intl_phone_picker 0.0.7.1 → 0.0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +9 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +45 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +23 -0
- data/README.md +101 -0
- data/Rakefile +9 -0
- data/TODO.md +2 -0
- data/app/assets/images/flags.png +0 -0
- data/app/assets/images/flags@2x.png +0 -0
- data/app/assets/javascripts/intlTelInput.js +1183 -0
- data/app/assets/javascripts/intlTelInputLang.js +43 -0
- data/app/assets/stylesheets/intlTelInput.scss +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/config/locales/fr.yml +234 -0
- data/config/locales/us.yml +231 -0
- data/intl_phone_picker.gemspec +29 -0
- data/lib/intl_phone_picker/activerecord_helpers.rb +16 -0
- data/lib/intl_phone_picker/railtie.rb +13 -0
- data/lib/intl_phone_picker/version.rb +3 -0
- data/lib/intl_phone_picker/view_helpers.rb +18 -0
- data/lib/intl_phone_picker.rb +18 -0
- data/test/test_helper.rb +4 -0
- data/vendor/assets/javascripts/libphonenumber/utils.js +481 -0
- metadata +27 -2
@@ -0,0 +1,43 @@
|
|
1
|
+
$(document).on("ready page:load", function(e) {
|
2
|
+
|
3
|
+
var countryData = $.fn.intlTelInput.getCountryData();
|
4
|
+
|
5
|
+
if ($(".intl_phone_input_fr").get(0)) {
|
6
|
+
// Use french dictionnary
|
7
|
+
var hashCountryDataTranslationFrench = {"af":"Afghanistan (افغانستان)","al":"Albanie (Shqipëri)","dz":"Algérie (الجزائر)","as":"Samoa américaines (American Samoa)","ad":"Andorre (Andorra)","ao":"Angola","ai":"Anguilla","ag":"Antigua-et-Barbuda (Antigua and Barbuda)","ar":"Argentine (Argentina)","am":"Arménie (Հայաստան)","aw":"Aruba","au":"Australie (Australia)","at":"Autriche (Österreich)","az":"Azerbaïdjan (Azərbaycan)","bs":"Bahamas","bh":"Bahreïn (البحرين)","bd":"Bangladesh (বাংলাদেশ)","bb":"Barbade (Barbados)","by":"Biélorussie (Беларусь)","be":"Belgique (België)","bz":"Belize","bj":"Bénin","bm":"Bermudes (Bermuda)","bt":"Bhoutan (འབྲུག)","bo":"Bolivie (Bolivia)","ba":"Bosnie-Herzégovine (Босна и Херцеговина)","bw":"Botswana","br":"Brésil (Brasil)","io":"Territoire britannique de l’océan Indien (British Indian Ocean Territory)","vg":"Îles Vierges britanniques (British Virgin Islands)","bn":"Brunei","bg":"Bulgarie (България)","bf":"Burkina Faso","bi":"Burundi (Uburundi)","kh":"Cambodge (កម្ពុជា)","cm":"Cameroun","ca":"Canada","cv":"Cap-Vert (Kabu Verdi)","bq":"Bonaire, Saint-Eustache et Saba (Caribbean Netherlands)","ky":"Îles Caïmans (Cay Islands)","cf":"République centrafricaine","td":"Tchad","cl":"Chili (Chile)","cn":"Chine (中国)","co":"Colombie (Colombia)","km":"Comores (جزر القمر)","cd":"République démocratique du Congo (Jamhuri ya Kidemokrasia ya Kongo)","cg":"République du Congo / (Congo) (Congo-Brazzaville)","ck":"Îles Cook (Cook Islands)","cr":"Costa Rica","ci":"Côte d’Ivoire","hr":"Croatie (Hrvatska)","cu":"Cuba","cw":"Curaçao","cy":"Chypre (Κύπρος)","cz":"République tchèque (Česká republika)","dk":"Danemark (Danmark)","dj":"Djibouti","dm":"Dominique (Dominica)","do":"République dominicaine (República Dominicana)","ec":"Équateur (Ecuador)","eg":"Égypte (مصر)","sv":"Salvador (El Salvador)","gq":"Guinée équatoriale (Guinea Ecuatorial)","er":"Érythrée (Eritrea)","ee":"Estonie (Eesti)","et":"Éthiopie (Ethiopia)","fk":"Îles Malouines (Islas Malvinas)","fo":"Îles Féroé (Føroyar)","fj":"Fidji (Fiji)","fi":"Finlande (Suomi)","fr":"France","gf":"Guyane (Guyane française)","pf":"Polynésie française","ga":"Gabon","gm":"Gambie (Gambia)","ge":"Géorgie (საქართველო)","de":"Allemagne (Deutschland)","gh":"Ghana (Gaana)","gi":"Gibraltar","gr":"Grèce (Ελλάδα)","gl":"Groenland (Kalaallit Nunaat)","gd":"Grenade (Grenada)","gp":"Guadeloupe","gu":"Guam","gt":"Guatemala","gn":"Guinée","gw":"Guinée-Bissau (República da Guiné-Bissau)","gy":"Guyana","ht":"Haïti (Haiti)","hn":"Honduras","hk":"Hong Kong (香港)","hu":"Hongrie (Magyarország)","is":"Islande (Ísland)","in":"Inde (भारत)","id":"Indonésie (Indonesia)","ir":"Iran (ایران)","iq":"Irak (العراق)","ie":"Irlande (Ireland)","il":"Israël (ישראל)","it":"Italie (Italia)","jm":"Jamaïque (Jamaica)","jp":"Japon (日本)","jo":"Jordanie (الأردن)","kz":"Kazakhstan (Казахстан)","ke":"Kenya","ki":"Kiribati","kw":"Koweït (الكويت)","kg":"Kirghizistan (Кыргызстан)","la":"Laos (ລາວ)","lv":"Lettonie (Latvija)","lb":"Liban (لبنان)","ls":"Lesotho","lr":"Liberia","ly":"Libye (ليبيا)","li":"Liechtenstein","lt":"Lituanie (Lietuva)","lu":"Luxembourg","mo":"Macao (澳門)","mk":"Macédoine (Македонија)","mg":"Madagascar (Madagasikara)","mw":"Malawi","my":"Malaisie (Malaysia)","mv":"Maldives","ml":"Mali","mt":"Malte (Malta)","mh":"Marshall (Marshall Islands)","mq":"Martinique","mr":"Mauritanie (موريتانيا)","mu":"Maurice (Moris)","mx":"Mexique (México)","fm":"Micronésie (Micronesia)","md":"Moldavie (Republica Moldova)","mc":"Monaco","mn":"Mongolie (Монгол)","me":"Monténégro (Crna Gora)","ms":"Montserrat","ma":"Maroc (المغرب)","mz":"Mozambique (Moçambique)","mm":"Birmanie (မြန်မာ)","na":"Namibie (Namibië)","nr":"Nauru","np":"Népal (नेपाल)","nl":"Pays-Bas (Nederland)","nc":"Nouvelle-Calédonie","nz":"Nouvelle-Zélande (New Zealand)","ni":"Nicaragua","ne":"Niger (Nijar)","ng":"Nigeria","nu":"Niue","nf":"Île Norfolk (Norfolk Island)","kp":"Corée du Nord (조선 민주주의 인민 공화국)","mp":"Îles Mariannes du Nord (Northern Mariana Islands)","no":"Norvège (Norge)","om":"Oman (عُمان)","pk":"Pakistan (پاکستان)","pw":"Palaos (Palau)","ps":"Autorité palestinienne (فلسطين)","pa":"Panama (Panamá)","pg":"Papouasie-Nouvelle-Guinée (Papua New Guinea)","py":"Paraguay","pe":"Pérou (Perú)","ph":"Philippines","pl":"Pologne (Polska)","pt":"Portugal","pr":"Porto Rico (Puerto Rico)","qa":"Qatar (قطر)","re":"La Réunion","ro":"Roumanie (România)","ru":"Russie (Россия)","rw":"Rwanda","bl":"Saint-Barthélemy","sh":"Sainte-Hélène, Ascension et Tristan da Cunha (Saint Helena)","kn":"Saint-Christophe-et-Niévès (Saint Kitts and Nevis)","lc":"Sainte-Lucie (Saint Lucia)","mf":"Saint-Martin (Antilles françaises) (partie française))","pm":"Saint-Pierre-et-Miquelon","vc":"Saint-Vincent-et-les-Grenadines (Saint Vincent and the Grenadines)","ws":"Samoa","sm":"Saint-Marin (San Marino)","st":"Sao Tomé-et-Principe (São Tomé e Príncipe)","sa":"Arabie saoudite (المملكة العربية السعودية)","sn":"Sénégal","rs":"Serbie (Србија)","sc":"Seychelles","sl":"Sierra Leone","sg":"Singapour (Singapore)","sx":"Saint-Martin (Sint Maarten)","sk":"Slovaquie (Slovensko)","si":"Slovénie (Slovenija)","sb":"Salomon (Solomon Islands)","so":"Somalie (Soomaaliya)","za":"Afrique du Sud (South Africa)","kr":"Corée du Sud (대한민국)","ss":"Soudan du Sud (جنوب السودان)","es":"Espagne (España)","lk":"Sri Lanka (ශ්රී ලංකාව)","sd":"Soudan (السودان)","sr":"Suriname","sz":"Swaziland","se":"Suède (Sverige)","ch":"Suisse (Schweiz)","sy":"Syrie (سوريا)","tw":"Taïwan / (République de Chine (Taïwan)) (台灣)","tj":"Tadjikistan (Tajikistan)","tz":"Tanzanie (Tanzania)","th":"Thaïlande (ไทย)","tl":"Timor oriental (Timor-Leste)","tg":"Togo","tk":"Tokelau","to":"Tonga","tt":"Trinité-et-Tobago (Trinidad and Tobago)","tn":"Tunisie (تونس)","tr":"Turquie (Türkiye)","tm":"Turkménistan (Turkmenistan)","tc":"Îles Turques-et-Caïques (Turks and Caicos Islands)","tv":"Tuvalu","vi":"Îles Vierges des États-Unis (U.S. Virgin Islands)","ug":"Ouganda (Uganda)","ua":"Ukraine (Україна)","ae":"Émirats arabes unis (الإمارات العربية المتحدة)","gb":"Royaume-Uni (United Kingdom)","us":"États-Unis (United States)","uy":"Uruguay","uz":"Ouzbékistan (Oʻzbekiston)","vu":"Vanuatu","va":"État de la Cité du Vatican (Città del Vaticano)","ve":"Venezuela","vn":"Viêt Nam (Việt Nam)","wf":"Wallis-et-Futuna (Wallis and Futuna)","ye":"Yémen (اليمن)","zm":"Zambie (Zambia)","zw":"Zimbabwe"};
|
8
|
+
|
9
|
+
$.each(countryData, function(i, country) {
|
10
|
+
country.name = hashCountryDataTranslationFrench[country.iso2];
|
11
|
+
});
|
12
|
+
}
|
13
|
+
|
14
|
+
$(".intl_phone_input_fr").intlTelInput({
|
15
|
+
defaultCountry: "fr",
|
16
|
+
preferredCountries: ['fr', 'be', 'ch', 'lu', 'ca', 'mc'],
|
17
|
+
nationalMode: true
|
18
|
+
});
|
19
|
+
|
20
|
+
$(".intl_phone_input_us").intlTelInput({
|
21
|
+
defaultCountry: "us",
|
22
|
+
nationalMode: true
|
23
|
+
});
|
24
|
+
|
25
|
+
// http://jackocnr.com/lib/intl-tel-input/examples/gen/hidden-input.html
|
26
|
+
$("input[type='hidden'][data-phone-field]").each(function() {
|
27
|
+
var hidden_input = $(this);
|
28
|
+
var visible_input = $("input[type='tel'][name='" + $(this).data('phone-field') + "']");
|
29
|
+
|
30
|
+
// Set international phones values into hidden fields by default
|
31
|
+
hidden_input.val(visible_input.intlTelInput("getNumber"));
|
32
|
+
|
33
|
+
// Update hidden field when visible one change
|
34
|
+
visible_input.on('change', function() {
|
35
|
+
hidden_input.val(visible_input.intlTelInput("getNumber"));
|
36
|
+
})
|
37
|
+
|
38
|
+
// update the hidden input on submit
|
39
|
+
hidden_input.closest('form').submit(function() {
|
40
|
+
hidden_input.val(visible_input.intlTelInput("getNumber"));
|
41
|
+
});
|
42
|
+
});
|
43
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
.intl-tel-input{position:relative;display:inline-block}.intl-tel-input *{box-sizing:border-box;-moz-box-sizing:border-box}.intl-tel-input .hide{display:none}.intl-tel-input .v-hide{visibility:hidden}.intl-tel-input input,.intl-tel-input input[type=text],.intl-tel-input input[type=tel]{position:relative;z-index:0;margin-top:0 !important;margin-bottom:0 !important;padding-left:48px;margin-left:0;transition:background-color 100ms ease-out}.intl-tel-input input.iti-invalid-key{transition:background-color 0;background-color:#FFC7C7}.intl-tel-input .flag-dropdown{position:absolute;top:0;bottom:0;padding:1px}.intl-tel-input .flag-dropdown:hover{cursor:pointer}.intl-tel-input .flag-dropdown:hover .selected-flag{background-color:rgba(0,0,0,0.05)}.intl-tel-input input[disabled]+.flag-dropdown:hover,.intl-tel-input input[readonly]+.flag-dropdown:hover{cursor:default}.intl-tel-input input[disabled]+.flag-dropdown:hover .selected-flag,.intl-tel-input input[readonly]+.flag-dropdown:hover .selected-flag{background-color:transparent}.intl-tel-input .selected-flag{z-index:1;position:relative;width:42px;height:100%;padding:0 0 0 8px}.intl-tel-input .selected-flag .iti-flag{position:absolute;top:0;bottom:0;margin:auto}.intl-tel-input .selected-flag .arrow{position:absolute;top:50%;margin-top:-2px;right:4px;width:0;height:0;border-left:3px solid transparent;border-right:3px solid transparent;border-top:4px solid #555}.intl-tel-input .selected-flag .arrow.up{border-top:none;border-bottom:4px solid #555}.intl-tel-input .country-list{list-style:none;position:absolute;z-index:2;padding:0;margin:0 0 0 -1px;box-shadow:1px 1px 4px rgba(0,0,0,0.2);background-color:white;border:1px solid #CCC;white-space:nowrap;max-height:200px;overflow-y:scroll}.intl-tel-input .country-list .flag{display:inline-block;width:20px}@media (max-width: 500px){.intl-tel-input .country-list{white-space:normal}}.intl-tel-input .country-list .divider{padding-bottom:5px;margin-bottom:5px;border-bottom:1px solid #CCC}.intl-tel-input .country-list .country{padding:5px 10px}.intl-tel-input .country-list .country .dial-code{color:#999}.intl-tel-input .country-list .country.highlight{background-color:rgba(0,0,0,0.05)}.intl-tel-input .country-list .flag,.intl-tel-input .country-list .country-name,.intl-tel-input .country-list .dial-code{vertical-align:middle}.intl-tel-input .country-list .flag,.intl-tel-input .country-list .country-name{margin-right:6px}.intl-tel-input select{position:absolute;top:0;left:0;z-index:1;width:42px;height:100%;opacity:0}.iti-flag{width:20px}.iti-flag.be{width:18px}.iti-flag.ch{width:15px}.iti-flag.mc{width:19px}.iti-flag.ne{width:18px}.iti-flag.np{width:13px}.iti-flag.va{width:15px}@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx){.iti-flag{background-size:5630px 15px}}.iti-flag.ac{height:10px;background-position:0px 0px}.iti-flag.ad{height:14px;background-position:-22px 0px}.iti-flag.ae{height:10px;background-position:-44px 0px}.iti-flag.af{height:14px;background-position:-66px 0px}.iti-flag.ag{height:14px;background-position:-88px 0px}.iti-flag.ai{height:10px;background-position:-110px 0px}.iti-flag.al{height:15px;background-position:-132px 0px}.iti-flag.am{height:10px;background-position:-154px 0px}.iti-flag.ao{height:14px;background-position:-176px 0px}.iti-flag.aq{height:14px;background-position:-198px 0px}.iti-flag.ar{height:13px;background-position:-220px 0px}.iti-flag.as{height:10px;background-position:-242px 0px}.iti-flag.at{height:14px;background-position:-264px 0px}.iti-flag.au{height:10px;background-position:-286px 0px}.iti-flag.aw{height:14px;background-position:-308px 0px}.iti-flag.ax{height:13px;background-position:-330px 0px}.iti-flag.az{height:10px;background-position:-352px 0px}.iti-flag.ba{height:10px;background-position:-374px 0px}.iti-flag.bb{height:14px;background-position:-396px 0px}.iti-flag.bd{height:12px;background-position:-418px 0px}.iti-flag.be{height:15px;background-position:-440px 0px}.iti-flag.bf{height:14px;background-position:-460px 0px}.iti-flag.bg{height:12px;background-position:-482px 0px}.iti-flag.bh{height:12px;background-position:-504px 0px}.iti-flag.bi{height:12px;background-position:-526px 0px}.iti-flag.bj{height:14px;background-position:-548px 0px}.iti-flag.bl{height:14px;background-position:-570px 0px}.iti-flag.bm{height:10px;background-position:-592px 0px}.iti-flag.bn{height:10px;background-position:-614px 0px}.iti-flag.bo{height:14px;background-position:-636px 0px}.iti-flag.bq{height:14px;background-position:-658px 0px}.iti-flag.br{height:14px;background-position:-680px 0px}.iti-flag.bs{height:10px;background-position:-702px 0px}.iti-flag.bt{height:14px;background-position:-724px 0px}.iti-flag.bv{height:15px;background-position:-746px 0px}.iti-flag.bw{height:14px;background-position:-768px 0px}.iti-flag.by{height:10px;background-position:-790px 0px}.iti-flag.bz{height:14px;background-position:-812px 0px}.iti-flag.ca{height:10px;background-position:-834px 0px}.iti-flag.cc{height:10px;background-position:-856px 0px}.iti-flag.cd{height:15px;background-position:-878px 0px}.iti-flag.cf{height:14px;background-position:-900px 0px}.iti-flag.cg{height:14px;background-position:-922px 0px}.iti-flag.ch{height:15px;background-position:-944px 0px}.iti-flag.ci{height:14px;background-position:-961px 0px}.iti-flag.ck{height:10px;background-position:-983px 0px}.iti-flag.cl{height:14px;background-position:-1005px 0px}.iti-flag.cm{height:14px;background-position:-1027px 0px}.iti-flag.cn{height:14px;background-position:-1049px 0px}.iti-flag.co{height:14px;background-position:-1071px 0px}.iti-flag.cp{height:14px;background-position:-1093px 0px}.iti-flag.cr{height:12px;background-position:-1115px 0px}.iti-flag.cu{height:10px;background-position:-1137px 0px}.iti-flag.cv{height:12px;background-position:-1159px 0px}.iti-flag.cw{height:14px;background-position:-1181px 0px}.iti-flag.cx{height:10px;background-position:-1203px 0px}.iti-flag.cy{height:14px;background-position:-1225px 0px}.iti-flag.cz{height:14px;background-position:-1247px 0px}.iti-flag.de{height:12px;background-position:-1269px 0px}.iti-flag.dg{height:10px;background-position:-1291px 0px}.iti-flag.dj{height:14px;background-position:-1313px 0px}.iti-flag.dk{height:15px;background-position:-1335px 0px}.iti-flag.dm{height:10px;background-position:-1357px 0px}.iti-flag.do{height:13px;background-position:-1379px 0px}.iti-flag.dz{height:14px;background-position:-1401px 0px}.iti-flag.ea{height:14px;background-position:-1423px 0px}.iti-flag.ec{height:14px;background-position:-1445px 0px}.iti-flag.ee{height:13px;background-position:-1467px 0px}.iti-flag.eg{height:14px;background-position:-1489px 0px}.iti-flag.eh{height:10px;background-position:-1511px 0px}.iti-flag.er{height:10px;background-position:-1533px 0px}.iti-flag.es{height:14px;background-position:-1555px 0px}.iti-flag.et{height:10px;background-position:-1577px 0px}.iti-flag.eu{height:14px;background-position:-1599px 0px}.iti-flag.fi{height:12px;background-position:-1621px 0px}.iti-flag.fj{height:10px;background-position:-1643px 0px}.iti-flag.fk{height:10px;background-position:-1665px 0px}.iti-flag.fm{height:11px;background-position:-1687px 0px}.iti-flag.fo{height:15px;background-position:-1709px 0px}.iti-flag.fr{height:14px;background-position:-1731px 0px}.iti-flag.ga{height:15px;background-position:-1753px 0px}.iti-flag.gb{height:10px;background-position:-1775px 0px}.iti-flag.gd{height:12px;background-position:-1797px 0px}.iti-flag.ge{height:14px;background-position:-1819px 0px}.iti-flag.gf{height:14px;background-position:-1841px 0px}.iti-flag.gg{height:14px;background-position:-1863px 0px}.iti-flag.gh{height:14px;background-position:-1885px 0px}.iti-flag.gi{height:10px;background-position:-1907px 0px}.iti-flag.gl{height:14px;background-position:-1929px 0px}.iti-flag.gm{height:14px;background-position:-1951px 0px}.iti-flag.gn{height:14px;background-position:-1973px 0px}.iti-flag.gp{height:14px;background-position:-1995px 0px}.iti-flag.gq{height:14px;background-position:-2017px 0px}.iti-flag.gr{height:14px;background-position:-2039px 0px}.iti-flag.gs{height:10px;background-position:-2061px 0px}.iti-flag.gt{height:13px;background-position:-2083px 0px}.iti-flag.gu{height:11px;background-position:-2105px 0px}.iti-flag.gw{height:10px;background-position:-2127px 0px}.iti-flag.gy{height:12px;background-position:-2149px 0px}.iti-flag.hk{height:14px;background-position:-2171px 0px}.iti-flag.hm{height:10px;background-position:-2193px 0px}.iti-flag.hn{height:10px;background-position:-2215px 0px}.iti-flag.hr{height:10px;background-position:-2237px 0px}.iti-flag.ht{height:12px;background-position:-2259px 0px}.iti-flag.hu{height:10px;background-position:-2281px 0px}.iti-flag.ic{height:14px;background-position:-2303px 0px}.iti-flag.id{height:14px;background-position:-2325px 0px}.iti-flag.ie{height:10px;background-position:-2347px 0px}.iti-flag.il{height:15px;background-position:-2369px 0px}.iti-flag.im{height:10px;background-position:-2391px 0px}.iti-flag.in{height:14px;background-position:-2413px 0px}.iti-flag.io{height:10px;background-position:-2435px 0px}.iti-flag.iq{height:14px;background-position:-2457px 0px}.iti-flag.ir{height:12px;background-position:-2479px 0px}.iti-flag.is{height:15px;background-position:-2501px 0px}.iti-flag.it{height:14px;background-position:-2523px 0px}.iti-flag.je{height:12px;background-position:-2545px 0px}.iti-flag.jm{height:10px;background-position:-2567px 0px}.iti-flag.jo{height:10px;background-position:-2589px 0px}.iti-flag.jp{height:14px;background-position:-2611px 0px}.iti-flag.ke{height:14px;background-position:-2633px 0px}.iti-flag.kg{height:12px;background-position:-2655px 0px}.iti-flag.kh{height:13px;background-position:-2677px 0px}.iti-flag.ki{height:10px;background-position:-2699px 0px}.iti-flag.km{height:12px;background-position:-2721px 0px}.iti-flag.kn{height:14px;background-position:-2743px 0px}.iti-flag.kp{height:10px;background-position:-2765px 0px}.iti-flag.kr{height:14px;background-position:-2787px 0px}.iti-flag.kw{height:10px;background-position:-2809px 0px}.iti-flag.ky{height:10px;background-position:-2831px 0px}.iti-flag.kz{height:10px;background-position:-2853px 0px}.iti-flag.la{height:14px;background-position:-2875px 0px}.iti-flag.lb{height:14px;background-position:-2897px 0px}.iti-flag.lc{height:10px;background-position:-2919px 0px}.iti-flag.li{height:12px;background-position:-2941px 0px}.iti-flag.lk{height:10px;background-position:-2963px 0px}.iti-flag.lr{height:11px;background-position:-2985px 0px}.iti-flag.ls{height:14px;background-position:-3007px 0px}.iti-flag.lt{height:12px;background-position:-3029px 0px}.iti-flag.lu{height:12px;background-position:-3051px 0px}.iti-flag.lv{height:10px;background-position:-3073px 0px}.iti-flag.ly{height:10px;background-position:-3095px 0px}.iti-flag.ma{height:14px;background-position:-3117px 0px}.iti-flag.mc{height:15px;background-position:-3139px 0px}.iti-flag.md{height:10px;background-position:-3160px 0px}.iti-flag.me{height:10px;background-position:-3182px 0px}.iti-flag.mf{height:14px;background-position:-3204px 0px}.iti-flag.mg{height:14px;background-position:-3226px 0px}.iti-flag.mh{height:11px;background-position:-3248px 0px}.iti-flag.mk{height:10px;background-position:-3270px 0px}.iti-flag.ml{height:14px;background-position:-3292px 0px}.iti-flag.mm{height:14px;background-position:-3314px 0px}.iti-flag.mn{height:10px;background-position:-3336px 0px}.iti-flag.mo{height:14px;background-position:-3358px 0px}.iti-flag.mp{height:10px;background-position:-3380px 0px}.iti-flag.mq{height:14px;background-position:-3402px 0px}.iti-flag.mr{height:14px;background-position:-3424px 0px}.iti-flag.ms{height:10px;background-position:-3446px 0px}.iti-flag.mt{height:14px;background-position:-3468px 0px}.iti-flag.mu{height:14px;background-position:-3490px 0px}.iti-flag.mv{height:14px;background-position:-3512px 0px}.iti-flag.mw{height:14px;background-position:-3534px 0px}.iti-flag.mx{height:12px;background-position:-3556px 0px}.iti-flag.my{height:10px;background-position:-3578px 0px}.iti-flag.mz{height:14px;background-position:-3600px 0px}.iti-flag.na{height:14px;background-position:-3622px 0px}.iti-flag.nc{height:10px;background-position:-3644px 0px}.iti-flag.ne{height:15px;background-position:-3666px 0px}.iti-flag.nf{height:10px;background-position:-3686px 0px}.iti-flag.ng{height:10px;background-position:-3708px 0px}.iti-flag.ni{height:12px;background-position:-3730px 0px}.iti-flag.nl{height:14px;background-position:-3752px 0px}.iti-flag.no{height:15px;background-position:-3774px 0px}.iti-flag.np{height:15px;background-position:-3796px 0px}.iti-flag.nr{height:10px;background-position:-3811px 0px}.iti-flag.nu{height:10px;background-position:-3833px 0px}.iti-flag.nz{height:10px;background-position:-3855px 0px}.iti-flag.om{height:10px;background-position:-3877px 0px}.iti-flag.pa{height:14px;background-position:-3899px 0px}.iti-flag.pe{height:14px;background-position:-3921px 0px}.iti-flag.pf{height:14px;background-position:-3943px 0px}.iti-flag.pg{height:15px;background-position:-3965px 0px}.iti-flag.ph{height:10px;background-position:-3987px 0px}.iti-flag.pk{height:14px;background-position:-4009px 0px}.iti-flag.pl{height:13px;background-position:-4031px 0px}.iti-flag.pm{height:14px;background-position:-4053px 0px}.iti-flag.pn{height:10px;background-position:-4075px 0px}.iti-flag.pr{height:14px;background-position:-4097px 0px}.iti-flag.ps{height:10px;background-position:-4119px 0px}.iti-flag.pt{height:14px;background-position:-4141px 0px}.iti-flag.pw{height:13px;background-position:-4163px 0px}.iti-flag.py{height:11px;background-position:-4185px 0px}.iti-flag.qa{height:8px;background-position:-4207px 0px}.iti-flag.re{height:14px;background-position:-4229px 0px}.iti-flag.ro{height:14px;background-position:-4251px 0px}.iti-flag.rs{height:14px;background-position:-4273px 0px}.iti-flag.ru{height:14px;background-position:-4295px 0px}.iti-flag.rw{height:14px;background-position:-4317px 0px}.iti-flag.sa{height:14px;background-position:-4339px 0px}.iti-flag.sb{height:10px;background-position:-4361px 0px}.iti-flag.sc{height:10px;background-position:-4383px 0px}.iti-flag.sd{height:10px;background-position:-4405px 0px}.iti-flag.se{height:13px;background-position:-4427px 0px}.iti-flag.sg{height:14px;background-position:-4449px 0px}.iti-flag.sh{height:10px;background-position:-4471px 0px}.iti-flag.si{height:10px;background-position:-4493px 0px}.iti-flag.sj{height:15px;background-position:-4515px 0px}.iti-flag.sk{height:14px;background-position:-4537px 0px}.iti-flag.sl{height:14px;background-position:-4559px 0px}.iti-flag.sm{height:15px;background-position:-4581px 0px}.iti-flag.sn{height:14px;background-position:-4603px 0px}.iti-flag.so{height:14px;background-position:-4625px 0px}.iti-flag.sr{height:14px;background-position:-4647px 0px}.iti-flag.ss{height:10px;background-position:-4669px 0px}.iti-flag.st{height:10px;background-position:-4691px 0px}.iti-flag.sv{height:12px;background-position:-4713px 0px}.iti-flag.sx{height:14px;background-position:-4735px 0px}.iti-flag.sy{height:14px;background-position:-4757px 0px}.iti-flag.sz{height:14px;background-position:-4779px 0px}.iti-flag.ta{height:10px;background-position:-4801px 0px}.iti-flag.tc{height:10px;background-position:-4823px 0px}.iti-flag.td{height:14px;background-position:-4845px 0px}.iti-flag.tf{height:14px;background-position:-4867px 0px}.iti-flag.tg{height:13px;background-position:-4889px 0px}.iti-flag.th{height:14px;background-position:-4911px 0px}.iti-flag.tj{height:10px;background-position:-4933px 0px}.iti-flag.tk{height:10px;background-position:-4955px 0px}.iti-flag.tl{height:10px;background-position:-4977px 0px}.iti-flag.tm{height:14px;background-position:-4999px 0px}.iti-flag.tn{height:14px;background-position:-5021px 0px}.iti-flag.to{height:10px;background-position:-5043px 0px}.iti-flag.tr{height:14px;background-position:-5065px 0px}.iti-flag.tt{height:12px;background-position:-5087px 0px}.iti-flag.tv{height:10px;background-position:-5109px 0px}.iti-flag.tw{height:14px;background-position:-5131px 0px}.iti-flag.tz{height:14px;background-position:-5153px 0px}.iti-flag.ua{height:14px;background-position:-5175px 0px}.iti-flag.ug{height:14px;background-position:-5197px 0px}.iti-flag.um{height:11px;background-position:-5219px 0px}.iti-flag.us{height:11px;background-position:-5241px 0px}.iti-flag.uy{height:14px;background-position:-5263px 0px}.iti-flag.uz{height:10px;background-position:-5285px 0px}.iti-flag.va{height:15px;background-position:-5307px 0px}.iti-flag.vc{height:14px;background-position:-5324px 0px}.iti-flag.ve{height:14px;background-position:-5346px 0px}.iti-flag.vg{height:10px;background-position:-5368px 0px}.iti-flag.vi{height:14px;background-position:-5390px 0px}.iti-flag.vn{height:14px;background-position:-5412px 0px}.iti-flag.vu{height:12px;background-position:-5434px 0px}.iti-flag.wf{height:14px;background-position:-5456px 0px}.iti-flag.ws{height:10px;background-position:-5478px 0px}.iti-flag.xk{height:15px;background-position:-5500px 0px}.iti-flag.ye{height:14px;background-position:-5522px 0px}.iti-flag.yt{height:14px;background-position:-5544px 0px}.iti-flag.za{height:14px;background-position:-5566px 0px}.iti-flag.zm{height:14px;background-position:-5588px 0px}.iti-flag.zw{height:10px;background-position:-5610px 0px}.iti-flag{width:20px;height:15px;box-shadow:0px 0px 1px 0px #888;background-image:image-url("flags.png");background-repeat:no-repeat;background-color:#DBDBDB;background-position:20px 0}@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx){.iti-flag{background-image:image-url("flags@2x.png")}}.iti-flag.np{background-color:transparent}
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "intl_phone_picker"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,234 @@
|
|
1
|
+
fr:
|
2
|
+
af: "Afghanistan (افغانستان)"
|
3
|
+
al: "Albanie (Shqipëri)"
|
4
|
+
dz: "Algérie (الجزائر)"
|
5
|
+
as: "Samoa américaines (American Samoa)"
|
6
|
+
ad: "Andorre (Andorra)"
|
7
|
+
ao: "Angola"
|
8
|
+
ai: "Anguilla"
|
9
|
+
ag: "Antigua-et-Barbuda (Antigua and Barbuda)"
|
10
|
+
ar: "Argentine (Argentina)"
|
11
|
+
am: "Arménie (Հայաստան)"
|
12
|
+
aw: "Aruba"
|
13
|
+
au: "Australie (Australia)"
|
14
|
+
at: "Autriche (Österreich)"
|
15
|
+
az: "Azerbaïdjan (Azərbaycan)"
|
16
|
+
bs: "Bahamas"
|
17
|
+
bh: "Bahreïn (البحرين)"
|
18
|
+
bd: "Bangladesh (বাংলাদেশ)"
|
19
|
+
bb: "Barbade (Barbados)"
|
20
|
+
by: "Biélorussie (Беларусь)"
|
21
|
+
be: "Belgique (België)"
|
22
|
+
bz: "Belize"
|
23
|
+
bj: "Bénin"
|
24
|
+
bm: "Bermudes (Bermuda)"
|
25
|
+
bt: "Bhoutan (འབྲུག)"
|
26
|
+
bo: "Bolivie (Bolivia)"
|
27
|
+
ba: "Bosnie-Herzégovine (Босна и Херцеговина)"
|
28
|
+
bw: "Botswana"
|
29
|
+
br: "Brésil (Brasil)"
|
30
|
+
io: "Territoire britannique de l’océan Indien (British Indian Ocean Territory)"
|
31
|
+
vg: "Îles Vierges britanniques (British Virgin Islands)"
|
32
|
+
bn: "Brunei"
|
33
|
+
bg: "Bulgarie (България)"
|
34
|
+
bf: "Burkina Faso"
|
35
|
+
bi: "Burundi (Uburundi)"
|
36
|
+
kh: "Cambodge (កម្ពុជា)"
|
37
|
+
cm: "Cameroun"
|
38
|
+
ca: "Canada"
|
39
|
+
cv: "Cap-Vert (Kabu Verdi)"
|
40
|
+
bq: "Bonaire Saint-Eustache et Saba (Caribbean Netherlands)"
|
41
|
+
ky: "Îles Caïmans (Cay Islands)"
|
42
|
+
cf: "République centrafricaine"
|
43
|
+
td: "Tchad"
|
44
|
+
cl: "Chili (Chile)"
|
45
|
+
cn: "Chine (中国)"
|
46
|
+
co: "Colombie (Colombia)"
|
47
|
+
km: "Comores (جزر القمر)"
|
48
|
+
cd: "République démocratique du Congo (Jamhuri ya Kidemokrasia ya Kongo)"
|
49
|
+
cg: "République du Congo / (Congo) (Congo-Brazzaville)"
|
50
|
+
ck: "Îles Cook (Cook Islands)"
|
51
|
+
cr: "Costa Rica"
|
52
|
+
ci: "Côte d’Ivoire"
|
53
|
+
hr: "Croatie (Hrvatska)"
|
54
|
+
cu: "Cuba"
|
55
|
+
cw: "Curaçao"
|
56
|
+
cy: "Chypre (Κύπρος)"
|
57
|
+
cz: "République tchèque (Česká republika)"
|
58
|
+
dk: "Danemark (Danmark)"
|
59
|
+
dj: "Djibouti"
|
60
|
+
dm: "Dominique (Dominica)"
|
61
|
+
do: "République dominicaine (República Dominicana)"
|
62
|
+
ec: "Équateur (Ecuador)"
|
63
|
+
eg: "Égypte (مصر)"
|
64
|
+
sv: "Salvador (El Salvador)"
|
65
|
+
gq: "Guinée équatoriale (Guinea Ecuatorial)"
|
66
|
+
er: "Érythrée (Eritrea)"
|
67
|
+
ee: "Estonie (Eesti)"
|
68
|
+
et: "Éthiopie (Ethiopia)"
|
69
|
+
fk: "Îles Malouines (Islas Malvinas)"
|
70
|
+
fo: "Îles Féroé (Føroyar)"
|
71
|
+
fj: "Fidji (Fiji)"
|
72
|
+
fi: "Finlande (Suomi)"
|
73
|
+
fr: "France"
|
74
|
+
gf: "Guyane (Guyane française)"
|
75
|
+
pf: "Polynésie française"
|
76
|
+
ga: "Gabon"
|
77
|
+
gm: "Gambie (Gambia)"
|
78
|
+
ge: "Géorgie (საქართველო)"
|
79
|
+
de: "Allemagne (Deutschland)"
|
80
|
+
gh: "Ghana (Gaana)"
|
81
|
+
gi: "Gibraltar"
|
82
|
+
gr: "Grèce (Ελλάδα)"
|
83
|
+
gl: "Groenland (Kalaallit Nunaat)"
|
84
|
+
gd: "Grenade (Grenada)"
|
85
|
+
gp: "Guadeloupe"
|
86
|
+
gu: "Guam"
|
87
|
+
gt: "Guatemala"
|
88
|
+
gn: "Guinée"
|
89
|
+
gw: "Guinée-Bissau (República da Guiné-Bissau)"
|
90
|
+
gy: "Guyana"
|
91
|
+
ht: "Haïti (Haiti)"
|
92
|
+
hn: "Honduras"
|
93
|
+
hk: "Hong Kong (香港)"
|
94
|
+
hu: "Hongrie (Magyarország)"
|
95
|
+
is: "Islande (Ísland)"
|
96
|
+
in: "Inde (भारत)"
|
97
|
+
id: "Indonésie (Indonesia)"
|
98
|
+
ir: "Iran (ایران)"
|
99
|
+
iq: "Irak (العراق)"
|
100
|
+
ie: "Irlande (Ireland)"
|
101
|
+
il: "Israël (ישראל)"
|
102
|
+
it: "Italie (Italia)"
|
103
|
+
jm: "Jamaïque (Jamaica)"
|
104
|
+
jp: "Japon (日本)"
|
105
|
+
jo: "Jordanie (الأردن)"
|
106
|
+
kz: "Kazakhstan (Казахстан)"
|
107
|
+
ke: "Kenya"
|
108
|
+
ki: "Kiribati"
|
109
|
+
kw: "Koweït (الكويت)"
|
110
|
+
kg: "Kirghizistan (Кыргызстан)"
|
111
|
+
la: "Laos (ລາວ)"
|
112
|
+
lv: "Lettonie (Latvija)"
|
113
|
+
lb: "Liban (لبنان)"
|
114
|
+
ls: "Lesotho"
|
115
|
+
lr: "Liberia"
|
116
|
+
ly: "Libye (ليبيا)"
|
117
|
+
li: "Liechtenstein"
|
118
|
+
lt: "Lituanie (Lietuva)"
|
119
|
+
lu: "Luxembourg"
|
120
|
+
mo: "Macao (澳門)"
|
121
|
+
mk: "Macédoine (Македонија)"
|
122
|
+
mg: "Madagascar (Madagasikara)"
|
123
|
+
mw: "Malawi"
|
124
|
+
my: "Malaisie (Malaysia)"
|
125
|
+
mv: "Maldives"
|
126
|
+
ml: "Mali"
|
127
|
+
mt: "Malte (Malta)"
|
128
|
+
mh: "Marshall (Marshall Islands)"
|
129
|
+
mq: "Martinique"
|
130
|
+
mr: "Mauritanie (موريتانيا)"
|
131
|
+
mu: "Maurice (Moris)"
|
132
|
+
mx: "Mexique (México)"
|
133
|
+
fm: "Micronésie (Micronesia)"
|
134
|
+
md: "Moldavie (Republica Moldova)"
|
135
|
+
mc: "Monaco"
|
136
|
+
mn: "Mongolie (Монгол)"
|
137
|
+
me: "Monténégro (Crna Gora)"
|
138
|
+
ms: "Montserrat"
|
139
|
+
ma: "Maroc (المغرب)"
|
140
|
+
mz: "Mozambique (Moçambique)"
|
141
|
+
mm: "Birmanie (မြန်မာ)"
|
142
|
+
na: "Namibie (Namibië)"
|
143
|
+
nr: "Nauru"
|
144
|
+
np: "Népal (नेपाल)"
|
145
|
+
nl: "Pays-Bas (Nederland)"
|
146
|
+
nc: "Nouvelle-Calédonie"
|
147
|
+
nz: "Nouvelle-Zélande (New Zealand)"
|
148
|
+
ni: "Nicaragua"
|
149
|
+
ne: "Niger (Nijar)"
|
150
|
+
ng: "Nigeria"
|
151
|
+
nu: "Niue"
|
152
|
+
nf: "Île Norfolk (Norfolk Island)"
|
153
|
+
kp: "Corée du Nord (조선 민주주의 인민 공화국)"
|
154
|
+
mp: "Îles Mariannes du Nord (Northern Mariana Islands)"
|
155
|
+
no: "Norvège (Norge)"
|
156
|
+
om: "Oman (عُمان)"
|
157
|
+
pk: "Pakistan (پاکستان)"
|
158
|
+
pw: "Palaos (Palau)"
|
159
|
+
ps: "Autorité palestinienne (فلسطين)"
|
160
|
+
pa: "Panama (Panamá)"
|
161
|
+
pg: "Papouasie-Nouvelle-Guinée (Papua New Guinea)"
|
162
|
+
py: "Paraguay"
|
163
|
+
pe: "Pérou (Perú)"
|
164
|
+
ph: "Philippines"
|
165
|
+
pl: "Pologne (Polska)"
|
166
|
+
pt: "Portugal"
|
167
|
+
pr: "Porto Rico (Puerto Rico)"
|
168
|
+
qa: "Qatar (قطر)"
|
169
|
+
re: "La Réunion"
|
170
|
+
ro: "Roumanie (România)"
|
171
|
+
ru: "Russie (Россия)"
|
172
|
+
rw: "Rwanda"
|
173
|
+
bl: "Saint-Barthélemy"
|
174
|
+
sh: "Sainte-Hélène Ascension et Tristan da Cunha (Saint Helena)"
|
175
|
+
kn: "Saint-Christophe-et-Niévès (Saint Kitts and Nevis)"
|
176
|
+
lc: "Sainte-Lucie (Saint Lucia)"
|
177
|
+
mf: "Saint-Martin (Antilles françaises) (partie française))"
|
178
|
+
pm: "Saint-Pierre-et-Miquelon"
|
179
|
+
vc: "Saint-Vincent-et-les-Grenadines (Saint Vincent and the Grenadines)"
|
180
|
+
ws: "Samoa"
|
181
|
+
sm: "Saint-Marin (San Marino)"
|
182
|
+
st: "Sao Tomé-et-Principe (São Tomé e Príncipe)"
|
183
|
+
sa: "Arabie saoudite (المملكة العربية السعودية)"
|
184
|
+
sn: "Sénégal"
|
185
|
+
rs: "Serbie (Србија)"
|
186
|
+
sc: "Seychelles"
|
187
|
+
sl: "Sierra Leone"
|
188
|
+
sg: "Singapour (Singapore)"
|
189
|
+
sx: "Saint-Martin (Sint Maarten)"
|
190
|
+
sk: "Slovaquie (Slovensko)"
|
191
|
+
si: "Slovénie (Slovenija)"
|
192
|
+
sb: "Salomon (Solomon Islands)"
|
193
|
+
so: "Somalie (Soomaaliya)"
|
194
|
+
za: "Afrique du Sud (South Africa)"
|
195
|
+
kr: "Corée du Sud (대한민국)"
|
196
|
+
ss: "Soudan du Sud (جنوب السودان)"
|
197
|
+
es: "Espagne (España)"
|
198
|
+
lk: "Sri Lanka (ශ්රී ලංකාව)"
|
199
|
+
sd: "Soudan (السودان)"
|
200
|
+
sr: "Suriname"
|
201
|
+
sz: "Swaziland"
|
202
|
+
se: "Suède (Sverige)"
|
203
|
+
ch: "Suisse (Schweiz)"
|
204
|
+
sy: "Syrie (سوريا)"
|
205
|
+
tw: "Taïwan / (République de Chine (Taïwan)) (台灣)"
|
206
|
+
tj: "Tadjikistan (Tajikistan)"
|
207
|
+
tz: "Tanzanie (Tanzania)"
|
208
|
+
th: "Thaïlande (ไทย)"
|
209
|
+
tl: "Timor oriental (Timor-Leste)"
|
210
|
+
tg: "Togo"
|
211
|
+
tk: "Tokelau"
|
212
|
+
to: "Tonga"
|
213
|
+
tt: "Trinité-et-Tobago (Trinidad and Tobago)"
|
214
|
+
tn: "Tunisie (تونس)"
|
215
|
+
tr: "Turquie (Türkiye)"
|
216
|
+
tm: "Turkménistan (Turkmenistan)"
|
217
|
+
tc: "Îles Turques-et-Caïques (Turks and Caicos Islands)"
|
218
|
+
tv: "Tuvalu"
|
219
|
+
vi: "Îles Vierges des États-Unis (U.S. Virgin Islands)"
|
220
|
+
ug: "Ouganda (Uganda)"
|
221
|
+
ua: "Ukraine (Україна)"
|
222
|
+
ae: "Émirats arabes unis (الإمارات العربية المتحدة)"
|
223
|
+
gb: "Royaume-Uni (United Kingdom)"
|
224
|
+
us: "États-Unis (United States)"
|
225
|
+
uy: "Uruguay"
|
226
|
+
uz: "Ouzbékistan (Oʻzbekiston)"
|
227
|
+
vu: "Vanuatu"
|
228
|
+
va: "État de la Cité du Vatican (Città del Vaticano)"
|
229
|
+
ve: "Venezuela"
|
230
|
+
vn: "Viêt Nam (Việt Nam)"
|
231
|
+
wf: "Wallis-et-Futuna (Wallis and Futuna)"
|
232
|
+
ye: "Yémen (يمني)"
|
233
|
+
zm: "Zambie (Zambia)"
|
234
|
+
zw: "Zimbabwe"
|
@@ -0,0 +1,231 @@
|
|
1
|
+
us:
|
2
|
+
af: "Afghanistan (افغانستان)"
|
3
|
+
al: "Albania (Shqipëri)"
|
4
|
+
dz: "Algeria (الجزائر)"
|
5
|
+
as: "American Samoa"
|
6
|
+
ad: "Andorra"
|
7
|
+
ao: "Angola"
|
8
|
+
ai: "Anguilla"
|
9
|
+
ag: "Antigua and Barbuda"
|
10
|
+
ar: "Argentina"
|
11
|
+
am: "Armenia (Հայաստան)"
|
12
|
+
aw: "Aruba"
|
13
|
+
au: "Australia"
|
14
|
+
at: "Austria (Österreich)"
|
15
|
+
az: "Azerbaijan (Azərbaycan)"
|
16
|
+
bs: "Bahamas"
|
17
|
+
bh: "Bahrain (البحرين)"
|
18
|
+
bd: "Bangladesh (বাংলাদেশ)"
|
19
|
+
bb: "Barbados"
|
20
|
+
by: "Belarus (Беларусь)"
|
21
|
+
be: "Belgium (België)"
|
22
|
+
bz: "Belize"
|
23
|
+
bj: "Benin (Bénin)"
|
24
|
+
bm: "Bermuda"
|
25
|
+
bt: "Bhutan (འབྲུག)"
|
26
|
+
bo: "Bolivia"
|
27
|
+
ba: "Bosnia and Herzegovina (Босна и Херцеговина)"
|
28
|
+
bw: "Botswana"
|
29
|
+
br: "Brazil (Brasil)"
|
30
|
+
io: "British Indian Ocean Territory"
|
31
|
+
vg: "British Virgin Islands"
|
32
|
+
bn: "Brunei"
|
33
|
+
bg: "Bulgaria (България)"
|
34
|
+
bf: "Burkina Faso"
|
35
|
+
bi: "Burundi (Uburundi)"
|
36
|
+
kh: "Cambodia (កម្ពុជា)"
|
37
|
+
cm: "Cameroon (Cameroun)"
|
38
|
+
ca: "Canada"
|
39
|
+
bq: "Caribbean Netherlands"
|
40
|
+
ky: "Cayman Islands"
|
41
|
+
cf: "Central African Republic (République centrafricaine)"
|
42
|
+
td: "Chad (Tchad)"
|
43
|
+
cl: "Chile"
|
44
|
+
cn: "China (中国)"
|
45
|
+
co: "Colombia"
|
46
|
+
km: "Comoros (جزر القمر)"
|
47
|
+
cd: "Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)"
|
48
|
+
cg: "Congo (Republic) (Congo-Brazzaville)"
|
49
|
+
ck: "Cook Islands"
|
50
|
+
cr: "Costa Rica"
|
51
|
+
ci: "Côte d’Ivoire"
|
52
|
+
hr: "Croatia (Hrvatska)"
|
53
|
+
cu: "Cuba"
|
54
|
+
cw: "Curaçao"
|
55
|
+
cy: "Cyprus (Κύπρος)"
|
56
|
+
cz: "Czech Republic (Česká republika)"
|
57
|
+
dk: "Denmark (Danmark)"
|
58
|
+
dj: "Djibouti"
|
59
|
+
dm: "Dominica"
|
60
|
+
do: "Dominican Republic (República Dominicana)"
|
61
|
+
eg: "Egypt (مصر)"
|
62
|
+
sv: "El Salvador"
|
63
|
+
gq: "Equatorial Guinea (Guinea Ecuatorial)"
|
64
|
+
er: "Eritrea"
|
65
|
+
ee: "Estonia (Eesti)"
|
66
|
+
et: "Ethiopia"
|
67
|
+
fk: "Falkland Islands (Islas Malvinas)"
|
68
|
+
fo: "Faroe Islands (Føroyar)"
|
69
|
+
fj: "Fiji"
|
70
|
+
fi: "Finland (Suomi)"
|
71
|
+
fr: "France"
|
72
|
+
gf: "French Guiana (Guyane française)"
|
73
|
+
pf: "French Polynesia (Polynésie française)"
|
74
|
+
ga: "Gabon"
|
75
|
+
gm: "Gambia"
|
76
|
+
ge: "Georgia (საქართველო)"
|
77
|
+
de: "Germany (Deutschland)"
|
78
|
+
gh: "Ghana (Gaana)"
|
79
|
+
gi: "Gibraltar"
|
80
|
+
gr: "Greece (Ελλάδα)"
|
81
|
+
gl: "Greenland (Kalaallit Nunaat)"
|
82
|
+
gd: "Grenada"
|
83
|
+
gp: "Guadeloupe"
|
84
|
+
gu: "Guam"
|
85
|
+
gt: "Guatemala"
|
86
|
+
gn: "Guinea (Guinée)"
|
87
|
+
gw: "Guinea-Bissau (Guiné Bissau)"
|
88
|
+
gy: "Guyana"
|
89
|
+
ht: "Haiti"
|
90
|
+
hn: "Honduras"
|
91
|
+
hk: "Hong Kong (香港)"
|
92
|
+
hu: "Hungary (Magyarország)"
|
93
|
+
is: "Iceland (Ísland)"
|
94
|
+
in: "India (भारत)"
|
95
|
+
id: "Indonesia"
|
96
|
+
ir: "Iran (ایران)"
|
97
|
+
iq: "Iraq (العراق)"
|
98
|
+
ie: "Ireland"
|
99
|
+
il: "Israel (ישראל)"
|
100
|
+
it: "Italy (Italia)"
|
101
|
+
jm: "Jamaica"
|
102
|
+
jp: "Japan (日本)"
|
103
|
+
jo: "Jordan (الأردن)"
|
104
|
+
kz: "Kazakhstan (Казахстан)"
|
105
|
+
ke: "Kenya"
|
106
|
+
ki: "Kiribati"
|
107
|
+
kw: "Kuwait (الكويت)"
|
108
|
+
kg: "Kyrgyzstan (Кыргызстан)"
|
109
|
+
la: "Laos (ລາວ)"
|
110
|
+
lv: "Latvia (Latvija)"
|
111
|
+
lb: "Lebanon (لبنان)"
|
112
|
+
ls: "Lesotho"
|
113
|
+
lr: "Liberia"
|
114
|
+
ly: "Libya (ليبيا)"
|
115
|
+
li: "Liechtenstein"
|
116
|
+
lt: "Lithuania (Lietuva)"
|
117
|
+
lu: "Luxembourg"
|
118
|
+
mo: "Macau (澳門)"
|
119
|
+
mk: "Macedonia (FYROM) (Македонија)"
|
120
|
+
mg: "Madagascar (Madagasikara)"
|
121
|
+
mw: "Malawi"
|
122
|
+
my: "Malaysia"
|
123
|
+
mv: "Maldives"
|
124
|
+
ml: "Mali"
|
125
|
+
mt: "Malta"
|
126
|
+
mh: "Marshall Islands"
|
127
|
+
mq: "Martinique"
|
128
|
+
mr: "Mauritania (موريتانيا)"
|
129
|
+
mu: "Mauritius (Moris)"
|
130
|
+
mx: "Mexico (México)"
|
131
|
+
fm: "Micronesia"
|
132
|
+
md: "Moldova (Republica Moldova)"
|
133
|
+
mc: "Monaco"
|
134
|
+
mn: "Mongolia (Монгол)"
|
135
|
+
me: "Montenegro (Crna Gora)"
|
136
|
+
ms: "Montserrat"
|
137
|
+
ma: "Morocco (المغرب)"
|
138
|
+
mz: "Mozambique (Moçambique)"
|
139
|
+
mm: "Myanmar (Burma) (မြန်မာ)"
|
140
|
+
na: "Namibia (Namibië)"
|
141
|
+
nr: "Nauru"
|
142
|
+
np: "Nepal (नेपाल)"
|
143
|
+
nl: "Netherlands (Nederland)"
|
144
|
+
nc: "New Caledonia (Nouvelle-Calédonie)"
|
145
|
+
nz: "New Zealand"
|
146
|
+
ni: "Nicaragua"
|
147
|
+
ne: "Niger (Nijar)"
|
148
|
+
ng: "Nigeria"
|
149
|
+
nu: "Niue"
|
150
|
+
nf: "Norfolk Island"
|
151
|
+
kp: "North Korea (조선 민주주의 인민 공화국)"
|
152
|
+
mp: "Northern Mariana Islands"
|
153
|
+
no: "Norway (Norge)"
|
154
|
+
om: "Oman (عُمان)"
|
155
|
+
pk: "Pakistan (پاکستان)"
|
156
|
+
pw: "Palau"
|
157
|
+
ps: "Palestine (فلسطين)"
|
158
|
+
pa: "Panama (Panamá)"
|
159
|
+
pg: "Papua New Guinea"
|
160
|
+
py: "Paraguay"
|
161
|
+
pe: "Peru (Perú)"
|
162
|
+
ph: "Philippines"
|
163
|
+
pl: "Poland (Polska)"
|
164
|
+
pt: "Portugal"
|
165
|
+
pr: "Puerto Rico"
|
166
|
+
re: "Réunion (La Réunion)"
|
167
|
+
ro: "Romania (România)"
|
168
|
+
ru: "Russia (Россия)"
|
169
|
+
rw: "Rwanda"
|
170
|
+
bl: "Saint Barthélemy (Saint-Barthélemy)"
|
171
|
+
sh: "Saint Helena"
|
172
|
+
kn: "Saint Kitts and Nevis"
|
173
|
+
lc: "Saint Lucia"
|
174
|
+
mf: "Saint Martin (Saint-Martin (partie française))"
|
175
|
+
pm: "Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)"
|
176
|
+
vc: "Saint Vincent and the Grenadines"
|
177
|
+
ws: "Samoa"
|
178
|
+
sm: "San Marino"
|
179
|
+
st: "São Tomé and Príncipe (São Tomé e Príncipe)"
|
180
|
+
sa: "Saudi Arabia (المملكة العربية السعودية)"
|
181
|
+
sn: "Senegal (Sénégal)"
|
182
|
+
rs: "Serbia (Србија)"
|
183
|
+
sc: "Seychelles"
|
184
|
+
sl: "Sierra Leone"
|
185
|
+
sg: "Singapore"
|
186
|
+
sx: "Sint Maarten"
|
187
|
+
sk: "Slovakia (Slovensko)"
|
188
|
+
si: "Slovenia (Slovenija)"
|
189
|
+
sb: "Solomon Islands"
|
190
|
+
so: "Somalia (Soomaaliya)"
|
191
|
+
za: "South Africa"
|
192
|
+
kr: "South Korea (대한민국)"
|
193
|
+
ss: "South Sudan (جنوب السودان)"
|
194
|
+
es: "Spain (España)"
|
195
|
+
lk: "Sri Lanka (ශ්රී ලංකාව)"
|
196
|
+
sd: "Sudan (السودان)"
|
197
|
+
sr: "Suriname"
|
198
|
+
sz: "Swaziland"
|
199
|
+
se: "Sweden (Sverige)"
|
200
|
+
ch: "Switzerland (Schweiz)"
|
201
|
+
sy: "Syria (سوريا)"
|
202
|
+
tw: "Taiwan (台灣)"
|
203
|
+
tj: "Tajikistan"
|
204
|
+
tz: "Tanzania"
|
205
|
+
th: "Thailand (ไทย)"
|
206
|
+
tl: "Timor-Leste"
|
207
|
+
tg: "Togo"
|
208
|
+
tk: "Tokelau"
|
209
|
+
to: "Tonga"
|
210
|
+
tt: "Trinidad and Tobago"
|
211
|
+
tn: "Tunisia (تونس)"
|
212
|
+
tr: "Turkey (Türkiye)"
|
213
|
+
tm: "Turkmenistan"
|
214
|
+
tc: "Turks and Caicos Islands"
|
215
|
+
tv: "Tuvalu"
|
216
|
+
vi: "U.S. Virgin Islands"
|
217
|
+
ug: "Uganda"
|
218
|
+
ua: "Ukraine (Україна)"
|
219
|
+
ae: "United Arab Emirates (الإمارات العربية المتحدة)"
|
220
|
+
gb: "United Kingdom"
|
221
|
+
us: "United States"
|
222
|
+
uy: "Uruguay"
|
223
|
+
uz: "Uzbekistan (Oʻzbekiston)"
|
224
|
+
vu: "Vanuatu"
|
225
|
+
va: "Vatican City (Città del Vaticano)"
|
226
|
+
ve: "Venezuela"
|
227
|
+
vn: "Vietnam (Việt Nam)"
|
228
|
+
wf: "Wallis and Futuna"
|
229
|
+
ye: "Yemen (اليمن)"
|
230
|
+
zm: "Zambia"
|
231
|
+
zw: "Zimbabwe"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require 'intl_phone_picker/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "intl_phone_picker"
|
7
|
+
spec.version = IntlPhonePicker::VERSION
|
8
|
+
spec.authors = ["Fabien Dobat\n\n"]
|
9
|
+
spec.email = ["fabien.dobat@seniormedia.fr"]
|
10
|
+
|
11
|
+
if spec.respond_to?(:metadata)
|
12
|
+
# spec.metadata['allowed_push_host'] = "https://rubygems.org/gems/intl_phone_picker"
|
13
|
+
end
|
14
|
+
|
15
|
+
spec.summary = %q{Internationalize your tel fields into jQuery numbers pickers}
|
16
|
+
spec.description = %q{IntlPhonePicker is a ruby gem which allow you to change your html5 "tel" fields into jQuery international phone number pickers.}
|
17
|
+
spec.homepage = "https://github.com/SeniorMedia/intl_phone_picker"
|
18
|
+
spec.license = "MIT"
|
19
|
+
|
20
|
+
spec.files = `git ls-files`.split("\n")
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.8"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "minitest"
|
26
|
+
|
27
|
+
spec.add_dependency "railties", ">= 3.1"
|
28
|
+
spec.add_dependency "sass-rails"
|
29
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class ActionView::Helpers::FormBuilder
|
2
|
+
|
3
|
+
def intl_phone_input(object_name, options = {})
|
4
|
+
class_name = 'intl_phone_input_' + IntlPhonePicker::langage_to_use
|
5
|
+
options = IntlPhonePicker::options_keys_to_sym options
|
6
|
+
|
7
|
+
phones_fields = telephone_field(object_name, options.merge(class: class_name).except(:hidden_intl_field))
|
8
|
+
|
9
|
+
# Can call this helper with option 'hidden_intl_field' set to true to toggle an hidden linked field which will store and return
|
10
|
+
# the phone number of the input with an international format, starts with '+33' for example
|
11
|
+
phones_fields << hidden_field(options[:hidden_intl_field], {'data-phone-field' => "#{self.object_name}[#{object_name}]"}) if options[:hidden_intl_field].presence
|
12
|
+
|
13
|
+
phones_fields
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'intl_phone_picker/view_helpers'
|
2
|
+
require 'intl_phone_picker/activerecord_helpers'
|
3
|
+
|
4
|
+
module IntlPhonePicker
|
5
|
+
class Engine < Rails::Engine
|
6
|
+
end
|
7
|
+
|
8
|
+
class Railtie < Rails::Railtie
|
9
|
+
initializer "intl_phone_picker.view_helpers" do
|
10
|
+
ActionView::Base.send :include, ViewHelpers
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|