diff --git a/.bowerrc b/.bowerrc index b6b594ac1..7dcff4cd0 100644 --- a/.bowerrc +++ b/.bowerrc @@ -1,3 +1,3 @@ { - "directory" : "./.bower_cache" + "directory" : "lib" } \ No newline at end of file diff --git a/.gitignore b/.gitignore index 4402ded75..829af25b5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ /lib/jasmine/ /lib/jasmine-jquery/ /lib/jquery/ -/.bower_cache/ \ No newline at end of file +/.bower_cache/ +/.sass-cache/ +/.grunt/ \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index cb1e5de45..9e7808950 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,10 +15,7 @@ module.exports = function(grunt) { style: "compact" }, files: { - 'build/css/intlTelInput.css': [ - 'src/css/intlTelInput.scss', - 'src/css/flags.scss' - ], + 'build/css/intlTelInput.css': 'src/css/intlTelInput.scss' } }, demo: { @@ -103,22 +100,17 @@ module.exports = function(grunt) { ], options: { vendor: [ - 'lib/jquery/jquery.js', - 'lib/jasmine-jquery/jasmine-jquery.js' + 'lib/jquery/dist/jquery.js', + 'lib/jasmine-jquery/lib/jasmine-jquery.js' ], helpers: [ 'src/spec/helpers/**/*.js' ], specs: [ 'src/spec/tests/**/*.js' - ] - } - }, - - // Asset libs - bower: { - install: { - // defaults are fine + ], + outfile: 'spec.html', + keepRunner: true } }, diff --git a/bower.json b/bower.json index 6c3bfeb45..9c8b31b56 100644 --- a/bower.json +++ b/bower.json @@ -10,7 +10,6 @@ "jquery": "^1.8.0" }, "devDependencies": { - "jasmine": "~1.3", - "jasmine-jquery": "~1.5" + "jasmine-jquery": "~2.0.2" } } \ No newline at end of file diff --git a/build/css/intlTelInput.css b/build/css/intlTelInput.css index 5f18edea4..385e6f7c7 100644 --- a/build/css/intlTelInput.css +++ b/build/css/intlTelInput.css @@ -1,30 +1,3 @@ -.intl-tel-input { position: relative; display: inline-block; } -.intl-tel-input .hide { display: none; } -.intl-tel-input .flag-dropdown { position: absolute; top: 0; bottom: 0; } -.intl-tel-input .flag-dropdown .selected-flag { z-index: 1; position: relative; } -.intl-tel-input .flag-dropdown .country-list { position: absolute; z-index: 2; } -.intl-tel-input .country-list { list-style: none; } -.intl-tel-input .country-list .flag { display: inline-block; } -.intl-tel-input .flag-dropdown:hover { cursor: pointer; } -.intl-tel-input input[disabled] + .flag-dropdown:hover { cursor: default; } -.intl-tel-input input { position: relative; z-index: 0; margin-top: 0 !important; margin-bottom: 0 !important; } -.intl-tel-input.pretty * { box-sizing: border-box; -moz-box-sizing: border-box; } -.intl-tel-input.pretty .flag-dropdown:hover .selected-flag { background-color: rgba(0, 0, 0, 0.05); } -.intl-tel-input.pretty input[disabled] + .flag-dropdown:hover .selected-flag { background-color: transparent; } -.intl-tel-input.pretty .flag-dropdown .selected-flag { width: 38px; height: 100%; padding: 0 0 0 8px; } -.intl-tel-input.pretty .flag-dropdown .selected-flag .flag { position: absolute; top: 50%; margin-top: -5px; } -.intl-tel-input.pretty .flag-dropdown .selected-flag .arrow { position: relative; top: 50%; margin-top: -2px; left: 20px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid #555555; } -.intl-tel-input.pretty .flag-dropdown .selected-flag .arrow.up { border-top: none; border-bottom: 4px solid #555555; } -.intl-tel-input.pretty .flag-dropdown .country-list { padding: 0; margin: 0 0 0 -1px; box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2); background-color: white; border: 1px solid #cccccc; width: 430px; max-height: 200px; overflow-y: scroll; } -.intl-tel-input.pretty .flag-dropdown .country-list .divider { padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px solid #cccccc; } -.intl-tel-input.pretty .flag-dropdown .country-list .country { line-height: 11px; padding: 7px 10px; } -.intl-tel-input.pretty .flag-dropdown .country-list .country .dial-code { color: #999999; } -.intl-tel-input.pretty .flag-dropdown .country-list .country.highlight { background-color: rgba(0, 0, 0, 0.05); } -.intl-tel-input.pretty .flag-dropdown .country-list .flag, .intl-tel-input.pretty .flag-dropdown .country-list .country-name { margin-right: 6px; } -.intl-tel-input.inside .flag-dropdown { padding: 1px; } -.intl-tel-input.inside input { padding-left: 44px; margin-left: 0; } -.intl-tel-input.outside input { border: none; margin-left: 38px; } - /** Originally from https://github.com/tkrotoff/famfamfam_flags Then converted to SCSS and simplified/optimised, and removed full country classes (as we only deal in 2 digit country codes) */ .intl-tel-input .flag { width: 16px; height: 11px; background: url("../img/flags.png"); } .intl-tel-input .zw { background-position: 0px 0px; } @@ -278,3 +251,30 @@ .intl-tel-input .ad { background-position: -208px -121px; } .intl-tel-input .np { background-position: -208px -132px; } .intl-tel-input .ch { background-position: -208px -143px; } + +.intl-tel-input { position: relative; display: inline-block; } +.intl-tel-input .hide { display: none; } +.intl-tel-input .flag-dropdown { position: absolute; top: 0; bottom: 0; } +.intl-tel-input .flag-dropdown .selected-flag { z-index: 1; position: relative; } +.intl-tel-input .flag-dropdown .country-list { position: absolute; z-index: 2; } +.intl-tel-input .country-list { list-style: none; } +.intl-tel-input .country-list .flag { display: inline-block; } +.intl-tel-input .flag-dropdown:hover { cursor: pointer; } +.intl-tel-input input[disabled] + .flag-dropdown:hover { cursor: default; } +.intl-tel-input input { position: relative; z-index: 0; margin-top: 0 !important; margin-bottom: 0 !important; } +.intl-tel-input.pretty * { box-sizing: border-box; -moz-box-sizing: border-box; } +.intl-tel-input.pretty .flag-dropdown:hover .selected-flag { background-color: rgba(0, 0, 0, 0.05); } +.intl-tel-input.pretty input[disabled] + .flag-dropdown:hover .selected-flag { background-color: transparent; } +.intl-tel-input.pretty .flag-dropdown .selected-flag { width: 38px; height: 100%; padding: 0 0 0 8px; } +.intl-tel-input.pretty .flag-dropdown .selected-flag .flag { position: absolute; top: 50%; margin-top: -5px; } +.intl-tel-input.pretty .flag-dropdown .selected-flag .arrow { position: relative; top: 50%; margin-top: -2px; left: 20px; width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid #555555; } +.intl-tel-input.pretty .flag-dropdown .selected-flag .arrow.up { border-top: none; border-bottom: 4px solid #555555; } +.intl-tel-input.pretty .flag-dropdown .country-list { padding: 0; margin: 0 0 0 -1px; box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2); background-color: white; border: 1px solid #cccccc; width: 430px; max-height: 200px; overflow-y: scroll; } +.intl-tel-input.pretty .flag-dropdown .country-list .divider { padding-bottom: 5px; margin-bottom: 5px; border-bottom: 1px solid #cccccc; } +.intl-tel-input.pretty .flag-dropdown .country-list .country { line-height: 11px; padding: 7px 10px; } +.intl-tel-input.pretty .flag-dropdown .country-list .country .dial-code { color: #999999; } +.intl-tel-input.pretty .flag-dropdown .country-list .country.highlight { background-color: rgba(0, 0, 0, 0.05); } +.intl-tel-input.pretty .flag-dropdown .country-list .flag, .intl-tel-input.pretty .flag-dropdown .country-list .country-name { margin-right: 6px; } +.intl-tel-input.inside .flag-dropdown { padding: 1px; } +.intl-tel-input.inside input { padding-left: 44px; margin-left: 0; } +.intl-tel-input.outside input { border: none; margin-left: 38px; } diff --git a/demo.html b/demo.html index 6a46a70ab..f9610b5ae 100644 --- a/demo.html +++ b/demo.html @@ -11,7 +11,7 @@

International Telephone Input

- + - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/src/css/intlTelInput.scss b/src/css/intlTelInput.scss index 81cb44a03..f105524b1 100644 --- a/src/css/intlTelInput.scss +++ b/src/css/intlTelInput.scss @@ -1,3 +1,5 @@ +@import 'flags'; + // rgba is needed for the selected flag hover state to blend in with // the border-highlighting some browsers give the input on focus $hoverColor: rgba(0, 0, 0, 0.05);