Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: polymer_1.0.4/bower_components/gold-zip-input/zip-validator.html

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698