Compare commits

..

2 Commits

Author SHA1 Message Date
Benjamin Keen
0af74ffcc3 Update README.md 2014-08-29 07:16:41 -07:00
QuintinS
ca30d770e5 Named the initialising function.
Given the plugin’s function the name $.crs(), so it can now be called
on demand.
2014-08-29 12:15:40 +02:00
7 changed files with 414 additions and 415 deletions

View File

@ -1,4 +1,4 @@
## Country-Region-Selector ## Country-Region-Selector (CRS)
A common form feature is dynamic, connected country and region dropdowns, where the region field is updated to contain A common form feature is dynamic, connected country and region dropdowns, where the region field is updated to contain
whatever regions (provinces / states / territories / counties etc.) are appropriate for the selected country. It's super whatever regions (provinces / states / territories / counties etc.) are appropriate for the selected country. It's super
@ -82,21 +82,19 @@ If you want to edit the source code, go right ahead (pull requests welcome, of c
is found in the `/source` folder. To re-generate the minified version, just run the Grunt task. In case you're not is found in the `/source` folder. To re-generate the minified version, just run the Grunt task. In case you're not
familiar with Grunt, here's how you get that hooked up. familiar with Grunt, here's how you get that hooked up.
1. Install [Node](http://nodejs.org) on your computer. 1. Install [Node](http://nodejs.org).
2. Clone this repository to your local computer. 2. Clone this repository to your local computer.
3. In the command line, navigate to to the root of the cloned repo (i.e. the folder with this README file in it). 3. In the command line, navigate to the root of the cloned repo (i.e. the folder with this README file in it).
4. Type `npm install` to download all necessary require modules. 4. Type `npm install` to download all the necessary modules.
5. Type `npm install -g grunt-cli` to install the Grunt command line tool to run properly. 5. Type `npm install -g grunt-cli` to install the Grunt command line tool to run properly.
6. Type `grunt` 6. In the country-region-selector folder type `grunt` to run the Grunt command.
That will then re-generate the minified files in your ./source folder. That will then re-generate the minified files in your ./source folder.
### Changelog ### Changelog
- `0.1.3` - Feb 10, 2015. Updated Ukraine regions. - `0.1.1` - April 24, updated country list for ISO 3166 countries and short codes
- `0.1.2` - Nov 1, 2014. Fix for typo in UK counties list. - `0.1.0` - March 27, initial version
- `0.1.1` - April 24, 2014. Updated country list for ISO 3166 countries and short codes
- `0.1.0` - March 27, 2014. Initial version
### License ### License

View File

@ -1,6 +1,6 @@
{ {
"name": "country-region-selector", "name": "country-region-selector",
"version": "0.1.3", "version": "0.1.1",
"main": "source/crs.min.js", "main": "source/crs.min.js",
"license": "MIT", "license": "MIT",
"ignore": [ "ignore": [

View File

@ -1,6 +1,6 @@
{ {
"name": "country-region-dropdowns", "name": "country-region-dropdowns",
"version": "0.1.3", "version": "0.1.1",
"description": "A simple, configurable JS script that lets you add a country dropdown that automatically updates a corresponding region dropdown in your forms.", "description": "A simple, configurable JS script that lets you add a country dropdown that automatically updates a corresponding region dropdown in your forms.",
"main": "example.html", "main": "example.html",
"scripts": { "scripts": {

View File

@ -1,12 +1,15 @@
/** /**
* country-region-dropdowns * country-region-dropdowns
* ------------------------ * ------------------------
* v0.1.3 * v0.1.1
* @author Ben Keen * @author Ben Keen
* @url https://github.com/benkeen/country-region-dropdowns * @url https://github.com/benkeen/country-region-dropdowns
* @licence MIT * @licence MIT
*/ */
(function() { (function($) {
$.crs = function() {
"use strict"; "use strict";
var _countryClass = "crs-country"; var _countryClass = "crs-country";
@ -247,9 +250,9 @@
["Turks and Caicos Islands","TC","Turks and Caicos Islands"], ["Turks and Caicos Islands","TC","Turks and Caicos Islands"],
["Tuvalu","TV","Tuvalu"], ["Tuvalu","TV","Tuvalu"],
["Uganda","UG","Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibaleisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungirie|Soroti|Tororo"], ["Uganda","UG","Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibaleisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungirie|Soroti|Tororo"],
["Ukraine","UA","Cherkasy|Chernihiv|Chernivtsi|Dnipropetrovsk|Donetsk|Ivano-Frankivsk|Kharkiv|Kherson|Khmelnytskyi|Kiev|Kirovohrad|Luhansk|Lviv|Mykolaiv|Odessa|Poltava|Rivne|Sumy|Ternopil|Vinnytsia|Volyn|Zakarpattia|Zaporizhia|Zhytomyr"], ["Ukraine","UA","Avtonomna Respublika Krym (Simferopol')|Cherkas'ka (Cherkasy)|Chernihivs'ka (Chernihiv)|Chernivets'ka (Chernivtsi)|Dnipropetrovs'ka (Dnipropetrovs'kka (Donets'k)|Ivano-Frankivs'ka (Ivano-Frankivs'k)|Kharkivs'ka (Kharkiv)|Khersons'ka (Kherson)|Khmel'nyts'ka (Khmel'nyts'kyy)|Kirovohrads'ka (d)|Kyyiv|Kyyivs'ka (Kiev)|L'vivs'ka (L'viv)|Luhans'ka (Luhans'k)|Mykolayivs'ka (Mykolayiv)|Odes'ka (Odesa)|Poltavs'ka (Poltava)|Rivnens'ka (Rivne)ol'|Sums'ka (Sumy)|Ternopil's'ka (Ternopil')|Vinnyts'ka (Vinnytsya)|Volyns'ka (Luts'k)|Zakarpats'ka (Uzhhorod)|Zaporiz'ka (Zaporizhzhya)s'ka (Zhytomyr)"],
["United Arab Emirates","AE","'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn"], ["United Arab Emirates","AE","'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn"],
["United Kingdom","GB","Barking and Dagenham|Barnet|Barnsley|Bath and North East Somerset|Bedfordshire|Bexley|Birmingham|Blackburn with ackpool|Bolton|Bournemouth|Bracknell Forest|Bradford|Brent|Brighton and ley|Buckinghamshire|Bury|Calderdale|Cambridgeshire|Camden|Cheshire|City of Bristol|City of Kingston upon Hull|City of rnwall|Coventry|Croydon|Cumbria|Darlington|Derby|Derbyshire|Devon|Doncaster|Dorset|Dudley|Durham|Ealing|East Riding of Yorkshire|East field|Essex|Gateshead|Gloucestershire|Greenwich|Hackney|Halton|Hammersmith and mpshire|Haringey|Harrow|Hartlepool|Havering|Herefordshire|Hertfordshire|Hillingdon|Hounslow|Isle of Wight|Islington|Kensington and ent|Kingston upon Thames|Kirklees|Knowsley|Lambeth|Lancashire|Leeds|Leicester|Leicestershire|Lewisham|Lincolnshire|Liverpool|Luton|Manchester|Medway|Middlesbrough|Milton Keynes|Newcastle upon Tyne|Newham|Norfolk|North East Lincolnshire|North Lincolnshire|North Somerset|North Tyneside|North |Northamptonshire|Northumberland|Nottingham|Nottinghamshire|Oldham|Oxfordshire|Peterborough|Plymouth|Poole|Portsmouth|Reading|Redbridge|Redcar and |Richmond upon Thames|Rochdale|Rotherham|Rutland|Salford|Sandwell|Sefton|Sheffield|Shropshire|Slough|Solihull|Somerset|South Gloucestershire|South Southampton|Southend-on-Sea|Southwark|St. Helens|Staffordshire|Stockport|Stockton-on-Tees|Stoke-on-folk|Sunderland|Surrey|Sutton|Swindon|Tameside|Telford and Wrekin|Thurrock|Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham ndsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and d|Wirral|Wokingham|Wolverhampton|Worcestershire|York,Aberdeen City|Aberdeenshire|Angus|Argyll and Bute|City of Edinburgh|Clackmannanshire|Dumfries and Galloway|Dundee City|East Ayrshire|East shire|East Lothian|East Renfrewshire|Eilean Siar (Western Isles)|Falkirk|Fife|Glasgow City|Highland|Inverclyde|Midlothian|Moray|North Ayrshire|North re|Orkney Islands|Perth and Kinross|Renfrewshire|Shetland Islands|South Ayrshire|South Lanarkshire|Stirling|The Scottish Borders|West shire|West Lothian"], ["United Kingdom","GB","Barking and Dagenham|Barnet|Barnsley|Bath and North East Somerset|Bedfordshire|Bexley|Birmingham|Blackburn with ackpool|Bolton|Bournemouth|Bracknell Forest|Bradford|Brent|Brighton and ley|Buckinghamshire|Bury|Calderdale|Cambridgeshire|Camden|Cheshire|City of Bristol|City of Kingston upon Hull|City of rnwall|Coventry|Croydon|Cumbria|Darlington|Derby|Derbyshire|Devon|Doncaster|Dorset|Dudley|Durham|Ealing|East Riding of Yorkshire|East field|Essex|Gateshead|Gloucestershire|Greenwich|Hackney|Halton|Hammersmith and mpshire|Haringey|Harrow|Hartlepool|Havering|Herefordshire|Hertfordshire|Hillingdon|Hounslow|Isle of Wight|Islington|Kensington and ent|Kingston upon Thames|Kirklees|Knowsley|Lambeth|Lancashire|Leeds|Leicester|Leicestershire|Lewisham|Lincolnshire|Liverpool|Luton|Manchester|Medway|ddlesbrough|Milton Keynes|Newcastle upon Tyne|Newham|Norfolk|North East Lincolnshire|North Lincolnshire|North Somerset|North Tyneside|North |Northamptonshire|Northumberland|Nottingham|Nottinghamshire|Oldham|Oxfordshire|Peterborough|Plymouth|Poole|Portsmouth|Reading|Redbridge|Redcar and |Richmond upon Thames|Rochdale|Rotherham|Rutland|Salford|Sandwell|Sefton|Sheffield|Shropshire|Slough|Solihull|Somerset|South Gloucestershire|South Southampton|Southend-on-Sea|Southwark|St. Helens|Staffordshire|Stockport|Stockton-on-Tees|Stoke-on-folk|Sunderland|Surrey|Sutton|Swindon|Tameside|Telford and Wrekin|Thurrock|Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham ndsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and d|Wirral|Wokingham|Wolverhampton|Worcestershire|York,Aberdeen City|Aberdeenshire|Angus|Argyll and Bute|City of Edinburgh|Clackmannanshire|Dumfries and Galloway|Dundee City|East Ayrshire|East shire|East Lothian|East Renfrewshire|Eilean Siar (Western Isles)|Falkirk|Fife|Glasgow City|Highland|Inverclyde|Midlothian|Moray|North Ayrshire|North re|Orkney Islands|Perth and Kinross|Renfrewshire|Shetland Islands|South Ayrshire|South Lanarkshire|Stirling|The Scottish Borders|West shire|West Lothian"],
["United States","US","Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming"], ["United States","US","Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming"],
["United States Minor Outlying Islands","UM","Wake Island|Johnston Atoll|Midway Atoll|Kingman Reef|Palmyra Atoll|Jarvis Island|Baker Island|Howland Island|Navassa Island|Bajo Nuevo Bank|Serranilla Bank"], ["United States Minor Outlying Islands","UM","Wake Island|Johnston Atoll|Midway Atoll|Kingman Reef|Palmyra Atoll|Jarvis Island|Baker Island|Howland Island|Navassa Island|Bajo Nuevo Bank|Serranilla Bank"],
["Uruguay","UY","Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandú|Río Negro|Rivera|Rocha|Salto|San José|Soriano|Tacuaremb|Treinta"], ["Uruguay","UY","Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandú|Río Negro|Rivera|Rocha|Salto|San José|Soriano|Tacuaremb|Treinta"],
@ -412,4 +415,6 @@
// when the page has loaded, run our init function // when the page has loaded, run our init function
_contentLoaded(window, _init); _contentLoaded(window, _init);
}
})(); })();

2
source/crs.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
/** /**
* country-region-dropdowns * country-region-dropdowns
* ------------------------ * ------------------------
* v0.1.2 * v0.1.1
* @author Ben Keen * @author Ben Keen
* @url https://github.com/benkeen/country-region-dropdowns * @url https://github.com/benkeen/country-region-dropdowns
* @licence MIT * @licence MIT
@ -12,8 +12,6 @@
var _countryClass = "crs-country"; var _countryClass = "crs-country";
var _defaultCountryStr = "Select country"; var _defaultCountryStr = "Select country";
var _defaultRegionStr = "Select region"; var _defaultRegionStr = "Select region";
var _defaultCountryValue = null;
var _defaultRegionValue = null;
// originally an object, but converted to an array to reduce size // originally an object, but converted to an array to reduce size
var _data = [ var _data = [
@ -249,9 +247,9 @@
["Turks and Caicos Islands","TC","Turks and Caicos Islands"], ["Turks and Caicos Islands","TC","Turks and Caicos Islands"],
["Tuvalu","TV","Tuvalu"], ["Tuvalu","TV","Tuvalu"],
["Uganda","UG","Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibaleisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungirie|Soroti|Tororo"], ["Uganda","UG","Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibaleisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungirie|Soroti|Tororo"],
["Ukraine","UA","Cherkasy|Chernihiv|Chernivtsi|Dnipropetrovsk|Donetsk|Ivano-Frankivsk|Kharkiv|Kherson|Khmelnytskyi|Kiev|Kirovohrad|Luhansk|Lviv|Mykolaiv|Odessa|Poltava|Rivne|Sumy|Ternopil|Vinnytsia|Volyn|Zakarpattia|Zaporizhia|Zhytomyr"], ["Ukraine","UA","Avtonomna Respublika Krym (Simferopol')|Cherkas'ka (Cherkasy)|Chernihivs'ka (Chernihiv)|Chernivets'ka (Chernivtsi)|Dnipropetrovs'ka (Dnipropetrovs'kka (Donets'k)|Ivano-Frankivs'ka (Ivano-Frankivs'k)|Kharkivs'ka (Kharkiv)|Khersons'ka (Kherson)|Khmel'nyts'ka (Khmel'nyts'kyy)|Kirovohrads'ka (d)|Kyyiv|Kyyivs'ka (Kiev)|L'vivs'ka (L'viv)|Luhans'ka (Luhans'k)|Mykolayivs'ka (Mykolayiv)|Odes'ka (Odesa)|Poltavs'ka (Poltava)|Rivnens'ka (Rivne)ol'|Sums'ka (Sumy)|Ternopil's'ka (Ternopil')|Vinnyts'ka (Vinnytsya)|Volyns'ka (Luts'k)|Zakarpats'ka (Uzhhorod)|Zaporiz'ka (Zaporizhzhya)s'ka (Zhytomyr)"],
["United Arab Emirates","AE","'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn"], ["United Arab Emirates","AE","'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn"],
["United Kingdom","GB","Barking and Dagenham|Barnet|Barnsley|Bath and North East Somerset|Bedfordshire|Bexley|Birmingham|Blackburn with ackpool|Bolton|Bournemouth|Bracknell Forest|Bradford|Brent|Brighton and ley|Buckinghamshire|Bury|Calderdale|Cambridgeshire|Camden|Cheshire|City of Bristol|City of Kingston upon Hull|City of rnwall|Coventry|Croydon|Cumbria|Darlington|Derby|Derbyshire|Devon|Doncaster|Dorset|Dudley|Durham|Ealing|East Riding of Yorkshire|East field|Essex|Gateshead|Gloucestershire|Greenwich|Hackney|Halton|Hammersmith and mpshire|Haringey|Harrow|Hartlepool|Havering|Herefordshire|Hertfordshire|Hillingdon|Hounslow|Isle of Wight|Islington|Kensington and ent|Kingston upon Thames|Kirklees|Knowsley|Lambeth|Lancashire|Leeds|Leicester|Leicestershire|Lewisham|Lincolnshire|Liverpool|Luton|Manchester|Medway|Middlesbrough|Milton Keynes|Newcastle upon Tyne|Newham|Norfolk|North East Lincolnshire|North Lincolnshire|North Somerset|North Tyneside|North |Northamptonshire|Northumberland|Nottingham|Nottinghamshire|Oldham|Oxfordshire|Peterborough|Plymouth|Poole|Portsmouth|Reading|Redbridge|Redcar and |Richmond upon Thames|Rochdale|Rotherham|Rutland|Salford|Sandwell|Sefton|Sheffield|Shropshire|Slough|Solihull|Somerset|South Gloucestershire|South Southampton|Southend-on-Sea|Southwark|St. Helens|Staffordshire|Stockport|Stockton-on-Tees|Stoke-on-folk|Sunderland|Surrey|Sutton|Swindon|Tameside|Telford and Wrekin|Thurrock|Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham ndsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and d|Wirral|Wokingham|Wolverhampton|Worcestershire|York,Aberdeen City|Aberdeenshire|Angus|Argyll and Bute|City of Edinburgh|Clackmannanshire|Dumfries and Galloway|Dundee City|East Ayrshire|East shire|East Lothian|East Renfrewshire|Eilean Siar (Western Isles)|Falkirk|Fife|Glasgow City|Highland|Inverclyde|Midlothian|Moray|North Ayrshire|North re|Orkney Islands|Perth and Kinross|Renfrewshire|Shetland Islands|South Ayrshire|South Lanarkshire|Stirling|The Scottish Borders|West shire|West Lothian"], ["United Kingdom","GB","Barking and Dagenham|Barnet|Barnsley|Bath and North East Somerset|Bedfordshire|Bexley|Birmingham|Blackburn with ackpool|Bolton|Bournemouth|Bracknell Forest|Bradford|Brent|Brighton and ley|Buckinghamshire|Bury|Calderdale|Cambridgeshire|Camden|Cheshire|City of Bristol|City of Kingston upon Hull|City of rnwall|Coventry|Croydon|Cumbria|Darlington|Derby|Derbyshire|Devon|Doncaster|Dorset|Dudley|Durham|Ealing|East Riding of Yorkshire|East field|Essex|Gateshead|Gloucestershire|Greenwich|Hackney|Halton|Hammersmith and mpshire|Haringey|Harrow|Hartlepool|Havering|Herefordshire|Hertfordshire|Hillingdon|Hounslow|Isle of Wight|Islington|Kensington and ent|Kingston upon Thames|Kirklees|Knowsley|Lambeth|Lancashire|Leeds|Leicester|Leicestershire|Lewisham|Lincolnshire|Liverpool|Luton|Manchester|Medway|ddlesbrough|Milton Keynes|Newcastle upon Tyne|Newham|Norfolk|North East Lincolnshire|North Lincolnshire|North Somerset|North Tyneside|North |Northamptonshire|Northumberland|Nottingham|Nottinghamshire|Oldham|Oxfordshire|Peterborough|Plymouth|Poole|Portsmouth|Reading|Redbridge|Redcar and |Richmond upon Thames|Rochdale|Rotherham|Rutland|Salford|Sandwell|Sefton|Sheffield|Shropshire|Slough|Solihull|Somerset|South Gloucestershire|South Southampton|Southend-on-Sea|Southwark|St. Helens|Staffordshire|Stockport|Stockton-on-Tees|Stoke-on-folk|Sunderland|Surrey|Sutton|Swindon|Tameside|Telford and Wrekin|Thurrock|Torbay|Tower Hamlets|Trafford|Wakefield|Walsall|Waltham ndsworth|Warrington|Warwickshire|West Berkshire|West Sussex|Westminster|Wigan|Wiltshire|Windsor and d|Wirral|Wokingham|Wolverhampton|Worcestershire|York,Aberdeen City|Aberdeenshire|Angus|Argyll and Bute|City of Edinburgh|Clackmannanshire|Dumfries and Galloway|Dundee City|East Ayrshire|East shire|East Lothian|East Renfrewshire|Eilean Siar (Western Isles)|Falkirk|Fife|Glasgow City|Highland|Inverclyde|Midlothian|Moray|North Ayrshire|North re|Orkney Islands|Perth and Kinross|Renfrewshire|Shetland Islands|South Ayrshire|South Lanarkshire|Stirling|The Scottish Borders|West shire|West Lothian"],
["United States","US","Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming"], ["United States","US","Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming"],
["United States Minor Outlying Islands","UM","Wake Island|Johnston Atoll|Midway Atoll|Kingman Reef|Palmyra Atoll|Jarvis Island|Baker Island|Howland Island|Navassa Island|Bajo Nuevo Bank|Serranilla Bank"], ["United States Minor Outlying Islands","UM","Wake Island|Johnston Atoll|Midway Atoll|Kingman Reef|Palmyra Atoll|Jarvis Island|Baker Island|Howland Island|Navassa Island|Bajo Nuevo Bank|Serranilla Bank"],
["Uruguay","UY","Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandú|Río Negro|Rivera|Rocha|Salto|San José|Soriano|Tacuaremb|Treinta"], ["Uruguay","UY","Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandú|Río Negro|Rivera|Rocha|Salto|San José|Soriano|Tacuaremb|Treinta"],
@ -276,12 +274,11 @@
var _populateCountryFields = function() { var _populateCountryFields = function() {
var countryElement = this; var countryElement = this;
_defaultCountryValue = $(countryElement).val();
countryElement.length = 0; countryElement.length = 0;
var customOptionStr = $(countryElement).attr("data-default-option"); var customOptionStr = $(countryElement).attr("data-default-option");
var defaultOptionStr = customOptionStr ? customOptionStr : _defaultCountryStr; var defaultOptionStr = customOptionStr ? customOptionStr : _defaultCountryStr;
var defaultSelectedValue = _defaultCountryValue ? _defaultCountryValue : $(countryElement).attr("data-default-value"); var defaultSelectedValue = $(countryElement).attr("data-default-value");
var customValue = $(countryElement).attr("data-value"); var customValue = $(countryElement).attr("data-value");
var foundIndex = 0; var foundIndex = 0;
@ -310,7 +307,7 @@
if (defaultSelectedValue) { if (defaultSelectedValue) {
_populateRegionFields(countryElement, regionElement); _populateRegionFields(countryElement, regionElement);
var defaultRegionSelectedValue = _defaultRegionValue ? _defaultRegionValue : $(regionElement).attr("data-default-value"); var defaultRegionSelectedValue = $(regionElement).attr("data-default-value");
if (defaultRegionSelectedValue !== null) { if (defaultRegionSelectedValue !== null) {
var data = _data[countryElement.selectedIndex-1][2].split("|"); var data = _data[countryElement.selectedIndex-1][2].split("|");
_setDefaultRegionValue(regionElement, data, defaultRegionSelectedValue); _setDefaultRegionValue(regionElement, data, defaultRegionSelectedValue);
@ -323,7 +320,6 @@
}; };
var _initRegionField = function(el) { var _initRegionField = function(el) {
_defaultRegionValue = $(el).val();
var customOptionStr = $(el).attr("data-blank-option"); var customOptionStr = $(el).attr("data-blank-option");
var defaultOptionStr = customOptionStr ? customOptionStr : "-"; var defaultOptionStr = customOptionStr ? customOptionStr : "-";
el.length = 0; el.length = 0;

File diff suppressed because one or more lines are too long