diff --git a/background.html b/background.html index 2b35f12b..41cf6e90 100644 --- a/background.html +++ b/background.html @@ -18,9 +18,8 @@ - + - diff --git a/bower.json b/bower.json index 523954ab..265942f5 100644 --- a/bower.json +++ b/bower.json @@ -13,7 +13,8 @@ "mustache": "~0.8.2", "qrcode": "git://github.com/davidshimjs/qrcodejs.git", "bootstrap-tagsinput": "~0.4.2", - "cryptojs": "svn+http://crypto-js.googlecode.com/svn/#~3.1.2" + "cryptojs": "svn+http://crypto-js.googlecode.com/svn/#~3.1.2", + "libphonenumber-api": "git://github.com/codedust/libphonenumber-api" }, "devDependencies": { "mocha": "~2.0.1", @@ -67,6 +68,9 @@ "src/evpkdf.js", "src/cipher-core.js", "src/aes.js" + ], + "libphonenumber-api": [ + "libphonenumber_api-compiled.js" ] }, "concat": { @@ -78,7 +82,8 @@ "mustache", "underscore", "backbone", - "qrcode" + "qrcode", + "libphonenumber-api" ] } } diff --git a/js-deps/libphonenumber_api-compiled.js b/components/libphonenumber-api/libphonenumber_api-compiled.js similarity index 64% rename from js-deps/libphonenumber_api-compiled.js rename to components/libphonenumber-api/libphonenumber_api-compiled.js index b3c97939..f868dd65 100644 --- a/js-deps/libphonenumber_api-compiled.js +++ b/components/libphonenumber-api/libphonenumber_api-compiled.js @@ -1,6 +1,6 @@ -(function(){function h(a){throw a;}var j=!0,k=null,m=!1,n,aa=this;function p(a,b){var c=a.split("."),e=aa;!(c[0]in e)&&e.execScript&&e.execScript("var "+c[0]);for(var d;c.length&&(d=c.shift());)!c.length&&void 0!==b?e[d]=b:e=e[d]?e[d]:e[d]={}}function q(a,b){function c(){}c.prototype=b.prototype;a.pa=b.prototype;a.prototype=new c;a.prototype.constructor=a};function r(a,b,c){this.fa=a;this.na=b.name||k;this.wa=b.k||k;this.ba=b.va;this.c={};for(a=0;a=e):-1!=na(d,e)}; -n.o=function(a){if(a==k)return k;var b=a.g(),b=K[b];if(b==k)b=k;else if(1==b.length)b=b[0];else a:{a=W(a);for(var c,e=b.length,d=0;d=a.b.length&&h("Phone number too short after IDD"); -a:{d=a.toString();if(!(0==d.length||"0"==d.charAt(0)))for(var g=d.length,i=1;3>=i&&i<=g;++i)if(f=parseInt(d.substring(0,i),10),f in K){c.append(d.substring(i));d=f;break a}d=0}if(0!=d)return e.l(d),d;h("Invalid country calling code")}if(b!=k&&(d=b.g(),f=""+d,g=a.toString(),0==g.lastIndexOf(f,0)&&(i=new E(g.substring(f.length)),g=x(b,1),f=RegExp(y(g,2)),qa(i,b,k),b=i.toString(),g=y(g,3),!U(f,a.toString())&&U(f,b)||3==(U(g,a.toString())?0:0==a.toString().search(g)?3:2))))return c.append(b),e.l(d),d; -e.l(0);return 0}function qa(a,b,c){var e=a.toString(),d=e.length,f=x(b,15);if(!(0==d||f==k||0==f.length))if(f=RegExp("^(?:"+f+")"),d=f.exec(e)){var g=RegExp,i;i=x(b,1);i=y(i,2);g=g(i);i=U(g,e);var l=d.length-1;b=x(b,16);if(b==k||0==b.length||d[l]==k||0==d[l].length){if(!i||U(g,e.substring(d[0].length)))c!=k&&(0c.toString().length?0:U(S,c.toString()))|| -h("The string supplied did not seem to be a phone number");b!=k&&isNaN(b)&&b.toUpperCase()in L||c.toString()!=k&&0d.substring(0,f).length?0:U(S,d.substring(0,f))))for(var g=d.match(R),i=g.length,l=1;ld.b.length&&h("The string supplied is too short to be a phone number");f!=k&&(g=new E,c=new E(d.toString()),qa(c,f,g),g=c.toString(),f=x(f,1),f=y(f,3),2==(U(f,g)?0:0==g.search(f)?3:2)||(d=c));c=d.toString();d=c.length;2>d&&h("The string supplied is too short to be a phone number");17a.length?!1:M(oa,a)}function N(a){return M(na,a)?O(a,ia):O(a,I)}function P(a){var b=N(a.toString());a.clear();a.append(b)}function O(a,b){for(var c=new z,e,d=a.length,f=0;f=e):-1!=U(d,e)};h.p=function(a){if(null==a)return null;var b=a.f(),b=F[b];if(null==b)b=null;else if(1==b.length)b=b[0];else a:{a=Q(a);for(var c,e=b.length,d=0;d=a.c.length)throw"Phone number too short after IDD"; +a:{a=a.toString();if(0!=a.length&&"0"!=a.charAt(0))for(d=a.length,f=1;3>=f&&f<=d;++f)if(b=parseInt(a.substring(0,f),10),b in F){c.append(a.substring(f));c=b;break a}c=0}if(0!=c)return e.m(c),c;throw"Invalid country calling code";}if(null!=b&&(d=b.f(),f=""+d,g=a.toString(),0==g.lastIndexOf(f,0))){var k=new z(g.substring(f.length)),g=s(b,1),f=new RegExp(t(g,2));Z(k,b,null);b=k.toString();g=t(g,3);if(!M(f,a.toString())&&M(f,b)||3==X(g,a.toString()))return c.append(b),e.m(d),d}e.m(0);return 0} +function Z(a,b,c){var e=a.toString(),d=e.length,f=s(b,15);if(0!=d&&null!=f&&0!=f.length&&(f=new RegExp("^(?:"+f+")"),d=f.exec(e))){var g=RegExp,k;k=s(b,1);k=t(k,2);g=new g(k);k=M(g,e);var l=d.length-1;b=s(b,16);if(null==b||0==b.length||null==d[l]||0==d[l].length){if(!k||M(g,e.substring(d[0].length)))null!=c&&0d.c.length)throw"The string supplied is too short to be a phone number";null!=f&&(g=new z,c=new z(d.toString()),Z(c,f,g),g=c.toString(),f=s(f,1),f=t(f,3),2==X(f,g)||(d=c));c=d.toString();d=c.length;if(2>d)throw"The string supplied is too short to be a phone number";if(17 - diff --git a/js/components.js b/js/components.js index 70755c22..a8e1660e 100644 --- a/js/components.js +++ b/js/components.js @@ -21966,3 +21966,468 @@ var QRCode; */ QRCode.CorrectLevel = QRErrorCorrectLevel; })(); + +(function(){var h,aa=this;function m(a,b){var c=a.split("."),e=aa;c[0]in e||!e.execScript||e.execScript("var "+c[0]);for(var d;c.length&&(d=c.shift());)c.length||void 0===b?e=e[d]?e[d]:e[d]={}:e[d]=b}function n(a,b){function c(){}c.prototype=b.prototype;a.la=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.ra=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}};function ba(a,b){this.aa=a;this.u=!!b.r;this.j=b.a;this.$=b.type;this.s=!1;switch(this.j){case ca:case da:case ea:case fa:case ga:this.s=!0}this.h=b.defaultValue}var ca=3,da=4,ea=6,fa=16,ga=18;function ha(a,b){this.da=a;this.e={};for(var c=0;ca.length?!1:M(oa,a)}function N(a){return M(na,a)?O(a,ia):O(a,I)}function P(a){var b=N(a.toString());a.clear();a.append(b)}function O(a,b){for(var c=new z,e,d=a.length,f=0;f=e):-1!=U(d,e)};h.p=function(a){if(null==a)return null;var b=a.f(),b=F[b];if(null==b)b=null;else if(1==b.length)b=b[0];else a:{a=Q(a);for(var c,e=b.length,d=0;d=a.c.length)throw"Phone number too short after IDD"; +a:{a=a.toString();if(0!=a.length&&"0"!=a.charAt(0))for(d=a.length,f=1;3>=f&&f<=d;++f)if(b=parseInt(a.substring(0,f),10),b in F){c.append(a.substring(f));c=b;break a}c=0}if(0!=c)return e.m(c),c;throw"Invalid country calling code";}if(null!=b&&(d=b.f(),f=""+d,g=a.toString(),0==g.lastIndexOf(f,0))){var k=new z(g.substring(f.length)),g=s(b,1),f=new RegExp(t(g,2));Z(k,b,null);b=k.toString();g=t(g,3);if(!M(f,a.toString())&&M(f,b)||3==X(g,a.toString()))return c.append(b),e.m(d),d}e.m(0);return 0} +function Z(a,b,c){var e=a.toString(),d=e.length,f=s(b,15);if(0!=d&&null!=f&&0!=f.length&&(f=new RegExp("^(?:"+f+")"),d=f.exec(e))){var g=RegExp,k;k=s(b,1);k=t(k,2);g=new g(k);k=M(g,e);var l=d.length-1;b=s(b,16);if(null==b||0==b.length||null==d[l]||0==d[l].length){if(!k||M(g,e.substring(d[0].length)))null!=c&&0d.c.length)throw"The string supplied is too short to be a phone number";null!=f&&(g=new z,c=new z(d.toString()),Z(c,f,g),g=c.toString(),f=s(f,1),f=t(f,3),2==X(f,g)||(d=c));c=d.toString();d=c.length;if(2>d)throw"The string supplied is too short to be a phone number";if(17 - diff --git a/test/index.html b/test/index.html index 8a2bb9a6..4c74e261 100644 --- a/test/index.html +++ b/test/index.html @@ -127,7 +127,6 @@ -