Index: polymer_1.0.4/bower_components/gold-zip-input/zip-validator.html |
diff --git a/polymer_0.5.4/bower_components/core-overlay/core-key-helper.html b/polymer_1.0.4/bower_components/gold-zip-input/zip-validator.html |
similarity index 51% |
copy from polymer_0.5.4/bower_components/core-overlay/core-key-helper.html |
copy to polymer_1.0.4/bower_components/gold-zip-input/zip-validator.html |
index 1c9e48438849f6676d3997e92b2ba7a56d13c540..c2e35926fbedd8982885b5518588e78b034d6da0 100644 |
--- a/polymer_0.5.4/bower_components/core-overlay/core-key-helper.html |
+++ b/polymer_1.0.4/bower_components/gold-zip-input/zip-validator.html |
@@ -1,5 +1,6 @@ |
<!-- |
-Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
+@license |
+Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt |
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt |
@@ -8,15 +9,24 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
--> |
<link rel="import" href="../polymer/polymer.html"> |
+<link rel="import" href="../iron-validator-behavior/iron-validator-behavior.html"> |
-<!-- |
-@element core-key-helper |
---> |
-<polymer-element name="core-key-helper"> |
- <script> |
- Polymer('core-key-helper', { |
- ENTER_KEY: 13, |
- ESCAPE_KEY: 27 |
- }); |
- </script> |
-</polymer-element> |
+<script> |
+ |
+ Polymer({ |
+ |
+ is: 'zip-validator', |
+ |
+ behaviors: [ |
+ Polymer.IronValidatorBehavior |
+ ], |
+ |
+ validate: function(value) { |
+ // A valid zipcode is 5 digits or 5 digits, a dash, and 4 more digits. |
+ var re = /^\d{5}(?:-\d{4})?$/; |
+ return re.test(value); |
+ } |
+ |
+ }); |
+ |
+</script> |