Browse Source

Removed more unneeded file changes from commit

Thomas Lhotta 11 years ago
parent
commit
4d9959caa6
3 changed files with 10 additions and 90 deletions
  1. 8 20
      dist/js/bootstrapValidator.js
  2. 0 2
      dist/js/language/de_DE.js
  3. 2 68
      test/spec.js

+ 8 - 20
dist/js/bootstrapValidator.js

@@ -2,7 +2,7 @@
  * BootstrapValidator (http://bootstrapvalidator.com)
  * The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3
  *
- * @version     v0.5.3-dev, built on 2014-11-03 12:37:06 PM
+ * @version     v0.5.3-dev, built on 2014-11-03 3:09:43 PM
  * @author      https://twitter.com/nghuuphuoc
  * @copyright   (c) 2013 - 2014 Nguyen Huu Phuoc
  * @license     MIT
@@ -8006,10 +8006,8 @@ if (typeof jQuery === 'undefined') {
         countryNotSupported: 'The country code %s is not supported',
         country: 'Please enter a valid postal code in %s',
         countries: {
-            AT: 'Austria',
             BR: 'Brazil',
             CA: 'Canada',
-            CH: 'Switzerland',
             CZ: 'Czech Republic',
             DE: 'Germany',
             DK: 'Denmark',
@@ -8035,7 +8033,7 @@ if (typeof jQuery === 'undefined') {
             country: 'country'
         },
 
-        COUNTRY_CODES: [ 'AT', 'BR', 'CA', 'CH', 'CZ', 'DE', 'DK', 'FR', 'GB', 'IE', 'IT', 'MA', 'NL', 'PT', 'RO', 'RU', 'SE', 'SG', 'SK', 'US'],
+        COUNTRY_CODES: ['BR', 'CA', 'CZ', 'DE', 'DK', 'FR', 'GB', 'IE', 'IT', 'MA', 'NL', 'PT', 'RO', 'RU', 'SE', 'SG', 'SK', 'US'],
 
         /**
          * Return true if and only if the input value is a valid country zip code
@@ -8079,11 +8077,6 @@ if (typeof jQuery === 'undefined') {
             var isValid = false;
             country = country.toUpperCase();
             switch (country) {
-                // http://en.wikipedia.org/wiki/List_of_postal_codes_in_Austria
-                case 'AT':
-                    isValid = /^([1-9]{1})(\d{3})$/.test(value);
-                    break;
-
                 case 'BR':
                     isValid = /^(\d{2})([\.]?)(\d{3})([\-]?)(\d{3})$/.test(value);
                     break;
@@ -8092,24 +8085,19 @@ if (typeof jQuery === 'undefined') {
                     isValid = /^(?:A|B|C|E|G|H|J|K|L|M|N|P|R|S|T|V|X|Y){1}[0-9]{1}(?:A|B|C|E|G|H|J|K|L|M|N|P|R|S|T|V|W|X|Y|Z){1}\s?[0-9]{1}(?:A|B|C|E|G|H|J|K|L|M|N|P|R|S|T|V|W|X|Y|Z){1}[0-9]{1}$/i.test(value);
                     break;
 
-                case 'CH':
-                    isValid = /^([1-9]{1})(\d{3})$/.test(value);
-                    break;
-
                 case 'CZ':
                     // Test: http://regexr.com/39hhr
                     isValid = /^(\d{3})([ ]?)(\d{2})$/.test(value);
                     break;
 
-                // http://stackoverflow.com/questions/7926687/regular-expression-german-zip-codes
                 case 'DE':
-                    isValid = /^(?!01000|99999)(0[1-9]\d{3}|[1-9]\d{4})$/.test(value);
+                    isValid = /^([01245678][0-9]{4})$/.test(value);
                     break;
 
                 case 'DK':
                     isValid = /^(DK(-|\s)?)?\d{4}$/i.test(value);
                     break;
-
+                    
                 // http://en.wikipedia.org/wiki/Postal_codes_in_France
                 case 'FR':
                     isValid = /^[0-9]{5}$/i.test(value);
@@ -8118,7 +8106,7 @@ if (typeof jQuery === 'undefined') {
                 case 'GB':
                     isValid = this._gb(value);
                     break;
-
+                
                 // http://www.eircode.ie/docs/default-source/Common/prepare-your-business-for-eircode---published-v2.pdf?sfvrsn=2
                 // Test: http://refiddle.com/1kpl
                 case 'IE':
@@ -8139,12 +8127,12 @@ if (typeof jQuery === 'undefined') {
                 case 'NL':
                     isValid = /^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}$/i.test(value);
                     break;
-
+                
                 // Test: http://refiddle.com/1l2t
                 case 'PT':
                     isValid = /^[1-9]\d{3}-\d{3}$/.test(value);
                     break;
-
+                    
                 case 'RO':
                     isValid = /^(0[1-8]{1}|[1-9]{1}[0-5]{1})?[0-9]{4}$/i.test(value);
                     break;
@@ -8159,7 +8147,7 @@ if (typeof jQuery === 'undefined') {
 
                 case 'SG':
                     isValid = /^([0][1-9]|[1-6][0-9]|[7]([0-3]|[5-9])|[8][0-2])(\d{4})$/i.test(value);
-                    break;
+                    break;                
 
                 case 'SK':
                     // Test: http://regexr.com/39hhr

+ 0 - 2
dist/js/language/de_DE.js

@@ -344,10 +344,8 @@
             countryNotSupported: 'Der Ländercode %s wird nicht unterstützt',
             country: 'Bitte gültigen Postleitzahl für %s eingeben',
             countries: {
-                AT: 'Österreich',
                 BR: 'Brasilien',
                 CA: 'Kanada',
-                CH: 'Schweiz',
                 CZ: 'Tschechische',
                 DE: 'Deutschland',
                 DK: 'Dänemark',

+ 2 - 68
test/spec.js

@@ -8236,7 +8236,7 @@ describe('zipCode', function() {
             expect(this.bv.isValid()).toEqual(false);
         }
     });
-
+    
     it('Eircode (Ireland postal code)', function() {
         this.bv.updateOption('zc', 'zipCode', 'country', 'IE');
 
@@ -8258,7 +8258,7 @@ describe('zipCode', function() {
             expect(this.bv.isValid()).toEqual(false);
         }
     });
-
+    
     it('Portugal postal code', function() {
         this.bv.updateOption('zc', 'zipCode', 'country', 'PT');
 
@@ -8280,70 +8280,4 @@ describe('zipCode', function() {
             expect(this.bv.isValid()).toEqual(false);
         }
     });
-
-    it('Austria postal code', function() {
-        this.bv.updateOption('zc', 'zipCode', 'country', 'AT');
-
-        // Valid samples
-        var validSamples = ['6020', '1010', '4853'];
-        for (var i in validSamples) {
-            this.bv.resetForm();
-            this.$zipCode.val(validSamples[i]);
-            this.bv.validate();
-            expect(this.bv.isValid()).toBeTruthy();
-        }
-
-        // Invalid samples
-        var invalidSamples = ['0020', '12345', '102', '12AB', 'AT 6020 XY'];
-        for (i in invalidSamples) {
-            this.bv.resetForm();
-            this.$zipCode.val(invalidSamples[i]);
-            this.bv.validate();
-            expect(this.bv.isValid()).toEqual(false);
-        }
-    });
-
-    it('Germany postal code', function() {
-        this.bv.updateOption('zc', 'zipCode', 'country', 'DE');
-
-        // Valid samples
-        var validSamples = ['52238', '01001', '09107'];
-        for (var i in validSamples) {
-            this.bv.resetForm();
-            this.$zipCode.val(validSamples[i]);
-            this.bv.validate();
-            expect(this.bv.isValid()).toBeTruthy();
-        }
-
-        // Invalid samples
-        var invalidSamples = ['01000', '99999', '102', 'ABCDE', 'DE 52240 XY'];
-        for (i in invalidSamples) {
-            this.bv.resetForm();
-            this.$zipCode.val(invalidSamples[i]);
-            this.bv.validate();
-            expect(this.bv.isValid()).toEqual(false);
-        }
-    });
-
-    it('Switzerland postal code', function() {
-        this.bv.updateOption('zc', 'zipCode', 'country', 'CH');
-
-        // Valid samples
-        var validSamples = [ '8280', '8090', '8238', '9490'];
-        for (var i in validSamples) {
-            this.bv.resetForm();
-            this.$zipCode.val(validSamples[i]);
-            this.bv.validate();
-            expect(this.bv.isValid()).toBeTruthy();
-        }
-
-        // Invalid samples
-        var invalidSamples = ['0123', '99999', '102', 'ABCD', 'CH-5224 XY'];
-        for (i in invalidSamples) {
-            this.bv.resetForm();
-            this.$zipCode.val(invalidSamples[i]);
-            this.bv.validate();
-            expect(this.bv.isValid()).toEqual(false);
-        }
-    });
 });