summaryrefslogtreecommitdiffstats
path: root/third_party/polymer/v1_0
diff options
context:
space:
mode:
authortsergeant <tsergeant@chromium.org>2015-06-17 19:53:43 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-18 02:54:24 +0000
commit6e6b751edaef93725d8ecd8142c32704bfe422e7 (patch)
tree2ca6c2c08fb15299ac30ade56835accad751db31 /third_party/polymer/v1_0
parent86ee231fb1707f9a9d09c7b55f9cdcf7580498ac (diff)
downloadchromium_src-6e6b751edaef93725d8ecd8142c32704bfe422e7.zip
chromium_src-6e6b751edaef93725d8ecd8142c32704bfe422e7.tar.gz
chromium_src-6e6b751edaef93725d8ecd8142c32704bfe422e7.tar.bz2
Update Polymer components and re-run reproduce.sh
This updates Polymer to version 1.0.3 and individual components to versions between 1.0.1 and 1.0.3. Material PDF needs version 1.0.1 of paper-ripple, and the patch from crrev.com/e5984ce48c06c9debe9e0a8ef297388171618219 was merged into Polymer 1.0.3. BUG=None Review URL: https://codereview.chromium.org/1187823002 Cr-Commit-Position: refs/heads/master@{#334984}
Diffstat (limited to 'third_party/polymer/v1_0')
-rw-r--r--third_party/polymer/v1_0/README.chromium8
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/bower.json3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-a11y-keys/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-a11y-keys/bower.json3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-a11y-keys/iron-a11y-keys-extracted.js1
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-ajax/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-ajax/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax-extracted.js110
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax.html2
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request-extracted.js20
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request.html5
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js44
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea.html2
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-behaviors/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-behaviors/bower.json3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js17
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js48
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-form/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-form/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-form/iron-form-extracted.js54
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-icon/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-icon/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon.html20
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-icons/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-icons/bower.json3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-icons/iron-icons.html2
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-iconset-svg/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-iconset-svg/bower.json3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js43
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-iconset/.bower.json13
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-iconset/bower.json7
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset-extracted.js1
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset.html1
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-image/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-image/bower.json3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-image/iron-image-extracted.js44
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-input/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-input/bower.json3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-input/iron-input-extracted.js93
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-jsonp-library/.bower.json15
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-jsonp-library/bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-jsonp-library/iron-jsonp-library-extracted.js10
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-localstorage/.bower.json12
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-localstorage/bower.json6
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage-extracted.js15
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage.html2
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/bower.json3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-behavior-extracted.js23
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/bower.json3
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js5
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-behaviors/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-behaviors/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js1
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js30
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior.html (renamed from third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-radio-button-behavior.html)2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-radio-button-behavior-extracted.js26
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-checkbox/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-checkbox/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js4
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.css16
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.html14
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/.bower.json10
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/bower.json4
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js5
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-common.css1
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/paper-dialog-scrollable-extracted.js1
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-drawer-panel/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-drawer-panel/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js26
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-fab/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-fab/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab-extracted.js8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab.html14
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-header-panel/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-header-panel/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel-extracted.js4
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel.html26
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-icon-button/.bower.json10
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-icon-button/bower.json4
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js25
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button.html12
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-input/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-input/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-input/paper-input-addon-behavior-extracted.js12
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js28
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js25
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container.html4
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-input/paper-input.html2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea.html4
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-radio-button/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-radio-button/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.css16
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.html14
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-radio-group/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-radio-group/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js135
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group.html6
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-ripple/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-ripple/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js14
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/README.md2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel-extracted.js5
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel.html2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-slider/.bower.json15
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-slider/bower.json9
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js140
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.css8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html29
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-styles/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-styles/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-styles/color.html6
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-styles/demo-pages.html8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toggle-button/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toggle-button/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button-extracted.js2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.css12
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html13
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toolbar/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toolbar/README.md6
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toolbar/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar-extracted.js2
-rw-r--r--third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar.html33
-rw-r--r--third_party/polymer/v1_0/components-chromium/polymer-externs/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/polymer-externs/polymer.externs.js214
-rw-r--r--third_party/polymer/v1_0/components-chromium/polymer/.bower.json10
-rw-r--r--third_party/polymer/v1_0/components-chromium/polymer/bower.json2
-rw-r--r--third_party/polymer/v1_0/components-chromium/polymer/build.log19
-rw-r--r--third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js1571
-rw-r--r--third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js287
-rw-r--r--third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js487
-rw-r--r--third_party/polymer/v1_0/components/iron-a11y-keys-behavior/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-a11y-keys-behavior/bower.json3
-rw-r--r--third_party/polymer/v1_0/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html3
-rw-r--r--third_party/polymer/v1_0/components/iron-a11y-keys/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-a11y-keys/bower.json3
-rw-r--r--third_party/polymer/v1_0/components/iron-a11y-keys/iron-a11y-keys.html1
-rw-r--r--third_party/polymer/v1_0/components/iron-ajax/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/iron-ajax/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/iron-ajax/iron-ajax.html112
-rw-r--r--third_party/polymer/v1_0/components/iron-ajax/iron-request.html25
-rw-r--r--third_party/polymer/v1_0/components/iron-autogrow-textarea/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/iron-autogrow-textarea/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/iron-autogrow-textarea/iron-autogrow-textarea.html55
-rw-r--r--third_party/polymer/v1_0/components/iron-behaviors/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-behaviors/bower.json3
-rw-r--r--third_party/polymer/v1_0/components/iron-behaviors/iron-button-state.html17
-rw-r--r--third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html48
-rw-r--r--third_party/polymer/v1_0/components/iron-form/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/iron-form/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/iron-form/iron-form.html54
-rw-r--r--third_party/polymer/v1_0/components/iron-icon/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/iron-icon/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/iron-icon/iron-icon.html20
-rw-r--r--third_party/polymer/v1_0/components/iron-icons/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-icons/bower.json3
-rw-r--r--third_party/polymer/v1_0/components/iron-icons/iron-icons.html2
-rw-r--r--third_party/polymer/v1_0/components/iron-iconset-svg/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-iconset-svg/bower.json3
-rw-r--r--third_party/polymer/v1_0/components/iron-iconset-svg/iron-iconset-svg.html43
-rw-r--r--third_party/polymer/v1_0/components/iron-iconset/.bower.json13
-rw-r--r--third_party/polymer/v1_0/components/iron-iconset/bower.json7
-rw-r--r--third_party/polymer/v1_0/components/iron-iconset/iron-iconset.html2
-rw-r--r--third_party/polymer/v1_0/components/iron-image/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-image/bower.json3
-rw-r--r--third_party/polymer/v1_0/components/iron-image/iron-image.html44
-rw-r--r--third_party/polymer/v1_0/components/iron-input/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-input/bower.json3
-rw-r--r--third_party/polymer/v1_0/components/iron-input/iron-input.html93
-rw-r--r--third_party/polymer/v1_0/components/iron-jsonp-library/.bower.json15
-rw-r--r--third_party/polymer/v1_0/components/iron-jsonp-library/bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-jsonp-library/iron-jsonp-library.html10
-rw-r--r--third_party/polymer/v1_0/components/iron-localstorage/.bower.json12
-rw-r--r--third_party/polymer/v1_0/components/iron-localstorage/bower.json6
-rw-r--r--third_party/polymer/v1_0/components/iron-localstorage/iron-localstorage.html17
-rw-r--r--third_party/polymer/v1_0/components/iron-overlay-behavior/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-overlay-behavior/bower.json3
-rw-r--r--third_party/polymer/v1_0/components/iron-overlay-behavior/iron-overlay-behavior.html23
-rw-r--r--third_party/polymer/v1_0/components/iron-validatable-behavior/.bower.json9
-rw-r--r--third_party/polymer/v1_0/components/iron-validatable-behavior/bower.json3
-rw-r--r--third_party/polymer/v1_0/components/iron-validatable-behavior/iron-validatable-behavior.html5
-rw-r--r--third_party/polymer/v1_0/components/paper-behaviors/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-behaviors/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-behaviors/paper-button-behavior.html1
-rw-r--r--third_party/polymer/v1_0/components/paper-behaviors/paper-inky-focus-behavior.html (renamed from third_party/polymer/v1_0/components/paper-behaviors/paper-radio-button-behavior.html)14
-rw-r--r--third_party/polymer/v1_0/components/paper-checkbox/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-checkbox/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.css16
-rw-r--r--third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.html18
-rw-r--r--third_party/polymer/v1_0/components/paper-dialog-behavior/.bower.json10
-rw-r--r--third_party/polymer/v1_0/components/paper-dialog-behavior/bower.json4
-rw-r--r--third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-behavior.html5
-rw-r--r--third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-common.css1
-rw-r--r--third_party/polymer/v1_0/components/paper-dialog-scrollable/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-dialog-scrollable/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-dialog-scrollable/paper-dialog-scrollable.html1
-rw-r--r--third_party/polymer/v1_0/components/paper-drawer-panel/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-drawer-panel/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-drawer-panel/paper-drawer-panel.html26
-rw-r--r--third_party/polymer/v1_0/components/paper-fab/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-fab/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-fab/paper-fab.html22
-rw-r--r--third_party/polymer/v1_0/components/paper-header-panel/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-header-panel/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-header-panel/paper-header-panel.html30
-rw-r--r--third_party/polymer/v1_0/components/paper-icon-button/.bower.json10
-rw-r--r--third_party/polymer/v1_0/components/paper-icon-button/bower.json4
-rw-r--r--third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html37
-rw-r--r--third_party/polymer/v1_0/components/paper-input/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-input/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-input/paper-input-addon-behavior.html12
-rw-r--r--third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html28
-rw-r--r--third_party/polymer/v1_0/components/paper-input/paper-input-container.html29
-rw-r--r--third_party/polymer/v1_0/components/paper-input/paper-input.html2
-rw-r--r--third_party/polymer/v1_0/components/paper-input/paper-textarea.html8
-rw-r--r--third_party/polymer/v1_0/components/paper-radio-button/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-radio-button/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.css16
-rw-r--r--third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.html16
-rw-r--r--third_party/polymer/v1_0/components/paper-radio-group/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-radio-group/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-radio-group/paper-radio-group.html142
-rw-r--r--third_party/polymer/v1_0/components/paper-ripple/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-ripple/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-ripple/paper-ripple.html14
-rw-r--r--third_party/polymer/v1_0/components/paper-scroll-header-panel/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-scroll-header-panel/README.md2
-rw-r--r--third_party/polymer/v1_0/components/paper-scroll-header-panel/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-scroll-header-panel/paper-scroll-header-panel.html7
-rw-r--r--third_party/polymer/v1_0/components/paper-slider/.bower.json15
-rw-r--r--third_party/polymer/v1_0/components/paper-slider/bower.json9
-rw-r--r--third_party/polymer/v1_0/components/paper-slider/paper-slider.css8
-rw-r--r--third_party/polymer/v1_0/components/paper-slider/paper-slider.html189
-rw-r--r--third_party/polymer/v1_0/components/paper-styles/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-styles/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-styles/color.html6
-rw-r--r--third_party/polymer/v1_0/components/paper-styles/demo-pages.html8
-rw-r--r--third_party/polymer/v1_0/components/paper-toggle-button/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-toggle-button/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.css12
-rw-r--r--third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.html15
-rw-r--r--third_party/polymer/v1_0/components/paper-toolbar/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/paper-toolbar/README.md6
-rw-r--r--third_party/polymer/v1_0/components/paper-toolbar/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/paper-toolbar/paper-toolbar.html35
-rw-r--r--third_party/polymer/v1_0/components/polymer-externs/.bower.json8
-rw-r--r--third_party/polymer/v1_0/components/polymer-externs/polymer.externs.js214
-rw-r--r--third_party/polymer/v1_0/components/polymer/.bower.json10
-rw-r--r--third_party/polymer/v1_0/components/polymer/bower.json2
-rw-r--r--third_party/polymer/v1_0/components/polymer/build.log19
-rw-r--r--third_party/polymer/v1_0/components/polymer/polymer-micro.html291
-rw-r--r--third_party/polymer/v1_0/components/polymer/polymer-mini.html487
-rw-r--r--third_party/polymer/v1_0/components/polymer/polymer.html1571
263 files changed, 4762 insertions, 3860 deletions
diff --git a/third_party/polymer/v1_0/README.chromium b/third_party/polymer/v1_0/README.chromium
index ee2b6db..77d6a09 100644
--- a/third_party/polymer/v1_0/README.chromium
+++ b/third_party/polymer/v1_0/README.chromium
@@ -1,7 +1,7 @@
Name: Polymer
Short Name: polymer
URL: http://www.polymer-project.org
-Version: 1.0
+Version: 1.0.3
Revision: (See components/<component>/.bower.json)
License: BSD
License File: ../LICENSE.polymer
@@ -39,13 +39,9 @@ HTML elements to external JS files. This version of the Polymer is used in a web
UI, where CSP forbids an execution of inline scripts. The extraction was made
with the help of the Vulcanize tool (https://github.com/Polymer/vulcanize).
- Replaced CRLF line endings with LF line endings in text files.
-- Manually applied patch (https://github.com/Polymer/polymer/pull/1724/files)
-to 'component-chromium/polymer/polymer-micro-extracted.js'.
To restore a content of the 'components', 'components-chromium' directorires
-from scratch, run ./reproduce.sh (requires bower and vulcanize >= 1.2). Then
-download https://codereview.chromium.org/download/issue1165893005_40001.diff
-and run 'git apply --reject issue1165893005_40001.diff'.
+from scratch, run ./reproduce.sh (requires bower and vulcanize >= 1.2).
Note on Bower:
The directory can be updated by running "bower update". A new component can be
diff --git a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/.bower.json
index 7a68cd2..1273560 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-a11y-keys-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A behavior that enables keybindings for greater a11y.",
"keywords": [
"web-components",
@@ -18,6 +18,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
@@ -25,11 +26,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "443f7fc3947aa1d2bb4817588da4bb67fcbbc09d"
+ "tag": "v1.0.2",
+ "commit": "f65766278e9943649e70ff8ab01a848ccf068b01"
},
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/bower.json b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/bower.json
index 87e2f64..cbf6871 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-a11y-keys-behavior",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "A behavior that enables keybindings for greater a11y.",
"keywords": [
"web-components",
@@ -18,6 +18,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js
index 8cddd21..c9da8f4 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior/iron-a11y-keys-behavior-extracted.js
@@ -228,6 +228,7 @@
* The `keys-pressed` event will fire when one of the key combinations set with the
* `keys` property is pressed.
*
+ * @demo demo/index.html
* @polymerBehavior IronA11yKeysBehavior
*/
Polymer.IronA11yKeysBehavior = {
@@ -243,6 +244,7 @@
},
_boundKeyHandlers: {
+ type: Array,
value: function() {
return [];
}
@@ -251,6 +253,7 @@
// We use this due to a limitation in IE10 where instances will have
// own properties of everything on the "prototype".
_imperativeKeyBindings: {
+ type: Object,
value: function() {
return {};
}
diff --git a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/.bower.json
index 7eb99e5..cb2b091 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-a11y-keys",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A basic element implementation of iron-a11y-keys-behavior, matching the legacy core-a11y-keys.",
"keywords": [
"web-components",
@@ -19,6 +19,7 @@
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
@@ -26,11 +27,11 @@
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0"
},
"homepage": "https://github.com/PolymerElements/iron-a11y-keys",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "11963b0e817ed910f5d13d1d68f4abac62c1a8f3"
+ "tag": "v1.0.1",
+ "commit": "9ba9b2bb3a328c6b88ebabb436dc96402dc0e455"
},
"_source": "git://github.com/PolymerElements/iron-a11y-keys.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/bower.json b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/bower.json
index 7776b7d..c3bb104 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-a11y-keys",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A basic element implementation of iron-a11y-keys-behavior, matching the legacy core-a11y-keys.",
"keywords": [
"web-components",
@@ -19,6 +19,7 @@
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/iron-a11y-keys-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/iron-a11y-keys-extracted.js
index 4798c3b..477f6f1 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/iron-a11y-keys-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-a11y-keys/iron-a11y-keys-extracted.js
@@ -73,6 +73,7 @@ Keys Syntax Grammar:
],
properties: {
+ /** @type {?Node} */
target: {
type: Object,
observer: '_targetChanged'
diff --git a/third_party/polymer/v1_0/components-chromium/iron-ajax/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-ajax/.bower.json
index b2da472..58b4721 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-ajax/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-ajax/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-ajax",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Makes it easy to make ajax calls and parse the response",
"private": true,
"authors": [
@@ -35,11 +35,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "97cc0c5e407ccde33f385ffbf9e6b6c706e63977"
+ "tag": "v1.0.2",
+ "commit": "6ed75a4425b709e6825cd4970e800b053ff8ffd8"
},
"_source": "git://github.com/PolymerElements/iron-ajax.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-ajax/bower.json b/third_party/polymer/v1_0/components-chromium/iron-ajax/bower.json
index 33b3614..46ae576 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-ajax/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-ajax/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-ajax",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Makes it easy to make ajax calls and parse the response",
"private": true,
"authors": [
diff --git a/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax-extracted.js
index 07a3882..ab1ec17 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax-extracted.js
@@ -33,7 +33,9 @@
/**
* An object that contains query parameters to be appended to the
- * specified `url` when generating a request.
+ * specified `url` when generating a request. If you wish to set the body
+ * content when making a POST request, you should use the `body` property
+ * instead.
*/
params: {
type: Object,
@@ -62,6 +64,9 @@
* headers='{"X-Requested-With": "XMLHttpRequest"}'
* handle-as="json"
* last-response-changed="{{handleResponse}}"></iron-ajax>
+ *
+ * Note: setting a `Content-Type` header here will override the value
+ * specified by the `contentType` property of this element.
*/
headers: {
type: Object,
@@ -71,9 +76,9 @@
},
/**
- * Content type to use when sending data. If the contenttype is set
- * and a `Content-Type` header is specified in the `headers` attribute,
- * the `headers` attribute value will take precedence.
+ * Content type to use when sending data. If the `contentType` property
+ * is set and a `Content-Type` header is specified in the `headers`
+ * property, the `headers` property value will take precedence.
*/
contentType: {
type: String,
@@ -173,7 +178,7 @@
/**
* Will be set to the most recent response received by a request
* that originated from this iron-ajax element. The type of the response
- * is determined by the value of `handleas` at the time that the request
+ * is determined by the value of `handleAs` at the time that the request
* was generated.
*/
lastResponse: {
@@ -201,7 +206,7 @@
notify: true,
readOnly: true,
value: function() {
- this._setActiveRequests([]);
+ return [];
}
},
@@ -217,23 +222,22 @@
_boundHandleResponse: {
type: Function,
value: function() {
- return this.handleResponse.bind(this);
- }
- },
-
- _boundDiscardRequest: {
- type: Function,
- value: function() {
- return this.discardRequest.bind(this);
+ return this._handleResponse.bind(this);
}
}
},
observers: [
- 'requestOptionsChanged(url, method, params, headers,' +
+ '_requestOptionsChanged(url, method, params, headers,' +
'contentType, body, sync, handleAs, withCredentials, auto)'
],
+ /**
+ * The query string that should be appended to the `url`, serialized from
+ * the current value of `params`.
+ *
+ * @return {string}
+ */
get queryString () {
var queryParts = [];
var param;
@@ -253,6 +257,12 @@
return queryParts.join('&');
},
+ /**
+ * The `url` with query string (if `params` are specified), suitable for
+ * providing to an `iron-request` instance.
+ *
+ * @return {string}
+ */
get requestUrl() {
var queryString = this.queryString;
@@ -263,9 +273,16 @@
return this.url;
},
+ /**
+ * An object that maps header names to header values, first applying the
+ * the value of `Content-Type` and then overlaying the headers specified
+ * in the `headers` property.
+ *
+ * @return {Object}
+ */
get requestHeaders() {
var headers = {
- 'content-type': this.contentType
+ 'Content-Type': this.contentType
};
var header;
@@ -278,6 +295,19 @@
return headers;
},
+ /**
+ * Request options suitable for generating an `iron-request` instance based
+ * on the current state of the `iron-ajax` instance's properties.
+ *
+ * @return {{
+ * url: string,
+ * method: (string|undefined),
+ * async: (boolean|undefined),
+ * body: (ArrayBuffer|ArrayBufferView|Blob|Document|FormData|null|string|undefined),
+ * headers: (Object|undefined),
+ * handleAs: (string|undefined),
+ * withCredentials: (boolean|undefined)}}
+ */
toRequestOptions: function() {
return {
url: this.requestUrl,
@@ -290,25 +320,13 @@
};
},
- requestOptionsChanged: function() {
- this.debounce('generate-request', function() {
- if (!this.url && this.url !== '') {
- return;
- }
-
- if (this.auto) {
- this.generateRequest();
- }
- }, this.debounceDuration);
- },
-
/**
* Performs an AJAX request to the specified URL.
*
- * @method generateRequest
+ * @return {!IronRequestElement}
*/
generateRequest: function() {
- var request = document.createElement('iron-request');
+ var request = /** @type {!IronRequestElement} */ (document.createElement('iron-request'));
var requestOptions = this.toRequestOptions();
this.activeRequests.push(request);
@@ -316,14 +334,15 @@
request.completes.then(
this._boundHandleResponse
).catch(
- this.handleError.bind(this, request)
+ this._handleError.bind(this, request)
).then(
- this._boundDiscardRequest
+ this._discardRequest.bind(this, request)
);
request.send(requestOptions);
this._setLastRequest(request);
+ this._setLoading(true);
this.fire('request', {
request: request,
@@ -333,12 +352,12 @@
return request;
},
- handleResponse: function(request) {
+ _handleResponse: function(request) {
this._setLastResponse(request.response);
this.fire('response', request);
},
- handleError: function(request, error) {
+ _handleError: function(request, error) {
if (this.verbose) {
console.error(error);
}
@@ -353,11 +372,28 @@
});
},
- discardRequest: function(request) {
+ _discardRequest: function(request) {
var requestIndex = this.activeRequests.indexOf(request);
- if (requestIndex > 0) {
+ if (requestIndex > -1) {
this.activeRequests.splice(requestIndex, 1);
}
- }
+
+ if (this.activeRequests.length === 0) {
+ this._setLoading(false);
+ }
+ },
+
+ _requestOptionsChanged: function() {
+ this.debounce('generate-request', function() {
+ if (!this.url && this.url !== '') {
+ return;
+ }
+
+ if (this.auto) {
+ this.generateRequest();
+ }
+ }, this.debounceDuration);
+ },
+
});
diff --git a/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax.html b/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax.html
index 4d53f02..a620ef1 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax.html
+++ b/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-ajax.html
@@ -28,6 +28,8 @@ Note: The `params` attribute must be double quoted JSON.
You can trigger a request explicitly by calling `generateRequest` on the
element.
+
+@demo demo/index.html
-->
</head><body><script src="iron-ajax-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request-extracted.js
index 93800bd..5458b81 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request-extracted.js
@@ -26,7 +26,7 @@
* resolved.
*
* @attribute response
- * @type Object
+ * @type {*}
* @default null
*/
response: {
@@ -96,7 +96,7 @@
* the status code 0 is accepted as a success even though the outcome may
* be ambiguous.
*
- * @return boolean
+ * @return {boolean}
*/
get succeeded() {
var status = this.xhr.status || 0;
@@ -110,7 +110,6 @@
/**
* Sends an HTTP request to the server and returns the XHR object.
*
- * @method request
* @param {{
* url: string,
* method: (string|undefined),
@@ -127,13 +126,13 @@
* headers HTTP request headers.
* handleAs The response type. Default is 'text'.
* withCredentials Whether or not to send credentials on the request. Default is false.
- * @return Promise
+ * @return {Promise}
*/
send: function (options) {
var xhr = this.xhr;
if (xhr.readyState > 0) {
- return;
+ return null;
}
xhr.addEventListener('readystatechange', function () {
@@ -190,6 +189,14 @@
return this.completes;
},
+ /**
+ * Attempts to parse the response body of the XHR. If parsing succeeds,
+ * the value returned will be deserialized based on the `responseType`
+ * set on the XHR.
+ *
+ * @return {*} The parsed response,
+ * or undefined if there was an empty response or parsing failed.
+ */
parseResponse: function () {
var xhr = this.xhr;
var responseType = this.xhr.responseType ||
@@ -234,6 +241,9 @@
}
},
+ /**
+ * Aborts the request.
+ */
abort: function () {
this._setAborted(true);
this.xhr.abort();
diff --git a/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request.html b/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request.html
index 3e692d9..d03e991f 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request.html
+++ b/third_party/polymer/v1_0/components-chromium/iron-ajax/iron-request.html
@@ -9,15 +9,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../promise-polyfill/promise-polyfill-lite.html">
<!--
-@group Iron Elements
-
iron-request can be used to perform XMLHttpRequests.
<iron-request id="xhr"></iron-request>
...
this.$.xhr.send({url: url, params: params});
-
-@element iron-request
-->
-
</head><body><script src="iron-request-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/.bower.json
index dcec326..6601ce9 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"
@@ -34,11 +34,11 @@
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "ae96e84193694882ff4112566bf365e495b6263f"
+ "tag": "v1.0.1",
+ "commit": "e2bd6f5e964d032beccacabbccb63f93c73f74c0"
},
"_source": "git://github.com/PolymerElements/iron-autogrow-textarea.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/bower.json b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/bower.json
index 39d4fd2..bcb7ff0 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js
index 70ed209..de9ac3f 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea-extracted.js
@@ -46,6 +46,50 @@
},
/**
+ * Bound to the textarea's `autocomplete` attribute.
+ */
+ autocomplete: {
+ type: String,
+ value: 'off'
+ },
+
+ /**
+ * Bound to the textarea's `autofocus` attribute.
+ */
+ autofocus: {
+ type: String,
+ value: 'off'
+ },
+
+ /**
+ * Bound to the textarea's `inputmode` attribute.
+ */
+ inputmode: {
+ type: String
+ },
+
+ /**
+ * Bound to the textarea's `name` attribute.
+ */
+ name: {
+ type: String
+ },
+
+ /**
+ * Bound to the textarea's `placeholder` attribute.
+ */
+ placeholder: {
+ type: String
+ },
+
+ /**
+ * Bound to the textarea's `readonly` attribute.
+ */
+ readonly: {
+ type: String
+ },
+
+ /**
* Set to true to mark the textarea as required.
*/
required: {
diff --git a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea.html b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea.html
index 9d21a4b..7c24a08 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea.html
+++ b/third_party/polymer/v1_0/components-chromium/iron-autogrow-textarea/iron-autogrow-textarea.html
@@ -71,7 +71,7 @@ this element's `bind-value` instead for imperative updates.
<!-- size the input/textarea with a div, because the textarea has intrinsic size in ff -->
<div class="textarea-container fit">
- <textarea id="textarea" required$="[[required]]" rows$="[[rows]]" maxlength$="[[maxlength]]"></textarea>
+ <textarea id="textarea" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" required$="[[required]]" rows$="[[rows]]" maxlength$="[[maxlength]]"></textarea>
</div>
</template>
diff --git a/third_party/polymer/v1_0/components-chromium/iron-behaviors/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-behaviors/.bower.json
index 2b621455..17a4dda 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-behaviors/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-behaviors/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [
@@ -16,6 +16,7 @@
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
@@ -23,11 +24,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-behaviors",
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "03284936c45f058a8192752869a57a0a57a2963f"
+ "tag": "v1.0.3",
+ "commit": "a8e8245c60d65712e2f0ac727f1ce3529dcf395d"
},
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-behaviors/bower.json b/third_party/polymer/v1_0/components-chromium/iron-behaviors/bower.json
index c3c6a73..9f55d07 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-behaviors/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-behaviors/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [
@@ -16,6 +16,7 @@
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js
index b27ec61..f9c6498 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-button-state-extracted.js
@@ -1,16 +1,15 @@
- /** @polymerBehavior Polymer.IronButtonState */
+ /**
+ * @demo demo/index.html
+ * @polymerBehavior
+ */
Polymer.IronButtonStateImpl = {
properties: {
/**
* If true, the user is currently holding down the button.
- *
- * @attribute pressed
- * @type boolean
- * @default false
*/
pressed: {
type: Boolean,
@@ -23,10 +22,6 @@
/**
* If true, the button toggles the active state with each tap or press
* of the spacebar.
- *
- * @attribute toggles
- * @type boolean
- * @default false
*/
toggles: {
type: Boolean,
@@ -36,10 +31,6 @@
/**
* If true, the button is a toggle and is currently in the active state.
- *
- * @attribute active
- * @type boolean
- * @default false
*/
active: {
type: Boolean,
diff --git a/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js
index 5e4ed8e..d84e4ee 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js
@@ -1,17 +1,15 @@
- /** @polymerBehavior */
-
+ /**
+ * @demo demo/index.html
+ * @polymerBehavior
+ */
Polymer.IronControlState = {
properties: {
/**
* If true, the element currently has focus.
- *
- * @attribute focused
- * @type boolean
- * @default false
*/
focused: {
type: Boolean,
@@ -23,10 +21,6 @@
/**
* If true, the user cannot interact with this element.
- *
- * @attribute disabled
- * @type boolean
- * @default false
*/
disabled: {
type: Boolean,
@@ -38,32 +32,44 @@
_oldTabIndex: {
type: Number
+ },
+
+ _boundFocusBlurHandler: {
+ type: Function,
+ value: function() {
+ return this._focusBlurHandler.bind(this);
+ }
}
+
},
observers: [
'_changedControlState(focused, disabled)'
],
- listeners: {
- focus: '_focusHandler',
- blur: '_blurHandler'
- },
-
ready: function() {
// TODO(sjmiles): ensure read-only property is valued so the compound
// observer will fire
if (this.focused === undefined) {
this._setFocused(false);
}
+ this.addEventListener('focus', this._boundFocusBlurHandler, true);
+ this.addEventListener('blur', this._boundFocusBlurHandler, true);
},
- _focusHandler: function() {
- this._setFocused(true);
- },
-
- _blurHandler: function() {
- this._setFocused(false);
+ _focusBlurHandler: function(event) {
+ var target = event.path ? event.path[0] : event.target;
+ if (target === this) {
+ var focused = event.type === 'focus';
+ this._setFocused(focused);
+ } else if (!this.shadowRoot) {
+ event.stopPropagation();
+ this.fire(event.type, {sourceEvent: event}, {
+ node: this,
+ bubbles: event.bubbles,
+ cancelable: event.cancelable
+ });
+ }
},
_disabledChanged: function(disabled, old) {
diff --git a/third_party/polymer/v1_0/components-chromium/iron-form/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-form/.bower.json
index fad4679..f299181 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-form/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-form/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-form",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Makes it easier to manage forms",
"keywords": [
"web-components",
@@ -35,11 +35,11 @@
"paper-button": "PolymerElements/paper-button#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "b884414ee5d9c9e1484554cd1e644e4cfa562153"
+ "tag": "v1.0.2",
+ "commit": "e84269ef9491bf06ac88b9e254ce99e8c1ebd8be"
},
"_source": "git://github.com/PolymerElements/iron-form.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-form/bower.json b/third_party/polymer/v1_0/components-chromium/iron-form/bower.json
index 8abd458..da25de5 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-form/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-form/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-form",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Makes it easier to manage forms",
"keywords": [
"web-components",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-form/iron-form-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-form/iron-form-extracted.js
index ae8d3a7..58c9736 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-form/iron-form-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-form/iron-form-extracted.js
@@ -26,7 +26,7 @@ call the form's `submit` method.
function submitForm() {
document.getElementById('form').submit();
}
-
+
@demo demo/index.html
*/
@@ -37,6 +37,12 @@ call the form's `submit` method.
extends: 'form',
/**
+ * Fired if the form cannot be submitted because it's invalid.
+ *
+ * @event iron-form-invalid
+ */
+
+ /**
* Fired after the form is submitted.
*
* @event iron-form-submit
@@ -56,7 +62,7 @@ call the form's `submit` method.
listeners: {
'iron-form-element-register': '_registerElement',
- 'submit': 'submit'
+ 'submit': '_onSubmit'
},
ready: function() {
@@ -72,9 +78,14 @@ call the form's `submit` method.
/**
* Called to submit the form.
*/
- submit: function(event) {
- if (!this._validate()) {
- return false;
+ submit: function() {
+ if (!this.noValidate && !this._validate()) {
+
+ // In order to trigger the native browser invalid-form UI, we need
+ // to do perform a fake form submit.
+ this._doFakeSubmitForValidation();
+ this.fire('iron-form-invalid');
+ return;
}
var json = this.serialize();
@@ -89,6 +100,10 @@ call the form's `submit` method.
this._requestBot.generateRequest();
this.fire('iron-form-submit', json);
+ },
+
+ _onSubmit: function(event) {
+ this.submit();
// Don't perform a page refresh.
if (event) {
@@ -158,9 +173,25 @@ call the form's `submit` method.
_validate: function() {
var valid = true;
+
+ // Validate all the custom elements.
+ var validatable;
for (var el, i = 0; el = this._customElements[i], i < this._customElements.length; i++) {
- valid = el.validate() && valid;
+ if (el.required) {
+ validatable = /** @type {{validate: (function() : boolean)}} */ (el);
+ valid = validatable.validate() && valid;
+ }
}
+
+ // Validate the form's native elements.
+ for (var el, i = 0; el = this.elements[i], i < this.elements.length; i++) {
+ // Custom elements that extend a native element will also appear in
+ // this list, but they've already been validated.
+ if (!el.hasAttribute('is') && el.willValidate && el.checkValidity) {
+ valid = el.checkValidity() && valid;
+ }
+ }
+
return valid;
},
@@ -171,6 +202,17 @@ call the form's `submit` method.
} else {
return el.checked;
}
+ },
+
+ _doFakeSubmitForValidation: function() {
+ var fakeSubmit = document.createElement('input');
+ fakeSubmit.setAttribute('type', 'submit');
+ fakeSubmit.style.display = 'none';
+ this.appendChild(fakeSubmit);
+
+ fakeSubmit.click();
+
+ this.removeChild(fakeSubmit);
}
});
diff --git a/third_party/polymer/v1_0/components-chromium/iron-icon/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-icon/.bower.json
index 4f44f2e8..8d82e66 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-icon/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-icon/.bower.json
@@ -1,7 +1,7 @@
{
"name": "iron-icon",
"private": true,
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon",
"main": "iron-icon.html",
@@ -27,11 +27,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-icon",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "b6c36359baf7dff86cc4174012296555512ce0c1"
+ "tag": "v1.0.1",
+ "commit": "530b0156756487b4c352d67a9e636724d6a4fe5e"
},
"_source": "git://github.com/PolymerElements/iron-icon.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-icon/bower.json b/third_party/polymer/v1_0/components-chromium/iron-icon/bower.json
index e5ebedb..8052729 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-icon/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-icon/bower.json
@@ -1,7 +1,7 @@
{
"name": "iron-icon",
"private": true,
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon",
"main": "iron-icon.html",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon.html b/third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon.html
index 5cb1c4ed..1f70668 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon.html
+++ b/third_party/polymer/v1_0/components-chromium/iron-icon/iron-icon.html
@@ -22,10 +22,10 @@ Example setting size to 32px x 32px:
<iron-icon class="big" src="big_star.png"></iron-icon>
- <style>
+ <style is="custom-style">
.big {
- height: 32px;
- width: 32px;
+ --iron-icon-height: 32px;
+ --iron-icon-width: 32px;
}
</style>
@@ -54,7 +54,7 @@ Example of using an icon named `cherry` from a custom iconset with the ID `fruit
See [iron-iconset](#iron-iconset) and [iron-iconset-svg](#iron-iconset-svg) for more information about
how to create a custom iconset.
-See [iron-icons](http://www.polymer-project.org/components/iron-icons/demo.html) for the default set of icons.
+See [iron-icons](https://elements.polymer-project.org/elements/iron-icons?view=demo:demo/index.html) for the default set of icons.
### Styling
@@ -73,13 +73,6 @@ Custom property | Description | Default
@homepage polymer.github.io
-->
-<style is="custom-style">
- :root {
- --iron-icon-width: 24px;
- --iron-icon-height: 24px;
- }
-</style>
-
</head><body><dom-module id="iron-icon">
<style>
@@ -92,8 +85,8 @@ Custom property | Description | Default
fill: currentcolor;
- width: var(--iron-icon-width);
- height: var(--iron-icon-height);
+ width: var(--iron-icon-width, 24px);
+ height: var(--iron-icon-height, 24px);
}
</style>
@@ -102,5 +95,4 @@ Custom property | Description | Default
</template>
</dom-module>
-
<script src="iron-icon-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/iron-icons/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-icons/.bower.json
index f7e7900..573d083 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-icons/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-icons/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-icons",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A set of icons for use with iron-icon",
"authors": [
"The Polymer Authors"
@@ -24,6 +24,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#1.0.0",
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
"iron-meta": "polymerelements/iron-meta#^1.0.0",
@@ -33,11 +34,11 @@
"util",
"update-icons.sh"
],
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "a1727591f312fe6cd2e065cab6490232716a646a"
+ "tag": "v1.0.2",
+ "commit": "7340b4e26a0235ffdf2477299ccecd0c5d3d99e8"
},
"_source": "git://github.com/PolymerElements/iron-icons.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-icons/bower.json b/third_party/polymer/v1_0/components-chromium/iron-icons/bower.json
index 1ba69fb..9ac5f25 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-icons/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-icons/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-icons",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A set of icons for use with iron-icon",
"authors": [
"The Polymer Authors"
@@ -24,6 +24,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#1.0.0",
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
"iron-meta": "polymerelements/iron-meta#^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-icons/iron-icons.html b/third_party/polymer/v1_0/components-chromium/iron-icons/iron-icons.html
index c0cf1e9..922d4d8 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-icons/iron-icons.html
+++ b/third_party/polymer/v1_0/components-chromium/iron-icons/iron-icons.html
@@ -7,7 +7,7 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<!--
-`iron-icons` is a utitliy import that includes the definition for the `iron-icon` element, `iron-iconset-svg` element, as well as an import for the default icon set.
+`iron-icons` is a utility import that includes the definition for the `iron-icon` element, `iron-iconset-svg` element, as well as an import for the default icon set.
The `iron-icons` directory also includes imports for additional icon sets that can be loaded into your project.
diff --git a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/.bower.json
index 33c74b8..dc56cd7 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/.bower.json
@@ -1,7 +1,7 @@
{
"name": "iron-iconset-svg",
"description": "Manages a set of svg icons",
- "version": "1.0.1",
+ "version": "1.0.3",
"keywords": [
"web-components",
"polymer",
@@ -17,6 +17,7 @@
"iron-meta": "polymerelements/iron-meta#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
@@ -24,11 +25,11 @@
"web-component-tester": "*"
},
"homepage": "https://github.com/PolymerElements/iron-iconset-svg",
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "ce54b944d6f1f67a254ea9c99585e553eba76b6d"
+ "tag": "v1.0.3",
+ "commit": "d909fa093ce23da7aa3ce844c6b080848e0580f6"
},
"_source": "git://github.com/PolymerElements/iron-iconset-svg.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/bower.json b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/bower.json
index 64e7d83..16c6dfb 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/bower.json
@@ -1,7 +1,7 @@
{
"name": "iron-iconset-svg",
"description": "Manages a set of svg icons",
- "version": "1.0.1",
+ "version": "1.0.3",
"keywords": [
"web-components",
"polymer",
@@ -17,6 +17,7 @@
"iron-meta": "polymerelements/iron-meta#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
index 3f461e2..bbbf099 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
@@ -31,6 +31,7 @@
* iconset.applyIcon(iconNode, 'car');
*
* @element iron-iconset-svg
+ * @demo demo/index.html
*/
Polymer({
@@ -50,14 +51,6 @@
},
/**
- * Array of fully-qualitifed icon names in the iconset.
- */
- iconNames: {
- type: Array,
- notify: true
- },
-
- /**
* The size of an individual icon. Note that icons must be square.
*
* @attribute iconSize
@@ -72,6 +65,18 @@
},
/**
+ * Construct an array of all icon names in this iconset.
+ *
+ * @return {!Array} Array of icon names.
+ */
+ getIconNames: function() {
+ this._icons = this._createIconMap();
+ return Object.keys(this._icons).map(function(n) {
+ return this.name + ':' + n;
+ }, this);
+ },
+
+ /**
* Applies an icon to the given element.
*
* An svg icon is prepended to the element's shadowRoot if it exists,
@@ -113,32 +118,17 @@
/**
*
- * When name is changed, either register a new iconset with the included
- * icons, or if there are no children, set up a meta-iconset.
+ * When name is changed, register iconset metadata
*
*/
_nameChanged: function() {
new Polymer.IronMeta({type: 'iconset', key: this.name, value: this});
- // icons (descendents) must exist a-priori
- this._icons = this._createIconMap();
- this.iconNames = this._getIconNames();
- },
-
- /**
- * Array of all icon names in this iconset.
- *
- * @return {!Array} Array of icon names.
- */
- _getIconNames: function() {
- return Object.keys(this._icons).map(function(n) {
- return this.name + ':' + n;
- }, this);
},
/**
* Create a map of child SVG elements by id.
*
- * @return {Object} Map of id's to SVG elements.
+ * @return {!Object} Map of id's to SVG elements.
*/
_createIconMap: function() {
// Objects chained to Object.prototype (`{}`) have members. Specifically,
@@ -160,6 +150,9 @@
* matching `id`.
*/
_cloneIcon: function(id) {
+ // create the icon map on-demand, since the iconset itself has no discrete
+ // signal to know when it's children are fully parsed
+ this._icons = this._icons || this._createIconMap();
return this._prepareSvgClone(this._icons[id], this.size);
},
diff --git a/third_party/polymer/v1_0/components-chromium/iron-iconset/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-iconset/.bower.json
index e4ecbfa..75ea9f6 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-iconset/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-iconset/.bower.json
@@ -1,11 +1,16 @@
{
"name": "iron-iconset",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Represents a set of icons",
"authors": [
"The Polymer Authors"
],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
"private": true,
"dependencies": {
"iron-meta": "PolymerElements/iron-meta#^1.0.0",
@@ -19,11 +24,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-iconset",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "3ce6be6b689dd8e309410b0c30d7be23a493a880"
+ "tag": "v1.0.1",
+ "commit": "d13a943588e6d200b6140adeb8ee2981dd9b5f04"
},
"_source": "git://github.com/PolymerElements/iron-iconset.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-iconset/bower.json b/third_party/polymer/v1_0/components-chromium/iron-iconset/bower.json
index 8766bf3..135633f 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-iconset/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-iconset/bower.json
@@ -1,11 +1,16 @@
{
"name": "iron-iconset",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Represents a set of icons",
"authors": [
"The Polymer Authors"
],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
"private": true,
"dependencies": {
"iron-meta": "PolymerElements/iron-meta#^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset-extracted.js
index de3dbec..1a3cfddb 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset-extracted.js
@@ -126,7 +126,6 @@
* @param {String|Number} icon The name or index of the icon to apply.
* @param {String} theme (optional) The name or index of the icon to apply.
* @param {Number} scale (optional, defaults to 1) Icon scaling factor.
- * @return {Element} The applied icon element.
*/
applyIcon: function(element, icon, theme, scale) {
this._validateIconMap();
diff --git a/third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset.html b/third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset.html
index 8e1dc83..f864d4b 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset.html
+++ b/third_party/polymer/v1_0/components-chromium/iron-iconset/iron-iconset.html
@@ -52,6 +52,7 @@ Then a themed icon can be applied like this:
iconset.applyIcon(iconNode, 'car', 'special');
@element iron-iconset
+@demo demo/index.html
-->
</head><body><script src="iron-iconset-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/iron-image/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-image/.bower.json
index 3e2ce06..18d5ff0 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-image/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-image/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-image",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An image-displaying element with lots of convenient features",
"private": true,
@@ -17,17 +17,18 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.4",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-image",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "b2a3ef4c558b91a3f9a897f2d0b4c961a220a325"
+ "tag": "v1.0.1",
+ "commit": "54aa387756c16ba09620e1b36ae4ee2d7fd274c6"
},
"_source": "git://github.com/PolymerElements/iron-image.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-image/bower.json b/third_party/polymer/v1_0/components-chromium/iron-image/bower.json
index 6e1d418..129e130 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-image/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-image/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-image",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An image-displaying element with lots of convenient features",
"private": true,
@@ -17,6 +17,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.4",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-image/iron-image-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-image/iron-image-extracted.js
index c9db9e1..9dc432e 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-image/iron-image-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-image/iron-image-extracted.js
@@ -7,10 +7,6 @@
properties: {
/**
* The URL of an image.
- *
- * @attribute src
- * @type string
- * @default ''
*/
src: {
observer: '_srcChanged',
@@ -22,10 +18,6 @@
* When true, the image is prevented from loading and any placeholder is
* shown. This may be useful when a binding to the src property is known to
* be invalid, to prevent 404 requests.
- *
- * @attribute preventLoad
- * @type boolean
- * @default false
*/
preventLoad: {
type: Boolean,
@@ -37,10 +29,6 @@
* aspect ratio of the image is contained within the element and
* letterboxed) or `cover` (image is cropped in order to fully cover the
* bounds of the element), or `null` (default: image takes natural size).
- *
- * @attribute sizing
- * @type string
- * @default null
*/
sizing: {
type: String,
@@ -50,10 +38,6 @@
/**
* When a sizing option is uzed (`cover` or `contain`), this determines
* how the image is aligned within the element bounds.
- *
- * @attribute position
- * @type string
- * @default 'center'
*/
position: {
type: String,
@@ -63,10 +47,6 @@
/**
* When `true`, any change to the `src` property will cause the `placeholder`
* image to be shown until the
- *
- * @attribute preload
- * @type boolean
- * @default false
*/
preload: {
type: Boolean,
@@ -76,10 +56,6 @@
/**
* This image will be used as a background/placeholder until the src image has
* loaded. Use of a data-URI for placeholder is encouraged for instant rendering.
- *
- * @attribute placeholder
- * @type string
- * @default null
*/
placeholder: {
type: String,
@@ -89,10 +65,6 @@
/**
* When `preload` is true, setting `fade` to true will cause the image to
* fade into place.
- *
- * @attribute fade
- * @type boolean
- * @default false
*/
fade: {
type: Boolean,
@@ -101,10 +73,6 @@
/**
* Read-only value that is true when the image is loaded.
- *
- * @attribute preloaded
- * @type boolean
- * @default false
*/
loaded: {
notify: true,
@@ -115,10 +83,6 @@
/**
* Read-only value that tracks the loading state of the image when the `preload`
* option is used.
- *
- * @attribute loading
- * @type boolean
- * @default false
*/
loading: {
notify: true,
@@ -129,10 +93,6 @@
/**
* Can be used to set the width of image (e.g. via binding); size may also be
* set via CSS.
- *
- * @attribute width
- * @type number
- * @default null
*/
width: {
observer: '_widthChanged',
@@ -247,11 +207,11 @@
this.style.backgroundPosition =
placeholderStyle.backgroundPosition =
- this.sizing ? this.position : null;
+ this.sizing ? this.position : '';
this.style.backgroundRepeat =
placeholderStyle.backgroundRepeat =
- this.sizing ? 'no-repeat' : null;
+ this.sizing ? 'no-repeat' : '';
},
_loadBehaviorChanged: function() {
diff --git a/third_party/polymer/v1_0/components-chromium/iron-input/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-input/.bower.json
index 5120860c..1383a44 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-input/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-input/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-input",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "An input element with data binding",
"authors": [
"The Polymer Authors"
@@ -26,17 +26,18 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "f54d4945cf96ede414904055547fd4c46dc0c053"
+ "tag": "v1.0.3",
+ "commit": "edb505f41d67120cb505deedb92aa69e90078d2f"
},
"_source": "git://github.com/PolymerElements/iron-input.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-input/bower.json b/third_party/polymer/v1_0/components-chromium/iron-input/bower.json
index 15142ba..c4c8951 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-input/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-input/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-input",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "An input element with data binding",
"authors": [
"The Polymer Authors"
@@ -26,6 +26,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-input/iron-input-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-input/iron-input-extracted.js
index 4e9067a..09f0053 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-input/iron-input-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-input/iron-input-extracted.js
@@ -73,13 +73,18 @@ is separate from validation, and `allowed-pattern` does not affect how the input
_previousValidInput: {
type: String,
value: ''
+ },
+
+ _patternAlreadyChecked: {
+ type: Boolean,
+ value: false
}
},
listeners: {
'input': '_onInput',
- 'keydown': '_onKeydown'
+ 'keypress': '_onKeypress'
},
get _patternRegExp() {
@@ -104,33 +109,54 @@ is separate from validation, and `allowed-pattern` does not affect how the input
_bindValueChanged: function() {
if (this.value !== this.bindValue) {
- this.value = this.bindValue;
+ this.value = !this.bindValue ? '' : this.bindValue;
}
// manually notify because we don't want to notify until after setting value
this.fire('bind-value-changed', {value: this.bindValue});
},
_onInput: function() {
- this.bindValue = this.value;
- },
+ // Need to validate each of the characters pasted if they haven't
+ // been validated inside `_onKeypress` already.
+ if (this.preventInvalidInput && !this._patternAlreadyChecked) {
+ var valid = this._checkPatternValidity();
+ if (!valid) {
+ this.value = this._previousValidInput;
+ }
+ }
- _isPrintable: function(keyCode) {
- var printable =
- (keyCode > 47 && keyCode < 58) || // number keys
- keyCode == 32 || keyCode == 13 || // spacebar & return key
- (keyCode > 64 && keyCode < 91) || // letter keys
- (keyCode > 95 && keyCode < 112) || // numpad keys
- (keyCode > 185 && keyCode < 193) || // ;=,-./` (in order)
- (keyCode > 218 && keyCode < 223); // [\]' (in order)
- return printable;
+ this.bindValue = this.value;
+ this._previousValidInput = this.value;
+ this._patternAlreadyChecked = false;
},
- // convert printable numpad keys to number keys
- _correctNumpadKeys: function(keyCode) {
- return (keyCode > 95 && keyCode < 112) ? keyCode - 48 : keyCode;
+ _isPrintable: function(event) {
+ // What a control/printable character is varies wildly based on the browser.
+ // - most control characters (arrows, backspace) do not send a `keypress` event
+ // in Chrome, but the *do* on Firefox
+ // - in Firefox, when they do send a `keypress` event, control chars have
+ // a charCode = 0, keyCode = xx (for ex. 40 for down arrow)
+ // - printable characters always send a keypress event.
+ // - in Firefox, printable chars always have a keyCode = 0. In Chrome, the keyCode
+ // always matches the charCode.
+ // None of this makes any sense.
+
+ var nonPrintable =
+ (event.keyCode == 8) || // backspace
+ (event.keyCode == 19) || // pause
+ (event.keyCode == 20) || // caps lock
+ (event.keyCode == 27) || // escape
+ (event.keyCode == 45) || // insert
+ (event.keyCode == 46) || // delete
+ (event.keyCode == 144) || // num lock
+ (event.keyCode == 145) || // scroll lock
+ (event.keyCode > 32 && event.keyCode < 41) || // page up/down, end, home, arrows
+ (event.keyCode > 111 && event.keyCode < 124); // fn keys
+
+ return !(event.charCode == 0 && nonPrintable);
},
- _onKeydown: function(event) {
+ _onKeypress: function(event) {
if (!this.preventInvalidInput && this.type !== 'number') {
return;
}
@@ -138,22 +164,45 @@ is separate from validation, and `allowed-pattern` does not affect how the input
if (!regexp) {
return;
}
- var thisChar = String.fromCharCode(this._correctNumpadKeys(event.keyCode));
- if (this._isPrintable(event.keyCode) && !regexp.test(thisChar)) {
+
+ // Handle special keys and backspace
+ if (event.metaKey || event.ctrlKey || event.altKey)
+ return;
+
+ // Check the pattern either here or in `_onInput`, but not in both.
+ this._patternAlreadyChecked = true;
+
+ var thisChar = String.fromCharCode(event.charCode);
+ if (this._isPrintable(event) && !regexp.test(thisChar)) {
event.preventDefault();
}
},
+ _checkPatternValidity: function() {
+ var regexp = this._patternRegExp;
+ if (!regexp) {
+ return true;
+ }
+ for (var i = 0; i < this.value.length; i++) {
+ if (!regexp.test(this.value[i])) {
+ return false;
+ }
+ }
+ return true;
+ },
+
/**
* Returns true if `value` is valid. The validator provided in `validator` will be used first,
* then any constraints.
- * @return {Boolean} True if the value is valid.
+ * @return {boolean} True if the value is valid.
*/
validate: function() {
// Empty, non-required input is valid.
- if (!this.required && this.value == '')
+ if (!this.required && this.value == '') {
+ this.invalid = false;
return true;
-
+ }
+
var valid;
if (this.hasValidator()) {
valid = Polymer.IronValidatableBehavior.validate.call(this, this.value);
diff --git a/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/.bower.json
index 31660e4..ae094c55 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-jsonp-library",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Loads jsonp libraries",
"authors": [
"Aleks Totic <a@totic.org>",
@@ -20,19 +20,20 @@
"/demo/"
],
"dependencies": {
- "polymer": "Polymer/polymer#^1.0.0",
- "iron-ajax": "PolymerElements/iron-ajax#^1.0.0"
+ "polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"web-component-tester": "*",
- "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "paper-spinner": "PolymerElements/paper-spinner#^1.0.1"
},
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "2957a77f8797e59f2cd97a61b9844c4f7a716f19"
+ "tag": "v1.0.1",
+ "commit": "4f1b758be4b000cd7d1f5cce7088d210d5b0b280"
},
"_source": "git://github.com/PolymerElements/iron-jsonp-library.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/bower.json b/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/bower.json
index 7f865fe..e387f62 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-jsonp-library",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Loads jsonp libraries",
"authors": [
"Aleks Totic <a@totic.org>",
@@ -20,12 +20,13 @@
"/demo/"
],
"dependencies": {
- "polymer": "Polymer/polymer#^1.0.0",
- "iron-ajax": "PolymerElements/iron-ajax#^1.0.0"
+ "polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"web-component-tester": "*",
- "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "paper-spinner": "PolymerElements/paper-spinner#^1.0.1"
}
}
diff --git a/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/iron-jsonp-library-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/iron-jsonp-library-extracted.js
index 210f6a3..bbdb50e 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/iron-jsonp-library-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-jsonp-library/iron-jsonp-library-extracted.js
@@ -12,6 +12,7 @@
when possible instead of using this element.
@hero hero.svg
+ @demo demo/index.html
@polymerBehavior
*/
Polymer.IronJsonpLibraryBehavior = {
@@ -87,14 +88,14 @@
}
};
- /*
+ /**
* LoaderMap keeps track of all Loaders
*/
var LoaderMap = {
apiMap: {}, // { hash -> Loader }
- /*
- * @param {function} notifyCallback loaded callback fn(result)
+ /**
+ * @param {Function} notifyCallback loaded callback fn(result)
* @param {string} jsonpCallbackName name of jsonpcallback. If API does not provide it, leave empty. Optional.
*/
require: function(url, notifyCallback, jsonpCallbackName) {
@@ -115,6 +116,7 @@
}
};
+ /** @constructor */
var Loader = function(name, url, callbackName) {
this.notifiers = []; // array of notifyFn [ notifyFn* ]
@@ -173,7 +175,7 @@
delete window[this.callbackName];
},
- notifyAll: function(notifyCallback) {
+ notifyAll: function() {
this.notifiers.forEach( function(notifyCallback) {
notifyCallback(this.error, this.result);
}.bind(this));
diff --git a/third_party/polymer/v1_0/components-chromium/iron-localstorage/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-localstorage/.bower.json
index 4e59d72..c37bfa7 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-localstorage/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-localstorage/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-localstorage",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Provides access to local storage",
"keywords": [
"web-component",
@@ -17,13 +17,15 @@
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
- "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "paper-checkbox": "PolymerElements/paper-checkbox#^1.0.1"
},
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "cecc6c2578287e779ffd76056cf5cf023799fc21"
+ "tag": "v1.0.1",
+ "commit": "7e8d167ef295e7cf7cb8f0729c57d7e65e0ee64f"
},
"_source": "git://github.com/PolymerElements/iron-localstorage.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-localstorage/bower.json b/third_party/polymer/v1_0/components-chromium/iron-localstorage/bower.json
index 95784b64a..1c481d5 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-localstorage/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-localstorage/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-localstorage",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Provides access to local storage",
"keywords": [
"web-component",
@@ -17,6 +17,8 @@
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
- "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "paper-checkbox": "PolymerElements/paper-checkbox#^1.0.1"
}
}
diff --git a/third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage-extracted.js
index 86b5c50..baf6df9 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage-extracted.js
@@ -6,9 +6,9 @@
/**
* Fired when value loads from localStorage.
*
- * @param {Object} detail
- * @param {Boolean} detail.externalChange true if change occured in different window
- * @event iron-localstorage-load
+ * @event paper-responsive-change
+ * @param {{externalChange: boolean}} detail -
+ * externalChange: True if change occured in different window.
*/
/**
@@ -28,6 +28,7 @@
/**
* The data associated with this storage.
* If value is set to null, and storage is in useRaw mode, item will be deleted
+ * @type {*}
*/
value: {
type: Object,
@@ -109,10 +110,10 @@
/**
* loads value from local storage
- * @param {Boolean} externalChange true if loading changes from a different window
+ * @param {boolean=} externalChange true if loading changes from a different window
*/
_load: function(externalChange) {
- var v = localStorage.getItem(this.name);
+ var v = window.localStorage.getItem(this.name);
if (v === null) {
this.fire('iron-localstorage-load-empty');
@@ -139,9 +140,9 @@
var v = this.useRaw ? this.value : JSON.stringify(this.value);
try {
if (this.value === null) {
- localStorage.removeItem(this.name);
+ window.localStorage.removeItem(this.name);
} else {
- localStorage.setItem(this.name, v);
+ window.localStorage.setItem(this.name, /** @type {string} */ (v));
}
}
catch(ex) {
diff --git a/third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage.html b/third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage.html
index c38d814..9c08b74 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage.html
+++ b/third_party/polymer/v1_0/components-chromium/iron-localstorage/iron-localstorage.html
@@ -11,7 +11,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<!--
Element access to Web Storage API (window.localStorage).
-Keeps `value` is sync with a localStorage key.
+Keeps `value` in sync with a localStorage key.
Direct assignments to `value` are automatically detected and saved.
Subproperty assignments are not (ex: `value.bar='foo'`).
diff --git a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/.bower.json
index dd439c4..7a37c57 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-overlay-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay",
"private": true,
@@ -26,6 +26,7 @@
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
@@ -34,11 +35,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-overlay-behavior",
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "03debac2eb637f2b3e68edb05d8f1e5902e81ebc"
+ "tag": "v1.0.2",
+ "commit": "e84965cddda459c9e4a24e8d442c56ba4d5823eb"
},
"_source": "git://github.com/PolymerElements/iron-overlay-behavior.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/bower.json b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/bower.json
index 7d4dead..de2114b 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-overlay-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay",
"private": true,
@@ -26,6 +26,7 @@
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-behavior-extracted.js
index 171e421..f42def0 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-overlay-behavior/iron-overlay-behavior-extracted.js
@@ -1,6 +1,6 @@
-/*
+/**
Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden or shown, and displays
on top of other content. It includes an optional backdrop, and can be used to implement a variety
of UI controls including dialogs and drop downs. Multiple overlays may be displayed at once.
@@ -121,6 +121,17 @@ context. You should place this element as a child of `<body>` whenever possible.
},
+/**
+ * Fired after the `iron-overlay` opens.
+ * @event iron-overlay-opened
+ */
+
+/**
+ * Fired after the `iron-overlay` closes.
+ * @event iron-overlay-closed {{canceled: boolean}} detail -
+ * canceled: True if the overlay was canceled.
+ */
+
listeners: {
'click': '_onClick',
'iron-resize': '_onIronResize'
@@ -402,14 +413,4 @@ context. You should place this element as a child of `<body>` whenever possible.
/** @polymerBehavior */
Polymer.IronOverlayBehavior = [Polymer.IronFitBehavior, Polymer.IronResizableBehavior, Polymer.IronOverlayBehaviorImpl];
-/*
- * Fired after the `iron-overlay` opens.
- * @event iron-overlay-opened
- */
-
-/*
- * Fired after the `iron-overlay` closes.
- * @event iron-overlay-closed {{canceled: boolean}} detail -
- * canceled: True if the overlay was canceled.
- */
diff --git a/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/.bower.json
index e274324..b1acc42 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-validatable-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Provides a behavior for an element that validates user input",
"authors": "The Polymer Authors",
"keywords": [
@@ -25,17 +25,18 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "63513294174960e48dfb4617f55e716de3c9fc49"
+ "tag": "1.0.2",
+ "commit": "a4fc340fdb268e274f312dadedd0633b025ac3a4"
},
"_source": "git://github.com/PolymerElements/iron-validatable-behavior.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/bower.json b/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/bower.json
index 3b66313..eaab387 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-validatable-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Provides a behavior for an element that validates user input",
"authors": "The Polymer Authors",
"keywords": [
@@ -25,6 +25,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js
index e39fd9e..0e294ff 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-extracted.js
@@ -34,6 +34,7 @@
* True if the last call to `validate` is invalid.
*/
invalid: {
+ notify: true,
reflectToAttribute: true,
type: Boolean,
value: false
@@ -66,7 +67,7 @@
},
/**
- * @return {Boolean} True if the validator `validator` exists.
+ * @return {boolean} True if the validator `validator` exists.
*/
hasValidator: function() {
return this._validator != null;
@@ -74,7 +75,7 @@
/**
* @param {Object} values Passed to the validator's `validate()` function.
- * @return {Boolean} True if `values` is valid.
+ * @return {boolean} True if `values` is valid.
*/
validate: function(values) {
var valid = this._validator && this._validator.validate(values);
diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-behaviors/.bower.json
index 4036b8dcc..ce085ea 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-behaviors",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Common behaviors across the paper elements",
"authors": [
"The Polymer Authors"
@@ -36,11 +36,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "cf1b11e381a8df169efe2c3aaf08e2787dda31b9"
+ "tag": "v1.0.2",
+ "commit": "4dd226a2cc5b780a73d0058cd9998b6e0af1cb2c"
},
"_source": "git://github.com/PolymerElements/paper-behaviors.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/bower.json b/third_party/polymer/v1_0/components-chromium/paper-behaviors/bower.json
index 0d55094..d4cae45 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-behaviors",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Common behaviors across the paper elements",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js
index 5b2319a..b830c52 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-button-behavior-extracted.js
@@ -33,6 +33,7 @@
}
};
+ /** @polymerBehavior */
Polymer.PaperButtonBehavior = [
Polymer.IronButtonState,
Polymer.IronControlState,
diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js
new file mode 100644
index 0000000..9130ec1
--- /dev/null
+++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior-extracted.js
@@ -0,0 +1,30 @@
+
+
+ /**
+ * `Polymer.PaperInkyFocusBehavior` implements a ripple when the element has keyboard focus.
+ *
+ * @polymerBehavior Polymer.PaperInkyFocusBehavior
+ */
+ Polymer.PaperInkyFocusBehaviorImpl = {
+
+ observers: [
+ '_focusedChanged(receivedFocusFromKeyboard)'
+ ],
+
+ _focusedChanged: function(receivedFocusFromKeyboard) {
+ if (!this.$.ink) {
+ return;
+ }
+
+ this.$.ink.holdDown = receivedFocusFromKeyboard;
+ }
+
+ };
+
+ /** @polymerBehavior Polymer.PaperInkyFocusBehavior */
+ Polymer.PaperInkyFocusBehavior = [
+ Polymer.IronButtonState,
+ Polymer.IronControlState,
+ Polymer.PaperInkyFocusBehaviorImpl
+ ];
+
diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-radio-button-behavior.html b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior.html
index 28c0d5b..7320287 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-radio-button-behavior.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-inky-focus-behavior.html
@@ -9,4 +9,4 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--><html><head><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-behaviors/iron-button-state.html">
-</head><body><script src="paper-radio-button-behavior-extracted.js"></script></body></html> \ No newline at end of file
+</head><body><script src="paper-inky-focus-behavior-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-radio-button-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-radio-button-behavior-extracted.js
deleted file mode 100644
index 11c5cfc..0000000
--- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-radio-button-behavior-extracted.js
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- /** @polymerBehavior */
- Polymer.PaperRadioButtonInk = {
-
- observers: [
- '_focusedChanged(receivedFocusFromKeyboard)'
- ],
-
- _focusedChanged: function(receivedFocusFromKeyboard) {
- if (!this.$.ink) {
- return;
- }
-
- this.$.ink.holdDown = receivedFocusFromKeyboard;
- }
-
- };
-
- /** @polymerBehavior */
- Polymer.PaperRadioButtonBehavior = [
- Polymer.IronButtonState,
- Polymer.IronControlState,
- Polymer.PaperRadioButtonInk
- ];
-
diff --git a/third_party/polymer/v1_0/components-chromium/paper-checkbox/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-checkbox/.bower.json
index 27f1492..f4cb1ba 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-checkbox/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-checkbox/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-checkbox",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design checkbox",
"authors": [
"The Polymer Authors"
@@ -34,11 +34,11 @@
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "d7b372fecace143f83ec67d323be9504308e5f5f"
+ "tag": "v1.0.3",
+ "commit": "b32696b963cdcb00223f2a2433ef439363c9a150"
},
"_source": "git://github.com/PolymerElements/paper-checkbox.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-checkbox/bower.json b/third_party/polymer/v1_0/components-chromium/paper-checkbox/bower.json
index 6ae5621..c68d6d83a 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-checkbox/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-checkbox/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-checkbox",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design checkbox",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js
index c166e07..7907d20 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox-extracted.js
@@ -3,7 +3,7 @@
is: 'paper-checkbox',
behaviors: [
- Polymer.PaperRadioButtonBehavior
+ Polymer.PaperInkyFocusBehavior
],
hostAttributes: {
@@ -76,12 +76,14 @@
if (checked) {
return 'checked';
}
+ return '';
},
_computeCheckmarkClass: function(checked) {
if (!checked) {
return 'hidden';
}
+ return '';
}
})
\ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.css b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.css
index eb203fd..195d822 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.css
+++ b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.css
@@ -37,12 +37,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
left: -15px;
width: 48px;
height: 48px;
- color: var(--paper-checkbox-unchecked-ink-color);
+ color: var(--paper-checkbox-unchecked-ink-color, --primary-text-color);
opacity: 0.6;
}
:host #ink[checked] {
- color: var(--paper-checkbox-checked-ink-color);
+ color: var(--paper-checkbox-checked-ink-color, --default-primary-color);
}
:host #checkbox {
@@ -50,7 +50,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
box-sizing: border-box;
height: 100%;
border: solid 2px;
- border-color: var(--paper-checkbox-unchecked-color);
+ border-color: var(--paper-checkbox-unchecked-color, --primary-text-color);
border-radius: 2px;
pointer-events: none;
-webkit-transition: background-color 140ms, border-color 140ms;
@@ -94,8 +94,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
:host #checkbox.checked {
- background-color: var(--paper-checkbox-checked-color);
- border-color: var(--paper-checkbox-checked-color);
+ background-color: var(--paper-checkbox-checked-color, --default-primary-color);
+ border-color: var(--paper-checkbox-checked-color, --default-primary-color);
}
:host #checkmark {
@@ -122,7 +122,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
padding-left: 8px;
white-space: normal;
pointer-events: none;
- color: var(--paper-checkbox-label-color);
+ color: var(--paper-checkbox-label-color, --primary-text-color);
}
#checkboxLabel[hidden] {
@@ -136,11 +136,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
:host([disabled]) #checkbox {
opacity: 0.5;
- border-color: var(--paper-checkbox-unchecked-color);
+ border-color: var(--paper-checkbox-unchecked-color, --primary-text-color);
}
:host([disabled][checked]) #checkbox {
- background-color: var(--paper-checkbox-unchecked-color);
+ background-color: var(--paper-checkbox-unchecked-color, --primary-text-color);
opacity: 0.5;
}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.html b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.html
index 873a937..6906c15 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-checkbox/paper-checkbox.html
@@ -9,7 +9,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--><html><head><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-styles/default-theme.html">
-<link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<!--
@@ -40,18 +40,6 @@ Custom property | Description | Default
@demo demo/index.html
-->
-<style is="custom-style">
- :root {
- --paper-checkbox-unchecked-color: var(--primary-text-color);
- --paper-checkbox-unchecked-ink-color: var(--primary-text-color);
-
- --paper-checkbox-checked-color: var(--default-primary-color);
- --paper-checkbox-checked-ink-color: var(--default-primary-color);
-
- --paper-checkbox-label-color: var(--primary-text-color);
- }
-</style>
-
</head><body><dom-module id="paper-checkbox">
<link rel="import" type="css" href="paper-checkbox.css">
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/.bower.json
index a47fd0f..532e273 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-dialog-behavior",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Implements a behavior used for material design dialogs",
"authors": "The Polymer Authors",
"keywords": [
@@ -23,7 +23,7 @@
"ignore": [],
"dependencies": {
"iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^1.0.0",
- "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
@@ -34,11 +34,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "cd65087ca07495d546bc46618563e53ceacd5325"
+ "tag": "v1.0.2",
+ "commit": "156945a20318c11bb65d0bc83ef402262c3071ca"
},
"_source": "git://github.com/PolymerElements/paper-dialog-behavior.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/bower.json b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/bower.json
index 7b3e6c1..cdd57c6 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-dialog-behavior",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Implements a behavior used for material design dialogs",
"authors": "The Polymer Authors",
"keywords": [
@@ -23,7 +23,7 @@
"ignore": [],
"dependencies": {
"iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^1.0.0",
- "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js
index 56dbb01..18689a5 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-behavior-extracted.js
@@ -1,6 +1,6 @@
-/*
+/**
Use `Polymer.PaperDialogBehavior` and `paper-dialog-common.css` to implement a Material Design
dialog.
@@ -68,8 +68,9 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
value: false
},
+ /** @type {?Node} */
_lastFocusedElement: {
- type: Node
+ type: Object
},
_boundOnFocus: {
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-common.css b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-common.css
index 57c665d..67bddb19 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-common.css
+++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-behavior/paper-dialog-common.css
@@ -15,6 +15,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
background: var(--paper-dialog-background-color, --primary-background-color);
color: var(--paper-dialog-color, --primary-text-color);
+ @apply(--layout-scroll);
@apply(--paper-font-body1);
@apply(--shadow-elevation-16dp);
@apply(--paper-dialog);
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/.bower.json
index 88e5eb3..a7eda78 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-dialog-scrollable",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A scrollable area used inside the material design dialog",
"authors": [
"The Polymer Authors"
@@ -33,11 +33,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "9d27cbdedfb4b4b06eefffbf99d0e7fa97c3e248"
+ "tag": "v1.0.1",
+ "commit": "94e65968791d9166d2d3bf186e449d042b10168f"
},
"_source": "git://github.com/PolymerElements/paper-dialog-scrollable.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/bower.json b/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/bower.json
index 99553af..17ae8f7 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-dialog-scrollable",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A scrollable area used inside the material design dialog",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/paper-dialog-scrollable-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/paper-dialog-scrollable-extracted.js
index b0335a7..7be247e 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/paper-dialog-scrollable-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-dialog-scrollable/paper-dialog-scrollable-extracted.js
@@ -10,6 +10,7 @@
/**
* The dialog element that implements `Polymer.PaperDialogBehavior` containing this element.
+ * @type {?Node}
*/
dialogElement: {
type: Object,
diff --git a/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/.bower.json
index f226642..e49fa46 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-drawer-panel",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A responsive drawer panel",
"authors": [
"The Polymer Authors"
@@ -30,11 +30,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "6294619b9eb3a9346854daef1b00fb3342dffef9"
+ "tag": "v1.0.2",
+ "commit": "691739c877914f7231eaca16b724bdca295dfe8d"
},
"_source": "git://github.com/PolymerElements/paper-drawer-panel.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/bower.json b/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/bower.json
index 52edc76..f87cca9 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-drawer-panel",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A responsive drawer panel",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js
index 5382e3c..b3de143 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-drawer-panel/paper-drawer-panel-extracted.js
@@ -74,7 +74,9 @@
*/
dragging: {
type: Boolean,
- value: false
+ value: false,
+ readOnly: true,
+ notify: true
},
/**
@@ -130,6 +132,7 @@
reflectToAttribute: true,
type: Boolean,
value: false,
+ readOnly: true,
notify: true
},
@@ -138,7 +141,9 @@
*/
peeking: {
type: Boolean,
- value: false
+ value: false,
+ readOnly: true,
+ notify: true
},
/**
@@ -163,6 +168,7 @@
*/
selected: {
reflectToAttribute: true,
+ notify: true,
type: String,
value: null
},
@@ -289,7 +295,7 @@
},
_responsiveChange: function(narrow) {
- this.narrow = narrow;
+ this._setNarrow(narrow);
if (this.narrow) {
this.selected = this.defaultSelected;
@@ -320,12 +326,12 @@
this.width = this.$.drawer.offsetWidth;
this._moveDrawer(this._translateXForDeltaX(this.rightDrawer ?
-this.edgeSwipeSensitivity : this.edgeSwipeSensitivity));
- this.peeking = true;
+ this._setPeeking(true);
},
_stopEdgePeek: function() {
if (this.peeking) {
- this.peeking = false;
+ this._setPeeking(false);
this._moveDrawer(null);
}
},
@@ -364,13 +370,13 @@
x <= this.edgeSwipeSensitivity);
},
- _trackStart: function() {
+ _trackStart: function(event) {
if (this._swipeAllowed()) {
sharedPanel = this;
- this.dragging = true;
+ this._setDragging(true);
if (this._isMainSelected()) {
- this.dragging = this.peeking || this._isEdgeTouch(event);
+ this._setDragging(this.peeking || this._isEdgeTouch(event));
}
if (this.dragging) {
@@ -399,7 +405,7 @@
// Ignore trackx until we move past the edge peek.
return;
}
- this.peeking = false;
+ this._setPeeking(false);
}
this._moveDrawer(this._translateXForDeltaX(dx));
@@ -410,7 +416,7 @@
if (this.dragging) {
var xDirection = e.detail.dx > 0;
- this.dragging = false;
+ this._setDragging(false);
this.transition = true;
sharedPanel = null;
this._moveDrawer(null);
diff --git a/third_party/polymer/v1_0/components-chromium/paper-fab/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-fab/.bower.json
index 4fe9c9f..15e922a 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-fab/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-fab/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-fab",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A material design floating action button",
"authors": [
"The Polymer Authors"
@@ -36,11 +36,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "3c626a4d116d774e9f4db3a3e0f92b0c8148f12e"
+ "tag": "v1.0.2",
+ "commit": "59d2f77f456271f1ae4059b92d83ba7655fb1580"
},
"_source": "git://github.com/PolymerElements/paper-fab.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-fab/bower.json b/third_party/polymer/v1_0/components-chromium/paper-fab/bower.json
index b195ccb..f3738a2 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-fab/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-fab/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-fab",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A material design floating action button",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab-extracted.js
index 649e445..fe84252 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab-extracted.js
@@ -45,6 +45,14 @@
type: Boolean,
value: false
}
+ },
+
+ _computeContentClass: function(receivedFocusFromKeyboard) {
+ var className = 'content';
+ if (receivedFocusFromKeyboard) {
+ className += ' keyboard-focus';
+ }
+ return className;
}
});
diff --git a/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab.html b/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab.html
index 320293a..f0b147a 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-fab/paper-fab.html
@@ -40,7 +40,8 @@ The following custom properties and mixins are available for styling:
Custom property | Description | Default
----------------|-------------|----------
-`--paper-fab-background` | The background color of the button | `--paper-indigo-500`
+`--paper-fab-background` | The background color of the button | `--accent-color`
+`--paper-fab-keyboard-focus-background` | The background color of the button when focused | `--paper-pink-900`
`--paper-fab-disabled-background` | The background color of the button when it's disabled | `--paper-grey-300`
`--paper-fab-disabled-text` | The text color of the button when it's disabled | `--paper-grey-500`
`--paper-fab` | Mixin applied to the button | `{}`
@@ -69,7 +70,7 @@ Custom property | Description | Default
min-width: 0;
width: 56px;
height: 56px;
- background: var(--paper-fab-background, --paper-indigo-500);
+ background: var(--paper-fab-background, --accent-color);
color: var(--text-primary-color);
border-radius: 50%;
padding: 16px;
@@ -95,11 +96,18 @@ Custom property | Description | Default
paper-material {
border-radius: inherit;
+ @apply(--layout-fit);
+ @apply(--layout-vertical);
+ @apply(--layout-center-center);
+ }
+
+ .keyboard-focus {
+ background: var(--paper-fab-keyboard-focus-background, --paper-pink-900);
}
</style>
<template>
<paper-ripple></paper-ripple>
- <paper-material class="content fit flex layout vertical center-center" elevation="[[elevation]]" animated="">
+ <paper-material class$="[[_computeContentClass(receivedFocusFromKeyboard)]]" elevation="[[_elevation]]" animated="">
<iron-icon id="icon" src="[[src]]" icon="[[icon]]"></iron-icon>
</paper-material>
</template>
diff --git a/third_party/polymer/v1_0/components-chromium/paper-header-panel/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-header-panel/.bower.json
index 394924f..6129668 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-header-panel/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-header-panel/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-header-panel",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A header and content wrapper for layout with headers",
"authors": [
"The Polymer Authors"
@@ -25,11 +25,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "ec388b9579fe61ce84e498132cd33ec275e8e398"
+ "tag": "v1.0.2",
+ "commit": "19cde2fc5dfd51439e3433b3d5e6b618d444cb0a"
},
"_source": "git://github.com/PolymerElements/paper-header-panel.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-header-panel/bower.json b/third_party/polymer/v1_0/components-chromium/paper-header-panel/bower.json
index 57314e7..62efe83 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-header-panel/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-header-panel/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-header-panel",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A header and content wrapper for layout with headers",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel-extracted.js
index 9a6ca40..1b1f071 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel-extracted.js
@@ -213,7 +213,7 @@
header.classList.remove(this.tallClass);
this.async(function() {
header.classList.remove('animate');
- }, null, animateDuration);
+ }, animateDuration);
} else {
header.classList.toggle('animate', configs.tallMode[newMode]);
}
@@ -236,7 +236,7 @@
_scroll: function(e) {
this._keepScrollingState();
- this.fire('content-scroll', {target: this.scroller}, this, false);
+ this.fire('content-scroll', {target: this.scroller}, {bubbles: false});
},
_getScrollerForMode: function(mode) {
diff --git a/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel.html b/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel.html
index 9a6ec35..ac5c7e1 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-header-panel/paper-header-panel.html
@@ -64,7 +64,7 @@ Mode | Description
`scroll` | The header keeps its seam with the panel, and is pushed off screen.
`cover` | The panel covers the whole `paper-header-panel` including the header. This allows user to style the panel in such a way that the panel is partially covering the header.
-Example:
+Example:
<paper-header-panel mode="waterfall">
<div class="paper-header">standard</div>
@@ -125,6 +125,17 @@ To change the panel container in different modes:
z-index: 0;
}
+ :root {
+ /**
+ * Default paper header panel shadow
+ */
+ --paper-header-panel-shadow: {
+ height: 6px;
+ bottom: -6px;
+ box-shadow: inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);
+ };
+ }
+
#mainContainer {
@apply(--layout-flex);
@@ -228,17 +239,4 @@ To change the panel container in different modes:
</dom-module>
-<style is="custom-style">
- :root {
- /**
- * Default paper header panel shadow
- */
- --paper-header-panel-shadow: {
- height: 6px;
- bottom: -6px;
- box-shadow: inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);
- };
- }
-</style>
-
<script src="paper-header-panel-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/paper-icon-button/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-icon-button/.bower.json
index f5ebf09..71c8d45 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-icon-button/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-icon-button/.bower.json
@@ -1,7 +1,7 @@
{
"name": "paper-icon-button",
"private": true,
- "version": "1.0.0",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "A material design icon button",
"main": "paper-icon-button.html",
@@ -25,17 +25,17 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
- "iron-component-page": "polymerelements/iron-component-page#^0.9.0",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-icon-button",
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "0db7b75d5e37d8521b6aceb94b185a57145699d9"
+ "tag": "v1.0.2",
+ "commit": "b22ade2080f2527760eae41e4700c52d4689a866"
},
"_source": "git://github.com/PolymerElements/paper-icon-button.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-icon-button/bower.json b/third_party/polymer/v1_0/components-chromium/paper-icon-button/bower.json
index 879efb1..6886757 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-icon-button/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-icon-button/bower.json
@@ -1,7 +1,7 @@
{
"name": "paper-icon-button",
"private": true,
- "version": "1.0.0",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "A material design icon button",
"main": "paper-icon-button.html",
@@ -25,7 +25,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
- "iron-component-page": "polymerelements/iron-component-page#^0.9.0",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js
index b2698d2..c04bcd6 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button-extracted.js
@@ -2,9 +2,13 @@
Polymer({
is: 'paper-icon-button',
+ hostAttributes: {
+ role: 'button',
+ tabindex: '0'
+ },
+
behaviors: [
- Polymer.PaperButtonBehavior,
- Polymer.PaperRadioButtonBehavior
+ Polymer.PaperInkyFocusBehavior
],
properties: {
@@ -23,6 +27,23 @@
*/
icon: {
type: String
+ },
+
+ /**
+ * Specifies the alternate text for the button, for accessibility.
+ */
+ alt: {
+ type: String,
+ observer: "_altChanged"
+ }
+ },
+
+ _altChanged: function(newValue, oldValue) {
+ var label = this.getAttribute('aria-label');
+
+ // Don't stomp over a user-set aria-label.
+ if (!label || oldValue == label) {
+ this.setAttribute('aria-label', newValue);
}
}
});
diff --git a/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button.html b/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button.html
index 45d584b..cad8699 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-icon-button/paper-icon-button.html
@@ -11,15 +11,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="../paper-behaviors/paper-button-behavior.html">
-<link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
-<style is="custom-style">
- :root {
- --paper-icon-button-disabled-text: var(--disabled-text-color);
- }
-</style>
-
<!--
Material Design: <a href="http://www.google.com/design/spec/components/buttons.html">Buttons</a>
@@ -97,7 +91,7 @@ Custom property | Description | Default
}
:host([disabled]) {
- color: var(--paper-icon-button-disabled-text, #fff);
+ color: var(--paper-icon-button-disabled-text, --disabled-text-color);
pointer-events: none;
cursor: auto;
@apply(--paper-icon-button-disabled);
@@ -105,7 +99,7 @@ Custom property | Description | Default
</style>
<template>
<paper-ripple id="ink" class="circle" center=""></paper-ripple>
- <iron-icon id="icon" src="[[src]]" icon="[[icon]]"></iron-icon>
+ <iron-icon id="icon" src="[[src]]" icon="[[icon]]" alt$="[[alt]]"></iron-icon>
</template>
</dom-module>
<script src="paper-icon-button-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-input/.bower.json
index fc83cc2..12c5a8c 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-input",
- "version": "1.0.0",
+ "version": "1.0.3",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@@ -41,11 +41,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "47a869b431fd03b9f611aee8eb286f0497ad379b"
+ "tag": "v1.0.3",
+ "commit": "5d3c8a4a95fce54f4b8b6a5e5b319e821a080447"
},
"_source": "git://github.com/PolymerElements/paper-input.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/bower.json b/third_party/polymer/v1_0/components-chromium/paper-input/bower.json
index d98556e..d25cce1 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-input",
- "version": "1.0.0",
+ "version": "1.0.3",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-addon-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-addon-behavior-extracted.js
index dda2f2e..14a5f1a 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-addon-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-addon-behavior-extracted.js
@@ -18,10 +18,14 @@
/**
* The function called by `<paper-input-container>` when the input value or validity changes.
- * @param {Object} state All properties are optional.
- * @param {Node} state.inputElement The input element.
- * @param {String} state.value The input value.
- * @param {Boolean} state.invalid True if the input value is invalid.
+ * @param {{
+ * inputElement: (Node|undefined),
+ * value: (string|undefined),
+ * invalid: (boolean|undefined)
+ * }} state All properties are optional -
+ * inputElement: The input element.
+ * value: The input value.
+ * invalid: True if the input value is invalid.
*/
update: function(state) {
}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js
index 2a0d54c..ff51360 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js
@@ -190,7 +190,9 @@
* A placeholder string in addition to the label. If this is set, the label will always float.
*/
placeholder: {
- type: String
+ type: String,
+ // need to set a default so _computeAlwaysFloatLabel is run
+ value: ''
},
/**
@@ -253,10 +255,32 @@
/**
* Validates the input element and sets an error style if needed.
*/
- validate: function () {
+ validate: function() {
return this.inputElement.validate();
},
+ /**
+ * Restores the cursor to its original position after updating the value.
+ * @param {string} newValue The value that should be saved.
+ */
+ updateValueAndPreserveCaret: function(newValue) {
+ // Not all elements might have selection, and even if they have the
+ // right properties, accessing them might throw an exception (like for
+ // <input type=number>)
+ try {
+ var start = this.inputElement.selectionStart;
+ this.value = newValue;
+
+ // The cursor automatically jumps to the end after re-setting the value,
+ // so restore it to its original position.
+ this.inputElement.selectionStart = start;
+ this.inputElement.selectionEnd = start;
+ } catch (e) {
+ // Just set the value and give up on the caret.
+ this.value = newValue;
+ }
+ },
+
_computeAlwaysFloatLabel: function(alwaysFloatLabel, placeholder) {
return placeholder || alwaysFloatLabel;
},
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
index 3b30b2c..d307fe6 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
@@ -60,10 +60,10 @@
},
_addons: {
- type: Array,
- value: function() {
- return [];
- }
+ type: Array
+ // do not set a default value here intentionally - it will be initialized lazily when a
+ // distributed child is attached, which may occur before configuration for this element
+ // in polyfill.
},
_inputHasContent: {
@@ -93,7 +93,7 @@
_boundOnInput: {
type: Function,
value: function() {
- this._onInput.bind(this)
+ return this._onInput.bind(this);
}
},
@@ -124,6 +124,9 @@
},
ready: function() {
+ if (!this._addons) {
+ this._addons = [];
+ }
this.addEventListener('focus', this._boundOnFocus, true);
this.addEventListener('blur', this._boundOnBlur, true);
if (this.attrForValue) {
@@ -138,8 +141,16 @@
},
_onAddonAttached: function(event) {
- this._addons.push(event.target);
- this._handleValue(this._inputElement);
+ if (!this._addons) {
+ this._addons = [];
+ }
+ var target = event.target;
+ if (this._addons.indexOf(target) === -1) {
+ this._addons.push(target);
+ if (this.isAttached) {
+ this._handleValue(this._inputElement);
+ }
+ }
},
_onFocus: function() {
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container.html b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container.html
index 82ff08e..4b805f5 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container.html
@@ -107,7 +107,7 @@ This element is `display:block` by default, but you can set the `inline` attribu
background: var(--paper-input-container-focus-color, --default-primary-color);
}
- .is-highlighted .focused-line {
+ .underline.is-highlighted .focused-line {
-webkit-transform: none;
transform: none;
-webkit-transition: -webkit-transform 0.25s;
@@ -116,7 +116,7 @@ This element is `display:block` by default, but you can set the `inline` attribu
@apply(--paper-transition-easing);
}
- .is-invalid .focused-line {
+ .underline.is-invalid .focused-line {
background: var(--paper-input-container-invalid-color, --google-red-500);
-webkit-transform: none;
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input.html b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input.html
index f9f900f..078fcf8 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input.html
@@ -69,7 +69,7 @@ style this element.
<label hidden$="[[!label]]">[[label]]</label>
- <input is="iron-input" id="input" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" bind-value="{{value}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" allowedpattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" maxlength$="[[maxlength]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" size$="[[size]]">
+ <input is="iron-input" id="input" aria-labelledby$="[[_ariaLabelledBy]]" aria-describedby$="[[_ariaDescribedBy]]" disabled$="[[disabled]]" bind-value="{{value}}" invalid="{{invalid}}" prevent-invalid-input="[[preventInvalidInput]]" allowed-pattern="[[allowedPattern]]" validator="[[validator]]" type$="[[type]]" pattern$="[[pattern]]" maxlength$="[[maxlength]]" required$="[[required]]" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" minlength$="[[minlength]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" size$="[[size]]">
<template is="dom-if" if="[[errorMessage]]">
<paper-input-error>[[errorMessage]]</paper-input-error>
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea.html b/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea.html
index fc50bba..fa2fbbb 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-textarea.html
@@ -34,11 +34,11 @@ style this element.
</head><body><dom-module id="paper-textarea">
<template>
- <paper-input-container no-label-float$="[[noLabelFloat]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]">
+ <paper-input-container no-label-float$="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]">
<label hidden$="[[!label]]">[[label]]</label>
- <iron-autogrow-textarea id="input" class="paper-input-input" bind-value="{{value}}" required$="[[required]]" maxlength$="[[maxlength]]"></iron-autogrow-textarea>
+ <iron-autogrow-textarea id="input" class="paper-input-input" bind-value="{{value}}" autocomplete$="[[autocomplete]]" autofocus$="[[autofocus]]" inputmode$="[[inputmode]]" name$="[[name]]" placeholder$="[[placeholder]]" readonly$="[[readonly]]" required$="[[required]]" maxlength$="[[maxlength]]"></iron-autogrow-textarea>
<template is="dom-if" if="[[errorMessage]]">
<paper-input-error>[[errorMessage]]</paper-input-error>
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-button/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-radio-button/.bower.json
index a5e2700..921a3c1 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-button/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-button/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-radio-button",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design radio button",
"authors": [
"The Polymer Authors"
@@ -32,11 +32,11 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "922027de73c04f430d74679a167651a8c1db97e8"
+ "tag": "v1.0.3",
+ "commit": "adf0de18d7f0b20b6ee7e891b4f265427fe2e5ff"
},
"_source": "git://github.com/PolymerElements/paper-radio-button.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-button/bower.json b/third_party/polymer/v1_0/components-chromium/paper-radio-button/bower.json
index 51165feb..4612f3d 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-button/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-button/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-radio-button",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design radio button",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js
index 81b0561..7d98f64 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js
@@ -3,7 +3,7 @@
is: 'paper-radio-button',
behaviors: [
- Polymer.PaperRadioButtonBehavior
+ Polymer.PaperInkyFocusBehavior
],
hostAttributes: {
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.css b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.css
index dcb9695..682d8c5 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.css
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.css
@@ -31,12 +31,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
left: -16px;
width: 48px;
height: 48px;
- color: var(--paper-radio-button-unchecked-ink-color);
+ color: var(--paper-radio-button-unchecked-ink-color, --primary-text-color);
opacity: 0.6;
}
:host #ink[checked] {
- color: var(--paper-radio-button-checked-ink-color);
+ color: var(--paper-radio-button-checked-ink-color, --default-primary-color);
}
:host #offRadio {
@@ -47,7 +47,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
height: 12px;
border-radius: 50%;
border: solid 2px;
- border-color: var(--paper-radio-button-unchecked-color);
+ border-color: var(--paper-radio-button-unchecked-color, --primary-text-color);
transition: border-color 0.28s;
}
@@ -58,7 +58,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
width: 8px;
height: 8px;
border-radius: 50%;
- background-color: var(--paper-radio-button-checked-color);
+ background-color: var(--paper-radio-button-checked-color, --default-primary-color);
-webkit-transform: scale(0);
transform: scale(0);
transition: -webkit-transform ease 0.28s;
@@ -66,7 +66,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
:host([checked]) #offRadio {
- border-color: var(--paper-radio-button-checked-color);
+ border-color: var(--paper-radio-button-checked-color, --default-primary-color);
}
:host([checked]) #onRadio {
@@ -81,7 +81,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
margin-left: 10px;
white-space: normal;
pointer-events: none;
- color: var(--paper-radio-button-label-color);
+ color: var(--paper-radio-button-label-color, --primary-text-color);
}
#radioLabel[hidden] {
@@ -94,12 +94,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
:host([disabled]) #offRadio {
- border-color: var(--paper-radio-button-unchecked-color);
+ border-color: var(--paper-radio-button-unchecked-color, --primary-text-color);
opacity: 0.5;
}
:host([disabled][checked]) #onRadio {
- background-color: var(--paper-radio-button-unchecked-color);
+ background-color: var(--paper-radio-button-unchecked-color, --primary-text-color);
opacity: 0.5;
}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.html b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.html
index f50037f..030a143 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button.html
@@ -8,7 +8,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--><html><head><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-styles/default-theme.html">
-<link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<!--
`paper-radio-button` is a button that can be either checked or unchecked.
@@ -40,18 +40,6 @@ Custom property | Description | Default
@demo demo/index.html
-->
-<style is="custom-style">
- :root {
- --paper-radio-button-unchecked-color: var(--primary-text-color);
- --paper-radio-button-unchecked-ink-color: var(--primary-text-color);
-
- --paper-radio-button-checked-color: var(--default-primary-color);
- --paper-radio-button-checked-ink-color: var(--default-primary-color);
-
- --paper-radio-button-label-color: var(--primary-text-color);
- }
-</style>
-
</head><body><dom-module id="paper-radio-button">
<link rel="import" type="css" href="paper-radio-button.css">
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-group/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-radio-group/.bower.json
index 5c09912..327bd4a 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-group/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-group/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-radio-group",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A group of material design radio buttons",
"authors": [
"The Polymer Authors"
@@ -33,11 +33,11 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "b69ba0adcdc5e43773933e91009298360363b7bb"
+ "tag": "v1.0.2",
+ "commit": "8599c003cd2e914e688daed06170955433445c25"
},
"_source": "git://github.com/PolymerElements/paper-radio-group.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-group/bower.json b/third_party/polymer/v1_0/components-chromium/paper-radio-group/bower.json
index 10e8b51..10e1eeb 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-group/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-group/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-radio-group",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A group of material design radio buttons",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js
index 6de17dc..115b8d9 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js
@@ -3,7 +3,8 @@
is: 'paper-radio-group',
behaviors: [
- Polymer.IronA11yKeysBehavior
+ Polymer.IronA11yKeysBehavior,
+ Polymer.IronSelectableBehavior
],
hostAttributes: {
@@ -13,115 +14,75 @@
properties: {
/**
- * Fired when the selected element changes to user interaction.
- *
- * @event paper-radio-group-changed
+ * Overriden from Polymer.IronSelectableBehavior
*/
+ attrForSelected: {
+ type: String,
+ value: 'name'
+ },
/**
- * Gets or sets the selected element. Use the `name` attribute of the
- * <paper-radio-button> that should be selected.
- *
- * @attribute selected
- * @type String
- * @default null
+ * Overriden from Polymer.IronSelectableBehavior
*/
-
- selected: {
+ selectedAttribute: {
type: String,
- value: null,
- notify: true,
- reflectToAttribute: true,
- observer: "_selectedChanged"
+ value: 'checked'
}
},
keyBindings: {
- 'left up': '_selectPrevious',
- 'right down': '_selectNext',
+ 'left up': 'selectPrevious',
+ 'right down': 'selectNext',
},
- _selectedChanged: function() {
- // TODO: This only needs to be async while a domReady event is unavailable.
- this.async(function() {
- this._selectIndex(this._valueToIndex(this.items, this.selected));
- this.fire('paper-radio-group-changed');
- });
- },
+ /**
+ * Selects the given value.
+ */
+ select: function(value) {
+ if (this.selected) {
+ var oldItem = this._valueToItem(this.selected);
+
+ // Do not allow unchecking the selected item.
+ if (this.selected == value) {
+ oldItem.checked = true;
+ return;
+ }
- _selectNext: function() {
- this.selected = this._nextNode();
- },
+ if (oldItem)
+ oldItem.checked = false;
+ }
- _selectPrevious: function() {
- this.selected = this._previousNode();
+ Polymer.IronSelectableBehavior.select.apply(this, [value]);
+ this.fire('paper-radio-group-changed');
},
/**
- * Returns an array of all items.
- *
- * @property items
- * @type array
+ * Selects the previous item. If the previous item is disabled, then it is
+ * skipped, and its previous item is selected
*/
- get items() {
- return Polymer.dom(this.$.items).getDistributedNodes();
- },
+ selectPrevious: function() {
+ var length = this.items.length;
+ var newIndex = Number(this._valueToIndex(this.selected));
- _nextNode: function() {
- var items = this.items;
- var index = this._selectedIndex;
- var newIndex = index;
do {
- newIndex = (newIndex + 1) % items.length;
- if (newIndex === index) {
- break;
- }
- } while (items[newIndex].disabled);
- return this._valueForNode(items[newIndex]);
- },
+ newIndex = (newIndex - 1 + length) % length;
+ } while (this.items[newIndex].disabled)
- _previousNode: function() {
- var items = this.items;
- var index = this._selectedIndex;
- var newIndex = index;
- do {
- newIndex = (newIndex || items.length) - 1;
- if (newIndex === index) {
- break;
- }
- } while (items[newIndex].disabled);
- return this._valueForNode(items[newIndex]);
+ this.select(this._indexToValue(newIndex));
},
- _selectIndex: function(index) {
- if (index == this._selectedIndex)
- return;
-
- var nodes = this.items;
-
- // If there was a previously selected node, deselect it.
- if (nodes[this._selectedIndex]) {
- nodes[this._selectedIndex].checked = false;
- }
+ /**
+ * Selects the next item. If the next item is disabled, then it is
+ * skipped, and its nexy item is selected
+ */
+ selectNext: function() {
+ var length = this.items.length;
+ var newIndex = Number(this._valueToIndex(this.selected));
- // Select a new node.
- nodes[index].checked = true;
- nodes[index].focus();
- this._selectedIndex = index;
- },
+ do {
+ newIndex = (newIndex + 1 + length) % length;
+ } while (this.items[newIndex].disabled)
- _valueForNode: function(node) {
- return node["name"] || node.getAttribute("name");
+ this.select(this._indexToValue(newIndex));
},
-
- // Finds an item with value == |value| and return its index.
- _valueToIndex: function(items, value) {
- for (var index = 0, node; (node = items[index]); index++) {
- if (this._valueForNode(node) == value) {
- return index;
- }
- }
- // If no item found, the value itself is probably the index.
- return value;
- }
});
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group.html b/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group.html
index ff66597..5b8ef2e 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group.html
@@ -7,7 +7,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><html><head><link rel="import" href="../polymer/polymer.html">
-<link rel="import" href="../iron-selector/iron-selector.html">
+<link rel="import" href="../iron-selector/iron-selectable.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
@@ -40,15 +40,13 @@ information about `paper-radio-button`.
display: inline-block;
}
- iron-selector ::content > * {
+ :host ::content > * {
padding: 12px;
}
</style>
<template>
- <iron-selector selected="{{selected}}" attr-for-selected="name" selectable="paper-radio-button">
<content id="items" select="*"></content>
- </iron-selector>
</template>
</dom-module>
diff --git a/third_party/polymer/v1_0/components-chromium/paper-ripple/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-ripple/.bower.json
index 1b45160..93d8b8c 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-ripple/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-ripple/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-ripple",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Adds a material design ripple to any container",
"private": true,
@@ -27,11 +27,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-ripple",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "bcf189cf43bd935dec7a09868988f33a7bdd25fe"
+ "tag": "v1.0.1",
+ "commit": "af19d904802437c305390bb03415c11661de3d0a"
},
"_source": "git://github.com/PolymerElements/paper-ripple.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-ripple/bower.json b/third_party/polymer/v1_0/components-chromium/paper-ripple/bower.json
index 55b8678..b9bb0d9 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-ripple/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-ripple/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-ripple",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Adds a material design ripple to any container",
"private": true,
diff --git a/third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js
index 0e7e265..a760fa2 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-ripple/paper-ripple-extracted.js
@@ -243,6 +243,7 @@
this.wave.style.transform = 'scale3d(' + scale + ',' + scale + ',1)';
},
+ /** @param {Event=} event */
downAction: function(event) {
var xCenter = this.containerMetrics.width / 2;
var yCenter = this.containerMetrics.height / 2;
@@ -287,6 +288,7 @@
this.waveContainer.style.height = this.containerMetrics.size + 'px';
},
+ /** @param {Event=} event */
upAction: function(event) {
if (!this.isMouseDown) {
return;
@@ -410,11 +412,9 @@
var ownerRoot = Polymer.dom(this).getOwnerRoot();
var target;
- if (ownerRoot) {
+ if (this.parentNode.nodeType == 11) { // DOCUMENT_FRAGMENT_NODE
target = ownerRoot.host;
- }
-
- if (!target) {
+ } else {
target = this.parentNode;
}
@@ -428,8 +428,8 @@
},
attached: function() {
- this._listen(this.target, 'up', this.upAction.bind(this));
- this._listen(this.target, 'down', this.downAction.bind(this));
+ this.listen(this.target, 'up', 'upAction');
+ this.listen(this.target, 'down', 'downAction');
if (!this.target.hasAttribute('noink')) {
this.keyEventTarget = this.target;
@@ -455,6 +455,7 @@
}, 1);
},
+ /** @param {Event=} event */
downAction: function(event) {
if (this.holdDown && this.ripples.length > 0) {
return;
@@ -469,6 +470,7 @@
}
},
+ /** @param {Event=} event */
upAction: function(event) {
if (this.holdDown) {
return;
diff --git a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/.bower.json
index 18b4ee3..18736ee 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/.bower.json
@@ -1,7 +1,7 @@
{
"name": "paper-scroll-header-panel",
"description": "A header bar with scrolling behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"private": true,
"authors": "The Polymer Authors",
@@ -36,11 +36,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-scroll-header-panel",
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "2b8db7a3cb8bfc7c8811438dd8cdfbdfda65d4d3"
+ "tag": "v1.0.2",
+ "commit": "99768fba06e038ffdeeb2b229515f9af7b4b1575"
},
"_source": "git://github.com/PolymerElements/paper-scroll-header-panel.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/README.md b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/README.md
index ac1be0c..78f6376 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/README.md
+++ b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/README.md
@@ -24,7 +24,7 @@ paper-scroll-header-panel {
height: 100%;
}
```
-`paper-scroll-header-panel` works well with `paper-toolbar` but can use any element that represents a header by adding a core-header class to it.
+`paper-scroll-header-panel` works well with `paper-toolbar` but can use any element that represents a header by adding a `paper-header` class to it.
```html
<paper-scroll-header-panel>
diff --git a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/bower.json b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/bower.json
index 86ac91c..8075eae 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/bower.json
@@ -1,7 +1,7 @@
{
"name": "paper-scroll-header-panel",
"description": "A header bar with scrolling behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"private": true,
"authors": "The Polymer Authors",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel-extracted.js
index f7aa1f8..9178d3b 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel-extracted.js
@@ -227,7 +227,7 @@
_condenseHeader: function(y) {
var reset = (y === null);
- // adjust top bar in core-header so the top bar stays at the top
+ // adjust top bar in paper-header so the top bar stays at the top
if (!this.scrollAwayTopbar && this.header.$ && this.header.$.topBar) {
this._translateY(this.header.$.topBar.style,
reset ? null : Math.min(y, this._headerMargin));
@@ -255,6 +255,7 @@
setTransform(s, t);
},
+ /** @param {Event=} event */
_scroll: function(event) {
if (!this.header) {
return;
@@ -281,7 +282,7 @@
this._y = y;
if (event) {
- this.fire('content-scroll', {target: this.scroller}, this, false);
+ this.fire('content-scroll', {target: this.scroller}, {cancelable: false});
}
}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel.html b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel.html
index eb18b0d..5bbb33db 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-scroll-header-panel/paper-scroll-header-panel.html
@@ -39,7 +39,7 @@ or, if you would prefer to do it in CSS, just give `html`, `body`, and `paper-sc
}
`paper-scroll-header-panel` works well with `paper-toolbar` but can use any element
-that represents a header by adding a `core-header` class to it.
+that represents a header by adding a `paper-header` class to it.
<paper-scroll-header-panel>
<paper-toolbar>Header</paper-toolbar>
diff --git a/third_party/polymer/v1_0/components-chromium/paper-slider/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-slider/.bower.json
index 9b0a642..99e51fb 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-slider/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-slider/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-slider",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A material design-style slider",
"license": "http://polymer.github.io/LICENSE.txt",
"authors": "The Polymer Authors",
@@ -23,20 +23,25 @@
"paper-progress": "PolymerElements/paper-progress#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
- "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0"
+ "paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
+ "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0",
+ "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-slider",
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "995905314b4aeffab020bdd53b0f68cc7b448a1d"
+ "tag": "v1.0.2",
+ "commit": "88ca34f8b87059a2cb187a4a42f5105756a30eff"
},
"_source": "git://github.com/PolymerElements/paper-slider.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-slider/bower.json b/third_party/polymer/v1_0/components-chromium/paper-slider/bower.json
index c40c262..127b9ac 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-slider/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-slider/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-slider",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A material design-style slider",
"license": "http://polymer.github.io/LICENSE.txt",
"authors": "The Polymer Authors",
@@ -23,11 +23,16 @@
"paper-progress": "PolymerElements/paper-progress#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
- "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0"
+ "paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
+ "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0",
+ "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js
index f69a9d7..b50d22f 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider-extracted.js
@@ -25,11 +25,12 @@
behaviors: [
Polymer.IronRangeBehavior,
- Polymer.IronControlState
+ Polymer.IronA11yKeysBehavior,
+ Polymer.IronFormElementBehavior,
+ Polymer.PaperInkyFocusBehavior
],
properties: {
-
/**
* If true, the slider thumb snaps to tick marks evenly spaced based
* on the `step` property value.
@@ -42,7 +43,7 @@
/**
* If true, a pin with numeric value label is shown when the slider thumb
- * is pressed. Use for settings for which users need to know the exact
+ * is pressed. Use for settings for which users need to know the exact
* value of the setting.
*/
pin: {
@@ -114,6 +115,7 @@
},
markers: {
+ type: Array,
readOnly: true,
value: []
},
@@ -127,8 +129,19 @@
'_immediateValueChanged(immediateValue)'
],
+ hostAttributes: {
+ role: 'slider',
+ tabindex: 0
+ },
+
+ keyBindings: {
+ 'left down pagedown home': '_decrementKey',
+ 'right up pageup end': '_incrementKey'
+ },
+
ready: function() {
// issue polymer/polymer#1305
+
this.async(function() {
this._updateKnob(this.value);
this._updateInputValue();
@@ -169,11 +182,12 @@
},
_immediateValueChanged: function() {
- if (!this.dragging) {
+ if (this.dragging) {
+ this.fire('immediate-value-change');
+ } else {
this.value = this.immediateValue;
}
this._updateInputValue();
- this.fire('immediate-value-change');
},
_secondaryProgressChanged: function() {
@@ -182,23 +196,26 @@
_updateInputValue: function() {
if (this.editable) {
- this.$$('#input').value = this.immediateValue;
+ this.$$('#input').value = this.immediateValue.toString();
}
},
_expandKnob: function() {
+ this.$.ink.holdDown = false;
this._setExpand(true);
},
_resetKnob: function() {
- this._expandJob && this._expandJob.stop();
+ this.cancelDebouncer('expandKnob');
this._setExpand(false);
+ this.$.ink.hidden = true;
},
_positionKnob: function(ratio) {
- this._setImmediateValue(this._calcStep(this._calcKnobPosition(ratio)) || 0);
- this._setRatio(this.snaps ? this._calcRatio(this.immediateValue) : ratio);
- this.$.sliderKnob.style.left = this.ratio * 100 + '%';
+ this._setImmediateValue(this._calcStep(this._calcKnobPosition(ratio)));
+ this._setRatio(this._calcRatio(this.immediateValue));
+
+ this.$.sliderKnob.style.left = (this.ratio * 100) + '%';
},
_inputChange: function() {
@@ -210,75 +227,104 @@
return (this.max - this.min) * ratio + this.min;
},
- _onTrack: function(e) {
+ _onTrack: function(event) {
switch (event.detail.state) {
- case 'end':
- this._trackEnd(event);
+ case 'start':
+ this._trackStart(event);
break;
case 'track':
this._trackX(event);
break;
- case 'start':
- this._trackStart(event);
+ case 'end':
+ this._trackEnd();
break;
}
},
- _trackStart: function(e) {
+ _trackStart: function(event) {
this._w = this.$.sliderBar.offsetWidth;
this._x = this.ratio * this._w;
this._startx = this._x || 0;
this._minx = - this._startx;
this._maxx = this._w - this._startx;
this.$.sliderKnob.classList.add('dragging');
+
this._setDragging(true);
- e.preventDefault();
},
_trackX: function(e) {
if (!this.dragging) {
this._trackStart(e);
}
- var x = Math.min(this._maxx, Math.max(this._minx, e.detail.dx));
- this._x = this._startx + x;
- this._setImmediateValue(this._calcStep(
- this._calcKnobPosition(this._x / this._w)) || 0);
- var s = this.$.sliderKnob.style;
- s.transform = s.webkitTransform = 'translate3d(' + (this.snaps ?
- (this._calcRatio(this.immediateValue) * this._w) - this._startx : x) + 'px, 0, 0)';
+
+ var dx = Math.min(this._maxx, Math.max(this._minx, e.detail.dx));
+ this._x = this._startx + dx;
+
+ var immediateValue = this._calcStep(this._calcKnobPosition(this._x / this._w));
+ this._setImmediateValue(immediateValue);
+
+ // update knob's position
+ var translateX = ((this._calcRatio(immediateValue) * this._w) - this._startx);
+ this.translate3d(translateX + 'px', 0, 0, this.$.sliderKnob);
},
_trackEnd: function() {
- var s = this.$.sliderKnob.style;
- s.transform = s.webkitTransform = '';
+ var s = this.$.sliderKnob.style;
+
this.$.sliderKnob.classList.remove('dragging');
this._setDragging(false);
this._resetKnob();
this.value = this.immediateValue;
+
+ s.transform = s.webkitTransform = '';
+
this.fire('change');
},
- _knobdown: function(e) {
- e.preventDefault();
+ _knobdown: function(event) {
this._expandKnob();
+
+ // cancel selection
+ event.detail.sourceEvent.preventDefault();
+
+ // set the focus manually because we will called prevent default
+ this.focus();
},
- _bardown: function(e) {
- e.preventDefault();
- this._setTransiting(true);
+ _bardown: function(event) {
+ this.$.ink.hidden = true;
+
+ event.preventDefault();
+
this._w = this.$.sliderBar.offsetWidth;
var rect = this.$.sliderBar.getBoundingClientRect();
- var ratio = (e.detail.x - rect.left) / this._w;
+ var ratio = (event.detail.x - rect.left) / this._w;
+ var prevRatio = this.ratio;
+
+ this._setTransiting(true);
+
this._positionKnob(ratio);
- this._expandJob = this.debounce(this._expandJob, this._expandKnob, 60);
+
+ this.debounce('expandKnob', this._expandKnob, 60);
+
+ // if the ratio doesn't change, sliderKnob's animation won't start
+ // and `_knobTransitionEnd` won't be called
+ // Therefore, we need to manually update the `transiting` state
+
+ if (prevRatio === this.ratio) {
+ this._setTransiting(false);
+ }
this.async(function() {
this.fire('change');
});
+
+ // cancel selection
+ event.detail.sourceEvent.preventDefault();
},
- _knobTransitionEnd: function(e) {
- if (e.target === this.$.sliderKnob) {
+ _knobTransitionEnd: function(event) {
+ if (event.target === this.$.sliderKnob) {
this._setTransiting(false);
}
},
@@ -295,14 +341,14 @@
_getClassNames: function() {
var classes = {};
- classes['disabled'] = this.disabled;
- classes['pin'] = this.pin;
- classes['snaps'] = this.snaps;
- classes['ring'] = this.immediateValue <= this.min;
- classes['expand'] = this.expand;
- classes['dragging'] = this.dragging;
- classes['transiting'] = this.transiting;
- classes['editable'] = this.editable;
+ classes.disabled = this.disabled;
+ classes.pin = this.pin;
+ classes.snaps = this.snaps;
+ classes.ring = this.immediateValue <= this.min;
+ classes.expand = this.expand;
+ classes.dragging = this.dragging;
+ classes.transiting = this.transiting;
+ classes.editable = this.editable;
return Object.keys(classes).filter(
function(className) {
@@ -310,8 +356,8 @@
}).join(' ');
},
- _incrementKey: function(ev, keys) {
- if (keys.key === 'end') {
+ _incrementKey: function(event) {
+ if (event.detail.key === 'end') {
this.value = this.max;
} else {
this.increment();
@@ -319,8 +365,8 @@
this.fire('change');
},
- _decrementKey: function(ev, keys) {
- if (keys.key === 'home') {
+ _decrementKey: function(event) {
+ if (event.detail.key === 'home') {
this.value = this.min;
} else {
this.decrement();
diff --git a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.css b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.css
index 0e0f784..0fd8682 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.css
+++ b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.css
@@ -116,7 +116,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
.transiting #sliderBar::shadow #activeProgress {
- transition: -webkit-transform 0.08s ease;
+ -webkit-transition: -webkit-transform 0.08s ease;
transition: transform 0.08s ease;
}
@@ -249,4 +249,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
.disabled.ring > #sliderKnob > #sliderKnobInner {
background-color: transparent;
-} \ No newline at end of file
+}
+
+paper-ripple {
+ color: var(--paper-slider-knob-color, --google-blue-700);
+}
diff --git a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html
index d5a02f9..5761025 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-slider/paper-slider.html
@@ -6,11 +6,14 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
---><html><head><link rel="import" href="../paper-styles/paper-styles.html">
-<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
-<link rel="import" href="../iron-behaviors/iron-control-state.html">
+--><html><head><link rel="import" href="../polymer/polymer.html">
+<link rel="import" href="../paper-styles/paper-styles.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<link rel="import" href="../paper-input/paper-input.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
+<link rel="import" href="../paper-ripple/paper-ripple.html">
+<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
+<link rel="import" href="../iron-form-element-behavior/iron-form-element-behavior.html">
<!--
`paper-slider` allows user to select a value from a range of values by
@@ -79,14 +82,15 @@ To change the slider disabled secondary progress bar color:
-->
</head><body><dom-module id="paper-slider">
+
<link rel="import" type="css" href="paper-slider.css">
- <template>
- <template is="dom-if" if="{{!disabled}}">
- </template>
+ <template>
<div id="sliderContainer" class$="[[_getClassNames(disabled, pin, snaps, immediateValue, min, expand, dragging, transiting, editable)]]">
+
<div class="bar-container">
- <paper-progress id="sliderBar" aria-hidden="true" min="[[min]]" max="[[max]]" value="[[immediateValue]]" secondary-progress="[[secondaryProgress]]" on-down="_bardown" on-up="_resetKnob" on-track="_onTrack"></paper-progress>
+ <paper-progress id="sliderBar" aria-hidden="true" min="[[min]]" max="[[max]]" step="[[step]]" value="[[immediateValue]]" secondary-progress="[[secondaryProgress]]" on-down="_bardown" on-up="_resetKnob" on-track="_onTrack">
+ </paper-progress>
</div>
<template is="dom-if" if="[[snaps]]">
@@ -97,17 +101,18 @@ To change the slider disabled secondary progress bar color:
</div>
</template>
- <div id="sliderKnob" on-down="_knobdown" on-up="_resetKnob" on-track="_onTrack" on-transitionend="_knobTransitionEnd" center-justified="" center="" horizontal="" layout="">
-
- <div id="sliderKnobInner" value$="[[immediateValue]]"></div>
+ <div id="sliderKnob" class="center-justified center horizontal layout" on-down="_knobdown" on-up="_resetKnob" on-track="_onTrack" on-transitionend="_knobTransitionEnd">
+ <paper-ripple id="ink" class="circle" center=""></paper-ripple>
+ <div id="sliderKnobInner" value$="[[immediateValue]]"></div>
</div>
</div>
<template is="dom-if" if="[[editable]]">
- <paper-input id="input" class="slider-input" disabled$="[[disabled]]" on-change="_inputChange"></paper-input>
+ <paper-input id="input" class="slider-input" disabled$="[[disabled]]" on-change="_inputChange">
+ </paper-input>
</template>
-
</template>
+
</dom-module>
<script src="paper-slider-extracted.js"></script></body></html> \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/paper-styles/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-styles/.bower.json
index 46a6457..8de16cb 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-styles/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-styles/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-styles",
- "version": "1.0.3",
+ "version": "1.0.4",
"description": "Common (global) styles for Material Design elements.",
"authors": [
"The Polymer Authors"
@@ -24,11 +24,11 @@
"devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.3",
+ "_release": "1.0.4",
"_resolution": {
"type": "version",
- "tag": "v1.0.3",
- "commit": "64adbb4e15214cdc0e5df1ac4b8f2d9e2eca6076"
+ "tag": "v1.0.4",
+ "commit": "d23af125cb74978532c25e5cd152f9b2e6d991c8"
},
"_source": "git://github.com/PolymerElements/paper-styles.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-styles/bower.json b/third_party/polymer/v1_0/components-chromium/paper-styles/bower.json
index c818d34..930947d 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-styles/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-styles/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-styles",
- "version": "1.0.3",
+ "version": "1.0.4",
"description": "Common (global) styles for Material Design elements.",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-styles/color.html b/third_party/polymer/v1_0/components-chromium/paper-styles/color.html
index 5f8f887..f0be341 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-styles/color.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-styles/color.html
@@ -283,9 +283,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--paper-deep-orange-a400: #ff3d00;
--paper-deep-orange-a700: #dd2c00;
- --paper-brown-50: #795548;
- --paper-brown-100: #efebe9;
- --paper-brown-200: #d7ccc8;
+ --paper-brown-50: #efebe9;
+ --paper-brown-100: #d7ccc8;
+ --paper-brown-200: #bcaaa4;
--paper-brown-300: #a1887f;
--paper-brown-400: #8d6e63;
--paper-brown-500: #795548;
diff --git a/third_party/polymer/v1_0/components-chromium/paper-styles/demo-pages.html b/third_party/polymer/v1_0/components-chromium/paper-styles/demo-pages.html
index 9fc5739..44f2288 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-styles/demo-pages.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-styles/demo-pages.html
@@ -9,7 +9,11 @@ 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-flex-layout/iron-flex-layout.html">
+
<link rel="import" href="color.html">
+<link rel="import" href="typography.html">
<link rel="import" href="shadow.html">
<style is="custom-style">
@@ -56,6 +60,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
margin-right: auto;
}
+ code {
+ color: var(--google-grey-700);
+ }
+
/* TODO: remove this hack and use horizontal-section-container instead */
body > div.layout.horizontal.center-justified {
@apply(--layout-wrap);
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/.bower.json
index dae78ed..db09a19 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-toggle-button",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design toggle button control",
"authors": [
"The Polymer Authors"
@@ -33,11 +33,11 @@
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "577b045eea2d8e7623fcce40001a2d9e7008bd60"
+ "tag": "v1.0.3",
+ "commit": "34235a35f65be5efadc8fc5c6f6e5dee0fbb6c52"
},
"_source": "git://github.com/PolymerElements/paper-toggle-button.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/bower.json b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/bower.json
index f7404f2..2a80170 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-toggle-button",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design toggle button control",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button-extracted.js
index 68a083c..75f78b8 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button-extracted.js
@@ -3,7 +3,7 @@
is: 'paper-toggle-button',
behaviors: [
- Polymer.PaperRadioButtonBehavior
+ Polymer.PaperInkyFocusBehavior
],
hostAttributes: {
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.css b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.css
index 8eb9d2d..bdadd9d 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.css
+++ b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.css
@@ -21,27 +21,27 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
:host .toggle-bar {
- background-color: var(--paper-toggle-button-unchecked-bar-color);
+ background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
}
:host .toggle-button {
- background-color: var(--paper-toggle-button-unchecked-button-color);
+ background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
}
:host([checked]) .toggle-bar {
- background-color: var(--paper-toggle-button-checked-bar-color);
+ background-color: var(--paper-toggle-button-checked-bar-color, --google-green-500);
}
:host([checked]) .toggle-button {
- background-color: var(--paper-toggle-button-checked-button-color);
+ background-color: var(--paper-toggle-button-checked-button-color, --google-green-500);
}
:host .toggle-ink {
- color: var(--paper-toggle-button-unchecked-ink-color);
+ color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
}
:host([checked]) .toggle-ink {
- color: var(--paper-toggle-button-checked-ink-color);
+ color: var(--paper-toggle-button-checked-ink-color, --google-green-500);
}
/* ID selectors should not be overriden by users. */
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html
index dca8ed2..f47e043 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-toggle-button/paper-toggle-button.html
@@ -8,7 +8,7 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--><html><head><link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
-<link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<!--
`paper-toggle-button` provides a ON/OFF switch that user can toggle the state
@@ -36,17 +36,6 @@ Custom property | Description | Default
@hero hero.svg
@demo demo/index.html
-->
-<style is="custom-style">
- :root {
- --paper-toggle-button-unchecked-bar-color: #000000;
- --paper-toggle-button-unchecked-button-color: var(--paper-grey-50);
- --paper-toggle-button-unchecked-ink-color: var(--dark-primary-color);
-
- --paper-toggle-button-checked-bar-color: var(--google-green-500);
- --paper-toggle-button-checked-button-color: var(--google-green-500);
- --paper-toggle-button-checked-ink-color: var(--google-green-500);
- }
-</style>
</head><body><dom-module id="paper-toggle-button">
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toolbar/.bower.json b/third_party/polymer/v1_0/components-chromium/paper-toolbar/.bower.json
index ac01bd5..de532ef 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toolbar/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-toolbar/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-toolbar",
- "version": "1.0.0",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "A material design toolbar that is easily customizable",
"private": true,
@@ -33,11 +33,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-toolbar",
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "6d0a50375e529a5f750c3a30324d5de8a8824fd1"
+ "tag": "v1.0.2",
+ "commit": "402eb11da736a5ae19713748bfa04cd96f3f7a0c"
},
"_source": "git://github.com/PolymerElements/paper-toolbar.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toolbar/README.md b/third_party/polymer/v1_0/components-chromium/paper-toolbar/README.md
index d9f7c05..ef525f4 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toolbar/README.md
+++ b/third_party/polymer/v1_0/components-chromium/paper-toolbar/README.md
@@ -12,7 +12,7 @@ Example:
```html
<paper-toolbar>
<paper-icon-button icon="menu" on-tap="{{menuAction}}"></paper-icon-button>
- <div title>Title</div>
+ <div class="title">Title</div>
<paper-icon-button icon="more" on-tap="{{moreAction}}"></paper-icon-button>
</paper-toolbar>
```
@@ -41,8 +41,8 @@ When `tall`, items can pin to either the top (default), middle or bottom. Use
```html
<paper-toolbar class="tall">
<paper-icon-button icon="menu"></paper-icon-button>
- <div title class="middle">Middle Title</div>
- <div title class="bottom">Bottom Title</div>
+ <div class="title middle">Middle Title</div>
+ <div class="title bottom">Bottom Title</div>
</paper-toolbar>
```
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toolbar/bower.json b/third_party/polymer/v1_0/components-chromium/paper-toolbar/bower.json
index 3c26395..26a02b6 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toolbar/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/paper-toolbar/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-toolbar",
- "version": "1.0.0",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "A material design toolbar that is easily customizable",
"private": true,
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar-extracted.js
index 1dc94c5..ba04543 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar-extracted.js
@@ -96,7 +96,7 @@
for (var content, index = 0; content = contents[index]; index++) {
var nodes = Polymer.dom(content).getDistributedNodes();
for (var node, jndex = 0; node = nodes[jndex]; jndex++) {
- if (node.hasAttribute && node.hasAttribute('title')) {
+ if (node.classList && node.classList.contains('title')) {
if (node.id) {
labelledBy.push(node.id);
} else {
diff --git a/third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar.html b/third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar.html
index 88beb73..4481273 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar.html
+++ b/third_party/polymer/v1_0/components-chromium/paper-toolbar/paper-toolbar.html
@@ -19,8 +19,8 @@ Example:
<paper-toolbar>
<paper-icon-button icon="menu" on-tap="menuAction"></paper-icon-button>
- <div title>Title</div>
- <paper-icon-button icon="more" on-tap="moreAction"></paper-icon-button>
+ <div class="title">Title</div>
+ <paper-icon-button icon="more-vert" on-tap="moreAction"></paper-icon-button>
</paper-toolbar>
`paper-toolbar` has a standard height, but can made be taller by setting `tall`
@@ -42,8 +42,8 @@ When `tall`, items can pin to either the top (default), middle or bottom. Use
<paper-toolbar class="tall">
<paper-icon-button icon="menu"></paper-icon-button>
- <div title class="middle">Middle Title</div>
- <div title class="bottom">Bottom Title</div>
+ <div class="middle title">Middle Title</div>
+ <div class="bottom title">Bottom Title</div>
</paper-toolbar>
For `medium-tall` toolbar, the middle and bottom contents overlap and are
@@ -62,7 +62,7 @@ Custom property | Description | Default
### Accessibility
-`<paper-toolbar>` has `role="toolbar"` by default. Any elements with the `title` attribute will
+`<paper-toolbar>` has `role="toolbar"` by default. Any elements with the class `title` will
be used as the label of the toolbar via `aria-labelledby`.
@demo demo/index.html
@@ -131,7 +131,6 @@ be used as the label of the toolbar via `aria-labelledby`.
#topBar {
position: relative;
- z-index: 1;
}
/* middle bar */
@@ -140,7 +139,6 @@ be used as the label of the toolbar via `aria-labelledby`.
top: 0;
right: 0;
left: 0;
- z-index: 2;
}
:host(.tall) #middleBar,
@@ -155,7 +153,6 @@ be used as the label of the toolbar via `aria-labelledby`.
right: 0;
bottom: 0;
left: 0;
- z-index: 1;
}
/*
@@ -169,10 +166,11 @@ be used as the label of the toolbar via `aria-labelledby`.
pointer-events: auto;
}
- .toolbar-tools > ::content [title] {
+ .toolbar-tools > ::content .title {
@apply(--paper-font-title);
@apply(--layout-flex);
+ pointer-events: none;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
@@ -192,23 +190,18 @@ be used as the label of the toolbar via `aria-labelledby`.
* Work in progress.
*/
.toolbar-tools > ::content paper-icon-button[icon=menu] {
- margin-left: -8px;
margin-right: 24px;
}
- .toolbar-tools > ::content paper-icon-button + paper-icon-button {
- margin-right: -8px;
- }
-
- .toolbar-tools > ::content > [title],
- .toolbar-tools > ::content[select=".middle"] > [title],
- .toolbar-tools > ::content[select=".bottom"] > [title] {
+ .toolbar-tools > ::content > .title,
+ .toolbar-tools > ::content[select=".middle"] > .title,
+ .toolbar-tools > ::content[select=".bottom"] > .title {
margin-left: 56px;
}
- .toolbar-tools > ::content > paper-icon-button + [title],
- .toolbar-tools > ::content[select=".middle"] paper-icon-button + [title],
- .toolbar-tools > ::content[select=".bottom"] paper-icon-button + [title] {
+ .toolbar-tools > ::content > paper-icon-button + .title,
+ .toolbar-tools > ::content[select=".middle"] paper-icon-button + .title,
+ .toolbar-tools > ::content[select=".bottom"] paper-icon-button + .title {
margin-left: 0;
}
</style>
diff --git a/third_party/polymer/v1_0/components-chromium/polymer-externs/.bower.json b/third_party/polymer/v1_0/components-chromium/polymer-externs/.bower.json
index 3b1c1de..2ee5eab 100644
--- a/third_party/polymer/v1_0/components-chromium/polymer-externs/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/polymer-externs/.bower.json
@@ -1,12 +1,12 @@
{
"name": "polymer-externs",
"homepage": "https://github.com/PolymerLabs/polymer-externs",
- "version": "1.0.0",
- "_release": "1.0.0",
+ "version": "1.0.3",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "1f2d54817701edfd0ded01e88ae0549e48efac49"
+ "tag": "v1.0.3",
+ "commit": "a9ff08086ba7541111e2d16a7418030b3e5f4711"
},
"_source": "git://github.com/PolymerLabs/polymer-externs.git",
"_target": "~1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/polymer-externs/polymer.externs.js b/third_party/polymer/v1_0/components-chromium/polymer-externs/polymer.externs.js
index d07a15b..41008e3 100644
--- a/third_party/polymer/v1_0/components-chromium/polymer-externs/polymer.externs.js
+++ b/third_party/polymer/v1_0/components-chromium/polymer-externs/polymer.externs.js
@@ -53,11 +53,11 @@ PolymerElement.prototype.is;
PolymerElement.prototype.extends;
/**
- * An array of objects whose properties get mixed in to this element.
- *
+ * An array of objects whose properties get added to this element.
+ * @see https://www.polymer-project.org/1.0/docs/devguide/behaviors.html
* @type {!Array<!Object>|undefined}
*/
-PolymerElement.prototype.mixins;
+PolymerElement.prototype.behaviors;
/**
* A string-separated list of dependent properties that should result in a
@@ -111,6 +111,12 @@ PolymerElement.prototype.hostAttributes;
PolymerElement.prototype.listeners;
/**
+ * Return the element whose local dom within which this element is contained.
+ * @type {?Element}
+ */
+PolymerElement.prototype.domHost;
+
+/**
* Notifies the event binding system of a change to a property.
* @param {string} path The path to set.
* @param {*} value The value to send in the update notification.
@@ -118,11 +124,44 @@ PolymerElement.prototype.listeners;
PolymerElement.prototype.notifyPath = function(path, value) {};
/**
- * Shorthand for setting a property, then calling notifyPath.
- * @param {string} path The path to set.
- * @param {*} value The new value.
+ * Convienence method for setting a value to a path and notifying any
+ * elements bound to the same path.
+ *
+ * Note, if any part in the path except for the last is undefined,
+ * this method does nothing (this method does not throw when
+ * dereferencing undefined paths).
+ *
+ * @param {(string|Array<(string|number)>)} path Path to the value
+ * to read. The path may be specified as a string (e.g. `foo.bar.baz`)
+ * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that
+ * bracketed expressions are not supported; string-based path parts
+ * *must* be separated by dots. Note that when dereferencing array
+ * indicies, the index may be used as a dotted part directly
+ * (e.g. `users.12.name` or `['users', 12, 'name']`).
+ * @param {*} value Value to set at the specified path.
+ * @param {Object=} root Root object from which the path is evaluated.
+*/
+PolymerElement.prototype.set = function(path, value, root) {};
+
+/**
+ * Convienence method for reading a value from a path.
+ *
+ * Note, if any part in the path is undefined, this method returns
+ * `undefined` (this method does not throw when dereferencing undefined
+ * paths).
+ *
+ * @param {(string|Array<(string|number)>)} path Path to the value
+ * to read. The path may be specified as a string (e.g. `foo.bar.baz`)
+ * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that
+ * bracketed expressions are not supported; string-based path parts
+ * *must* be separated by dots. Note that when dereferencing array
+ * indicies, the index may be used as a dotted part directly
+ * (e.g. `users.12.name` or `['users', 12, 'name']`).
+ * @param {Object=} root Root object from which the path is evaluated.
+ * @return {*} Value at the path, or `undefined` if any part of the path
+ * is undefined.
*/
-PolymerElement.prototype.setPathValue = function(path, value) {};
+PolymerElement.prototype.get = function(path, root) {};
/**
* Fire an event.
@@ -167,12 +206,47 @@ PolymerElement.prototype.toggleAttribute = function(name, bool, node) {};
PolymerElement.prototype.attributeFollows = function(name, newNode, oldNode) {};
/**
+ * Convenience method to add an event listener on a given element, late bound to
+ * a named method on this element.
+ * @param {!Element} node Element to add event listener to.
+ * @param {string} eventName Name of event to listen for.
+ * @param {string} methodName Name of handler method on this to call.
+ */
+PolymerElement.prototype.listen = function(node, eventName, methodName) {};
+
+/**
+ * Override scrolling behavior to all direction, one direction, or none.
+ *
+ * Valid scroll directions:
+ * 'all': scroll in any direction
+ * 'x': scroll only in the 'x' direction
+ * 'y': scroll only in the 'y' direction
+ * 'none': disable scrolling for this node
+ *
+ * @param {string=} direction Direction to allow scrolling Defaults to all.
+ * @param {HTMLElement=} node Element to apply scroll direction setting.
+ * Defaults to this.
+ */
+PolymerElement.prototype.setScrollDirection = function(direction, node) {};
+
+/**
* @param {!Function} method
* @param {number=} wait
* @return {number} A handle which can be used to cancel the job.
*/
PolymerElement.prototype.async = function(method, wait) {};
+Polymer.Base;
+
+/**
+ * Used by the promise-polyfill on its own.
+ *
+ * @param {!Function} method
+ * @param {number=} wait
+ * @return {number} A handle which can be used to cancel the job.
+ */
+Polymer.Base.async = function(method, wait) {};
+
/**
* @param {number} handle
*/
@@ -218,9 +292,9 @@ PolymerElement.prototype.transform = function(transform, node) {};
/**
* Transforms the specified node, or this element if no node is specified.
- * @param {string} x
- * @param {string} y
- * @param {string} z
+ * @param {number|string} x
+ * @param {number|string} y
+ * @param {number|string} z
* @param {HTMLElement=} node
*/
PolymerElement.prototype.translate3d = function(x, y, z, node) {};
@@ -247,6 +321,39 @@ PolymerElement.prototype.arrayDelete = function(array, item) {};
*/
PolymerElement.prototype.resolveUrl = function(url) {};
+/**
+ * Logs a message to the console.
+ *
+ * @param {!Array} var_args
+ * @protected
+ */
+PolymerElement.prototype._log = function(var_args) {};
+
+/**
+ * Logs a message to the console with a 'warn' level.
+ *
+ * @param {!Array} var_args
+ * @protected
+ */
+PolymerElement.prototype._warn = function(var_args) {};
+
+/**
+ * Logs a message to the console with an 'error' level.
+ *
+ * @param {!Array} var_args
+ * @protected
+ */
+PolymerElement.prototype._error = function(var_args) {};
+
+/**
+ * Formats string arguments together for a console log.
+ *
+ * @param {...*} var_args
+ * @return {!Array} The formatted array of args to a log function.
+ * @protected
+ */
+PolymerElement.prototype._logf = function(var_args) {};
+
/**
* A Polymer DOM API for manipulating DOM such that local DOM and light DOM
@@ -316,6 +423,9 @@ PolymerDomApi.prototype.getDistributedNodes = function() {};
/** @return {!Array<!Node>} */
PolymerDomApi.prototype.getDestinationInsertionPoints = function() {};
+/** @return {?Node} */
+PolymerDomApi.prototype.getOwnerRoot = function() {};
+
/**
* @param {string} attribute
* @param {string|number|boolean} value Values are converted to strings with
@@ -331,12 +441,88 @@ PolymerDomApi.prototype.removeAttribute = function(attribute) {};
PolymerDomApi.prototype.classList;
/**
- * Returns a Polymer-friendly API for manipulating DOM of a specified node.
+ * A Polymer Event API.
*
- * @param {?Node} node
- * @return {!PolymerDomApi}
+ * @constructor
*/
-Polymer.dom = function(node) {};
+var PolymerEventApi = function() {};
+
+/** @type {?EventTarget} */
+PolymerEventApi.prototype.rootTarget;
+
+/** @type {?EventTarget} */
+PolymerEventApi.prototype.localTarget;
+
+/** @type {?Array<!Element>|undefined} */
+PolymerEventApi.prototype.path;
+
+/**
+ * Returns a Polymer-friendly API for manipulating DOM of a specified node or
+ * an event API for a specified event..
+ *
+ * @param {?Node|?Event} nodeOrEvent
+ * @return {!PolymerDomApi|!PolymerEventApi}
+ */
+Polymer.dom = function(nodeOrEvent) {};
Polymer.dom.flush = function() {};
+Polymer.CaseMap;
+
+/**
+ * Convert a string from dash to camel-case.
+ * @param {string} dash
+ * @return {string} The string in camel-case.
+ */
+Polymer.CaseMap.dashToCamelCase = function(dash) {};
+
+/**
+ * Convert a string from camel-case to dash format.
+ * @param {string} camel
+ * @return {string} The string in dash format.
+ */
+Polymer.CaseMap.camelToDashCase = function(camel) {};
+
+
+/**
+ * An Event type fired when moving while finger/button is down.
+ * state - a string indicating the tracking state:
+ * + start: fired when tracking is first detected (finger/button down and
+ * moved past a pre-set distance threshold)
+ * + track: fired while tracking
+ * + end: fired when tracking ends
+ * x - clientX coordinate for event
+ * y - clientY coordinate for event
+ * dx - change in pixels horizontally since the first track event
+ * dy - change in pixels vertically since the first track event
+ * ddx - change in pixels horizontally since last track event
+ * ddy - change in pixels vertically since last track event
+ * hover() - a function that may be called to determine the element currently
+ * being hovered
+ *
+ * @typedef {{
+ * state: string,
+ * x: number,
+ * y: number,
+ * dx: number,
+ * dy: number,
+ * ddx: number,
+ * ddy: number,
+ * hover: (function(): Node)
+ * }}
+ */
+var PolymerTrackEvent;
+
+/**
+ * An Event type fired when a finger does down, up, or taps.
+ * x - clientX coordinate for event
+ * y - clientY coordinate for event
+ * sourceEvent - the original DOM event that caused the down action
+ *
+ * @typedef {{
+ * x: number,
+ * y: number,
+ * sourceEvent: Event
+ * }}
+ */
+var PolymerTouchEvent;
diff --git a/third_party/polymer/v1_0/components-chromium/polymer/.bower.json b/third_party/polymer/v1_0/components-chromium/polymer/.bower.json
index 5ba173d..314686e 100644
--- a/third_party/polymer/v1_0/components-chromium/polymer/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/polymer/.bower.json
@@ -1,6 +1,6 @@
{
"name": "polymer",
- "version": "1.0.2",
+ "version": "1.0.3",
"main": [
"polymer.html"
],
@@ -24,13 +24,13 @@
},
"private": true,
"homepage": "https://github.com/Polymer/polymer",
- "_release": "1.0.2",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.2",
- "commit": "63f3bf1babfeaba5649345569b1bd9f3d61a88ae"
+ "tag": "v1.0.3",
+ "commit": "336178d90e44ea7e01ec84155e83d037adf05a4c"
},
"_source": "git://github.com/Polymer/polymer.git",
- "_target": "~v1.0.0",
+ "_target": "^1.0.0",
"_originalSource": "Polymer/polymer"
} \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/polymer/bower.json b/third_party/polymer/v1_0/components-chromium/polymer/bower.json
index 9c4f5c9..2cbb654 100644
--- a/third_party/polymer/v1_0/components-chromium/polymer/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/polymer/bower.json
@@ -1,6 +1,6 @@
{
"name": "polymer",
- "version": "1.0.2",
+ "version": "1.0.3",
"main": [
"polymer.html"
],
diff --git a/third_party/polymer/v1_0/components-chromium/polymer/build.log b/third_party/polymer/v1_0/components-chromium/polymer/build.log
index 736b31c..b87b858 100644
--- a/third_party/polymer/v1_0/components-chromium/polymer/build.log
+++ b/third_party/polymer/v1_0/components-chromium/polymer/build.log
@@ -1,26 +1,27 @@
BUILD LOG
---------
-Build Time: 2015-05-28T22:23:07-0700
+Build Time: 2015-06-04T20:19:11-0700
NODEJS INFORMATION
==================
nodejs: v2.0.2
-del: 1.2.0
-gulp: 3.8.11
+gulp: 3.9.0
gulp-audit: 1.0.0
gulp-rename: 1.2.2
-gulp-replace: 0.5.3
gulp-vulcanize: 6.0.0
lazypipe: 0.2.3
-polyclean: 1.1.0
+polyclean: 1.2.0
run-sequence: 1.1.0
+del: 1.2.0
+gulp-replace: 0.5.3
+vulcanize: 1.8.1
REPO REVISIONS
==============
-polymer: 3b0d10b4da804703d493da7bd0b5c22fc6f7b173
+polymer: 0c73fc226b6b5ca308a851b334b1bdeda289195d
BUILD HASHES
============
-polymer-mini.html: 6643b7ca3675fd7247fb1894a51435e0e1256e32
-polymer-micro.html: 9dda81fc6d99a1bc3c044543c4cad106042930a8
-polymer.html: f9f247c99df9ac2c7fb610aabfe3fcdcbbdbc9f9 \ No newline at end of file
+polymer-mini.html: 8173d099edaed570f4db95cd54317f49dc3183ae
+polymer-micro.html: afd2d239fc08ec69fa912a0fc7e73e8ce58e3f91
+polymer.html: 2094f18d71f5aec3321b1364575579e960b37cbc \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js b/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
index 5f52247..efa86c5 100644
--- a/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/polymer/polymer-extracted.js
@@ -1,38 +1,37 @@
Polymer.nar = [];
-
Polymer.Annotations = {
-parseAnnotations: function(template) {
+parseAnnotations: function (template) {
var list = [];
var content = template._content || template.content;
this._parseNodeAnnotations(content, list);
return list;
},
-_parseNodeAnnotations: function(node, list) {
+_parseNodeAnnotations: function (node, list) {
return node.nodeType === Node.TEXT_NODE ? this._parseTextNodeAnnotation(node, list) : this._parseElementAnnotations(node, list);
},
-_testEscape: function(value) {
+_testEscape: function (value) {
var escape = value.slice(0, 2);
-if (escape === "{{" || escape === "[[") {
+if (escape === '{{' || escape === '[[') {
return escape;
}
},
-_parseTextNodeAnnotation: function(node, list) {
+_parseTextNodeAnnotation: function (node, list) {
var v = node.textContent;
var escape = this._testEscape(v);
if (escape) {
-node.textContent = " ";
+node.textContent = ' ';
var annote = {
-bindings: [ {
-kind: "text",
+bindings: [{
+kind: 'text',
mode: escape[0],
value: v.slice(2, -2).trim()
-} ]
+}]
};
list.push(annote);
return annote;
}
},
-_parseElementAnnotations: function(element, list) {
+_parseElementAnnotations: function (element, list) {
var annote = {
bindings: [],
events: []
@@ -49,10 +48,10 @@ list.push(annote);
}
return annote;
},
-_parseChildNodesAnnotations: function(root, annote, list, callback) {
+_parseChildNodesAnnotations: function (root, annote, list, callback) {
if (root.firstChild) {
for (var i = 0, node = root.firstChild; node; node = node.nextSibling, i++) {
-if (node.localName === "template" && !node.hasAttribute("preserve-content")) {
+if (node.localName === 'template' && !node.hasAttribute('preserve-content')) {
this._parseTemplate(node, i, list, annote);
}
var childAnnotation = this._parseNodeAnnotations(node, list, callback);
@@ -63,7 +62,7 @@ childAnnotation.index = i;
}
}
},
-_parseTemplate: function(node, index, list, parent) {
+_parseTemplate: function (node, index, list, parent) {
var content = document.createDocumentFragment();
content._notes = this.parseAnnotations(node);
content.appendChild(node.content);
@@ -75,12 +74,12 @@ parent: parent,
index: index
});
},
-_parseNodeAttributeAnnotations: function(node, annotation) {
+_parseNodeAttributeAnnotations: function (node, annotation) {
for (var i = node.attributes.length - 1, a; a = node.attributes[i]; i--) {
var n = a.name, v = a.value;
-if (n === "id" && !this._testEscape(v)) {
+if (n === 'id' && !this._testEscape(v)) {
annotation.id = v;
-} else if (n.slice(0, 3) === "on-") {
+} else if (n.slice(0, 3) === 'on-') {
node.removeAttribute(n);
annotation.events.push({
name: n.slice(3),
@@ -94,7 +93,7 @@ annotation.bindings.push(b);
}
}
},
-_parseNodeAttributeAnnotation: function(node, n, v) {
+_parseNodeAttributeAnnotation: function (node, n, v) {
var escape = this._testEscape(v);
if (escape) {
var customEvent;
@@ -102,26 +101,26 @@ var name = n;
var mode = escape[0];
v = v.slice(2, -2).trim();
var not = false;
-if (v[0] == "!") {
+if (v[0] == '!') {
v = v.substring(1);
not = true;
}
-var kind = "property";
-if (n[n.length - 1] == "$") {
+var kind = 'property';
+if (n[n.length - 1] == '$') {
name = n.slice(0, -1);
-kind = "attribute";
+kind = 'attribute';
}
var notifyEvent, colon;
-if (mode == "{" && (colon = v.indexOf("::")) > 0) {
+if (mode == '{' && (colon = v.indexOf('::')) > 0) {
notifyEvent = v.substring(colon + 2);
v = v.substring(0, colon);
customEvent = true;
}
-if (node.localName == "input" && n == "value") {
-node.setAttribute(n, "");
+if (node.localName == 'input' && n == 'value') {
+node.setAttribute(n, '');
}
node.removeAttribute(n);
-if (kind === "property") {
+if (kind === 'property') {
name = Polymer.CaseMap.dashToCamelCase(name);
}
return {
@@ -135,30 +134,29 @@ customEvent: customEvent
};
}
},
-_localSubTree: function(node, host) {
+_localSubTree: function (node, host) {
return node === host ? node.childNodes : node._lightChildren || node.childNodes;
},
-findAnnotatedNode: function(root, annote) {
+findAnnotatedNode: function (root, annote) {
var parent = annote.parent && Polymer.Annotations.findAnnotatedNode(root, annote.parent);
return !parent ? root : Polymer.Annotations._localSubTree(parent, root)[annote.index];
}
};
-
-(function() {
+(function () {
function resolveCss(cssText, ownerDocument) {
-return cssText.replace(CSS_URL_RX, function(m, pre, url, post) {
-return pre + "'" + resolve(url.replace(/["']/g, ""), ownerDocument) + "'" + post;
+return cssText.replace(CSS_URL_RX, function (m, pre, url, post) {
+return pre + '\'' + resolve(url.replace(/["']/g, ''), ownerDocument) + '\'' + post;
});
}
function resolveAttrs(element, ownerDocument) {
for (var name in URL_ATTRS) {
var a$ = URL_ATTRS[name];
for (var i = 0, l = a$.length, a, at, v; i < l && (a = a$[i]); i++) {
-if (name === "*" || element.localName === name) {
+if (name === '*' || element.localName === name) {
at = element.attributes[a];
v = at && at.value;
if (v && v.search(BINDING_RX) < 0) {
-at.value = a === "style" ? resolveCss(v, ownerDocument) : resolve(v, ownerDocument);
+at.value = a === 'style' ? resolveCss(v, ownerDocument) : resolve(v, ownerDocument);
}
}
}
@@ -173,20 +171,25 @@ var tempDoc;
var tempDocBase;
function resolveUrl(url, baseUri) {
if (!tempDoc) {
-tempDoc = document.implementation.createHTMLDocument("temp");
-tempDocBase = tempDoc.createElement("base");
+tempDoc = document.implementation.createHTMLDocument('temp');
+tempDocBase = tempDoc.createElement('base');
tempDoc.head.appendChild(tempDocBase);
}
tempDocBase.href = baseUri;
return resolve(url, tempDoc);
}
function getUrlResolver(ownerDocument) {
-return ownerDocument.__urlResolver || (ownerDocument.__urlResolver = ownerDocument.createElement("a"));
+return ownerDocument.__urlResolver || (ownerDocument.__urlResolver = ownerDocument.createElement('a'));
}
var CSS_URL_RX = /(url\()([^)]*)(\))/g;
var URL_ATTRS = {
-"*": [ "href", "src", "style", "url" ],
-form: [ "action" ]
+'*': [
+'href',
+'src',
+'style',
+'url'
+],
+form: ['action']
};
var BINDING_RX = /\{\{|\[\[/;
Polymer.ResolveUrl = {
@@ -194,10 +197,9 @@ resolveCss: resolveCss,
resolveAttrs: resolveAttrs,
resolveUrl: resolveUrl
};
-})();
-
+}());
Polymer.Base._addFeature({
-_prepAnnotations: function() {
+_prepAnnotations: function () {
if (!this._template) {
this._notes = [];
} else {
@@ -207,7 +209,7 @@ this._processAnnotations(this._notes);
Polymer.Annotations.prepElement = null;
}
},
-_processAnnotations: function(notes) {
+_processAnnotations: function (notes) {
for (var i = 0; i < notes.length; i++) {
var note = notes[i];
for (var j = 0; j < note.bindings.length; j++) {
@@ -224,9 +226,9 @@ var bindings = [];
for (var prop in pp) {
bindings.push({
index: note.index,
-kind: "property",
-mode: "{",
-name: "_parent_" + prop,
+kind: 'property',
+mode: '{',
+name: '_parent_' + prop,
model: prop,
value: prop
});
@@ -235,10 +237,10 @@ note.bindings = note.bindings.concat(bindings);
}
}
},
-_discoverTemplateParentProps: function(notes) {
+_discoverTemplateParentProps: function (notes) {
var pp = {};
-notes.forEach(function(n) {
-n.bindings.forEach(function(b) {
+notes.forEach(function (n) {
+n.bindings.forEach(function (b) {
if (b.signature) {
var args = b.signature.args;
for (var k = 0; k < args.length; k++) {
@@ -255,104 +257,105 @@ Polymer.Base.mixin(pp, tpp);
});
return pp;
},
-_prepElement: function(element) {
+_prepElement: function (element) {
Polymer.ResolveUrl.resolveAttrs(element, this._template.ownerDocument);
},
_findAnnotatedNode: Polymer.Annotations.findAnnotatedNode,
-_marshalAnnotationReferences: function() {
+_marshalAnnotationReferences: function () {
if (this._template) {
this._marshalIdNodes();
this._marshalAnnotatedNodes();
this._marshalAnnotatedListeners();
}
},
-_configureAnnotationReferences: function() {
+_configureAnnotationReferences: function () {
this._configureTemplateContent();
},
-_configureTemplateContent: function() {
-this._notes.forEach(function(note, i) {
+_configureTemplateContent: function () {
+this._notes.forEach(function (note, i) {
if (note.templateContent) {
this._nodes[i]._content = note.templateContent;
}
}, this);
},
-_marshalIdNodes: function() {
+_marshalIdNodes: function () {
this.$ = {};
-this._notes.forEach(function(a) {
+this._notes.forEach(function (a) {
if (a.id) {
this.$[a.id] = this._findAnnotatedNode(this.root, a);
}
}, this);
},
-_marshalAnnotatedNodes: function() {
+_marshalAnnotatedNodes: function () {
if (this._nodes) {
-this._nodes = this._nodes.map(function(a) {
+this._nodes = this._nodes.map(function (a) {
return this._findAnnotatedNode(this.root, a);
}, this);
}
},
-_marshalAnnotatedListeners: function() {
-this._notes.forEach(function(a) {
+_marshalAnnotatedListeners: function () {
+this._notes.forEach(function (a) {
if (a.events && a.events.length) {
var node = this._findAnnotatedNode(this.root, a);
-a.events.forEach(function(e) {
+a.events.forEach(function (e) {
this.listen(node, e.name, e.value);
}, this);
}
}, this);
}
});
-
Polymer.Base._addFeature({
listeners: {},
-_listenListeners: function(listeners) {
+_listenListeners: function (listeners) {
var node, name, key;
for (key in listeners) {
-if (key.indexOf(".") < 0) {
+if (key.indexOf('.') < 0) {
node = this;
name = key;
} else {
-name = key.split(".");
+name = key.split('.');
node = this.$[name[0]];
name = name[1];
}
this.listen(node, name, listeners[key]);
}
},
-listen: function(node, eventName, methodName) {
+listen: function (node, eventName, methodName) {
this._listen(node, eventName, this._createEventHandler(node, eventName, methodName));
},
-_createEventHandler: function(node, eventName, methodName) {
+_createEventHandler: function (node, eventName, methodName) {
var host = this;
-return function(e) {
+return function (e) {
if (host[methodName]) {
host[methodName](e, e.detail);
} else {
-host._warn(host._logf("_createEventHandler", "listener method `" + methodName + "` not defined"));
+host._warn(host._logf('_createEventHandler', 'listener method `' + methodName + '` not defined'));
}
};
},
-_listen: function(node, eventName, handler) {
+_listen: function (node, eventName, handler) {
node.addEventListener(eventName, handler);
}
});
-
-(function() {
-"use strict";
-var HAS_NATIVE_TA = typeof document.head.style.touchAction === "string";
-var GESTURE_KEY = "__polymerGestures";
-var HANDLED_OBJ = "__polymerGesturesHandled";
-var TOUCH_ACTION = "__polymerGesturesTouchAction";
+(function () {
+'use strict';
+var HAS_NATIVE_TA = typeof document.head.style.touchAction === 'string';
+var GESTURE_KEY = '__polymerGestures';
+var HANDLED_OBJ = '__polymerGesturesHandled';
+var TOUCH_ACTION = '__polymerGesturesTouchAction';
var TAP_DISTANCE = 25;
var TRACK_DISTANCE = 5;
var TRACK_LENGTH = 2;
var MOUSE_TIMEOUT = 2500;
-var MOUSE_EVENTS = [ "mousedown", "mousemove", "mouseup", "click" ];
-var mouseCanceller = function(mouseEvent) {
-mouseEvent[HANDLED_OBJ] = {
-skip: true
-};
-if (mouseEvent.type === "click") {
+var MOUSE_EVENTS = [
+'mousedown',
+'mousemove',
+'mouseup',
+'click'
+];
+var mouseCanceller = function (mouseEvent) {
+mouseEvent[HANDLED_OBJ] = { skip: true };
+if (mouseEvent.type === 'click') {
var path = Polymer.dom(mouseEvent).path;
for (var i = 0; i < path.length; i++) {
if (path[i] === POINTERSTATE.mouse.target) {
@@ -377,7 +380,7 @@ function ignoreMouse() {
if (!POINTERSTATE.mouse.mouseIgnoreJob) {
setupTeardownMouseCanceller(true);
}
-var unset = function() {
+var unset = function () {
setupTeardownMouseCanceller();
POINTERSTATE.mouse.target = null;
POINTERSTATE.mouse.mouseIgnoreJob = null;
@@ -399,7 +402,7 @@ scrollDecided: false
};
function firstTouchAction(ev) {
var path = Polymer.dom(ev).path;
-var ta = "auto";
+var ta = 'auto';
for (var i = 0, n; i < path.length; i++) {
n = path[i];
if (n[TOUCH_ACTION]) {
@@ -412,7 +415,7 @@ return ta;
var Gestures = {
gestures: {},
recognizers: [],
-deepTargetFind: function(x, y) {
+deepTargetFind: function (x, y) {
var node = document.elementFromPoint(x, y);
var next = node;
while (next && next.shadowRoot) {
@@ -423,7 +426,7 @@ node = next;
}
return node;
},
-handleNative: function(ev) {
+handleNative: function (ev) {
var handled;
var type = ev.type;
var node = ev.currentTarget;
@@ -434,9 +437,9 @@ return;
}
if (!ev[HANDLED_OBJ]) {
ev[HANDLED_OBJ] = {};
-if (type.slice(0, 5) === "touch") {
+if (type.slice(0, 5) === 'touch') {
var t = ev.changedTouches[0];
-if (type === "touchstart") {
+if (type === 'touchstart') {
if (ev.touches.length === 1) {
POINTERSTATE.touch.id = t.identifier;
}
@@ -445,11 +448,11 @@ if (POINTERSTATE.touch.id !== t.identifier) {
return;
}
if (!HAS_NATIVE_TA) {
-if (type === "touchstart" || type === "touchmove") {
+if (type === 'touchstart' || type === 'touchmove') {
Gestures.handleTouchAction(ev);
}
}
-if (type === "touchend") {
+if (type === 'touchend') {
POINTERSTATE.mouse.target = Polymer.dom(ev).rootTarget;
ignoreMouse(true);
}
@@ -468,14 +471,14 @@ r[type](ev);
}
}
},
-handleTouchAction: function(ev) {
+handleTouchAction: function (ev) {
var t = ev.changedTouches[0];
var type = ev.type;
-if (type === "touchstart") {
+if (type === 'touchstart') {
POINTERSTATE.touch.x = t.clientX;
POINTERSTATE.touch.y = t.clientY;
POINTERSTATE.touch.scrollDecided = false;
-} else if (type === "touchmove") {
+} else if (type === 'touchmove') {
if (POINTERSTATE.touch.scrollDecided) {
return;
}
@@ -484,11 +487,12 @@ var ta = firstTouchAction(ev);
var prevent = false;
var dx = Math.abs(POINTERSTATE.touch.x - t.clientX);
var dy = Math.abs(POINTERSTATE.touch.y - t.clientY);
-if (!ev.cancelable) {} else if (ta === "none") {
+if (!ev.cancelable) {
+} else if (ta === 'none') {
prevent = true;
-} else if (ta === "pan-x") {
+} else if (ta === 'pan-x') {
prevent = dy > dx;
-} else if (ta === "pan-y") {
+} else if (ta === 'pan-y') {
prevent = dx > dy;
}
if (prevent) {
@@ -496,7 +500,7 @@ ev.preventDefault();
}
}
},
-add: function(node, evType, handler) {
+add: function (node, evType, handler) {
var recognizer = this.gestures[evType];
var deps = recognizer.deps;
var name = recognizer.name;
@@ -518,19 +522,19 @@ if (recognizer.touchAction) {
this.setTouchAction(node, recognizer.touchAction);
}
},
-register: function(recog) {
+register: function (recog) {
this.recognizers.push(recog);
for (var i = 0; i < recog.emits.length; i++) {
this.gestures[recog.emits[i]] = recog;
}
},
-setTouchAction: function(node, value) {
+setTouchAction: function (node, value) {
if (HAS_NATIVE_TA) {
node.style.touchAction = value;
}
node[TOUCH_ACTION] = value;
},
-fire: function(target, type, detail) {
+fire: function (target, type, detail) {
var ev = new CustomEvent(type, {
detail: detail,
bubbles: true,
@@ -540,26 +544,33 @@ target.dispatchEvent(ev);
}
};
Gestures.register({
-name: "downup",
-deps: [ "mousedown", "touchstart", "touchend" ],
-emits: [ "down", "up" ],
-mousedown: function(e) {
+name: 'downup',
+deps: [
+'mousedown',
+'touchstart',
+'touchend'
+],
+emits: [
+'down',
+'up'
+],
+mousedown: function (e) {
var t = e.currentTarget;
var self = this;
var upfn = function upfn(e) {
-self.fire("up", t, e);
-document.removeEventListener("mouseup", upfn);
+self.fire('up', t, e);
+document.removeEventListener('mouseup', upfn);
};
-document.addEventListener("mouseup", upfn);
-this.fire("down", t, e);
+document.addEventListener('mouseup', upfn);
+this.fire('down', t, e);
},
-touchstart: function(e) {
-this.fire("down", e.currentTarget, e.changedTouches[0]);
+touchstart: function (e) {
+this.fire('down', e.currentTarget, e.changedTouches[0]);
},
-touchend: function(e) {
-this.fire("up", e.currentTarget, e.changedTouches[0]);
+touchend: function (e) {
+this.fire('up', e.currentTarget, e.changedTouches[0]);
},
-fire: function(type, target, event) {
+fire: function (type, target, event) {
Gestures.fire(target, type, {
x: event.clientX,
y: event.clientY,
@@ -568,31 +579,36 @@ sourceEvent: event
}
});
Gestures.register({
-name: "track",
-touchAction: "none",
-deps: [ "mousedown", "touchstart", "touchmove", "touchend" ],
-emits: [ "track" ],
+name: 'track',
+touchAction: 'none',
+deps: [
+'mousedown',
+'touchstart',
+'touchmove',
+'touchend'
+],
+emits: ['track'],
info: {
x: 0,
y: 0,
-state: "start",
+state: 'start',
started: false,
moves: [],
-addMove: function(move) {
+addMove: function (move) {
if (this.moves.length > TRACK_LENGTH) {
this.moves.shift();
}
this.moves.push(move);
}
},
-clearInfo: function() {
-this.info.state = "start";
+clearInfo: function () {
+this.info.state = 'start';
this.info.started = false;
this.info.moves = [];
this.info.x = 0;
this.info.y = 0;
},
-hasMovedEnough: function(x, y) {
+hasMovedEnough: function (x, y) {
if (this.info.started) {
return true;
}
@@ -600,13 +616,13 @@ var dx = Math.abs(this.info.x - x);
var dy = Math.abs(this.info.y - y);
return dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE;
},
-mousedown: function(e) {
+mousedown: function (e) {
var t = e.currentTarget;
var self = this;
var movefn = function movefn(e) {
var x = e.clientX, y = e.clientY;
if (self.hasMovedEnough(x, y)) {
-self.info.state = self.info.started ? e.type === "mouseup" ? "end" : "track" : "start";
+self.info.state = self.info.started ? e.type === 'mouseup' ? 'end' : 'track' : 'start';
self.info.addMove({
x: x,
y: y
@@ -622,20 +638,20 @@ POINTERSTATE.tapPrevented = true;
movefn(e);
}
self.clearInfo();
-document.removeEventListener("mousemove", movefn);
-document.removeEventListener("mouseup", upfn);
+document.removeEventListener('mousemove', movefn);
+document.removeEventListener('mouseup', upfn);
};
-document.addEventListener("mousemove", movefn);
-document.addEventListener("mouseup", upfn);
+document.addEventListener('mousemove', movefn);
+document.addEventListener('mouseup', upfn);
this.info.x = e.clientX;
this.info.y = e.clientY;
},
-touchstart: function(e) {
+touchstart: function (e) {
var ct = e.changedTouches[0];
this.info.x = ct.clientX;
this.info.y = ct.clientY;
},
-touchmove: function(e) {
+touchmove: function (e) {
var t = e.currentTarget;
var ct = e.changedTouches[0];
var x = ct.clientX, y = ct.clientY;
@@ -645,16 +661,16 @@ x: x,
y: y
});
this.fire(t, ct);
-this.info.state = "track";
+this.info.state = 'track';
this.info.started = true;
}
},
-touchend: function(e) {
+touchend: function (e) {
var t = e.currentTarget;
var ct = e.changedTouches[0];
if (this.info.started) {
POINTERSTATE.tapPrevented = true;
-this.info.state = "end";
+this.info.state = 'end';
this.info.addMove({
x: ct.clientX,
y: ct.clientY
@@ -663,7 +679,7 @@ this.fire(t, ct);
}
this.clearInfo();
},
-fire: function(target, touch) {
+fire: function (target, touch) {
var secondlast = this.info.moves[this.info.moves.length - 2];
var lastmove = this.info.moves[this.info.moves.length - 1];
var dx = lastmove.x - this.info.x;
@@ -673,7 +689,7 @@ if (secondlast) {
ddx = lastmove.x - secondlast.x;
ddy = lastmove.y - secondlast.y;
}
-return Gestures.fire(target, "track", {
+return Gestures.fire(target, 'track', {
state: this.info.state,
x: touch.clientX,
y: touch.clientY,
@@ -682,48 +698,53 @@ dy: dy,
ddx: ddx,
ddy: ddy,
sourceEvent: touch,
-hover: function() {
+hover: function () {
return Gestures.deepTargetFind(touch.clientX, touch.clientY);
}
});
}
});
Gestures.register({
-name: "tap",
-deps: [ "mousedown", "click", "touchstart", "touchend" ],
-emits: [ "tap" ],
+name: 'tap',
+deps: [
+'mousedown',
+'click',
+'touchstart',
+'touchend'
+],
+emits: ['tap'],
start: {
x: NaN,
y: NaN
},
-reset: function() {
+reset: function () {
this.start.x = NaN;
this.start.y = NaN;
},
-save: function(e) {
+save: function (e) {
this.start.x = e.clientX;
this.start.y = e.clientY;
},
-mousedown: function(e) {
+mousedown: function (e) {
POINTERSTATE.tapPrevented = false;
this.save(e);
},
-click: function(e) {
+click: function (e) {
this.forward(e);
},
-touchstart: function(e) {
+touchstart: function (e) {
POINTERSTATE.tapPrevented = false;
this.save(e.changedTouches[0]);
},
-touchend: function(e) {
+touchend: function (e) {
this.forward(e.changedTouches[0]);
},
-forward: function(e) {
+forward: function (e) {
var dx = Math.abs(e.clientX - this.start.x);
var dy = Math.abs(e.clientY - this.start.y);
if (isNaN(dx) || isNaN(dy) || dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) {
if (!POINTERSTATE.tapPrevented) {
-Gestures.fire(e.target, "tap", {
+Gestures.fire(e.target, 'tap', {
x: e.clientX,
y: e.clientY,
sourceEvent: e
@@ -734,32 +755,31 @@ this.reset();
}
});
var DIRECTION_MAP = {
-x: "pan-x",
-y: "pan-y",
-none: "none",
-all: "auto"
+x: 'pan-x',
+y: 'pan-y',
+none: 'none',
+all: 'auto'
};
Polymer.Base._addFeature({
-_listen: function(node, eventName, handler) {
+_listen: function (node, eventName, handler) {
if (Gestures.gestures[eventName]) {
Gestures.add(node, eventName, handler);
} else {
node.addEventListener(eventName, handler);
}
},
-setScrollDirection: function(direction, node) {
+setScrollDirection: function (direction, node) {
node = node || this;
-Gestures.setTouchAction(node, DIRECTION_MAP[direction] || "auto");
+Gestures.setTouchAction(node, DIRECTION_MAP[direction] || 'auto');
}
});
Polymer.Gestures = Gestures;
-})();
-
-Polymer.Async = function() {
+}());
+Polymer.Async = function () {
var currVal = 0;
var lastVal = 0;
var callbacks = [];
-var twiddle = document.createTextNode("");
+var twiddle = document.createTextNode('');
function runAsync(callback, waitTime) {
if (waitTime > 0) {
return ~setTimeout(callback, waitTime);
@@ -776,7 +796,7 @@ clearTimeout(~handle);
var idx = handle - lastVal;
if (idx >= 0) {
if (!callbacks[idx]) {
-throw "invalid async handle: " + handle;
+throw 'invalid async handle: ' + handle;
}
callbacks[idx] = null;
}
@@ -793,37 +813,34 @@ cb();
callbacks.splice(0, len);
lastVal += len;
}
-new (window.MutationObserver || JsMutationObserver)(atEndOfMicrotask).observe(twiddle, {
-characterData: true
-});
+new (window.MutationObserver || JsMutationObserver)(atEndOfMicrotask).observe(twiddle, { characterData: true });
return {
run: runAsync,
cancel: cancelAsync
};
}();
-
-Polymer.Debounce = function() {
+Polymer.Debounce = function () {
var Async = Polymer.Async;
-var Debouncer = function(context) {
+var Debouncer = function (context) {
this.context = context;
this.boundComplete = this.complete.bind(this);
};
Debouncer.prototype = {
-go: function(callback, wait) {
+go: function (callback, wait) {
var h;
-this.finish = function() {
+this.finish = function () {
Async.cancel(h);
};
h = Async.run(this.boundComplete, wait);
this.callback = callback;
},
-stop: function() {
+stop: function () {
if (this.finish) {
this.finish();
this.finish = null;
}
},
-complete: function() {
+complete: function () {
if (this.finish) {
this.stop();
this.callback.call(this.context);
@@ -841,12 +858,11 @@ return debouncer;
}
return debounce;
}();
-
Polymer.Base._addFeature({
-$$: function(slctr) {
+$$: function (slctr) {
return Polymer.dom(this.root).querySelector(slctr);
},
-toggleClass: function(name, bool, node) {
+toggleClass: function (name, bool, node) {
node = node || this;
if (arguments.length == 1) {
bool = !node.classList.contains(name);
@@ -857,18 +873,18 @@ Polymer.dom(node).classList.add(name);
Polymer.dom(node).classList.remove(name);
}
},
-toggleAttribute: function(name, bool, node) {
+toggleAttribute: function (name, bool, node) {
node = node || this;
if (arguments.length == 1) {
bool = !node.hasAttribute(name);
}
if (bool) {
-Polymer.dom(node).setAttribute(name, "");
+Polymer.dom(node).setAttribute(name, '');
} else {
Polymer.dom(node).removeAttribute(name);
}
},
-classFollows: function(name, toElement, fromElement) {
+classFollows: function (name, toElement, fromElement) {
if (fromElement) {
Polymer.dom(fromElement).classList.remove(name);
}
@@ -876,23 +892,23 @@ if (toElement) {
Polymer.dom(toElement).classList.add(name);
}
},
-attributeFollows: function(name, toElement, fromElement) {
+attributeFollows: function (name, toElement, fromElement) {
if (fromElement) {
Polymer.dom(fromElement).removeAttribute(name);
}
if (toElement) {
-Polymer.dom(toElement).setAttribute(name, "");
+Polymer.dom(toElement).setAttribute(name, '');
}
},
-getContentChildNodes: function(slctr) {
-return Polymer.dom(Polymer.dom(this.root).querySelector(slctr || "content")).getDistributedNodes();
+getContentChildNodes: function (slctr) {
+return Polymer.dom(Polymer.dom(this.root).querySelector(slctr || 'content')).getDistributedNodes();
},
-getContentChildren: function(slctr) {
-return this.getContentChildNodes(slctr).filter(function(n) {
+getContentChildren: function (slctr) {
+return this.getContentChildNodes(slctr).filter(function (n) {
return n.nodeType === Node.ELEMENT_NODE;
});
},
-fire: function(type, detail, options) {
+fire: function (type, detail, options) {
options = options || Polymer.nob;
var node = options.node || this;
var detail = detail === null || detail === undefined ? Polymer.nob : detail;
@@ -905,13 +921,13 @@ detail: detail
node.dispatchEvent(event);
return event;
},
-async: function(callback, waitTime) {
+async: function (callback, waitTime) {
return Polymer.Async.run(callback.bind(this), waitTime);
},
-cancelAsync: function(handle) {
+cancelAsync: function (handle) {
Polymer.Async.cancel(handle);
},
-arrayDelete: function(path, item) {
+arrayDelete: function (path, item) {
var index;
if (Array.isArray(path)) {
index = path.indexOf(item);
@@ -926,18 +942,18 @@ return this.splice(path, index, 1);
}
}
},
-transform: function(transform, node) {
+transform: function (transform, node) {
node = node || this;
node.style.webkitTransform = transform;
node.style.transform = transform;
},
-translate3d: function(x, y, z, node) {
+translate3d: function (x, y, z, node) {
node = node || this;
-this.transform("translate3d(" + x + "," + y + "," + z + ")", node);
+this.transform('translate3d(' + x + ',' + y + ',' + z + ')', node);
},
-importHref: function(href, onload, onerror) {
-var l = document.createElement("link");
-l.rel = "import";
+importHref: function (href, onload, onerror) {
+var l = document.createElement('link');
+l.rel = 'import';
l.href = href;
if (onload) {
l.onload = onload.bind(this);
@@ -948,7 +964,7 @@ l.onerror = onerror.bind(this);
document.head.appendChild(l);
return l;
},
-create: function(tag, props) {
+create: function (tag, props) {
var elt = document.createElement(tag);
if (props) {
for (var n in props) {
@@ -957,15 +973,14 @@ elt[n] = props[n];
}
return elt;
},
-mixin: function(target, source) {
+mixin: function (target, source) {
for (var i in source) {
target[i] = source[i];
}
}
});
-
Polymer.Bind = {
-prepareModel: function(model) {
+prepareModel: function (model) {
model._propertyEffects = {};
model._bindListeners = [];
var api = this._modelApi;
@@ -974,19 +989,15 @@ model[n] = api[n];
}
},
_modelApi: {
-_notifyChange: function(property) {
-var eventName = Polymer.CaseMap.camelToDashCase(property) + "-changed";
-this.fire(eventName, {
-value: this[property]
-}, {
-bubbles: false
-});
+_notifyChange: function (property) {
+var eventName = Polymer.CaseMap.camelToDashCase(property) + '-changed';
+this.fire(eventName, { value: this[property] }, { bubbles: false });
},
-_propertySet: function(property, value, effects) {
+_propertySet: function (property, value, effects) {
var old = this.__data__[property];
if (old !== value) {
this.__data__[property] = value;
-if (typeof value == "object") {
+if (typeof value == 'object') {
this._clearPath(property);
}
if (this._propertyChanged) {
@@ -998,37 +1009,37 @@ this._effectEffects(property, value, effects, old);
}
return old;
},
-_effectEffects: function(property, value, effects, old) {
-effects.forEach(function(fx) {
-var fn = Polymer.Bind["_" + fx.kind + "Effect"];
+_effectEffects: function (property, value, effects, old) {
+effects.forEach(function (fx) {
+var fn = Polymer.Bind['_' + fx.kind + 'Effect'];
if (fn) {
fn.call(this, property, value, fx.effect, old);
}
}, this);
},
-_clearPath: function(path) {
+_clearPath: function (path) {
for (var prop in this.__data__) {
-if (prop.indexOf(path + ".") === 0) {
+if (prop.indexOf(path + '.') === 0) {
this.__data__[prop] = undefined;
}
}
}
},
-ensurePropertyEffects: function(model, property) {
+ensurePropertyEffects: function (model, property) {
var fx = model._propertyEffects[property];
if (!fx) {
fx = model._propertyEffects[property] = [];
}
return fx;
},
-addPropertyEffect: function(model, property, kind, effect) {
+addPropertyEffect: function (model, property, kind, effect) {
var fx = this.ensurePropertyEffects(model, property);
fx.push({
kind: kind,
effect: effect
});
},
-createBindings: function(model) {
+createBindings: function (model) {
var fx$ = model._propertyEffects;
if (fx$) {
for (var n in fx$) {
@@ -1038,43 +1049,43 @@ this._createAccessors(model, n, fx);
}
}
},
-_sortPropertyEffects: function() {
+_sortPropertyEffects: function () {
var EFFECT_ORDER = {
-compute: 0,
-annotation: 1,
-computedAnnotation: 2,
-reflect: 3,
-notify: 4,
-observer: 5,
-complexObserver: 6,
-"function": 7
+'compute': 0,
+'annotation': 1,
+'computedAnnotation': 2,
+'reflect': 3,
+'notify': 4,
+'observer': 5,
+'complexObserver': 6,
+'function': 7
};
-return function(a, b) {
+return function (a, b) {
return EFFECT_ORDER[a.kind] - EFFECT_ORDER[b.kind];
};
}(),
-_createAccessors: function(model, property, effects) {
+_createAccessors: function (model, property, effects) {
var defun = {
-get: function() {
+get: function () {
return this.__data__[property];
}
};
-var setter = function(value) {
+var setter = function (value) {
this._propertySet(property, value, effects);
};
if (model.getPropertyInfo && model.getPropertyInfo(property).readOnly) {
-model["_set" + this.upper(property)] = setter;
+model['_set' + this.upper(property)] = setter;
} else {
defun.set = setter;
}
Object.defineProperty(model, property, defun);
},
-upper: function(name) {
+upper: function (name) {
return name[0].toUpperCase() + name.substring(1);
},
-_addAnnotatedListener: function(model, index, property, path, event) {
+_addAnnotatedListener: function (model, index, property, path, event) {
var fn = this._notedListenerFactory(property, path, this._isStructured(path), this._isEventBogus);
-var eventName = event || Polymer.CaseMap.camelToDashCase(property) + "-changed";
+var eventName = event || Polymer.CaseMap.camelToDashCase(property) + '-changed';
model._bindListeners.push({
index: index,
property: property,
@@ -1083,14 +1094,14 @@ changedFn: fn,
event: eventName
});
},
-_isStructured: function(path) {
-return path.indexOf(".") > 0;
+_isStructured: function (path) {
+return path.indexOf('.') > 0;
},
-_isEventBogus: function(e, target) {
+_isEventBogus: function (e, target) {
return e.path && e.path[0] !== target;
},
-_notedListenerFactory: function(property, path, isStructured, bogusTest) {
-return function(e, target) {
+_notedListenerFactory: function (property, path, isStructured, bogusTest) {
+return function (e, target) {
if (!bogusTest(e, target)) {
if (e.detail && e.detail.path) {
this.notifyPath(this._fixPath(path, property, e.detail.path), e.detail.value);
@@ -1107,22 +1118,21 @@ this.set(path, value);
}
};
},
-prepareInstance: function(inst) {
+prepareInstance: function (inst) {
inst.__data__ = Object.create(null);
},
-setupBindListeners: function(inst) {
-inst._bindListeners.forEach(function(info) {
+setupBindListeners: function (inst) {
+inst._bindListeners.forEach(function (info) {
var node = inst._nodes[info.index];
node.addEventListener(info.event, inst._notifyListener.bind(inst, info.changedFn));
});
}
};
-
Polymer.Base.extend(Polymer.Bind, {
-_shouldAddListener: function(effect) {
-return effect.name && effect.mode === "{" && !effect.negate && effect.kind != "attribute";
+_shouldAddListener: function (effect) {
+return effect.name && effect.mode === '{' && !effect.negate && effect.kind != 'attribute';
},
-_annotationEffect: function(source, value, effect) {
+_annotationEffect: function (source, value, effect) {
if (source != effect.value) {
value = this.get(effect.value);
this.__data__[effect.value] = value;
@@ -1132,24 +1142,24 @@ if (!effect.customEvent || this._nodes[effect.index][effect.name] !== calc) {
return this._applyEffectValue(calc, effect);
}
},
-_reflectEffect: function(source) {
+_reflectEffect: function (source) {
this.reflectPropertyToAttribute(source);
},
-_notifyEffect: function(source) {
+_notifyEffect: function (source) {
this._notifyChange(source);
},
-_functionEffect: function(source, value, fn, old) {
+_functionEffect: function (source, value, fn, old) {
fn.call(this, source, value, old);
},
-_observerEffect: function(source, value, effect, old) {
+_observerEffect: function (source, value, effect, old) {
var fn = this[effect.method];
if (fn) {
fn.call(this, value, old);
} else {
-this._warn(this._logf("_observerEffect", "observer method `" + effect.method + "` not defined"));
+this._warn(this._logf('_observerEffect', 'observer method `' + effect.method + '` not defined'));
}
},
-_complexObserverEffect: function(source, value, effect) {
+_complexObserverEffect: function (source, value, effect) {
var fn = this[effect.method];
if (fn) {
var args = Polymer.Bind._marshalArgs(this.__data__, effect, source, value);
@@ -1157,21 +1167,21 @@ if (args) {
fn.apply(this, args);
}
} else {
-this._warn(this._logf("_complexObserverEffect", "observer method `" + effect.method + "` not defined"));
+this._warn(this._logf('_complexObserverEffect', 'observer method `' + effect.method + '` not defined'));
}
},
-_computeEffect: function(source, value, effect) {
+_computeEffect: function (source, value, effect) {
var args = Polymer.Bind._marshalArgs(this.__data__, effect, source, value);
if (args) {
var fn = this[effect.method];
if (fn) {
this[effect.property] = fn.apply(this, args);
} else {
-this._warn(this._logf("_computeEffect", "compute method `" + effect.method + "` not defined"));
+this._warn(this._logf('_computeEffect', 'compute method `' + effect.method + '` not defined'));
}
}
},
-_annotatedComputationEffect: function(source, value, effect) {
+_annotatedComputationEffect: function (source, value, effect) {
var computedHost = this._rootDataHost || this;
var fn = computedHost[effect.method];
if (fn) {
@@ -1184,15 +1194,16 @@ computedvalue = !computedvalue;
this._applyEffectValue(computedvalue, effect);
}
} else {
-computedHost._warn(computedHost._logf("_annotatedComputationEffect", "compute method `" + effect.method + "` not defined"));
+computedHost._warn(computedHost._logf('_annotatedComputationEffect', 'compute method `' + effect.method + '` not defined'));
}
},
-_marshalArgs: function(model, effect, path, value) {
+_marshalArgs: function (model, effect, path, value) {
var values = [];
var args = effect.args;
for (var i = 0, l = args.length; i < l; i++) {
var arg = args[i];
var name = arg.name;
+var v;
if (arg.literal) {
v = arg.value;
} else if (arg.structured) {
@@ -1204,7 +1215,7 @@ if (args.length > 1 && v === undefined) {
return;
}
if (arg.wildcard) {
-var baseChanged = name.indexOf(path + ".") === 0;
+var baseChanged = name.indexOf(path + '.') === 0;
var matches = effect.trigger.name.indexOf(name) === 0 && !baseChanged;
values[i] = {
path: matches ? path : name,
@@ -1218,19 +1229,18 @@ values[i] = v;
return values;
}
});
-
Polymer.Base._addFeature({
-_addPropertyEffect: function(property, kind, effect) {
+_addPropertyEffect: function (property, kind, effect) {
Polymer.Bind.addPropertyEffect(this, property, kind, effect);
},
-_prepEffects: function() {
+_prepEffects: function () {
Polymer.Bind.prepareModel(this);
this._addAnnotationEffects(this._notes);
},
-_prepBindings: function() {
+_prepBindings: function () {
Polymer.Bind.createBindings(this);
},
-_addPropertyEffects: function(properties) {
+_addPropertyEffects: function (properties) {
if (properties) {
for (var p in properties) {
var prop = properties[p];
@@ -1241,10 +1251,10 @@ if (prop.computed) {
this._addComputedEffect(p, prop.computed);
}
if (prop.notify) {
-this._addPropertyEffect(p, "notify");
+this._addPropertyEffect(p, 'notify');
}
if (prop.reflectToAttribute) {
-this._addPropertyEffect(p, "reflect");
+this._addPropertyEffect(p, 'reflect');
}
if (prop.readOnly) {
Polymer.Bind.ensurePropertyEffects(this, p);
@@ -1252,10 +1262,10 @@ Polymer.Bind.ensurePropertyEffects(this, p);
}
}
},
-_addComputedEffect: function(name, expression) {
+_addComputedEffect: function (name, expression) {
var sig = this._parseMethod(expression);
-sig.args.forEach(function(arg) {
-this._addPropertyEffect(arg.model, "compute", {
+sig.args.forEach(function (arg) {
+this._addPropertyEffect(arg.model, 'compute', {
method: sig.method,
args: sig.args,
trigger: arg,
@@ -1263,39 +1273,39 @@ property: name
});
}, this);
},
-_addObserverEffect: function(property, observer) {
-this._addPropertyEffect(property, "observer", {
+_addObserverEffect: function (property, observer) {
+this._addPropertyEffect(property, 'observer', {
method: observer,
property: property
});
},
-_addComplexObserverEffects: function(observers) {
+_addComplexObserverEffects: function (observers) {
if (observers) {
-observers.forEach(function(observer) {
+observers.forEach(function (observer) {
this._addComplexObserverEffect(observer);
}, this);
}
},
-_addComplexObserverEffect: function(observer) {
+_addComplexObserverEffect: function (observer) {
var sig = this._parseMethod(observer);
-sig.args.forEach(function(arg) {
-this._addPropertyEffect(arg.model, "complexObserver", {
+sig.args.forEach(function (arg) {
+this._addPropertyEffect(arg.model, 'complexObserver', {
method: sig.method,
args: sig.args,
trigger: arg
});
}, this);
},
-_addAnnotationEffects: function(notes) {
+_addAnnotationEffects: function (notes) {
this._nodes = [];
-notes.forEach(function(note) {
+notes.forEach(function (note) {
var index = this._nodes.push(note) - 1;
-note.bindings.forEach(function(binding) {
+note.bindings.forEach(function (binding) {
this._addAnnotationEffect(binding, index);
}, this);
}, this);
},
-_addAnnotationEffect: function(note, index) {
+_addAnnotationEffect: function (note, index) {
if (Polymer.Bind._shouldAddListener(note)) {
Polymer.Bind._addAnnotatedListener(this, index, note.name, note.value, note.event);
}
@@ -1303,23 +1313,23 @@ if (note.signature) {
this._addAnnotatedComputationEffect(note, index);
} else {
note.index = index;
-this._addPropertyEffect(note.model, "annotation", note);
+this._addPropertyEffect(note.model, 'annotation', note);
}
},
-_addAnnotatedComputationEffect: function(note, index) {
+_addAnnotatedComputationEffect: function (note, index) {
var sig = note.signature;
if (sig.static) {
-this.__addAnnotatedComputationEffect("__static__", index, note, sig, null);
+this.__addAnnotatedComputationEffect('__static__', index, note, sig, null);
} else {
-sig.args.forEach(function(arg) {
+sig.args.forEach(function (arg) {
if (!arg.literal) {
this.__addAnnotatedComputationEffect(arg.model, index, note, sig, arg);
}
}, this);
}
},
-__addAnnotatedComputationEffect: function(property, index, note, sig, trigger) {
-this._addPropertyEffect(property, "annotatedComputation", {
+__addAnnotatedComputationEffect: function (property, index, note, sig, trigger) {
+this._addPropertyEffect(property, 'annotatedComputation', {
index: index,
kind: note.kind,
property: note.name,
@@ -1329,15 +1339,15 @@ args: sig.args,
trigger: trigger
});
},
-_parseMethod: function(expression) {
+_parseMethod: function (expression) {
var m = expression.match(/(\w*)\((.*)\)/);
if (m) {
var sig = {
method: m[1],
-"static": true
+static: true
};
if (m[2].trim()) {
-var args = m[2].replace(/\\,/g, "&comma;").split(",");
+var args = m[2].replace(/\\,/g, '&comma;').split(',');
return this._parseArgs(args, sig);
} else {
sig.args = Polymer.nar;
@@ -1345,8 +1355,8 @@ return sig;
}
}
},
-_parseArgs: function(argList, sig) {
-sig.args = argList.map(function(rawArg) {
+_parseArgs: function (argList, sig) {
+sig.args = argList.map(function (rawArg) {
var arg = this._parseArg(rawArg);
if (!arg.literal) {
sig.static = false;
@@ -1355,32 +1365,31 @@ return arg;
}, this);
return sig;
},
-_parseArg: function(rawArg) {
-var arg = rawArg.trim().replace(/&comma;/g, ",").replace(/\\(.)/g, "$1");
+_parseArg: function (rawArg) {
+var arg = rawArg.trim().replace(/&comma;/g, ',').replace(/\\(.)/g, '$1');
var a = {
name: arg,
model: this._modelForPath(arg)
};
var fc = arg[0];
-if (fc >= "0" && fc <= "9") {
-fc = "#";
+if (fc >= '0' && fc <= '9') {
+fc = '#';
}
switch (fc) {
-case "'":
+case '\'':
case '"':
a.value = arg.slice(1, -1);
a.literal = true;
break;
-
-case "#":
+case '#':
a.value = Number(arg);
a.literal = true;
break;
}
if (!a.literal) {
-a.structured = arg.indexOf(".") > 0;
+a.structured = arg.indexOf('.') > 0;
if (a.structured) {
-a.wildcard = arg.slice(-2) == ".*";
+a.wildcard = arg.slice(-2) == '.*';
if (a.wildcard) {
a.name = arg.slice(0, -2);
}
@@ -1388,50 +1397,49 @@ a.name = arg.slice(0, -2);
}
return a;
},
-_marshalInstanceEffects: function() {
+_marshalInstanceEffects: function () {
Polymer.Bind.prepareInstance(this);
Polymer.Bind.setupBindListeners(this);
},
-_applyEffectValue: function(value, info) {
+_applyEffectValue: function (value, info) {
var node = this._nodes[info.index];
-var property = info.property || info.name || "textContent";
-if (info.kind == "attribute") {
+var property = info.property || info.name || 'textContent';
+if (info.kind == 'attribute') {
this.serializeValueToAttribute(value, property, node);
} else {
-if (property === "className") {
+if (property === 'className') {
value = this._scopeElementClass(node, value);
}
-if (property === "textContent" || node.localName == "input" && property == "value") {
-value = value == undefined ? "" : value;
+if (property === 'textContent' || node.localName == 'input' && property == 'value') {
+value = value == undefined ? '' : value;
}
return node[property] = value;
}
},
-_executeStaticEffects: function() {
+_executeStaticEffects: function () {
if (this._propertyEffects.__static__) {
-this._effectEffects("__static__", null, this._propertyEffects.__static__);
+this._effectEffects('__static__', null, this._propertyEffects.__static__);
}
}
});
-
Polymer.Base._addFeature({
-_setupConfigure: function(initialConfig) {
+_setupConfigure: function (initialConfig) {
this._config = initialConfig || {};
this._handlers = [];
},
-_marshalAttributes: function() {
+_marshalAttributes: function () {
this._takeAttributesToModel(this._config);
},
-_configValue: function(name, value) {
+_configValue: function (name, value) {
this._config[name] = value;
},
-_beforeClientsReady: function() {
+_beforeClientsReady: function () {
this._configure();
},
-_configure: function() {
+_configure: function () {
this._configureAnnotationReferences();
var config = {};
-this.behaviors.forEach(function(b) {
+this.behaviors.forEach(function (b) {
this._configureProperties(b.properties, config);
}, this);
this._configureProperties(this.properties, config);
@@ -1439,33 +1447,33 @@ this._mixinConfigure(config, this._config);
this._config = config;
this._distributeConfig(this._config);
},
-_configureProperties: function(properties, config) {
+_configureProperties: function (properties, config) {
for (var i in properties) {
var c = properties[i];
if (c.value !== undefined) {
var value = c.value;
-if (typeof value == "function") {
+if (typeof value == 'function') {
value = value.call(this, this._config);
}
config[i] = value;
}
}
},
-_mixinConfigure: function(a, b) {
+_mixinConfigure: function (a, b) {
for (var prop in b) {
if (!this.getPropertyInfo(prop).readOnly) {
a[prop] = b[prop];
}
}
},
-_distributeConfig: function(config) {
+_distributeConfig: function (config) {
var fx$ = this._propertyEffects;
if (fx$) {
for (var p in config) {
var fx = fx$[p];
if (fx) {
for (var i = 0, l = fx.length, x; i < l && (x = fx[i]); i++) {
-if (x.kind === "annotation") {
+if (x.kind === 'annotation') {
var node = this._nodes[x.effect.index];
if (node._configValue) {
var value = p === x.effect.value ? config[p] : this.get(x.effect.value, config);
@@ -1477,12 +1485,12 @@ node._configValue(x.effect.name, value);
}
}
},
-_afterClientsReady: function() {
+_afterClientsReady: function () {
this._executeStaticEffects();
this._applyConfig(this._config);
this._flushHandlers();
},
-_applyConfig: function(config) {
+_applyConfig: function (config) {
for (var n in config) {
if (this[n] === undefined) {
var effects = this._propertyEffects[n];
@@ -1494,28 +1502,31 @@ this[n] = config[n];
}
}
},
-_notifyListener: function(fn, e) {
+_notifyListener: function (fn, e) {
if (!this._clientsReadied) {
-this._queueHandler([ fn, e, e.target ]);
+this._queueHandler([
+fn,
+e,
+e.target
+]);
} else {
return fn.call(this, e, e.target);
}
},
-_queueHandler: function(args) {
+_queueHandler: function (args) {
this._handlers.push(args);
},
-_flushHandlers: function() {
+_flushHandlers: function () {
var h$ = this._handlers;
for (var i = 0, l = h$.length, h; i < l && (h = h$[i]); i++) {
h[0].call(this, h[1], h[2]);
}
}
});
-
-(function() {
-"use strict";
+(function () {
+'use strict';
Polymer.Base._addFeature({
-notifyPath: function(path, value, fromAbove) {
+notifyPath: function (path, value, fromAbove) {
var old = this._propertySet(path, value);
if (old !== value) {
this._pathEffector(path, value);
@@ -1524,21 +1535,21 @@ this._notifyPath(path, value);
}
}
},
-_getPathParts: function(path) {
+_getPathParts: function (path) {
if (Array.isArray(path)) {
var parts = [];
for (var i = 0; i < path.length; i++) {
-var args = path[i].toString().split(".");
+var args = path[i].toString().split('.');
for (var j = 0; j < args.length; j++) {
parts.push(args[j]);
}
}
return parts;
} else {
-return path.toString().split(".");
+return path.toString().split('.');
}
},
-set: function(path, value, root) {
+set: function (path, value, root) {
var prop = root || this;
var parts = this._getPathParts(path);
var array;
@@ -1556,13 +1567,13 @@ array = Array.isArray(prop) ? prop : null;
}
prop[last] = value;
if (!root) {
-this.notifyPath(parts.join("."), value);
+this.notifyPath(parts.join('.'), value);
}
} else {
prop[path] = value;
}
},
-get: function(path, root) {
+get: function (path, root) {
var prop = root || this;
var parts = this._getPathParts(path);
var last = parts.pop();
@@ -1574,12 +1585,12 @@ return;
}
return prop[last];
},
-_pathEffector: function(path, value) {
+_pathEffector: function (path, value) {
var model = this._modelForPath(path);
var fx$ = this._propertyEffects[model];
if (fx$) {
-fx$.forEach(function(fx) {
-var fxFn = this["_" + fx.kind + "PathEffect"];
+fx$.forEach(function (fx) {
+var fxFn = this['_' + fx.kind + 'PathEffect'];
if (fxFn) {
fxFn.call(this, path, value, fx.effect);
}
@@ -1589,10 +1600,10 @@ if (this._boundPaths) {
this._notifyBoundPaths(path, value);
}
},
-_annotationPathEffect: function(path, value, effect) {
-if (effect.value === path || effect.value.indexOf(path + ".") === 0) {
+_annotationPathEffect: function (path, value, effect) {
+if (effect.value === path || effect.value.indexOf(path + '.') === 0) {
Polymer.Bind._annotationEffect.call(this, path, value, effect);
-} else if (path.indexOf(effect.value + ".") === 0 && !effect.negate) {
+} else if (path.indexOf(effect.value + '.') === 0 && !effect.negate) {
var node = this._nodes[effect.index];
if (node && node.notifyPath) {
var p = this._fixPath(effect.name, effect.value, path);
@@ -1600,26 +1611,26 @@ node.notifyPath(p, value, true);
}
}
},
-_complexObserverPathEffect: function(path, value, effect) {
+_complexObserverPathEffect: function (path, value, effect) {
if (this._pathMatchesEffect(path, effect)) {
Polymer.Bind._complexObserverEffect.call(this, path, value, effect);
}
},
-_computePathEffect: function(path, value, effect) {
+_computePathEffect: function (path, value, effect) {
if (this._pathMatchesEffect(path, effect)) {
Polymer.Bind._computeEffect.call(this, path, value, effect);
}
},
-_annotatedComputationPathEffect: function(path, value, effect) {
+_annotatedComputationPathEffect: function (path, value, effect) {
if (this._pathMatchesEffect(path, effect)) {
Polymer.Bind._annotatedComputationEffect.call(this, path, value, effect);
}
},
-_pathMatchesEffect: function(path, effect) {
+_pathMatchesEffect: function (path, effect) {
var effectArg = effect.trigger.name;
-return effectArg == path || effectArg.indexOf(path + ".") === 0 || effect.trigger.wildcard && path.indexOf(effectArg) === 0;
+return effectArg == path || effectArg.indexOf(path + '.') === 0 || effect.trigger.wildcard && path.indexOf(effectArg) === 0;
},
-linkPaths: function(to, from) {
+linkPaths: function (to, from) {
this._boundPaths = this._boundPaths || {};
if (from) {
this._boundPaths[to] = from;
@@ -1627,21 +1638,21 @@ this._boundPaths[to] = from;
this.unbindPath(to);
}
},
-unlinkPaths: function(path) {
+unlinkPaths: function (path) {
if (this._boundPaths) {
delete this._boundPaths[path];
}
},
-_notifyBoundPaths: function(path, value) {
+_notifyBoundPaths: function (path, value) {
var from, to;
for (var a in this._boundPaths) {
var b = this._boundPaths[a];
-if (path.indexOf(a + ".") == 0) {
+if (path.indexOf(a + '.') == 0) {
from = a;
to = b;
break;
}
-if (path.indexOf(b + ".") == 0) {
+if (path.indexOf(b + '.') == 0) {
from = b;
to = a;
break;
@@ -1652,45 +1663,43 @@ var p = this._fixPath(to, from, path);
this.notifyPath(p, value);
}
},
-_fixPath: function(property, root, path) {
+_fixPath: function (property, root, path) {
return property + path.slice(root.length);
},
-_notifyPath: function(path, value) {
+_notifyPath: function (path, value) {
var rootName = this._modelForPath(path);
var dashCaseName = Polymer.CaseMap.camelToDashCase(rootName);
var eventName = dashCaseName + this._EVENT_CHANGED;
this.fire(eventName, {
path: path,
value: value
-}, {
-bubbles: false
-});
+}, { bubbles: false });
},
-_modelForPath: function(path) {
-var dot = path.indexOf(".");
+_modelForPath: function (path) {
+var dot = path.indexOf('.');
return dot < 0 ? path : path.slice(0, dot);
},
-_EVENT_CHANGED: "-changed",
-_notifySplice: function(array, path, index, added, removed) {
-var splices = [ {
+_EVENT_CHANGED: '-changed',
+_notifySplice: function (array, path, index, added, removed) {
+var splices = [{
index: index,
addedCount: added,
removed: removed,
object: array,
-type: "splice"
-} ];
+type: 'splice'
+}];
var change = {
keySplices: Polymer.Collection.get(array).applySplices(splices),
indexSplices: splices
};
-this.set(path + ".splices", change);
+this.set(path + '.splices', change);
if (added != removed.length) {
-this.notifyPath(path + ".length", array.length);
+this.notifyPath(path + '.length', array.length);
}
change.keySplices = null;
change.indexSplices = null;
},
-push: function(path) {
+push: function (path) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var len = array.length;
@@ -1698,7 +1707,7 @@ var ret = array.push.apply(array, args);
this._notifySplice(array, path, len, args.length, []);
return ret;
},
-pop: function(path) {
+pop: function (path) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var rem = array.slice(-1);
@@ -1706,7 +1715,7 @@ var ret = array.pop.apply(array, args);
this._notifySplice(array, path, array.length, 0, rem);
return ret;
},
-splice: function(path, start, deleteCount) {
+splice: function (path, start, deleteCount) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var rem = array.slice(start, start + deleteCount);
@@ -1714,14 +1723,14 @@ var ret = array.splice.apply(array, args);
this._notifySplice(array, path, start, args.length - 2, rem);
return ret;
},
-shift: function(path) {
+shift: function (path) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var ret = array.shift.apply(array, args);
-this._notifySplice(array, path, 0, 0, [ ret ]);
+this._notifySplice(array, path, 0, 0, [ret]);
return ret;
},
-unshift: function(path) {
+unshift: function (path) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var ret = array.unshift.apply(array, args);
@@ -1729,30 +1738,28 @@ this._notifySplice(array, path, 0, args.length, []);
return ret;
}
});
-})();
-
+}());
Polymer.Base._addFeature({
-resolveUrl: function(url) {
+resolveUrl: function (url) {
var module = Polymer.DomModule.import(this.is);
-var root = "";
+var root = '';
if (module) {
-var assetPath = module.getAttribute("assetpath") || "";
+var assetPath = module.getAttribute('assetpath') || '';
root = Polymer.ResolveUrl.resolveUrl(assetPath, module.ownerDocument.baseURI);
}
return Polymer.ResolveUrl.resolveUrl(url, root);
}
});
-
-Polymer.CssParse = function() {
+Polymer.CssParse = function () {
var api = {
-parse: function(text) {
+parse: function (text) {
text = this._clean(text);
return this._parseCss(this._lex(text), text);
},
-_clean: function(cssText) {
-return cssText.replace(rx.comments, "").replace(rx.port, "");
+_clean: function (cssText) {
+return cssText.replace(rx.comments, '').replace(rx.port, '');
},
-_lex: function(text) {
+_lex: function (text) {
var root = {
start: 0,
end: text.length
@@ -1773,7 +1780,6 @@ previous: previous
};
p.rules.push(n);
break;
-
case this.CLOSE_BRACE:
n.end = i + 1;
n = n.parent || root;
@@ -1782,13 +1788,13 @@ break;
}
return root;
},
-_parseCss: function(node, text) {
+_parseCss: function (node, text) {
var t = text.substring(node.start, node.end - 1);
node.parsedCssText = node.cssText = t.trim();
if (node.parent) {
var ss = node.previous ? node.previous.end : node.parent.start;
t = text.substring(ss, node.start - 1);
-t = t.substring(t.lastIndexOf(";") + 1);
+t = t.substring(t.lastIndexOf(';') + 1);
var s = node.parsedSelector = node.selector = t.trim();
node.atRule = s.indexOf(AT_START) === 0;
if (node.atRule) {
@@ -1813,9 +1819,9 @@ this._parseCss(r, text);
}
return node;
},
-stringify: function(node, preserveProperties, text) {
-text = text || "";
-var cssText = "";
+stringify: function (node, preserveProperties, text) {
+text = text || '';
+var cssText = '';
if (node.cssText || node.rules) {
var r$ = node.rules;
if (r$ && (preserveProperties || !hasMixinRules(r$))) {
@@ -1826,17 +1832,17 @@ cssText = this.stringify(r, preserveProperties, cssText);
cssText = preserveProperties ? node.cssText : removeCustomProps(node.cssText);
cssText = cssText.trim();
if (cssText) {
-cssText = " " + cssText + "\n";
+cssText = ' ' + cssText + '\n';
}
}
}
if (cssText) {
if (node.selector) {
-text += node.selector + " " + this.OPEN_BRACE + "\n";
+text += node.selector + ' ' + this.OPEN_BRACE + '\n';
}
text += cssText;
if (node.selector) {
-text += this.CLOSE_BRACE + "\n\n";
+text += this.CLOSE_BRACE + '\n\n';
}
}
return text;
@@ -1845,20 +1851,20 @@ types: {
STYLE_RULE: 1,
KEYFRAMES_RULE: 7,
MEDIA_RULE: 4,
-MIXIN_RULE: 1e3
+MIXIN_RULE: 1000
},
-OPEN_BRACE: "{",
-CLOSE_BRACE: "}"
+OPEN_BRACE: '{',
+CLOSE_BRACE: '}'
};
function hasMixinRules(rules) {
return rules[0].selector.indexOf(VAR_START) >= 0;
}
function removeCustomProps(cssText) {
-return cssText.replace(rx.customProp, "").replace(rx.mixinProp, "").replace(rx.mixinApply, "").replace(rx.varApply, "");
+return cssText.replace(rx.customProp, '').replace(rx.mixinProp, '').replace(rx.mixinApply, '').replace(rx.varApply, '');
}
-var VAR_START = "--";
-var MEDIA_START = "@media";
-var AT_START = "@";
+var VAR_START = '--';
+var MEDIA_START = '@media';
+var AT_START = '@';
var rx = {
comments: /\/\*[^*]*\*+([^\/*][^*]*\*+)*\//gim,
port: /@import[^;]*;/gim,
@@ -1870,12 +1876,11 @@ keyframesRule: /^@[^\s]*keyframes/
};
return api;
}();
-
-Polymer.StyleUtil = function() {
+Polymer.StyleUtil = function () {
return {
-MODULE_STYLES_SELECTOR: "style, link[rel=import][type~=css]",
-toCssText: function(rules, callback, preserveProperties) {
-if (typeof rules === "string") {
+MODULE_STYLES_SELECTOR: 'style, link[rel=import][type~=css]',
+toCssText: function (rules, callback, preserveProperties) {
+if (typeof rules === 'string') {
rules = this.parser.parse(rules);
}
if (callback) {
@@ -1883,21 +1888,21 @@ this.forEachStyleRule(rules, callback);
}
return this.parser.stringify(rules, preserveProperties);
},
-forRulesInStyles: function(styles, callback) {
+forRulesInStyles: function (styles, callback) {
for (var i = 0, l = styles.length, s; i < l && (s = styles[i]); i++) {
this.forEachStyleRule(this.rulesForStyle(s), callback);
}
},
-rulesForStyle: function(style) {
+rulesForStyle: function (style) {
if (!style.__cssRules) {
style.__cssRules = this.parser.parse(style.textContent);
}
return style.__cssRules;
},
-clearStyleRules: function(style) {
+clearStyleRules: function (style) {
style.__cssRules = null;
},
-forEachStyleRule: function(node, callback) {
+forEachStyleRule: function (node, callback) {
var s = node.selector;
var skipRules = false;
if (node.type === this.ruleTypes.STYLE_RULE) {
@@ -1912,28 +1917,28 @@ this.forEachStyleRule(r, callback);
}
}
},
-applyCss: function(cssText, moniker, target, afterNode) {
-var style = document.createElement("style");
+applyCss: function (cssText, moniker, target, afterNode) {
+var style = document.createElement('style');
if (moniker) {
-style.setAttribute("scope", moniker);
+style.setAttribute('scope', moniker);
}
style.textContent = cssText;
target = target || document.head;
if (!afterNode) {
-var n$ = target.querySelectorAll("style[scope]");
+var n$ = target.querySelectorAll('style[scope]');
afterNode = n$[n$.length - 1];
}
target.insertBefore(style, afterNode && afterNode.nextSibling || target.firstChild);
return style;
},
-cssFromModule: function(moduleId) {
+cssFromModule: function (moduleId) {
var m = Polymer.DomModule.import(moduleId);
if (m && !m._cssText) {
-var cssText = "";
+var cssText = '';
var e$ = Array.prototype.slice.call(m.querySelectorAll(this.MODULE_STYLES_SELECTOR));
for (var i = 0, e; i < e$.length; i++) {
e = e$[i];
-if (e.localName === "style") {
+if (e.localName === 'style') {
e = e.__appliedElement || e;
e.parentNode.removeChild(e);
} else {
@@ -1945,21 +1950,20 @@ cssText += Polymer.ResolveUrl.resolveCss(e.textContent, e.ownerDocument);
}
m._cssText = cssText;
}
-return m && m._cssText || "";
+return m && m._cssText || '';
},
parser: Polymer.CssParse,
ruleTypes: Polymer.CssParse.types
};
}();
-
-Polymer.StyleTransformer = function() {
+Polymer.StyleTransformer = function () {
var nativeShadow = Polymer.Settings.useNativeShadow;
var styleUtil = Polymer.StyleUtil;
var api = {
-dom: function(node, scope, useAttr, shouldRemoveScope) {
-this._transformDom(node, scope || "", useAttr, shouldRemoveScope);
+dom: function (node, scope, useAttr, shouldRemoveScope) {
+this._transformDom(node, scope || '', useAttr, shouldRemoveScope);
},
-_transformDom: function(node, selector, useAttr, shouldRemoveScope) {
+_transformDom: function (node, selector, useAttr, shouldRemoveScope) {
if (node.setAttribute) {
this.element(node, selector, useAttr, shouldRemoveScope);
}
@@ -1968,7 +1972,7 @@ for (var i = 0; i < c$.length; i++) {
this._transformDom(c$[i], selector, useAttr, shouldRemoveScope);
}
},
-element: function(element, scope, useAttr, shouldRemoveScope) {
+element: function (element, scope, useAttr, shouldRemoveScope) {
if (useAttr) {
if (shouldRemoveScope) {
element.removeAttribute(SCOPE_NAME);
@@ -1989,29 +1993,29 @@ element.classList.add(scope);
var c = element.getAttribute(CLASS);
if (shouldRemoveScope) {
if (c) {
-element.setAttribute(CLASS, c.replace(SCOPE_NAME, "").replace(scope, ""));
+element.setAttribute(CLASS, c.replace(SCOPE_NAME, '').replace(scope, ''));
}
} else {
-element.setAttribute(CLASS, c + (c ? " " : "") + SCOPE_NAME + " " + scope);
+element.setAttribute(CLASS, c + (c ? ' ' : '') + SCOPE_NAME + ' ' + scope);
}
}
}
}
},
-elementStyles: function(element, callback) {
+elementStyles: function (element, callback) {
var styles = element._styles;
-var cssText = "";
+var cssText = '';
for (var i = 0, l = styles.length, s, text; i < l && (s = styles[i]); i++) {
var rules = styleUtil.rulesForStyle(s);
-cssText += nativeShadow ? styleUtil.toCssText(rules, callback) : this.css(rules, element.is, element.extends, callback, element._scopeCssViaAttr) + "\n\n";
+cssText += nativeShadow ? styleUtil.toCssText(rules, callback) : this.css(rules, element.is, element.extends, callback, element._scopeCssViaAttr) + '\n\n';
}
return cssText.trim();
},
-css: function(rules, scope, ext, callback, useAttr) {
+css: function (rules, scope, ext, callback, useAttr) {
var hostScope = this._calcHostScope(scope, ext);
scope = this._calcElementScope(scope, useAttr);
var self = this;
-return styleUtil.toCssText(rules, function(rule) {
+return styleUtil.toCssText(rules, function (rule) {
if (!rule.isScoped) {
self.rule(rule, scope, hostScope);
rule.isScoped = true;
@@ -2021,30 +2025,30 @@ callback(rule, scope, hostScope);
}
});
},
-_calcElementScope: function(scope, useAttr) {
+_calcElementScope: function (scope, useAttr) {
if (scope) {
return useAttr ? CSS_ATTR_PREFIX + scope + CSS_ATTR_SUFFIX : CSS_CLASS_PREFIX + scope;
} else {
-return "";
+return '';
}
},
-_calcHostScope: function(scope, ext) {
-return ext ? "[is=" + scope + "]" : scope;
+_calcHostScope: function (scope, ext) {
+return ext ? '[is=' + scope + ']' : scope;
},
-rule: function(rule, scope, hostScope) {
+rule: function (rule, scope, hostScope) {
this._transformRule(rule, this._transformComplexSelector, scope, hostScope);
},
-_transformRule: function(rule, transformer, scope, hostScope) {
+_transformRule: function (rule, transformer, scope, hostScope) {
var p$ = rule.selector.split(COMPLEX_SELECTOR_SEP);
for (var i = 0, l = p$.length, p; i < l && (p = p$[i]); i++) {
p$[i] = transformer.call(this, p, scope, hostScope);
}
rule.selector = p$.join(COMPLEX_SELECTOR_SEP);
},
-_transformComplexSelector: function(selector, scope, hostScope) {
+_transformComplexSelector: function (selector, scope, hostScope) {
var stop = false;
var self = this;
-selector = selector.replace(SIMPLE_SELECTOR_SEP, function(m, c, s) {
+selector = selector.replace(SIMPLE_SELECTOR_SEP, function (m, c, s) {
if (!stop) {
var o = self._transformCompoundSelector(s, c, scope, hostScope);
if (o.stop) {
@@ -2057,10 +2061,10 @@ return c + s;
});
return selector;
},
-_transformCompoundSelector: function(selector, combinator, scope, hostScope) {
+_transformCompoundSelector: function (selector, combinator, scope, hostScope) {
var jumpIndex = selector.search(SCOPE_JUMP);
if (selector.indexOf(HOST) >= 0) {
-selector = selector.replace(HOST_PAREN, function(m, host, paren) {
+selector = selector.replace(HOST_PAREN, function (m, host, paren) {
return hostScope + paren;
});
selector = selector.replace(HOST, hostScope);
@@ -2068,11 +2072,11 @@ selector = selector.replace(HOST, hostScope);
selector = scope ? this._transformSimpleSelector(selector, scope) : selector;
}
if (selector.indexOf(CONTENT) >= 0) {
-combinator = "";
+combinator = '';
}
var stop;
if (jumpIndex >= 0) {
-selector = selector.replace(SCOPE_JUMP, " ");
+selector = selector.replace(SCOPE_JUMP, ' ');
stop = true;
}
return {
@@ -2081,45 +2085,44 @@ combinator: combinator,
stop: stop
};
},
-_transformSimpleSelector: function(selector, scope) {
+_transformSimpleSelector: function (selector, scope) {
var p$ = selector.split(PSEUDO_PREFIX);
p$[0] += scope;
return p$.join(PSEUDO_PREFIX);
},
-rootRule: function(rule) {
+rootRule: function (rule) {
this._transformRule(rule, this._transformRootSelector);
},
-_transformRootSelector: function(selector) {
+_transformRootSelector: function (selector) {
return selector.match(SCOPE_JUMP) ? this._transformComplexSelector(selector) : selector.trim() + SCOPE_ROOT_SELECTOR;
},
-SCOPE_NAME: "style-scope"
+SCOPE_NAME: 'style-scope'
};
var SCOPE_NAME = api.SCOPE_NAME;
-var SCOPE_ROOT_SELECTOR = ":not([" + SCOPE_NAME + "])" + ":not(." + SCOPE_NAME + ")";
-var COMPLEX_SELECTOR_SEP = ",";
+var SCOPE_ROOT_SELECTOR = ':not([' + SCOPE_NAME + '])' + ':not(.' + SCOPE_NAME + ')';
+var COMPLEX_SELECTOR_SEP = ',';
var SIMPLE_SELECTOR_SEP = /(^|[\s>+~]+)([^\s>+~]+)/g;
-var HOST = ":host";
+var HOST = ':host';
var HOST_PAREN = /(\:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g;
-var CONTENT = "::content";
+var CONTENT = '::content';
var SCOPE_JUMP = /\:\:content|\:\:shadow|\/deep\//;
-var CSS_CLASS_PREFIX = ".";
-var CSS_ATTR_PREFIX = "[" + SCOPE_NAME + "~=";
-var CSS_ATTR_SUFFIX = "]";
-var PSEUDO_PREFIX = ":";
-var CLASS = "class";
+var CSS_CLASS_PREFIX = '.';
+var CSS_ATTR_PREFIX = '[' + SCOPE_NAME + '~=';
+var CSS_ATTR_SUFFIX = ']';
+var PSEUDO_PREFIX = ':';
+var CLASS = 'class';
return api;
}();
-
-Polymer.StyleExtends = function() {
+Polymer.StyleExtends = function () {
var styleUtil = Polymer.StyleUtil;
return {
-hasExtends: function(cssText) {
+hasExtends: function (cssText) {
return Boolean(cssText.match(this.rx.EXTEND));
},
-transform: function(style) {
+transform: function (style) {
var rules = styleUtil.rulesForStyle(style);
var self = this;
-styleUtil.forEachStyleRule(rules, function(rule) {
+styleUtil.forEachStyleRule(rules, function (rule) {
var map = self._mapRule(rule);
if (rule.parent) {
var m;
@@ -2131,18 +2134,18 @@ self._extendRule(rule, extendor);
}
}
}
-rule.cssText = rule.cssText.replace(self.rx.EXTEND, "");
+rule.cssText = rule.cssText.replace(self.rx.EXTEND, '');
});
-return styleUtil.toCssText(rules, function(rule) {
+return styleUtil.toCssText(rules, function (rule) {
if (rule.selector.match(self.rx.STRIP)) {
-rule.cssText = "";
+rule.cssText = '';
}
}, true);
},
-_mapRule: function(rule) {
+_mapRule: function (rule) {
if (rule.parent) {
var map = rule.parent.map || (rule.parent.map = {});
-var parts = rule.selector.split(",");
+var parts = rule.selector.split(',');
for (var i = 0, p; i < parts.length; i++) {
p = parts[i];
map[p.trim()] = rule;
@@ -2150,24 +2153,24 @@ map[p.trim()] = rule;
return map;
}
},
-_findExtendor: function(extend, rule) {
+_findExtendor: function (extend, rule) {
return rule.parent && rule.parent.map && rule.parent.map[extend] || this._findExtendor(extend, rule.parent);
},
-_extendRule: function(target, source) {
+_extendRule: function (target, source) {
if (target.parent !== source.parent) {
this._cloneAndAddRuleToParent(source, target.parent);
}
target.extends = target.extends || (target.extends = []);
target.extends.push(source);
-source.selector = source.selector.replace(this.rx.STRIP, "");
-source.selector = (source.selector && source.selector + ",\n") + target.selector;
+source.selector = source.selector.replace(this.rx.STRIP, '');
+source.selector = (source.selector && source.selector + ',\n') + target.selector;
if (source.extends) {
-source.extends.forEach(function(e) {
+source.extends.forEach(function (e) {
this._extendRule(target, e);
}, this);
}
},
-_cloneAndAddRuleToParent: function(rule, parent) {
+_cloneAndAddRuleToParent: function (rule, parent) {
rule = Object.create(rule);
rule.parent = parent;
if (rule.extends) {
@@ -2181,21 +2184,20 @@ STRIP: /%[^,]*$/
}
};
}();
-
-(function() {
+(function () {
var prepElement = Polymer.Base._prepElement;
var nativeShadow = Polymer.Settings.useNativeShadow;
var styleUtil = Polymer.StyleUtil;
var styleTransformer = Polymer.StyleTransformer;
var styleExtends = Polymer.StyleExtends;
Polymer.Base._addFeature({
-_prepElement: function(element) {
+_prepElement: function (element) {
if (this._encapsulateStyle) {
styleTransformer.element(element, this.is, this._scopeCssViaAttr);
}
prepElement.call(this, element);
},
-_prepStyles: function() {
+_prepStyles: function () {
if (this._encapsulateStyle === undefined) {
this._encapsulateStyle = !nativeShadow && Boolean(this._template);
}
@@ -2208,9 +2210,9 @@ this._scopeStyle = style;
}
}
},
-_collectStyles: function() {
+_collectStyles: function () {
var styles = [];
-var cssText = "", m$ = this.styleModules;
+var cssText = '', m$ = this.styleModules;
if (m$) {
for (var i = 0, l = m$.length, m; i < l && (m = m$[i]); i++) {
cssText += styleUtil.cssFromModule(m);
@@ -2218,7 +2220,7 @@ cssText += styleUtil.cssFromModule(m);
}
cssText += styleUtil.cssFromModule(this.is);
if (cssText) {
-var style = document.createElement("style");
+var style = document.createElement('style');
style.textContent = cssText;
if (styleExtends.hasExtends(style.textContent)) {
cssText = styleExtends.transform(style);
@@ -2227,34 +2229,38 @@ styles.push(style);
}
return styles;
},
-_elementAdd: function(node) {
-if (this._encapsulateStyle && !node.__styleScoped) {
+_elementAdd: function (node) {
+if (this._encapsulateStyle) {
+if (node.__styleScoped) {
+node.__styleScoped = false;
+} else {
styleTransformer.dom(node, this.is, this._scopeCssViaAttr);
}
+}
},
-_elementRemove: function(node) {
+_elementRemove: function (node) {
if (this._encapsulateStyle) {
styleTransformer.dom(node, this.is, this._scopeCssViaAttr, true);
}
},
-scopeSubtree: function(container, shouldObserve) {
+scopeSubtree: function (container, shouldObserve) {
if (nativeShadow) {
return;
}
var self = this;
-var scopify = function(node) {
+var scopify = function (node) {
if (node.nodeType === Node.ELEMENT_NODE) {
node.className = self._scopeElementClass(node, node.className);
-var n$ = node.querySelectorAll("*");
-Array.prototype.forEach.call(n$, function(n) {
+var n$ = node.querySelectorAll('*');
+Array.prototype.forEach.call(n$, function (n) {
n.className = self._scopeElementClass(n, n.className);
});
}
};
scopify(container);
if (shouldObserve) {
-var mo = new MutationObserver(function(mxns) {
-mxns.forEach(function(m) {
+var mo = new MutationObserver(function (mxns) {
+mxns.forEach(function (m) {
if (m.addedNodes) {
for (var i = 0; i < m.addedNodes.length; i++) {
scopify(m.addedNodes[i]);
@@ -2270,17 +2276,16 @@ return mo;
}
}
});
-})();
-
-Polymer.StyleProperties = function() {
+}());
+Polymer.StyleProperties = function () {
var nativeShadow = Polymer.Settings.useNativeShadow;
var matchesSelector = Polymer.DomApi.matchesSelector;
var styleUtil = Polymer.StyleUtil;
var styleTransformer = Polymer.StyleTransformer;
return {
-decorateStyles: function(styles) {
+decorateStyles: function (styles) {
var self = this, props = {};
-styleUtil.forRulesInStyles(styles, function(rule) {
+styleUtil.forRulesInStyles(styles, function (rule) {
self.decorateRule(rule);
self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);
});
@@ -2290,7 +2295,7 @@ names.push(i);
}
return names;
},
-decorateRule: function(rule) {
+decorateRule: function (rule) {
if (rule.propertyInfo) {
return rule.propertyInfo;
}
@@ -2304,7 +2309,7 @@ info.cssText = this.collectCssText(rule);
rule.propertyInfo = info;
return info;
},
-collectProperties: function(rule, properties) {
+collectProperties: function (rule, properties) {
var info = rule.propertyInfo;
if (info) {
if (info.properties) {
@@ -2322,68 +2327,68 @@ any = true;
return any;
}
},
-collectCssText: function(rule) {
-var customCssText = "";
+collectCssText: function (rule) {
+var customCssText = '';
var cssText = rule.parsedCssText;
-cssText = cssText.replace(this.rx.BRACKETED, "").replace(this.rx.VAR_ASSIGN, "");
-var parts = cssText.split(";");
+cssText = cssText.replace(this.rx.BRACKETED, '').replace(this.rx.VAR_ASSIGN, '');
+var parts = cssText.split(';');
for (var i = 0, p; i < parts.length; i++) {
p = parts[i];
if (p.match(this.rx.MIXIN_MATCH) || p.match(this.rx.VAR_MATCH)) {
-customCssText += p + ";\n";
+customCssText += p + ';\n';
}
}
return customCssText;
},
-collectPropertiesInCssText: function(cssText, props) {
+collectPropertiesInCssText: function (cssText, props) {
var m;
while (m = this.rx.VAR_CAPTURE.exec(cssText)) {
props[m[1]] = true;
}
},
-reify: function(props) {
+reify: function (props) {
var names = Object.getOwnPropertyNames(props);
for (var i = 0, n; i < names.length; i++) {
n = names[i];
props[n] = this.valueForProperty(props[n], props);
}
},
-valueForProperty: function(property, props) {
+valueForProperty: function (property, props) {
if (property) {
-if (property.indexOf(";") >= 0) {
+if (property.indexOf(';') >= 0) {
property = this.valueForProperties(property, props);
} else {
var self = this;
-var fn = function(all, prefix, value, fallback) {
+var fn = function (all, prefix, value, fallback) {
var propertyValue = self.valueForProperty(props[value], props) || (props[fallback] ? self.valueForProperty(props[fallback], props) : fallback);
-return prefix + (propertyValue || "");
+return prefix + (propertyValue || '');
};
property = property.replace(this.rx.VAR_MATCH, fn);
}
}
-return property && property.trim() || "";
+return property && property.trim() || '';
},
-valueForProperties: function(property, props) {
-var parts = property.split(";");
+valueForProperties: function (property, props) {
+var parts = property.split(';');
for (var i = 0, p, m; i < parts.length && (p = parts[i]); i++) {
m = p.match(this.rx.MIXIN_MATCH);
if (m) {
p = this.valueForProperty(props[m[1]], props);
} else {
-var pp = p.split(":");
+var pp = p.split(':');
if (pp[1]) {
pp[1] = pp[1].trim();
pp[1] = this.valueForProperty(pp[1], props) || pp[1];
}
-p = pp.join(":");
+p = pp.join(':');
}
-parts[i] = p && p.lastIndexOf(";") === p.length - 1 ? p.slice(0, -1) : p || "";
+parts[i] = p && p.lastIndexOf(';') === p.length - 1 ? p.slice(0, -1) : p || '';
}
-return parts.join(";");
+return parts.join(';');
},
-applyProperties: function(rule, props) {
-var output = "";
-if (!rule.properties) {
+applyProperties: function (rule, props) {
+var output = '';
+if (!rule.propertyInfo) {
this.decorateRule(rule);
}
if (rule.propertyInfo.cssText) {
@@ -2391,10 +2396,10 @@ output = this.valueForProperties(rule.propertyInfo.cssText, props);
}
rule.cssText = output;
},
-propertyDataFromStyles: function(styles, element) {
+propertyDataFromStyles: function (styles, element) {
var props = {}, self = this;
var o = [], i = 0;
-styleUtil.forRulesInStyles(styles, function(rule) {
+styleUtil.forRulesInStyles(styles, function (rule) {
if (!rule.propertyInfo) {
self.decorateRule(rule);
}
@@ -2409,21 +2414,21 @@ properties: props,
key: o
};
},
-scopePropertiesFromStyles: function(styles) {
+scopePropertiesFromStyles: function (styles) {
if (!styles._scopeStyleProperties) {
styles._scopeStyleProperties = this.selectedPropertiesFromStyles(styles, this.SCOPE_SELECTORS);
}
return styles._scopeStyleProperties;
},
-hostPropertiesFromStyles: function(styles) {
+hostPropertiesFromStyles: function (styles) {
if (!styles._hostStyleProperties) {
styles._hostStyleProperties = this.selectedPropertiesFromStyles(styles, this.HOST_SELECTORS);
}
return styles._hostStyleProperties;
},
-selectedPropertiesFromStyles: function(styles, selectors) {
+selectedPropertiesFromStyles: function (styles, selectors) {
var props = {}, self = this;
-styleUtil.forRulesInStyles(styles, function(rule) {
+styleUtil.forRulesInStyles(styles, function (rule) {
if (!rule.propertyInfo) {
self.decorateRule(rule);
}
@@ -2436,29 +2441,29 @@ return;
});
return props;
},
-transformStyles: function(element, properties, scopeSelector) {
+transformStyles: function (element, properties, scopeSelector) {
var self = this;
var hostRx = new RegExp(this.rx.HOST_PREFIX + element.is + this.rx.HOST_SUFFIX);
-return styleTransformer.elementStyles(element, function(rule) {
+return styleTransformer.elementStyles(element, function (rule) {
self.applyProperties(rule, properties);
if (rule.cssText && !nativeShadow) {
self._scopeSelector(rule, hostRx, element.is, element._scopeCssViaAttr, scopeSelector);
}
});
},
-_scopeSelector: function(rule, hostRx, is, viaAttr, scopeId) {
+_scopeSelector: function (rule, hostRx, is, viaAttr, scopeId) {
rule.transformedSelector = rule.transformedSelector || rule.selector;
var selector = rule.transformedSelector;
-var scope = viaAttr ? "[" + styleTransformer.SCOPE_NAME + "~=" + scopeId + "]" : "." + scopeId;
-var parts = selector.split(",");
+var scope = viaAttr ? '[' + styleTransformer.SCOPE_NAME + '~=' + scopeId + ']' : '.' + scopeId;
+var parts = selector.split(',');
for (var i = 0, l = parts.length, p; i < l && (p = parts[i]); i++) {
-parts[i] = p.match(hostRx) ? p.replace(is, is + scope) : scope + " " + p;
+parts[i] = p.match(hostRx) ? p.replace(is, is + scope) : scope + ' ' + p;
}
-rule.selector = parts.join(",");
+rule.selector = parts.join(',');
},
-applyElementScopeSelector: function(element, selector, old, viaAttr) {
+applyElementScopeSelector: function (element, selector, old, viaAttr) {
var c = viaAttr ? element.getAttribute(styleTransformer.SCOPE_NAME) : element.className;
-v = old ? c.replace(old, selector) : (c ? c + " " : "") + this.XSCOPE_NAME + " " + selector;
+v = old ? c.replace(old, selector) : (c ? c + ' ' : '') + this.XSCOPE_NAME + ' ' + selector;
if (c !== v) {
if (viaAttr) {
element.setAttribute(styleTransformer.SCOPE_NAME, v);
@@ -2467,8 +2472,8 @@ element.className = v;
}
}
},
-applyElementStyle: function(element, properties, selector, style) {
-var cssText = style ? style.textContent || "" : this.transformStyles(element, properties, selector);
+applyElementStyle: function (element, properties, selector, style) {
+var cssText = style ? style.textContent || '' : this.transformStyles(element, properties, selector);
var s = element._customStyle;
if (s && !nativeShadow && s !== style) {
s._useCount--;
@@ -2499,12 +2504,12 @@ MIXIN_MATCH: /(?:^|\W+)@apply[\s]*\(([^)]*)\);?/im,
VAR_MATCH: /(^|\W+)var\([\s]*([^,)]*)[\s]*,?[\s]*((?:[^,)]*)|(?:[^;]*\([^;)]*\)))[\s]*?\)/gim,
VAR_CAPTURE: /\([\s]*(--[^,\s)]*)(?:,[\s]*(--[^,\s)]*))?(?:\)|,)/gim,
BRACKETED: /\{[^}]*\}/g,
-HOST_PREFIX: "(?:^|[^.])",
-HOST_SUFFIX: "($|[.:[\\s>+~])"
+HOST_PREFIX: '(?:^|[^.])',
+HOST_SUFFIX: '($|[.:[\\s>+~])'
},
-HOST_SELECTORS: [ ":host" ],
-SCOPE_SELECTORS: [ ":root" ],
-XSCOPE_NAME: "x-scope"
+HOST_SELECTORS: [':host'],
+SCOPE_SELECTORS: [':root'],
+XSCOPE_NAME: 'x-scope'
};
function addToBitMask(n, bits) {
var o = parseInt(n / 32);
@@ -2512,16 +2517,15 @@ var v = 1 << n % 32;
bits[o] = (bits[o] || 0) | v;
}
}();
-
-Polymer.StyleDefaults = function() {
+Polymer.StyleDefaults = function () {
var styleProperties = Polymer.StyleProperties;
var styleUtil = Polymer.StyleUtil;
-var style = document.createElement("style");
+var style = document.createElement('style');
var api = {
style: style,
-_styles: [ style ],
+_styles: [style],
_properties: null,
-applyCss: function(cssText) {
+applyCss: function (cssText) {
this.style.textContent += cssText;
styleUtil.clearStyleRules(this.style);
this._properties = null;
@@ -2534,21 +2538,21 @@ this._properties = styleProperties.scopePropertiesFromStyles(this._styles);
}
return this._properties;
},
-_needsStyleProperties: function() {},
-_computeStyleProperties: function() {
+_needsStyleProperties: function () {
+},
+_computeStyleProperties: function () {
return this._styleProperties;
}
};
return api;
}();
-
-(function() {
-Polymer.StyleCache = function() {
+(function () {
+Polymer.StyleCache = function () {
this.cache = {};
};
Polymer.StyleCache.prototype = {
MAX: 100,
-store: function(is, data, keyValues, keyStyles) {
+store: function (is, data, keyValues, keyStyles) {
data.keyValues = keyValues;
data.styles = keyStyles;
var s$ = this.cache[is] = this.cache[is] || [];
@@ -2557,7 +2561,7 @@ if (s$.length > this.MAX) {
s$.shift();
}
},
-retrieve: function(is, keyValues, keyStyles) {
+retrieve: function (is, keyValues, keyStyles) {
var cache = this.cache[is];
if (cache) {
for (var i = cache.length - 1, data; i >= 0; i--) {
@@ -2568,10 +2572,10 @@ return data;
}
}
},
-clear: function() {
+clear: function () {
this.cache = {};
},
-_objectsEqual: function(target, source) {
+_objectsEqual: function (target, source) {
for (var i in target) {
if (target[i] !== source[i]) {
return false;
@@ -2583,9 +2587,8 @@ return target.length === source.length;
return true;
}
};
-})();
-
-(function() {
+}());
+(function () {
var serializeValueToAttribute = Polymer.Base.serializeValueToAttribute;
var propertyUtils = Polymer.StyleProperties;
var styleTransformer = Polymer.StyleTransformer;
@@ -2593,21 +2596,21 @@ var styleUtil = Polymer.StyleUtil;
var styleDefaults = Polymer.StyleDefaults;
var nativeShadow = Polymer.Settings.useNativeShadow;
Polymer.Base._addFeature({
-_prepStyleProperties: function() {
+_prepStyleProperties: function () {
this._ownStylePropertyNames = this._styles ? propertyUtils.decorateStyles(this._styles) : [];
},
-_setupStyleProperties: function() {
+_setupStyleProperties: function () {
this.customStyle = {};
},
-_needsStyleProperties: function() {
+_needsStyleProperties: function () {
return Boolean(this._ownStylePropertyNames && this._ownStylePropertyNames.length);
},
-_beforeAttached: function() {
+_beforeAttached: function () {
if (!this._scopeSelector && this._needsStyleProperties()) {
this._updateStyleProperties();
}
},
-_updateStyleProperties: function() {
+_updateStyleProperties: function () {
var info, scope = this.domHost || styleDefaults;
if (!scope._styleCache) {
scope._styleCache = new Polymer.StyleCache();
@@ -2642,7 +2645,7 @@ styleCache.store(this.is, Object.create(info), this._ownStyleProperties, this._s
}
}
},
-_computeStyleProperties: function(scopeProps) {
+_computeStyleProperties: function (scopeProps) {
var scope = this.domHost || styleDefaults;
if (!scope._styleProperties) {
scope._computeStyleProperties();
@@ -2656,7 +2659,7 @@ this.mixin(props, this.customStyle);
propertyUtils.reify(props);
this._styleProperties = props;
},
-_computeOwnStyleProperties: function() {
+_computeOwnStyleProperties: function () {
var props = {};
for (var i = 0, n; i < this._ownStylePropertyNames.length; i++) {
n = this._ownStylePropertyNames[i];
@@ -2665,18 +2668,18 @@ props[n] = this._styleProperties[n];
this._ownStyleProperties = props;
},
_scopeCount: 0,
-_applyStyleProperties: function(info) {
+_applyStyleProperties: function (info) {
var oldScopeSelector = this._scopeSelector;
-this._scopeSelector = info ? info._scopeSelector : this.is + "-" + this.__proto__._scopeCount++;
+this._scopeSelector = info ? info._scopeSelector : this.is + '-' + this.__proto__._scopeCount++;
style = propertyUtils.applyElementStyle(this, this._styleProperties, this._scopeSelector, info && info.style);
if ((style || oldScopeSelector) && !nativeShadow) {
propertyUtils.applyElementScopeSelector(this, this._scopeSelector, oldScopeSelector, this._scopeCssViaAttr);
}
return style || {};
},
-serializeValueToAttribute: function(value, attribute, node) {
+serializeValueToAttribute: function (value, attribute, node) {
node = node || this;
-if (attribute === "class") {
+if (attribute === 'class') {
var host = node === this ? this.domHost || this.dataHost : this;
if (host) {
value = host._scopeElementClass(node, value);
@@ -2685,13 +2688,13 @@ value = host._scopeElementClass(node, value);
node = Polymer.dom(node);
serializeValueToAttribute.call(this, value, attribute, node);
},
-_scopeElementClass: function(element, selector) {
+_scopeElementClass: function (element, selector) {
if (!nativeShadow && !this._scopeCssViaAttr) {
-selector += (selector ? " " : "") + SCOPE_NAME + " " + this.is + (element._scopeSelector ? " " + XSCOPE_NAME + " " + element._scopeSelector : "");
+selector += (selector ? ' ' : '') + SCOPE_NAME + ' ' + this.is + (element._scopeSelector ? ' ' + XSCOPE_NAME + ' ' + element._scopeSelector : '');
}
return selector;
},
-updateStyles: function() {
+updateStyles: function () {
if (this.isAttached) {
if (this._needsStyleProperties()) {
this._updateStyleProperties();
@@ -2704,9 +2707,9 @@ this._styleCache.clear();
this._updateRootStyles();
}
},
-_updateRootStyles: function(root) {
+_updateRootStyles: function (root) {
root = root || this.root;
-var c$ = Polymer.dom(root)._query(function(e) {
+var c$ = Polymer.dom(root)._query(function (e) {
return e.shadyRoot || e.shadowRoot;
});
for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) {
@@ -2716,7 +2719,7 @@ c.updateStyles();
}
}
});
-Polymer.updateStyles = function() {
+Polymer.updateStyles = function () {
styleDefaults._styleCache.clear();
Polymer.Base._updateRootStyles(document);
};
@@ -2724,10 +2727,9 @@ var styleCache = new Polymer.StyleCache();
Polymer.customStyleCache = styleCache;
var SCOPE_NAME = styleTransformer.SCOPE_NAME;
var XSCOPE_NAME = propertyUtils.XSCOPE_NAME;
-})();
-
+}());
Polymer.Base._addFeature({
-_registerFeatures: function() {
+_registerFeatures: function () {
this._prepIs();
this._prepAttributes();
this._prepExtends();
@@ -2741,12 +2743,12 @@ this._prepBehaviors();
this._prepBindings();
this._prepShady();
},
-_prepBehavior: function(b) {
+_prepBehavior: function (b) {
this._addPropertyEffects(b.properties);
this._addComplexObserverEffects(b.observers);
this._addHostAttributes(b.hostAttributes);
},
-_initFeatures: function() {
+_initFeatures: function () {
this._poolContent();
this._setupConfigure();
this._setupStyleProperties();
@@ -2761,41 +2763,40 @@ this._marshalBehaviors();
this._marshalAttributes();
this._tryReady();
},
-_marshalBehavior: function(b) {
+_marshalBehavior: function (b) {
this._listenListeners(b.listeners);
}
});
-
-(function() {
+(function () {
var nativeShadow = Polymer.Settings.useNativeShadow;
var propertyUtils = Polymer.StyleProperties;
var styleUtil = Polymer.StyleUtil;
var styleDefaults = Polymer.StyleDefaults;
Polymer({
-is: "custom-style",
-"extends": "style",
-created: function() {
-this._appliesToDocument = this.parentNode.localName !== "dom-module";
+is: 'custom-style',
+extends: 'style',
+created: function () {
+this._appliesToDocument = this.parentNode.localName !== 'dom-module';
if (this._appliesToDocument) {
var e = this.__appliedElement || this;
var rules = styleUtil.rulesForStyle(e);
-propertyUtils.decorateStyles([ e ]);
+propertyUtils.decorateStyles([e]);
this._rulesToDefaultProperties(rules);
this.async(this._applyStyle);
}
},
-_applyStyle: function() {
+_applyStyle: function () {
var e = this.__appliedElement || this;
this._computeStyleProperties();
var props = this._styleProperties;
var self = this;
-e.textContent = styleUtil.toCssText(styleUtil.rulesForStyle(e), function(rule) {
-if (rule.selector === ":root") {
-rule.selector = "body";
+e.textContent = styleUtil.toCssText(styleUtil.rulesForStyle(e), function (rule) {
+if (rule.selector === ':root') {
+rule.selector = 'body';
}
var css = rule.cssText = rule.parsedCssText;
-if (rule.propertyInfo.cssText) {
-css = css.replace(propertyUtils.rx.VAR_ASSIGN, "");
+if (rule.propertyInfo && rule.propertyInfo.cssText) {
+css = css.replace(propertyUtils.rx.VAR_ASSIGN, '');
rule.cssText = propertyUtils.valueForProperties(css, props);
}
if (!nativeShadow) {
@@ -2803,10 +2804,10 @@ Polymer.StyleTransformer.rootRule(rule);
}
});
},
-_rulesToDefaultProperties: function(rules) {
-styleUtil.forEachStyleRule(rules, function(rule) {
+_rulesToDefaultProperties: function (rules) {
+styleUtil.forEachStyleRule(rules, function (rule) {
if (!rule.propertyInfo.properties) {
-rule.cssText = "";
+rule.cssText = '';
}
});
var cssText = styleUtil.parser.stringify(rules, true);
@@ -2815,24 +2816,19 @@ styleDefaults.applyCss(cssText);
}
}
});
-})();
-
+}());
Polymer.Templatizer = {
-properties: {
-_hideTemplateChildren: {
-observer: "_hideTemplateChildrenChanged"
-}
-},
+properties: { _hideTemplateChildren: { observer: '_showHideChildren' } },
_templatizerStatic: {
count: 0,
callbacks: {},
debouncer: null
},
_instanceProps: Polymer.nob,
-created: function() {
+created: function () {
this._templatizerId = this._templatizerStatic.count++;
},
-templatize: function(template) {
+templatize: function (template) {
if (!template._content) {
template._content = template.content;
}
@@ -2860,19 +2856,16 @@ archetype.constructor = ctor;
template._content._ctor = ctor;
this.ctor = ctor;
},
-_getRootDataHost: function() {
+_getRootDataHost: function () {
return this.dataHost && this.dataHost._rootDataHost || this.dataHost;
},
-_hideTemplateChildrenChanged: function(hidden) {
-if (this._hideChildren) {
-this._hideChildren(hidden);
-}
+_showHideChildren: function (hidden) {
},
-_debounceTemplate: function(fn) {
+_debounceTemplate: function (fn) {
this._templatizerStatic.callbacks[this._templatizerId] = fn.bind(this);
this._templatizerStatic.debouncer = Polymer.Debounce(this._templatizerStatic.debouncer, this._flushTemplates.bind(this, true));
},
-_flushTemplates: function(debouncerExpired) {
+_flushTemplates: function (debouncerExpired) {
var db = this._templatizerStatic.debouncer;
while (debouncerExpired || db && db.finish) {
db.stop();
@@ -2884,13 +2877,13 @@ cbs[id]();
debouncerExpired = false;
}
},
-_customPrepEffects: function(archetype) {
+_customPrepEffects: function (archetype) {
var parentProps = archetype._parentProps;
for (var prop in parentProps) {
-archetype._addPropertyEffect(prop, "function", this._createHostPropEffector(prop));
+archetype._addPropertyEffect(prop, 'function', this._createHostPropEffector(prop));
}
},
-_customPrepAnnotations: function(archetype, template) {
+_customPrepAnnotations: function (archetype, template) {
archetype._template = template;
var c = template._content;
if (!c._notes) {
@@ -2905,7 +2898,7 @@ this._processAnnotations(c._notes);
archetype._notes = c._notes;
archetype._parentProps = c._parentProps;
},
-_prepParentProperties: function(archetype, template) {
+_prepParentProperties: function (archetype, template) {
var parentProps = this._parentProps = archetype._parentProps;
if (this._forwardParentProp && parentProps) {
var proto = archetype._parentPropProto;
@@ -2919,13 +2912,14 @@ if (template != this) {
Polymer.Bind.prepareModel(proto);
}
for (prop in parentProps) {
-var parentProp = "_parent_" + prop;
-var effects = [ {
-kind: "function",
+var parentProp = '_parent_' + prop;
+var effects = [
+{
+kind: 'function',
effect: this._createForwardPropEffector(prop)
-}, {
-kind: "notify"
-} ];
+},
+{ kind: 'notify' }
+];
Polymer.Bind._createAccessors(proto, parentProp, effects);
}
}
@@ -2936,18 +2930,18 @@ template._forwardParentProp = this._forwardParentProp.bind(this);
this._extendTemplate(template, proto);
}
},
-_createForwardPropEffector: function(prop) {
-return function(source, value) {
+_createForwardPropEffector: function (prop) {
+return function (source, value) {
this._forwardParentProp(prop, value);
};
},
-_createHostPropEffector: function(prop) {
-return function(source, value) {
-this.dataHost["_parent_" + prop] = value;
+_createHostPropEffector: function (prop) {
+return function (source, value) {
+this.dataHost['_parent_' + prop] = value;
};
},
-_extendTemplate: function(template, proto) {
-Object.getOwnPropertyNames(proto).forEach(function(n) {
+_extendTemplate: function (template, proto) {
+Object.getOwnPropertyNames(proto).forEach(function (n) {
var val = template[n];
var pd = Object.getOwnPropertyDescriptor(proto, n);
Object.defineProperty(template, n, pd);
@@ -2956,25 +2950,26 @@ template._propertySet(n, val);
}
});
},
-_forwardInstancePath: function(inst, path, value) {},
-_notifyPathImpl: function(path, value) {
+_forwardInstancePath: function (inst, path, value) {
+},
+_notifyPathImpl: function (path, value) {
var dataHost = this.dataHost;
-var dot = path.indexOf(".");
+var dot = path.indexOf('.');
var root = dot < 0 ? path : path.slice(0, dot);
dataHost._forwardInstancePath.call(dataHost, this, path, value);
if (root in dataHost._parentProps) {
-dataHost.notifyPath("_parent_" + path, value);
+dataHost.notifyPath('_parent_' + path, value);
}
},
-_pathEffector: function(path, value, fromAbove) {
+_pathEffector: function (path, value, fromAbove) {
if (this._forwardParentPath) {
-if (path.indexOf("_parent_") === 0) {
+if (path.indexOf('_parent_') === 0) {
this._forwardParentPath(path.substring(8), value);
}
}
Polymer.Base._pathEffector.apply(this, arguments);
},
-_constructorImpl: function(model, host) {
+_constructorImpl: function (model, host) {
this._rootDataHost = host._getRootDataHost();
this._setupConfigure(model);
this._pushHost(host);
@@ -2992,115 +2987,111 @@ n._templateInstance = this;
this._children = children;
this._tryReady();
},
-_listenImpl: function(node, eventName, methodName) {
+_listenImpl: function (node, eventName, methodName) {
var model = this;
var host = this._rootDataHost;
var handler = host._createEventHandler(node, eventName, methodName);
-var decorated = function(e) {
+var decorated = function (e) {
e.model = model;
handler(e);
};
host._listen(node, eventName, decorated);
},
-_scopeElementClassImpl: function(node, value) {
+_scopeElementClassImpl: function (node, value) {
var host = this._rootDataHost;
if (host) {
return host._scopeElementClass(node, value);
}
},
-stamp: function(model) {
+stamp: function (model) {
model = model || {};
if (this._parentProps) {
for (var prop in this._parentProps) {
-model[prop] = this["_parent_" + prop];
+model[prop] = this['_parent_' + prop];
}
}
return new this.ctor(model, this);
}
};
-
Polymer({
-is: "dom-template",
-"extends": "template",
-behaviors: [ Polymer.Templatizer ],
-ready: function() {
+is: 'dom-template',
+extends: 'template',
+behaviors: [Polymer.Templatizer],
+ready: function () {
this.templatize(this);
}
});
-
Polymer._collections = new WeakMap();
-
-Polymer.Collection = function(userArray) {
+Polymer.Collection = function (userArray) {
Polymer._collections.set(userArray, this);
this.userArray = userArray;
this.store = userArray.slice();
this.initMap();
};
-
Polymer.Collection.prototype = {
constructor: Polymer.Collection,
-initMap: function() {
+initMap: function () {
var omap = this.omap = new WeakMap();
var pmap = this.pmap = {};
var s = this.store;
for (var i = 0; i < s.length; i++) {
var item = s[i];
-if (item && typeof item == "object") {
+if (item && typeof item == 'object') {
omap.set(item, i);
} else {
pmap[item] = i;
}
}
},
-add: function(item) {
+add: function (item) {
var key = this.store.push(item) - 1;
-if (item && typeof item == "object") {
+if (item && typeof item == 'object') {
this.omap.set(item, key);
} else {
this.pmap[item] = key;
}
return key;
},
-removeKey: function(key) {
+removeKey: function (key) {
this._removeFromMap(this.store[key]);
delete this.store[key];
},
-_removeFromMap: function(item) {
-if (typeof item == "object") {
+_removeFromMap: function (item) {
+if (typeof item == 'object') {
this.omap.delete(item);
} else {
delete this.pmap[item];
}
},
-remove: function(item) {
+remove: function (item) {
var key = this.getKey(item);
this.removeKey(key);
return key;
},
-getKey: function(item) {
-if (typeof item == "object") {
+getKey: function (item) {
+if (typeof item == 'object') {
return this.omap.get(item);
} else {
return this.pmap[item];
}
},
-getKeys: function() {
+getKeys: function () {
return Object.keys(this.store);
},
-setItem: function(key, value) {
+setItem: function (key, value) {
this.store[key] = value;
},
-getItem: function(key) {
+getItem: function (key) {
return this.store[key];
},
-getItems: function() {
+getItems: function () {
var items = [], store = this.store;
for (var key in store) {
items.push(store[key]);
}
return items;
},
-applySplices: function(splices) {
+applySplices: function (splices) {
var keySplices = [];
for (var i = 0; i < splices.length; i++) {
var j, o, key, s = splices[i];
@@ -3126,64 +3117,65 @@ added: added
return keySplices;
}
};
-
-Polymer.Collection.get = function(userArray) {
+Polymer.Collection.get = function (userArray) {
return Polymer._collections.get(userArray) || new Polymer.Collection(userArray);
};
-
Polymer({
-is: "dom-repeat",
-"extends": "template",
+is: 'dom-repeat',
+extends: 'template',
properties: {
-items: {
-type: Array
-},
+items: { type: Array },
as: {
type: String,
-value: "item"
+value: 'item'
},
indexAs: {
type: String,
-value: "index"
+value: 'index'
},
sort: {
type: Function,
-observer: "_sortChanged"
+observer: '_sortChanged'
},
filter: {
type: Function,
-observer: "_filterChanged"
+observer: '_filterChanged'
},
observe: {
type: String,
-observer: "_observeChanged"
+observer: '_observeChanged'
},
delay: Number
},
-behaviors: [ Polymer.Templatizer ],
-observers: [ "_itemsChanged(items.*)" ],
-detached: function() {
+behaviors: [Polymer.Templatizer],
+observers: ['_itemsChanged(items.*)'],
+detached: function () {
if (this.rows) {
for (var i = 0; i < this.rows.length; i++) {
this._detachRow(i);
}
}
-this.rows = null;
},
-ready: function() {
-this._instanceProps = {
-__key__: true
-};
+attached: function () {
+if (this.rows) {
+var parentNode = Polymer.dom(this).parentNode;
+for (var i = 0; i < this.rows.length; i++) {
+Polymer.dom(parentNode).insertBefore(this.rows[i].root, this);
+}
+}
+},
+ready: function () {
+this._instanceProps = { __key__: true };
this._instanceProps[this.as] = true;
this._instanceProps[this.indexAs] = true;
if (!this.ctor) {
this.templatize(this);
}
},
-_sortChanged: function() {
+_sortChanged: function () {
var dataHost = this._getRootDataHost();
var sort = this.sort;
-this._sortFn = sort && (typeof sort == "function" ? sort : function() {
+this._sortFn = sort && (typeof sort == 'function' ? sort : function () {
return dataHost[sort].apply(dataHost, arguments);
});
this._fullRefresh = true;
@@ -3191,10 +3183,10 @@ if (this.items) {
this._debounceTemplate(this._render);
}
},
-_filterChanged: function() {
+_filterChanged: function () {
var dataHost = this._getRootDataHost();
var filter = this.filter;
-this._filterFn = filter && (typeof filter == "function" ? filter : function() {
+this._filterFn = filter && (typeof filter == 'function' ? filter : function () {
return dataHost[filter].apply(dataHost, arguments);
});
this._fullRefresh = true;
@@ -3202,22 +3194,22 @@ if (this.items) {
this._debounceTemplate(this._render);
}
},
-_observeChanged: function() {
-this._observePaths = this.observe && this.observe.replace(".*", ".").split(" ");
+_observeChanged: function () {
+this._observePaths = this.observe && this.observe.replace('.*', '.').split(' ');
},
-_itemsChanged: function(change) {
-if (change.path == "items") {
+_itemsChanged: function (change) {
+if (change.path == 'items') {
if (Array.isArray(this.items)) {
this.collection = Polymer.Collection.get(this.items);
} else if (!this.items) {
this.collection = null;
} else {
-this._error(this._logf("dom-repeat", "expected array for `items`," + " found", this.items));
+this._error(this._logf('dom-repeat', 'expected array for `items`,' + ' found', this.items));
}
this._splices = [];
this._fullRefresh = true;
this._debounceTemplate(this._render);
-} else if (change.path == "items.splices") {
+} else if (change.path == 'items.splices') {
this._splices = this._splices.concat(change.value.keySplices);
this._debounceTemplate(this._render);
} else {
@@ -3226,15 +3218,15 @@ this._forwardItemPath(subpath, change.value);
this._checkObservedPaths(subpath);
}
},
-_checkObservedPaths: function(path) {
+_checkObservedPaths: function (path) {
if (this._observePaths) {
-path = path.substring(path.indexOf(".") + 1);
+path = path.substring(path.indexOf('.') + 1);
var paths = this._observePaths;
for (var i = 0; i < paths.length; i++) {
if (path.indexOf(paths[i]) === 0) {
this._fullRefresh = true;
if (this.delay) {
-this.debounce("render", this._render, this.delay);
+this.debounce('render', this._render, this.delay);
} else {
this._debounceTemplate(this._render);
}
@@ -3243,12 +3235,12 @@ return;
}
}
},
-render: function() {
+render: function () {
this._fullRefresh = true;
-this.debounce("render", this._render);
+this.debounce('render', this._render);
this._flushTemplates();
},
-_render: function() {
+_render: function () {
var c = this.collection;
if (!this._fullRefresh) {
if (this._sortFn) {
@@ -3281,13 +3273,13 @@ row[this.as] = item;
row.__key__ = key;
row[this.indexAs] = i;
}
-for (;i < this.rows.length; i++) {
+for (; i < this.rows.length; i++) {
this._detachRow(i);
}
this.rows.splice(keys.length, this.rows.length - keys.length);
-this.fire("dom-change");
+this.fire('dom-change');
},
-_sortAndFilter: function() {
+_sortAndFilter: function () {
var c = this.collection;
if (!this._sortFn) {
this._orderedKeys = [];
@@ -3301,20 +3293,20 @@ this._orderedKeys.push(c.getKey(items[i]));
this._orderedKeys = c ? c.getKeys() : [];
}
if (this._filterFn) {
-this._orderedKeys = this._orderedKeys.filter(function(a) {
+this._orderedKeys = this._orderedKeys.filter(function (a) {
return this._filterFn(c.getItem(a));
}, this);
}
if (this._sortFn) {
-this._orderedKeys.sort(function(a, b) {
+this._orderedKeys.sort(function (a, b) {
return this._sortFn(c.getItem(a), c.getItem(b));
}.bind(this));
}
},
-_keySort: function(a, b) {
+_keySort: function (a, b) {
return this.collection.getKey(a) - this.collection.getKey(b);
},
-_applySplicesViewSort: function(splices) {
+_applySplicesViewSort: function (splices) {
var c = this.collection;
var keys = this._orderedKeys;
var rows = this.rows;
@@ -3322,7 +3314,7 @@ var removedRows = [];
var addedKeys = [];
var pool = [];
var sortFn = this._sortFn || this._keySort.bind(this);
-splices.forEach(function(s) {
+splices.forEach(function (s) {
for (var i = 0; i < s.removed.length; i++) {
var idx = this._rowForKey[s.removed[i]];
if (idx != null) {
@@ -3344,11 +3336,11 @@ keys.splice(idx, 1);
}
if (addedKeys.length) {
if (this._filterFn) {
-addedKeys = addedKeys.filter(function(a) {
+addedKeys = addedKeys.filter(function (a) {
return this._filterFn(c.getItem(a));
}, this);
}
-addedKeys.sort(function(a, b) {
+addedKeys.sort(function (a, b) {
return this._sortFn(c.getItem(a), c.getItem(b));
}.bind(this));
var start = 0;
@@ -3357,7 +3349,7 @@ start = this._insertRowIntoViewSort(start, addedKeys[i], pool);
}
}
},
-_insertRowIntoViewSort: function(start, key, pool) {
+_insertRowIntoViewSort: function (start, key, pool) {
var c = this.collection;
var item = c.getItem(key);
var end = this.rows.length - 1;
@@ -3383,18 +3375,21 @@ this._orderedKeys.splice(idx, 0, key);
this.rows.splice(idx, 0, this._insertRow(idx, pool, c.getItem(key)));
return idx;
},
-_applySplicesArraySort: function(splices) {
+_applySplicesArraySort: function (splices) {
var keys = this._orderedKeys;
var pool = [];
-splices.forEach(function(s) {
+splices.forEach(function (s) {
for (var i = 0; i < s.removed.length; i++) {
pool.push(this._detachRow(s.index + i));
}
this.rows.splice(s.index, s.removed.length);
}, this);
var c = this.collection;
-splices.forEach(function(s) {
-var args = [ s.index, s.removed.length ].concat(s.added);
+splices.forEach(function (s) {
+var args = [
+s.index,
+s.removed.length
+].concat(s.added);
keys.splice.apply(keys, args);
for (var i = 0; i < s.added.length; i++) {
var item = c.getItem(s.added[i]);
@@ -3403,7 +3398,7 @@ this.rows.splice(s.index + i, 0, row);
}
}, this);
},
-_detachRow: function(idx) {
+_detachRow: function (idx) {
var row = this.rows[idx];
var parentNode = Polymer.dom(this).parentNode;
for (var i = 0; i < row._children.length; i++) {
@@ -3412,7 +3407,7 @@ Polymer.dom(row.root).appendChild(el);
}
return row;
},
-_insertRow: function(idx, pool, item) {
+_insertRow: function (idx, pool, item) {
var row = pool && pool.pop() || this._generateRow(idx, item);
var beforeRow = this.rows[idx];
var beforeNode = beforeRow ? beforeRow._children[0] : this;
@@ -3420,58 +3415,56 @@ var parentNode = Polymer.dom(this).parentNode;
Polymer.dom(parentNode).insertBefore(row.root, beforeNode);
return row;
},
-_generateRow: function(idx, item) {
-var model = {
-__key__: this.collection.getKey(item)
-};
+_generateRow: function (idx, item) {
+var model = { __key__: this.collection.getKey(item) };
model[this.as] = item;
model[this.indexAs] = idx;
var row = this.stamp(model);
return row;
},
-_hideChildren: function(hidden) {
+_showHideChildren: function (hidden) {
if (this.rows) {
for (var i = 0; i < this.rows.length; i++) {
var c$ = this.rows[i]._children;
for (var j = 0; j < c$.length; j++) {
var c = c$[j];
if (c.style) {
-c.style.display = hidden ? "none" : "";
+c.style.display = hidden ? 'none' : '';
}
c._hideTemplateChildren = hidden;
}
}
}
},
-_forwardInstancePath: function(row, path, value) {
-if (path.indexOf(this.as + ".") === 0) {
-this.notifyPath("items." + row.__key__ + "." + path.slice(this.as.length + 1), value);
+_forwardInstancePath: function (row, path, value) {
+if (path.indexOf(this.as + '.') === 0) {
+this.notifyPath('items.' + row.__key__ + '.' + path.slice(this.as.length + 1), value);
return true;
}
},
-_forwardParentProp: function(prop, value) {
+_forwardParentProp: function (prop, value) {
if (this.rows) {
-this.rows.forEach(function(row) {
+this.rows.forEach(function (row) {
row[prop] = value;
}, this);
}
},
-_forwardParentPath: function(path, value) {
+_forwardParentPath: function (path, value) {
if (this.rows) {
-this.rows.forEach(function(row) {
+this.rows.forEach(function (row) {
row.notifyPath(path, value, true);
}, this);
}
},
-_forwardItemPath: function(path, value) {
+_forwardItemPath: function (path, value) {
if (this._rowForKey) {
-var dot = path.indexOf(".");
+var dot = path.indexOf('.');
var key = path.substring(0, dot < 0 ? path.length : dot);
var idx = this._rowForKey[key];
var row = this.rows[idx];
if (row) {
if (dot >= 0) {
-path = this.as + "." + path.substring(dot + 1);
+path = this.as + '.' + path.substring(dot + 1);
row.notifyPath(path, value, true);
} else {
row[this.as] = value;
@@ -3479,7 +3472,7 @@ row[this.as] = value;
}
}
},
-modelForElement: function(el) {
+modelForElement: function (el) {
var model;
while (el) {
if (model = el._templateInstance) {
@@ -3493,26 +3486,25 @@ el = el.parentNode;
}
}
},
-itemForElement: function(el) {
+itemForElement: function (el) {
var instance = this.modelForElement(el);
return instance && instance[this.as];
},
-keyForElement: function(el) {
+keyForElement: function (el) {
var instance = this.modelForElement(el);
return instance && instance.__key__;
},
-indexForElement: function(el) {
+indexForElement: function (el) {
var instance = this.modelForElement(el);
return instance && instance[this.indexAs];
}
});
-
Polymer({
-is: "array-selector",
+is: 'array-selector',
properties: {
items: {
type: Array,
-observer: "_itemsChanged"
+observer: '_itemsChanged'
},
selected: {
type: Object,
@@ -3521,13 +3513,13 @@ notify: true
toggle: Boolean,
multi: Boolean
},
-_itemsChanged: function() {
+_itemsChanged: function () {
if (Array.isArray(this.selected)) {
for (var i = 0; i < this.selected.length; i++) {
-this.unlinkPaths("selected." + i);
+this.unlinkPaths('selected.' + i);
}
} else {
-this.unlinkPaths("selected");
+this.unlinkPaths('selected');
}
if (this.multi) {
this.selected = [];
@@ -3535,22 +3527,22 @@ this.selected = [];
this.selected = null;
}
},
-deselect: function(item) {
+deselect: function (item) {
if (this.multi) {
var scol = Polymer.Collection.get(this.selected);
var sidx = this.selected.indexOf(item);
if (sidx >= 0) {
var skey = scol.getKey(item);
-this.splice("selected", sidx, 1);
-this.unlinkPaths("selected." + skey);
+this.splice('selected', sidx, 1);
+this.unlinkPaths('selected.' + skey);
return true;
}
} else {
this.selected = null;
-this.unlinkPaths("selected");
+this.unlinkPaths('selected');
}
},
-select: function(item) {
+select: function (item) {
var icol = Polymer.Collection.get(this.items);
var key = icol.getKey(item);
if (this.multi) {
@@ -3559,28 +3551,27 @@ var skey = scol.getKey(item);
if (skey >= 0) {
this.deselect(item);
} else if (this.toggle) {
-this.push("selected", item);
-this.async(function() {
+this.push('selected', item);
+this.async(function () {
skey = scol.getKey(item);
-this.linkPaths("selected." + skey, "items." + key);
+this.linkPaths('selected.' + skey, 'items.' + key);
});
}
} else {
if (this.toggle && item == this.selected) {
this.deselect();
} else {
-this.linkPaths("selected", "items." + key);
+this.linkPaths('selected', 'items.' + key);
this.selected = item;
}
}
}
});
-
Polymer({
-is: "dom-if",
-"extends": "template",
+is: 'dom-if',
+extends: 'template',
properties: {
-"if": {
+'if': {
type: Boolean,
value: false
},
@@ -3589,42 +3580,42 @@ type: Boolean,
value: false
}
},
-behaviors: [ Polymer.Templatizer ],
-observers: [ "_queueRender(if, restamp)" ],
-_queueRender: function() {
+behaviors: [Polymer.Templatizer],
+observers: ['_queueRender(if, restamp)'],
+_queueRender: function () {
this._debounceTemplate(this._render);
},
-detached: function() {
+detached: function () {
this._teardownInstance();
},
-attached: function() {
+attached: function () {
if (this.if && this.ctor) {
this.async(this._ensureInstance);
}
},
-render: function() {
+render: function () {
this._flushTemplates();
},
-_render: function() {
+_render: function () {
if (this.if) {
if (!this.ctor) {
this._wrapTextNodes(this._content || this.content);
this.templatize(this);
}
this._ensureInstance();
-this._hideTemplateChildren = false;
+this._showHideChildren();
} else if (this.restamp) {
this._teardownInstance();
}
if (!this.restamp && this._instance) {
-this._hideTemplateChildren = !this.if;
+this._showHideChildren();
}
if (this.if != this._lastIf) {
-this.fire("dom-change");
+this.fire('dom-change');
this._lastIf = this.if;
}
},
-_ensureInstance: function() {
+_ensureInstance: function () {
if (!this._instance) {
this._instance = this.stamp();
var root = this._instance.root;
@@ -3632,116 +3623,114 @@ var parent = Polymer.dom(Polymer.dom(this).parentNode);
parent.insertBefore(root, this);
}
},
-_teardownInstance: function() {
+_teardownInstance: function () {
if (this._instance) {
var c = this._instance._children;
if (c) {
var parent = Polymer.dom(Polymer.dom(c[0]).parentNode);
-c.forEach(function(n) {
+c.forEach(function (n) {
parent.removeChild(n);
});
}
this._instance = null;
}
},
-_wrapTextNodes: function(root) {
+_wrapTextNodes: function (root) {
for (var n = root.firstChild; n; n = n.nextSibling) {
if (n.nodeType === Node.TEXT_NODE) {
-var s = document.createElement("span");
+var s = document.createElement('span');
root.insertBefore(s, n);
s.appendChild(n);
n = s;
}
}
},
-_hideChildren: function(hidden) {
+_showHideChildren: function () {
+var hidden = this._hideTemplateChildren || !this.if;
if (this._instance) {
var c$ = this._instance._children;
for (var i = 0; i < c$.length; i++) {
var c = c$[i];
-c.style.display = hidden ? "none" : "";
+c.style.display = hidden ? 'none' : '';
c._hideTemplateChildren = hidden;
}
}
},
-_forwardParentProp: function(prop, value) {
+_forwardParentProp: function (prop, value) {
if (this._instance) {
this._instance[prop] = value;
}
},
-_forwardParentPath: function(path, value) {
+_forwardParentPath: function (path, value) {
if (this._instance) {
this._instance.notifyPath(path, value, true);
}
}
});
-
Polymer.ImportStatus = {
_ready: false,
_callbacks: [],
-whenLoaded: function(cb) {
+whenLoaded: function (cb) {
if (this._ready) {
cb();
} else {
this._callbacks.push(cb);
}
},
-_importsLoaded: function() {
+_importsLoaded: function () {
this._ready = true;
-this._callbacks.forEach(function(cb) {
+this._callbacks.forEach(function (cb) {
cb();
});
this._callbacks = [];
}
};
-
-window.addEventListener("load", function() {
+window.addEventListener('load', function () {
Polymer.ImportStatus._importsLoaded();
});
-
if (window.HTMLImports) {
-HTMLImports.whenReady(function() {
+HTMLImports.whenReady(function () {
Polymer.ImportStatus._importsLoaded();
});
}
-
Polymer({
-is: "dom-bind",
-"extends": "template",
-created: function() {
+is: 'dom-bind',
+extends: 'template',
+created: function () {
Polymer.ImportStatus.whenLoaded(this._readySelf.bind(this));
},
-_registerFeatures: function() {
+_registerFeatures: function () {
this._prepExtends();
this._prepConstructor();
},
-_insertChildren: function() {
+_insertChildren: function () {
var parentDom = Polymer.dom(Polymer.dom(this).parentNode);
parentDom.insertBefore(this.root, this);
},
-_removeChildren: function() {
+_removeChildren: function () {
if (this._children) {
for (var i = 0; i < this._children.length; i++) {
this.root.appendChild(this._children[i]);
}
}
},
-_initFeatures: function() {},
-_scopeElementClass: function(element, selector) {
+_initFeatures: function () {
+},
+_scopeElementClass: function (element, selector) {
if (this.dataHost) {
return this.dataHost._scopeElementClass(element, selector);
} else {
return selector;
}
},
-_prepConfigure: function() {
+_prepConfigure: function () {
var config = {};
for (var prop in this._propertyEffects) {
config[prop] = this[prop];
}
this._setupConfigure = this._setupConfigure.bind(this, config);
},
-attached: function() {
+attached: function () {
if (!this._children) {
this._template = this;
this._prepAnnotations();
@@ -3753,9 +3742,9 @@ Polymer.Base._initFeatures.call(this);
this._children = Array.prototype.slice.call(this.root.childNodes);
}
this._insertChildren();
-this.fire("dom-change");
+this.fire('dom-change');
},
-detached: function() {
+detached: function () {
this._removeChildren();
}
}); \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js b/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js
index 5351ce8..7b7b84d 100644
--- a/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/polymer/polymer-micro-extracted.js
@@ -1,9 +1,9 @@
-(function() {
+(function () {
function resolve() {
-document.body.removeAttribute("unresolved");
+document.body.removeAttribute('unresolved');
}
if (window.WebComponents) {
-addEventListener("WebComponentsReady", resolve);
+addEventListener('WebComponentsReady', resolve);
} else {
if (document.readyState === 'interactive' || document.readyState === 'complete') {
resolve();
@@ -11,20 +11,19 @@ resolve();
addEventListener('DOMContentLoaded', resolve);
}
}
-})();
-
+}());
Polymer = {
-Settings: function() {
+Settings: function () {
var user = window.Polymer || {};
-location.search.slice(1).split("&").forEach(function(o) {
-o = o.split("=");
+location.search.slice(1).split('&').forEach(function (o) {
+o = o.split('=');
o[0] && (user[o[0]] = o[1] || true);
});
-var wantShadow = user.dom === "shadow";
+var wantShadow = user.dom === 'shadow';
var hasShadow = Boolean(Element.prototype.createShadowRoot);
var nativeShadow = hasShadow && !window.ShadowDOMPolyfill;
var useShadow = wantShadow && hasShadow;
-var hasNativeImports = Boolean("import" in document.createElement("link"));
+var hasNativeImports = Boolean('import' in document.createElement('link'));
var useNativeImports = hasNativeImports;
var useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
return {
@@ -38,15 +37,12 @@ useNativeCustomElements: useNativeCustomElements
};
}()
};
-
-(function() {
+(function () {
var userPolymer = window.Polymer;
-window.Polymer = function(prototype) {
+window.Polymer = function (prototype) {
var ctor = desugar(prototype);
prototype = ctor.prototype;
-var options = {
-prototype: prototype
-};
+var options = { prototype: prototype };
if (prototype.extends) {
options.extends = prototype.extends;
}
@@ -54,7 +50,7 @@ Polymer.telemetry._registrate(prototype);
document.registerElement(prototype.is, options);
return ctor;
};
-var desugar = function(prototype) {
+var desugar = function (prototype) {
prototype = Polymer.Base.chainObject(prototype, Polymer.Base);
prototype.registerCallback();
return prototype.constructor;
@@ -66,65 +62,62 @@ Polymer[i] = userPolymer[i];
}
}
Polymer.Class = desugar;
-})();
-
+}());
Polymer.telemetry = {
registrations: [],
-_regLog: function(prototype) {
-console.log("[" + prototype.is + "]: registered");
+_regLog: function (prototype) {
+console.log('[' + prototype.is + ']: registered');
},
-_registrate: function(prototype) {
+_registrate: function (prototype) {
this.registrations.push(prototype);
Polymer.log && this._regLog(prototype);
},
-dumpRegistrations: function() {
+dumpRegistrations: function () {
this.registrations.forEach(this._regLog);
}
};
-
-Object.defineProperty(window, "currentImport", {
+Object.defineProperty(window, 'currentImport', {
enumerable: true,
configurable: true,
-get: function() {
+get: function () {
return (document._currentScript || document.currentScript).ownerDocument;
}
});
-
Polymer.Base = {
-_addFeature: function(feature) {
+_addFeature: function (feature) {
this.extend(this, feature);
},
-registerCallback: function() {
+registerCallback: function () {
this._registerFeatures();
-this._doBehavior("registered");
+this._doBehavior('registered');
},
-createdCallback: function() {
+createdCallback: function () {
Polymer.telemetry.instanceCount++;
this.root = this;
-this._doBehavior("created");
+this._doBehavior('created');
this._initFeatures();
},
-attachedCallback: function() {
+attachedCallback: function () {
this.isAttached = true;
-this._doBehavior("attached");
+this._doBehavior('attached');
},
-detachedCallback: function() {
+detachedCallback: function () {
this.isAttached = false;
-this._doBehavior("detached");
+this._doBehavior('detached');
},
-attributeChangedCallback: function(name) {
+attributeChangedCallback: function (name) {
this._setAttributeToProperty(this, name);
-this._doBehavior("attributeChanged", arguments);
+this._doBehavior('attributeChanged', arguments);
},
-extend: function(prototype, api) {
+extend: function (prototype, api) {
if (prototype && api) {
-Object.getOwnPropertyNames(api).forEach(function(n) {
+Object.getOwnPropertyNames(api).forEach(function (n) {
this.copyOwnProperty(n, api, prototype);
}, this);
}
return prototype || api;
},
-copyOwnProperty: function(name, source, target) {
+copyOwnProperty: function (name, source, target) {
var pd = Object.getOwnPropertyDescriptor(source, name);
if (pd) {
Object.defineProperty(target, name, pd);
@@ -133,17 +126,18 @@ Object.defineProperty(target, name, pd);
_log: console.log.apply.bind(console.log, console),
_warn: console.warn.apply.bind(console.warn, console),
_error: console.error.apply.bind(console.error, console),
-_logf: function() {
-return this._logPrefix.concat([ this.is ]).concat(Array.prototype.slice.call(arguments, 0));
+_logf: function () {
+return this._logPrefix.concat([this.is]).concat(Array.prototype.slice.call(arguments, 0));
}
};
-
-Polymer.Base._logPrefix = function() {
+Polymer.Base._logPrefix = function () {
var color = window.chrome || /firefox/i.test(navigator.userAgent);
-return color ? [ "%c[%s::%s]:", "font-weight: bold; background-color:#EEEE00;" ] : [ "[%s::%s]:" ];
+return color ? [
+'%c[%s::%s]:',
+'font-weight: bold; background-color:#EEEE00;'
+] : ['[%s::%s]:'];
}();
-
-Polymer.Base.chainObject = function(object, inherited) {
+Polymer.Base.chainObject = function (object, inherited) {
if (object && inherited && object !== inherited) {
if (!Object.__proto__) {
object = Polymer.Base.extend(Object.create(inherited), object);
@@ -152,26 +146,23 @@ object.__proto__ = inherited;
}
return object;
};
-
Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype);
-
Polymer.telemetry.instanceCount = 0;
-
-(function() {
+(function () {
var modules = {};
-var DomModule = function() {
-return document.createElement("dom-module");
+var DomModule = function () {
+return document.createElement('dom-module');
};
DomModule.prototype = Object.create(HTMLElement.prototype);
DomModule.prototype.constructor = DomModule;
-DomModule.prototype.createdCallback = function() {
-var id = this.id || this.getAttribute("name") || this.getAttribute("is");
+DomModule.prototype.createdCallback = function () {
+var id = this.id || this.getAttribute('name') || this.getAttribute('is');
if (id) {
this.id = id;
modules[id] = this;
}
};
-DomModule.prototype.import = function(id, slctr) {
+DomModule.prototype.import = function (id, slctr) {
var m = modules[id];
if (!m) {
forceDocumentUpgrade();
@@ -187,7 +178,7 @@ if (cePolyfill) {
var ready = CustomElements.ready;
CustomElements.ready = true;
}
-document.registerElement("dom-module", DomModule);
+document.registerElement('dom-module', DomModule);
if (cePolyfill) {
CustomElements.ready = ready;
}
@@ -199,42 +190,40 @@ CustomElements.upgradeAll(script.ownerDocument);
}
}
}
-})();
-
+}());
Polymer.Base._addFeature({
-_prepIs: function() {
+_prepIs: function () {
if (!this.is) {
var module = (document._currentScript || document.currentScript).parentNode;
-if (module.localName === "dom-module") {
-var id = module.id || module.getAttribute("name") || module.getAttribute("is");
+if (module.localName === 'dom-module') {
+var id = module.id || module.getAttribute('name') || module.getAttribute('is');
this.is = id;
}
}
}
});
-
Polymer.Base._addFeature({
behaviors: [],
-_prepBehaviors: function() {
+_prepBehaviors: function () {
if (this.behaviors.length) {
this.behaviors = this._flattenBehaviorsList(this.behaviors);
}
this._prepAllBehaviors(this.behaviors);
},
-_flattenBehaviorsList: function(behaviors) {
+_flattenBehaviorsList: function (behaviors) {
var flat = [];
-behaviors.forEach(function(b) {
+behaviors.forEach(function (b) {
if (b instanceof Array) {
flat = flat.concat(this._flattenBehaviorsList(b));
} else if (b) {
flat.push(b);
} else {
-this._warn(this._logf("_flattenBehaviorsList", "behavior is null, check for missing or 404 import"));
+this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for missing or 404 import'));
}
}, this);
return flat;
},
-_prepAllBehaviors: function(behaviors) {
+_prepAllBehaviors: function (behaviors) {
for (var i = behaviors.length - 1; i >= 0; i--) {
this._mixinBehavior(behaviors[i]);
}
@@ -243,22 +232,21 @@ this._prepBehavior(behaviors[i]);
}
this._prepBehavior(this);
},
-_mixinBehavior: function(b) {
-Object.getOwnPropertyNames(b).forEach(function(n) {
+_mixinBehavior: function (b) {
+Object.getOwnPropertyNames(b).forEach(function (n) {
switch (n) {
-case "hostAttributes":
-case "registered":
-case "properties":
-case "observers":
-case "listeners":
-case "created":
-case "attached":
-case "detached":
-case "attributeChanged":
-case "configure":
-case "ready":
+case 'hostAttributes':
+case 'registered':
+case 'properties':
+case 'observers':
+case 'listeners':
+case 'created':
+case 'attached':
+case 'detached':
+case 'attributeChanged':
+case 'configure':
+case 'ready':
break;
-
default:
if (!this.hasOwnProperty(n)) {
this.copyOwnProperty(n, b, this);
@@ -267,37 +255,36 @@ break;
}
}, this);
},
-_doBehavior: function(name, args) {
-this.behaviors.forEach(function(b) {
+_doBehavior: function (name, args) {
+this.behaviors.forEach(function (b) {
this._invokeBehavior(b, name, args);
}, this);
this._invokeBehavior(this, name, args);
},
-_invokeBehavior: function(b, name, args) {
+_invokeBehavior: function (b, name, args) {
var fn = b[name];
if (fn) {
fn.apply(this, args || Polymer.nar);
}
},
-_marshalBehaviors: function() {
-this.behaviors.forEach(function(b) {
+_marshalBehaviors: function () {
+this.behaviors.forEach(function (b) {
this._marshalBehavior(b);
}, this);
this._marshalBehavior(this);
}
});
-
Polymer.Base._addFeature({
-_prepExtends: function() {
+_prepExtends: function () {
if (this.extends) {
this.__proto__ = this._getExtendedPrototype(this.extends);
}
},
-_getExtendedPrototype: function(tag) {
+_getExtendedPrototype: function (tag) {
return this._getExtendedNativePrototype(tag);
},
_nativePrototypes: {},
-_getExtendedNativePrototype: function(tag) {
+_getExtendedNativePrototype: function (tag) {
var p = this._nativePrototypes[tag];
if (!p) {
var np = this.getNativePrototype(tag);
@@ -306,28 +293,30 @@ this._nativePrototypes[tag] = p;
}
return p;
},
-getNativePrototype: function(tag) {
+getNativePrototype: function (tag) {
return Object.getPrototypeOf(document.createElement(tag));
}
});
-
Polymer.Base._addFeature({
-_prepConstructor: function() {
-this._factoryArgs = this.extends ? [ this.extends, this.is ] : [ this.is ];
-var ctor = function() {
+_prepConstructor: function () {
+this._factoryArgs = this.extends ? [
+this.extends,
+this.is
+] : [this.is];
+var ctor = function () {
return this._factory(arguments);
};
-if (this.hasOwnProperty("extends")) {
+if (this.hasOwnProperty('extends')) {
ctor.extends = this.extends;
}
-Object.defineProperty(this, "constructor", {
+Object.defineProperty(this, 'constructor', {
value: ctor,
writable: true,
configurable: true
});
ctor.prototype = this;
},
-_factory: function(args) {
+_factory: function (args) {
var elt = document.createElement.apply(document, this._factoryArgs);
if (this.factoryImpl) {
this.factoryImpl.apply(elt, args);
@@ -335,26 +324,22 @@ this.factoryImpl.apply(elt, args);
return elt;
}
});
-
Polymer.nob = Object.create(null);
-
Polymer.Base._addFeature({
properties: {},
-getPropertyInfo: function(property) {
+getPropertyInfo: function (property) {
var info = this._getPropertyInfo(property, this.properties);
if (!info) {
-this.behaviors.some(function(b) {
+this.behaviors.some(function (b) {
return info = this._getPropertyInfo(property, b.properties);
}, this);
}
return info || Polymer.nob;
},
-_getPropertyInfo: function(property, properties) {
+_getPropertyInfo: function (property, properties) {
var p = properties && properties[property];
-if (typeof p === "function") {
-p = properties[property] = {
-type: p
-};
+if (typeof p === 'function') {
+p = properties[property] = { type: p };
}
if (p) {
p.defined = true;
@@ -362,60 +347,58 @@ p.defined = true;
return p;
}
});
-
Polymer.CaseMap = {
_caseMap: {},
-dashToCamelCase: function(dash) {
+dashToCamelCase: function (dash) {
var mapped = Polymer.CaseMap._caseMap[dash];
if (mapped) {
return mapped;
}
-if (dash.indexOf("-") < 0) {
+if (dash.indexOf('-') < 0) {
return Polymer.CaseMap._caseMap[dash] = dash;
}
-return Polymer.CaseMap._caseMap[dash] = dash.replace(/-([a-z])/g, function(m) {
+return Polymer.CaseMap._caseMap[dash] = dash.replace(/-([a-z])/g, function (m) {
return m[1].toUpperCase();
});
},
-camelToDashCase: function(camel) {
+camelToDashCase: function (camel) {
var mapped = Polymer.CaseMap._caseMap[camel];
if (mapped) {
return mapped;
}
-return Polymer.CaseMap._caseMap[camel] = camel.replace(/([a-z][A-Z])/g, function(g) {
-return g[0] + "-" + g[1].toLowerCase();
+return Polymer.CaseMap._caseMap[camel] = camel.replace(/([a-z][A-Z])/g, function (g) {
+return g[0] + '-' + g[1].toLowerCase();
});
}
};
-
Polymer.Base._addFeature({
-_prepAttributes: function() {
+_prepAttributes: function () {
this._aggregatedAttributes = {};
},
-_addHostAttributes: function(attributes) {
+_addHostAttributes: function (attributes) {
if (attributes) {
this.mixin(this._aggregatedAttributes, attributes);
}
},
-_marshalHostAttributes: function() {
+_marshalHostAttributes: function () {
this._applyAttributes(this, this._aggregatedAttributes);
},
-_applyAttributes: function(node, attr$) {
+_applyAttributes: function (node, attr$) {
for (var n in attr$) {
-if (!this.hasAttribute(n) && n !== "class") {
+if (!this.hasAttribute(n) && n !== 'class') {
this.serializeValueToAttribute(attr$[n], n, this);
}
}
},
-_marshalAttributes: function() {
+_marshalAttributes: function () {
this._takeAttributesToModel(this);
},
-_takeAttributesToModel: function(model) {
+_takeAttributesToModel: function (model) {
for (var i = 0, l = this.attributes.length; i < l; i++) {
this._setAttributeToProperty(model, this.attributes[i].name);
}
},
-_setAttributeToProperty: function(model, attrName) {
+_setAttributeToProperty: function (model, attrName) {
if (!this._serializing) {
var propName = Polymer.CaseMap.dashToCamelCase(attrName);
var info = this.getPropertyInfo(propName);
@@ -426,112 +409,104 @@ model[propName] = this.deserialize(val, info.type);
}
},
_serializing: false,
-reflectPropertyToAttribute: function(name) {
+reflectPropertyToAttribute: function (name) {
this._serializing = true;
this.serializeValueToAttribute(this[name], Polymer.CaseMap.camelToDashCase(name));
this._serializing = false;
},
-serializeValueToAttribute: function(value, attribute, node) {
+serializeValueToAttribute: function (value, attribute, node) {
var str = this.serialize(value);
-(node || this)[str === undefined ? "removeAttribute" : "setAttribute"](attribute, str);
+(node || this)[str === undefined ? 'removeAttribute' : 'setAttribute'](attribute, str);
},
-deserialize: function(value, type) {
+deserialize: function (value, type) {
switch (type) {
case Number:
value = Number(value);
break;
-
case Boolean:
value = value !== null;
break;
-
case Object:
try {
value = JSON.parse(value);
-} catch (x) {}
+} catch (x) {
+}
break;
-
case Array:
try {
value = JSON.parse(value);
} catch (x) {
value = null;
-console.warn("Polymer::Attributes: couldn`t decode Array as JSON");
+console.warn('Polymer::Attributes: couldn`t decode Array as JSON');
}
break;
-
case Date:
value = new Date(value);
break;
-
case String:
default:
break;
}
return value;
},
-serialize: function(value) {
+serialize: function (value) {
switch (typeof value) {
-case "boolean":
-return value ? "" : undefined;
-
-case "object":
+case 'boolean':
+return value ? '' : undefined;
+case 'object':
if (value instanceof Date) {
return value;
} else if (value) {
try {
return JSON.stringify(value);
} catch (x) {
-return "";
+return '';
}
}
-
default:
return value != null ? value : undefined;
}
}
});
-
Polymer.Base._addFeature({
-_setupDebouncers: function() {
+_setupDebouncers: function () {
this._debouncers = {};
},
-debounce: function(jobName, callback, wait) {
+debounce: function (jobName, callback, wait) {
this._debouncers[jobName] = Polymer.Debounce.call(this, this._debouncers[jobName], callback, wait);
},
-isDebouncerActive: function(jobName) {
+isDebouncerActive: function (jobName) {
var debouncer = this._debouncers[jobName];
return debouncer && debouncer.finish;
},
-flushDebouncer: function(jobName) {
+flushDebouncer: function (jobName) {
var debouncer = this._debouncers[jobName];
if (debouncer) {
debouncer.complete();
}
},
-cancelDebouncer: function(jobName) {
+cancelDebouncer: function (jobName) {
var debouncer = this._debouncers[jobName];
if (debouncer) {
debouncer.stop();
}
}
});
-
-Polymer.version = "1.0.2";
-
+Polymer.version = '1.0.3';
Polymer.Base._addFeature({
-_registerFeatures: function() {
+_registerFeatures: function () {
this._prepIs();
this._prepAttributes();
this._prepBehaviors();
this._prepExtends();
this._prepConstructor();
},
-_prepBehavior: function(b) {
+_prepBehavior: function (b) {
this._addHostAttributes(b.hostAttributes);
},
-_marshalBehavior: function(b) {},
-_initFeatures: function() {
+_marshalBehavior: function (b) {
+},
+_initFeatures: function () {
this._marshalHostAttributes();
this._setupDebouncers();
this._marshalBehaviors();
diff --git a/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js b/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js
index ff4e108..d5bef3c 100644
--- a/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/polymer/polymer-mini-extracted.js
@@ -1,65 +1,65 @@
Polymer.Base._addFeature({
-_prepTemplate: function() {
-this._template = this._template || Polymer.DomModule.import(this.is, "template");
+_prepTemplate: function () {
+this._template = this._template || Polymer.DomModule.import(this.is, 'template');
if (!this._template) {
var script = document._currentScript || document.currentScript;
var prev = script && script.previousElementSibling;
-if (prev && prev.localName === "template") {
+if (prev && prev.localName === 'template') {
this._template = prev;
}
}
-if (this._template && this._template.hasAttribute("is")) {
-this._warn(this._logf("_prepTemplate", "top-level Polymer template " + "must not be a type-extension, found", this._template, "Move inside simple <template>."));
+if (this._template && this._template.hasAttribute('is')) {
+this._warn(this._logf('_prepTemplate', 'top-level Polymer template ' + 'must not be a type-extension, found', this._template, 'Move inside simple <template>.'));
}
},
-_stampTemplate: function() {
+_stampTemplate: function () {
if (this._template) {
this.root = this.instanceTemplate(this._template);
}
},
-instanceTemplate: function(template) {
+instanceTemplate: function (template) {
var dom = document.importNode(template._content || template.content, true);
return dom;
}
});
-
-(function() {
+(function () {
var baseAttachedCallback = Polymer.Base.attachedCallback;
Polymer.Base._addFeature({
_hostStack: [],
-ready: function() {},
-_pushHost: function(host) {
+ready: function () {
+},
+_pushHost: function (host) {
this.dataHost = host = host || Polymer.Base._hostStack[Polymer.Base._hostStack.length - 1];
if (host && host._clients) {
host._clients.push(this);
}
this._beginHost();
},
-_beginHost: function() {
+_beginHost: function () {
Polymer.Base._hostStack.push(this);
if (!this._clients) {
this._clients = [];
}
},
-_popHost: function() {
+_popHost: function () {
Polymer.Base._hostStack.pop();
},
-_tryReady: function() {
+_tryReady: function () {
if (this._canReady()) {
this._ready();
}
},
-_canReady: function() {
+_canReady: function () {
return !this.dataHost || this.dataHost._clientsReadied;
},
-_ready: function() {
+_ready: function () {
this._beforeClientsReady();
this._setupRoot();
this._readyClients();
this._afterClientsReady();
this._readySelf();
},
-_readyClients: function() {
+_readyClients: function () {
this._beginDistribute();
var c$ = this._clients;
for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) {
@@ -69,18 +69,21 @@ this._finishDistribute();
this._clientsReadied = true;
this._clients = null;
},
-_readySelf: function() {
-this._doBehavior("ready");
+_readySelf: function () {
+this._doBehavior('ready');
this._readied = true;
if (this._attachedPending) {
this._attachedPending = false;
this.attachedCallback();
}
},
-_beforeClientsReady: function() {},
-_afterClientsReady: function() {},
-_beforeAttached: function() {},
-attachedCallback: function() {
+_beforeClientsReady: function () {
+},
+_afterClientsReady: function () {
+},
+_beforeAttached: function () {
+},
+attachedCallback: function () {
if (this._readied) {
this._beforeAttached();
baseAttachedCallback.call(this);
@@ -89,9 +92,8 @@ this._attachedPending = true;
}
}
});
-})();
-
-Polymer.ArraySplice = function() {
+}());
+Polymer.ArraySplice = function () {
function newSplice(index, removed, addedCount) {
return {
index: index,
@@ -103,9 +105,10 @@ var EDIT_LEAVE = 0;
var EDIT_UPDATE = 1;
var EDIT_ADD = 2;
var EDIT_DELETE = 3;
-function ArraySplice() {}
+function ArraySplice() {
+}
ArraySplice.prototype = {
-calcEditDistances: function(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+calcEditDistances: function (current, currentStart, currentEnd, old, oldStart, oldEnd) {
var rowCount = oldEnd - oldStart + 1;
var columnCount = currentEnd - currentStart + 1;
var distances = new Array(rowCount);
@@ -113,10 +116,13 @@ for (var i = 0; i < rowCount; i++) {
distances[i] = new Array(columnCount);
distances[i][0] = i;
}
-for (var j = 0; j < columnCount; j++) distances[0][j] = j;
+for (var j = 0; j < columnCount; j++)
+distances[0][j] = j;
for (var i = 1; i < rowCount; i++) {
for (var j = 1; j < columnCount; j++) {
-if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1])) distances[i][j] = distances[i - 1][j - 1]; else {
+if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1]))
+distances[i][j] = distances[i - 1][j - 1];
+else {
var north = distances[i - 1][j] + 1;
var west = distances[i][j - 1] + 1;
distances[i][j] = north < west ? north : west;
@@ -125,7 +131,7 @@ distances[i][j] = north < west ? north : west;
}
return distances;
},
-spliceOperationsFromEditDistances: function(distances) {
+spliceOperationsFromEditDistances: function (distances) {
var i = distances.length - 1;
var j = distances[0].length - 1;
var current = distances[i][j];
@@ -145,7 +151,10 @@ var northWest = distances[i - 1][j - 1];
var west = distances[i - 1][j];
var north = distances[i][j - 1];
var min;
-if (west < north) min = west < northWest ? west : northWest; else min = north < northWest ? north : northWest;
+if (west < north)
+min = west < northWest ? west : northWest;
+else
+min = north < northWest ? north : northWest;
if (min == northWest) {
if (northWest == current) {
edits.push(EDIT_LEAVE);
@@ -168,22 +177,27 @@ current = north;
edits.reverse();
return edits;
},
-calcSplices: function(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+calcSplices: function (current, currentStart, currentEnd, old, oldStart, oldEnd) {
var prefixCount = 0;
var suffixCount = 0;
var minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);
-if (currentStart == 0 && oldStart == 0) prefixCount = this.sharedPrefix(current, old, minLength);
-if (currentEnd == current.length && oldEnd == old.length) suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);
+if (currentStart == 0 && oldStart == 0)
+prefixCount = this.sharedPrefix(current, old, minLength);
+if (currentEnd == current.length && oldEnd == old.length)
+suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);
currentStart += prefixCount;
oldStart += prefixCount;
currentEnd -= suffixCount;
oldEnd -= suffixCount;
-if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0) return [];
+if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)
+return [];
if (currentStart == currentEnd) {
var splice = newSplice(currentStart, [], 0);
-while (oldStart < oldEnd) splice.removed.push(old[oldStart++]);
-return [ splice ];
-} else if (oldStart == oldEnd) return [ newSplice(currentStart, [], currentEnd - currentStart) ];
+while (oldStart < oldEnd)
+splice.removed.push(old[oldStart++]);
+return [splice];
+} else if (oldStart == oldEnd)
+return [newSplice(currentStart, [], currentEnd - currentStart)];
var ops = this.spliceOperationsFromEditDistances(this.calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd));
var splice = undefined;
var splices = [];
@@ -199,23 +213,23 @@ splice = undefined;
index++;
oldIndex++;
break;
-
case EDIT_UPDATE:
-if (!splice) splice = newSplice(index, [], 0);
+if (!splice)
+splice = newSplice(index, [], 0);
splice.addedCount++;
index++;
splice.removed.push(old[oldIndex]);
oldIndex++;
break;
-
case EDIT_ADD:
-if (!splice) splice = newSplice(index, [], 0);
+if (!splice)
+splice = newSplice(index, [], 0);
splice.addedCount++;
index++;
break;
-
case EDIT_DELETE:
-if (!splice) splice = newSplice(index, [], 0);
+if (!splice)
+splice = newSplice(index, [], 0);
splice.removed.push(old[oldIndex]);
oldIndex++;
break;
@@ -226,30 +240,32 @@ splices.push(splice);
}
return splices;
},
-sharedPrefix: function(current, old, searchLength) {
-for (var i = 0; i < searchLength; i++) if (!this.equals(current[i], old[i])) return i;
+sharedPrefix: function (current, old, searchLength) {
+for (var i = 0; i < searchLength; i++)
+if (!this.equals(current[i], old[i]))
+return i;
return searchLength;
},
-sharedSuffix: function(current, old, searchLength) {
+sharedSuffix: function (current, old, searchLength) {
var index1 = current.length;
var index2 = old.length;
var count = 0;
-while (count < searchLength && this.equals(current[--index1], old[--index2])) count++;
+while (count < searchLength && this.equals(current[--index1], old[--index2]))
+count++;
return count;
},
-calculateSplices: function(current, previous) {
+calculateSplices: function (current, previous) {
return this.calcSplices(current, 0, current.length, previous, 0, previous.length);
},
-equals: function(currentValue, previousValue) {
+equals: function (currentValue, previousValue) {
return currentValue === previousValue;
}
};
return new ArraySplice();
}();
-
-Polymer.EventApi = function() {
+Polymer.EventApi = function () {
var Settings = Polymer.Settings;
-var EventApi = function(event) {
+var EventApi = function (event) {
this.event = event;
};
if (Settings.useShadow) {
@@ -294,36 +310,29 @@ return this.event._path;
}
};
}
-var factory = function(event) {
+var factory = function (event) {
if (!event.__eventApi) {
event.__eventApi = new EventApi(event);
}
return event.__eventApi;
};
-return {
-factory: factory
-};
+return { factory: factory };
}();
-
-Polymer.domInnerHTML = function() {
+Polymer.domInnerHTML = function () {
var escapeAttrRegExp = /[&\u00A0"]/g;
var escapeDataRegExp = /[&\u00A0<>]/g;
function escapeReplace(c) {
switch (c) {
-case "&":
-return "&amp;";
-
-case "<":
-return "&lt;";
-
-case ">":
-return "&gt;";
-
+case '&':
+return '&amp;';
+case '<':
+return '&lt;';
+case '>':
+return '&gt;';
case '"':
-return "&quot;";
-
-case "\u00A0":
-return "&nbsp;";
+return '&quot;';
+case '\xA0':
+return '&nbsp;';
}
}
function escapeAttr(s) {
@@ -339,41 +348,65 @@ set[arr[i]] = true;
}
return set;
}
-var voidElements = makeSet([ "area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr" ]);
-var plaintextParents = makeSet([ "style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript" ]);
+var voidElements = makeSet([
+'area',
+'base',
+'br',
+'col',
+'command',
+'embed',
+'hr',
+'img',
+'input',
+'keygen',
+'link',
+'meta',
+'param',
+'source',
+'track',
+'wbr'
+]);
+var plaintextParents = makeSet([
+'style',
+'script',
+'xmp',
+'iframe',
+'noembed',
+'noframes',
+'plaintext',
+'noscript'
+]);
function getOuterHTML(node, parentNode, composed) {
switch (node.nodeType) {
case Node.ELEMENT_NODE:
var tagName = node.localName;
-var s = "<" + tagName;
+var s = '<' + tagName;
var attrs = node.attributes;
for (var i = 0, attr; attr = attrs[i]; i++) {
-s += " " + attr.name + '="' + escapeAttr(attr.value) + '"';
+s += ' ' + attr.name + '="' + escapeAttr(attr.value) + '"';
}
-s += ">";
+s += '>';
if (voidElements[tagName]) {
return s;
}
-return s + getInnerHTML(node, composed) + "</" + tagName + ">";
-
+return s + getInnerHTML(node, composed) + '</' + tagName + '>';
case Node.TEXT_NODE:
var data = node.data;
if (parentNode && plaintextParents[parentNode.localName]) {
return data;
}
return escapeData(data);
-
case Node.COMMENT_NODE:
-return "<!--" + node.data + "-->";
-
+return '<!--' + node.data + '-->';
default:
console.error(node);
-throw new Error("not implemented");
+throw new Error('not implemented');
}
}
function getInnerHTML(node, composed) {
-if (node instanceof HTMLTemplateElement) node = node.content;
-var s = "";
+if (node instanceof HTMLTemplateElement)
+node = node.content;
+var s = '';
var c$ = Polymer.dom(node).childNodes;
c$ = composed ? node._composedChildren : c$;
for (var i = 0, l = c$.length, child; i < l && (child = c$[i]); i++) {
@@ -381,41 +414,38 @@ s += getOuterHTML(child, node, composed);
}
return s;
}
-return {
-getInnerHTML: getInnerHTML
-};
+return { getInnerHTML: getInnerHTML };
}();
-
-Polymer.DomApi = function() {
-"use strict";
+Polymer.DomApi = function () {
+'use strict';
var Settings = Polymer.Settings;
var getInnerHTML = Polymer.domInnerHTML.getInnerHTML;
var nativeInsertBefore = Element.prototype.insertBefore;
var nativeRemoveChild = Element.prototype.removeChild;
var nativeAppendChild = Element.prototype.appendChild;
var dirtyRoots = [];
-var DomApi = function(node) {
+var DomApi = function (node) {
this.node = node;
if (this.patch) {
this.patch();
}
};
DomApi.prototype = {
-flush: function() {
+flush: function () {
for (var i = 0, host; i < dirtyRoots.length; i++) {
host = dirtyRoots[i];
-host.flushDebouncer("_distribute");
+host.flushDebouncer('_distribute');
}
dirtyRoots = [];
},
-_lazyDistribute: function(host) {
+_lazyDistribute: function (host) {
if (host.shadyRoot && host.shadyRoot._distributionClean) {
host.shadyRoot._distributionClean = false;
-host.debounce("_distribute", host._distributeContent);
+host.debounce('_distribute', host._distributeContent);
dirtyRoots.push(host);
}
},
-appendChild: function(node) {
+appendChild: function (node) {
var distributed;
this._removeNodeFromHost(node);
if (this._nodeIsInLogicalTree(this.node)) {
@@ -433,7 +463,7 @@ addToComposedParent(container, node);
}
return node;
},
-insertBefore: function(node, ref_node) {
+insertBefore: function (node, ref_node) {
if (!ref_node) {
return this.appendChild(node);
}
@@ -444,7 +474,7 @@ saveLightChildrenIfNeeded(this.node);
var children = this.childNodes;
var index = children.indexOf(ref_node);
if (index < 0) {
-throw Error("The ref_node to be inserted before is not a child " + "of this node");
+throw Error('The ref_node to be inserted before is not a child ' + 'of this node');
}
var host = this._hostForNode(this.node);
this._addLogicalInfo(node, this.node, host && host.shadyRoot, index);
@@ -461,9 +491,9 @@ addToComposedParent(container, node, ref_node);
}
return node;
},
-removeChild: function(node) {
+removeChild: function (node) {
if (factory(node).parentNode !== this.node) {
-console.warn("The node to be removed is not a child of this node", node);
+console.warn('The node to be removed is not a child of this node', node);
}
var distributed;
if (this._nodeIsInLogicalTree(this.node)) {
@@ -480,15 +510,15 @@ removeFromComposedParent(container, node);
}
return node;
},
-replaceChild: function(node, ref_node) {
+replaceChild: function (node, ref_node) {
this.insertBefore(node, ref_node);
this.removeChild(ref_node);
return node;
},
-getOwnerRoot: function() {
+getOwnerRoot: function () {
return this._ownerShadyRootForNode(this.node);
},
-_ownerShadyRootForNode: function(node) {
+_ownerShadyRootForNode: function (node) {
if (!node) {
return;
}
@@ -508,7 +538,7 @@ node._ownerShadyRoot = root;
}
return node._ownerShadyRoot;
},
-_maybeDistribute: function(node, parent, host) {
+_maybeDistribute: function (node, parent, host) {
var nodeNeedsDistribute = this._nodeNeedsDistribution(node);
var distribute = this._parentNeedsDistribution(parent) || nodeNeedsDistribute;
if (nodeNeedsDistribute) {
@@ -519,7 +549,7 @@ this._lazyDistribute(host);
}
return distribute;
},
-_tryRemoveUndistributedNode: function(node) {
+_tryRemoveUndistributedNode: function (node) {
if (this.node.shadyRoot) {
if (node.parentNode) {
nativeRemoveChild.call(node.parentNode, node);
@@ -527,23 +557,23 @@ nativeRemoveChild.call(node.parentNode, node);
return true;
}
},
-_updateInsertionPoints: function(host) {
+_updateInsertionPoints: function (host) {
host.shadyRoot._insertionPoints = factory(host.shadyRoot).querySelectorAll(CONTENT);
},
-_nodeIsInLogicalTree: function(node) {
+_nodeIsInLogicalTree: function (node) {
return Boolean(node._lightParent || node._isShadyRoot || this._ownerShadyRootForNode(node) || node.shadyRoot);
},
-_hostForNode: function(node) {
+_hostForNode: function (node) {
var root = node.shadyRoot || (node._isShadyRoot ? node : this._ownerShadyRootForNode(node));
return root && root.host;
},
-_parentNeedsDistribution: function(parent) {
+_parentNeedsDistribution: function (parent) {
return parent && parent.shadyRoot && hasInsertionPoint(parent.shadyRoot);
},
-_nodeNeedsDistribution: function(node) {
+_nodeNeedsDistribution: function (node) {
return node.localName === CONTENT || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && node.querySelector(CONTENT);
},
-_removeNodeFromHost: function(node) {
+_removeNodeFromHost: function (node) {
if (node._lightParent) {
var root = this._ownerShadyRootForNode(node);
if (root) {
@@ -553,14 +583,14 @@ this._removeLogicalInfo(node, node._lightParent);
}
this._removeOwnerShadyRoot(node);
},
-_addNodeToHost: function(node) {
+_addNodeToHost: function (node) {
var checkNode = node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? node.firstChild : node;
var root = this._ownerShadyRootForNode(checkNode);
if (root) {
root.host._elementAdd(node);
}
},
-_addLogicalInfo: function(node, container, root, index) {
+_addLogicalInfo: function (node, container, root, index) {
saveLightChildrenIfNeeded(container);
var children = factory(container).childNodes;
index = index === undefined ? children.length : index;
@@ -575,16 +605,16 @@ children.splice(index, 0, node);
node._lightParent = container;
}
},
-_removeLogicalInfo: function(node, container) {
+_removeLogicalInfo: function (node, container) {
var children = factory(container).childNodes;
var index = children.indexOf(node);
if (index < 0 || container !== node._lightParent) {
-throw Error("The node to be removed is not a child of this node");
+throw Error('The node to be removed is not a child of this node');
}
children.splice(index, 1);
node._lightParent = null;
},
-_removeOwnerShadyRoot: function(node) {
+_removeOwnerShadyRoot: function (node) {
var hasCachedRoot = factory(node).getOwnerRoot() !== undefined;
if (hasCachedRoot) {
var c$ = factory(node).childNodes;
@@ -594,7 +624,7 @@ this._removeOwnerShadyRoot(n);
}
node._ownerShadyRoot = undefined;
},
-_firstComposedNode: function(content) {
+_firstComposedNode: function (content) {
var n$ = factory(content).getDistributedNodes();
for (var i = 0, l = n$.length, n, p$; i < l && (n = n$[i]); i++) {
p$ = factory(n).getDestinationInsertionPoints();
@@ -603,40 +633,40 @@ return n;
}
}
},
-querySelector: function(selector) {
+querySelector: function (selector) {
return this.querySelectorAll(selector)[0];
},
-querySelectorAll: function(selector) {
-return this._query(function(n) {
+querySelectorAll: function (selector) {
+return this._query(function (n) {
return matchesSelector.call(n, selector);
}, this.node);
},
-_query: function(matcher, node) {
+_query: function (matcher, node) {
node = node || this.node;
var list = [];
this._queryElements(factory(node).childNodes, matcher, list);
return list;
},
-_queryElements: function(elements, matcher, list) {
+_queryElements: function (elements, matcher, list) {
for (var i = 0, l = elements.length, c; i < l && (c = elements[i]); i++) {
if (c.nodeType === Node.ELEMENT_NODE) {
this._queryElement(c, matcher, list);
}
}
},
-_queryElement: function(node, matcher, list) {
+_queryElement: function (node, matcher, list) {
if (matcher(node)) {
list.push(node);
}
this._queryElements(factory(node).childNodes, matcher, list);
},
-getDestinationInsertionPoints: function() {
+getDestinationInsertionPoints: function () {
return this.node._destinationInsertionPoints || [];
},
-getDistributedNodes: function() {
+getDistributedNodes: function () {
return this.node._distributedNodes || [];
},
-queryDistributedElements: function(selector) {
+queryDistributedElements: function (selector) {
var c$ = this.childNodes;
var list = [];
this._distributedFilter(selector, c$, list);
@@ -647,7 +677,7 @@ this._distributedFilter(selector, factory(c).getDistributedNodes(), list);
}
return list;
},
-_distributedFilter: function(selector, list, results) {
+_distributedFilter: function (selector, list, results) {
results = results || [];
for (var i = 0, l = list.length, d; i < l && (d = list[i]); i++) {
if (d.nodeType === Node.ELEMENT_NODE && d.localName !== CONTENT && matchesSelector.call(d, selector)) {
@@ -656,27 +686,27 @@ results.push(d);
}
return results;
},
-_clear: function() {
+_clear: function () {
while (this.childNodes.length) {
this.removeChild(this.childNodes[0]);
}
},
-setAttribute: function(name, value) {
+setAttribute: function (name, value) {
this.node.setAttribute(name, value);
this._distributeParent();
},
-removeAttribute: function(name) {
+removeAttribute: function (name) {
this.node.removeAttribute(name);
this._distributeParent();
},
-_distributeParent: function() {
+_distributeParent: function () {
if (this._parentNeedsDistribution(this.parentNode)) {
this._lazyDistribute(this.parentNode);
}
}
};
-Object.defineProperty(DomApi.prototype, "classList", {
-get: function() {
+Object.defineProperty(DomApi.prototype, 'classList', {
+get: function () {
if (!this._classList) {
this._classList = new DomApi.ClassList(this);
}
@@ -684,20 +714,20 @@ return this._classList;
},
configurable: true
});
-DomApi.ClassList = function(host) {
+DomApi.ClassList = function (host) {
this.domApi = host;
this.node = host.node;
};
DomApi.ClassList.prototype = {
-add: function() {
+add: function () {
this.node.classList.add.apply(this.node.classList, arguments);
this.domApi._distributeParent();
},
-remove: function() {
+remove: function () {
this.node.classList.remove.apply(this.node.classList, arguments);
this.domApi._distributeParent();
},
-toggle: function() {
+toggle: function () {
this.node.classList.toggle.apply(this.node.classList, arguments);
this.domApi._distributeParent();
}
@@ -705,41 +735,41 @@ this.domApi._distributeParent();
if (!Settings.useShadow) {
Object.defineProperties(DomApi.prototype, {
childNodes: {
-get: function() {
+get: function () {
var c$ = getLightChildren(this.node);
return Array.isArray(c$) ? c$ : Array.prototype.slice.call(c$);
},
configurable: true
},
children: {
-get: function() {
-return Array.prototype.filter.call(this.childNodes, function(n) {
+get: function () {
+return Array.prototype.filter.call(this.childNodes, function (n) {
return n.nodeType === Node.ELEMENT_NODE;
});
},
configurable: true
},
parentNode: {
-get: function() {
+get: function () {
return this.node._lightParent || (this.node.__patched ? this.node._composedParent : this.node.parentNode);
},
configurable: true
},
firstChild: {
-get: function() {
+get: function () {
return this.childNodes[0];
},
configurable: true
},
lastChild: {
-get: function() {
+get: function () {
var c$ = this.childNodes;
return c$[c$.length - 1];
},
configurable: true
},
nextSibling: {
-get: function() {
+get: function () {
var c$ = this.parentNode && factory(this.parentNode).childNodes;
if (c$) {
return c$[Array.prototype.indexOf.call(c$, this.node) + 1];
@@ -748,7 +778,7 @@ return c$[Array.prototype.indexOf.call(c$, this.node) + 1];
configurable: true
},
previousSibling: {
-get: function() {
+get: function () {
var c$ = this.parentNode && factory(this.parentNode).childNodes;
if (c$) {
return c$[Array.prototype.indexOf.call(c$, this.node) - 1];
@@ -757,20 +787,20 @@ return c$[Array.prototype.indexOf.call(c$, this.node) - 1];
configurable: true
},
firstElementChild: {
-get: function() {
+get: function () {
return this.children[0];
},
configurable: true
},
lastElementChild: {
-get: function() {
+get: function () {
var c$ = this.children;
return c$[c$.length - 1];
},
configurable: true
},
nextElementSibling: {
-get: function() {
+get: function () {
var c$ = this.parentNode && factory(this.parentNode).children;
if (c$) {
return c$[Array.prototype.indexOf.call(c$, this.node) + 1];
@@ -779,7 +809,7 @@ return c$[Array.prototype.indexOf.call(c$, this.node) + 1];
configurable: true
},
previousElementSibling: {
-get: function() {
+get: function () {
var c$ = this.parentNode && factory(this.parentNode).children;
if (c$) {
return c$[Array.prototype.indexOf.call(c$, this.node) - 1];
@@ -788,16 +818,16 @@ return c$[Array.prototype.indexOf.call(c$, this.node) - 1];
configurable: true
},
textContent: {
-get: function() {
+get: function () {
if (this.node.nodeType === Node.TEXT_NODE) {
return this.node.textContent;
} else {
-return Array.prototype.map.call(this.childNodes, function(c) {
+return Array.prototype.map.call(this.childNodes, function (c) {
return c.textContent;
-}).join("");
+}).join('');
}
},
-set: function(text) {
+set: function (text) {
this._clear();
if (text) {
this.appendChild(document.createTextNode(text));
@@ -806,17 +836,17 @@ this.appendChild(document.createTextNode(text));
configurable: true
},
innerHTML: {
-get: function() {
+get: function () {
if (this.node.nodeType === Node.TEXT_NODE) {
return null;
} else {
return getInnerHTML(this.node);
}
},
-set: function(text) {
+set: function (text) {
if (this.node.nodeType !== Node.TEXT_NODE) {
this._clear();
-var d = document.createElement("div");
+var d = document.createElement('div');
d.innerHTML = text;
for (var e = d.firstChild; e; e = e.nextSibling) {
this.appendChild(e);
@@ -826,14 +856,14 @@ this.appendChild(e);
configurable: true
}
});
-DomApi.prototype._getComposedInnerHTML = function() {
+DomApi.prototype._getComposedInnerHTML = function () {
return getInnerHTML(this.node, true);
};
} else {
-DomApi.prototype.querySelectorAll = function(selector) {
+DomApi.prototype.querySelectorAll = function (selector) {
return Array.prototype.slice.call(this.node.querySelectorAll(selector));
};
-DomApi.prototype.getOwnerRoot = function() {
+DomApi.prototype.getOwnerRoot = function () {
var n = this.node;
while (n) {
if (n.nodeType === Node.DOCUMENT_FRAGMENT_NODE && n.host) {
@@ -842,66 +872,77 @@ return n;
n = n.parentNode;
}
};
-DomApi.prototype.getDestinationInsertionPoints = function() {
+DomApi.prototype.getDestinationInsertionPoints = function () {
var n$ = this.node.getDestinationInsertionPoints();
return n$ ? Array.prototype.slice.call(n$) : [];
};
-DomApi.prototype.getDistributedNodes = function() {
+DomApi.prototype.getDistributedNodes = function () {
var n$ = this.node.getDistributedNodes();
return n$ ? Array.prototype.slice.call(n$) : [];
};
-DomApi.prototype._distributeParent = function() {};
+DomApi.prototype._distributeParent = function () {
+};
Object.defineProperties(DomApi.prototype, {
childNodes: {
-get: function() {
+get: function () {
return Array.prototype.slice.call(this.node.childNodes);
},
configurable: true
},
children: {
-get: function() {
+get: function () {
return Array.prototype.slice.call(this.node.children);
},
configurable: true
},
textContent: {
-get: function() {
+get: function () {
return this.node.textContent;
},
-set: function(value) {
+set: function (value) {
return this.node.textContent = value;
},
configurable: true
},
innerHTML: {
-get: function() {
+get: function () {
return this.node.innerHTML;
},
-set: function(value) {
+set: function (value) {
return this.node.innerHTML = value;
},
configurable: true
}
});
-var forwards = [ "parentNode", "firstChild", "lastChild", "nextSibling", "previousSibling", "firstElementChild", "lastElementChild", "nextElementSibling", "previousElementSibling" ];
-forwards.forEach(function(name) {
+var forwards = [
+'parentNode',
+'firstChild',
+'lastChild',
+'nextSibling',
+'previousSibling',
+'firstElementChild',
+'lastElementChild',
+'nextElementSibling',
+'previousElementSibling'
+];
+forwards.forEach(function (name) {
Object.defineProperty(DomApi.prototype, name, {
-get: function() {
+get: function () {
return this.node[name];
},
configurable: true
});
});
}
-var CONTENT = "content";
-var factory = function(node, patch) {
+var CONTENT = 'content';
+var factory = function (node, patch) {
node = node || document;
if (!node.__domApi) {
node.__domApi = new DomApi(node, patch);
}
return node.__domApi;
};
-Polymer.dom = function(obj, patch) {
+Polymer.dom = function (obj, patch) {
if (obj instanceof Event) {
return Polymer.EventApi.factory(obj);
} else {
@@ -924,7 +965,7 @@ var children = getComposedChildren(parent);
var i = ref_node ? children.indexOf(ref_node) : -1;
if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
var fragChildren = getComposedChildren(node);
-fragChildren.forEach(function(c) {
+fragChildren.forEach(function (c) {
addNodeToComposedChildren(c, parent, children, i);
});
} else {
@@ -974,21 +1015,20 @@ ctor: DomApi,
factory: factory
};
}();
-
-(function() {
+(function () {
Polymer.Base._addFeature({
-_prepShady: function() {
+_prepShady: function () {
this._useContent = this._useContent || Boolean(this._template);
if (this._useContent) {
-this._template._hasInsertionPoint = this._template.content.querySelector("content");
+this._template._hasInsertionPoint = this._template.content.querySelector('content');
}
},
-_poolContent: function() {
+_poolContent: function () {
if (this._useContent) {
saveLightChildrenIfNeeded(this);
}
},
-_setupRoot: function() {
+_setupRoot: function () {
if (this._useContent) {
this._createLocalRoot();
if (!this.dataHost) {
@@ -996,12 +1036,12 @@ upgradeLightChildren(this._lightChildren);
}
}
},
-_createLocalRoot: function() {
+_createLocalRoot: function () {
this.shadyRoot = this.root;
this.shadyRoot._distributionClean = false;
this.shadyRoot._isShadyRoot = true;
this.shadyRoot._dirtyRoots = [];
-this.shadyRoot._insertionPoints = this._template._hasInsertionPoint ? this.shadyRoot.querySelectorAll("content") : [];
+this.shadyRoot._insertionPoints = this._template._hasInsertionPoint ? this.shadyRoot.querySelectorAll('content') : [];
saveLightChildrenIfNeeded(this.shadyRoot);
this.shadyRoot.host = this;
},
@@ -1009,39 +1049,39 @@ get domHost() {
var root = Polymer.dom(this).getOwnerRoot();
return root && root.host;
},
-distributeContent: function() {
+distributeContent: function () {
if (this.shadyRoot) {
var host = getTopDistributingHost(this);
Polymer.dom(this)._lazyDistribute(host);
}
},
-_distributeContent: function() {
+_distributeContent: function () {
if (this._useContent && !this.shadyRoot._distributionClean) {
this._beginDistribute();
this._distributeDirtyRoots();
this._finishDistribute();
}
},
-_beginDistribute: function() {
+_beginDistribute: function () {
if (this._useContent && hasInsertionPoint(this.shadyRoot)) {
this._resetDistribution();
this._distributePool(this.shadyRoot, this._collectPool());
}
},
-_distributeDirtyRoots: function() {
+_distributeDirtyRoots: function () {
var c$ = this.shadyRoot._dirtyRoots;
for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) {
c._distributeContent();
}
this.shadyRoot._dirtyRoots = [];
},
-_finishDistribute: function() {
+_finishDistribute: function () {
if (this._useContent) {
if (hasInsertionPoint(this.shadyRoot)) {
this._composeTree();
} else {
if (!this.shadyRoot._hasDistributed) {
-this.textContent = "";
+this.textContent = '';
this.appendChild(this.shadyRoot);
} else {
var children = this._composeNode(this);
@@ -1052,11 +1092,11 @@ this.shadyRoot._hasDistributed = true;
this.shadyRoot._distributionClean = true;
}
},
-elementMatches: function(selector, node) {
+elementMatches: function (selector, node) {
node = node || this;
return matchesSelector.call(node, selector);
},
-_resetDistribution: function() {
+_resetDistribution: function () {
var children = getLightChildren(this);
for (var i = 0; i < children.length; i++) {
var child = children[i];
@@ -1073,7 +1113,7 @@ for (var j = 0; j < p$.length; j++) {
p$[j]._distributedNodes = [];
}
},
-_collectPool: function() {
+_collectPool: function () {
var pool = [];
var children = getLightChildren(this);
for (var i = 0; i < children.length; i++) {
@@ -1086,14 +1126,14 @@ pool.push(child);
}
return pool;
},
-_distributePool: function(node, pool) {
+_distributePool: function (node, pool) {
var p$ = node._insertionPoints;
for (var i = 0, l = p$.length, p; i < l && (p = p$[i]); i++) {
this._distributeInsertionPoint(p, pool);
maybeRedistributeParent(p, this);
}
},
-_distributeInsertionPoint: function(content, pool) {
+_distributeInsertionPoint: function (content, pool) {
var anyDistributed = false;
for (var i = 0, l = pool.length, node; i < l; i++) {
node = pool[i];
@@ -1113,7 +1153,7 @@ distributeNodeInto(children[j], content);
}
}
},
-_composeTree: function() {
+_composeTree: function () {
this._updateChildNodes(this, this._composeNode(this));
var p$ = this.shadyRoot._insertionPoints;
for (var i = 0, l = p$.length, p, parent; i < l && (p = p$[i]); i++) {
@@ -1123,7 +1163,7 @@ this._updateChildNodes(parent, this._composeNode(parent));
}
}
},
-_composeNode: function(node) {
+_composeNode: function (node) {
var children = [];
var c$ = getLightChildren(node.shadyRoot || node);
for (var i = 0; i < c$.length; i++) {
@@ -1142,7 +1182,7 @@ children.push(child);
}
return children;
},
-_updateChildNodes: function(container, children) {
+_updateChildNodes: function (container, children) {
var composed = getComposedChildren(container);
var splices = Polymer.ArraySplice.calculateSplices(children, composed);
for (var i = 0, d = 0, s; i < splices.length && (s = splices[i]); i++) {
@@ -1161,8 +1201,8 @@ composed.splice(j, 0, n);
}
}
},
-_matchesContentSelect: function(node, contentElement) {
-var select = contentElement.getAttribute("select");
+_matchesContentSelect: function (node, contentElement) {
+var select = contentElement.getAttribute('select');
if (!select) {
return true;
}
@@ -1179,8 +1219,10 @@ return false;
}
return this.elementMatches(select, node);
},
-_elementAdd: function() {},
-_elementRemove: function() {}
+_elementAdd: function () {
+},
+_elementRemove: function () {
+}
});
var saveLightChildrenIfNeeded = Polymer.DomApi.saveLightChildrenIfNeeded;
var getLightChildren = Polymer.DomApi.getLightChildren;
@@ -1192,7 +1234,7 @@ function distributeNodeInto(child, insertionPoint) {
insertionPoint._distributedNodes.push(child);
var points = child._destinationInsertionPoints;
if (!points) {
-child._destinationInsertionPoints = [ insertionPoint ];
+child._destinationInsertionPoints = [insertionPoint];
} else {
points.push(insertionPoint);
}
@@ -1218,7 +1260,7 @@ var points = node._destinationInsertionPoints;
return points && points[points.length - 1] === insertionPoint;
}
function isInsertionPoint(node) {
-return node.localName == "content";
+return node.localName == 'content';
}
var nativeInsertBefore = Element.prototype.insertBefore;
var nativeRemoveChild = Element.prototype.removeChild;
@@ -1253,7 +1295,7 @@ function hostNeedsRedistribution(host) {
var c$ = Polymer.dom(host).children;
for (var i = 0, c; i < c$.length; i++) {
c = c$[i];
-if (c.localName === "content") {
+if (c.localName === 'content') {
return host.domHost;
}
}
@@ -1266,27 +1308,29 @@ CustomElements.upgrade(children[i]);
}
}
}
-})();
-
+}());
if (Polymer.Settings.useShadow) {
Polymer.Base._addFeature({
-_poolContent: function() {},
-_beginDistribute: function() {},
-distributeContent: function() {},
-_distributeContent: function() {},
-_finishDistribute: function() {},
-_createLocalRoot: function() {
+_poolContent: function () {
+},
+_beginDistribute: function () {
+},
+distributeContent: function () {
+},
+_distributeContent: function () {
+},
+_finishDistribute: function () {
+},
+_createLocalRoot: function () {
this.createShadowRoot();
this.shadowRoot.appendChild(this.root);
this.root = this.shadowRoot;
}
});
}
-
-Polymer.DomModule = document.createElement("dom-module");
-
+Polymer.DomModule = document.createElement('dom-module');
Polymer.Base._addFeature({
-_registerFeatures: function() {
+_registerFeatures: function () {
this._prepIs();
this._prepAttributes();
this._prepBehaviors();
@@ -1295,10 +1339,10 @@ this._prepConstructor();
this._prepTemplate();
this._prepShady();
},
-_prepBehavior: function(b) {
+_prepBehavior: function (b) {
this._addHostAttributes(b.hostAttributes);
},
-_initFeatures: function() {
+_initFeatures: function () {
this._poolContent();
this._pushHost();
this._stampTemplate();
@@ -1308,5 +1352,6 @@ this._setupDebouncers();
this._marshalBehaviors();
this._tryReady();
},
-_marshalBehavior: function(b) {}
+_marshalBehavior: function (b) {
+}
}); \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/.bower.json b/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/.bower.json
index 7a68cd2..1273560 100644
--- a/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-a11y-keys-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A behavior that enables keybindings for greater a11y.",
"keywords": [
"web-components",
@@ -18,6 +18,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
@@ -25,11 +26,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior",
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "443f7fc3947aa1d2bb4817588da4bb67fcbbc09d"
+ "tag": "v1.0.2",
+ "commit": "f65766278e9943649e70ff8ab01a848ccf068b01"
},
"_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/bower.json b/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/bower.json
index 87e2f64..cbf6871 100644
--- a/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/bower.json
+++ b/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-a11y-keys-behavior",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "A behavior that enables keybindings for greater a11y.",
"keywords": [
"web-components",
@@ -18,6 +18,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html b/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html
index ba571b6..47b7ee6 100644
--- a/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html
+++ b/third_party/polymer/v1_0/components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html
@@ -240,6 +240,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* The `keys-pressed` event will fire when one of the key combinations set with the
* `keys` property is pressed.
*
+ * @demo demo/index.html
* @polymerBehavior IronA11yKeysBehavior
*/
Polymer.IronA11yKeysBehavior = {
@@ -255,6 +256,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
_boundKeyHandlers: {
+ type: Array,
value: function() {
return [];
}
@@ -263,6 +265,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// We use this due to a limitation in IE10 where instances will have
// own properties of everything on the "prototype".
_imperativeKeyBindings: {
+ type: Object,
value: function() {
return {};
}
diff --git a/third_party/polymer/v1_0/components/iron-a11y-keys/.bower.json b/third_party/polymer/v1_0/components/iron-a11y-keys/.bower.json
index 7eb99e5..cb2b091 100644
--- a/third_party/polymer/v1_0/components/iron-a11y-keys/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-a11y-keys/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-a11y-keys",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A basic element implementation of iron-a11y-keys-behavior, matching the legacy core-a11y-keys.",
"keywords": [
"web-components",
@@ -19,6 +19,7 @@
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
@@ -26,11 +27,11 @@
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0"
},
"homepage": "https://github.com/PolymerElements/iron-a11y-keys",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "11963b0e817ed910f5d13d1d68f4abac62c1a8f3"
+ "tag": "v1.0.1",
+ "commit": "9ba9b2bb3a328c6b88ebabb436dc96402dc0e455"
},
"_source": "git://github.com/PolymerElements/iron-a11y-keys.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-a11y-keys/bower.json b/third_party/polymer/v1_0/components/iron-a11y-keys/bower.json
index 7776b7d..c3bb104 100644
--- a/third_party/polymer/v1_0/components/iron-a11y-keys/bower.json
+++ b/third_party/polymer/v1_0/components/iron-a11y-keys/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-a11y-keys",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A basic element implementation of iron-a11y-keys-behavior, matching the legacy core-a11y-keys.",
"keywords": [
"web-components",
@@ -19,6 +19,7 @@
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
diff --git a/third_party/polymer/v1_0/components/iron-a11y-keys/iron-a11y-keys.html b/third_party/polymer/v1_0/components/iron-a11y-keys/iron-a11y-keys.html
index f937e87..b60a090 100644
--- a/third_party/polymer/v1_0/components/iron-a11y-keys/iron-a11y-keys.html
+++ b/third_party/polymer/v1_0/components/iron-a11y-keys/iron-a11y-keys.html
@@ -87,6 +87,7 @@ Keys Syntax Grammar:
],
properties: {
+ /** @type {?Node} */
target: {
type: Object,
observer: '_targetChanged'
diff --git a/third_party/polymer/v1_0/components/iron-ajax/.bower.json b/third_party/polymer/v1_0/components/iron-ajax/.bower.json
index b2da472..58b4721 100644
--- a/third_party/polymer/v1_0/components/iron-ajax/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-ajax/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-ajax",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Makes it easy to make ajax calls and parse the response",
"private": true,
"authors": [
@@ -35,11 +35,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "97cc0c5e407ccde33f385ffbf9e6b6c706e63977"
+ "tag": "v1.0.2",
+ "commit": "6ed75a4425b709e6825cd4970e800b053ff8ffd8"
},
"_source": "git://github.com/PolymerElements/iron-ajax.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-ajax/bower.json b/third_party/polymer/v1_0/components/iron-ajax/bower.json
index 33b3614..46ae576 100644
--- a/third_party/polymer/v1_0/components/iron-ajax/bower.json
+++ b/third_party/polymer/v1_0/components/iron-ajax/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-ajax",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Makes it easy to make ajax calls and parse the response",
"private": true,
"authors": [
diff --git a/third_party/polymer/v1_0/components/iron-ajax/iron-ajax.html b/third_party/polymer/v1_0/components/iron-ajax/iron-ajax.html
index 47d202b..8137dc8 100644
--- a/third_party/polymer/v1_0/components/iron-ajax/iron-ajax.html
+++ b/third_party/polymer/v1_0/components/iron-ajax/iron-ajax.html
@@ -30,6 +30,8 @@ Note: The `params` attribute must be double quoted JSON.
You can trigger a request explicitly by calling `generateRequest` on the
element.
+
+@demo demo/index.html
-->
<script>
@@ -67,7 +69,9 @@ element.
/**
* An object that contains query parameters to be appended to the
- * specified `url` when generating a request.
+ * specified `url` when generating a request. If you wish to set the body
+ * content when making a POST request, you should use the `body` property
+ * instead.
*/
params: {
type: Object,
@@ -96,6 +100,9 @@ element.
* headers='{"X-Requested-With": "XMLHttpRequest"}'
* handle-as="json"
* last-response-changed="{{handleResponse}}"></iron-ajax>
+ *
+ * Note: setting a `Content-Type` header here will override the value
+ * specified by the `contentType` property of this element.
*/
headers: {
type: Object,
@@ -105,9 +112,9 @@ element.
},
/**
- * Content type to use when sending data. If the contenttype is set
- * and a `Content-Type` header is specified in the `headers` attribute,
- * the `headers` attribute value will take precedence.
+ * Content type to use when sending data. If the `contentType` property
+ * is set and a `Content-Type` header is specified in the `headers`
+ * property, the `headers` property value will take precedence.
*/
contentType: {
type: String,
@@ -207,7 +214,7 @@ element.
/**
* Will be set to the most recent response received by a request
* that originated from this iron-ajax element. The type of the response
- * is determined by the value of `handleas` at the time that the request
+ * is determined by the value of `handleAs` at the time that the request
* was generated.
*/
lastResponse: {
@@ -235,7 +242,7 @@ element.
notify: true,
readOnly: true,
value: function() {
- this._setActiveRequests([]);
+ return [];
}
},
@@ -251,23 +258,22 @@ element.
_boundHandleResponse: {
type: Function,
value: function() {
- return this.handleResponse.bind(this);
- }
- },
-
- _boundDiscardRequest: {
- type: Function,
- value: function() {
- return this.discardRequest.bind(this);
+ return this._handleResponse.bind(this);
}
}
},
observers: [
- 'requestOptionsChanged(url, method, params, headers,' +
+ '_requestOptionsChanged(url, method, params, headers,' +
'contentType, body, sync, handleAs, withCredentials, auto)'
],
+ /**
+ * The query string that should be appended to the `url`, serialized from
+ * the current value of `params`.
+ *
+ * @return {string}
+ */
get queryString () {
var queryParts = [];
var param;
@@ -287,6 +293,12 @@ element.
return queryParts.join('&');
},
+ /**
+ * The `url` with query string (if `params` are specified), suitable for
+ * providing to an `iron-request` instance.
+ *
+ * @return {string}
+ */
get requestUrl() {
var queryString = this.queryString;
@@ -297,9 +309,16 @@ element.
return this.url;
},
+ /**
+ * An object that maps header names to header values, first applying the
+ * the value of `Content-Type` and then overlaying the headers specified
+ * in the `headers` property.
+ *
+ * @return {Object}
+ */
get requestHeaders() {
var headers = {
- 'content-type': this.contentType
+ 'Content-Type': this.contentType
};
var header;
@@ -312,6 +331,19 @@ element.
return headers;
},
+ /**
+ * Request options suitable for generating an `iron-request` instance based
+ * on the current state of the `iron-ajax` instance's properties.
+ *
+ * @return {{
+ * url: string,
+ * method: (string|undefined),
+ * async: (boolean|undefined),
+ * body: (ArrayBuffer|ArrayBufferView|Blob|Document|FormData|null|string|undefined),
+ * headers: (Object|undefined),
+ * handleAs: (string|undefined),
+ * withCredentials: (boolean|undefined)}}
+ */
toRequestOptions: function() {
return {
url: this.requestUrl,
@@ -324,25 +356,13 @@ element.
};
},
- requestOptionsChanged: function() {
- this.debounce('generate-request', function() {
- if (!this.url && this.url !== '') {
- return;
- }
-
- if (this.auto) {
- this.generateRequest();
- }
- }, this.debounceDuration);
- },
-
/**
* Performs an AJAX request to the specified URL.
*
- * @method generateRequest
+ * @return {!IronRequestElement}
*/
generateRequest: function() {
- var request = document.createElement('iron-request');
+ var request = /** @type {!IronRequestElement} */ (document.createElement('iron-request'));
var requestOptions = this.toRequestOptions();
this.activeRequests.push(request);
@@ -350,14 +370,15 @@ element.
request.completes.then(
this._boundHandleResponse
).catch(
- this.handleError.bind(this, request)
+ this._handleError.bind(this, request)
).then(
- this._boundDiscardRequest
+ this._discardRequest.bind(this, request)
);
request.send(requestOptions);
this._setLastRequest(request);
+ this._setLoading(true);
this.fire('request', {
request: request,
@@ -367,12 +388,12 @@ element.
return request;
},
- handleResponse: function(request) {
+ _handleResponse: function(request) {
this._setLastResponse(request.response);
this.fire('response', request);
},
- handleError: function(request, error) {
+ _handleError: function(request, error) {
if (this.verbose) {
console.error(error);
}
@@ -387,12 +408,29 @@ element.
});
},
- discardRequest: function(request) {
+ _discardRequest: function(request) {
var requestIndex = this.activeRequests.indexOf(request);
- if (requestIndex > 0) {
+ if (requestIndex > -1) {
this.activeRequests.splice(requestIndex, 1);
}
- }
+
+ if (this.activeRequests.length === 0) {
+ this._setLoading(false);
+ }
+ },
+
+ _requestOptionsChanged: function() {
+ this.debounce('generate-request', function() {
+ if (!this.url && this.url !== '') {
+ return;
+ }
+
+ if (this.auto) {
+ this.generateRequest();
+ }
+ }, this.debounceDuration);
+ },
+
});
</script>
diff --git a/third_party/polymer/v1_0/components/iron-ajax/iron-request.html b/third_party/polymer/v1_0/components/iron-ajax/iron-request.html
index d1737ca..22c0511 100644
--- a/third_party/polymer/v1_0/components/iron-ajax/iron-request.html
+++ b/third_party/polymer/v1_0/components/iron-ajax/iron-request.html
@@ -11,17 +11,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../promise-polyfill/promise-polyfill-lite.html">
<!--
-@group Iron Elements
-
iron-request can be used to perform XMLHttpRequests.
<iron-request id="xhr"></iron-request>
...
this.$.xhr.send({url: url, params: params});
-
-@element iron-request
-->
-
<script>
Polymer({
is: 'iron-request',
@@ -50,7 +45,7 @@ iron-request can be used to perform XMLHttpRequests.
* resolved.
*
* @attribute response
- * @type Object
+ * @type {*}
* @default null
*/
response: {
@@ -120,7 +115,7 @@ iron-request can be used to perform XMLHttpRequests.
* the status code 0 is accepted as a success even though the outcome may
* be ambiguous.
*
- * @return boolean
+ * @return {boolean}
*/
get succeeded() {
var status = this.xhr.status || 0;
@@ -134,7 +129,6 @@ iron-request can be used to perform XMLHttpRequests.
/**
* Sends an HTTP request to the server and returns the XHR object.
*
- * @method request
* @param {{
* url: string,
* method: (string|undefined),
@@ -151,13 +145,13 @@ iron-request can be used to perform XMLHttpRequests.
* headers HTTP request headers.
* handleAs The response type. Default is 'text'.
* withCredentials Whether or not to send credentials on the request. Default is false.
- * @return Promise
+ * @return {Promise}
*/
send: function (options) {
var xhr = this.xhr;
if (xhr.readyState > 0) {
- return;
+ return null;
}
xhr.addEventListener('readystatechange', function () {
@@ -214,6 +208,14 @@ iron-request can be used to perform XMLHttpRequests.
return this.completes;
},
+ /**
+ * Attempts to parse the response body of the XHR. If parsing succeeds,
+ * the value returned will be deserialized based on the `responseType`
+ * set on the XHR.
+ *
+ * @return {*} The parsed response,
+ * or undefined if there was an empty response or parsing failed.
+ */
parseResponse: function () {
var xhr = this.xhr;
var responseType = this.xhr.responseType ||
@@ -258,6 +260,9 @@ iron-request can be used to perform XMLHttpRequests.
}
},
+ /**
+ * Aborts the request.
+ */
abort: function () {
this._setAborted(true);
this.xhr.abort();
diff --git a/third_party/polymer/v1_0/components/iron-autogrow-textarea/.bower.json b/third_party/polymer/v1_0/components/iron-autogrow-textarea/.bower.json
index dcec326..6601ce9 100644
--- a/third_party/polymer/v1_0/components/iron-autogrow-textarea/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-autogrow-textarea/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"
@@ -34,11 +34,11 @@
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "ae96e84193694882ff4112566bf365e495b6263f"
+ "tag": "v1.0.1",
+ "commit": "e2bd6f5e964d032beccacabbccb63f93c73f74c0"
},
"_source": "git://github.com/PolymerElements/iron-autogrow-textarea.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-autogrow-textarea/bower.json b/third_party/polymer/v1_0/components/iron-autogrow-textarea/bower.json
index 39d4fd2..bcb7ff0 100644
--- a/third_party/polymer/v1_0/components/iron-autogrow-textarea/bower.json
+++ b/third_party/polymer/v1_0/components/iron-autogrow-textarea/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-autogrow-textarea",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A textarea element that automatically grows with input",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/iron-autogrow-textarea/iron-autogrow-textarea.html b/third_party/polymer/v1_0/components/iron-autogrow-textarea/iron-autogrow-textarea.html
index 6a21146..376177d 100644
--- a/third_party/polymer/v1_0/components/iron-autogrow-textarea/iron-autogrow-textarea.html
+++ b/third_party/polymer/v1_0/components/iron-autogrow-textarea/iron-autogrow-textarea.html
@@ -73,7 +73,16 @@ this element's `bind-value` instead for imperative updates.
<!-- size the input/textarea with a div, because the textarea has intrinsic size in ff -->
<div class="textarea-container fit">
- <textarea id="textarea" required$="[[required]]" rows$="[[rows]]" maxlength$="[[maxlength]]"></textarea>
+ <textarea id="textarea"
+ autocomplete$="[[autocomplete]]"
+ autofocus$="[[autofocus]]"
+ inputmode$="[[inputmode]]"
+ name$="[[name]]"
+ placeholder$="[[placeholder]]"
+ readonly$="[[readonly]]"
+ required$="[[required]]"
+ rows$="[[rows]]"
+ maxlength$="[[maxlength]]"></textarea>
</div>
</template>
@@ -125,6 +134,50 @@ this element's `bind-value` instead for imperative updates.
},
/**
+ * Bound to the textarea's `autocomplete` attribute.
+ */
+ autocomplete: {
+ type: String,
+ value: 'off'
+ },
+
+ /**
+ * Bound to the textarea's `autofocus` attribute.
+ */
+ autofocus: {
+ type: String,
+ value: 'off'
+ },
+
+ /**
+ * Bound to the textarea's `inputmode` attribute.
+ */
+ inputmode: {
+ type: String
+ },
+
+ /**
+ * Bound to the textarea's `name` attribute.
+ */
+ name: {
+ type: String
+ },
+
+ /**
+ * Bound to the textarea's `placeholder` attribute.
+ */
+ placeholder: {
+ type: String
+ },
+
+ /**
+ * Bound to the textarea's `readonly` attribute.
+ */
+ readonly: {
+ type: String
+ },
+
+ /**
* Set to true to mark the textarea as required.
*/
required: {
diff --git a/third_party/polymer/v1_0/components/iron-behaviors/.bower.json b/third_party/polymer/v1_0/components/iron-behaviors/.bower.json
index 2b621455..17a4dda 100644
--- a/third_party/polymer/v1_0/components/iron-behaviors/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-behaviors/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [
@@ -16,6 +16,7 @@
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
@@ -23,11 +24,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-behaviors",
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "03284936c45f058a8192752869a57a0a57a2963f"
+ "tag": "v1.0.3",
+ "commit": "a8e8245c60d65712e2f0ac727f1ce3529dcf395d"
},
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-behaviors/bower.json b/third_party/polymer/v1_0/components/iron-behaviors/bower.json
index c3c6a73..9f55d07 100644
--- a/third_party/polymer/v1_0/components/iron-behaviors/bower.json
+++ b/third_party/polymer/v1_0/components/iron-behaviors/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-behaviors",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "Provides a set of behaviors for the iron elements",
"private": true,
"authors": [
@@ -16,6 +16,7 @@
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-behaviors/iron-button-state.html b/third_party/polymer/v1_0/components/iron-behaviors/iron-button-state.html
index bc7249a..9c666c6 100644
--- a/third_party/polymer/v1_0/components/iron-behaviors/iron-button-state.html
+++ b/third_party/polymer/v1_0/components/iron-behaviors/iron-button-state.html
@@ -14,17 +14,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
- /** @polymerBehavior Polymer.IronButtonState */
+ /**
+ * @demo demo/index.html
+ * @polymerBehavior
+ */
Polymer.IronButtonStateImpl = {
properties: {
/**
* If true, the user is currently holding down the button.
- *
- * @attribute pressed
- * @type boolean
- * @default false
*/
pressed: {
type: Boolean,
@@ -37,10 +36,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* If true, the button toggles the active state with each tap or press
* of the spacebar.
- *
- * @attribute toggles
- * @type boolean
- * @default false
*/
toggles: {
type: Boolean,
@@ -50,10 +45,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* If true, the button is a toggle and is currently in the active state.
- *
- * @attribute active
- * @type boolean
- * @default false
*/
active: {
type: Boolean,
diff --git a/third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html b/third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html
index f2efb7c..33e42ea 100644
--- a/third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html
+++ b/third_party/polymer/v1_0/components/iron-behaviors/iron-control-state.html
@@ -12,18 +12,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
- /** @polymerBehavior */
-
+ /**
+ * @demo demo/index.html
+ * @polymerBehavior
+ */
Polymer.IronControlState = {
properties: {
/**
* If true, the element currently has focus.
- *
- * @attribute focused
- * @type boolean
- * @default false
*/
focused: {
type: Boolean,
@@ -35,10 +33,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* If true, the user cannot interact with this element.
- *
- * @attribute disabled
- * @type boolean
- * @default false
*/
disabled: {
type: Boolean,
@@ -50,32 +44,44 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
_oldTabIndex: {
type: Number
+ },
+
+ _boundFocusBlurHandler: {
+ type: Function,
+ value: function() {
+ return this._focusBlurHandler.bind(this);
+ }
}
+
},
observers: [
'_changedControlState(focused, disabled)'
],
- listeners: {
- focus: '_focusHandler',
- blur: '_blurHandler'
- },
-
ready: function() {
// TODO(sjmiles): ensure read-only property is valued so the compound
// observer will fire
if (this.focused === undefined) {
this._setFocused(false);
}
+ this.addEventListener('focus', this._boundFocusBlurHandler, true);
+ this.addEventListener('blur', this._boundFocusBlurHandler, true);
},
- _focusHandler: function() {
- this._setFocused(true);
- },
-
- _blurHandler: function() {
- this._setFocused(false);
+ _focusBlurHandler: function(event) {
+ var target = event.path ? event.path[0] : event.target;
+ if (target === this) {
+ var focused = event.type === 'focus';
+ this._setFocused(focused);
+ } else if (!this.shadowRoot) {
+ event.stopPropagation();
+ this.fire(event.type, {sourceEvent: event}, {
+ node: this,
+ bubbles: event.bubbles,
+ cancelable: event.cancelable
+ });
+ }
},
_disabledChanged: function(disabled, old) {
diff --git a/third_party/polymer/v1_0/components/iron-form/.bower.json b/third_party/polymer/v1_0/components/iron-form/.bower.json
index fad4679..f299181 100644
--- a/third_party/polymer/v1_0/components/iron-form/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-form/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-form",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Makes it easier to manage forms",
"keywords": [
"web-components",
@@ -35,11 +35,11 @@
"paper-button": "PolymerElements/paper-button#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "b884414ee5d9c9e1484554cd1e644e4cfa562153"
+ "tag": "v1.0.2",
+ "commit": "e84269ef9491bf06ac88b9e254ce99e8c1ebd8be"
},
"_source": "git://github.com/PolymerElements/iron-form.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-form/bower.json b/third_party/polymer/v1_0/components/iron-form/bower.json
index 8abd458..da25de5 100644
--- a/third_party/polymer/v1_0/components/iron-form/bower.json
+++ b/third_party/polymer/v1_0/components/iron-form/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-form",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Makes it easier to manage forms",
"keywords": [
"web-components",
diff --git a/third_party/polymer/v1_0/components/iron-form/iron-form.html b/third_party/polymer/v1_0/components/iron-form/iron-form.html
index 44b77ae..ec378c8 100644
--- a/third_party/polymer/v1_0/components/iron-form/iron-form.html
+++ b/third_party/polymer/v1_0/components/iron-form/iron-form.html
@@ -39,7 +39,7 @@ call the form's `submit` method.
function submitForm() {
document.getElementById('form').submit();
}
-
+
@demo demo/index.html
*/
@@ -50,6 +50,12 @@ call the form's `submit` method.
extends: 'form',
/**
+ * Fired if the form cannot be submitted because it's invalid.
+ *
+ * @event iron-form-invalid
+ */
+
+ /**
* Fired after the form is submitted.
*
* @event iron-form-submit
@@ -69,7 +75,7 @@ call the form's `submit` method.
listeners: {
'iron-form-element-register': '_registerElement',
- 'submit': 'submit'
+ 'submit': '_onSubmit'
},
ready: function() {
@@ -85,9 +91,14 @@ call the form's `submit` method.
/**
* Called to submit the form.
*/
- submit: function(event) {
- if (!this._validate()) {
- return false;
+ submit: function() {
+ if (!this.noValidate && !this._validate()) {
+
+ // In order to trigger the native browser invalid-form UI, we need
+ // to do perform a fake form submit.
+ this._doFakeSubmitForValidation();
+ this.fire('iron-form-invalid');
+ return;
}
var json = this.serialize();
@@ -102,6 +113,10 @@ call the form's `submit` method.
this._requestBot.generateRequest();
this.fire('iron-form-submit', json);
+ },
+
+ _onSubmit: function(event) {
+ this.submit();
// Don't perform a page refresh.
if (event) {
@@ -171,9 +186,25 @@ call the form's `submit` method.
_validate: function() {
var valid = true;
+
+ // Validate all the custom elements.
+ var validatable;
for (var el, i = 0; el = this._customElements[i], i < this._customElements.length; i++) {
- valid = el.validate() && valid;
+ if (el.required) {
+ validatable = /** @type {{validate: (function() : boolean)}} */ (el);
+ valid = validatable.validate() && valid;
+ }
}
+
+ // Validate the form's native elements.
+ for (var el, i = 0; el = this.elements[i], i < this.elements.length; i++) {
+ // Custom elements that extend a native element will also appear in
+ // this list, but they've already been validated.
+ if (!el.hasAttribute('is') && el.willValidate && el.checkValidity) {
+ valid = el.checkValidity() && valid;
+ }
+ }
+
return valid;
},
@@ -184,6 +215,17 @@ call the form's `submit` method.
} else {
return el.checked;
}
+ },
+
+ _doFakeSubmitForValidation: function() {
+ var fakeSubmit = document.createElement('input');
+ fakeSubmit.setAttribute('type', 'submit');
+ fakeSubmit.style.display = 'none';
+ this.appendChild(fakeSubmit);
+
+ fakeSubmit.click();
+
+ this.removeChild(fakeSubmit);
}
});
diff --git a/third_party/polymer/v1_0/components/iron-icon/.bower.json b/third_party/polymer/v1_0/components/iron-icon/.bower.json
index 4f44f2e8..8d82e66 100644
--- a/third_party/polymer/v1_0/components/iron-icon/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-icon/.bower.json
@@ -1,7 +1,7 @@
{
"name": "iron-icon",
"private": true,
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon",
"main": "iron-icon.html",
@@ -27,11 +27,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-icon",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "b6c36359baf7dff86cc4174012296555512ce0c1"
+ "tag": "v1.0.1",
+ "commit": "530b0156756487b4c352d67a9e636724d6a4fe5e"
},
"_source": "git://github.com/PolymerElements/iron-icon.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-icon/bower.json b/third_party/polymer/v1_0/components/iron-icon/bower.json
index e5ebedb..8052729 100644
--- a/third_party/polymer/v1_0/components/iron-icon/bower.json
+++ b/third_party/polymer/v1_0/components/iron-icon/bower.json
@@ -1,7 +1,7 @@
{
"name": "iron-icon",
"private": true,
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An element that supports displaying an icon",
"main": "iron-icon.html",
diff --git a/third_party/polymer/v1_0/components/iron-icon/iron-icon.html b/third_party/polymer/v1_0/components/iron-icon/iron-icon.html
index ea9778a..bdb55c7 100644
--- a/third_party/polymer/v1_0/components/iron-icon/iron-icon.html
+++ b/third_party/polymer/v1_0/components/iron-icon/iron-icon.html
@@ -24,10 +24,10 @@ Example setting size to 32px x 32px:
<iron-icon class="big" src="big_star.png"></iron-icon>
- <style>
+ <style is="custom-style">
.big {
- height: 32px;
- width: 32px;
+ --iron-icon-height: 32px;
+ --iron-icon-width: 32px;
}
</style>
@@ -56,7 +56,7 @@ Example of using an icon named `cherry` from a custom iconset with the ID `fruit
See [iron-iconset](#iron-iconset) and [iron-iconset-svg](#iron-iconset-svg) for more information about
how to create a custom iconset.
-See [iron-icons](http://www.polymer-project.org/components/iron-icons/demo.html) for the default set of icons.
+See [iron-icons](https://elements.polymer-project.org/elements/iron-icons?view=demo:demo/index.html) for the default set of icons.
### Styling
@@ -75,13 +75,6 @@ Custom property | Description | Default
@homepage polymer.github.io
-->
-<style is="custom-style">
- :root {
- --iron-icon-width: 24px;
- --iron-icon-height: 24px;
- }
-</style>
-
<dom-module id="iron-icon">
<style>
@@ -94,8 +87,8 @@ Custom property | Description | Default
fill: currentcolor;
- width: var(--iron-icon-width);
- height: var(--iron-icon-height);
+ width: var(--iron-icon-width, 24px);
+ height: var(--iron-icon-height, 24px);
}
</style>
@@ -184,4 +177,3 @@ Custom property | Description | Default
</script>
</dom-module>
-
diff --git a/third_party/polymer/v1_0/components/iron-icons/.bower.json b/third_party/polymer/v1_0/components/iron-icons/.bower.json
index f7e7900..573d083 100644
--- a/third_party/polymer/v1_0/components/iron-icons/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-icons/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-icons",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A set of icons for use with iron-icon",
"authors": [
"The Polymer Authors"
@@ -24,6 +24,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#1.0.0",
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
"iron-meta": "polymerelements/iron-meta#^1.0.0",
@@ -33,11 +34,11 @@
"util",
"update-icons.sh"
],
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "a1727591f312fe6cd2e065cab6490232716a646a"
+ "tag": "v1.0.2",
+ "commit": "7340b4e26a0235ffdf2477299ccecd0c5d3d99e8"
},
"_source": "git://github.com/PolymerElements/iron-icons.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-icons/bower.json b/third_party/polymer/v1_0/components/iron-icons/bower.json
index 1ba69fb..9ac5f25 100644
--- a/third_party/polymer/v1_0/components/iron-icons/bower.json
+++ b/third_party/polymer/v1_0/components/iron-icons/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-icons",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A set of icons for use with iron-icon",
"authors": [
"The Polymer Authors"
@@ -24,6 +24,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#1.0.0",
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
"iron-meta": "polymerelements/iron-meta#^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-icons/iron-icons.html b/third_party/polymer/v1_0/components/iron-icons/iron-icons.html
index c0cf1e9..922d4d8 100644
--- a/third_party/polymer/v1_0/components/iron-icons/iron-icons.html
+++ b/third_party/polymer/v1_0/components/iron-icons/iron-icons.html
@@ -7,7 +7,7 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<!--
-`iron-icons` is a utitliy import that includes the definition for the `iron-icon` element, `iron-iconset-svg` element, as well as an import for the default icon set.
+`iron-icons` is a utility import that includes the definition for the `iron-icon` element, `iron-iconset-svg` element, as well as an import for the default icon set.
The `iron-icons` directory also includes imports for additional icon sets that can be loaded into your project.
diff --git a/third_party/polymer/v1_0/components/iron-iconset-svg/.bower.json b/third_party/polymer/v1_0/components/iron-iconset-svg/.bower.json
index 33c74b8..dc56cd7 100644
--- a/third_party/polymer/v1_0/components/iron-iconset-svg/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-iconset-svg/.bower.json
@@ -1,7 +1,7 @@
{
"name": "iron-iconset-svg",
"description": "Manages a set of svg icons",
- "version": "1.0.1",
+ "version": "1.0.3",
"keywords": [
"web-components",
"polymer",
@@ -17,6 +17,7 @@
"iron-meta": "polymerelements/iron-meta#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
@@ -24,11 +25,11 @@
"web-component-tester": "*"
},
"homepage": "https://github.com/PolymerElements/iron-iconset-svg",
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "ce54b944d6f1f67a254ea9c99585e553eba76b6d"
+ "tag": "v1.0.3",
+ "commit": "d909fa093ce23da7aa3ce844c6b080848e0580f6"
},
"_source": "git://github.com/PolymerElements/iron-iconset-svg.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-iconset-svg/bower.json b/third_party/polymer/v1_0/components/iron-iconset-svg/bower.json
index 64e7d83..16c6dfb 100644
--- a/third_party/polymer/v1_0/components/iron-iconset-svg/bower.json
+++ b/third_party/polymer/v1_0/components/iron-iconset-svg/bower.json
@@ -1,7 +1,7 @@
{
"name": "iron-iconset-svg",
"description": "Manages a set of svg icons",
- "version": "1.0.1",
+ "version": "1.0.3",
"keywords": [
"web-components",
"polymer",
@@ -17,6 +17,7 @@
"iron-meta": "polymerelements/iron-meta#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"iron-icon": "polymerelements/iron-icon#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-iconset-svg/iron-iconset-svg.html b/third_party/polymer/v1_0/components/iron-iconset-svg/iron-iconset-svg.html
index 0c5977d..4852857 100644
--- a/third_party/polymer/v1_0/components/iron-iconset-svg/iron-iconset-svg.html
+++ b/third_party/polymer/v1_0/components/iron-iconset-svg/iron-iconset-svg.html
@@ -44,6 +44,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* iconset.applyIcon(iconNode, 'car');
*
* @element iron-iconset-svg
+ * @demo demo/index.html
*/
Polymer({
@@ -63,14 +64,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
- * Array of fully-qualitifed icon names in the iconset.
- */
- iconNames: {
- type: Array,
- notify: true
- },
-
- /**
* The size of an individual icon. Note that icons must be square.
*
* @attribute iconSize
@@ -85,6 +78,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
+ * Construct an array of all icon names in this iconset.
+ *
+ * @return {!Array} Array of icon names.
+ */
+ getIconNames: function() {
+ this._icons = this._createIconMap();
+ return Object.keys(this._icons).map(function(n) {
+ return this.name + ':' + n;
+ }, this);
+ },
+
+ /**
* Applies an icon to the given element.
*
* An svg icon is prepended to the element's shadowRoot if it exists,
@@ -126,32 +131,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
*
- * When name is changed, either register a new iconset with the included
- * icons, or if there are no children, set up a meta-iconset.
+ * When name is changed, register iconset metadata
*
*/
_nameChanged: function() {
new Polymer.IronMeta({type: 'iconset', key: this.name, value: this});
- // icons (descendents) must exist a-priori
- this._icons = this._createIconMap();
- this.iconNames = this._getIconNames();
- },
-
- /**
- * Array of all icon names in this iconset.
- *
- * @return {!Array} Array of icon names.
- */
- _getIconNames: function() {
- return Object.keys(this._icons).map(function(n) {
- return this.name + ':' + n;
- }, this);
},
/**
* Create a map of child SVG elements by id.
*
- * @return {Object} Map of id's to SVG elements.
+ * @return {!Object} Map of id's to SVG elements.
*/
_createIconMap: function() {
// Objects chained to Object.prototype (`{}`) have members. Specifically,
@@ -173,6 +163,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* matching `id`.
*/
_cloneIcon: function(id) {
+ // create the icon map on-demand, since the iconset itself has no discrete
+ // signal to know when it's children are fully parsed
+ this._icons = this._icons || this._createIconMap();
return this._prepareSvgClone(this._icons[id], this.size);
},
diff --git a/third_party/polymer/v1_0/components/iron-iconset/.bower.json b/third_party/polymer/v1_0/components/iron-iconset/.bower.json
index e4ecbfa..75ea9f6 100644
--- a/third_party/polymer/v1_0/components/iron-iconset/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-iconset/.bower.json
@@ -1,11 +1,16 @@
{
"name": "iron-iconset",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Represents a set of icons",
"authors": [
"The Polymer Authors"
],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
"private": true,
"dependencies": {
"iron-meta": "PolymerElements/iron-meta#^1.0.0",
@@ -19,11 +24,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-iconset",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "3ce6be6b689dd8e309410b0c30d7be23a493a880"
+ "tag": "v1.0.1",
+ "commit": "d13a943588e6d200b6140adeb8ee2981dd9b5f04"
},
"_source": "git://github.com/PolymerElements/iron-iconset.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-iconset/bower.json b/third_party/polymer/v1_0/components/iron-iconset/bower.json
index 8766bf3..135633f 100644
--- a/third_party/polymer/v1_0/components/iron-iconset/bower.json
+++ b/third_party/polymer/v1_0/components/iron-iconset/bower.json
@@ -1,11 +1,16 @@
{
"name": "iron-iconset",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Represents a set of icons",
"authors": [
"The Polymer Authors"
],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "icon"
+ ],
"private": true,
"dependencies": {
"iron-meta": "PolymerElements/iron-meta#^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-iconset/iron-iconset.html b/third_party/polymer/v1_0/components/iron-iconset/iron-iconset.html
index 1fbc628..fc21d99 100644
--- a/third_party/polymer/v1_0/components/iron-iconset/iron-iconset.html
+++ b/third_party/polymer/v1_0/components/iron-iconset/iron-iconset.html
@@ -54,6 +54,7 @@ Then a themed icon can be applied like this:
iconset.applyIcon(iconNode, 'car', 'special');
@element iron-iconset
+@demo demo/index.html
-->
<script>
@@ -184,7 +185,6 @@ Then a themed icon can be applied like this:
* @param {String|Number} icon The name or index of the icon to apply.
* @param {String} theme (optional) The name or index of the icon to apply.
* @param {Number} scale (optional, defaults to 1) Icon scaling factor.
- * @return {Element} The applied icon element.
*/
applyIcon: function(element, icon, theme, scale) {
this._validateIconMap();
diff --git a/third_party/polymer/v1_0/components/iron-image/.bower.json b/third_party/polymer/v1_0/components/iron-image/.bower.json
index 3e2ce06..18d5ff0 100644
--- a/third_party/polymer/v1_0/components/iron-image/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-image/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-image",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An image-displaying element with lots of convenient features",
"private": true,
@@ -17,17 +17,18 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.4",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-image",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "b2a3ef4c558b91a3f9a897f2d0b4c961a220a325"
+ "tag": "v1.0.1",
+ "commit": "54aa387756c16ba09620e1b36ae4ee2d7fd274c6"
},
"_source": "git://github.com/PolymerElements/iron-image.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-image/bower.json b/third_party/polymer/v1_0/components/iron-image/bower.json
index 6e1d418..129e130 100644
--- a/third_party/polymer/v1_0/components/iron-image/bower.json
+++ b/third_party/polymer/v1_0/components/iron-image/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-image",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "An image-displaying element with lots of convenient features",
"private": true,
@@ -17,6 +17,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.4",
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
diff --git a/third_party/polymer/v1_0/components/iron-image/iron-image.html b/third_party/polymer/v1_0/components/iron-image/iron-image.html
index 07eb458..7eba73f 100644
--- a/third_party/polymer/v1_0/components/iron-image/iron-image.html
+++ b/third_party/polymer/v1_0/components/iron-image/iron-image.html
@@ -109,10 +109,6 @@ Examples:
properties: {
/**
* The URL of an image.
- *
- * @attribute src
- * @type string
- * @default ''
*/
src: {
observer: '_srcChanged',
@@ -124,10 +120,6 @@ Examples:
* When true, the image is prevented from loading and any placeholder is
* shown. This may be useful when a binding to the src property is known to
* be invalid, to prevent 404 requests.
- *
- * @attribute preventLoad
- * @type boolean
- * @default false
*/
preventLoad: {
type: Boolean,
@@ -139,10 +131,6 @@ Examples:
* aspect ratio of the image is contained within the element and
* letterboxed) or `cover` (image is cropped in order to fully cover the
* bounds of the element), or `null` (default: image takes natural size).
- *
- * @attribute sizing
- * @type string
- * @default null
*/
sizing: {
type: String,
@@ -152,10 +140,6 @@ Examples:
/**
* When a sizing option is uzed (`cover` or `contain`), this determines
* how the image is aligned within the element bounds.
- *
- * @attribute position
- * @type string
- * @default 'center'
*/
position: {
type: String,
@@ -165,10 +149,6 @@ Examples:
/**
* When `true`, any change to the `src` property will cause the `placeholder`
* image to be shown until the
- *
- * @attribute preload
- * @type boolean
- * @default false
*/
preload: {
type: Boolean,
@@ -178,10 +158,6 @@ Examples:
/**
* This image will be used as a background/placeholder until the src image has
* loaded. Use of a data-URI for placeholder is encouraged for instant rendering.
- *
- * @attribute placeholder
- * @type string
- * @default null
*/
placeholder: {
type: String,
@@ -191,10 +167,6 @@ Examples:
/**
* When `preload` is true, setting `fade` to true will cause the image to
* fade into place.
- *
- * @attribute fade
- * @type boolean
- * @default false
*/
fade: {
type: Boolean,
@@ -203,10 +175,6 @@ Examples:
/**
* Read-only value that is true when the image is loaded.
- *
- * @attribute preloaded
- * @type boolean
- * @default false
*/
loaded: {
notify: true,
@@ -217,10 +185,6 @@ Examples:
/**
* Read-only value that tracks the loading state of the image when the `preload`
* option is used.
- *
- * @attribute loading
- * @type boolean
- * @default false
*/
loading: {
notify: true,
@@ -231,10 +195,6 @@ Examples:
/**
* Can be used to set the width of image (e.g. via binding); size may also be
* set via CSS.
- *
- * @attribute width
- * @type number
- * @default null
*/
width: {
observer: '_widthChanged',
@@ -349,11 +309,11 @@ Examples:
this.style.backgroundPosition =
placeholderStyle.backgroundPosition =
- this.sizing ? this.position : null;
+ this.sizing ? this.position : '';
this.style.backgroundRepeat =
placeholderStyle.backgroundRepeat =
- this.sizing ? 'no-repeat' : null;
+ this.sizing ? 'no-repeat' : '';
},
_loadBehaviorChanged: function() {
diff --git a/third_party/polymer/v1_0/components/iron-input/.bower.json b/third_party/polymer/v1_0/components/iron-input/.bower.json
index 5120860c..1383a44 100644
--- a/third_party/polymer/v1_0/components/iron-input/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-input/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-input",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "An input element with data binding",
"authors": [
"The Polymer Authors"
@@ -26,17 +26,18 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "f54d4945cf96ede414904055547fd4c46dc0c053"
+ "tag": "v1.0.3",
+ "commit": "edb505f41d67120cb505deedb92aa69e90078d2f"
},
"_source": "git://github.com/PolymerElements/iron-input.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-input/bower.json b/third_party/polymer/v1_0/components/iron-input/bower.json
index 15142ba..c4c8951 100644
--- a/third_party/polymer/v1_0/components/iron-input/bower.json
+++ b/third_party/polymer/v1_0/components/iron-input/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-input",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "An input element with data binding",
"authors": [
"The Polymer Authors"
@@ -26,6 +26,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-input/iron-input.html b/third_party/polymer/v1_0/components/iron-input/iron-input.html
index 623a605..3d8cccb 100644
--- a/third_party/polymer/v1_0/components/iron-input/iron-input.html
+++ b/third_party/polymer/v1_0/components/iron-input/iron-input.html
@@ -86,13 +86,18 @@ is separate from validation, and `allowed-pattern` does not affect how the input
_previousValidInput: {
type: String,
value: ''
+ },
+
+ _patternAlreadyChecked: {
+ type: Boolean,
+ value: false
}
},
listeners: {
'input': '_onInput',
- 'keydown': '_onKeydown'
+ 'keypress': '_onKeypress'
},
get _patternRegExp() {
@@ -117,33 +122,54 @@ is separate from validation, and `allowed-pattern` does not affect how the input
_bindValueChanged: function() {
if (this.value !== this.bindValue) {
- this.value = this.bindValue;
+ this.value = !this.bindValue ? '' : this.bindValue;
}
// manually notify because we don't want to notify until after setting value
this.fire('bind-value-changed', {value: this.bindValue});
},
_onInput: function() {
- this.bindValue = this.value;
- },
+ // Need to validate each of the characters pasted if they haven't
+ // been validated inside `_onKeypress` already.
+ if (this.preventInvalidInput && !this._patternAlreadyChecked) {
+ var valid = this._checkPatternValidity();
+ if (!valid) {
+ this.value = this._previousValidInput;
+ }
+ }
- _isPrintable: function(keyCode) {
- var printable =
- (keyCode > 47 && keyCode < 58) || // number keys
- keyCode == 32 || keyCode == 13 || // spacebar & return key
- (keyCode > 64 && keyCode < 91) || // letter keys
- (keyCode > 95 && keyCode < 112) || // numpad keys
- (keyCode > 185 && keyCode < 193) || // ;=,-./` (in order)
- (keyCode > 218 && keyCode < 223); // [\]' (in order)
- return printable;
+ this.bindValue = this.value;
+ this._previousValidInput = this.value;
+ this._patternAlreadyChecked = false;
},
- // convert printable numpad keys to number keys
- _correctNumpadKeys: function(keyCode) {
- return (keyCode > 95 && keyCode < 112) ? keyCode - 48 : keyCode;
+ _isPrintable: function(event) {
+ // What a control/printable character is varies wildly based on the browser.
+ // - most control characters (arrows, backspace) do not send a `keypress` event
+ // in Chrome, but the *do* on Firefox
+ // - in Firefox, when they do send a `keypress` event, control chars have
+ // a charCode = 0, keyCode = xx (for ex. 40 for down arrow)
+ // - printable characters always send a keypress event.
+ // - in Firefox, printable chars always have a keyCode = 0. In Chrome, the keyCode
+ // always matches the charCode.
+ // None of this makes any sense.
+
+ var nonPrintable =
+ (event.keyCode == 8) || // backspace
+ (event.keyCode == 19) || // pause
+ (event.keyCode == 20) || // caps lock
+ (event.keyCode == 27) || // escape
+ (event.keyCode == 45) || // insert
+ (event.keyCode == 46) || // delete
+ (event.keyCode == 144) || // num lock
+ (event.keyCode == 145) || // scroll lock
+ (event.keyCode > 32 && event.keyCode < 41) || // page up/down, end, home, arrows
+ (event.keyCode > 111 && event.keyCode < 124); // fn keys
+
+ return !(event.charCode == 0 && nonPrintable);
},
- _onKeydown: function(event) {
+ _onKeypress: function(event) {
if (!this.preventInvalidInput && this.type !== 'number') {
return;
}
@@ -151,22 +177,45 @@ is separate from validation, and `allowed-pattern` does not affect how the input
if (!regexp) {
return;
}
- var thisChar = String.fromCharCode(this._correctNumpadKeys(event.keyCode));
- if (this._isPrintable(event.keyCode) && !regexp.test(thisChar)) {
+
+ // Handle special keys and backspace
+ if (event.metaKey || event.ctrlKey || event.altKey)
+ return;
+
+ // Check the pattern either here or in `_onInput`, but not in both.
+ this._patternAlreadyChecked = true;
+
+ var thisChar = String.fromCharCode(event.charCode);
+ if (this._isPrintable(event) && !regexp.test(thisChar)) {
event.preventDefault();
}
},
+ _checkPatternValidity: function() {
+ var regexp = this._patternRegExp;
+ if (!regexp) {
+ return true;
+ }
+ for (var i = 0; i < this.value.length; i++) {
+ if (!regexp.test(this.value[i])) {
+ return false;
+ }
+ }
+ return true;
+ },
+
/**
* Returns true if `value` is valid. The validator provided in `validator` will be used first,
* then any constraints.
- * @return {Boolean} True if the value is valid.
+ * @return {boolean} True if the value is valid.
*/
validate: function() {
// Empty, non-required input is valid.
- if (!this.required && this.value == '')
+ if (!this.required && this.value == '') {
+ this.invalid = false;
return true;
-
+ }
+
var valid;
if (this.hasValidator()) {
valid = Polymer.IronValidatableBehavior.validate.call(this, this.value);
diff --git a/third_party/polymer/v1_0/components/iron-jsonp-library/.bower.json b/third_party/polymer/v1_0/components/iron-jsonp-library/.bower.json
index 31660e4..ae094c55 100644
--- a/third_party/polymer/v1_0/components/iron-jsonp-library/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-jsonp-library/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-jsonp-library",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Loads jsonp libraries",
"authors": [
"Aleks Totic <a@totic.org>",
@@ -20,19 +20,20 @@
"/demo/"
],
"dependencies": {
- "polymer": "Polymer/polymer#^1.0.0",
- "iron-ajax": "PolymerElements/iron-ajax#^1.0.0"
+ "polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"web-component-tester": "*",
- "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "paper-spinner": "PolymerElements/paper-spinner#^1.0.1"
},
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "2957a77f8797e59f2cd97a61b9844c4f7a716f19"
+ "tag": "v1.0.1",
+ "commit": "4f1b758be4b000cd7d1f5cce7088d210d5b0b280"
},
"_source": "git://github.com/PolymerElements/iron-jsonp-library.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-jsonp-library/bower.json b/third_party/polymer/v1_0/components/iron-jsonp-library/bower.json
index 7f865fe..e387f62 100644
--- a/third_party/polymer/v1_0/components/iron-jsonp-library/bower.json
+++ b/third_party/polymer/v1_0/components/iron-jsonp-library/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-jsonp-library",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Loads jsonp libraries",
"authors": [
"Aleks Totic <a@totic.org>",
@@ -20,12 +20,13 @@
"/demo/"
],
"dependencies": {
- "polymer": "Polymer/polymer#^1.0.0",
- "iron-ajax": "PolymerElements/iron-ajax#^1.0.0"
+ "polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"web-component-tester": "*",
- "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "paper-spinner": "PolymerElements/paper-spinner#^1.0.1"
}
}
diff --git a/third_party/polymer/v1_0/components/iron-jsonp-library/iron-jsonp-library.html b/third_party/polymer/v1_0/components/iron-jsonp-library/iron-jsonp-library.html
index e4c04b5..63c60a3 100644
--- a/third_party/polymer/v1_0/components/iron-jsonp-library/iron-jsonp-library.html
+++ b/third_party/polymer/v1_0/components/iron-jsonp-library/iron-jsonp-library.html
@@ -23,6 +23,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
when possible instead of using this element.
@hero hero.svg
+ @demo demo/index.html
@polymerBehavior
*/
Polymer.IronJsonpLibraryBehavior = {
@@ -98,14 +99,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
};
- /*
+ /**
* LoaderMap keeps track of all Loaders
*/
var LoaderMap = {
apiMap: {}, // { hash -> Loader }
- /*
- * @param {function} notifyCallback loaded callback fn(result)
+ /**
+ * @param {Function} notifyCallback loaded callback fn(result)
* @param {string} jsonpCallbackName name of jsonpcallback. If API does not provide it, leave empty. Optional.
*/
require: function(url, notifyCallback, jsonpCallbackName) {
@@ -126,6 +127,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
};
+ /** @constructor */
var Loader = function(name, url, callbackName) {
this.notifiers = []; // array of notifyFn [ notifyFn* ]
@@ -184,7 +186,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
delete window[this.callbackName];
},
- notifyAll: function(notifyCallback) {
+ notifyAll: function() {
this.notifiers.forEach( function(notifyCallback) {
notifyCallback(this.error, this.result);
}.bind(this));
diff --git a/third_party/polymer/v1_0/components/iron-localstorage/.bower.json b/third_party/polymer/v1_0/components/iron-localstorage/.bower.json
index 4e59d72..c37bfa7 100644
--- a/third_party/polymer/v1_0/components/iron-localstorage/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-localstorage/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-localstorage",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Provides access to local storage",
"keywords": [
"web-component",
@@ -17,13 +17,15 @@
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
- "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "paper-checkbox": "PolymerElements/paper-checkbox#^1.0.1"
},
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "cecc6c2578287e779ffd76056cf5cf023799fc21"
+ "tag": "v1.0.1",
+ "commit": "7e8d167ef295e7cf7cb8f0729c57d7e65e0ee64f"
},
"_source": "git://github.com/PolymerElements/iron-localstorage.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-localstorage/bower.json b/third_party/polymer/v1_0/components/iron-localstorage/bower.json
index 95784b64a..1c481d5 100644
--- a/third_party/polymer/v1_0/components/iron-localstorage/bower.json
+++ b/third_party/polymer/v1_0/components/iron-localstorage/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-localstorage",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "Provides access to local storage",
"keywords": [
"web-component",
@@ -17,6 +17,8 @@
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
- "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.2",
+ "paper-checkbox": "PolymerElements/paper-checkbox#^1.0.1"
}
}
diff --git a/third_party/polymer/v1_0/components/iron-localstorage/iron-localstorage.html b/third_party/polymer/v1_0/components/iron-localstorage/iron-localstorage.html
index 986cbcd..46a094e 100644
--- a/third_party/polymer/v1_0/components/iron-localstorage/iron-localstorage.html
+++ b/third_party/polymer/v1_0/components/iron-localstorage/iron-localstorage.html
@@ -13,7 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<!--
Element access to Web Storage API (window.localStorage).
-Keeps `value` is sync with a localStorage key.
+Keeps `value` in sync with a localStorage key.
Direct assignments to `value` are automatically detected and saved.
Subproperty assignments are not (ex: `value.bar='foo'`).
@@ -46,9 +46,9 @@ No `<iron-localstorage value="{{foo.bar}}"`.
/**
* Fired when value loads from localStorage.
*
- * @param {Object} detail
- * @param {Boolean} detail.externalChange true if change occured in different window
- * @event iron-localstorage-load
+ * @event paper-responsive-change
+ * @param {{externalChange: boolean}} detail -
+ * externalChange: True if change occured in different window.
*/
/**
@@ -68,6 +68,7 @@ No `<iron-localstorage value="{{foo.bar}}"`.
/**
* The data associated with this storage.
* If value is set to null, and storage is in useRaw mode, item will be deleted
+ * @type {*}
*/
value: {
type: Object,
@@ -149,10 +150,10 @@ No `<iron-localstorage value="{{foo.bar}}"`.
/**
* loads value from local storage
- * @param {Boolean} externalChange true if loading changes from a different window
+ * @param {boolean=} externalChange true if loading changes from a different window
*/
_load: function(externalChange) {
- var v = localStorage.getItem(this.name);
+ var v = window.localStorage.getItem(this.name);
if (v === null) {
this.fire('iron-localstorage-load-empty');
@@ -179,9 +180,9 @@ No `<iron-localstorage value="{{foo.bar}}"`.
var v = this.useRaw ? this.value : JSON.stringify(this.value);
try {
if (this.value === null) {
- localStorage.removeItem(this.name);
+ window.localStorage.removeItem(this.name);
} else {
- localStorage.setItem(this.name, v);
+ window.localStorage.setItem(this.name, /** @type {string} */ (v));
}
}
catch(ex) {
diff --git a/third_party/polymer/v1_0/components/iron-overlay-behavior/.bower.json b/third_party/polymer/v1_0/components/iron-overlay-behavior/.bower.json
index dd439c4..7a37c57 100644
--- a/third_party/polymer/v1_0/components/iron-overlay-behavior/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-overlay-behavior/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-overlay-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay",
"private": true,
@@ -26,6 +26,7 @@
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
@@ -34,11 +35,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-overlay-behavior",
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "03debac2eb637f2b3e68edb05d8f1e5902e81ebc"
+ "tag": "v1.0.2",
+ "commit": "e84965cddda459c9e4a24e8d442c56ba4d5823eb"
},
"_source": "git://github.com/PolymerElements/iron-overlay-behavior.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-overlay-behavior/bower.json b/third_party/polymer/v1_0/components/iron-overlay-behavior/bower.json
index 7d4dead..de2114b 100644
--- a/third_party/polymer/v1_0/components/iron-overlay-behavior/bower.json
+++ b/third_party/polymer/v1_0/components/iron-overlay-behavior/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-overlay-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Provides a behavior for making an element an overlay",
"private": true,
@@ -26,6 +26,7 @@
"iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "polymerelements/paper-styles#^1.0.2",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-overlay-behavior/iron-overlay-behavior.html b/third_party/polymer/v1_0/components/iron-overlay-behavior/iron-overlay-behavior.html
index affc81a..c4db372 100644
--- a/third_party/polymer/v1_0/components/iron-overlay-behavior/iron-overlay-behavior.html
+++ b/third_party/polymer/v1_0/components/iron-overlay-behavior/iron-overlay-behavior.html
@@ -16,7 +16,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
-/*
+/**
Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden or shown, and displays
on top of other content. It includes an optional backdrop, and can be used to implement a variety
of UI controls including dialogs and drop downs. Multiple overlays may be displayed at once.
@@ -137,6 +137,17 @@ context. You should place this element as a child of `<body>` whenever possible.
},
+/**
+ * Fired after the `iron-overlay` opens.
+ * @event iron-overlay-opened
+ */
+
+/**
+ * Fired after the `iron-overlay` closes.
+ * @event iron-overlay-closed {{canceled: boolean}} detail -
+ * canceled: True if the overlay was canceled.
+ */
+
listeners: {
'click': '_onClick',
'iron-resize': '_onIronResize'
@@ -418,15 +429,5 @@ context. You should place this element as a child of `<body>` whenever possible.
/** @polymerBehavior */
Polymer.IronOverlayBehavior = [Polymer.IronFitBehavior, Polymer.IronResizableBehavior, Polymer.IronOverlayBehaviorImpl];
-/*
- * Fired after the `iron-overlay` opens.
- * @event iron-overlay-opened
- */
-
-/*
- * Fired after the `iron-overlay` closes.
- * @event iron-overlay-closed {{canceled: boolean}} detail -
- * canceled: True if the overlay was canceled.
- */
</script>
diff --git a/third_party/polymer/v1_0/components/iron-validatable-behavior/.bower.json b/third_party/polymer/v1_0/components/iron-validatable-behavior/.bower.json
index e274324..b1acc42 100644
--- a/third_party/polymer/v1_0/components/iron-validatable-behavior/.bower.json
+++ b/third_party/polymer/v1_0/components/iron-validatable-behavior/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-validatable-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Provides a behavior for an element that validates user input",
"authors": "The Polymer Authors",
"keywords": [
@@ -25,17 +25,18 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "63513294174960e48dfb4617f55e716de3c9fc49"
+ "tag": "1.0.2",
+ "commit": "a4fc340fdb268e274f312dadedd0633b025ac3a4"
},
"_source": "git://github.com/PolymerElements/iron-validatable-behavior.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-validatable-behavior/bower.json b/third_party/polymer/v1_0/components/iron-validatable-behavior/bower.json
index 3b66313..eaab387 100644
--- a/third_party/polymer/v1_0/components/iron-validatable-behavior/bower.json
+++ b/third_party/polymer/v1_0/components/iron-validatable-behavior/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-validatable-behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "Provides a behavior for an element that validates user input",
"authors": "The Polymer Authors",
"keywords": [
@@ -25,6 +25,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
diff --git a/third_party/polymer/v1_0/components/iron-validatable-behavior/iron-validatable-behavior.html b/third_party/polymer/v1_0/components/iron-validatable-behavior/iron-validatable-behavior.html
index d792b0d..c59c47e 100644
--- a/third_party/polymer/v1_0/components/iron-validatable-behavior/iron-validatable-behavior.html
+++ b/third_party/polymer/v1_0/components/iron-validatable-behavior/iron-validatable-behavior.html
@@ -47,6 +47,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* True if the last call to `validate` is invalid.
*/
invalid: {
+ notify: true,
reflectToAttribute: true,
type: Boolean,
value: false
@@ -79,7 +80,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
- * @return {Boolean} True if the validator `validator` exists.
+ * @return {boolean} True if the validator `validator` exists.
*/
hasValidator: function() {
return this._validator != null;
@@ -87,7 +88,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* @param {Object} values Passed to the validator's `validate()` function.
- * @return {Boolean} True if `values` is valid.
+ * @return {boolean} True if `values` is valid.
*/
validate: function(values) {
var valid = this._validator && this._validator.validate(values);
diff --git a/third_party/polymer/v1_0/components/paper-behaviors/.bower.json b/third_party/polymer/v1_0/components/paper-behaviors/.bower.json
index 4036b8dcc..ce085ea 100644
--- a/third_party/polymer/v1_0/components/paper-behaviors/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-behaviors/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-behaviors",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Common behaviors across the paper elements",
"authors": [
"The Polymer Authors"
@@ -36,11 +36,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "cf1b11e381a8df169efe2c3aaf08e2787dda31b9"
+ "tag": "v1.0.2",
+ "commit": "4dd226a2cc5b780a73d0058cd9998b6e0af1cb2c"
},
"_source": "git://github.com/PolymerElements/paper-behaviors.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-behaviors/bower.json b/third_party/polymer/v1_0/components/paper-behaviors/bower.json
index 0d55094..d4cae45 100644
--- a/third_party/polymer/v1_0/components/paper-behaviors/bower.json
+++ b/third_party/polymer/v1_0/components/paper-behaviors/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-behaviors",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Common behaviors across the paper elements",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-behaviors/paper-button-behavior.html b/third_party/polymer/v1_0/components/paper-behaviors/paper-button-behavior.html
index 7f8aa974..bbe508f 100644
--- a/third_party/polymer/v1_0/components/paper-behaviors/paper-button-behavior.html
+++ b/third_party/polymer/v1_0/components/paper-behaviors/paper-button-behavior.html
@@ -46,6 +46,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
};
+ /** @polymerBehavior */
Polymer.PaperButtonBehavior = [
Polymer.IronButtonState,
Polymer.IronControlState,
diff --git a/third_party/polymer/v1_0/components/paper-behaviors/paper-radio-button-behavior.html b/third_party/polymer/v1_0/components/paper-behaviors/paper-inky-focus-behavior.html
index f79d65d..4f6e9f8 100644
--- a/third_party/polymer/v1_0/components/paper-behaviors/paper-radio-button-behavior.html
+++ b/third_party/polymer/v1_0/components/paper-behaviors/paper-inky-focus-behavior.html
@@ -13,8 +13,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
- /** @polymerBehavior */
- Polymer.PaperRadioButtonInk = {
+ /**
+ * `Polymer.PaperInkyFocusBehavior` implements a ripple when the element has keyboard focus.
+ *
+ * @polymerBehavior Polymer.PaperInkyFocusBehavior
+ */
+ Polymer.PaperInkyFocusBehaviorImpl = {
observers: [
'_focusedChanged(receivedFocusFromKeyboard)'
@@ -30,11 +34,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
};
- /** @polymerBehavior */
- Polymer.PaperRadioButtonBehavior = [
+ /** @polymerBehavior Polymer.PaperInkyFocusBehavior */
+ Polymer.PaperInkyFocusBehavior = [
Polymer.IronButtonState,
Polymer.IronControlState,
- Polymer.PaperRadioButtonInk
+ Polymer.PaperInkyFocusBehaviorImpl
];
</script>
diff --git a/third_party/polymer/v1_0/components/paper-checkbox/.bower.json b/third_party/polymer/v1_0/components/paper-checkbox/.bower.json
index 27f1492..f4cb1ba 100644
--- a/third_party/polymer/v1_0/components/paper-checkbox/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-checkbox/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-checkbox",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design checkbox",
"authors": [
"The Polymer Authors"
@@ -34,11 +34,11 @@
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
"polymer": "Polymer/polymer#^1.0.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "d7b372fecace143f83ec67d323be9504308e5f5f"
+ "tag": "v1.0.3",
+ "commit": "b32696b963cdcb00223f2a2433ef439363c9a150"
},
"_source": "git://github.com/PolymerElements/paper-checkbox.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-checkbox/bower.json b/third_party/polymer/v1_0/components/paper-checkbox/bower.json
index 6ae5621..c68d6d83a 100644
--- a/third_party/polymer/v1_0/components/paper-checkbox/bower.json
+++ b/third_party/polymer/v1_0/components/paper-checkbox/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-checkbox",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design checkbox",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.css b/third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.css
index eb203fd..195d822 100644
--- a/third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.css
+++ b/third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.css
@@ -37,12 +37,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
left: -15px;
width: 48px;
height: 48px;
- color: var(--paper-checkbox-unchecked-ink-color);
+ color: var(--paper-checkbox-unchecked-ink-color, --primary-text-color);
opacity: 0.6;
}
:host #ink[checked] {
- color: var(--paper-checkbox-checked-ink-color);
+ color: var(--paper-checkbox-checked-ink-color, --default-primary-color);
}
:host #checkbox {
@@ -50,7 +50,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
box-sizing: border-box;
height: 100%;
border: solid 2px;
- border-color: var(--paper-checkbox-unchecked-color);
+ border-color: var(--paper-checkbox-unchecked-color, --primary-text-color);
border-radius: 2px;
pointer-events: none;
-webkit-transition: background-color 140ms, border-color 140ms;
@@ -94,8 +94,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
:host #checkbox.checked {
- background-color: var(--paper-checkbox-checked-color);
- border-color: var(--paper-checkbox-checked-color);
+ background-color: var(--paper-checkbox-checked-color, --default-primary-color);
+ border-color: var(--paper-checkbox-checked-color, --default-primary-color);
}
:host #checkmark {
@@ -122,7 +122,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
padding-left: 8px;
white-space: normal;
pointer-events: none;
- color: var(--paper-checkbox-label-color);
+ color: var(--paper-checkbox-label-color, --primary-text-color);
}
#checkboxLabel[hidden] {
@@ -136,11 +136,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
:host([disabled]) #checkbox {
opacity: 0.5;
- border-color: var(--paper-checkbox-unchecked-color);
+ border-color: var(--paper-checkbox-unchecked-color, --primary-text-color);
}
:host([disabled][checked]) #checkbox {
- background-color: var(--paper-checkbox-unchecked-color);
+ background-color: var(--paper-checkbox-unchecked-color, --primary-text-color);
opacity: 0.5;
}
diff --git a/third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.html b/third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.html
index 2deb9a80..ee40cf9 100644
--- a/third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.html
+++ b/third_party/polymer/v1_0/components/paper-checkbox/paper-checkbox.html
@@ -11,7 +11,7 @@ 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="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-styles/default-theme.html">
-<link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<!--
@@ -42,18 +42,6 @@ Custom property | Description | Default
@demo demo/index.html
-->
-<style is="custom-style">
- :root {
- --paper-checkbox-unchecked-color: var(--primary-text-color);
- --paper-checkbox-unchecked-ink-color: var(--primary-text-color);
-
- --paper-checkbox-checked-color: var(--default-primary-color);
- --paper-checkbox-checked-ink-color: var(--default-primary-color);
-
- --paper-checkbox-label-color: var(--primary-text-color);
- }
-</style>
-
<dom-module id="paper-checkbox">
<link rel="import" type="css" href="paper-checkbox.css">
@@ -75,7 +63,7 @@ Custom property | Description | Default
is: 'paper-checkbox',
behaviors: [
- Polymer.PaperRadioButtonBehavior
+ Polymer.PaperInkyFocusBehavior
],
hostAttributes: {
@@ -148,12 +136,14 @@ Custom property | Description | Default
if (checked) {
return 'checked';
}
+ return '';
},
_computeCheckmarkClass: function(checked) {
if (!checked) {
return 'hidden';
}
+ return '';
}
})
</script>
diff --git a/third_party/polymer/v1_0/components/paper-dialog-behavior/.bower.json b/third_party/polymer/v1_0/components/paper-dialog-behavior/.bower.json
index a47fd0f..532e273 100644
--- a/third_party/polymer/v1_0/components/paper-dialog-behavior/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-dialog-behavior/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-dialog-behavior",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Implements a behavior used for material design dialogs",
"authors": "The Polymer Authors",
"keywords": [
@@ -23,7 +23,7 @@
"ignore": [],
"dependencies": {
"iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^1.0.0",
- "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
@@ -34,11 +34,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "cd65087ca07495d546bc46618563e53ceacd5325"
+ "tag": "v1.0.2",
+ "commit": "156945a20318c11bb65d0bc83ef402262c3071ca"
},
"_source": "git://github.com/PolymerElements/paper-dialog-behavior.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-dialog-behavior/bower.json b/third_party/polymer/v1_0/components/paper-dialog-behavior/bower.json
index 7b3e6c1..cdd57c6 100644
--- a/third_party/polymer/v1_0/components/paper-dialog-behavior/bower.json
+++ b/third_party/polymer/v1_0/components/paper-dialog-behavior/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-dialog-behavior",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "Implements a behavior used for material design dialogs",
"authors": "The Polymer Authors",
"keywords": [
@@ -23,7 +23,7 @@
"ignore": [],
"dependencies": {
"iron-overlay-behavior": "PolymerElements/iron-overlay-behavior#^1.0.0",
- "paper-styles": "PolymerElements/paper-styles#^1.0.0",
+ "paper-styles": "PolymerElements/paper-styles#^1.0.4",
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
diff --git a/third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-behavior.html b/third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-behavior.html
index 8e83fed..227fb4d 100644
--- a/third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-behavior.html
+++ b/third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-behavior.html
@@ -14,7 +14,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
-/*
+/**
Use `Polymer.PaperDialogBehavior` and `paper-dialog-common.css` to implement a Material Design
dialog.
@@ -82,8 +82,9 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
value: false
},
+ /** @type {?Node} */
_lastFocusedElement: {
- type: Node
+ type: Object
},
_boundOnFocus: {
diff --git a/third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-common.css b/third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-common.css
index 57c665d..67bddb19 100644
--- a/third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-common.css
+++ b/third_party/polymer/v1_0/components/paper-dialog-behavior/paper-dialog-common.css
@@ -15,6 +15,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
background: var(--paper-dialog-background-color, --primary-background-color);
color: var(--paper-dialog-color, --primary-text-color);
+ @apply(--layout-scroll);
@apply(--paper-font-body1);
@apply(--shadow-elevation-16dp);
@apply(--paper-dialog);
diff --git a/third_party/polymer/v1_0/components/paper-dialog-scrollable/.bower.json b/third_party/polymer/v1_0/components/paper-dialog-scrollable/.bower.json
index 88e5eb3..a7eda78 100644
--- a/third_party/polymer/v1_0/components/paper-dialog-scrollable/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-dialog-scrollable/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-dialog-scrollable",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A scrollable area used inside the material design dialog",
"authors": [
"The Polymer Authors"
@@ -33,11 +33,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "9d27cbdedfb4b4b06eefffbf99d0e7fa97c3e248"
+ "tag": "v1.0.1",
+ "commit": "94e65968791d9166d2d3bf186e449d042b10168f"
},
"_source": "git://github.com/PolymerElements/paper-dialog-scrollable.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-dialog-scrollable/bower.json b/third_party/polymer/v1_0/components/paper-dialog-scrollable/bower.json
index 99553af..17ae8f7 100644
--- a/third_party/polymer/v1_0/components/paper-dialog-scrollable/bower.json
+++ b/third_party/polymer/v1_0/components/paper-dialog-scrollable/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-dialog-scrollable",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A scrollable area used inside the material design dialog",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-dialog-scrollable/paper-dialog-scrollable.html b/third_party/polymer/v1_0/components/paper-dialog-scrollable/paper-dialog-scrollable.html
index 9817489..5f46d9c 100644
--- a/third_party/polymer/v1_0/components/paper-dialog-scrollable/paper-dialog-scrollable.html
+++ b/third_party/polymer/v1_0/components/paper-dialog-scrollable/paper-dialog-scrollable.html
@@ -96,6 +96,7 @@ is hidden if it is scrolled to the bottom.
/**
* The dialog element that implements `Polymer.PaperDialogBehavior` containing this element.
+ * @type {?Node}
*/
dialogElement: {
type: Object,
diff --git a/third_party/polymer/v1_0/components/paper-drawer-panel/.bower.json b/third_party/polymer/v1_0/components/paper-drawer-panel/.bower.json
index f226642..e49fa46 100644
--- a/third_party/polymer/v1_0/components/paper-drawer-panel/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-drawer-panel/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-drawer-panel",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A responsive drawer panel",
"authors": [
"The Polymer Authors"
@@ -30,11 +30,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "6294619b9eb3a9346854daef1b00fb3342dffef9"
+ "tag": "v1.0.2",
+ "commit": "691739c877914f7231eaca16b724bdca295dfe8d"
},
"_source": "git://github.com/PolymerElements/paper-drawer-panel.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-drawer-panel/bower.json b/third_party/polymer/v1_0/components/paper-drawer-panel/bower.json
index 52edc76..f87cca9 100644
--- a/third_party/polymer/v1_0/components/paper-drawer-panel/bower.json
+++ b/third_party/polymer/v1_0/components/paper-drawer-panel/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-drawer-panel",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A responsive drawer panel",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-drawer-panel/paper-drawer-panel.html b/third_party/polymer/v1_0/components/paper-drawer-panel/paper-drawer-panel.html
index 758d88a..148cfeb 100644
--- a/third_party/polymer/v1_0/components/paper-drawer-panel/paper-drawer-panel.html
+++ b/third_party/polymer/v1_0/components/paper-drawer-panel/paper-drawer-panel.html
@@ -210,7 +210,9 @@ To change the drawer container when it's in the right side:
*/
dragging: {
type: Boolean,
- value: false
+ value: false,
+ readOnly: true,
+ notify: true
},
/**
@@ -266,6 +268,7 @@ To change the drawer container when it's in the right side:
reflectToAttribute: true,
type: Boolean,
value: false,
+ readOnly: true,
notify: true
},
@@ -274,7 +277,9 @@ To change the drawer container when it's in the right side:
*/
peeking: {
type: Boolean,
- value: false
+ value: false,
+ readOnly: true,
+ notify: true
},
/**
@@ -299,6 +304,7 @@ To change the drawer container when it's in the right side:
*/
selected: {
reflectToAttribute: true,
+ notify: true,
type: String,
value: null
},
@@ -425,7 +431,7 @@ To change the drawer container when it's in the right side:
},
_responsiveChange: function(narrow) {
- this.narrow = narrow;
+ this._setNarrow(narrow);
if (this.narrow) {
this.selected = this.defaultSelected;
@@ -456,12 +462,12 @@ To change the drawer container when it's in the right side:
this.width = this.$.drawer.offsetWidth;
this._moveDrawer(this._translateXForDeltaX(this.rightDrawer ?
-this.edgeSwipeSensitivity : this.edgeSwipeSensitivity));
- this.peeking = true;
+ this._setPeeking(true);
},
_stopEdgePeek: function() {
if (this.peeking) {
- this.peeking = false;
+ this._setPeeking(false);
this._moveDrawer(null);
}
},
@@ -500,13 +506,13 @@ To change the drawer container when it's in the right side:
x <= this.edgeSwipeSensitivity);
},
- _trackStart: function() {
+ _trackStart: function(event) {
if (this._swipeAllowed()) {
sharedPanel = this;
- this.dragging = true;
+ this._setDragging(true);
if (this._isMainSelected()) {
- this.dragging = this.peeking || this._isEdgeTouch(event);
+ this._setDragging(this.peeking || this._isEdgeTouch(event));
}
if (this.dragging) {
@@ -535,7 +541,7 @@ To change the drawer container when it's in the right side:
// Ignore trackx until we move past the edge peek.
return;
}
- this.peeking = false;
+ this._setPeeking(false);
}
this._moveDrawer(this._translateXForDeltaX(dx));
@@ -546,7 +552,7 @@ To change the drawer container when it's in the right side:
if (this.dragging) {
var xDirection = e.detail.dx > 0;
- this.dragging = false;
+ this._setDragging(false);
this.transition = true;
sharedPanel = null;
this._moveDrawer(null);
diff --git a/third_party/polymer/v1_0/components/paper-fab/.bower.json b/third_party/polymer/v1_0/components/paper-fab/.bower.json
index 4fe9c9f..15e922a 100644
--- a/third_party/polymer/v1_0/components/paper-fab/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-fab/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-fab",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A material design floating action button",
"authors": [
"The Polymer Authors"
@@ -36,11 +36,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "3c626a4d116d774e9f4db3a3e0f92b0c8148f12e"
+ "tag": "v1.0.2",
+ "commit": "59d2f77f456271f1ae4059b92d83ba7655fb1580"
},
"_source": "git://github.com/PolymerElements/paper-fab.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-fab/bower.json b/third_party/polymer/v1_0/components/paper-fab/bower.json
index b195ccb..f3738a2 100644
--- a/third_party/polymer/v1_0/components/paper-fab/bower.json
+++ b/third_party/polymer/v1_0/components/paper-fab/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-fab",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A material design floating action button",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-fab/paper-fab.html b/third_party/polymer/v1_0/components/paper-fab/paper-fab.html
index 16e5de1..f607ca4 100644
--- a/third_party/polymer/v1_0/components/paper-fab/paper-fab.html
+++ b/third_party/polymer/v1_0/components/paper-fab/paper-fab.html
@@ -42,7 +42,8 @@ The following custom properties and mixins are available for styling:
Custom property | Description | Default
----------------|-------------|----------
-`--paper-fab-background` | The background color of the button | `--paper-indigo-500`
+`--paper-fab-background` | The background color of the button | `--accent-color`
+`--paper-fab-keyboard-focus-background` | The background color of the button when focused | `--paper-pink-900`
`--paper-fab-disabled-background` | The background color of the button when it's disabled | `--paper-grey-300`
`--paper-fab-disabled-text` | The text color of the button when it's disabled | `--paper-grey-500`
`--paper-fab` | Mixin applied to the button | `{}`
@@ -71,7 +72,7 @@ Custom property | Description | Default
min-width: 0;
width: 56px;
height: 56px;
- background: var(--paper-fab-background, --paper-indigo-500);
+ background: var(--paper-fab-background, --accent-color);
color: var(--text-primary-color);
border-radius: 50%;
padding: 16px;
@@ -97,11 +98,18 @@ Custom property | Description | Default
paper-material {
border-radius: inherit;
+ @apply(--layout-fit);
+ @apply(--layout-vertical);
+ @apply(--layout-center-center);
+ }
+
+ .keyboard-focus {
+ background: var(--paper-fab-keyboard-focus-background, --paper-pink-900);
}
</style>
<template>
<paper-ripple></paper-ripple>
- <paper-material class="content fit flex layout vertical center-center" elevation="[[elevation]]" animated>
+ <paper-material class$="[[_computeContentClass(receivedFocusFromKeyboard)]]" elevation="[[_elevation]]" animated>
<iron-icon id="icon" src="[[src]]" icon="[[icon]]"></iron-icon>
</paper-material>
</template>
@@ -153,6 +161,14 @@ Custom property | Description | Default
type: Boolean,
value: false
}
+ },
+
+ _computeContentClass: function(receivedFocusFromKeyboard) {
+ var className = 'content';
+ if (receivedFocusFromKeyboard) {
+ className += ' keyboard-focus';
+ }
+ return className;
}
});
diff --git a/third_party/polymer/v1_0/components/paper-header-panel/.bower.json b/third_party/polymer/v1_0/components/paper-header-panel/.bower.json
index 394924f..6129668 100644
--- a/third_party/polymer/v1_0/components/paper-header-panel/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-header-panel/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-header-panel",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A header and content wrapper for layout with headers",
"authors": [
"The Polymer Authors"
@@ -25,11 +25,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "ec388b9579fe61ce84e498132cd33ec275e8e398"
+ "tag": "v1.0.2",
+ "commit": "19cde2fc5dfd51439e3433b3d5e6b618d444cb0a"
},
"_source": "git://github.com/PolymerElements/paper-header-panel.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-header-panel/bower.json b/third_party/polymer/v1_0/components/paper-header-panel/bower.json
index 57314e7..62efe83 100644
--- a/third_party/polymer/v1_0/components/paper-header-panel/bower.json
+++ b/third_party/polymer/v1_0/components/paper-header-panel/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-header-panel",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A header and content wrapper for layout with headers",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-header-panel/paper-header-panel.html b/third_party/polymer/v1_0/components/paper-header-panel/paper-header-panel.html
index 8ce83ac..d337995 100644
--- a/third_party/polymer/v1_0/components/paper-header-panel/paper-header-panel.html
+++ b/third_party/polymer/v1_0/components/paper-header-panel/paper-header-panel.html
@@ -66,7 +66,7 @@ Mode | Description
`scroll` | The header keeps its seam with the panel, and is pushed off screen.
`cover` | The panel covers the whole `paper-header-panel` including the header. This allows user to style the panel in such a way that the panel is partially covering the header.
-Example:
+Example:
<paper-header-panel mode="waterfall">
<div class="paper-header">standard</div>
@@ -127,6 +127,17 @@ To change the panel container in different modes:
z-index: 0;
}
+ :root {
+ /**
+ * Default paper header panel shadow
+ */
+ --paper-header-panel-shadow: {
+ height: 6px;
+ bottom: -6px;
+ box-shadow: inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);
+ };
+ }
+
#mainContainer {
@apply(--layout-flex);
@@ -230,19 +241,6 @@ To change the panel container in different modes:
</dom-module>
-<style is="custom-style">
- :root {
- /**
- * Default paper header panel shadow
- */
- --paper-header-panel-shadow: {
- height: 6px;
- bottom: -6px;
- box-shadow: inset 0px 5px 6px -3px rgba(0, 0, 0, 0.4);
- };
- }
-</style>
-
<script>
(function() {
@@ -458,7 +456,7 @@ To change the panel container in different modes:
header.classList.remove(this.tallClass);
this.async(function() {
header.classList.remove('animate');
- }, null, animateDuration);
+ }, animateDuration);
} else {
header.classList.toggle('animate', configs.tallMode[newMode]);
}
@@ -481,7 +479,7 @@ To change the panel container in different modes:
_scroll: function(e) {
this._keepScrollingState();
- this.fire('content-scroll', {target: this.scroller}, this, false);
+ this.fire('content-scroll', {target: this.scroller}, {bubbles: false});
},
_getScrollerForMode: function(mode) {
diff --git a/third_party/polymer/v1_0/components/paper-icon-button/.bower.json b/third_party/polymer/v1_0/components/paper-icon-button/.bower.json
index f5ebf09..71c8d45 100644
--- a/third_party/polymer/v1_0/components/paper-icon-button/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-icon-button/.bower.json
@@ -1,7 +1,7 @@
{
"name": "paper-icon-button",
"private": true,
- "version": "1.0.0",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "A material design icon button",
"main": "paper-icon-button.html",
@@ -25,17 +25,17 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
- "iron-component-page": "polymerelements/iron-component-page#^0.9.0",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-icon-button",
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "0db7b75d5e37d8521b6aceb94b185a57145699d9"
+ "tag": "v1.0.2",
+ "commit": "b22ade2080f2527760eae41e4700c52d4689a866"
},
"_source": "git://github.com/PolymerElements/paper-icon-button.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-icon-button/bower.json b/third_party/polymer/v1_0/components/paper-icon-button/bower.json
index 879efb1..6886757 100644
--- a/third_party/polymer/v1_0/components/paper-icon-button/bower.json
+++ b/third_party/polymer/v1_0/components/paper-icon-button/bower.json
@@ -1,7 +1,7 @@
{
"name": "paper-icon-button",
"private": true,
- "version": "1.0.0",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "A material design icon button",
"main": "paper-icon-button.html",
@@ -25,7 +25,7 @@
"polymer": "Polymer/polymer#^1.0.0"
},
"devDependencies": {
- "iron-component-page": "polymerelements/iron-component-page#^0.9.0",
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
"test-fixture": "polymerelements/test-fixture#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
diff --git a/third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html b/third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html
index 99d8d88..f4164ce 100644
--- a/third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html
+++ b/third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html
@@ -13,15 +13,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="../paper-behaviors/paper-button-behavior.html">
-<link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
-<style is="custom-style">
- :root {
- --paper-icon-button-disabled-text: var(--disabled-text-color);
- }
-</style>
-
<!--
Material Design: <a href="http://www.google.com/design/spec/components/buttons.html">Buttons</a>
@@ -99,7 +93,7 @@ Custom property | Description | Default
}
:host([disabled]) {
- color: var(--paper-icon-button-disabled-text, #fff);
+ color: var(--paper-icon-button-disabled-text, --disabled-text-color);
pointer-events: none;
cursor: auto;
@apply(--paper-icon-button-disabled);
@@ -107,16 +101,20 @@ Custom property | Description | Default
</style>
<template>
<paper-ripple id="ink" class="circle" center></paper-ripple>
- <iron-icon id="icon" src="[[src]]" icon="[[icon]]"></iron-icon>
+ <iron-icon id="icon" src="[[src]]" icon="[[icon]]" alt$="[[alt]]"></iron-icon>
</template>
</dom-module>
<script>
Polymer({
is: 'paper-icon-button',
+ hostAttributes: {
+ role: 'button',
+ tabindex: '0'
+ },
+
behaviors: [
- Polymer.PaperButtonBehavior,
- Polymer.PaperRadioButtonBehavior
+ Polymer.PaperInkyFocusBehavior
],
properties: {
@@ -135,6 +133,23 @@ Custom property | Description | Default
*/
icon: {
type: String
+ },
+
+ /**
+ * Specifies the alternate text for the button, for accessibility.
+ */
+ alt: {
+ type: String,
+ observer: "_altChanged"
+ }
+ },
+
+ _altChanged: function(newValue, oldValue) {
+ var label = this.getAttribute('aria-label');
+
+ // Don't stomp over a user-set aria-label.
+ if (!label || oldValue == label) {
+ this.setAttribute('aria-label', newValue);
}
}
});
diff --git a/third_party/polymer/v1_0/components/paper-input/.bower.json b/third_party/polymer/v1_0/components/paper-input/.bower.json
index fc83cc2..12c5a8c 100644
--- a/third_party/polymer/v1_0/components/paper-input/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-input/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-input",
- "version": "1.0.0",
+ "version": "1.0.3",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
@@ -41,11 +41,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.0",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "47a869b431fd03b9f611aee8eb286f0497ad379b"
+ "tag": "v1.0.3",
+ "commit": "5d3c8a4a95fce54f4b8b6a5e5b319e821a080447"
},
"_source": "git://github.com/PolymerElements/paper-input.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-input/bower.json b/third_party/polymer/v1_0/components/paper-input/bower.json
index d98556e..d25cce1 100644
--- a/third_party/polymer/v1_0/components/paper-input/bower.json
+++ b/third_party/polymer/v1_0/components/paper-input/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-input",
- "version": "1.0.0",
+ "version": "1.0.3",
"description": "Material design text fields",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-input/paper-input-addon-behavior.html b/third_party/polymer/v1_0/components/paper-input/paper-input-addon-behavior.html
index dd17a78..0b021a5 100644
--- a/third_party/polymer/v1_0/components/paper-input/paper-input-addon-behavior.html
+++ b/third_party/polymer/v1_0/components/paper-input/paper-input-addon-behavior.html
@@ -30,10 +30,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* The function called by `<paper-input-container>` when the input value or validity changes.
- * @param {Object} state All properties are optional.
- * @param {Node} state.inputElement The input element.
- * @param {String} state.value The input value.
- * @param {Boolean} state.invalid True if the input value is invalid.
+ * @param {{
+ * inputElement: (Node|undefined),
+ * value: (string|undefined),
+ * invalid: (boolean|undefined)
+ * }} state All properties are optional -
+ * inputElement: The input element.
+ * value: The input value.
+ * invalid: True if the input value is invalid.
*/
update: function(state) {
}
diff --git a/third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html b/third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html
index 06a4e54..1e72e98 100644
--- a/third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html
+++ b/third_party/polymer/v1_0/components/paper-input/paper-input-behavior.html
@@ -201,7 +201,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
* A placeholder string in addition to the label. If this is set, the label will always float.
*/
placeholder: {
- type: String
+ type: String,
+ // need to set a default so _computeAlwaysFloatLabel is run
+ value: ''
},
/**
@@ -264,10 +266,32 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* Validates the input element and sets an error style if needed.
*/
- validate: function () {
+ validate: function() {
return this.inputElement.validate();
},
+ /**
+ * Restores the cursor to its original position after updating the value.
+ * @param {string} newValue The value that should be saved.
+ */
+ updateValueAndPreserveCaret: function(newValue) {
+ // Not all elements might have selection, and even if they have the
+ // right properties, accessing them might throw an exception (like for
+ // <input type=number>)
+ try {
+ var start = this.inputElement.selectionStart;
+ this.value = newValue;
+
+ // The cursor automatically jumps to the end after re-setting the value,
+ // so restore it to its original position.
+ this.inputElement.selectionStart = start;
+ this.inputElement.selectionEnd = start;
+ } catch (e) {
+ // Just set the value and give up on the caret.
+ this.value = newValue;
+ }
+ },
+
_computeAlwaysFloatLabel: function(alwaysFloatLabel, placeholder) {
return placeholder || alwaysFloatLabel;
},
diff --git a/third_party/polymer/v1_0/components/paper-input/paper-input-container.html b/third_party/polymer/v1_0/components/paper-input/paper-input-container.html
index 18935c1..e9088c2 100644
--- a/third_party/polymer/v1_0/components/paper-input/paper-input-container.html
+++ b/third_party/polymer/v1_0/components/paper-input/paper-input-container.html
@@ -109,7 +109,7 @@ This element is `display:block` by default, but you can set the `inline` attribu
background: var(--paper-input-container-focus-color, --default-primary-color);
}
- .is-highlighted .focused-line {
+ .underline.is-highlighted .focused-line {
-webkit-transform: none;
transform: none;
-webkit-transition: -webkit-transform 0.25s;
@@ -118,7 +118,7 @@ This element is `display:block` by default, but you can set the `inline` attribu
@apply(--paper-transition-easing);
}
- .is-invalid .focused-line {
+ .underline.is-invalid .focused-line {
background: var(--paper-input-container-invalid-color, --google-red-500);
-webkit-transform: none;
@@ -305,10 +305,10 @@ This element is `display:block` by default, but you can set the `inline` attribu
},
_addons: {
- type: Array,
- value: function() {
- return [];
- }
+ type: Array
+ // do not set a default value here intentionally - it will be initialized lazily when a
+ // distributed child is attached, which may occur before configuration for this element
+ // in polyfill.
},
_inputHasContent: {
@@ -338,7 +338,7 @@ This element is `display:block` by default, but you can set the `inline` attribu
_boundOnInput: {
type: Function,
value: function() {
- this._onInput.bind(this)
+ return this._onInput.bind(this);
}
},
@@ -369,6 +369,9 @@ This element is `display:block` by default, but you can set the `inline` attribu
},
ready: function() {
+ if (!this._addons) {
+ this._addons = [];
+ }
this.addEventListener('focus', this._boundOnFocus, true);
this.addEventListener('blur', this._boundOnBlur, true);
if (this.attrForValue) {
@@ -383,8 +386,16 @@ This element is `display:block` by default, but you can set the `inline` attribu
},
_onAddonAttached: function(event) {
- this._addons.push(event.target);
- this._handleValue(this._inputElement);
+ if (!this._addons) {
+ this._addons = [];
+ }
+ var target = event.target;
+ if (this._addons.indexOf(target) === -1) {
+ this._addons.push(target);
+ if (this.isAttached) {
+ this._handleValue(this._inputElement);
+ }
+ }
},
_onFocus: function() {
diff --git a/third_party/polymer/v1_0/components/paper-input/paper-input.html b/third_party/polymer/v1_0/components/paper-input/paper-input.html
index 234db95..f6720e7 100644
--- a/third_party/polymer/v1_0/components/paper-input/paper-input.html
+++ b/third_party/polymer/v1_0/components/paper-input/paper-input.html
@@ -77,7 +77,7 @@ style this element.
bind-value="{{value}}"
invalid="{{invalid}}"
prevent-invalid-input="[[preventInvalidInput]]"
- allowedPattern="[[allowedPattern]]"
+ allowed-pattern="[[allowedPattern]]"
validator="[[validator]]"
type$="[[type]]"
pattern$="[[pattern]]"
diff --git a/third_party/polymer/v1_0/components/paper-input/paper-textarea.html b/third_party/polymer/v1_0/components/paper-input/paper-textarea.html
index 0c74edf..d47a5b5 100644
--- a/third_party/polymer/v1_0/components/paper-input/paper-textarea.html
+++ b/third_party/polymer/v1_0/components/paper-input/paper-textarea.html
@@ -35,12 +35,18 @@ style this element.
<dom-module id="paper-textarea">
<template>
- <paper-input-container no-label-float$="[[noLabelFloat]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]">
+ <paper-input-container no-label-float$="[[noLabelFloat]]" always-float-label="[[_computeAlwaysFloatLabel(alwaysFloatLabel,placeholder)]]" auto-validate$="[[autoValidate]]" disabled$="[[disabled]]" invalid="[[invalid]]">
<label hidden$="[[!label]]">[[label]]</label>
<iron-autogrow-textarea id="input" class="paper-input-input"
bind-value="{{value}}"
+ autocomplete$="[[autocomplete]]"
+ autofocus$="[[autofocus]]"
+ inputmode$="[[inputmode]]"
+ name$="[[name]]"
+ placeholder$="[[placeholder]]"
+ readonly$="[[readonly]]"
required$="[[required]]"
maxlength$="[[maxlength]]"></iron-autogrow-textarea>
diff --git a/third_party/polymer/v1_0/components/paper-radio-button/.bower.json b/third_party/polymer/v1_0/components/paper-radio-button/.bower.json
index a5e2700..921a3c1 100644
--- a/third_party/polymer/v1_0/components/paper-radio-button/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-radio-button/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-radio-button",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design radio button",
"authors": [
"The Polymer Authors"
@@ -32,11 +32,11 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "922027de73c04f430d74679a167651a8c1db97e8"
+ "tag": "v1.0.3",
+ "commit": "adf0de18d7f0b20b6ee7e891b4f265427fe2e5ff"
},
"_source": "git://github.com/PolymerElements/paper-radio-button.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-radio-button/bower.json b/third_party/polymer/v1_0/components/paper-radio-button/bower.json
index 51165feb..4612f3d 100644
--- a/third_party/polymer/v1_0/components/paper-radio-button/bower.json
+++ b/third_party/polymer/v1_0/components/paper-radio-button/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-radio-button",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design radio button",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.css b/third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.css
index dcb9695..682d8c5 100644
--- a/third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.css
+++ b/third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.css
@@ -31,12 +31,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
left: -16px;
width: 48px;
height: 48px;
- color: var(--paper-radio-button-unchecked-ink-color);
+ color: var(--paper-radio-button-unchecked-ink-color, --primary-text-color);
opacity: 0.6;
}
:host #ink[checked] {
- color: var(--paper-radio-button-checked-ink-color);
+ color: var(--paper-radio-button-checked-ink-color, --default-primary-color);
}
:host #offRadio {
@@ -47,7 +47,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
height: 12px;
border-radius: 50%;
border: solid 2px;
- border-color: var(--paper-radio-button-unchecked-color);
+ border-color: var(--paper-radio-button-unchecked-color, --primary-text-color);
transition: border-color 0.28s;
}
@@ -58,7 +58,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
width: 8px;
height: 8px;
border-radius: 50%;
- background-color: var(--paper-radio-button-checked-color);
+ background-color: var(--paper-radio-button-checked-color, --default-primary-color);
-webkit-transform: scale(0);
transform: scale(0);
transition: -webkit-transform ease 0.28s;
@@ -66,7 +66,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
:host([checked]) #offRadio {
- border-color: var(--paper-radio-button-checked-color);
+ border-color: var(--paper-radio-button-checked-color, --default-primary-color);
}
:host([checked]) #onRadio {
@@ -81,7 +81,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
margin-left: 10px;
white-space: normal;
pointer-events: none;
- color: var(--paper-radio-button-label-color);
+ color: var(--paper-radio-button-label-color, --primary-text-color);
}
#radioLabel[hidden] {
@@ -94,12 +94,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
:host([disabled]) #offRadio {
- border-color: var(--paper-radio-button-unchecked-color);
+ border-color: var(--paper-radio-button-unchecked-color, --primary-text-color);
opacity: 0.5;
}
:host([disabled][checked]) #onRadio {
- background-color: var(--paper-radio-button-unchecked-color);
+ background-color: var(--paper-radio-button-unchecked-color, --primary-text-color);
opacity: 0.5;
}
diff --git a/third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.html b/third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.html
index ab67812..63fba75 100644
--- a/third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.html
+++ b/third_party/polymer/v1_0/components/paper-radio-button/paper-radio-button.html
@@ -10,7 +10,7 @@ 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="../paper-ripple/paper-ripple.html">
<link rel="import" href="../paper-styles/default-theme.html">
-<link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<!--
`paper-radio-button` is a button that can be either checked or unchecked.
@@ -42,18 +42,6 @@ Custom property | Description | Default
@demo demo/index.html
-->
-<style is="custom-style">
- :root {
- --paper-radio-button-unchecked-color: var(--primary-text-color);
- --paper-radio-button-unchecked-ink-color: var(--primary-text-color);
-
- --paper-radio-button-checked-color: var(--default-primary-color);
- --paper-radio-button-checked-ink-color: var(--default-primary-color);
-
- --paper-radio-button-label-color: var(--primary-text-color);
- }
-</style>
-
<dom-module id="paper-radio-button">
<link rel="import" type="css" href="paper-radio-button.css">
@@ -75,7 +63,7 @@ Custom property | Description | Default
is: 'paper-radio-button',
behaviors: [
- Polymer.PaperRadioButtonBehavior
+ Polymer.PaperInkyFocusBehavior
],
hostAttributes: {
diff --git a/third_party/polymer/v1_0/components/paper-radio-group/.bower.json b/third_party/polymer/v1_0/components/paper-radio-group/.bower.json
index 5c09912..327bd4a 100644
--- a/third_party/polymer/v1_0/components/paper-radio-group/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-radio-group/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-radio-group",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A group of material design radio buttons",
"authors": [
"The Polymer Authors"
@@ -33,11 +33,11 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "b69ba0adcdc5e43773933e91009298360363b7bb"
+ "tag": "v1.0.2",
+ "commit": "8599c003cd2e914e688daed06170955433445c25"
},
"_source": "git://github.com/PolymerElements/paper-radio-group.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-radio-group/bower.json b/third_party/polymer/v1_0/components/paper-radio-group/bower.json
index 10e8b51..10e1eeb 100644
--- a/third_party/polymer/v1_0/components/paper-radio-group/bower.json
+++ b/third_party/polymer/v1_0/components/paper-radio-group/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-radio-group",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A group of material design radio buttons",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-radio-group/paper-radio-group.html b/third_party/polymer/v1_0/components/paper-radio-group/paper-radio-group.html
index 7960f27..d28b6d7 100644
--- a/third_party/polymer/v1_0/components/paper-radio-group/paper-radio-group.html
+++ b/third_party/polymer/v1_0/components/paper-radio-group/paper-radio-group.html
@@ -9,7 +9,7 @@ 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-selector/iron-selector.html">
+<link rel="import" href="../iron-selector/iron-selectable.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
@@ -42,16 +42,13 @@ information about `paper-radio-button`.
display: inline-block;
}
- iron-selector ::content > * {
+ :host ::content > * {
padding: 12px;
}
</style>
<template>
- <iron-selector selected="{{selected}}" attr-for-selected="name"
- selectable="paper-radio-button">
<content id="items" select="*"></content>
- </iron-selector>
</template>
</dom-module>
@@ -61,7 +58,8 @@ information about `paper-radio-button`.
is: 'paper-radio-group',
behaviors: [
- Polymer.IronA11yKeysBehavior
+ Polymer.IronA11yKeysBehavior,
+ Polymer.IronSelectableBehavior
],
hostAttributes: {
@@ -71,116 +69,76 @@ information about `paper-radio-button`.
properties: {
/**
- * Fired when the selected element changes to user interaction.
- *
- * @event paper-radio-group-changed
+ * Overriden from Polymer.IronSelectableBehavior
*/
+ attrForSelected: {
+ type: String,
+ value: 'name'
+ },
/**
- * Gets or sets the selected element. Use the `name` attribute of the
- * <paper-radio-button> that should be selected.
- *
- * @attribute selected
- * @type String
- * @default null
+ * Overriden from Polymer.IronSelectableBehavior
*/
-
- selected: {
+ selectedAttribute: {
type: String,
- value: null,
- notify: true,
- reflectToAttribute: true,
- observer: "_selectedChanged"
+ value: 'checked'
}
},
keyBindings: {
- 'left up': '_selectPrevious',
- 'right down': '_selectNext',
+ 'left up': 'selectPrevious',
+ 'right down': 'selectNext',
},
- _selectedChanged: function() {
- // TODO: This only needs to be async while a domReady event is unavailable.
- this.async(function() {
- this._selectIndex(this._valueToIndex(this.items, this.selected));
- this.fire('paper-radio-group-changed');
- });
- },
+ /**
+ * Selects the given value.
+ */
+ select: function(value) {
+ if (this.selected) {
+ var oldItem = this._valueToItem(this.selected);
+
+ // Do not allow unchecking the selected item.
+ if (this.selected == value) {
+ oldItem.checked = true;
+ return;
+ }
- _selectNext: function() {
- this.selected = this._nextNode();
- },
+ if (oldItem)
+ oldItem.checked = false;
+ }
- _selectPrevious: function() {
- this.selected = this._previousNode();
+ Polymer.IronSelectableBehavior.select.apply(this, [value]);
+ this.fire('paper-radio-group-changed');
},
/**
- * Returns an array of all items.
- *
- * @property items
- * @type array
+ * Selects the previous item. If the previous item is disabled, then it is
+ * skipped, and its previous item is selected
*/
- get items() {
- return Polymer.dom(this.$.items).getDistributedNodes();
- },
+ selectPrevious: function() {
+ var length = this.items.length;
+ var newIndex = Number(this._valueToIndex(this.selected));
- _nextNode: function() {
- var items = this.items;
- var index = this._selectedIndex;
- var newIndex = index;
do {
- newIndex = (newIndex + 1) % items.length;
- if (newIndex === index) {
- break;
- }
- } while (items[newIndex].disabled);
- return this._valueForNode(items[newIndex]);
- },
+ newIndex = (newIndex - 1 + length) % length;
+ } while (this.items[newIndex].disabled)
- _previousNode: function() {
- var items = this.items;
- var index = this._selectedIndex;
- var newIndex = index;
- do {
- newIndex = (newIndex || items.length) - 1;
- if (newIndex === index) {
- break;
- }
- } while (items[newIndex].disabled);
- return this._valueForNode(items[newIndex]);
+ this.select(this._indexToValue(newIndex));
},
- _selectIndex: function(index) {
- if (index == this._selectedIndex)
- return;
-
- var nodes = this.items;
-
- // If there was a previously selected node, deselect it.
- if (nodes[this._selectedIndex]) {
- nodes[this._selectedIndex].checked = false;
- }
+ /**
+ * Selects the next item. If the next item is disabled, then it is
+ * skipped, and its nexy item is selected
+ */
+ selectNext: function() {
+ var length = this.items.length;
+ var newIndex = Number(this._valueToIndex(this.selected));
- // Select a new node.
- nodes[index].checked = true;
- nodes[index].focus();
- this._selectedIndex = index;
- },
+ do {
+ newIndex = (newIndex + 1 + length) % length;
+ } while (this.items[newIndex].disabled)
- _valueForNode: function(node) {
- return node["name"] || node.getAttribute("name");
+ this.select(this._indexToValue(newIndex));
},
-
- // Finds an item with value == |value| and return its index.
- _valueToIndex: function(items, value) {
- for (var index = 0, node; (node = items[index]); index++) {
- if (this._valueForNode(node) == value) {
- return index;
- }
- }
- // If no item found, the value itself is probably the index.
- return value;
- }
});
</script>
diff --git a/third_party/polymer/v1_0/components/paper-ripple/.bower.json b/third_party/polymer/v1_0/components/paper-ripple/.bower.json
index 1b45160..93d8b8c 100644
--- a/third_party/polymer/v1_0/components/paper-ripple/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-ripple/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-ripple",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Adds a material design ripple to any container",
"private": true,
@@ -27,11 +27,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-ripple",
- "_release": "1.0.0",
+ "_release": "1.0.1",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "bcf189cf43bd935dec7a09868988f33a7bdd25fe"
+ "tag": "v1.0.1",
+ "commit": "af19d904802437c305390bb03415c11661de3d0a"
},
"_source": "git://github.com/PolymerElements/paper-ripple.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-ripple/bower.json b/third_party/polymer/v1_0/components/paper-ripple/bower.json
index 55b8678..b9bb0d9 100644
--- a/third_party/polymer/v1_0/components/paper-ripple/bower.json
+++ b/third_party/polymer/v1_0/components/paper-ripple/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-ripple",
- "version": "1.0.0",
+ "version": "1.0.1",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "Adds a material design ripple to any container",
"private": true,
diff --git a/third_party/polymer/v1_0/components/paper-ripple/paper-ripple.html b/third_party/polymer/v1_0/components/paper-ripple/paper-ripple.html
index 704738c..08d3da1 100644
--- a/third_party/polymer/v1_0/components/paper-ripple/paper-ripple.html
+++ b/third_party/polymer/v1_0/components/paper-ripple/paper-ripple.html
@@ -392,6 +392,7 @@ Apply `circle` class to make the rippling effect within a circle.
this.wave.style.transform = 'scale3d(' + scale + ',' + scale + ',1)';
},
+ /** @param {Event=} event */
downAction: function(event) {
var xCenter = this.containerMetrics.width / 2;
var yCenter = this.containerMetrics.height / 2;
@@ -436,6 +437,7 @@ Apply `circle` class to make the rippling effect within a circle.
this.waveContainer.style.height = this.containerMetrics.size + 'px';
},
+ /** @param {Event=} event */
upAction: function(event) {
if (!this.isMouseDown) {
return;
@@ -559,11 +561,9 @@ Apply `circle` class to make the rippling effect within a circle.
var ownerRoot = Polymer.dom(this).getOwnerRoot();
var target;
- if (ownerRoot) {
+ if (this.parentNode.nodeType == 11) { // DOCUMENT_FRAGMENT_NODE
target = ownerRoot.host;
- }
-
- if (!target) {
+ } else {
target = this.parentNode;
}
@@ -577,8 +577,8 @@ Apply `circle` class to make the rippling effect within a circle.
},
attached: function() {
- this._listen(this.target, 'up', this.upAction.bind(this));
- this._listen(this.target, 'down', this.downAction.bind(this));
+ this.listen(this.target, 'up', 'upAction');
+ this.listen(this.target, 'down', 'downAction');
if (!this.target.hasAttribute('noink')) {
this.keyEventTarget = this.target;
@@ -604,6 +604,7 @@ Apply `circle` class to make the rippling effect within a circle.
}, 1);
},
+ /** @param {Event=} event */
downAction: function(event) {
if (this.holdDown && this.ripples.length > 0) {
return;
@@ -618,6 +619,7 @@ Apply `circle` class to make the rippling effect within a circle.
}
},
+ /** @param {Event=} event */
upAction: function(event) {
if (this.holdDown) {
return;
diff --git a/third_party/polymer/v1_0/components/paper-scroll-header-panel/.bower.json b/third_party/polymer/v1_0/components/paper-scroll-header-panel/.bower.json
index 18b4ee3..18736ee 100644
--- a/third_party/polymer/v1_0/components/paper-scroll-header-panel/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-scroll-header-panel/.bower.json
@@ -1,7 +1,7 @@
{
"name": "paper-scroll-header-panel",
"description": "A header bar with scrolling behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"private": true,
"authors": "The Polymer Authors",
@@ -36,11 +36,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-scroll-header-panel",
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "2b8db7a3cb8bfc7c8811438dd8cdfbdfda65d4d3"
+ "tag": "v1.0.2",
+ "commit": "99768fba06e038ffdeeb2b229515f9af7b4b1575"
},
"_source": "git://github.com/PolymerElements/paper-scroll-header-panel.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-scroll-header-panel/README.md b/third_party/polymer/v1_0/components/paper-scroll-header-panel/README.md
index ac1be0c..78f6376 100644
--- a/third_party/polymer/v1_0/components/paper-scroll-header-panel/README.md
+++ b/third_party/polymer/v1_0/components/paper-scroll-header-panel/README.md
@@ -24,7 +24,7 @@ paper-scroll-header-panel {
height: 100%;
}
```
-`paper-scroll-header-panel` works well with `paper-toolbar` but can use any element that represents a header by adding a core-header class to it.
+`paper-scroll-header-panel` works well with `paper-toolbar` but can use any element that represents a header by adding a `paper-header` class to it.
```html
<paper-scroll-header-panel>
diff --git a/third_party/polymer/v1_0/components/paper-scroll-header-panel/bower.json b/third_party/polymer/v1_0/components/paper-scroll-header-panel/bower.json
index 86ac91c..8075eae 100644
--- a/third_party/polymer/v1_0/components/paper-scroll-header-panel/bower.json
+++ b/third_party/polymer/v1_0/components/paper-scroll-header-panel/bower.json
@@ -1,7 +1,7 @@
{
"name": "paper-scroll-header-panel",
"description": "A header bar with scrolling behavior",
- "version": "1.0.1",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"private": true,
"authors": "The Polymer Authors",
diff --git a/third_party/polymer/v1_0/components/paper-scroll-header-panel/paper-scroll-header-panel.html b/third_party/polymer/v1_0/components/paper-scroll-header-panel/paper-scroll-header-panel.html
index 3cb82f1..740e9c7c 100644
--- a/third_party/polymer/v1_0/components/paper-scroll-header-panel/paper-scroll-header-panel.html
+++ b/third_party/polymer/v1_0/components/paper-scroll-header-panel/paper-scroll-header-panel.html
@@ -41,7 +41,7 @@ or, if you would prefer to do it in CSS, just give `html`, `body`, and `paper-sc
}
`paper-scroll-header-panel` works well with `paper-toolbar` but can use any element
-that represents a header by adding a `core-header` class to it.
+that represents a header by adding a `paper-header` class to it.
<paper-scroll-header-panel>
<paper-toolbar>Header</paper-toolbar>
@@ -378,7 +378,7 @@ Styling scroll-header-panel:
_condenseHeader: function(y) {
var reset = (y === null);
- // adjust top bar in core-header so the top bar stays at the top
+ // adjust top bar in paper-header so the top bar stays at the top
if (!this.scrollAwayTopbar && this.header.$ && this.header.$.topBar) {
this._translateY(this.header.$.topBar.style,
reset ? null : Math.min(y, this._headerMargin));
@@ -406,6 +406,7 @@ Styling scroll-header-panel:
setTransform(s, t);
},
+ /** @param {Event=} event */
_scroll: function(event) {
if (!this.header) {
return;
@@ -432,7 +433,7 @@ Styling scroll-header-panel:
this._y = y;
if (event) {
- this.fire('content-scroll', {target: this.scroller}, this, false);
+ this.fire('content-scroll', {target: this.scroller}, {cancelable: false});
}
}
diff --git a/third_party/polymer/v1_0/components/paper-slider/.bower.json b/third_party/polymer/v1_0/components/paper-slider/.bower.json
index 9b0a642..99e51fb 100644
--- a/third_party/polymer/v1_0/components/paper-slider/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-slider/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-slider",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A material design-style slider",
"license": "http://polymer.github.io/LICENSE.txt",
"authors": "The Polymer Authors",
@@ -23,20 +23,25 @@
"paper-progress": "PolymerElements/paper-progress#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
- "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0"
+ "paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
+ "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0",
+ "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-slider",
- "_release": "1.0.1",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "995905314b4aeffab020bdd53b0f68cc7b448a1d"
+ "tag": "v1.0.2",
+ "commit": "88ca34f8b87059a2cb187a4a42f5105756a30eff"
},
"_source": "git://github.com/PolymerElements/paper-slider.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-slider/bower.json b/third_party/polymer/v1_0/components/paper-slider/bower.json
index c40c262..127b9ac 100644
--- a/third_party/polymer/v1_0/components/paper-slider/bower.json
+++ b/third_party/polymer/v1_0/components/paper-slider/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-slider",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "A material design-style slider",
"license": "http://polymer.github.io/LICENSE.txt",
"authors": "The Polymer Authors",
@@ -23,11 +23,16 @@
"paper-progress": "PolymerElements/paper-progress#^1.0.0",
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
- "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0"
+ "paper-ripple": "PolymerElements/paper-ripple#^1.0.0",
+ "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0",
+ "paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
+ "iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0",
+ "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}
diff --git a/third_party/polymer/v1_0/components/paper-slider/paper-slider.css b/third_party/polymer/v1_0/components/paper-slider/paper-slider.css
index 0e0f784..0fd8682 100644
--- a/third_party/polymer/v1_0/components/paper-slider/paper-slider.css
+++ b/third_party/polymer/v1_0/components/paper-slider/paper-slider.css
@@ -116,7 +116,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
.transiting #sliderBar::shadow #activeProgress {
- transition: -webkit-transform 0.08s ease;
+ -webkit-transition: -webkit-transform 0.08s ease;
transition: transform 0.08s ease;
}
@@ -249,4 +249,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
.disabled.ring > #sliderKnob > #sliderKnobInner {
background-color: transparent;
-} \ No newline at end of file
+}
+
+paper-ripple {
+ color: var(--paper-slider-knob-color, --google-blue-700);
+}
diff --git a/third_party/polymer/v1_0/components/paper-slider/paper-slider.html b/third_party/polymer/v1_0/components/paper-slider/paper-slider.html
index 135dba8..c51236f 100644
--- a/third_party/polymer/v1_0/components/paper-slider/paper-slider.html
+++ b/third_party/polymer/v1_0/components/paper-slider/paper-slider.html
@@ -8,11 +8,14 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
-->
+<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../paper-styles/paper-styles.html">
-<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
-<link rel="import" href="../iron-behaviors/iron-control-state.html">
<link rel="import" href="../paper-progress/paper-progress.html">
<link rel="import" href="../paper-input/paper-input.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
+<link rel="import" href="../paper-ripple/paper-ripple.html">
+<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
+<link rel="import" href="../iron-form-element-behavior/iron-form-element-behavior.html">
<!--
`paper-slider` allows user to select a value from a range of values by
@@ -81,15 +84,26 @@ To change the slider disabled secondary progress bar color:
-->
<dom-module id="paper-slider">
+
<link rel="import" type="css" href="paper-slider.css">
+
<template>
- <template is="dom-if" if="{{!disabled}}">
- </template>
+ <div id="sliderContainer"
+ class$="[[_getClassNames(disabled, pin, snaps, immediateValue, min, expand, dragging, transiting, editable)]]">
- <div id="sliderContainer" class$="[[_getClassNames(disabled, pin, snaps, immediateValue, min, expand, dragging, transiting, editable)]]">
<div class="bar-container">
- <paper-progress id="sliderBar" aria-hidden="true" min="[[min]]" max="[[max]]" value="[[immediateValue]]" secondary-progress="[[secondaryProgress]]"
- on-down="_bardown" on-up="_resetKnob" on-track="_onTrack"></paper-progress>
+ <paper-progress
+ id="sliderBar"
+ aria-hidden="true"
+ min="[[min]]"
+ max="[[max]]"
+ step="[[step]]"
+ value="[[immediateValue]]"
+ secondary-progress="[[secondaryProgress]]"
+ on-down="_bardown"
+ on-up="_resetKnob"
+ on-track="_onTrack">
+ </paper-progress>
</div>
<template is="dom-if" if="[[snaps]]">
@@ -100,20 +114,27 @@ To change the slider disabled secondary progress bar color:
</div>
</template>
- <div id="sliderKnob" on-down="_knobdown" on-up="_resetKnob"
+ <div id="sliderKnob"
+ class="center-justified center horizontal layout"
+ on-down="_knobdown"
+ on-up="_resetKnob"
on-track="_onTrack"
- on-transitionend="_knobTransitionEnd"
- center-justified center horizontal layout>
-
- <div id="sliderKnobInner" value$="[[immediateValue]]"></div>
+ on-transitionend="_knobTransitionEnd">
+ <paper-ripple id="ink" class="circle" center></paper-ripple>
+ <div id="sliderKnobInner" value$="[[immediateValue]]"></div>
</div>
</div>
<template is="dom-if" if="[[editable]]">
- <paper-input id="input" class="slider-input" disabled$="[[disabled]]" on-change="_inputChange"></paper-input>
+ <paper-input
+ id="input"
+ class="slider-input"
+ disabled$="[[disabled]]"
+ on-change="_inputChange">
+ </paper-input>
</template>
-
</template>
+
</dom-module>
<script>
@@ -143,11 +164,12 @@ To change the slider disabled secondary progress bar color:
behaviors: [
Polymer.IronRangeBehavior,
- Polymer.IronControlState
+ Polymer.IronA11yKeysBehavior,
+ Polymer.IronFormElementBehavior,
+ Polymer.PaperInkyFocusBehavior
],
properties: {
-
/**
* If true, the slider thumb snaps to tick marks evenly spaced based
* on the `step` property value.
@@ -160,7 +182,7 @@ To change the slider disabled secondary progress bar color:
/**
* If true, a pin with numeric value label is shown when the slider thumb
- * is pressed. Use for settings for which users need to know the exact
+ * is pressed. Use for settings for which users need to know the exact
* value of the setting.
*/
pin: {
@@ -232,6 +254,7 @@ To change the slider disabled secondary progress bar color:
},
markers: {
+ type: Array,
readOnly: true,
value: []
},
@@ -245,8 +268,19 @@ To change the slider disabled secondary progress bar color:
'_immediateValueChanged(immediateValue)'
],
+ hostAttributes: {
+ role: 'slider',
+ tabindex: 0
+ },
+
+ keyBindings: {
+ 'left down pagedown home': '_decrementKey',
+ 'right up pageup end': '_incrementKey'
+ },
+
ready: function() {
// issue polymer/polymer#1305
+
this.async(function() {
this._updateKnob(this.value);
this._updateInputValue();
@@ -287,11 +321,12 @@ To change the slider disabled secondary progress bar color:
},
_immediateValueChanged: function() {
- if (!this.dragging) {
+ if (this.dragging) {
+ this.fire('immediate-value-change');
+ } else {
this.value = this.immediateValue;
}
this._updateInputValue();
- this.fire('immediate-value-change');
},
_secondaryProgressChanged: function() {
@@ -300,23 +335,26 @@ To change the slider disabled secondary progress bar color:
_updateInputValue: function() {
if (this.editable) {
- this.$$('#input').value = this.immediateValue;
+ this.$$('#input').value = this.immediateValue.toString();
}
},
_expandKnob: function() {
+ this.$.ink.holdDown = false;
this._setExpand(true);
},
_resetKnob: function() {
- this._expandJob && this._expandJob.stop();
+ this.cancelDebouncer('expandKnob');
this._setExpand(false);
+ this.$.ink.hidden = true;
},
_positionKnob: function(ratio) {
- this._setImmediateValue(this._calcStep(this._calcKnobPosition(ratio)) || 0);
- this._setRatio(this.snaps ? this._calcRatio(this.immediateValue) : ratio);
- this.$.sliderKnob.style.left = this.ratio * 100 + '%';
+ this._setImmediateValue(this._calcStep(this._calcKnobPosition(ratio)));
+ this._setRatio(this._calcRatio(this.immediateValue));
+
+ this.$.sliderKnob.style.left = (this.ratio * 100) + '%';
},
_inputChange: function() {
@@ -328,75 +366,104 @@ To change the slider disabled secondary progress bar color:
return (this.max - this.min) * ratio + this.min;
},
- _onTrack: function(e) {
+ _onTrack: function(event) {
switch (event.detail.state) {
- case 'end':
- this._trackEnd(event);
+ case 'start':
+ this._trackStart(event);
break;
case 'track':
this._trackX(event);
break;
- case 'start':
- this._trackStart(event);
+ case 'end':
+ this._trackEnd();
break;
}
},
- _trackStart: function(e) {
+ _trackStart: function(event) {
this._w = this.$.sliderBar.offsetWidth;
this._x = this.ratio * this._w;
this._startx = this._x || 0;
this._minx = - this._startx;
this._maxx = this._w - this._startx;
this.$.sliderKnob.classList.add('dragging');
+
this._setDragging(true);
- e.preventDefault();
},
_trackX: function(e) {
if (!this.dragging) {
this._trackStart(e);
}
- var x = Math.min(this._maxx, Math.max(this._minx, e.detail.dx));
- this._x = this._startx + x;
- this._setImmediateValue(this._calcStep(
- this._calcKnobPosition(this._x / this._w)) || 0);
- var s = this.$.sliderKnob.style;
- s.transform = s.webkitTransform = 'translate3d(' + (this.snaps ?
- (this._calcRatio(this.immediateValue) * this._w) - this._startx : x) + 'px, 0, 0)';
+
+ var dx = Math.min(this._maxx, Math.max(this._minx, e.detail.dx));
+ this._x = this._startx + dx;
+
+ var immediateValue = this._calcStep(this._calcKnobPosition(this._x / this._w));
+ this._setImmediateValue(immediateValue);
+
+ // update knob's position
+ var translateX = ((this._calcRatio(immediateValue) * this._w) - this._startx);
+ this.translate3d(translateX + 'px', 0, 0, this.$.sliderKnob);
},
_trackEnd: function() {
- var s = this.$.sliderKnob.style;
- s.transform = s.webkitTransform = '';
+ var s = this.$.sliderKnob.style;
+
this.$.sliderKnob.classList.remove('dragging');
this._setDragging(false);
this._resetKnob();
this.value = this.immediateValue;
+
+ s.transform = s.webkitTransform = '';
+
this.fire('change');
},
- _knobdown: function(e) {
- e.preventDefault();
+ _knobdown: function(event) {
this._expandKnob();
+
+ // cancel selection
+ event.detail.sourceEvent.preventDefault();
+
+ // set the focus manually because we will called prevent default
+ this.focus();
},
- _bardown: function(e) {
- e.preventDefault();
- this._setTransiting(true);
+ _bardown: function(event) {
+ this.$.ink.hidden = true;
+
+ event.preventDefault();
+
this._w = this.$.sliderBar.offsetWidth;
var rect = this.$.sliderBar.getBoundingClientRect();
- var ratio = (e.detail.x - rect.left) / this._w;
+ var ratio = (event.detail.x - rect.left) / this._w;
+ var prevRatio = this.ratio;
+
+ this._setTransiting(true);
+
this._positionKnob(ratio);
- this._expandJob = this.debounce(this._expandJob, this._expandKnob, 60);
+
+ this.debounce('expandKnob', this._expandKnob, 60);
+
+ // if the ratio doesn't change, sliderKnob's animation won't start
+ // and `_knobTransitionEnd` won't be called
+ // Therefore, we need to manually update the `transiting` state
+
+ if (prevRatio === this.ratio) {
+ this._setTransiting(false);
+ }
this.async(function() {
this.fire('change');
});
+
+ // cancel selection
+ event.detail.sourceEvent.preventDefault();
},
- _knobTransitionEnd: function(e) {
- if (e.target === this.$.sliderKnob) {
+ _knobTransitionEnd: function(event) {
+ if (event.target === this.$.sliderKnob) {
this._setTransiting(false);
}
},
@@ -413,14 +480,14 @@ To change the slider disabled secondary progress bar color:
_getClassNames: function() {
var classes = {};
- classes['disabled'] = this.disabled;
- classes['pin'] = this.pin;
- classes['snaps'] = this.snaps;
- classes['ring'] = this.immediateValue <= this.min;
- classes['expand'] = this.expand;
- classes['dragging'] = this.dragging;
- classes['transiting'] = this.transiting;
- classes['editable'] = this.editable;
+ classes.disabled = this.disabled;
+ classes.pin = this.pin;
+ classes.snaps = this.snaps;
+ classes.ring = this.immediateValue <= this.min;
+ classes.expand = this.expand;
+ classes.dragging = this.dragging;
+ classes.transiting = this.transiting;
+ classes.editable = this.editable;
return Object.keys(classes).filter(
function(className) {
@@ -428,8 +495,8 @@ To change the slider disabled secondary progress bar color:
}).join(' ');
},
- _incrementKey: function(ev, keys) {
- if (keys.key === 'end') {
+ _incrementKey: function(event) {
+ if (event.detail.key === 'end') {
this.value = this.max;
} else {
this.increment();
@@ -437,8 +504,8 @@ To change the slider disabled secondary progress bar color:
this.fire('change');
},
- _decrementKey: function(ev, keys) {
- if (keys.key === 'home') {
+ _decrementKey: function(event) {
+ if (event.detail.key === 'home') {
this.value = this.min;
} else {
this.decrement();
diff --git a/third_party/polymer/v1_0/components/paper-styles/.bower.json b/third_party/polymer/v1_0/components/paper-styles/.bower.json
index 46a6457..8de16cb 100644
--- a/third_party/polymer/v1_0/components/paper-styles/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-styles/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-styles",
- "version": "1.0.3",
+ "version": "1.0.4",
"description": "Common (global) styles for Material Design elements.",
"authors": [
"The Polymer Authors"
@@ -24,11 +24,11 @@
"devDependencies": {
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.3",
+ "_release": "1.0.4",
"_resolution": {
"type": "version",
- "tag": "v1.0.3",
- "commit": "64adbb4e15214cdc0e5df1ac4b8f2d9e2eca6076"
+ "tag": "v1.0.4",
+ "commit": "d23af125cb74978532c25e5cd152f9b2e6d991c8"
},
"_source": "git://github.com/PolymerElements/paper-styles.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-styles/bower.json b/third_party/polymer/v1_0/components/paper-styles/bower.json
index c818d34..930947d 100644
--- a/third_party/polymer/v1_0/components/paper-styles/bower.json
+++ b/third_party/polymer/v1_0/components/paper-styles/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-styles",
- "version": "1.0.3",
+ "version": "1.0.4",
"description": "Common (global) styles for Material Design elements.",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-styles/color.html b/third_party/polymer/v1_0/components/paper-styles/color.html
index 5f8f887..f0be341 100644
--- a/third_party/polymer/v1_0/components/paper-styles/color.html
+++ b/third_party/polymer/v1_0/components/paper-styles/color.html
@@ -283,9 +283,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--paper-deep-orange-a400: #ff3d00;
--paper-deep-orange-a700: #dd2c00;
- --paper-brown-50: #795548;
- --paper-brown-100: #efebe9;
- --paper-brown-200: #d7ccc8;
+ --paper-brown-50: #efebe9;
+ --paper-brown-100: #d7ccc8;
+ --paper-brown-200: #bcaaa4;
--paper-brown-300: #a1887f;
--paper-brown-400: #8d6e63;
--paper-brown-500: #795548;
diff --git a/third_party/polymer/v1_0/components/paper-styles/demo-pages.html b/third_party/polymer/v1_0/components/paper-styles/demo-pages.html
index 9fc5739..44f2288 100644
--- a/third_party/polymer/v1_0/components/paper-styles/demo-pages.html
+++ b/third_party/polymer/v1_0/components/paper-styles/demo-pages.html
@@ -9,7 +9,11 @@ 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-flex-layout/iron-flex-layout.html">
+
<link rel="import" href="color.html">
+<link rel="import" href="typography.html">
<link rel="import" href="shadow.html">
<style is="custom-style">
@@ -56,6 +60,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
margin-right: auto;
}
+ code {
+ color: var(--google-grey-700);
+ }
+
/* TODO: remove this hack and use horizontal-section-container instead */
body > div.layout.horizontal.center-justified {
@apply(--layout-wrap);
diff --git a/third_party/polymer/v1_0/components/paper-toggle-button/.bower.json b/third_party/polymer/v1_0/components/paper-toggle-button/.bower.json
index dae78ed..db09a19 100644
--- a/third_party/polymer/v1_0/components/paper-toggle-button/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-toggle-button/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-toggle-button",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design toggle button control",
"authors": [
"The Polymer Authors"
@@ -33,11 +33,11 @@
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.1",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.1",
- "commit": "577b045eea2d8e7623fcce40001a2d9e7008bd60"
+ "tag": "v1.0.3",
+ "commit": "34235a35f65be5efadc8fc5c6f6e5dee0fbb6c52"
},
"_source": "git://github.com/PolymerElements/paper-toggle-button.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-toggle-button/bower.json b/third_party/polymer/v1_0/components/paper-toggle-button/bower.json
index f7404f2..2a80170 100644
--- a/third_party/polymer/v1_0/components/paper-toggle-button/bower.json
+++ b/third_party/polymer/v1_0/components/paper-toggle-button/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-toggle-button",
- "version": "1.0.1",
+ "version": "1.0.3",
"description": "A material design toggle button control",
"authors": [
"The Polymer Authors"
diff --git a/third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.css b/third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.css
index 8eb9d2d..bdadd9d 100644
--- a/third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.css
+++ b/third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.css
@@ -21,27 +21,27 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
:host .toggle-bar {
- background-color: var(--paper-toggle-button-unchecked-bar-color);
+ background-color: var(--paper-toggle-button-unchecked-bar-color, #000000);
}
:host .toggle-button {
- background-color: var(--paper-toggle-button-unchecked-button-color);
+ background-color: var(--paper-toggle-button-unchecked-button-color, --paper-grey-50);
}
:host([checked]) .toggle-bar {
- background-color: var(--paper-toggle-button-checked-bar-color);
+ background-color: var(--paper-toggle-button-checked-bar-color, --google-green-500);
}
:host([checked]) .toggle-button {
- background-color: var(--paper-toggle-button-checked-button-color);
+ background-color: var(--paper-toggle-button-checked-button-color, --google-green-500);
}
:host .toggle-ink {
- color: var(--paper-toggle-button-unchecked-ink-color);
+ color: var(--paper-toggle-button-unchecked-ink-color, --primary-text-color);
}
:host([checked]) .toggle-ink {
- color: var(--paper-toggle-button-checked-ink-color);
+ color: var(--paper-toggle-button-checked-ink-color, --google-green-500);
}
/* ID selectors should not be overriden by users. */
diff --git a/third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.html b/third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.html
index 8e9eee4..a531907 100644
--- a/third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.html
+++ b/third_party/polymer/v1_0/components/paper-toggle-button/paper-toggle-button.html
@@ -10,7 +10,7 @@ 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="../paper-ripple/paper-ripple.html">
-<link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<!--
`paper-toggle-button` provides a ON/OFF switch that user can toggle the state
@@ -38,17 +38,6 @@ Custom property | Description | Default
@hero hero.svg
@demo demo/index.html
-->
-<style is="custom-style">
- :root {
- --paper-toggle-button-unchecked-bar-color: #000000;
- --paper-toggle-button-unchecked-button-color: var(--paper-grey-50);
- --paper-toggle-button-unchecked-ink-color: var(--dark-primary-color);
-
- --paper-toggle-button-checked-bar-color: var(--google-green-500);
- --paper-toggle-button-checked-button-color: var(--google-green-500);
- --paper-toggle-button-checked-ink-color: var(--google-green-500);
- }
-</style>
<dom-module id="paper-toggle-button">
@@ -70,7 +59,7 @@ Custom property | Description | Default
is: 'paper-toggle-button',
behaviors: [
- Polymer.PaperRadioButtonBehavior
+ Polymer.PaperInkyFocusBehavior
],
hostAttributes: {
diff --git a/third_party/polymer/v1_0/components/paper-toolbar/.bower.json b/third_party/polymer/v1_0/components/paper-toolbar/.bower.json
index ac01bd5..de532ef 100644
--- a/third_party/polymer/v1_0/components/paper-toolbar/.bower.json
+++ b/third_party/polymer/v1_0/components/paper-toolbar/.bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-toolbar",
- "version": "1.0.0",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "A material design toolbar that is easily customizable",
"private": true,
@@ -33,11 +33,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/paper-toolbar",
- "_release": "1.0.0",
+ "_release": "1.0.2",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "6d0a50375e529a5f750c3a30324d5de8a8824fd1"
+ "tag": "v1.0.2",
+ "commit": "402eb11da736a5ae19713748bfa04cd96f3f7a0c"
},
"_source": "git://github.com/PolymerElements/paper-toolbar.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components/paper-toolbar/README.md b/third_party/polymer/v1_0/components/paper-toolbar/README.md
index d9f7c05..ef525f4 100644
--- a/third_party/polymer/v1_0/components/paper-toolbar/README.md
+++ b/third_party/polymer/v1_0/components/paper-toolbar/README.md
@@ -12,7 +12,7 @@ Example:
```html
<paper-toolbar>
<paper-icon-button icon="menu" on-tap="{{menuAction}}"></paper-icon-button>
- <div title>Title</div>
+ <div class="title">Title</div>
<paper-icon-button icon="more" on-tap="{{moreAction}}"></paper-icon-button>
</paper-toolbar>
```
@@ -41,8 +41,8 @@ When `tall`, items can pin to either the top (default), middle or bottom. Use
```html
<paper-toolbar class="tall">
<paper-icon-button icon="menu"></paper-icon-button>
- <div title class="middle">Middle Title</div>
- <div title class="bottom">Bottom Title</div>
+ <div class="title middle">Middle Title</div>
+ <div class="title bottom">Bottom Title</div>
</paper-toolbar>
```
diff --git a/third_party/polymer/v1_0/components/paper-toolbar/bower.json b/third_party/polymer/v1_0/components/paper-toolbar/bower.json
index 3c26395..26a02b6 100644
--- a/third_party/polymer/v1_0/components/paper-toolbar/bower.json
+++ b/third_party/polymer/v1_0/components/paper-toolbar/bower.json
@@ -1,6 +1,6 @@
{
"name": "paper-toolbar",
- "version": "1.0.0",
+ "version": "1.0.2",
"license": "http://polymer.github.io/LICENSE.txt",
"description": "A material design toolbar that is easily customizable",
"private": true,
diff --git a/third_party/polymer/v1_0/components/paper-toolbar/paper-toolbar.html b/third_party/polymer/v1_0/components/paper-toolbar/paper-toolbar.html
index 1bee9c3..153305e 100644
--- a/third_party/polymer/v1_0/components/paper-toolbar/paper-toolbar.html
+++ b/third_party/polymer/v1_0/components/paper-toolbar/paper-toolbar.html
@@ -21,8 +21,8 @@ Example:
<paper-toolbar>
<paper-icon-button icon="menu" on-tap="menuAction"></paper-icon-button>
- <div title>Title</div>
- <paper-icon-button icon="more" on-tap="moreAction"></paper-icon-button>
+ <div class="title">Title</div>
+ <paper-icon-button icon="more-vert" on-tap="moreAction"></paper-icon-button>
</paper-toolbar>
`paper-toolbar` has a standard height, but can made be taller by setting `tall`
@@ -44,8 +44,8 @@ When `tall`, items can pin to either the top (default), middle or bottom. Use
<paper-toolbar class="tall">
<paper-icon-button icon="menu"></paper-icon-button>
- <div title class="middle">Middle Title</div>
- <div title class="bottom">Bottom Title</div>
+ <div class="middle title">Middle Title</div>
+ <div class="bottom title">Bottom Title</div>
</paper-toolbar>
For `medium-tall` toolbar, the middle and bottom contents overlap and are
@@ -64,7 +64,7 @@ Custom property | Description | Default
### Accessibility
-`<paper-toolbar>` has `role="toolbar"` by default. Any elements with the `title` attribute will
+`<paper-toolbar>` has `role="toolbar"` by default. Any elements with the class `title` will
be used as the label of the toolbar via `aria-labelledby`.
@demo demo/index.html
@@ -133,7 +133,6 @@ be used as the label of the toolbar via `aria-labelledby`.
#topBar {
position: relative;
- z-index: 1;
}
/* middle bar */
@@ -142,7 +141,6 @@ be used as the label of the toolbar via `aria-labelledby`.
top: 0;
right: 0;
left: 0;
- z-index: 2;
}
:host(.tall) #middleBar,
@@ -157,7 +155,6 @@ be used as the label of the toolbar via `aria-labelledby`.
right: 0;
bottom: 0;
left: 0;
- z-index: 1;
}
/*
@@ -171,10 +168,11 @@ be used as the label of the toolbar via `aria-labelledby`.
pointer-events: auto;
}
- .toolbar-tools > ::content [title] {
+ .toolbar-tools > ::content .title {
@apply(--paper-font-title);
@apply(--layout-flex);
+ pointer-events: none;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
@@ -194,23 +192,18 @@ be used as the label of the toolbar via `aria-labelledby`.
* Work in progress.
*/
.toolbar-tools > ::content paper-icon-button[icon=menu] {
- margin-left: -8px;
margin-right: 24px;
}
- .toolbar-tools > ::content paper-icon-button + paper-icon-button {
- margin-right: -8px;
- }
-
- .toolbar-tools > ::content > [title],
- .toolbar-tools > ::content[select=".middle"] > [title],
- .toolbar-tools > ::content[select=".bottom"] > [title] {
+ .toolbar-tools > ::content > .title,
+ .toolbar-tools > ::content[select=".middle"] > .title,
+ .toolbar-tools > ::content[select=".bottom"] > .title {
margin-left: 56px;
}
- .toolbar-tools > ::content > paper-icon-button + [title],
- .toolbar-tools > ::content[select=".middle"] paper-icon-button + [title],
- .toolbar-tools > ::content[select=".bottom"] paper-icon-button + [title] {
+ .toolbar-tools > ::content > paper-icon-button + .title,
+ .toolbar-tools > ::content[select=".middle"] paper-icon-button + .title,
+ .toolbar-tools > ::content[select=".bottom"] paper-icon-button + .title {
margin-left: 0;
}
</style>
@@ -331,7 +324,7 @@ be used as the label of the toolbar via `aria-labelledby`.
for (var content, index = 0; content = contents[index]; index++) {
var nodes = Polymer.dom(content).getDistributedNodes();
for (var node, jndex = 0; node = nodes[jndex]; jndex++) {
- if (node.hasAttribute && node.hasAttribute('title')) {
+ if (node.classList && node.classList.contains('title')) {
if (node.id) {
labelledBy.push(node.id);
} else {
diff --git a/third_party/polymer/v1_0/components/polymer-externs/.bower.json b/third_party/polymer/v1_0/components/polymer-externs/.bower.json
index 3b1c1de..2ee5eab 100644
--- a/third_party/polymer/v1_0/components/polymer-externs/.bower.json
+++ b/third_party/polymer/v1_0/components/polymer-externs/.bower.json
@@ -1,12 +1,12 @@
{
"name": "polymer-externs",
"homepage": "https://github.com/PolymerLabs/polymer-externs",
- "version": "1.0.0",
- "_release": "1.0.0",
+ "version": "1.0.3",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.0",
- "commit": "1f2d54817701edfd0ded01e88ae0549e48efac49"
+ "tag": "v1.0.3",
+ "commit": "a9ff08086ba7541111e2d16a7418030b3e5f4711"
},
"_source": "git://github.com/PolymerLabs/polymer-externs.git",
"_target": "~1.0.0",
diff --git a/third_party/polymer/v1_0/components/polymer-externs/polymer.externs.js b/third_party/polymer/v1_0/components/polymer-externs/polymer.externs.js
index d07a15b..41008e3 100644
--- a/third_party/polymer/v1_0/components/polymer-externs/polymer.externs.js
+++ b/third_party/polymer/v1_0/components/polymer-externs/polymer.externs.js
@@ -53,11 +53,11 @@ PolymerElement.prototype.is;
PolymerElement.prototype.extends;
/**
- * An array of objects whose properties get mixed in to this element.
- *
+ * An array of objects whose properties get added to this element.
+ * @see https://www.polymer-project.org/1.0/docs/devguide/behaviors.html
* @type {!Array<!Object>|undefined}
*/
-PolymerElement.prototype.mixins;
+PolymerElement.prototype.behaviors;
/**
* A string-separated list of dependent properties that should result in a
@@ -111,6 +111,12 @@ PolymerElement.prototype.hostAttributes;
PolymerElement.prototype.listeners;
/**
+ * Return the element whose local dom within which this element is contained.
+ * @type {?Element}
+ */
+PolymerElement.prototype.domHost;
+
+/**
* Notifies the event binding system of a change to a property.
* @param {string} path The path to set.
* @param {*} value The value to send in the update notification.
@@ -118,11 +124,44 @@ PolymerElement.prototype.listeners;
PolymerElement.prototype.notifyPath = function(path, value) {};
/**
- * Shorthand for setting a property, then calling notifyPath.
- * @param {string} path The path to set.
- * @param {*} value The new value.
+ * Convienence method for setting a value to a path and notifying any
+ * elements bound to the same path.
+ *
+ * Note, if any part in the path except for the last is undefined,
+ * this method does nothing (this method does not throw when
+ * dereferencing undefined paths).
+ *
+ * @param {(string|Array<(string|number)>)} path Path to the value
+ * to read. The path may be specified as a string (e.g. `foo.bar.baz`)
+ * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that
+ * bracketed expressions are not supported; string-based path parts
+ * *must* be separated by dots. Note that when dereferencing array
+ * indicies, the index may be used as a dotted part directly
+ * (e.g. `users.12.name` or `['users', 12, 'name']`).
+ * @param {*} value Value to set at the specified path.
+ * @param {Object=} root Root object from which the path is evaluated.
+*/
+PolymerElement.prototype.set = function(path, value, root) {};
+
+/**
+ * Convienence method for reading a value from a path.
+ *
+ * Note, if any part in the path is undefined, this method returns
+ * `undefined` (this method does not throw when dereferencing undefined
+ * paths).
+ *
+ * @param {(string|Array<(string|number)>)} path Path to the value
+ * to read. The path may be specified as a string (e.g. `foo.bar.baz`)
+ * or an array of path parts (e.g. `['foo.bar', 'baz']`). Note that
+ * bracketed expressions are not supported; string-based path parts
+ * *must* be separated by dots. Note that when dereferencing array
+ * indicies, the index may be used as a dotted part directly
+ * (e.g. `users.12.name` or `['users', 12, 'name']`).
+ * @param {Object=} root Root object from which the path is evaluated.
+ * @return {*} Value at the path, or `undefined` if any part of the path
+ * is undefined.
*/
-PolymerElement.prototype.setPathValue = function(path, value) {};
+PolymerElement.prototype.get = function(path, root) {};
/**
* Fire an event.
@@ -167,12 +206,47 @@ PolymerElement.prototype.toggleAttribute = function(name, bool, node) {};
PolymerElement.prototype.attributeFollows = function(name, newNode, oldNode) {};
/**
+ * Convenience method to add an event listener on a given element, late bound to
+ * a named method on this element.
+ * @param {!Element} node Element to add event listener to.
+ * @param {string} eventName Name of event to listen for.
+ * @param {string} methodName Name of handler method on this to call.
+ */
+PolymerElement.prototype.listen = function(node, eventName, methodName) {};
+
+/**
+ * Override scrolling behavior to all direction, one direction, or none.
+ *
+ * Valid scroll directions:
+ * 'all': scroll in any direction
+ * 'x': scroll only in the 'x' direction
+ * 'y': scroll only in the 'y' direction
+ * 'none': disable scrolling for this node
+ *
+ * @param {string=} direction Direction to allow scrolling Defaults to all.
+ * @param {HTMLElement=} node Element to apply scroll direction setting.
+ * Defaults to this.
+ */
+PolymerElement.prototype.setScrollDirection = function(direction, node) {};
+
+/**
* @param {!Function} method
* @param {number=} wait
* @return {number} A handle which can be used to cancel the job.
*/
PolymerElement.prototype.async = function(method, wait) {};
+Polymer.Base;
+
+/**
+ * Used by the promise-polyfill on its own.
+ *
+ * @param {!Function} method
+ * @param {number=} wait
+ * @return {number} A handle which can be used to cancel the job.
+ */
+Polymer.Base.async = function(method, wait) {};
+
/**
* @param {number} handle
*/
@@ -218,9 +292,9 @@ PolymerElement.prototype.transform = function(transform, node) {};
/**
* Transforms the specified node, or this element if no node is specified.
- * @param {string} x
- * @param {string} y
- * @param {string} z
+ * @param {number|string} x
+ * @param {number|string} y
+ * @param {number|string} z
* @param {HTMLElement=} node
*/
PolymerElement.prototype.translate3d = function(x, y, z, node) {};
@@ -247,6 +321,39 @@ PolymerElement.prototype.arrayDelete = function(array, item) {};
*/
PolymerElement.prototype.resolveUrl = function(url) {};
+/**
+ * Logs a message to the console.
+ *
+ * @param {!Array} var_args
+ * @protected
+ */
+PolymerElement.prototype._log = function(var_args) {};
+
+/**
+ * Logs a message to the console with a 'warn' level.
+ *
+ * @param {!Array} var_args
+ * @protected
+ */
+PolymerElement.prototype._warn = function(var_args) {};
+
+/**
+ * Logs a message to the console with an 'error' level.
+ *
+ * @param {!Array} var_args
+ * @protected
+ */
+PolymerElement.prototype._error = function(var_args) {};
+
+/**
+ * Formats string arguments together for a console log.
+ *
+ * @param {...*} var_args
+ * @return {!Array} The formatted array of args to a log function.
+ * @protected
+ */
+PolymerElement.prototype._logf = function(var_args) {};
+
/**
* A Polymer DOM API for manipulating DOM such that local DOM and light DOM
@@ -316,6 +423,9 @@ PolymerDomApi.prototype.getDistributedNodes = function() {};
/** @return {!Array<!Node>} */
PolymerDomApi.prototype.getDestinationInsertionPoints = function() {};
+/** @return {?Node} */
+PolymerDomApi.prototype.getOwnerRoot = function() {};
+
/**
* @param {string} attribute
* @param {string|number|boolean} value Values are converted to strings with
@@ -331,12 +441,88 @@ PolymerDomApi.prototype.removeAttribute = function(attribute) {};
PolymerDomApi.prototype.classList;
/**
- * Returns a Polymer-friendly API for manipulating DOM of a specified node.
+ * A Polymer Event API.
*
- * @param {?Node} node
- * @return {!PolymerDomApi}
+ * @constructor
*/
-Polymer.dom = function(node) {};
+var PolymerEventApi = function() {};
+
+/** @type {?EventTarget} */
+PolymerEventApi.prototype.rootTarget;
+
+/** @type {?EventTarget} */
+PolymerEventApi.prototype.localTarget;
+
+/** @type {?Array<!Element>|undefined} */
+PolymerEventApi.prototype.path;
+
+/**
+ * Returns a Polymer-friendly API for manipulating DOM of a specified node or
+ * an event API for a specified event..
+ *
+ * @param {?Node|?Event} nodeOrEvent
+ * @return {!PolymerDomApi|!PolymerEventApi}
+ */
+Polymer.dom = function(nodeOrEvent) {};
Polymer.dom.flush = function() {};
+Polymer.CaseMap;
+
+/**
+ * Convert a string from dash to camel-case.
+ * @param {string} dash
+ * @return {string} The string in camel-case.
+ */
+Polymer.CaseMap.dashToCamelCase = function(dash) {};
+
+/**
+ * Convert a string from camel-case to dash format.
+ * @param {string} camel
+ * @return {string} The string in dash format.
+ */
+Polymer.CaseMap.camelToDashCase = function(camel) {};
+
+
+/**
+ * An Event type fired when moving while finger/button is down.
+ * state - a string indicating the tracking state:
+ * + start: fired when tracking is first detected (finger/button down and
+ * moved past a pre-set distance threshold)
+ * + track: fired while tracking
+ * + end: fired when tracking ends
+ * x - clientX coordinate for event
+ * y - clientY coordinate for event
+ * dx - change in pixels horizontally since the first track event
+ * dy - change in pixels vertically since the first track event
+ * ddx - change in pixels horizontally since last track event
+ * ddy - change in pixels vertically since last track event
+ * hover() - a function that may be called to determine the element currently
+ * being hovered
+ *
+ * @typedef {{
+ * state: string,
+ * x: number,
+ * y: number,
+ * dx: number,
+ * dy: number,
+ * ddx: number,
+ * ddy: number,
+ * hover: (function(): Node)
+ * }}
+ */
+var PolymerTrackEvent;
+
+/**
+ * An Event type fired when a finger does down, up, or taps.
+ * x - clientX coordinate for event
+ * y - clientY coordinate for event
+ * sourceEvent - the original DOM event that caused the down action
+ *
+ * @typedef {{
+ * x: number,
+ * y: number,
+ * sourceEvent: Event
+ * }}
+ */
+var PolymerTouchEvent;
diff --git a/third_party/polymer/v1_0/components/polymer/.bower.json b/third_party/polymer/v1_0/components/polymer/.bower.json
index 5ba173d..314686e 100644
--- a/third_party/polymer/v1_0/components/polymer/.bower.json
+++ b/third_party/polymer/v1_0/components/polymer/.bower.json
@@ -1,6 +1,6 @@
{
"name": "polymer",
- "version": "1.0.2",
+ "version": "1.0.3",
"main": [
"polymer.html"
],
@@ -24,13 +24,13 @@
},
"private": true,
"homepage": "https://github.com/Polymer/polymer",
- "_release": "1.0.2",
+ "_release": "1.0.3",
"_resolution": {
"type": "version",
- "tag": "v1.0.2",
- "commit": "63f3bf1babfeaba5649345569b1bd9f3d61a88ae"
+ "tag": "v1.0.3",
+ "commit": "336178d90e44ea7e01ec84155e83d037adf05a4c"
},
"_source": "git://github.com/Polymer/polymer.git",
- "_target": "~v1.0.0",
+ "_target": "^1.0.0",
"_originalSource": "Polymer/polymer"
} \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components/polymer/bower.json b/third_party/polymer/v1_0/components/polymer/bower.json
index 9c4f5c9..2cbb654 100644
--- a/third_party/polymer/v1_0/components/polymer/bower.json
+++ b/third_party/polymer/v1_0/components/polymer/bower.json
@@ -1,6 +1,6 @@
{
"name": "polymer",
- "version": "1.0.2",
+ "version": "1.0.3",
"main": [
"polymer.html"
],
diff --git a/third_party/polymer/v1_0/components/polymer/build.log b/third_party/polymer/v1_0/components/polymer/build.log
index 736b31c..b87b858 100644
--- a/third_party/polymer/v1_0/components/polymer/build.log
+++ b/third_party/polymer/v1_0/components/polymer/build.log
@@ -1,26 +1,27 @@
BUILD LOG
---------
-Build Time: 2015-05-28T22:23:07-0700
+Build Time: 2015-06-04T20:19:11-0700
NODEJS INFORMATION
==================
nodejs: v2.0.2
-del: 1.2.0
-gulp: 3.8.11
+gulp: 3.9.0
gulp-audit: 1.0.0
gulp-rename: 1.2.2
-gulp-replace: 0.5.3
gulp-vulcanize: 6.0.0
lazypipe: 0.2.3
-polyclean: 1.1.0
+polyclean: 1.2.0
run-sequence: 1.1.0
+del: 1.2.0
+gulp-replace: 0.5.3
+vulcanize: 1.8.1
REPO REVISIONS
==============
-polymer: 3b0d10b4da804703d493da7bd0b5c22fc6f7b173
+polymer: 0c73fc226b6b5ca308a851b334b1bdeda289195d
BUILD HASHES
============
-polymer-mini.html: 6643b7ca3675fd7247fb1894a51435e0e1256e32
-polymer-micro.html: 9dda81fc6d99a1bc3c044543c4cad106042930a8
-polymer.html: f9f247c99df9ac2c7fb610aabfe3fcdcbbdbc9f9 \ No newline at end of file
+polymer-mini.html: 8173d099edaed570f4db95cd54317f49dc3183ae
+polymer-micro.html: afd2d239fc08ec69fa912a0fc7e73e8ce58e3f91
+polymer.html: 2094f18d71f5aec3321b1364575579e960b37cbc \ No newline at end of file
diff --git a/third_party/polymer/v1_0/components/polymer/polymer-micro.html b/third_party/polymer/v1_0/components/polymer/polymer-micro.html
index 1dd6123..8e72da4 100644
--- a/third_party/polymer/v1_0/components/polymer/polymer-micro.html
+++ b/third_party/polymer/v1_0/components/polymer/polymer-micro.html
@@ -6,29 +6,32 @@ 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
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
---><script>(function() {
+--><script>(function () {
function resolve() {
-document.body.removeAttribute("unresolved");
+document.body.removeAttribute('unresolved');
}
if (window.WebComponents) {
-addEventListener("WebComponentsReady", resolve);
+addEventListener('WebComponentsReady', resolve);
} else {
+if (document.readyState === 'interactive' || document.readyState === 'complete') {
resolve();
+} else {
+addEventListener('DOMContentLoaded', resolve);
}
-})();
-
+}
+}());
Polymer = {
-Settings: function() {
+Settings: function () {
var user = window.Polymer || {};
-location.search.slice(1).split("&").forEach(function(o) {
-o = o.split("=");
+location.search.slice(1).split('&').forEach(function (o) {
+o = o.split('=');
o[0] && (user[o[0]] = o[1] || true);
});
-var wantShadow = user.dom === "shadow";
+var wantShadow = user.dom === 'shadow';
var hasShadow = Boolean(Element.prototype.createShadowRoot);
var nativeShadow = hasShadow && !window.ShadowDOMPolyfill;
var useShadow = wantShadow && hasShadow;
-var hasNativeImports = Boolean("import" in document.createElement("link"));
+var hasNativeImports = Boolean('import' in document.createElement('link'));
var useNativeImports = hasNativeImports;
var useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
return {
@@ -42,15 +45,12 @@ useNativeCustomElements: useNativeCustomElements
};
}()
};
-
-(function() {
+(function () {
var userPolymer = window.Polymer;
-window.Polymer = function(prototype) {
+window.Polymer = function (prototype) {
var ctor = desugar(prototype);
prototype = ctor.prototype;
-var options = {
-prototype: prototype
-};
+var options = { prototype: prototype };
if (prototype.extends) {
options.extends = prototype.extends;
}
@@ -58,7 +58,7 @@ Polymer.telemetry._registrate(prototype);
document.registerElement(prototype.is, options);
return ctor;
};
-var desugar = function(prototype) {
+var desugar = function (prototype) {
prototype = Polymer.Base.chainObject(prototype, Polymer.Base);
prototype.registerCallback();
return prototype.constructor;
@@ -70,65 +70,62 @@ Polymer[i] = userPolymer[i];
}
}
Polymer.Class = desugar;
-})();
-
+}());
Polymer.telemetry = {
registrations: [],
-_regLog: function(prototype) {
-console.log("[" + prototype.is + "]: registered");
+_regLog: function (prototype) {
+console.log('[' + prototype.is + ']: registered');
},
-_registrate: function(prototype) {
+_registrate: function (prototype) {
this.registrations.push(prototype);
Polymer.log && this._regLog(prototype);
},
-dumpRegistrations: function() {
+dumpRegistrations: function () {
this.registrations.forEach(this._regLog);
}
};
-
-Object.defineProperty(window, "currentImport", {
+Object.defineProperty(window, 'currentImport', {
enumerable: true,
configurable: true,
-get: function() {
+get: function () {
return (document._currentScript || document.currentScript).ownerDocument;
}
});
-
Polymer.Base = {
-_addFeature: function(feature) {
+_addFeature: function (feature) {
this.extend(this, feature);
},
-registerCallback: function() {
+registerCallback: function () {
this._registerFeatures();
-this._doBehavior("registered");
+this._doBehavior('registered');
},
-createdCallback: function() {
+createdCallback: function () {
Polymer.telemetry.instanceCount++;
this.root = this;
-this._doBehavior("created");
+this._doBehavior('created');
this._initFeatures();
},
-attachedCallback: function() {
+attachedCallback: function () {
this.isAttached = true;
-this._doBehavior("attached");
+this._doBehavior('attached');
},
-detachedCallback: function() {
+detachedCallback: function () {
this.isAttached = false;
-this._doBehavior("detached");
+this._doBehavior('detached');
},
-attributeChangedCallback: function(name) {
+attributeChangedCallback: function (name) {
this._setAttributeToProperty(this, name);
-this._doBehavior("attributeChanged", arguments);
+this._doBehavior('attributeChanged', arguments);
},
-extend: function(prototype, api) {
+extend: function (prototype, api) {
if (prototype && api) {
-Object.getOwnPropertyNames(api).forEach(function(n) {
+Object.getOwnPropertyNames(api).forEach(function (n) {
this.copyOwnProperty(n, api, prototype);
}, this);
}
return prototype || api;
},
-copyOwnProperty: function(name, source, target) {
+copyOwnProperty: function (name, source, target) {
var pd = Object.getOwnPropertyDescriptor(source, name);
if (pd) {
Object.defineProperty(target, name, pd);
@@ -137,17 +134,18 @@ Object.defineProperty(target, name, pd);
_log: console.log.apply.bind(console.log, console),
_warn: console.warn.apply.bind(console.warn, console),
_error: console.error.apply.bind(console.error, console),
-_logf: function() {
-return this._logPrefix.concat([ this.is ]).concat(Array.prototype.slice.call(arguments, 0));
+_logf: function () {
+return this._logPrefix.concat([this.is]).concat(Array.prototype.slice.call(arguments, 0));
}
};
-
-Polymer.Base._logPrefix = function() {
+Polymer.Base._logPrefix = function () {
var color = window.chrome || /firefox/i.test(navigator.userAgent);
-return color ? [ "%c[%s::%s]:", "font-weight: bold; background-color:#EEEE00;" ] : [ "[%s::%s]:" ];
+return color ? [
+'%c[%s::%s]:',
+'font-weight: bold; background-color:#EEEE00;'
+] : ['[%s::%s]:'];
}();
-
-Polymer.Base.chainObject = function(object, inherited) {
+Polymer.Base.chainObject = function (object, inherited) {
if (object && inherited && object !== inherited) {
if (!Object.__proto__) {
object = Polymer.Base.extend(Object.create(inherited), object);
@@ -156,26 +154,23 @@ object.__proto__ = inherited;
}
return object;
};
-
Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype);
-
Polymer.telemetry.instanceCount = 0;
-
-(function() {
+(function () {
var modules = {};
-var DomModule = function() {
-return document.createElement("dom-module");
+var DomModule = function () {
+return document.createElement('dom-module');
};
DomModule.prototype = Object.create(HTMLElement.prototype);
DomModule.prototype.constructor = DomModule;
-DomModule.prototype.createdCallback = function() {
-var id = this.id || this.getAttribute("name") || this.getAttribute("is");
+DomModule.prototype.createdCallback = function () {
+var id = this.id || this.getAttribute('name') || this.getAttribute('is');
if (id) {
this.id = id;
modules[id] = this;
}
};
-DomModule.prototype.import = function(id, slctr) {
+DomModule.prototype.import = function (id, slctr) {
var m = modules[id];
if (!m) {
forceDocumentUpgrade();
@@ -191,7 +186,7 @@ if (cePolyfill) {
var ready = CustomElements.ready;
CustomElements.ready = true;
}
-document.registerElement("dom-module", DomModule);
+document.registerElement('dom-module', DomModule);
if (cePolyfill) {
CustomElements.ready = ready;
}
@@ -203,42 +198,40 @@ CustomElements.upgradeAll(script.ownerDocument);
}
}
}
-})();
-
+}());
Polymer.Base._addFeature({
-_prepIs: function() {
+_prepIs: function () {
if (!this.is) {
var module = (document._currentScript || document.currentScript).parentNode;
-if (module.localName === "dom-module") {
-var id = module.id || module.getAttribute("name") || module.getAttribute("is");
+if (module.localName === 'dom-module') {
+var id = module.id || module.getAttribute('name') || module.getAttribute('is');
this.is = id;
}
}
}
});
-
Polymer.Base._addFeature({
behaviors: [],
-_prepBehaviors: function() {
+_prepBehaviors: function () {
if (this.behaviors.length) {
this.behaviors = this._flattenBehaviorsList(this.behaviors);
}
this._prepAllBehaviors(this.behaviors);
},
-_flattenBehaviorsList: function(behaviors) {
+_flattenBehaviorsList: function (behaviors) {
var flat = [];
-behaviors.forEach(function(b) {
+behaviors.forEach(function (b) {
if (b instanceof Array) {
flat = flat.concat(this._flattenBehaviorsList(b));
} else if (b) {
flat.push(b);
} else {
-this._warn(this._logf("_flattenBehaviorsList", "behavior is null, check for missing or 404 import"));
+this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for missing or 404 import'));
}
}, this);
return flat;
},
-_prepAllBehaviors: function(behaviors) {
+_prepAllBehaviors: function (behaviors) {
for (var i = behaviors.length - 1; i >= 0; i--) {
this._mixinBehavior(behaviors[i]);
}
@@ -247,22 +240,21 @@ this._prepBehavior(behaviors[i]);
}
this._prepBehavior(this);
},
-_mixinBehavior: function(b) {
-Object.getOwnPropertyNames(b).forEach(function(n) {
+_mixinBehavior: function (b) {
+Object.getOwnPropertyNames(b).forEach(function (n) {
switch (n) {
-case "hostAttributes":
-case "registered":
-case "properties":
-case "observers":
-case "listeners":
-case "created":
-case "attached":
-case "detached":
-case "attributeChanged":
-case "configure":
-case "ready":
+case 'hostAttributes':
+case 'registered':
+case 'properties':
+case 'observers':
+case 'listeners':
+case 'created':
+case 'attached':
+case 'detached':
+case 'attributeChanged':
+case 'configure':
+case 'ready':
break;
-
default:
if (!this.hasOwnProperty(n)) {
this.copyOwnProperty(n, b, this);
@@ -271,37 +263,36 @@ break;
}
}, this);
},
-_doBehavior: function(name, args) {
-this.behaviors.forEach(function(b) {
+_doBehavior: function (name, args) {
+this.behaviors.forEach(function (b) {
this._invokeBehavior(b, name, args);
}, this);
this._invokeBehavior(this, name, args);
},
-_invokeBehavior: function(b, name, args) {
+_invokeBehavior: function (b, name, args) {
var fn = b[name];
if (fn) {
fn.apply(this, args || Polymer.nar);
}
},
-_marshalBehaviors: function() {
-this.behaviors.forEach(function(b) {
+_marshalBehaviors: function () {
+this.behaviors.forEach(function (b) {
this._marshalBehavior(b);
}, this);
this._marshalBehavior(this);
}
});
-
Polymer.Base._addFeature({
-_prepExtends: function() {
+_prepExtends: function () {
if (this.extends) {
this.__proto__ = this._getExtendedPrototype(this.extends);
}
},
-_getExtendedPrototype: function(tag) {
+_getExtendedPrototype: function (tag) {
return this._getExtendedNativePrototype(tag);
},
_nativePrototypes: {},
-_getExtendedNativePrototype: function(tag) {
+_getExtendedNativePrototype: function (tag) {
var p = this._nativePrototypes[tag];
if (!p) {
var np = this.getNativePrototype(tag);
@@ -310,28 +301,30 @@ this._nativePrototypes[tag] = p;
}
return p;
},
-getNativePrototype: function(tag) {
+getNativePrototype: function (tag) {
return Object.getPrototypeOf(document.createElement(tag));
}
});
-
Polymer.Base._addFeature({
-_prepConstructor: function() {
-this._factoryArgs = this.extends ? [ this.extends, this.is ] : [ this.is ];
-var ctor = function() {
+_prepConstructor: function () {
+this._factoryArgs = this.extends ? [
+this.extends,
+this.is
+] : [this.is];
+var ctor = function () {
return this._factory(arguments);
};
-if (this.hasOwnProperty("extends")) {
+if (this.hasOwnProperty('extends')) {
ctor.extends = this.extends;
}
-Object.defineProperty(this, "constructor", {
+Object.defineProperty(this, 'constructor', {
value: ctor,
writable: true,
configurable: true
});
ctor.prototype = this;
},
-_factory: function(args) {
+_factory: function (args) {
var elt = document.createElement.apply(document, this._factoryArgs);
if (this.factoryImpl) {
this.factoryImpl.apply(elt, args);
@@ -339,26 +332,22 @@ this.factoryImpl.apply(elt, args);
return elt;
}
});
-
Polymer.nob = Object.create(null);
-
Polymer.Base._addFeature({
properties: {},
-getPropertyInfo: function(property) {
+getPropertyInfo: function (property) {
var info = this._getPropertyInfo(property, this.properties);
if (!info) {
-this.behaviors.some(function(b) {
+this.behaviors.some(function (b) {
return info = this._getPropertyInfo(property, b.properties);
}, this);
}
return info || Polymer.nob;
},
-_getPropertyInfo: function(property, properties) {
+_getPropertyInfo: function (property, properties) {
var p = properties && properties[property];
-if (typeof p === "function") {
-p = properties[property] = {
-type: p
-};
+if (typeof p === 'function') {
+p = properties[property] = { type: p };
}
if (p) {
p.defined = true;
@@ -366,60 +355,58 @@ p.defined = true;
return p;
}
});
-
Polymer.CaseMap = {
_caseMap: {},
-dashToCamelCase: function(dash) {
+dashToCamelCase: function (dash) {
var mapped = Polymer.CaseMap._caseMap[dash];
if (mapped) {
return mapped;
}
-if (dash.indexOf("-") < 0) {
+if (dash.indexOf('-') < 0) {
return Polymer.CaseMap._caseMap[dash] = dash;
}
-return Polymer.CaseMap._caseMap[dash] = dash.replace(/-([a-z])/g, function(m) {
+return Polymer.CaseMap._caseMap[dash] = dash.replace(/-([a-z])/g, function (m) {
return m[1].toUpperCase();
});
},
-camelToDashCase: function(camel) {
+camelToDashCase: function (camel) {
var mapped = Polymer.CaseMap._caseMap[camel];
if (mapped) {
return mapped;
}
-return Polymer.CaseMap._caseMap[camel] = camel.replace(/([a-z][A-Z])/g, function(g) {
-return g[0] + "-" + g[1].toLowerCase();
+return Polymer.CaseMap._caseMap[camel] = camel.replace(/([a-z][A-Z])/g, function (g) {
+return g[0] + '-' + g[1].toLowerCase();
});
}
};
-
Polymer.Base._addFeature({
-_prepAttributes: function() {
+_prepAttributes: function () {
this._aggregatedAttributes = {};
},
-_addHostAttributes: function(attributes) {
+_addHostAttributes: function (attributes) {
if (attributes) {
this.mixin(this._aggregatedAttributes, attributes);
}
},
-_marshalHostAttributes: function() {
+_marshalHostAttributes: function () {
this._applyAttributes(this, this._aggregatedAttributes);
},
-_applyAttributes: function(node, attr$) {
+_applyAttributes: function (node, attr$) {
for (var n in attr$) {
-if (!this.hasAttribute(n) && n !== "class") {
+if (!this.hasAttribute(n) && n !== 'class') {
this.serializeValueToAttribute(attr$[n], n, this);
}
}
},
-_marshalAttributes: function() {
+_marshalAttributes: function () {
this._takeAttributesToModel(this);
},
-_takeAttributesToModel: function(model) {
+_takeAttributesToModel: function (model) {
for (var i = 0, l = this.attributes.length; i < l; i++) {
this._setAttributeToProperty(model, this.attributes[i].name);
}
},
-_setAttributeToProperty: function(model, attrName) {
+_setAttributeToProperty: function (model, attrName) {
if (!this._serializing) {
var propName = Polymer.CaseMap.dashToCamelCase(attrName);
var info = this.getPropertyInfo(propName);
@@ -430,112 +417,104 @@ model[propName] = this.deserialize(val, info.type);
}
},
_serializing: false,
-reflectPropertyToAttribute: function(name) {
+reflectPropertyToAttribute: function (name) {
this._serializing = true;
this.serializeValueToAttribute(this[name], Polymer.CaseMap.camelToDashCase(name));
this._serializing = false;
},
-serializeValueToAttribute: function(value, attribute, node) {
+serializeValueToAttribute: function (value, attribute, node) {
var str = this.serialize(value);
-(node || this)[str === undefined ? "removeAttribute" : "setAttribute"](attribute, str);
+(node || this)[str === undefined ? 'removeAttribute' : 'setAttribute'](attribute, str);
},
-deserialize: function(value, type) {
+deserialize: function (value, type) {
switch (type) {
case Number:
value = Number(value);
break;
-
case Boolean:
value = value !== null;
break;
-
case Object:
try {
value = JSON.parse(value);
-} catch (x) {}
+} catch (x) {
+}
break;
-
case Array:
try {
value = JSON.parse(value);
} catch (x) {
value = null;
-console.warn("Polymer::Attributes: couldn`t decode Array as JSON");
+console.warn('Polymer::Attributes: couldn`t decode Array as JSON');
}
break;
-
case Date:
value = new Date(value);
break;
-
case String:
default:
break;
}
return value;
},
-serialize: function(value) {
+serialize: function (value) {
switch (typeof value) {
-case "boolean":
-return value ? "" : undefined;
-
-case "object":
+case 'boolean':
+return value ? '' : undefined;
+case 'object':
if (value instanceof Date) {
return value;
} else if (value) {
try {
return JSON.stringify(value);
} catch (x) {
-return "";
+return '';
}
}
-
default:
return value != null ? value : undefined;
}
}
});
-
Polymer.Base._addFeature({
-_setupDebouncers: function() {
+_setupDebouncers: function () {
this._debouncers = {};
},
-debounce: function(jobName, callback, wait) {
+debounce: function (jobName, callback, wait) {
this._debouncers[jobName] = Polymer.Debounce.call(this, this._debouncers[jobName], callback, wait);
},
-isDebouncerActive: function(jobName) {
+isDebouncerActive: function (jobName) {
var debouncer = this._debouncers[jobName];
return debouncer && debouncer.finish;
},
-flushDebouncer: function(jobName) {
+flushDebouncer: function (jobName) {
var debouncer = this._debouncers[jobName];
if (debouncer) {
debouncer.complete();
}
},
-cancelDebouncer: function(jobName) {
+cancelDebouncer: function (jobName) {
var debouncer = this._debouncers[jobName];
if (debouncer) {
debouncer.stop();
}
}
});
-
-Polymer.version = "1.0.2";
-
+Polymer.version = '1.0.3';
Polymer.Base._addFeature({
-_registerFeatures: function() {
+_registerFeatures: function () {
this._prepIs();
this._prepAttributes();
this._prepBehaviors();
this._prepExtends();
this._prepConstructor();
},
-_prepBehavior: function(b) {
+_prepBehavior: function (b) {
this._addHostAttributes(b.hostAttributes);
},
-_marshalBehavior: function(b) {},
-_initFeatures: function() {
+_marshalBehavior: function (b) {
+},
+_initFeatures: function () {
this._marshalHostAttributes();
this._setupDebouncers();
this._marshalBehaviors();
diff --git a/third_party/polymer/v1_0/components/polymer/polymer-mini.html b/third_party/polymer/v1_0/components/polymer/polymer-mini.html
index 853b3cf..533db50 100644
--- a/third_party/polymer/v1_0/components/polymer/polymer-mini.html
+++ b/third_party/polymer/v1_0/components/polymer/polymer-mini.html
@@ -9,67 +9,67 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--><link rel="import" href="polymer-micro.html">
<script>Polymer.Base._addFeature({
-_prepTemplate: function() {
-this._template = this._template || Polymer.DomModule.import(this.is, "template");
+_prepTemplate: function () {
+this._template = this._template || Polymer.DomModule.import(this.is, 'template');
if (!this._template) {
var script = document._currentScript || document.currentScript;
var prev = script && script.previousElementSibling;
-if (prev && prev.localName === "template") {
+if (prev && prev.localName === 'template') {
this._template = prev;
}
}
-if (this._template && this._template.hasAttribute("is")) {
-this._warn(this._logf("_prepTemplate", "top-level Polymer template " + "must not be a type-extension, found", this._template, "Move inside simple <template>."));
+if (this._template && this._template.hasAttribute('is')) {
+this._warn(this._logf('_prepTemplate', 'top-level Polymer template ' + 'must not be a type-extension, found', this._template, 'Move inside simple <template>.'));
}
},
-_stampTemplate: function() {
+_stampTemplate: function () {
if (this._template) {
this.root = this.instanceTemplate(this._template);
}
},
-instanceTemplate: function(template) {
+instanceTemplate: function (template) {
var dom = document.importNode(template._content || template.content, true);
return dom;
}
});
-
-(function() {
+(function () {
var baseAttachedCallback = Polymer.Base.attachedCallback;
Polymer.Base._addFeature({
_hostStack: [],
-ready: function() {},
-_pushHost: function(host) {
+ready: function () {
+},
+_pushHost: function (host) {
this.dataHost = host = host || Polymer.Base._hostStack[Polymer.Base._hostStack.length - 1];
if (host && host._clients) {
host._clients.push(this);
}
this._beginHost();
},
-_beginHost: function() {
+_beginHost: function () {
Polymer.Base._hostStack.push(this);
if (!this._clients) {
this._clients = [];
}
},
-_popHost: function() {
+_popHost: function () {
Polymer.Base._hostStack.pop();
},
-_tryReady: function() {
+_tryReady: function () {
if (this._canReady()) {
this._ready();
}
},
-_canReady: function() {
+_canReady: function () {
return !this.dataHost || this.dataHost._clientsReadied;
},
-_ready: function() {
+_ready: function () {
this._beforeClientsReady();
this._setupRoot();
this._readyClients();
this._afterClientsReady();
this._readySelf();
},
-_readyClients: function() {
+_readyClients: function () {
this._beginDistribute();
var c$ = this._clients;
for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) {
@@ -79,18 +79,21 @@ this._finishDistribute();
this._clientsReadied = true;
this._clients = null;
},
-_readySelf: function() {
-this._doBehavior("ready");
+_readySelf: function () {
+this._doBehavior('ready');
this._readied = true;
if (this._attachedPending) {
this._attachedPending = false;
this.attachedCallback();
}
},
-_beforeClientsReady: function() {},
-_afterClientsReady: function() {},
-_beforeAttached: function() {},
-attachedCallback: function() {
+_beforeClientsReady: function () {
+},
+_afterClientsReady: function () {
+},
+_beforeAttached: function () {
+},
+attachedCallback: function () {
if (this._readied) {
this._beforeAttached();
baseAttachedCallback.call(this);
@@ -99,9 +102,8 @@ this._attachedPending = true;
}
}
});
-})();
-
-Polymer.ArraySplice = function() {
+}());
+Polymer.ArraySplice = function () {
function newSplice(index, removed, addedCount) {
return {
index: index,
@@ -113,9 +115,10 @@ var EDIT_LEAVE = 0;
var EDIT_UPDATE = 1;
var EDIT_ADD = 2;
var EDIT_DELETE = 3;
-function ArraySplice() {}
+function ArraySplice() {
+}
ArraySplice.prototype = {
-calcEditDistances: function(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+calcEditDistances: function (current, currentStart, currentEnd, old, oldStart, oldEnd) {
var rowCount = oldEnd - oldStart + 1;
var columnCount = currentEnd - currentStart + 1;
var distances = new Array(rowCount);
@@ -123,10 +126,13 @@ for (var i = 0; i < rowCount; i++) {
distances[i] = new Array(columnCount);
distances[i][0] = i;
}
-for (var j = 0; j < columnCount; j++) distances[0][j] = j;
+for (var j = 0; j < columnCount; j++)
+distances[0][j] = j;
for (var i = 1; i < rowCount; i++) {
for (var j = 1; j < columnCount; j++) {
-if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1])) distances[i][j] = distances[i - 1][j - 1]; else {
+if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1]))
+distances[i][j] = distances[i - 1][j - 1];
+else {
var north = distances[i - 1][j] + 1;
var west = distances[i][j - 1] + 1;
distances[i][j] = north < west ? north : west;
@@ -135,7 +141,7 @@ distances[i][j] = north < west ? north : west;
}
return distances;
},
-spliceOperationsFromEditDistances: function(distances) {
+spliceOperationsFromEditDistances: function (distances) {
var i = distances.length - 1;
var j = distances[0].length - 1;
var current = distances[i][j];
@@ -155,7 +161,10 @@ var northWest = distances[i - 1][j - 1];
var west = distances[i - 1][j];
var north = distances[i][j - 1];
var min;
-if (west < north) min = west < northWest ? west : northWest; else min = north < northWest ? north : northWest;
+if (west < north)
+min = west < northWest ? west : northWest;
+else
+min = north < northWest ? north : northWest;
if (min == northWest) {
if (northWest == current) {
edits.push(EDIT_LEAVE);
@@ -178,22 +187,27 @@ current = north;
edits.reverse();
return edits;
},
-calcSplices: function(current, currentStart, currentEnd, old, oldStart, oldEnd) {
+calcSplices: function (current, currentStart, currentEnd, old, oldStart, oldEnd) {
var prefixCount = 0;
var suffixCount = 0;
var minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);
-if (currentStart == 0 && oldStart == 0) prefixCount = this.sharedPrefix(current, old, minLength);
-if (currentEnd == current.length && oldEnd == old.length) suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);
+if (currentStart == 0 && oldStart == 0)
+prefixCount = this.sharedPrefix(current, old, minLength);
+if (currentEnd == current.length && oldEnd == old.length)
+suffixCount = this.sharedSuffix(current, old, minLength - prefixCount);
currentStart += prefixCount;
oldStart += prefixCount;
currentEnd -= suffixCount;
oldEnd -= suffixCount;
-if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0) return [];
+if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0)
+return [];
if (currentStart == currentEnd) {
var splice = newSplice(currentStart, [], 0);
-while (oldStart < oldEnd) splice.removed.push(old[oldStart++]);
-return [ splice ];
-} else if (oldStart == oldEnd) return [ newSplice(currentStart, [], currentEnd - currentStart) ];
+while (oldStart < oldEnd)
+splice.removed.push(old[oldStart++]);
+return [splice];
+} else if (oldStart == oldEnd)
+return [newSplice(currentStart, [], currentEnd - currentStart)];
var ops = this.spliceOperationsFromEditDistances(this.calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd));
var splice = undefined;
var splices = [];
@@ -209,23 +223,23 @@ splice = undefined;
index++;
oldIndex++;
break;
-
case EDIT_UPDATE:
-if (!splice) splice = newSplice(index, [], 0);
+if (!splice)
+splice = newSplice(index, [], 0);
splice.addedCount++;
index++;
splice.removed.push(old[oldIndex]);
oldIndex++;
break;
-
case EDIT_ADD:
-if (!splice) splice = newSplice(index, [], 0);
+if (!splice)
+splice = newSplice(index, [], 0);
splice.addedCount++;
index++;
break;
-
case EDIT_DELETE:
-if (!splice) splice = newSplice(index, [], 0);
+if (!splice)
+splice = newSplice(index, [], 0);
splice.removed.push(old[oldIndex]);
oldIndex++;
break;
@@ -236,30 +250,32 @@ splices.push(splice);
}
return splices;
},
-sharedPrefix: function(current, old, searchLength) {
-for (var i = 0; i < searchLength; i++) if (!this.equals(current[i], old[i])) return i;
+sharedPrefix: function (current, old, searchLength) {
+for (var i = 0; i < searchLength; i++)
+if (!this.equals(current[i], old[i]))
+return i;
return searchLength;
},
-sharedSuffix: function(current, old, searchLength) {
+sharedSuffix: function (current, old, searchLength) {
var index1 = current.length;
var index2 = old.length;
var count = 0;
-while (count < searchLength && this.equals(current[--index1], old[--index2])) count++;
+while (count < searchLength && this.equals(current[--index1], old[--index2]))
+count++;
return count;
},
-calculateSplices: function(current, previous) {
+calculateSplices: function (current, previous) {
return this.calcSplices(current, 0, current.length, previous, 0, previous.length);
},
-equals: function(currentValue, previousValue) {
+equals: function (currentValue, previousValue) {
return currentValue === previousValue;
}
};
return new ArraySplice();
}();
-
-Polymer.EventApi = function() {
+Polymer.EventApi = function () {
var Settings = Polymer.Settings;
-var EventApi = function(event) {
+var EventApi = function (event) {
this.event = event;
};
if (Settings.useShadow) {
@@ -304,36 +320,29 @@ return this.event._path;
}
};
}
-var factory = function(event) {
+var factory = function (event) {
if (!event.__eventApi) {
event.__eventApi = new EventApi(event);
}
return event.__eventApi;
};
-return {
-factory: factory
-};
+return { factory: factory };
}();
-
-Polymer.domInnerHTML = function() {
+Polymer.domInnerHTML = function () {
var escapeAttrRegExp = /[&\u00A0"]/g;
var escapeDataRegExp = /[&\u00A0<>]/g;
function escapeReplace(c) {
switch (c) {
-case "&":
-return "&amp;";
-
-case "<":
-return "&lt;";
-
-case ">":
-return "&gt;";
-
+case '&':
+return '&amp;';
+case '<':
+return '&lt;';
+case '>':
+return '&gt;';
case '"':
-return "&quot;";
-
-case "\u00A0":
-return "&nbsp;";
+return '&quot;';
+case '\xA0':
+return '&nbsp;';
}
}
function escapeAttr(s) {
@@ -349,41 +358,65 @@ set[arr[i]] = true;
}
return set;
}
-var voidElements = makeSet([ "area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr" ]);
-var plaintextParents = makeSet([ "style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript" ]);
+var voidElements = makeSet([
+'area',
+'base',
+'br',
+'col',
+'command',
+'embed',
+'hr',
+'img',
+'input',
+'keygen',
+'link',
+'meta',
+'param',
+'source',
+'track',
+'wbr'
+]);
+var plaintextParents = makeSet([
+'style',
+'script',
+'xmp',
+'iframe',
+'noembed',
+'noframes',
+'plaintext',
+'noscript'
+]);
function getOuterHTML(node, parentNode, composed) {
switch (node.nodeType) {
case Node.ELEMENT_NODE:
var tagName = node.localName;
-var s = "<" + tagName;
+var s = '<' + tagName;
var attrs = node.attributes;
for (var i = 0, attr; attr = attrs[i]; i++) {
-s += " " + attr.name + '="' + escapeAttr(attr.value) + '"';
+s += ' ' + attr.name + '="' + escapeAttr(attr.value) + '"';
}
-s += ">";
+s += '>';
if (voidElements[tagName]) {
return s;
}
-return s + getInnerHTML(node, composed) + "</" + tagName + ">";
-
+return s + getInnerHTML(node, composed) + '</' + tagName + '>';
case Node.TEXT_NODE:
var data = node.data;
if (parentNode && plaintextParents[parentNode.localName]) {
return data;
}
return escapeData(data);
-
case Node.COMMENT_NODE:
-return "<!--" + node.data + "-->";
-
+return '<!--' + node.data + '-->';
default:
console.error(node);
-throw new Error("not implemented");
+throw new Error('not implemented');
}
}
function getInnerHTML(node, composed) {
-if (node instanceof HTMLTemplateElement) node = node.content;
-var s = "";
+if (node instanceof HTMLTemplateElement)
+node = node.content;
+var s = '';
var c$ = Polymer.dom(node).childNodes;
c$ = composed ? node._composedChildren : c$;
for (var i = 0, l = c$.length, child; i < l && (child = c$[i]); i++) {
@@ -391,41 +424,38 @@ s += getOuterHTML(child, node, composed);
}
return s;
}
-return {
-getInnerHTML: getInnerHTML
-};
+return { getInnerHTML: getInnerHTML };
}();
-
-Polymer.DomApi = function() {
-"use strict";
+Polymer.DomApi = function () {
+'use strict';
var Settings = Polymer.Settings;
var getInnerHTML = Polymer.domInnerHTML.getInnerHTML;
var nativeInsertBefore = Element.prototype.insertBefore;
var nativeRemoveChild = Element.prototype.removeChild;
var nativeAppendChild = Element.prototype.appendChild;
var dirtyRoots = [];
-var DomApi = function(node) {
+var DomApi = function (node) {
this.node = node;
if (this.patch) {
this.patch();
}
};
DomApi.prototype = {
-flush: function() {
+flush: function () {
for (var i = 0, host; i < dirtyRoots.length; i++) {
host = dirtyRoots[i];
-host.flushDebouncer("_distribute");
+host.flushDebouncer('_distribute');
}
dirtyRoots = [];
},
-_lazyDistribute: function(host) {
+_lazyDistribute: function (host) {
if (host.shadyRoot && host.shadyRoot._distributionClean) {
host.shadyRoot._distributionClean = false;
-host.debounce("_distribute", host._distributeContent);
+host.debounce('_distribute', host._distributeContent);
dirtyRoots.push(host);
}
},
-appendChild: function(node) {
+appendChild: function (node) {
var distributed;
this._removeNodeFromHost(node);
if (this._nodeIsInLogicalTree(this.node)) {
@@ -443,7 +473,7 @@ addToComposedParent(container, node);
}
return node;
},
-insertBefore: function(node, ref_node) {
+insertBefore: function (node, ref_node) {
if (!ref_node) {
return this.appendChild(node);
}
@@ -454,7 +484,7 @@ saveLightChildrenIfNeeded(this.node);
var children = this.childNodes;
var index = children.indexOf(ref_node);
if (index < 0) {
-throw Error("The ref_node to be inserted before is not a child " + "of this node");
+throw Error('The ref_node to be inserted before is not a child ' + 'of this node');
}
var host = this._hostForNode(this.node);
this._addLogicalInfo(node, this.node, host && host.shadyRoot, index);
@@ -471,9 +501,9 @@ addToComposedParent(container, node, ref_node);
}
return node;
},
-removeChild: function(node) {
+removeChild: function (node) {
if (factory(node).parentNode !== this.node) {
-console.warn("The node to be removed is not a child of this node", node);
+console.warn('The node to be removed is not a child of this node', node);
}
var distributed;
if (this._nodeIsInLogicalTree(this.node)) {
@@ -490,15 +520,15 @@ removeFromComposedParent(container, node);
}
return node;
},
-replaceChild: function(node, ref_node) {
+replaceChild: function (node, ref_node) {
this.insertBefore(node, ref_node);
this.removeChild(ref_node);
return node;
},
-getOwnerRoot: function() {
+getOwnerRoot: function () {
return this._ownerShadyRootForNode(this.node);
},
-_ownerShadyRootForNode: function(node) {
+_ownerShadyRootForNode: function (node) {
if (!node) {
return;
}
@@ -518,7 +548,7 @@ node._ownerShadyRoot = root;
}
return node._ownerShadyRoot;
},
-_maybeDistribute: function(node, parent, host) {
+_maybeDistribute: function (node, parent, host) {
var nodeNeedsDistribute = this._nodeNeedsDistribution(node);
var distribute = this._parentNeedsDistribution(parent) || nodeNeedsDistribute;
if (nodeNeedsDistribute) {
@@ -529,7 +559,7 @@ this._lazyDistribute(host);
}
return distribute;
},
-_tryRemoveUndistributedNode: function(node) {
+_tryRemoveUndistributedNode: function (node) {
if (this.node.shadyRoot) {
if (node.parentNode) {
nativeRemoveChild.call(node.parentNode, node);
@@ -537,23 +567,23 @@ nativeRemoveChild.call(node.parentNode, node);
return true;
}
},
-_updateInsertionPoints: function(host) {
+_updateInsertionPoints: function (host) {
host.shadyRoot._insertionPoints = factory(host.shadyRoot).querySelectorAll(CONTENT);
},
-_nodeIsInLogicalTree: function(node) {
+_nodeIsInLogicalTree: function (node) {
return Boolean(node._lightParent || node._isShadyRoot || this._ownerShadyRootForNode(node) || node.shadyRoot);
},
-_hostForNode: function(node) {
+_hostForNode: function (node) {
var root = node.shadyRoot || (node._isShadyRoot ? node : this._ownerShadyRootForNode(node));
return root && root.host;
},
-_parentNeedsDistribution: function(parent) {
+_parentNeedsDistribution: function (parent) {
return parent && parent.shadyRoot && hasInsertionPoint(parent.shadyRoot);
},
-_nodeNeedsDistribution: function(node) {
+_nodeNeedsDistribution: function (node) {
return node.localName === CONTENT || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && node.querySelector(CONTENT);
},
-_removeNodeFromHost: function(node) {
+_removeNodeFromHost: function (node) {
if (node._lightParent) {
var root = this._ownerShadyRootForNode(node);
if (root) {
@@ -563,14 +593,14 @@ this._removeLogicalInfo(node, node._lightParent);
}
this._removeOwnerShadyRoot(node);
},
-_addNodeToHost: function(node) {
+_addNodeToHost: function (node) {
var checkNode = node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? node.firstChild : node;
var root = this._ownerShadyRootForNode(checkNode);
if (root) {
root.host._elementAdd(node);
}
},
-_addLogicalInfo: function(node, container, root, index) {
+_addLogicalInfo: function (node, container, root, index) {
saveLightChildrenIfNeeded(container);
var children = factory(container).childNodes;
index = index === undefined ? children.length : index;
@@ -585,16 +615,16 @@ children.splice(index, 0, node);
node._lightParent = container;
}
},
-_removeLogicalInfo: function(node, container) {
+_removeLogicalInfo: function (node, container) {
var children = factory(container).childNodes;
var index = children.indexOf(node);
if (index < 0 || container !== node._lightParent) {
-throw Error("The node to be removed is not a child of this node");
+throw Error('The node to be removed is not a child of this node');
}
children.splice(index, 1);
node._lightParent = null;
},
-_removeOwnerShadyRoot: function(node) {
+_removeOwnerShadyRoot: function (node) {
var hasCachedRoot = factory(node).getOwnerRoot() !== undefined;
if (hasCachedRoot) {
var c$ = factory(node).childNodes;
@@ -604,7 +634,7 @@ this._removeOwnerShadyRoot(n);
}
node._ownerShadyRoot = undefined;
},
-_firstComposedNode: function(content) {
+_firstComposedNode: function (content) {
var n$ = factory(content).getDistributedNodes();
for (var i = 0, l = n$.length, n, p$; i < l && (n = n$[i]); i++) {
p$ = factory(n).getDestinationInsertionPoints();
@@ -613,40 +643,40 @@ return n;
}
}
},
-querySelector: function(selector) {
+querySelector: function (selector) {
return this.querySelectorAll(selector)[0];
},
-querySelectorAll: function(selector) {
-return this._query(function(n) {
+querySelectorAll: function (selector) {
+return this._query(function (n) {
return matchesSelector.call(n, selector);
}, this.node);
},
-_query: function(matcher, node) {
+_query: function (matcher, node) {
node = node || this.node;
var list = [];
this._queryElements(factory(node).childNodes, matcher, list);
return list;
},
-_queryElements: function(elements, matcher, list) {
+_queryElements: function (elements, matcher, list) {
for (var i = 0, l = elements.length, c; i < l && (c = elements[i]); i++) {
if (c.nodeType === Node.ELEMENT_NODE) {
this._queryElement(c, matcher, list);
}
}
},
-_queryElement: function(node, matcher, list) {
+_queryElement: function (node, matcher, list) {
if (matcher(node)) {
list.push(node);
}
this._queryElements(factory(node).childNodes, matcher, list);
},
-getDestinationInsertionPoints: function() {
+getDestinationInsertionPoints: function () {
return this.node._destinationInsertionPoints || [];
},
-getDistributedNodes: function() {
+getDistributedNodes: function () {
return this.node._distributedNodes || [];
},
-queryDistributedElements: function(selector) {
+queryDistributedElements: function (selector) {
var c$ = this.childNodes;
var list = [];
this._distributedFilter(selector, c$, list);
@@ -657,7 +687,7 @@ this._distributedFilter(selector, factory(c).getDistributedNodes(), list);
}
return list;
},
-_distributedFilter: function(selector, list, results) {
+_distributedFilter: function (selector, list, results) {
results = results || [];
for (var i = 0, l = list.length, d; i < l && (d = list[i]); i++) {
if (d.nodeType === Node.ELEMENT_NODE && d.localName !== CONTENT && matchesSelector.call(d, selector)) {
@@ -666,27 +696,27 @@ results.push(d);
}
return results;
},
-_clear: function() {
+_clear: function () {
while (this.childNodes.length) {
this.removeChild(this.childNodes[0]);
}
},
-setAttribute: function(name, value) {
+setAttribute: function (name, value) {
this.node.setAttribute(name, value);
this._distributeParent();
},
-removeAttribute: function(name) {
+removeAttribute: function (name) {
this.node.removeAttribute(name);
this._distributeParent();
},
-_distributeParent: function() {
+_distributeParent: function () {
if (this._parentNeedsDistribution(this.parentNode)) {
this._lazyDistribute(this.parentNode);
}
}
};
-Object.defineProperty(DomApi.prototype, "classList", {
-get: function() {
+Object.defineProperty(DomApi.prototype, 'classList', {
+get: function () {
if (!this._classList) {
this._classList = new DomApi.ClassList(this);
}
@@ -694,20 +724,20 @@ return this._classList;
},
configurable: true
});
-DomApi.ClassList = function(host) {
+DomApi.ClassList = function (host) {
this.domApi = host;
this.node = host.node;
};
DomApi.ClassList.prototype = {
-add: function() {
+add: function () {
this.node.classList.add.apply(this.node.classList, arguments);
this.domApi._distributeParent();
},
-remove: function() {
+remove: function () {
this.node.classList.remove.apply(this.node.classList, arguments);
this.domApi._distributeParent();
},
-toggle: function() {
+toggle: function () {
this.node.classList.toggle.apply(this.node.classList, arguments);
this.domApi._distributeParent();
}
@@ -715,41 +745,41 @@ this.domApi._distributeParent();
if (!Settings.useShadow) {
Object.defineProperties(DomApi.prototype, {
childNodes: {
-get: function() {
+get: function () {
var c$ = getLightChildren(this.node);
return Array.isArray(c$) ? c$ : Array.prototype.slice.call(c$);
},
configurable: true
},
children: {
-get: function() {
-return Array.prototype.filter.call(this.childNodes, function(n) {
+get: function () {
+return Array.prototype.filter.call(this.childNodes, function (n) {
return n.nodeType === Node.ELEMENT_NODE;
});
},
configurable: true
},
parentNode: {
-get: function() {
+get: function () {
return this.node._lightParent || (this.node.__patched ? this.node._composedParent : this.node.parentNode);
},
configurable: true
},
firstChild: {
-get: function() {
+get: function () {
return this.childNodes[0];
},
configurable: true
},
lastChild: {
-get: function() {
+get: function () {
var c$ = this.childNodes;
return c$[c$.length - 1];
},
configurable: true
},
nextSibling: {
-get: function() {
+get: function () {
var c$ = this.parentNode && factory(this.parentNode).childNodes;
if (c$) {
return c$[Array.prototype.indexOf.call(c$, this.node) + 1];
@@ -758,7 +788,7 @@ return c$[Array.prototype.indexOf.call(c$, this.node) + 1];
configurable: true
},
previousSibling: {
-get: function() {
+get: function () {
var c$ = this.parentNode && factory(this.parentNode).childNodes;
if (c$) {
return c$[Array.prototype.indexOf.call(c$, this.node) - 1];
@@ -767,20 +797,20 @@ return c$[Array.prototype.indexOf.call(c$, this.node) - 1];
configurable: true
},
firstElementChild: {
-get: function() {
+get: function () {
return this.children[0];
},
configurable: true
},
lastElementChild: {
-get: function() {
+get: function () {
var c$ = this.children;
return c$[c$.length - 1];
},
configurable: true
},
nextElementSibling: {
-get: function() {
+get: function () {
var c$ = this.parentNode && factory(this.parentNode).children;
if (c$) {
return c$[Array.prototype.indexOf.call(c$, this.node) + 1];
@@ -789,7 +819,7 @@ return c$[Array.prototype.indexOf.call(c$, this.node) + 1];
configurable: true
},
previousElementSibling: {
-get: function() {
+get: function () {
var c$ = this.parentNode && factory(this.parentNode).children;
if (c$) {
return c$[Array.prototype.indexOf.call(c$, this.node) - 1];
@@ -798,16 +828,16 @@ return c$[Array.prototype.indexOf.call(c$, this.node) - 1];
configurable: true
},
textContent: {
-get: function() {
+get: function () {
if (this.node.nodeType === Node.TEXT_NODE) {
return this.node.textContent;
} else {
-return Array.prototype.map.call(this.childNodes, function(c) {
+return Array.prototype.map.call(this.childNodes, function (c) {
return c.textContent;
-}).join("");
+}).join('');
}
},
-set: function(text) {
+set: function (text) {
this._clear();
if (text) {
this.appendChild(document.createTextNode(text));
@@ -816,17 +846,17 @@ this.appendChild(document.createTextNode(text));
configurable: true
},
innerHTML: {
-get: function() {
+get: function () {
if (this.node.nodeType === Node.TEXT_NODE) {
return null;
} else {
return getInnerHTML(this.node);
}
},
-set: function(text) {
+set: function (text) {
if (this.node.nodeType !== Node.TEXT_NODE) {
this._clear();
-var d = document.createElement("div");
+var d = document.createElement('div');
d.innerHTML = text;
for (var e = d.firstChild; e; e = e.nextSibling) {
this.appendChild(e);
@@ -836,14 +866,14 @@ this.appendChild(e);
configurable: true
}
});
-DomApi.prototype._getComposedInnerHTML = function() {
+DomApi.prototype._getComposedInnerHTML = function () {
return getInnerHTML(this.node, true);
};
} else {
-DomApi.prototype.querySelectorAll = function(selector) {
+DomApi.prototype.querySelectorAll = function (selector) {
return Array.prototype.slice.call(this.node.querySelectorAll(selector));
};
-DomApi.prototype.getOwnerRoot = function() {
+DomApi.prototype.getOwnerRoot = function () {
var n = this.node;
while (n) {
if (n.nodeType === Node.DOCUMENT_FRAGMENT_NODE && n.host) {
@@ -852,66 +882,77 @@ return n;
n = n.parentNode;
}
};
-DomApi.prototype.getDestinationInsertionPoints = function() {
+DomApi.prototype.getDestinationInsertionPoints = function () {
var n$ = this.node.getDestinationInsertionPoints();
return n$ ? Array.prototype.slice.call(n$) : [];
};
-DomApi.prototype.getDistributedNodes = function() {
+DomApi.prototype.getDistributedNodes = function () {
var n$ = this.node.getDistributedNodes();
return n$ ? Array.prototype.slice.call(n$) : [];
};
-DomApi.prototype._distributeParent = function() {};
+DomApi.prototype._distributeParent = function () {
+};
Object.defineProperties(DomApi.prototype, {
childNodes: {
-get: function() {
+get: function () {
return Array.prototype.slice.call(this.node.childNodes);
},
configurable: true
},
children: {
-get: function() {
+get: function () {
return Array.prototype.slice.call(this.node.children);
},
configurable: true
},
textContent: {
-get: function() {
+get: function () {
return this.node.textContent;
},
-set: function(value) {
+set: function (value) {
return this.node.textContent = value;
},
configurable: true
},
innerHTML: {
-get: function() {
+get: function () {
return this.node.innerHTML;
},
-set: function(value) {
+set: function (value) {
return this.node.innerHTML = value;
},
configurable: true
}
});
-var forwards = [ "parentNode", "firstChild", "lastChild", "nextSibling", "previousSibling", "firstElementChild", "lastElementChild", "nextElementSibling", "previousElementSibling" ];
-forwards.forEach(function(name) {
+var forwards = [
+'parentNode',
+'firstChild',
+'lastChild',
+'nextSibling',
+'previousSibling',
+'firstElementChild',
+'lastElementChild',
+'nextElementSibling',
+'previousElementSibling'
+];
+forwards.forEach(function (name) {
Object.defineProperty(DomApi.prototype, name, {
-get: function() {
+get: function () {
return this.node[name];
},
configurable: true
});
});
}
-var CONTENT = "content";
-var factory = function(node, patch) {
+var CONTENT = 'content';
+var factory = function (node, patch) {
node = node || document;
if (!node.__domApi) {
node.__domApi = new DomApi(node, patch);
}
return node.__domApi;
};
-Polymer.dom = function(obj, patch) {
+Polymer.dom = function (obj, patch) {
if (obj instanceof Event) {
return Polymer.EventApi.factory(obj);
} else {
@@ -934,7 +975,7 @@ var children = getComposedChildren(parent);
var i = ref_node ? children.indexOf(ref_node) : -1;
if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
var fragChildren = getComposedChildren(node);
-fragChildren.forEach(function(c) {
+fragChildren.forEach(function (c) {
addNodeToComposedChildren(c, parent, children, i);
});
} else {
@@ -984,21 +1025,20 @@ ctor: DomApi,
factory: factory
};
}();
-
-(function() {
+(function () {
Polymer.Base._addFeature({
-_prepShady: function() {
+_prepShady: function () {
this._useContent = this._useContent || Boolean(this._template);
if (this._useContent) {
-this._template._hasInsertionPoint = this._template.content.querySelector("content");
+this._template._hasInsertionPoint = this._template.content.querySelector('content');
}
},
-_poolContent: function() {
+_poolContent: function () {
if (this._useContent) {
saveLightChildrenIfNeeded(this);
}
},
-_setupRoot: function() {
+_setupRoot: function () {
if (this._useContent) {
this._createLocalRoot();
if (!this.dataHost) {
@@ -1006,12 +1046,12 @@ upgradeLightChildren(this._lightChildren);
}
}
},
-_createLocalRoot: function() {
+_createLocalRoot: function () {
this.shadyRoot = this.root;
this.shadyRoot._distributionClean = false;
this.shadyRoot._isShadyRoot = true;
this.shadyRoot._dirtyRoots = [];
-this.shadyRoot._insertionPoints = this._template._hasInsertionPoint ? this.shadyRoot.querySelectorAll("content") : [];
+this.shadyRoot._insertionPoints = this._template._hasInsertionPoint ? this.shadyRoot.querySelectorAll('content') : [];
saveLightChildrenIfNeeded(this.shadyRoot);
this.shadyRoot.host = this;
},
@@ -1019,39 +1059,39 @@ get domHost() {
var root = Polymer.dom(this).getOwnerRoot();
return root && root.host;
},
-distributeContent: function() {
+distributeContent: function () {
if (this.shadyRoot) {
var host = getTopDistributingHost(this);
Polymer.dom(this)._lazyDistribute(host);
}
},
-_distributeContent: function() {
+_distributeContent: function () {
if (this._useContent && !this.shadyRoot._distributionClean) {
this._beginDistribute();
this._distributeDirtyRoots();
this._finishDistribute();
}
},
-_beginDistribute: function() {
+_beginDistribute: function () {
if (this._useContent && hasInsertionPoint(this.shadyRoot)) {
this._resetDistribution();
this._distributePool(this.shadyRoot, this._collectPool());
}
},
-_distributeDirtyRoots: function() {
+_distributeDirtyRoots: function () {
var c$ = this.shadyRoot._dirtyRoots;
for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) {
c._distributeContent();
}
this.shadyRoot._dirtyRoots = [];
},
-_finishDistribute: function() {
+_finishDistribute: function () {
if (this._useContent) {
if (hasInsertionPoint(this.shadyRoot)) {
this._composeTree();
} else {
if (!this.shadyRoot._hasDistributed) {
-this.textContent = "";
+this.textContent = '';
this.appendChild(this.shadyRoot);
} else {
var children = this._composeNode(this);
@@ -1062,11 +1102,11 @@ this.shadyRoot._hasDistributed = true;
this.shadyRoot._distributionClean = true;
}
},
-elementMatches: function(selector, node) {
+elementMatches: function (selector, node) {
node = node || this;
return matchesSelector.call(node, selector);
},
-_resetDistribution: function() {
+_resetDistribution: function () {
var children = getLightChildren(this);
for (var i = 0; i < children.length; i++) {
var child = children[i];
@@ -1083,7 +1123,7 @@ for (var j = 0; j < p$.length; j++) {
p$[j]._distributedNodes = [];
}
},
-_collectPool: function() {
+_collectPool: function () {
var pool = [];
var children = getLightChildren(this);
for (var i = 0; i < children.length; i++) {
@@ -1096,14 +1136,14 @@ pool.push(child);
}
return pool;
},
-_distributePool: function(node, pool) {
+_distributePool: function (node, pool) {
var p$ = node._insertionPoints;
for (var i = 0, l = p$.length, p; i < l && (p = p$[i]); i++) {
this._distributeInsertionPoint(p, pool);
maybeRedistributeParent(p, this);
}
},
-_distributeInsertionPoint: function(content, pool) {
+_distributeInsertionPoint: function (content, pool) {
var anyDistributed = false;
for (var i = 0, l = pool.length, node; i < l; i++) {
node = pool[i];
@@ -1123,7 +1163,7 @@ distributeNodeInto(children[j], content);
}
}
},
-_composeTree: function() {
+_composeTree: function () {
this._updateChildNodes(this, this._composeNode(this));
var p$ = this.shadyRoot._insertionPoints;
for (var i = 0, l = p$.length, p, parent; i < l && (p = p$[i]); i++) {
@@ -1133,7 +1173,7 @@ this._updateChildNodes(parent, this._composeNode(parent));
}
}
},
-_composeNode: function(node) {
+_composeNode: function (node) {
var children = [];
var c$ = getLightChildren(node.shadyRoot || node);
for (var i = 0; i < c$.length; i++) {
@@ -1152,7 +1192,7 @@ children.push(child);
}
return children;
},
-_updateChildNodes: function(container, children) {
+_updateChildNodes: function (container, children) {
var composed = getComposedChildren(container);
var splices = Polymer.ArraySplice.calculateSplices(children, composed);
for (var i = 0, d = 0, s; i < splices.length && (s = splices[i]); i++) {
@@ -1171,8 +1211,8 @@ composed.splice(j, 0, n);
}
}
},
-_matchesContentSelect: function(node, contentElement) {
-var select = contentElement.getAttribute("select");
+_matchesContentSelect: function (node, contentElement) {
+var select = contentElement.getAttribute('select');
if (!select) {
return true;
}
@@ -1189,8 +1229,10 @@ return false;
}
return this.elementMatches(select, node);
},
-_elementAdd: function() {},
-_elementRemove: function() {}
+_elementAdd: function () {
+},
+_elementRemove: function () {
+}
});
var saveLightChildrenIfNeeded = Polymer.DomApi.saveLightChildrenIfNeeded;
var getLightChildren = Polymer.DomApi.getLightChildren;
@@ -1202,7 +1244,7 @@ function distributeNodeInto(child, insertionPoint) {
insertionPoint._distributedNodes.push(child);
var points = child._destinationInsertionPoints;
if (!points) {
-child._destinationInsertionPoints = [ insertionPoint ];
+child._destinationInsertionPoints = [insertionPoint];
} else {
points.push(insertionPoint);
}
@@ -1228,7 +1270,7 @@ var points = node._destinationInsertionPoints;
return points && points[points.length - 1] === insertionPoint;
}
function isInsertionPoint(node) {
-return node.localName == "content";
+return node.localName == 'content';
}
var nativeInsertBefore = Element.prototype.insertBefore;
var nativeRemoveChild = Element.prototype.removeChild;
@@ -1263,7 +1305,7 @@ function hostNeedsRedistribution(host) {
var c$ = Polymer.dom(host).children;
for (var i = 0, c; i < c$.length; i++) {
c = c$[i];
-if (c.localName === "content") {
+if (c.localName === 'content') {
return host.domHost;
}
}
@@ -1276,27 +1318,29 @@ CustomElements.upgrade(children[i]);
}
}
}
-})();
-
+}());
if (Polymer.Settings.useShadow) {
Polymer.Base._addFeature({
-_poolContent: function() {},
-_beginDistribute: function() {},
-distributeContent: function() {},
-_distributeContent: function() {},
-_finishDistribute: function() {},
-_createLocalRoot: function() {
+_poolContent: function () {
+},
+_beginDistribute: function () {
+},
+distributeContent: function () {
+},
+_distributeContent: function () {
+},
+_finishDistribute: function () {
+},
+_createLocalRoot: function () {
this.createShadowRoot();
this.shadowRoot.appendChild(this.root);
this.root = this.shadowRoot;
}
});
}
-
-Polymer.DomModule = document.createElement("dom-module");
-
+Polymer.DomModule = document.createElement('dom-module');
Polymer.Base._addFeature({
-_registerFeatures: function() {
+_registerFeatures: function () {
this._prepIs();
this._prepAttributes();
this._prepBehaviors();
@@ -1305,10 +1349,10 @@ this._prepConstructor();
this._prepTemplate();
this._prepShady();
},
-_prepBehavior: function(b) {
+_prepBehavior: function (b) {
this._addHostAttributes(b.hostAttributes);
},
-_initFeatures: function() {
+_initFeatures: function () {
this._poolContent();
this._pushHost();
this._stampTemplate();
@@ -1318,6 +1362,7 @@ this._setupDebouncers();
this._marshalBehaviors();
this._tryReady();
},
-_marshalBehavior: function(b) {}
+_marshalBehavior: function (b) {
+}
});</script>
diff --git a/third_party/polymer/v1_0/components/polymer/polymer.html b/third_party/polymer/v1_0/components/polymer/polymer.html
index 8eec9b4..cb08dbb 100644
--- a/third_party/polymer/v1_0/components/polymer/polymer.html
+++ b/third_party/polymer/v1_0/components/polymer/polymer.html
@@ -17,40 +17,39 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
--><link rel="import" href="polymer-mini.html">
<script>Polymer.nar = [];
-
Polymer.Annotations = {
-parseAnnotations: function(template) {
+parseAnnotations: function (template) {
var list = [];
var content = template._content || template.content;
this._parseNodeAnnotations(content, list);
return list;
},
-_parseNodeAnnotations: function(node, list) {
+_parseNodeAnnotations: function (node, list) {
return node.nodeType === Node.TEXT_NODE ? this._parseTextNodeAnnotation(node, list) : this._parseElementAnnotations(node, list);
},
-_testEscape: function(value) {
+_testEscape: function (value) {
var escape = value.slice(0, 2);
-if (escape === "{{" || escape === "[[") {
+if (escape === '{{' || escape === '[[') {
return escape;
}
},
-_parseTextNodeAnnotation: function(node, list) {
+_parseTextNodeAnnotation: function (node, list) {
var v = node.textContent;
var escape = this._testEscape(v);
if (escape) {
-node.textContent = " ";
+node.textContent = ' ';
var annote = {
-bindings: [ {
-kind: "text",
+bindings: [{
+kind: 'text',
mode: escape[0],
value: v.slice(2, -2).trim()
-} ]
+}]
};
list.push(annote);
return annote;
}
},
-_parseElementAnnotations: function(element, list) {
+_parseElementAnnotations: function (element, list) {
var annote = {
bindings: [],
events: []
@@ -67,10 +66,10 @@ list.push(annote);
}
return annote;
},
-_parseChildNodesAnnotations: function(root, annote, list, callback) {
+_parseChildNodesAnnotations: function (root, annote, list, callback) {
if (root.firstChild) {
for (var i = 0, node = root.firstChild; node; node = node.nextSibling, i++) {
-if (node.localName === "template" && !node.hasAttribute("preserve-content")) {
+if (node.localName === 'template' && !node.hasAttribute('preserve-content')) {
this._parseTemplate(node, i, list, annote);
}
var childAnnotation = this._parseNodeAnnotations(node, list, callback);
@@ -81,7 +80,7 @@ childAnnotation.index = i;
}
}
},
-_parseTemplate: function(node, index, list, parent) {
+_parseTemplate: function (node, index, list, parent) {
var content = document.createDocumentFragment();
content._notes = this.parseAnnotations(node);
content.appendChild(node.content);
@@ -93,12 +92,12 @@ parent: parent,
index: index
});
},
-_parseNodeAttributeAnnotations: function(node, annotation) {
+_parseNodeAttributeAnnotations: function (node, annotation) {
for (var i = node.attributes.length - 1, a; a = node.attributes[i]; i--) {
var n = a.name, v = a.value;
-if (n === "id" && !this._testEscape(v)) {
+if (n === 'id' && !this._testEscape(v)) {
annotation.id = v;
-} else if (n.slice(0, 3) === "on-") {
+} else if (n.slice(0, 3) === 'on-') {
node.removeAttribute(n);
annotation.events.push({
name: n.slice(3),
@@ -112,7 +111,7 @@ annotation.bindings.push(b);
}
}
},
-_parseNodeAttributeAnnotation: function(node, n, v) {
+_parseNodeAttributeAnnotation: function (node, n, v) {
var escape = this._testEscape(v);
if (escape) {
var customEvent;
@@ -120,26 +119,26 @@ var name = n;
var mode = escape[0];
v = v.slice(2, -2).trim();
var not = false;
-if (v[0] == "!") {
+if (v[0] == '!') {
v = v.substring(1);
not = true;
}
-var kind = "property";
-if (n[n.length - 1] == "$") {
+var kind = 'property';
+if (n[n.length - 1] == '$') {
name = n.slice(0, -1);
-kind = "attribute";
+kind = 'attribute';
}
var notifyEvent, colon;
-if (mode == "{" && (colon = v.indexOf("::")) > 0) {
+if (mode == '{' && (colon = v.indexOf('::')) > 0) {
notifyEvent = v.substring(colon + 2);
v = v.substring(0, colon);
customEvent = true;
}
-if (node.localName == "input" && n == "value") {
-node.setAttribute(n, "");
+if (node.localName == 'input' && n == 'value') {
+node.setAttribute(n, '');
}
node.removeAttribute(n);
-if (kind === "property") {
+if (kind === 'property') {
name = Polymer.CaseMap.dashToCamelCase(name);
}
return {
@@ -153,30 +152,29 @@ customEvent: customEvent
};
}
},
-_localSubTree: function(node, host) {
+_localSubTree: function (node, host) {
return node === host ? node.childNodes : node._lightChildren || node.childNodes;
},
-findAnnotatedNode: function(root, annote) {
+findAnnotatedNode: function (root, annote) {
var parent = annote.parent && Polymer.Annotations.findAnnotatedNode(root, annote.parent);
return !parent ? root : Polymer.Annotations._localSubTree(parent, root)[annote.index];
}
};
-
-(function() {
+(function () {
function resolveCss(cssText, ownerDocument) {
-return cssText.replace(CSS_URL_RX, function(m, pre, url, post) {
-return pre + "'" + resolve(url.replace(/["']/g, ""), ownerDocument) + "'" + post;
+return cssText.replace(CSS_URL_RX, function (m, pre, url, post) {
+return pre + '\'' + resolve(url.replace(/["']/g, ''), ownerDocument) + '\'' + post;
});
}
function resolveAttrs(element, ownerDocument) {
for (var name in URL_ATTRS) {
var a$ = URL_ATTRS[name];
for (var i = 0, l = a$.length, a, at, v; i < l && (a = a$[i]); i++) {
-if (name === "*" || element.localName === name) {
+if (name === '*' || element.localName === name) {
at = element.attributes[a];
v = at && at.value;
if (v && v.search(BINDING_RX) < 0) {
-at.value = a === "style" ? resolveCss(v, ownerDocument) : resolve(v, ownerDocument);
+at.value = a === 'style' ? resolveCss(v, ownerDocument) : resolve(v, ownerDocument);
}
}
}
@@ -191,20 +189,25 @@ var tempDoc;
var tempDocBase;
function resolveUrl(url, baseUri) {
if (!tempDoc) {
-tempDoc = document.implementation.createHTMLDocument("temp");
-tempDocBase = tempDoc.createElement("base");
+tempDoc = document.implementation.createHTMLDocument('temp');
+tempDocBase = tempDoc.createElement('base');
tempDoc.head.appendChild(tempDocBase);
}
tempDocBase.href = baseUri;
return resolve(url, tempDoc);
}
function getUrlResolver(ownerDocument) {
-return ownerDocument.__urlResolver || (ownerDocument.__urlResolver = ownerDocument.createElement("a"));
+return ownerDocument.__urlResolver || (ownerDocument.__urlResolver = ownerDocument.createElement('a'));
}
var CSS_URL_RX = /(url\()([^)]*)(\))/g;
var URL_ATTRS = {
-"*": [ "href", "src", "style", "url" ],
-form: [ "action" ]
+'*': [
+'href',
+'src',
+'style',
+'url'
+],
+form: ['action']
};
var BINDING_RX = /\{\{|\[\[/;
Polymer.ResolveUrl = {
@@ -212,10 +215,9 @@ resolveCss: resolveCss,
resolveAttrs: resolveAttrs,
resolveUrl: resolveUrl
};
-})();
-
+}());
Polymer.Base._addFeature({
-_prepAnnotations: function() {
+_prepAnnotations: function () {
if (!this._template) {
this._notes = [];
} else {
@@ -225,7 +227,7 @@ this._processAnnotations(this._notes);
Polymer.Annotations.prepElement = null;
}
},
-_processAnnotations: function(notes) {
+_processAnnotations: function (notes) {
for (var i = 0; i < notes.length; i++) {
var note = notes[i];
for (var j = 0; j < note.bindings.length; j++) {
@@ -242,9 +244,9 @@ var bindings = [];
for (var prop in pp) {
bindings.push({
index: note.index,
-kind: "property",
-mode: "{",
-name: "_parent_" + prop,
+kind: 'property',
+mode: '{',
+name: '_parent_' + prop,
model: prop,
value: prop
});
@@ -253,10 +255,10 @@ note.bindings = note.bindings.concat(bindings);
}
}
},
-_discoverTemplateParentProps: function(notes) {
+_discoverTemplateParentProps: function (notes) {
var pp = {};
-notes.forEach(function(n) {
-n.bindings.forEach(function(b) {
+notes.forEach(function (n) {
+n.bindings.forEach(function (b) {
if (b.signature) {
var args = b.signature.args;
for (var k = 0; k < args.length; k++) {
@@ -273,104 +275,105 @@ Polymer.Base.mixin(pp, tpp);
});
return pp;
},
-_prepElement: function(element) {
+_prepElement: function (element) {
Polymer.ResolveUrl.resolveAttrs(element, this._template.ownerDocument);
},
_findAnnotatedNode: Polymer.Annotations.findAnnotatedNode,
-_marshalAnnotationReferences: function() {
+_marshalAnnotationReferences: function () {
if (this._template) {
this._marshalIdNodes();
this._marshalAnnotatedNodes();
this._marshalAnnotatedListeners();
}
},
-_configureAnnotationReferences: function() {
+_configureAnnotationReferences: function () {
this._configureTemplateContent();
},
-_configureTemplateContent: function() {
-this._notes.forEach(function(note, i) {
+_configureTemplateContent: function () {
+this._notes.forEach(function (note, i) {
if (note.templateContent) {
this._nodes[i]._content = note.templateContent;
}
}, this);
},
-_marshalIdNodes: function() {
+_marshalIdNodes: function () {
this.$ = {};
-this._notes.forEach(function(a) {
+this._notes.forEach(function (a) {
if (a.id) {
this.$[a.id] = this._findAnnotatedNode(this.root, a);
}
}, this);
},
-_marshalAnnotatedNodes: function() {
+_marshalAnnotatedNodes: function () {
if (this._nodes) {
-this._nodes = this._nodes.map(function(a) {
+this._nodes = this._nodes.map(function (a) {
return this._findAnnotatedNode(this.root, a);
}, this);
}
},
-_marshalAnnotatedListeners: function() {
-this._notes.forEach(function(a) {
+_marshalAnnotatedListeners: function () {
+this._notes.forEach(function (a) {
if (a.events && a.events.length) {
var node = this._findAnnotatedNode(this.root, a);
-a.events.forEach(function(e) {
+a.events.forEach(function (e) {
this.listen(node, e.name, e.value);
}, this);
}
}, this);
}
});
-
Polymer.Base._addFeature({
listeners: {},
-_listenListeners: function(listeners) {
+_listenListeners: function (listeners) {
var node, name, key;
for (key in listeners) {
-if (key.indexOf(".") < 0) {
+if (key.indexOf('.') < 0) {
node = this;
name = key;
} else {
-name = key.split(".");
+name = key.split('.');
node = this.$[name[0]];
name = name[1];
}
this.listen(node, name, listeners[key]);
}
},
-listen: function(node, eventName, methodName) {
+listen: function (node, eventName, methodName) {
this._listen(node, eventName, this._createEventHandler(node, eventName, methodName));
},
-_createEventHandler: function(node, eventName, methodName) {
+_createEventHandler: function (node, eventName, methodName) {
var host = this;
-return function(e) {
+return function (e) {
if (host[methodName]) {
host[methodName](e, e.detail);
} else {
-host._warn(host._logf("_createEventHandler", "listener method `" + methodName + "` not defined"));
+host._warn(host._logf('_createEventHandler', 'listener method `' + methodName + '` not defined'));
}
};
},
-_listen: function(node, eventName, handler) {
+_listen: function (node, eventName, handler) {
node.addEventListener(eventName, handler);
}
});
-
-(function() {
-"use strict";
-var HAS_NATIVE_TA = typeof document.head.style.touchAction === "string";
-var GESTURE_KEY = "__polymerGestures";
-var HANDLED_OBJ = "__polymerGesturesHandled";
-var TOUCH_ACTION = "__polymerGesturesTouchAction";
+(function () {
+'use strict';
+var HAS_NATIVE_TA = typeof document.head.style.touchAction === 'string';
+var GESTURE_KEY = '__polymerGestures';
+var HANDLED_OBJ = '__polymerGesturesHandled';
+var TOUCH_ACTION = '__polymerGesturesTouchAction';
var TAP_DISTANCE = 25;
var TRACK_DISTANCE = 5;
var TRACK_LENGTH = 2;
var MOUSE_TIMEOUT = 2500;
-var MOUSE_EVENTS = [ "mousedown", "mousemove", "mouseup", "click" ];
-var mouseCanceller = function(mouseEvent) {
-mouseEvent[HANDLED_OBJ] = {
-skip: true
-};
-if (mouseEvent.type === "click") {
+var MOUSE_EVENTS = [
+'mousedown',
+'mousemove',
+'mouseup',
+'click'
+];
+var mouseCanceller = function (mouseEvent) {
+mouseEvent[HANDLED_OBJ] = { skip: true };
+if (mouseEvent.type === 'click') {
var path = Polymer.dom(mouseEvent).path;
for (var i = 0; i < path.length; i++) {
if (path[i] === POINTERSTATE.mouse.target) {
@@ -395,7 +398,7 @@ function ignoreMouse() {
if (!POINTERSTATE.mouse.mouseIgnoreJob) {
setupTeardownMouseCanceller(true);
}
-var unset = function() {
+var unset = function () {
setupTeardownMouseCanceller();
POINTERSTATE.mouse.target = null;
POINTERSTATE.mouse.mouseIgnoreJob = null;
@@ -417,7 +420,7 @@ scrollDecided: false
};
function firstTouchAction(ev) {
var path = Polymer.dom(ev).path;
-var ta = "auto";
+var ta = 'auto';
for (var i = 0, n; i < path.length; i++) {
n = path[i];
if (n[TOUCH_ACTION]) {
@@ -430,7 +433,7 @@ return ta;
var Gestures = {
gestures: {},
recognizers: [],
-deepTargetFind: function(x, y) {
+deepTargetFind: function (x, y) {
var node = document.elementFromPoint(x, y);
var next = node;
while (next && next.shadowRoot) {
@@ -441,7 +444,7 @@ node = next;
}
return node;
},
-handleNative: function(ev) {
+handleNative: function (ev) {
var handled;
var type = ev.type;
var node = ev.currentTarget;
@@ -452,9 +455,9 @@ return;
}
if (!ev[HANDLED_OBJ]) {
ev[HANDLED_OBJ] = {};
-if (type.slice(0, 5) === "touch") {
+if (type.slice(0, 5) === 'touch') {
var t = ev.changedTouches[0];
-if (type === "touchstart") {
+if (type === 'touchstart') {
if (ev.touches.length === 1) {
POINTERSTATE.touch.id = t.identifier;
}
@@ -463,11 +466,11 @@ if (POINTERSTATE.touch.id !== t.identifier) {
return;
}
if (!HAS_NATIVE_TA) {
-if (type === "touchstart" || type === "touchmove") {
+if (type === 'touchstart' || type === 'touchmove') {
Gestures.handleTouchAction(ev);
}
}
-if (type === "touchend") {
+if (type === 'touchend') {
POINTERSTATE.mouse.target = Polymer.dom(ev).rootTarget;
ignoreMouse(true);
}
@@ -486,14 +489,14 @@ r[type](ev);
}
}
},
-handleTouchAction: function(ev) {
+handleTouchAction: function (ev) {
var t = ev.changedTouches[0];
var type = ev.type;
-if (type === "touchstart") {
+if (type === 'touchstart') {
POINTERSTATE.touch.x = t.clientX;
POINTERSTATE.touch.y = t.clientY;
POINTERSTATE.touch.scrollDecided = false;
-} else if (type === "touchmove") {
+} else if (type === 'touchmove') {
if (POINTERSTATE.touch.scrollDecided) {
return;
}
@@ -502,11 +505,12 @@ var ta = firstTouchAction(ev);
var prevent = false;
var dx = Math.abs(POINTERSTATE.touch.x - t.clientX);
var dy = Math.abs(POINTERSTATE.touch.y - t.clientY);
-if (!ev.cancelable) {} else if (ta === "none") {
+if (!ev.cancelable) {
+} else if (ta === 'none') {
prevent = true;
-} else if (ta === "pan-x") {
+} else if (ta === 'pan-x') {
prevent = dy > dx;
-} else if (ta === "pan-y") {
+} else if (ta === 'pan-y') {
prevent = dx > dy;
}
if (prevent) {
@@ -514,7 +518,7 @@ ev.preventDefault();
}
}
},
-add: function(node, evType, handler) {
+add: function (node, evType, handler) {
var recognizer = this.gestures[evType];
var deps = recognizer.deps;
var name = recognizer.name;
@@ -536,19 +540,19 @@ if (recognizer.touchAction) {
this.setTouchAction(node, recognizer.touchAction);
}
},
-register: function(recog) {
+register: function (recog) {
this.recognizers.push(recog);
for (var i = 0; i < recog.emits.length; i++) {
this.gestures[recog.emits[i]] = recog;
}
},
-setTouchAction: function(node, value) {
+setTouchAction: function (node, value) {
if (HAS_NATIVE_TA) {
node.style.touchAction = value;
}
node[TOUCH_ACTION] = value;
},
-fire: function(target, type, detail) {
+fire: function (target, type, detail) {
var ev = new CustomEvent(type, {
detail: detail,
bubbles: true,
@@ -558,26 +562,33 @@ target.dispatchEvent(ev);
}
};
Gestures.register({
-name: "downup",
-deps: [ "mousedown", "touchstart", "touchend" ],
-emits: [ "down", "up" ],
-mousedown: function(e) {
+name: 'downup',
+deps: [
+'mousedown',
+'touchstart',
+'touchend'
+],
+emits: [
+'down',
+'up'
+],
+mousedown: function (e) {
var t = e.currentTarget;
var self = this;
var upfn = function upfn(e) {
-self.fire("up", t, e);
-document.removeEventListener("mouseup", upfn);
+self.fire('up', t, e);
+document.removeEventListener('mouseup', upfn);
};
-document.addEventListener("mouseup", upfn);
-this.fire("down", t, e);
+document.addEventListener('mouseup', upfn);
+this.fire('down', t, e);
},
-touchstart: function(e) {
-this.fire("down", e.currentTarget, e.changedTouches[0]);
+touchstart: function (e) {
+this.fire('down', e.currentTarget, e.changedTouches[0]);
},
-touchend: function(e) {
-this.fire("up", e.currentTarget, e.changedTouches[0]);
+touchend: function (e) {
+this.fire('up', e.currentTarget, e.changedTouches[0]);
},
-fire: function(type, target, event) {
+fire: function (type, target, event) {
Gestures.fire(target, type, {
x: event.clientX,
y: event.clientY,
@@ -586,31 +597,36 @@ sourceEvent: event
}
});
Gestures.register({
-name: "track",
-touchAction: "none",
-deps: [ "mousedown", "touchstart", "touchmove", "touchend" ],
-emits: [ "track" ],
+name: 'track',
+touchAction: 'none',
+deps: [
+'mousedown',
+'touchstart',
+'touchmove',
+'touchend'
+],
+emits: ['track'],
info: {
x: 0,
y: 0,
-state: "start",
+state: 'start',
started: false,
moves: [],
-addMove: function(move) {
+addMove: function (move) {
if (this.moves.length > TRACK_LENGTH) {
this.moves.shift();
}
this.moves.push(move);
}
},
-clearInfo: function() {
-this.info.state = "start";
+clearInfo: function () {
+this.info.state = 'start';
this.info.started = false;
this.info.moves = [];
this.info.x = 0;
this.info.y = 0;
},
-hasMovedEnough: function(x, y) {
+hasMovedEnough: function (x, y) {
if (this.info.started) {
return true;
}
@@ -618,13 +634,13 @@ var dx = Math.abs(this.info.x - x);
var dy = Math.abs(this.info.y - y);
return dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE;
},
-mousedown: function(e) {
+mousedown: function (e) {
var t = e.currentTarget;
var self = this;
var movefn = function movefn(e) {
var x = e.clientX, y = e.clientY;
if (self.hasMovedEnough(x, y)) {
-self.info.state = self.info.started ? e.type === "mouseup" ? "end" : "track" : "start";
+self.info.state = self.info.started ? e.type === 'mouseup' ? 'end' : 'track' : 'start';
self.info.addMove({
x: x,
y: y
@@ -640,20 +656,20 @@ POINTERSTATE.tapPrevented = true;
movefn(e);
}
self.clearInfo();
-document.removeEventListener("mousemove", movefn);
-document.removeEventListener("mouseup", upfn);
+document.removeEventListener('mousemove', movefn);
+document.removeEventListener('mouseup', upfn);
};
-document.addEventListener("mousemove", movefn);
-document.addEventListener("mouseup", upfn);
+document.addEventListener('mousemove', movefn);
+document.addEventListener('mouseup', upfn);
this.info.x = e.clientX;
this.info.y = e.clientY;
},
-touchstart: function(e) {
+touchstart: function (e) {
var ct = e.changedTouches[0];
this.info.x = ct.clientX;
this.info.y = ct.clientY;
},
-touchmove: function(e) {
+touchmove: function (e) {
var t = e.currentTarget;
var ct = e.changedTouches[0];
var x = ct.clientX, y = ct.clientY;
@@ -663,16 +679,16 @@ x: x,
y: y
});
this.fire(t, ct);
-this.info.state = "track";
+this.info.state = 'track';
this.info.started = true;
}
},
-touchend: function(e) {
+touchend: function (e) {
var t = e.currentTarget;
var ct = e.changedTouches[0];
if (this.info.started) {
POINTERSTATE.tapPrevented = true;
-this.info.state = "end";
+this.info.state = 'end';
this.info.addMove({
x: ct.clientX,
y: ct.clientY
@@ -681,7 +697,7 @@ this.fire(t, ct);
}
this.clearInfo();
},
-fire: function(target, touch) {
+fire: function (target, touch) {
var secondlast = this.info.moves[this.info.moves.length - 2];
var lastmove = this.info.moves[this.info.moves.length - 1];
var dx = lastmove.x - this.info.x;
@@ -691,7 +707,7 @@ if (secondlast) {
ddx = lastmove.x - secondlast.x;
ddy = lastmove.y - secondlast.y;
}
-return Gestures.fire(target, "track", {
+return Gestures.fire(target, 'track', {
state: this.info.state,
x: touch.clientX,
y: touch.clientY,
@@ -700,48 +716,53 @@ dy: dy,
ddx: ddx,
ddy: ddy,
sourceEvent: touch,
-hover: function() {
+hover: function () {
return Gestures.deepTargetFind(touch.clientX, touch.clientY);
}
});
}
});
Gestures.register({
-name: "tap",
-deps: [ "mousedown", "click", "touchstart", "touchend" ],
-emits: [ "tap" ],
+name: 'tap',
+deps: [
+'mousedown',
+'click',
+'touchstart',
+'touchend'
+],
+emits: ['tap'],
start: {
x: NaN,
y: NaN
},
-reset: function() {
+reset: function () {
this.start.x = NaN;
this.start.y = NaN;
},
-save: function(e) {
+save: function (e) {
this.start.x = e.clientX;
this.start.y = e.clientY;
},
-mousedown: function(e) {
+mousedown: function (e) {
POINTERSTATE.tapPrevented = false;
this.save(e);
},
-click: function(e) {
+click: function (e) {
this.forward(e);
},
-touchstart: function(e) {
+touchstart: function (e) {
POINTERSTATE.tapPrevented = false;
this.save(e.changedTouches[0]);
},
-touchend: function(e) {
+touchend: function (e) {
this.forward(e.changedTouches[0]);
},
-forward: function(e) {
+forward: function (e) {
var dx = Math.abs(e.clientX - this.start.x);
var dy = Math.abs(e.clientY - this.start.y);
if (isNaN(dx) || isNaN(dy) || dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) {
if (!POINTERSTATE.tapPrevented) {
-Gestures.fire(e.target, "tap", {
+Gestures.fire(e.target, 'tap', {
x: e.clientX,
y: e.clientY,
sourceEvent: e
@@ -752,32 +773,31 @@ this.reset();
}
});
var DIRECTION_MAP = {
-x: "pan-x",
-y: "pan-y",
-none: "none",
-all: "auto"
+x: 'pan-x',
+y: 'pan-y',
+none: 'none',
+all: 'auto'
};
Polymer.Base._addFeature({
-_listen: function(node, eventName, handler) {
+_listen: function (node, eventName, handler) {
if (Gestures.gestures[eventName]) {
Gestures.add(node, eventName, handler);
} else {
node.addEventListener(eventName, handler);
}
},
-setScrollDirection: function(direction, node) {
+setScrollDirection: function (direction, node) {
node = node || this;
-Gestures.setTouchAction(node, DIRECTION_MAP[direction] || "auto");
+Gestures.setTouchAction(node, DIRECTION_MAP[direction] || 'auto');
}
});
Polymer.Gestures = Gestures;
-})();
-
-Polymer.Async = function() {
+}());
+Polymer.Async = function () {
var currVal = 0;
var lastVal = 0;
var callbacks = [];
-var twiddle = document.createTextNode("");
+var twiddle = document.createTextNode('');
function runAsync(callback, waitTime) {
if (waitTime > 0) {
return ~setTimeout(callback, waitTime);
@@ -794,7 +814,7 @@ clearTimeout(~handle);
var idx = handle - lastVal;
if (idx >= 0) {
if (!callbacks[idx]) {
-throw "invalid async handle: " + handle;
+throw 'invalid async handle: ' + handle;
}
callbacks[idx] = null;
}
@@ -811,37 +831,34 @@ cb();
callbacks.splice(0, len);
lastVal += len;
}
-new (window.MutationObserver || JsMutationObserver)(atEndOfMicrotask).observe(twiddle, {
-characterData: true
-});
+new (window.MutationObserver || JsMutationObserver)(atEndOfMicrotask).observe(twiddle, { characterData: true });
return {
run: runAsync,
cancel: cancelAsync
};
}();
-
-Polymer.Debounce = function() {
+Polymer.Debounce = function () {
var Async = Polymer.Async;
-var Debouncer = function(context) {
+var Debouncer = function (context) {
this.context = context;
this.boundComplete = this.complete.bind(this);
};
Debouncer.prototype = {
-go: function(callback, wait) {
+go: function (callback, wait) {
var h;
-this.finish = function() {
+this.finish = function () {
Async.cancel(h);
};
h = Async.run(this.boundComplete, wait);
this.callback = callback;
},
-stop: function() {
+stop: function () {
if (this.finish) {
this.finish();
this.finish = null;
}
},
-complete: function() {
+complete: function () {
if (this.finish) {
this.stop();
this.callback.call(this.context);
@@ -859,12 +876,11 @@ return debouncer;
}
return debounce;
}();
-
Polymer.Base._addFeature({
-$$: function(slctr) {
+$$: function (slctr) {
return Polymer.dom(this.root).querySelector(slctr);
},
-toggleClass: function(name, bool, node) {
+toggleClass: function (name, bool, node) {
node = node || this;
if (arguments.length == 1) {
bool = !node.classList.contains(name);
@@ -875,18 +891,18 @@ Polymer.dom(node).classList.add(name);
Polymer.dom(node).classList.remove(name);
}
},
-toggleAttribute: function(name, bool, node) {
+toggleAttribute: function (name, bool, node) {
node = node || this;
if (arguments.length == 1) {
bool = !node.hasAttribute(name);
}
if (bool) {
-Polymer.dom(node).setAttribute(name, "");
+Polymer.dom(node).setAttribute(name, '');
} else {
Polymer.dom(node).removeAttribute(name);
}
},
-classFollows: function(name, toElement, fromElement) {
+classFollows: function (name, toElement, fromElement) {
if (fromElement) {
Polymer.dom(fromElement).classList.remove(name);
}
@@ -894,23 +910,23 @@ if (toElement) {
Polymer.dom(toElement).classList.add(name);
}
},
-attributeFollows: function(name, toElement, fromElement) {
+attributeFollows: function (name, toElement, fromElement) {
if (fromElement) {
Polymer.dom(fromElement).removeAttribute(name);
}
if (toElement) {
-Polymer.dom(toElement).setAttribute(name, "");
+Polymer.dom(toElement).setAttribute(name, '');
}
},
-getContentChildNodes: function(slctr) {
-return Polymer.dom(Polymer.dom(this.root).querySelector(slctr || "content")).getDistributedNodes();
+getContentChildNodes: function (slctr) {
+return Polymer.dom(Polymer.dom(this.root).querySelector(slctr || 'content')).getDistributedNodes();
},
-getContentChildren: function(slctr) {
-return this.getContentChildNodes(slctr).filter(function(n) {
+getContentChildren: function (slctr) {
+return this.getContentChildNodes(slctr).filter(function (n) {
return n.nodeType === Node.ELEMENT_NODE;
});
},
-fire: function(type, detail, options) {
+fire: function (type, detail, options) {
options = options || Polymer.nob;
var node = options.node || this;
var detail = detail === null || detail === undefined ? Polymer.nob : detail;
@@ -923,13 +939,13 @@ detail: detail
node.dispatchEvent(event);
return event;
},
-async: function(callback, waitTime) {
+async: function (callback, waitTime) {
return Polymer.Async.run(callback.bind(this), waitTime);
},
-cancelAsync: function(handle) {
+cancelAsync: function (handle) {
Polymer.Async.cancel(handle);
},
-arrayDelete: function(path, item) {
+arrayDelete: function (path, item) {
var index;
if (Array.isArray(path)) {
index = path.indexOf(item);
@@ -944,18 +960,18 @@ return this.splice(path, index, 1);
}
}
},
-transform: function(transform, node) {
+transform: function (transform, node) {
node = node || this;
node.style.webkitTransform = transform;
node.style.transform = transform;
},
-translate3d: function(x, y, z, node) {
+translate3d: function (x, y, z, node) {
node = node || this;
-this.transform("translate3d(" + x + "," + y + "," + z + ")", node);
+this.transform('translate3d(' + x + ',' + y + ',' + z + ')', node);
},
-importHref: function(href, onload, onerror) {
-var l = document.createElement("link");
-l.rel = "import";
+importHref: function (href, onload, onerror) {
+var l = document.createElement('link');
+l.rel = 'import';
l.href = href;
if (onload) {
l.onload = onload.bind(this);
@@ -966,7 +982,7 @@ l.onerror = onerror.bind(this);
document.head.appendChild(l);
return l;
},
-create: function(tag, props) {
+create: function (tag, props) {
var elt = document.createElement(tag);
if (props) {
for (var n in props) {
@@ -975,15 +991,14 @@ elt[n] = props[n];
}
return elt;
},
-mixin: function(target, source) {
+mixin: function (target, source) {
for (var i in source) {
target[i] = source[i];
}
}
});
-
Polymer.Bind = {
-prepareModel: function(model) {
+prepareModel: function (model) {
model._propertyEffects = {};
model._bindListeners = [];
var api = this._modelApi;
@@ -992,19 +1007,15 @@ model[n] = api[n];
}
},
_modelApi: {
-_notifyChange: function(property) {
-var eventName = Polymer.CaseMap.camelToDashCase(property) + "-changed";
-this.fire(eventName, {
-value: this[property]
-}, {
-bubbles: false
-});
+_notifyChange: function (property) {
+var eventName = Polymer.CaseMap.camelToDashCase(property) + '-changed';
+this.fire(eventName, { value: this[property] }, { bubbles: false });
},
-_propertySet: function(property, value, effects) {
+_propertySet: function (property, value, effects) {
var old = this.__data__[property];
if (old !== value) {
this.__data__[property] = value;
-if (typeof value == "object") {
+if (typeof value == 'object') {
this._clearPath(property);
}
if (this._propertyChanged) {
@@ -1016,37 +1027,37 @@ this._effectEffects(property, value, effects, old);
}
return old;
},
-_effectEffects: function(property, value, effects, old) {
-effects.forEach(function(fx) {
-var fn = Polymer.Bind["_" + fx.kind + "Effect"];
+_effectEffects: function (property, value, effects, old) {
+effects.forEach(function (fx) {
+var fn = Polymer.Bind['_' + fx.kind + 'Effect'];
if (fn) {
fn.call(this, property, value, fx.effect, old);
}
}, this);
},
-_clearPath: function(path) {
+_clearPath: function (path) {
for (var prop in this.__data__) {
-if (prop.indexOf(path + ".") === 0) {
+if (prop.indexOf(path + '.') === 0) {
this.__data__[prop] = undefined;
}
}
}
},
-ensurePropertyEffects: function(model, property) {
+ensurePropertyEffects: function (model, property) {
var fx = model._propertyEffects[property];
if (!fx) {
fx = model._propertyEffects[property] = [];
}
return fx;
},
-addPropertyEffect: function(model, property, kind, effect) {
+addPropertyEffect: function (model, property, kind, effect) {
var fx = this.ensurePropertyEffects(model, property);
fx.push({
kind: kind,
effect: effect
});
},
-createBindings: function(model) {
+createBindings: function (model) {
var fx$ = model._propertyEffects;
if (fx$) {
for (var n in fx$) {
@@ -1056,43 +1067,43 @@ this._createAccessors(model, n, fx);
}
}
},
-_sortPropertyEffects: function() {
+_sortPropertyEffects: function () {
var EFFECT_ORDER = {
-compute: 0,
-annotation: 1,
-computedAnnotation: 2,
-reflect: 3,
-notify: 4,
-observer: 5,
-complexObserver: 6,
-"function": 7
+'compute': 0,
+'annotation': 1,
+'computedAnnotation': 2,
+'reflect': 3,
+'notify': 4,
+'observer': 5,
+'complexObserver': 6,
+'function': 7
};
-return function(a, b) {
+return function (a, b) {
return EFFECT_ORDER[a.kind] - EFFECT_ORDER[b.kind];
};
}(),
-_createAccessors: function(model, property, effects) {
+_createAccessors: function (model, property, effects) {
var defun = {
-get: function() {
+get: function () {
return this.__data__[property];
}
};
-var setter = function(value) {
+var setter = function (value) {
this._propertySet(property, value, effects);
};
if (model.getPropertyInfo && model.getPropertyInfo(property).readOnly) {
-model["_set" + this.upper(property)] = setter;
+model['_set' + this.upper(property)] = setter;
} else {
defun.set = setter;
}
Object.defineProperty(model, property, defun);
},
-upper: function(name) {
+upper: function (name) {
return name[0].toUpperCase() + name.substring(1);
},
-_addAnnotatedListener: function(model, index, property, path, event) {
+_addAnnotatedListener: function (model, index, property, path, event) {
var fn = this._notedListenerFactory(property, path, this._isStructured(path), this._isEventBogus);
-var eventName = event || Polymer.CaseMap.camelToDashCase(property) + "-changed";
+var eventName = event || Polymer.CaseMap.camelToDashCase(property) + '-changed';
model._bindListeners.push({
index: index,
property: property,
@@ -1101,14 +1112,14 @@ changedFn: fn,
event: eventName
});
},
-_isStructured: function(path) {
-return path.indexOf(".") > 0;
+_isStructured: function (path) {
+return path.indexOf('.') > 0;
},
-_isEventBogus: function(e, target) {
+_isEventBogus: function (e, target) {
return e.path && e.path[0] !== target;
},
-_notedListenerFactory: function(property, path, isStructured, bogusTest) {
-return function(e, target) {
+_notedListenerFactory: function (property, path, isStructured, bogusTest) {
+return function (e, target) {
if (!bogusTest(e, target)) {
if (e.detail && e.detail.path) {
this.notifyPath(this._fixPath(path, property, e.detail.path), e.detail.value);
@@ -1125,22 +1136,21 @@ this.set(path, value);
}
};
},
-prepareInstance: function(inst) {
+prepareInstance: function (inst) {
inst.__data__ = Object.create(null);
},
-setupBindListeners: function(inst) {
-inst._bindListeners.forEach(function(info) {
+setupBindListeners: function (inst) {
+inst._bindListeners.forEach(function (info) {
var node = inst._nodes[info.index];
node.addEventListener(info.event, inst._notifyListener.bind(inst, info.changedFn));
});
}
};
-
Polymer.Base.extend(Polymer.Bind, {
-_shouldAddListener: function(effect) {
-return effect.name && effect.mode === "{" && !effect.negate && effect.kind != "attribute";
+_shouldAddListener: function (effect) {
+return effect.name && effect.mode === '{' && !effect.negate && effect.kind != 'attribute';
},
-_annotationEffect: function(source, value, effect) {
+_annotationEffect: function (source, value, effect) {
if (source != effect.value) {
value = this.get(effect.value);
this.__data__[effect.value] = value;
@@ -1150,24 +1160,24 @@ if (!effect.customEvent || this._nodes[effect.index][effect.name] !== calc) {
return this._applyEffectValue(calc, effect);
}
},
-_reflectEffect: function(source) {
+_reflectEffect: function (source) {
this.reflectPropertyToAttribute(source);
},
-_notifyEffect: function(source) {
+_notifyEffect: function (source) {
this._notifyChange(source);
},
-_functionEffect: function(source, value, fn, old) {
+_functionEffect: function (source, value, fn, old) {
fn.call(this, source, value, old);
},
-_observerEffect: function(source, value, effect, old) {
+_observerEffect: function (source, value, effect, old) {
var fn = this[effect.method];
if (fn) {
fn.call(this, value, old);
} else {
-this._warn(this._logf("_observerEffect", "observer method `" + effect.method + "` not defined"));
+this._warn(this._logf('_observerEffect', 'observer method `' + effect.method + '` not defined'));
}
},
-_complexObserverEffect: function(source, value, effect) {
+_complexObserverEffect: function (source, value, effect) {
var fn = this[effect.method];
if (fn) {
var args = Polymer.Bind._marshalArgs(this.__data__, effect, source, value);
@@ -1175,21 +1185,21 @@ if (args) {
fn.apply(this, args);
}
} else {
-this._warn(this._logf("_complexObserverEffect", "observer method `" + effect.method + "` not defined"));
+this._warn(this._logf('_complexObserverEffect', 'observer method `' + effect.method + '` not defined'));
}
},
-_computeEffect: function(source, value, effect) {
+_computeEffect: function (source, value, effect) {
var args = Polymer.Bind._marshalArgs(this.__data__, effect, source, value);
if (args) {
var fn = this[effect.method];
if (fn) {
this[effect.property] = fn.apply(this, args);
} else {
-this._warn(this._logf("_computeEffect", "compute method `" + effect.method + "` not defined"));
+this._warn(this._logf('_computeEffect', 'compute method `' + effect.method + '` not defined'));
}
}
},
-_annotatedComputationEffect: function(source, value, effect) {
+_annotatedComputationEffect: function (source, value, effect) {
var computedHost = this._rootDataHost || this;
var fn = computedHost[effect.method];
if (fn) {
@@ -1202,15 +1212,16 @@ computedvalue = !computedvalue;
this._applyEffectValue(computedvalue, effect);
}
} else {
-computedHost._warn(computedHost._logf("_annotatedComputationEffect", "compute method `" + effect.method + "` not defined"));
+computedHost._warn(computedHost._logf('_annotatedComputationEffect', 'compute method `' + effect.method + '` not defined'));
}
},
-_marshalArgs: function(model, effect, path, value) {
+_marshalArgs: function (model, effect, path, value) {
var values = [];
var args = effect.args;
for (var i = 0, l = args.length; i < l; i++) {
var arg = args[i];
var name = arg.name;
+var v;
if (arg.literal) {
v = arg.value;
} else if (arg.structured) {
@@ -1222,7 +1233,7 @@ if (args.length > 1 && v === undefined) {
return;
}
if (arg.wildcard) {
-var baseChanged = name.indexOf(path + ".") === 0;
+var baseChanged = name.indexOf(path + '.') === 0;
var matches = effect.trigger.name.indexOf(name) === 0 && !baseChanged;
values[i] = {
path: matches ? path : name,
@@ -1236,19 +1247,18 @@ values[i] = v;
return values;
}
});
-
Polymer.Base._addFeature({
-_addPropertyEffect: function(property, kind, effect) {
+_addPropertyEffect: function (property, kind, effect) {
Polymer.Bind.addPropertyEffect(this, property, kind, effect);
},
-_prepEffects: function() {
+_prepEffects: function () {
Polymer.Bind.prepareModel(this);
this._addAnnotationEffects(this._notes);
},
-_prepBindings: function() {
+_prepBindings: function () {
Polymer.Bind.createBindings(this);
},
-_addPropertyEffects: function(properties) {
+_addPropertyEffects: function (properties) {
if (properties) {
for (var p in properties) {
var prop = properties[p];
@@ -1259,10 +1269,10 @@ if (prop.computed) {
this._addComputedEffect(p, prop.computed);
}
if (prop.notify) {
-this._addPropertyEffect(p, "notify");
+this._addPropertyEffect(p, 'notify');
}
if (prop.reflectToAttribute) {
-this._addPropertyEffect(p, "reflect");
+this._addPropertyEffect(p, 'reflect');
}
if (prop.readOnly) {
Polymer.Bind.ensurePropertyEffects(this, p);
@@ -1270,10 +1280,10 @@ Polymer.Bind.ensurePropertyEffects(this, p);
}
}
},
-_addComputedEffect: function(name, expression) {
+_addComputedEffect: function (name, expression) {
var sig = this._parseMethod(expression);
-sig.args.forEach(function(arg) {
-this._addPropertyEffect(arg.model, "compute", {
+sig.args.forEach(function (arg) {
+this._addPropertyEffect(arg.model, 'compute', {
method: sig.method,
args: sig.args,
trigger: arg,
@@ -1281,39 +1291,39 @@ property: name
});
}, this);
},
-_addObserverEffect: function(property, observer) {
-this._addPropertyEffect(property, "observer", {
+_addObserverEffect: function (property, observer) {
+this._addPropertyEffect(property, 'observer', {
method: observer,
property: property
});
},
-_addComplexObserverEffects: function(observers) {
+_addComplexObserverEffects: function (observers) {
if (observers) {
-observers.forEach(function(observer) {
+observers.forEach(function (observer) {
this._addComplexObserverEffect(observer);
}, this);
}
},
-_addComplexObserverEffect: function(observer) {
+_addComplexObserverEffect: function (observer) {
var sig = this._parseMethod(observer);
-sig.args.forEach(function(arg) {
-this._addPropertyEffect(arg.model, "complexObserver", {
+sig.args.forEach(function (arg) {
+this._addPropertyEffect(arg.model, 'complexObserver', {
method: sig.method,
args: sig.args,
trigger: arg
});
}, this);
},
-_addAnnotationEffects: function(notes) {
+_addAnnotationEffects: function (notes) {
this._nodes = [];
-notes.forEach(function(note) {
+notes.forEach(function (note) {
var index = this._nodes.push(note) - 1;
-note.bindings.forEach(function(binding) {
+note.bindings.forEach(function (binding) {
this._addAnnotationEffect(binding, index);
}, this);
}, this);
},
-_addAnnotationEffect: function(note, index) {
+_addAnnotationEffect: function (note, index) {
if (Polymer.Bind._shouldAddListener(note)) {
Polymer.Bind._addAnnotatedListener(this, index, note.name, note.value, note.event);
}
@@ -1321,23 +1331,23 @@ if (note.signature) {
this._addAnnotatedComputationEffect(note, index);
} else {
note.index = index;
-this._addPropertyEffect(note.model, "annotation", note);
+this._addPropertyEffect(note.model, 'annotation', note);
}
},
-_addAnnotatedComputationEffect: function(note, index) {
+_addAnnotatedComputationEffect: function (note, index) {
var sig = note.signature;
if (sig.static) {
-this.__addAnnotatedComputationEffect("__static__", index, note, sig, null);
+this.__addAnnotatedComputationEffect('__static__', index, note, sig, null);
} else {
-sig.args.forEach(function(arg) {
+sig.args.forEach(function (arg) {
if (!arg.literal) {
this.__addAnnotatedComputationEffect(arg.model, index, note, sig, arg);
}
}, this);
}
},
-__addAnnotatedComputationEffect: function(property, index, note, sig, trigger) {
-this._addPropertyEffect(property, "annotatedComputation", {
+__addAnnotatedComputationEffect: function (property, index, note, sig, trigger) {
+this._addPropertyEffect(property, 'annotatedComputation', {
index: index,
kind: note.kind,
property: note.name,
@@ -1347,15 +1357,15 @@ args: sig.args,
trigger: trigger
});
},
-_parseMethod: function(expression) {
+_parseMethod: function (expression) {
var m = expression.match(/(\w*)\((.*)\)/);
if (m) {
var sig = {
method: m[1],
-"static": true
+static: true
};
if (m[2].trim()) {
-var args = m[2].replace(/\\,/g, "&comma;").split(",");
+var args = m[2].replace(/\\,/g, '&comma;').split(',');
return this._parseArgs(args, sig);
} else {
sig.args = Polymer.nar;
@@ -1363,8 +1373,8 @@ return sig;
}
}
},
-_parseArgs: function(argList, sig) {
-sig.args = argList.map(function(rawArg) {
+_parseArgs: function (argList, sig) {
+sig.args = argList.map(function (rawArg) {
var arg = this._parseArg(rawArg);
if (!arg.literal) {
sig.static = false;
@@ -1373,32 +1383,31 @@ return arg;
}, this);
return sig;
},
-_parseArg: function(rawArg) {
-var arg = rawArg.trim().replace(/&comma;/g, ",").replace(/\\(.)/g, "$1");
+_parseArg: function (rawArg) {
+var arg = rawArg.trim().replace(/&comma;/g, ',').replace(/\\(.)/g, '$1');
var a = {
name: arg,
model: this._modelForPath(arg)
};
var fc = arg[0];
-if (fc >= "0" && fc <= "9") {
-fc = "#";
+if (fc >= '0' && fc <= '9') {
+fc = '#';
}
switch (fc) {
-case "'":
+case '\'':
case '"':
a.value = arg.slice(1, -1);
a.literal = true;
break;
-
-case "#":
+case '#':
a.value = Number(arg);
a.literal = true;
break;
}
if (!a.literal) {
-a.structured = arg.indexOf(".") > 0;
+a.structured = arg.indexOf('.') > 0;
if (a.structured) {
-a.wildcard = arg.slice(-2) == ".*";
+a.wildcard = arg.slice(-2) == '.*';
if (a.wildcard) {
a.name = arg.slice(0, -2);
}
@@ -1406,50 +1415,49 @@ a.name = arg.slice(0, -2);
}
return a;
},
-_marshalInstanceEffects: function() {
+_marshalInstanceEffects: function () {
Polymer.Bind.prepareInstance(this);
Polymer.Bind.setupBindListeners(this);
},
-_applyEffectValue: function(value, info) {
+_applyEffectValue: function (value, info) {
var node = this._nodes[info.index];
-var property = info.property || info.name || "textContent";
-if (info.kind == "attribute") {
+var property = info.property || info.name || 'textContent';
+if (info.kind == 'attribute') {
this.serializeValueToAttribute(value, property, node);
} else {
-if (property === "className") {
+if (property === 'className') {
value = this._scopeElementClass(node, value);
}
-if (property === "textContent" || node.localName == "input" && property == "value") {
-value = value == undefined ? "" : value;
+if (property === 'textContent' || node.localName == 'input' && property == 'value') {
+value = value == undefined ? '' : value;
}
return node[property] = value;
}
},
-_executeStaticEffects: function() {
+_executeStaticEffects: function () {
if (this._propertyEffects.__static__) {
-this._effectEffects("__static__", null, this._propertyEffects.__static__);
+this._effectEffects('__static__', null, this._propertyEffects.__static__);
}
}
});
-
Polymer.Base._addFeature({
-_setupConfigure: function(initialConfig) {
+_setupConfigure: function (initialConfig) {
this._config = initialConfig || {};
this._handlers = [];
},
-_marshalAttributes: function() {
+_marshalAttributes: function () {
this._takeAttributesToModel(this._config);
},
-_configValue: function(name, value) {
+_configValue: function (name, value) {
this._config[name] = value;
},
-_beforeClientsReady: function() {
+_beforeClientsReady: function () {
this._configure();
},
-_configure: function() {
+_configure: function () {
this._configureAnnotationReferences();
var config = {};
-this.behaviors.forEach(function(b) {
+this.behaviors.forEach(function (b) {
this._configureProperties(b.properties, config);
}, this);
this._configureProperties(this.properties, config);
@@ -1457,33 +1465,33 @@ this._mixinConfigure(config, this._config);
this._config = config;
this._distributeConfig(this._config);
},
-_configureProperties: function(properties, config) {
+_configureProperties: function (properties, config) {
for (var i in properties) {
var c = properties[i];
if (c.value !== undefined) {
var value = c.value;
-if (typeof value == "function") {
+if (typeof value == 'function') {
value = value.call(this, this._config);
}
config[i] = value;
}
}
},
-_mixinConfigure: function(a, b) {
+_mixinConfigure: function (a, b) {
for (var prop in b) {
if (!this.getPropertyInfo(prop).readOnly) {
a[prop] = b[prop];
}
}
},
-_distributeConfig: function(config) {
+_distributeConfig: function (config) {
var fx$ = this._propertyEffects;
if (fx$) {
for (var p in config) {
var fx = fx$[p];
if (fx) {
for (var i = 0, l = fx.length, x; i < l && (x = fx[i]); i++) {
-if (x.kind === "annotation") {
+if (x.kind === 'annotation') {
var node = this._nodes[x.effect.index];
if (node._configValue) {
var value = p === x.effect.value ? config[p] : this.get(x.effect.value, config);
@@ -1495,12 +1503,12 @@ node._configValue(x.effect.name, value);
}
}
},
-_afterClientsReady: function() {
+_afterClientsReady: function () {
this._executeStaticEffects();
this._applyConfig(this._config);
this._flushHandlers();
},
-_applyConfig: function(config) {
+_applyConfig: function (config) {
for (var n in config) {
if (this[n] === undefined) {
var effects = this._propertyEffects[n];
@@ -1512,28 +1520,31 @@ this[n] = config[n];
}
}
},
-_notifyListener: function(fn, e) {
+_notifyListener: function (fn, e) {
if (!this._clientsReadied) {
-this._queueHandler([ fn, e, e.target ]);
+this._queueHandler([
+fn,
+e,
+e.target
+]);
} else {
return fn.call(this, e, e.target);
}
},
-_queueHandler: function(args) {
+_queueHandler: function (args) {
this._handlers.push(args);
},
-_flushHandlers: function() {
+_flushHandlers: function () {
var h$ = this._handlers;
for (var i = 0, l = h$.length, h; i < l && (h = h$[i]); i++) {
h[0].call(this, h[1], h[2]);
}
}
});
-
-(function() {
-"use strict";
+(function () {
+'use strict';
Polymer.Base._addFeature({
-notifyPath: function(path, value, fromAbove) {
+notifyPath: function (path, value, fromAbove) {
var old = this._propertySet(path, value);
if (old !== value) {
this._pathEffector(path, value);
@@ -1542,21 +1553,21 @@ this._notifyPath(path, value);
}
}
},
-_getPathParts: function(path) {
+_getPathParts: function (path) {
if (Array.isArray(path)) {
var parts = [];
for (var i = 0; i < path.length; i++) {
-var args = path[i].toString().split(".");
+var args = path[i].toString().split('.');
for (var j = 0; j < args.length; j++) {
parts.push(args[j]);
}
}
return parts;
} else {
-return path.toString().split(".");
+return path.toString().split('.');
}
},
-set: function(path, value, root) {
+set: function (path, value, root) {
var prop = root || this;
var parts = this._getPathParts(path);
var array;
@@ -1574,13 +1585,13 @@ array = Array.isArray(prop) ? prop : null;
}
prop[last] = value;
if (!root) {
-this.notifyPath(parts.join("."), value);
+this.notifyPath(parts.join('.'), value);
}
} else {
prop[path] = value;
}
},
-get: function(path, root) {
+get: function (path, root) {
var prop = root || this;
var parts = this._getPathParts(path);
var last = parts.pop();
@@ -1592,12 +1603,12 @@ return;
}
return prop[last];
},
-_pathEffector: function(path, value) {
+_pathEffector: function (path, value) {
var model = this._modelForPath(path);
var fx$ = this._propertyEffects[model];
if (fx$) {
-fx$.forEach(function(fx) {
-var fxFn = this["_" + fx.kind + "PathEffect"];
+fx$.forEach(function (fx) {
+var fxFn = this['_' + fx.kind + 'PathEffect'];
if (fxFn) {
fxFn.call(this, path, value, fx.effect);
}
@@ -1607,10 +1618,10 @@ if (this._boundPaths) {
this._notifyBoundPaths(path, value);
}
},
-_annotationPathEffect: function(path, value, effect) {
-if (effect.value === path || effect.value.indexOf(path + ".") === 0) {
+_annotationPathEffect: function (path, value, effect) {
+if (effect.value === path || effect.value.indexOf(path + '.') === 0) {
Polymer.Bind._annotationEffect.call(this, path, value, effect);
-} else if (path.indexOf(effect.value + ".") === 0 && !effect.negate) {
+} else if (path.indexOf(effect.value + '.') === 0 && !effect.negate) {
var node = this._nodes[effect.index];
if (node && node.notifyPath) {
var p = this._fixPath(effect.name, effect.value, path);
@@ -1618,26 +1629,26 @@ node.notifyPath(p, value, true);
}
}
},
-_complexObserverPathEffect: function(path, value, effect) {
+_complexObserverPathEffect: function (path, value, effect) {
if (this._pathMatchesEffect(path, effect)) {
Polymer.Bind._complexObserverEffect.call(this, path, value, effect);
}
},
-_computePathEffect: function(path, value, effect) {
+_computePathEffect: function (path, value, effect) {
if (this._pathMatchesEffect(path, effect)) {
Polymer.Bind._computeEffect.call(this, path, value, effect);
}
},
-_annotatedComputationPathEffect: function(path, value, effect) {
+_annotatedComputationPathEffect: function (path, value, effect) {
if (this._pathMatchesEffect(path, effect)) {
Polymer.Bind._annotatedComputationEffect.call(this, path, value, effect);
}
},
-_pathMatchesEffect: function(path, effect) {
+_pathMatchesEffect: function (path, effect) {
var effectArg = effect.trigger.name;
-return effectArg == path || effectArg.indexOf(path + ".") === 0 || effect.trigger.wildcard && path.indexOf(effectArg) === 0;
+return effectArg == path || effectArg.indexOf(path + '.') === 0 || effect.trigger.wildcard && path.indexOf(effectArg) === 0;
},
-linkPaths: function(to, from) {
+linkPaths: function (to, from) {
this._boundPaths = this._boundPaths || {};
if (from) {
this._boundPaths[to] = from;
@@ -1645,21 +1656,21 @@ this._boundPaths[to] = from;
this.unbindPath(to);
}
},
-unlinkPaths: function(path) {
+unlinkPaths: function (path) {
if (this._boundPaths) {
delete this._boundPaths[path];
}
},
-_notifyBoundPaths: function(path, value) {
+_notifyBoundPaths: function (path, value) {
var from, to;
for (var a in this._boundPaths) {
var b = this._boundPaths[a];
-if (path.indexOf(a + ".") == 0) {
+if (path.indexOf(a + '.') == 0) {
from = a;
to = b;
break;
}
-if (path.indexOf(b + ".") == 0) {
+if (path.indexOf(b + '.') == 0) {
from = b;
to = a;
break;
@@ -1670,45 +1681,43 @@ var p = this._fixPath(to, from, path);
this.notifyPath(p, value);
}
},
-_fixPath: function(property, root, path) {
+_fixPath: function (property, root, path) {
return property + path.slice(root.length);
},
-_notifyPath: function(path, value) {
+_notifyPath: function (path, value) {
var rootName = this._modelForPath(path);
var dashCaseName = Polymer.CaseMap.camelToDashCase(rootName);
var eventName = dashCaseName + this._EVENT_CHANGED;
this.fire(eventName, {
path: path,
value: value
-}, {
-bubbles: false
-});
+}, { bubbles: false });
},
-_modelForPath: function(path) {
-var dot = path.indexOf(".");
+_modelForPath: function (path) {
+var dot = path.indexOf('.');
return dot < 0 ? path : path.slice(0, dot);
},
-_EVENT_CHANGED: "-changed",
-_notifySplice: function(array, path, index, added, removed) {
-var splices = [ {
+_EVENT_CHANGED: '-changed',
+_notifySplice: function (array, path, index, added, removed) {
+var splices = [{
index: index,
addedCount: added,
removed: removed,
object: array,
-type: "splice"
-} ];
+type: 'splice'
+}];
var change = {
keySplices: Polymer.Collection.get(array).applySplices(splices),
indexSplices: splices
};
-this.set(path + ".splices", change);
+this.set(path + '.splices', change);
if (added != removed.length) {
-this.notifyPath(path + ".length", array.length);
+this.notifyPath(path + '.length', array.length);
}
change.keySplices = null;
change.indexSplices = null;
},
-push: function(path) {
+push: function (path) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var len = array.length;
@@ -1716,7 +1725,7 @@ var ret = array.push.apply(array, args);
this._notifySplice(array, path, len, args.length, []);
return ret;
},
-pop: function(path) {
+pop: function (path) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var rem = array.slice(-1);
@@ -1724,7 +1733,7 @@ var ret = array.pop.apply(array, args);
this._notifySplice(array, path, array.length, 0, rem);
return ret;
},
-splice: function(path, start, deleteCount) {
+splice: function (path, start, deleteCount) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var rem = array.slice(start, start + deleteCount);
@@ -1732,14 +1741,14 @@ var ret = array.splice.apply(array, args);
this._notifySplice(array, path, start, args.length - 2, rem);
return ret;
},
-shift: function(path) {
+shift: function (path) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var ret = array.shift.apply(array, args);
-this._notifySplice(array, path, 0, 0, [ ret ]);
+this._notifySplice(array, path, 0, 0, [ret]);
return ret;
},
-unshift: function(path) {
+unshift: function (path) {
var array = this.get(path);
var args = Array.prototype.slice.call(arguments, 1);
var ret = array.unshift.apply(array, args);
@@ -1747,30 +1756,28 @@ this._notifySplice(array, path, 0, args.length, []);
return ret;
}
});
-})();
-
+}());
Polymer.Base._addFeature({
-resolveUrl: function(url) {
+resolveUrl: function (url) {
var module = Polymer.DomModule.import(this.is);
-var root = "";
+var root = '';
if (module) {
-var assetPath = module.getAttribute("assetpath") || "";
+var assetPath = module.getAttribute('assetpath') || '';
root = Polymer.ResolveUrl.resolveUrl(assetPath, module.ownerDocument.baseURI);
}
return Polymer.ResolveUrl.resolveUrl(url, root);
}
});
-
-Polymer.CssParse = function() {
+Polymer.CssParse = function () {
var api = {
-parse: function(text) {
+parse: function (text) {
text = this._clean(text);
return this._parseCss(this._lex(text), text);
},
-_clean: function(cssText) {
-return cssText.replace(rx.comments, "").replace(rx.port, "");
+_clean: function (cssText) {
+return cssText.replace(rx.comments, '').replace(rx.port, '');
},
-_lex: function(text) {
+_lex: function (text) {
var root = {
start: 0,
end: text.length
@@ -1791,7 +1798,6 @@ previous: previous
};
p.rules.push(n);
break;
-
case this.CLOSE_BRACE:
n.end = i + 1;
n = n.parent || root;
@@ -1800,13 +1806,13 @@ break;
}
return root;
},
-_parseCss: function(node, text) {
+_parseCss: function (node, text) {
var t = text.substring(node.start, node.end - 1);
node.parsedCssText = node.cssText = t.trim();
if (node.parent) {
var ss = node.previous ? node.previous.end : node.parent.start;
t = text.substring(ss, node.start - 1);
-t = t.substring(t.lastIndexOf(";") + 1);
+t = t.substring(t.lastIndexOf(';') + 1);
var s = node.parsedSelector = node.selector = t.trim();
node.atRule = s.indexOf(AT_START) === 0;
if (node.atRule) {
@@ -1831,9 +1837,9 @@ this._parseCss(r, text);
}
return node;
},
-stringify: function(node, preserveProperties, text) {
-text = text || "";
-var cssText = "";
+stringify: function (node, preserveProperties, text) {
+text = text || '';
+var cssText = '';
if (node.cssText || node.rules) {
var r$ = node.rules;
if (r$ && (preserveProperties || !hasMixinRules(r$))) {
@@ -1844,17 +1850,17 @@ cssText = this.stringify(r, preserveProperties, cssText);
cssText = preserveProperties ? node.cssText : removeCustomProps(node.cssText);
cssText = cssText.trim();
if (cssText) {
-cssText = " " + cssText + "\n";
+cssText = ' ' + cssText + '\n';
}
}
}
if (cssText) {
if (node.selector) {
-text += node.selector + " " + this.OPEN_BRACE + "\n";
+text += node.selector + ' ' + this.OPEN_BRACE + '\n';
}
text += cssText;
if (node.selector) {
-text += this.CLOSE_BRACE + "\n\n";
+text += this.CLOSE_BRACE + '\n\n';
}
}
return text;
@@ -1863,20 +1869,20 @@ types: {
STYLE_RULE: 1,
KEYFRAMES_RULE: 7,
MEDIA_RULE: 4,
-MIXIN_RULE: 1e3
+MIXIN_RULE: 1000
},
-OPEN_BRACE: "{",
-CLOSE_BRACE: "}"
+OPEN_BRACE: '{',
+CLOSE_BRACE: '}'
};
function hasMixinRules(rules) {
return rules[0].selector.indexOf(VAR_START) >= 0;
}
function removeCustomProps(cssText) {
-return cssText.replace(rx.customProp, "").replace(rx.mixinProp, "").replace(rx.mixinApply, "").replace(rx.varApply, "");
+return cssText.replace(rx.customProp, '').replace(rx.mixinProp, '').replace(rx.mixinApply, '').replace(rx.varApply, '');
}
-var VAR_START = "--";
-var MEDIA_START = "@media";
-var AT_START = "@";
+var VAR_START = '--';
+var MEDIA_START = '@media';
+var AT_START = '@';
var rx = {
comments: /\/\*[^*]*\*+([^\/*][^*]*\*+)*\//gim,
port: /@import[^;]*;/gim,
@@ -1888,12 +1894,11 @@ keyframesRule: /^@[^\s]*keyframes/
};
return api;
}();
-
-Polymer.StyleUtil = function() {
+Polymer.StyleUtil = function () {
return {
-MODULE_STYLES_SELECTOR: "style, link[rel=import][type~=css]",
-toCssText: function(rules, callback, preserveProperties) {
-if (typeof rules === "string") {
+MODULE_STYLES_SELECTOR: 'style, link[rel=import][type~=css]',
+toCssText: function (rules, callback, preserveProperties) {
+if (typeof rules === 'string') {
rules = this.parser.parse(rules);
}
if (callback) {
@@ -1901,21 +1906,21 @@ this.forEachStyleRule(rules, callback);
}
return this.parser.stringify(rules, preserveProperties);
},
-forRulesInStyles: function(styles, callback) {
+forRulesInStyles: function (styles, callback) {
for (var i = 0, l = styles.length, s; i < l && (s = styles[i]); i++) {
this.forEachStyleRule(this.rulesForStyle(s), callback);
}
},
-rulesForStyle: function(style) {
+rulesForStyle: function (style) {
if (!style.__cssRules) {
style.__cssRules = this.parser.parse(style.textContent);
}
return style.__cssRules;
},
-clearStyleRules: function(style) {
+clearStyleRules: function (style) {
style.__cssRules = null;
},
-forEachStyleRule: function(node, callback) {
+forEachStyleRule: function (node, callback) {
var s = node.selector;
var skipRules = false;
if (node.type === this.ruleTypes.STYLE_RULE) {
@@ -1930,28 +1935,28 @@ this.forEachStyleRule(r, callback);
}
}
},
-applyCss: function(cssText, moniker, target, afterNode) {
-var style = document.createElement("style");
+applyCss: function (cssText, moniker, target, afterNode) {
+var style = document.createElement('style');
if (moniker) {
-style.setAttribute("scope", moniker);
+style.setAttribute('scope', moniker);
}
style.textContent = cssText;
target = target || document.head;
if (!afterNode) {
-var n$ = target.querySelectorAll("style[scope]");
+var n$ = target.querySelectorAll('style[scope]');
afterNode = n$[n$.length - 1];
}
target.insertBefore(style, afterNode && afterNode.nextSibling || target.firstChild);
return style;
},
-cssFromModule: function(moduleId) {
+cssFromModule: function (moduleId) {
var m = Polymer.DomModule.import(moduleId);
if (m && !m._cssText) {
-var cssText = "";
+var cssText = '';
var e$ = Array.prototype.slice.call(m.querySelectorAll(this.MODULE_STYLES_SELECTOR));
for (var i = 0, e; i < e$.length; i++) {
e = e$[i];
-if (e.localName === "style") {
+if (e.localName === 'style') {
e = e.__appliedElement || e;
e.parentNode.removeChild(e);
} else {
@@ -1963,21 +1968,20 @@ cssText += Polymer.ResolveUrl.resolveCss(e.textContent, e.ownerDocument);
}
m._cssText = cssText;
}
-return m && m._cssText || "";
+return m && m._cssText || '';
},
parser: Polymer.CssParse,
ruleTypes: Polymer.CssParse.types
};
}();
-
-Polymer.StyleTransformer = function() {
+Polymer.StyleTransformer = function () {
var nativeShadow = Polymer.Settings.useNativeShadow;
var styleUtil = Polymer.StyleUtil;
var api = {
-dom: function(node, scope, useAttr, shouldRemoveScope) {
-this._transformDom(node, scope || "", useAttr, shouldRemoveScope);
+dom: function (node, scope, useAttr, shouldRemoveScope) {
+this._transformDom(node, scope || '', useAttr, shouldRemoveScope);
},
-_transformDom: function(node, selector, useAttr, shouldRemoveScope) {
+_transformDom: function (node, selector, useAttr, shouldRemoveScope) {
if (node.setAttribute) {
this.element(node, selector, useAttr, shouldRemoveScope);
}
@@ -1986,7 +1990,7 @@ for (var i = 0; i < c$.length; i++) {
this._transformDom(c$[i], selector, useAttr, shouldRemoveScope);
}
},
-element: function(element, scope, useAttr, shouldRemoveScope) {
+element: function (element, scope, useAttr, shouldRemoveScope) {
if (useAttr) {
if (shouldRemoveScope) {
element.removeAttribute(SCOPE_NAME);
@@ -2007,29 +2011,29 @@ element.classList.add(scope);
var c = element.getAttribute(CLASS);
if (shouldRemoveScope) {
if (c) {
-element.setAttribute(CLASS, c.replace(SCOPE_NAME, "").replace(scope, ""));
+element.setAttribute(CLASS, c.replace(SCOPE_NAME, '').replace(scope, ''));
}
} else {
-element.setAttribute(CLASS, c + (c ? " " : "") + SCOPE_NAME + " " + scope);
+element.setAttribute(CLASS, c + (c ? ' ' : '') + SCOPE_NAME + ' ' + scope);
}
}
}
}
},
-elementStyles: function(element, callback) {
+elementStyles: function (element, callback) {
var styles = element._styles;
-var cssText = "";
+var cssText = '';
for (var i = 0, l = styles.length, s, text; i < l && (s = styles[i]); i++) {
var rules = styleUtil.rulesForStyle(s);
-cssText += nativeShadow ? styleUtil.toCssText(rules, callback) : this.css(rules, element.is, element.extends, callback, element._scopeCssViaAttr) + "\n\n";
+cssText += nativeShadow ? styleUtil.toCssText(rules, callback) : this.css(rules, element.is, element.extends, callback, element._scopeCssViaAttr) + '\n\n';
}
return cssText.trim();
},
-css: function(rules, scope, ext, callback, useAttr) {
+css: function (rules, scope, ext, callback, useAttr) {
var hostScope = this._calcHostScope(scope, ext);
scope = this._calcElementScope(scope, useAttr);
var self = this;
-return styleUtil.toCssText(rules, function(rule) {
+return styleUtil.toCssText(rules, function (rule) {
if (!rule.isScoped) {
self.rule(rule, scope, hostScope);
rule.isScoped = true;
@@ -2039,30 +2043,30 @@ callback(rule, scope, hostScope);
}
});
},
-_calcElementScope: function(scope, useAttr) {
+_calcElementScope: function (scope, useAttr) {
if (scope) {
return useAttr ? CSS_ATTR_PREFIX + scope + CSS_ATTR_SUFFIX : CSS_CLASS_PREFIX + scope;
} else {
-return "";
+return '';
}
},
-_calcHostScope: function(scope, ext) {
-return ext ? "[is=" + scope + "]" : scope;
+_calcHostScope: function (scope, ext) {
+return ext ? '[is=' + scope + ']' : scope;
},
-rule: function(rule, scope, hostScope) {
+rule: function (rule, scope, hostScope) {
this._transformRule(rule, this._transformComplexSelector, scope, hostScope);
},
-_transformRule: function(rule, transformer, scope, hostScope) {
+_transformRule: function (rule, transformer, scope, hostScope) {
var p$ = rule.selector.split(COMPLEX_SELECTOR_SEP);
for (var i = 0, l = p$.length, p; i < l && (p = p$[i]); i++) {
p$[i] = transformer.call(this, p, scope, hostScope);
}
rule.selector = p$.join(COMPLEX_SELECTOR_SEP);
},
-_transformComplexSelector: function(selector, scope, hostScope) {
+_transformComplexSelector: function (selector, scope, hostScope) {
var stop = false;
var self = this;
-selector = selector.replace(SIMPLE_SELECTOR_SEP, function(m, c, s) {
+selector = selector.replace(SIMPLE_SELECTOR_SEP, function (m, c, s) {
if (!stop) {
var o = self._transformCompoundSelector(s, c, scope, hostScope);
if (o.stop) {
@@ -2075,10 +2079,10 @@ return c + s;
});
return selector;
},
-_transformCompoundSelector: function(selector, combinator, scope, hostScope) {
+_transformCompoundSelector: function (selector, combinator, scope, hostScope) {
var jumpIndex = selector.search(SCOPE_JUMP);
if (selector.indexOf(HOST) >= 0) {
-selector = selector.replace(HOST_PAREN, function(m, host, paren) {
+selector = selector.replace(HOST_PAREN, function (m, host, paren) {
return hostScope + paren;
});
selector = selector.replace(HOST, hostScope);
@@ -2086,11 +2090,11 @@ selector = selector.replace(HOST, hostScope);
selector = scope ? this._transformSimpleSelector(selector, scope) : selector;
}
if (selector.indexOf(CONTENT) >= 0) {
-combinator = "";
+combinator = '';
}
var stop;
if (jumpIndex >= 0) {
-selector = selector.replace(SCOPE_JUMP, " ");
+selector = selector.replace(SCOPE_JUMP, ' ');
stop = true;
}
return {
@@ -2099,45 +2103,44 @@ combinator: combinator,
stop: stop
};
},
-_transformSimpleSelector: function(selector, scope) {
+_transformSimpleSelector: function (selector, scope) {
var p$ = selector.split(PSEUDO_PREFIX);
p$[0] += scope;
return p$.join(PSEUDO_PREFIX);
},
-rootRule: function(rule) {
+rootRule: function (rule) {
this._transformRule(rule, this._transformRootSelector);
},
-_transformRootSelector: function(selector) {
+_transformRootSelector: function (selector) {
return selector.match(SCOPE_JUMP) ? this._transformComplexSelector(selector) : selector.trim() + SCOPE_ROOT_SELECTOR;
},
-SCOPE_NAME: "style-scope"
+SCOPE_NAME: 'style-scope'
};
var SCOPE_NAME = api.SCOPE_NAME;
-var SCOPE_ROOT_SELECTOR = ":not([" + SCOPE_NAME + "])" + ":not(." + SCOPE_NAME + ")";
-var COMPLEX_SELECTOR_SEP = ",";
+var SCOPE_ROOT_SELECTOR = ':not([' + SCOPE_NAME + '])' + ':not(.' + SCOPE_NAME + ')';
+var COMPLEX_SELECTOR_SEP = ',';
var SIMPLE_SELECTOR_SEP = /(^|[\s>+~]+)([^\s>+~]+)/g;
-var HOST = ":host";
+var HOST = ':host';
var HOST_PAREN = /(\:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g;
-var CONTENT = "::content";
+var CONTENT = '::content';
var SCOPE_JUMP = /\:\:content|\:\:shadow|\/deep\//;
-var CSS_CLASS_PREFIX = ".";
-var CSS_ATTR_PREFIX = "[" + SCOPE_NAME + "~=";
-var CSS_ATTR_SUFFIX = "]";
-var PSEUDO_PREFIX = ":";
-var CLASS = "class";
+var CSS_CLASS_PREFIX = '.';
+var CSS_ATTR_PREFIX = '[' + SCOPE_NAME + '~=';
+var CSS_ATTR_SUFFIX = ']';
+var PSEUDO_PREFIX = ':';
+var CLASS = 'class';
return api;
}();
-
-Polymer.StyleExtends = function() {
+Polymer.StyleExtends = function () {
var styleUtil = Polymer.StyleUtil;
return {
-hasExtends: function(cssText) {
+hasExtends: function (cssText) {
return Boolean(cssText.match(this.rx.EXTEND));
},
-transform: function(style) {
+transform: function (style) {
var rules = styleUtil.rulesForStyle(style);
var self = this;
-styleUtil.forEachStyleRule(rules, function(rule) {
+styleUtil.forEachStyleRule(rules, function (rule) {
var map = self._mapRule(rule);
if (rule.parent) {
var m;
@@ -2149,18 +2152,18 @@ self._extendRule(rule, extendor);
}
}
}
-rule.cssText = rule.cssText.replace(self.rx.EXTEND, "");
+rule.cssText = rule.cssText.replace(self.rx.EXTEND, '');
});
-return styleUtil.toCssText(rules, function(rule) {
+return styleUtil.toCssText(rules, function (rule) {
if (rule.selector.match(self.rx.STRIP)) {
-rule.cssText = "";
+rule.cssText = '';
}
}, true);
},
-_mapRule: function(rule) {
+_mapRule: function (rule) {
if (rule.parent) {
var map = rule.parent.map || (rule.parent.map = {});
-var parts = rule.selector.split(",");
+var parts = rule.selector.split(',');
for (var i = 0, p; i < parts.length; i++) {
p = parts[i];
map[p.trim()] = rule;
@@ -2168,24 +2171,24 @@ map[p.trim()] = rule;
return map;
}
},
-_findExtendor: function(extend, rule) {
+_findExtendor: function (extend, rule) {
return rule.parent && rule.parent.map && rule.parent.map[extend] || this._findExtendor(extend, rule.parent);
},
-_extendRule: function(target, source) {
+_extendRule: function (target, source) {
if (target.parent !== source.parent) {
this._cloneAndAddRuleToParent(source, target.parent);
}
target.extends = target.extends || (target.extends = []);
target.extends.push(source);
-source.selector = source.selector.replace(this.rx.STRIP, "");
-source.selector = (source.selector && source.selector + ",\n") + target.selector;
+source.selector = source.selector.replace(this.rx.STRIP, '');
+source.selector = (source.selector && source.selector + ',\n') + target.selector;
if (source.extends) {
-source.extends.forEach(function(e) {
+source.extends.forEach(function (e) {
this._extendRule(target, e);
}, this);
}
},
-_cloneAndAddRuleToParent: function(rule, parent) {
+_cloneAndAddRuleToParent: function (rule, parent) {
rule = Object.create(rule);
rule.parent = parent;
if (rule.extends) {
@@ -2199,21 +2202,20 @@ STRIP: /%[^,]*$/
}
};
}();
-
-(function() {
+(function () {
var prepElement = Polymer.Base._prepElement;
var nativeShadow = Polymer.Settings.useNativeShadow;
var styleUtil = Polymer.StyleUtil;
var styleTransformer = Polymer.StyleTransformer;
var styleExtends = Polymer.StyleExtends;
Polymer.Base._addFeature({
-_prepElement: function(element) {
+_prepElement: function (element) {
if (this._encapsulateStyle) {
styleTransformer.element(element, this.is, this._scopeCssViaAttr);
}
prepElement.call(this, element);
},
-_prepStyles: function() {
+_prepStyles: function () {
if (this._encapsulateStyle === undefined) {
this._encapsulateStyle = !nativeShadow && Boolean(this._template);
}
@@ -2226,9 +2228,9 @@ this._scopeStyle = style;
}
}
},
-_collectStyles: function() {
+_collectStyles: function () {
var styles = [];
-var cssText = "", m$ = this.styleModules;
+var cssText = '', m$ = this.styleModules;
if (m$) {
for (var i = 0, l = m$.length, m; i < l && (m = m$[i]); i++) {
cssText += styleUtil.cssFromModule(m);
@@ -2236,7 +2238,7 @@ cssText += styleUtil.cssFromModule(m);
}
cssText += styleUtil.cssFromModule(this.is);
if (cssText) {
-var style = document.createElement("style");
+var style = document.createElement('style');
style.textContent = cssText;
if (styleExtends.hasExtends(style.textContent)) {
cssText = styleExtends.transform(style);
@@ -2245,34 +2247,38 @@ styles.push(style);
}
return styles;
},
-_elementAdd: function(node) {
-if (this._encapsulateStyle && !node.__styleScoped) {
+_elementAdd: function (node) {
+if (this._encapsulateStyle) {
+if (node.__styleScoped) {
+node.__styleScoped = false;
+} else {
styleTransformer.dom(node, this.is, this._scopeCssViaAttr);
}
+}
},
-_elementRemove: function(node) {
+_elementRemove: function (node) {
if (this._encapsulateStyle) {
styleTransformer.dom(node, this.is, this._scopeCssViaAttr, true);
}
},
-scopeSubtree: function(container, shouldObserve) {
+scopeSubtree: function (container, shouldObserve) {
if (nativeShadow) {
return;
}
var self = this;
-var scopify = function(node) {
+var scopify = function (node) {
if (node.nodeType === Node.ELEMENT_NODE) {
node.className = self._scopeElementClass(node, node.className);
-var n$ = node.querySelectorAll("*");
-Array.prototype.forEach.call(n$, function(n) {
+var n$ = node.querySelectorAll('*');
+Array.prototype.forEach.call(n$, function (n) {
n.className = self._scopeElementClass(n, n.className);
});
}
};
scopify(container);
if (shouldObserve) {
-var mo = new MutationObserver(function(mxns) {
-mxns.forEach(function(m) {
+var mo = new MutationObserver(function (mxns) {
+mxns.forEach(function (m) {
if (m.addedNodes) {
for (var i = 0; i < m.addedNodes.length; i++) {
scopify(m.addedNodes[i]);
@@ -2288,17 +2294,16 @@ return mo;
}
}
});
-})();
-
-Polymer.StyleProperties = function() {
+}());
+Polymer.StyleProperties = function () {
var nativeShadow = Polymer.Settings.useNativeShadow;
var matchesSelector = Polymer.DomApi.matchesSelector;
var styleUtil = Polymer.StyleUtil;
var styleTransformer = Polymer.StyleTransformer;
return {
-decorateStyles: function(styles) {
+decorateStyles: function (styles) {
var self = this, props = {};
-styleUtil.forRulesInStyles(styles, function(rule) {
+styleUtil.forRulesInStyles(styles, function (rule) {
self.decorateRule(rule);
self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);
});
@@ -2308,7 +2313,7 @@ names.push(i);
}
return names;
},
-decorateRule: function(rule) {
+decorateRule: function (rule) {
if (rule.propertyInfo) {
return rule.propertyInfo;
}
@@ -2322,7 +2327,7 @@ info.cssText = this.collectCssText(rule);
rule.propertyInfo = info;
return info;
},
-collectProperties: function(rule, properties) {
+collectProperties: function (rule, properties) {
var info = rule.propertyInfo;
if (info) {
if (info.properties) {
@@ -2340,68 +2345,68 @@ any = true;
return any;
}
},
-collectCssText: function(rule) {
-var customCssText = "";
+collectCssText: function (rule) {
+var customCssText = '';
var cssText = rule.parsedCssText;
-cssText = cssText.replace(this.rx.BRACKETED, "").replace(this.rx.VAR_ASSIGN, "");
-var parts = cssText.split(";");
+cssText = cssText.replace(this.rx.BRACKETED, '').replace(this.rx.VAR_ASSIGN, '');
+var parts = cssText.split(';');
for (var i = 0, p; i < parts.length; i++) {
p = parts[i];
if (p.match(this.rx.MIXIN_MATCH) || p.match(this.rx.VAR_MATCH)) {
-customCssText += p + ";\n";
+customCssText += p + ';\n';
}
}
return customCssText;
},
-collectPropertiesInCssText: function(cssText, props) {
+collectPropertiesInCssText: function (cssText, props) {
var m;
while (m = this.rx.VAR_CAPTURE.exec(cssText)) {
props[m[1]] = true;
}
},
-reify: function(props) {
+reify: function (props) {
var names = Object.getOwnPropertyNames(props);
for (var i = 0, n; i < names.length; i++) {
n = names[i];
props[n] = this.valueForProperty(props[n], props);
}
},
-valueForProperty: function(property, props) {
+valueForProperty: function (property, props) {
if (property) {
-if (property.indexOf(";") >= 0) {
+if (property.indexOf(';') >= 0) {
property = this.valueForProperties(property, props);
} else {
var self = this;
-var fn = function(all, prefix, value, fallback) {
+var fn = function (all, prefix, value, fallback) {
var propertyValue = self.valueForProperty(props[value], props) || (props[fallback] ? self.valueForProperty(props[fallback], props) : fallback);
-return prefix + (propertyValue || "");
+return prefix + (propertyValue || '');
};
property = property.replace(this.rx.VAR_MATCH, fn);
}
}
-return property && property.trim() || "";
+return property && property.trim() || '';
},
-valueForProperties: function(property, props) {
-var parts = property.split(";");
+valueForProperties: function (property, props) {
+var parts = property.split(';');
for (var i = 0, p, m; i < parts.length && (p = parts[i]); i++) {
m = p.match(this.rx.MIXIN_MATCH);
if (m) {
p = this.valueForProperty(props[m[1]], props);
} else {
-var pp = p.split(":");
+var pp = p.split(':');
if (pp[1]) {
pp[1] = pp[1].trim();
pp[1] = this.valueForProperty(pp[1], props) || pp[1];
}
-p = pp.join(":");
+p = pp.join(':');
}
-parts[i] = p && p.lastIndexOf(";") === p.length - 1 ? p.slice(0, -1) : p || "";
+parts[i] = p && p.lastIndexOf(';') === p.length - 1 ? p.slice(0, -1) : p || '';
}
-return parts.join(";");
+return parts.join(';');
},
-applyProperties: function(rule, props) {
-var output = "";
-if (!rule.properties) {
+applyProperties: function (rule, props) {
+var output = '';
+if (!rule.propertyInfo) {
this.decorateRule(rule);
}
if (rule.propertyInfo.cssText) {
@@ -2409,10 +2414,10 @@ output = this.valueForProperties(rule.propertyInfo.cssText, props);
}
rule.cssText = output;
},
-propertyDataFromStyles: function(styles, element) {
+propertyDataFromStyles: function (styles, element) {
var props = {}, self = this;
var o = [], i = 0;
-styleUtil.forRulesInStyles(styles, function(rule) {
+styleUtil.forRulesInStyles(styles, function (rule) {
if (!rule.propertyInfo) {
self.decorateRule(rule);
}
@@ -2427,21 +2432,21 @@ properties: props,
key: o
};
},
-scopePropertiesFromStyles: function(styles) {
+scopePropertiesFromStyles: function (styles) {
if (!styles._scopeStyleProperties) {
styles._scopeStyleProperties = this.selectedPropertiesFromStyles(styles, this.SCOPE_SELECTORS);
}
return styles._scopeStyleProperties;
},
-hostPropertiesFromStyles: function(styles) {
+hostPropertiesFromStyles: function (styles) {
if (!styles._hostStyleProperties) {
styles._hostStyleProperties = this.selectedPropertiesFromStyles(styles, this.HOST_SELECTORS);
}
return styles._hostStyleProperties;
},
-selectedPropertiesFromStyles: function(styles, selectors) {
+selectedPropertiesFromStyles: function (styles, selectors) {
var props = {}, self = this;
-styleUtil.forRulesInStyles(styles, function(rule) {
+styleUtil.forRulesInStyles(styles, function (rule) {
if (!rule.propertyInfo) {
self.decorateRule(rule);
}
@@ -2454,29 +2459,29 @@ return;
});
return props;
},
-transformStyles: function(element, properties, scopeSelector) {
+transformStyles: function (element, properties, scopeSelector) {
var self = this;
var hostRx = new RegExp(this.rx.HOST_PREFIX + element.is + this.rx.HOST_SUFFIX);
-return styleTransformer.elementStyles(element, function(rule) {
+return styleTransformer.elementStyles(element, function (rule) {
self.applyProperties(rule, properties);
if (rule.cssText && !nativeShadow) {
self._scopeSelector(rule, hostRx, element.is, element._scopeCssViaAttr, scopeSelector);
}
});
},
-_scopeSelector: function(rule, hostRx, is, viaAttr, scopeId) {
+_scopeSelector: function (rule, hostRx, is, viaAttr, scopeId) {
rule.transformedSelector = rule.transformedSelector || rule.selector;
var selector = rule.transformedSelector;
-var scope = viaAttr ? "[" + styleTransformer.SCOPE_NAME + "~=" + scopeId + "]" : "." + scopeId;
-var parts = selector.split(",");
+var scope = viaAttr ? '[' + styleTransformer.SCOPE_NAME + '~=' + scopeId + ']' : '.' + scopeId;
+var parts = selector.split(',');
for (var i = 0, l = parts.length, p; i < l && (p = parts[i]); i++) {
-parts[i] = p.match(hostRx) ? p.replace(is, is + scope) : scope + " " + p;
+parts[i] = p.match(hostRx) ? p.replace(is, is + scope) : scope + ' ' + p;
}
-rule.selector = parts.join(",");
+rule.selector = parts.join(',');
},
-applyElementScopeSelector: function(element, selector, old, viaAttr) {
+applyElementScopeSelector: function (element, selector, old, viaAttr) {
var c = viaAttr ? element.getAttribute(styleTransformer.SCOPE_NAME) : element.className;
-v = old ? c.replace(old, selector) : (c ? c + " " : "") + this.XSCOPE_NAME + " " + selector;
+v = old ? c.replace(old, selector) : (c ? c + ' ' : '') + this.XSCOPE_NAME + ' ' + selector;
if (c !== v) {
if (viaAttr) {
element.setAttribute(styleTransformer.SCOPE_NAME, v);
@@ -2485,8 +2490,8 @@ element.className = v;
}
}
},
-applyElementStyle: function(element, properties, selector, style) {
-var cssText = style ? style.textContent || "" : this.transformStyles(element, properties, selector);
+applyElementStyle: function (element, properties, selector, style) {
+var cssText = style ? style.textContent || '' : this.transformStyles(element, properties, selector);
var s = element._customStyle;
if (s && !nativeShadow && s !== style) {
s._useCount--;
@@ -2517,12 +2522,12 @@ MIXIN_MATCH: /(?:^|\W+)@apply[\s]*\(([^)]*)\);?/im,
VAR_MATCH: /(^|\W+)var\([\s]*([^,)]*)[\s]*,?[\s]*((?:[^,)]*)|(?:[^;]*\([^;)]*\)))[\s]*?\)/gim,
VAR_CAPTURE: /\([\s]*(--[^,\s)]*)(?:,[\s]*(--[^,\s)]*))?(?:\)|,)/gim,
BRACKETED: /\{[^}]*\}/g,
-HOST_PREFIX: "(?:^|[^.])",
-HOST_SUFFIX: "($|[.:[\\s>+~])"
+HOST_PREFIX: '(?:^|[^.])',
+HOST_SUFFIX: '($|[.:[\\s>+~])'
},
-HOST_SELECTORS: [ ":host" ],
-SCOPE_SELECTORS: [ ":root" ],
-XSCOPE_NAME: "x-scope"
+HOST_SELECTORS: [':host'],
+SCOPE_SELECTORS: [':root'],
+XSCOPE_NAME: 'x-scope'
};
function addToBitMask(n, bits) {
var o = parseInt(n / 32);
@@ -2530,16 +2535,15 @@ var v = 1 << n % 32;
bits[o] = (bits[o] || 0) | v;
}
}();
-
-Polymer.StyleDefaults = function() {
+Polymer.StyleDefaults = function () {
var styleProperties = Polymer.StyleProperties;
var styleUtil = Polymer.StyleUtil;
-var style = document.createElement("style");
+var style = document.createElement('style');
var api = {
style: style,
-_styles: [ style ],
+_styles: [style],
_properties: null,
-applyCss: function(cssText) {
+applyCss: function (cssText) {
this.style.textContent += cssText;
styleUtil.clearStyleRules(this.style);
this._properties = null;
@@ -2552,21 +2556,21 @@ this._properties = styleProperties.scopePropertiesFromStyles(this._styles);
}
return this._properties;
},
-_needsStyleProperties: function() {},
-_computeStyleProperties: function() {
+_needsStyleProperties: function () {
+},
+_computeStyleProperties: function () {
return this._styleProperties;
}
};
return api;
}();
-
-(function() {
-Polymer.StyleCache = function() {
+(function () {
+Polymer.StyleCache = function () {
this.cache = {};
};
Polymer.StyleCache.prototype = {
MAX: 100,
-store: function(is, data, keyValues, keyStyles) {
+store: function (is, data, keyValues, keyStyles) {
data.keyValues = keyValues;
data.styles = keyStyles;
var s$ = this.cache[is] = this.cache[is] || [];
@@ -2575,7 +2579,7 @@ if (s$.length > this.MAX) {
s$.shift();
}
},
-retrieve: function(is, keyValues, keyStyles) {
+retrieve: function (is, keyValues, keyStyles) {
var cache = this.cache[is];
if (cache) {
for (var i = cache.length - 1, data; i >= 0; i--) {
@@ -2586,10 +2590,10 @@ return data;
}
}
},
-clear: function() {
+clear: function () {
this.cache = {};
},
-_objectsEqual: function(target, source) {
+_objectsEqual: function (target, source) {
for (var i in target) {
if (target[i] !== source[i]) {
return false;
@@ -2601,9 +2605,8 @@ return target.length === source.length;
return true;
}
};
-})();
-
-(function() {
+}());
+(function () {
var serializeValueToAttribute = Polymer.Base.serializeValueToAttribute;
var propertyUtils = Polymer.StyleProperties;
var styleTransformer = Polymer.StyleTransformer;
@@ -2611,21 +2614,21 @@ var styleUtil = Polymer.StyleUtil;
var styleDefaults = Polymer.StyleDefaults;
var nativeShadow = Polymer.Settings.useNativeShadow;
Polymer.Base._addFeature({
-_prepStyleProperties: function() {
+_prepStyleProperties: function () {
this._ownStylePropertyNames = this._styles ? propertyUtils.decorateStyles(this._styles) : [];
},
-_setupStyleProperties: function() {
+_setupStyleProperties: function () {
this.customStyle = {};
},
-_needsStyleProperties: function() {
+_needsStyleProperties: function () {
return Boolean(this._ownStylePropertyNames && this._ownStylePropertyNames.length);
},
-_beforeAttached: function() {
+_beforeAttached: function () {
if (!this._scopeSelector && this._needsStyleProperties()) {
this._updateStyleProperties();
}
},
-_updateStyleProperties: function() {
+_updateStyleProperties: function () {
var info, scope = this.domHost || styleDefaults;
if (!scope._styleCache) {
scope._styleCache = new Polymer.StyleCache();
@@ -2660,7 +2663,7 @@ styleCache.store(this.is, Object.create(info), this._ownStyleProperties, this._s
}
}
},
-_computeStyleProperties: function(scopeProps) {
+_computeStyleProperties: function (scopeProps) {
var scope = this.domHost || styleDefaults;
if (!scope._styleProperties) {
scope._computeStyleProperties();
@@ -2674,7 +2677,7 @@ this.mixin(props, this.customStyle);
propertyUtils.reify(props);
this._styleProperties = props;
},
-_computeOwnStyleProperties: function() {
+_computeOwnStyleProperties: function () {
var props = {};
for (var i = 0, n; i < this._ownStylePropertyNames.length; i++) {
n = this._ownStylePropertyNames[i];
@@ -2683,18 +2686,18 @@ props[n] = this._styleProperties[n];
this._ownStyleProperties = props;
},
_scopeCount: 0,
-_applyStyleProperties: function(info) {
+_applyStyleProperties: function (info) {
var oldScopeSelector = this._scopeSelector;
-this._scopeSelector = info ? info._scopeSelector : this.is + "-" + this.__proto__._scopeCount++;
+this._scopeSelector = info ? info._scopeSelector : this.is + '-' + this.__proto__._scopeCount++;
style = propertyUtils.applyElementStyle(this, this._styleProperties, this._scopeSelector, info && info.style);
if ((style || oldScopeSelector) && !nativeShadow) {
propertyUtils.applyElementScopeSelector(this, this._scopeSelector, oldScopeSelector, this._scopeCssViaAttr);
}
return style || {};
},
-serializeValueToAttribute: function(value, attribute, node) {
+serializeValueToAttribute: function (value, attribute, node) {
node = node || this;
-if (attribute === "class") {
+if (attribute === 'class') {
var host = node === this ? this.domHost || this.dataHost : this;
if (host) {
value = host._scopeElementClass(node, value);
@@ -2703,13 +2706,13 @@ value = host._scopeElementClass(node, value);
node = Polymer.dom(node);
serializeValueToAttribute.call(this, value, attribute, node);
},
-_scopeElementClass: function(element, selector) {
+_scopeElementClass: function (element, selector) {
if (!nativeShadow && !this._scopeCssViaAttr) {
-selector += (selector ? " " : "") + SCOPE_NAME + " " + this.is + (element._scopeSelector ? " " + XSCOPE_NAME + " " + element._scopeSelector : "");
+selector += (selector ? ' ' : '') + SCOPE_NAME + ' ' + this.is + (element._scopeSelector ? ' ' + XSCOPE_NAME + ' ' + element._scopeSelector : '');
}
return selector;
},
-updateStyles: function() {
+updateStyles: function () {
if (this.isAttached) {
if (this._needsStyleProperties()) {
this._updateStyleProperties();
@@ -2722,9 +2725,9 @@ this._styleCache.clear();
this._updateRootStyles();
}
},
-_updateRootStyles: function(root) {
+_updateRootStyles: function (root) {
root = root || this.root;
-var c$ = Polymer.dom(root)._query(function(e) {
+var c$ = Polymer.dom(root)._query(function (e) {
return e.shadyRoot || e.shadowRoot;
});
for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) {
@@ -2734,7 +2737,7 @@ c.updateStyles();
}
}
});
-Polymer.updateStyles = function() {
+Polymer.updateStyles = function () {
styleDefaults._styleCache.clear();
Polymer.Base._updateRootStyles(document);
};
@@ -2742,10 +2745,9 @@ var styleCache = new Polymer.StyleCache();
Polymer.customStyleCache = styleCache;
var SCOPE_NAME = styleTransformer.SCOPE_NAME;
var XSCOPE_NAME = propertyUtils.XSCOPE_NAME;
-})();
-
+}());
Polymer.Base._addFeature({
-_registerFeatures: function() {
+_registerFeatures: function () {
this._prepIs();
this._prepAttributes();
this._prepExtends();
@@ -2759,12 +2761,12 @@ this._prepBehaviors();
this._prepBindings();
this._prepShady();
},
-_prepBehavior: function(b) {
+_prepBehavior: function (b) {
this._addPropertyEffects(b.properties);
this._addComplexObserverEffects(b.observers);
this._addHostAttributes(b.hostAttributes);
},
-_initFeatures: function() {
+_initFeatures: function () {
this._poolContent();
this._setupConfigure();
this._setupStyleProperties();
@@ -2779,41 +2781,40 @@ this._marshalBehaviors();
this._marshalAttributes();
this._tryReady();
},
-_marshalBehavior: function(b) {
+_marshalBehavior: function (b) {
this._listenListeners(b.listeners);
}
});
-
-(function() {
+(function () {
var nativeShadow = Polymer.Settings.useNativeShadow;
var propertyUtils = Polymer.StyleProperties;
var styleUtil = Polymer.StyleUtil;
var styleDefaults = Polymer.StyleDefaults;
Polymer({
-is: "custom-style",
-"extends": "style",
-created: function() {
-this._appliesToDocument = this.parentNode.localName !== "dom-module";
+is: 'custom-style',
+extends: 'style',
+created: function () {
+this._appliesToDocument = this.parentNode.localName !== 'dom-module';
if (this._appliesToDocument) {
var e = this.__appliedElement || this;
var rules = styleUtil.rulesForStyle(e);
-propertyUtils.decorateStyles([ e ]);
+propertyUtils.decorateStyles([e]);
this._rulesToDefaultProperties(rules);
this.async(this._applyStyle);
}
},
-_applyStyle: function() {
+_applyStyle: function () {
var e = this.__appliedElement || this;
this._computeStyleProperties();
var props = this._styleProperties;
var self = this;
-e.textContent = styleUtil.toCssText(styleUtil.rulesForStyle(e), function(rule) {
-if (rule.selector === ":root") {
-rule.selector = "body";
+e.textContent = styleUtil.toCssText(styleUtil.rulesForStyle(e), function (rule) {
+if (rule.selector === ':root') {
+rule.selector = 'body';
}
var css = rule.cssText = rule.parsedCssText;
-if (rule.propertyInfo.cssText) {
-css = css.replace(propertyUtils.rx.VAR_ASSIGN, "");
+if (rule.propertyInfo && rule.propertyInfo.cssText) {
+css = css.replace(propertyUtils.rx.VAR_ASSIGN, '');
rule.cssText = propertyUtils.valueForProperties(css, props);
}
if (!nativeShadow) {
@@ -2821,10 +2822,10 @@ Polymer.StyleTransformer.rootRule(rule);
}
});
},
-_rulesToDefaultProperties: function(rules) {
-styleUtil.forEachStyleRule(rules, function(rule) {
+_rulesToDefaultProperties: function (rules) {
+styleUtil.forEachStyleRule(rules, function (rule) {
if (!rule.propertyInfo.properties) {
-rule.cssText = "";
+rule.cssText = '';
}
});
var cssText = styleUtil.parser.stringify(rules, true);
@@ -2833,24 +2834,19 @@ styleDefaults.applyCss(cssText);
}
}
});
-})();
-
+}());
Polymer.Templatizer = {
-properties: {
-_hideTemplateChildren: {
-observer: "_hideTemplateChildrenChanged"
-}
-},
+properties: { _hideTemplateChildren: { observer: '_showHideChildren' } },
_templatizerStatic: {
count: 0,
callbacks: {},
debouncer: null
},
_instanceProps: Polymer.nob,
-created: function() {
+created: function () {
this._templatizerId = this._templatizerStatic.count++;
},
-templatize: function(template) {
+templatize: function (template) {
if (!template._content) {
template._content = template.content;
}
@@ -2878,19 +2874,16 @@ archetype.constructor = ctor;
template._content._ctor = ctor;
this.ctor = ctor;
},
-_getRootDataHost: function() {
+_getRootDataHost: function () {
return this.dataHost && this.dataHost._rootDataHost || this.dataHost;
},
-_hideTemplateChildrenChanged: function(hidden) {
-if (this._hideChildren) {
-this._hideChildren(hidden);
-}
+_showHideChildren: function (hidden) {
},
-_debounceTemplate: function(fn) {
+_debounceTemplate: function (fn) {
this._templatizerStatic.callbacks[this._templatizerId] = fn.bind(this);
this._templatizerStatic.debouncer = Polymer.Debounce(this._templatizerStatic.debouncer, this._flushTemplates.bind(this, true));
},
-_flushTemplates: function(debouncerExpired) {
+_flushTemplates: function (debouncerExpired) {
var db = this._templatizerStatic.debouncer;
while (debouncerExpired || db && db.finish) {
db.stop();
@@ -2902,13 +2895,13 @@ cbs[id]();
debouncerExpired = false;
}
},
-_customPrepEffects: function(archetype) {
+_customPrepEffects: function (archetype) {
var parentProps = archetype._parentProps;
for (var prop in parentProps) {
-archetype._addPropertyEffect(prop, "function", this._createHostPropEffector(prop));
+archetype._addPropertyEffect(prop, 'function', this._createHostPropEffector(prop));
}
},
-_customPrepAnnotations: function(archetype, template) {
+_customPrepAnnotations: function (archetype, template) {
archetype._template = template;
var c = template._content;
if (!c._notes) {
@@ -2923,7 +2916,7 @@ this._processAnnotations(c._notes);
archetype._notes = c._notes;
archetype._parentProps = c._parentProps;
},
-_prepParentProperties: function(archetype, template) {
+_prepParentProperties: function (archetype, template) {
var parentProps = this._parentProps = archetype._parentProps;
if (this._forwardParentProp && parentProps) {
var proto = archetype._parentPropProto;
@@ -2937,13 +2930,14 @@ if (template != this) {
Polymer.Bind.prepareModel(proto);
}
for (prop in parentProps) {
-var parentProp = "_parent_" + prop;
-var effects = [ {
-kind: "function",
+var parentProp = '_parent_' + prop;
+var effects = [
+{
+kind: 'function',
effect: this._createForwardPropEffector(prop)
-}, {
-kind: "notify"
-} ];
+},
+{ kind: 'notify' }
+];
Polymer.Bind._createAccessors(proto, parentProp, effects);
}
}
@@ -2954,18 +2948,18 @@ template._forwardParentProp = this._forwardParentProp.bind(this);
this._extendTemplate(template, proto);
}
},
-_createForwardPropEffector: function(prop) {
-return function(source, value) {
+_createForwardPropEffector: function (prop) {
+return function (source, value) {
this._forwardParentProp(prop, value);
};
},
-_createHostPropEffector: function(prop) {
-return function(source, value) {
-this.dataHost["_parent_" + prop] = value;
+_createHostPropEffector: function (prop) {
+return function (source, value) {
+this.dataHost['_parent_' + prop] = value;
};
},
-_extendTemplate: function(template, proto) {
-Object.getOwnPropertyNames(proto).forEach(function(n) {
+_extendTemplate: function (template, proto) {
+Object.getOwnPropertyNames(proto).forEach(function (n) {
var val = template[n];
var pd = Object.getOwnPropertyDescriptor(proto, n);
Object.defineProperty(template, n, pd);
@@ -2974,25 +2968,26 @@ template._propertySet(n, val);
}
});
},
-_forwardInstancePath: function(inst, path, value) {},
-_notifyPathImpl: function(path, value) {
+_forwardInstancePath: function (inst, path, value) {
+},
+_notifyPathImpl: function (path, value) {
var dataHost = this.dataHost;
-var dot = path.indexOf(".");
+var dot = path.indexOf('.');
var root = dot < 0 ? path : path.slice(0, dot);
dataHost._forwardInstancePath.call(dataHost, this, path, value);
if (root in dataHost._parentProps) {
-dataHost.notifyPath("_parent_" + path, value);
+dataHost.notifyPath('_parent_' + path, value);
}
},
-_pathEffector: function(path, value, fromAbove) {
+_pathEffector: function (path, value, fromAbove) {
if (this._forwardParentPath) {
-if (path.indexOf("_parent_") === 0) {
+if (path.indexOf('_parent_') === 0) {
this._forwardParentPath(path.substring(8), value);
}
}
Polymer.Base._pathEffector.apply(this, arguments);
},
-_constructorImpl: function(model, host) {
+_constructorImpl: function (model, host) {
this._rootDataHost = host._getRootDataHost();
this._setupConfigure(model);
this._pushHost(host);
@@ -3010,115 +3005,111 @@ n._templateInstance = this;
this._children = children;
this._tryReady();
},
-_listenImpl: function(node, eventName, methodName) {
+_listenImpl: function (node, eventName, methodName) {
var model = this;
var host = this._rootDataHost;
var handler = host._createEventHandler(node, eventName, methodName);
-var decorated = function(e) {
+var decorated = function (e) {
e.model = model;
handler(e);
};
host._listen(node, eventName, decorated);
},
-_scopeElementClassImpl: function(node, value) {
+_scopeElementClassImpl: function (node, value) {
var host = this._rootDataHost;
if (host) {
return host._scopeElementClass(node, value);
}
},
-stamp: function(model) {
+stamp: function (model) {
model = model || {};
if (this._parentProps) {
for (var prop in this._parentProps) {
-model[prop] = this["_parent_" + prop];
+model[prop] = this['_parent_' + prop];
}
}
return new this.ctor(model, this);
}
};
-
Polymer({
-is: "dom-template",
-"extends": "template",
-behaviors: [ Polymer.Templatizer ],
-ready: function() {
+is: 'dom-template',
+extends: 'template',
+behaviors: [Polymer.Templatizer],
+ready: function () {
this.templatize(this);
}
});
-
Polymer._collections = new WeakMap();
-
-Polymer.Collection = function(userArray) {
+Polymer.Collection = function (userArray) {
Polymer._collections.set(userArray, this);
this.userArray = userArray;
this.store = userArray.slice();
this.initMap();
};
-
Polymer.Collection.prototype = {
constructor: Polymer.Collection,
-initMap: function() {
+initMap: function () {
var omap = this.omap = new WeakMap();
var pmap = this.pmap = {};
var s = this.store;
for (var i = 0; i < s.length; i++) {
var item = s[i];
-if (item && typeof item == "object") {
+if (item && typeof item == 'object') {
omap.set(item, i);
} else {
pmap[item] = i;
}
}
},
-add: function(item) {
+add: function (item) {
var key = this.store.push(item) - 1;
-if (item && typeof item == "object") {
+if (item && typeof item == 'object') {
this.omap.set(item, key);
} else {
this.pmap[item] = key;
}
return key;
},
-removeKey: function(key) {
+removeKey: function (key) {
this._removeFromMap(this.store[key]);
delete this.store[key];
},
-_removeFromMap: function(item) {
-if (typeof item == "object") {
+_removeFromMap: function (item) {
+if (typeof item == 'object') {
this.omap.delete(item);
} else {
delete this.pmap[item];
}
},
-remove: function(item) {
+remove: function (item) {
var key = this.getKey(item);
this.removeKey(key);
return key;
},
-getKey: function(item) {
-if (typeof item == "object") {
+getKey: function (item) {
+if (typeof item == 'object') {
return this.omap.get(item);
} else {
return this.pmap[item];
}
},
-getKeys: function() {
+getKeys: function () {
return Object.keys(this.store);
},
-setItem: function(key, value) {
+setItem: function (key, value) {
this.store[key] = value;
},
-getItem: function(key) {
+getItem: function (key) {
return this.store[key];
},
-getItems: function() {
+getItems: function () {
var items = [], store = this.store;
for (var key in store) {
items.push(store[key]);
}
return items;
},
-applySplices: function(splices) {
+applySplices: function (splices) {
var keySplices = [];
for (var i = 0; i < splices.length; i++) {
var j, o, key, s = splices[i];
@@ -3144,64 +3135,65 @@ added: added
return keySplices;
}
};
-
-Polymer.Collection.get = function(userArray) {
+Polymer.Collection.get = function (userArray) {
return Polymer._collections.get(userArray) || new Polymer.Collection(userArray);
};
-
Polymer({
-is: "dom-repeat",
-"extends": "template",
+is: 'dom-repeat',
+extends: 'template',
properties: {
-items: {
-type: Array
-},
+items: { type: Array },
as: {
type: String,
-value: "item"
+value: 'item'
},
indexAs: {
type: String,
-value: "index"
+value: 'index'
},
sort: {
type: Function,
-observer: "_sortChanged"
+observer: '_sortChanged'
},
filter: {
type: Function,
-observer: "_filterChanged"
+observer: '_filterChanged'
},
observe: {
type: String,
-observer: "_observeChanged"
+observer: '_observeChanged'
},
delay: Number
},
-behaviors: [ Polymer.Templatizer ],
-observers: [ "_itemsChanged(items.*)" ],
-detached: function() {
+behaviors: [Polymer.Templatizer],
+observers: ['_itemsChanged(items.*)'],
+detached: function () {
if (this.rows) {
for (var i = 0; i < this.rows.length; i++) {
this._detachRow(i);
}
}
-this.rows = null;
},
-ready: function() {
-this._instanceProps = {
-__key__: true
-};
+attached: function () {
+if (this.rows) {
+var parentNode = Polymer.dom(this).parentNode;
+for (var i = 0; i < this.rows.length; i++) {
+Polymer.dom(parentNode).insertBefore(this.rows[i].root, this);
+}
+}
+},
+ready: function () {
+this._instanceProps = { __key__: true };
this._instanceProps[this.as] = true;
this._instanceProps[this.indexAs] = true;
if (!this.ctor) {
this.templatize(this);
}
},
-_sortChanged: function() {
+_sortChanged: function () {
var dataHost = this._getRootDataHost();
var sort = this.sort;
-this._sortFn = sort && (typeof sort == "function" ? sort : function() {
+this._sortFn = sort && (typeof sort == 'function' ? sort : function () {
return dataHost[sort].apply(dataHost, arguments);
});
this._fullRefresh = true;
@@ -3209,10 +3201,10 @@ if (this.items) {
this._debounceTemplate(this._render);
}
},
-_filterChanged: function() {
+_filterChanged: function () {
var dataHost = this._getRootDataHost();
var filter = this.filter;
-this._filterFn = filter && (typeof filter == "function" ? filter : function() {
+this._filterFn = filter && (typeof filter == 'function' ? filter : function () {
return dataHost[filter].apply(dataHost, arguments);
});
this._fullRefresh = true;
@@ -3220,22 +3212,22 @@ if (this.items) {
this._debounceTemplate(this._render);
}
},
-_observeChanged: function() {
-this._observePaths = this.observe && this.observe.replace(".*", ".").split(" ");
+_observeChanged: function () {
+this._observePaths = this.observe && this.observe.replace('.*', '.').split(' ');
},
-_itemsChanged: function(change) {
-if (change.path == "items") {
+_itemsChanged: function (change) {
+if (change.path == 'items') {
if (Array.isArray(this.items)) {
this.collection = Polymer.Collection.get(this.items);
} else if (!this.items) {
this.collection = null;
} else {
-this._error(this._logf("dom-repeat", "expected array for `items`," + " found", this.items));
+this._error(this._logf('dom-repeat', 'expected array for `items`,' + ' found', this.items));
}
this._splices = [];
this._fullRefresh = true;
this._debounceTemplate(this._render);
-} else if (change.path == "items.splices") {
+} else if (change.path == 'items.splices') {
this._splices = this._splices.concat(change.value.keySplices);
this._debounceTemplate(this._render);
} else {
@@ -3244,15 +3236,15 @@ this._forwardItemPath(subpath, change.value);
this._checkObservedPaths(subpath);
}
},
-_checkObservedPaths: function(path) {
+_checkObservedPaths: function (path) {
if (this._observePaths) {
-path = path.substring(path.indexOf(".") + 1);
+path = path.substring(path.indexOf('.') + 1);
var paths = this._observePaths;
for (var i = 0; i < paths.length; i++) {
if (path.indexOf(paths[i]) === 0) {
this._fullRefresh = true;
if (this.delay) {
-this.debounce("render", this._render, this.delay);
+this.debounce('render', this._render, this.delay);
} else {
this._debounceTemplate(this._render);
}
@@ -3261,12 +3253,12 @@ return;
}
}
},
-render: function() {
+render: function () {
this._fullRefresh = true;
-this.debounce("render", this._render);
+this.debounce('render', this._render);
this._flushTemplates();
},
-_render: function() {
+_render: function () {
var c = this.collection;
if (!this._fullRefresh) {
if (this._sortFn) {
@@ -3299,13 +3291,13 @@ row[this.as] = item;
row.__key__ = key;
row[this.indexAs] = i;
}
-for (;i < this.rows.length; i++) {
+for (; i < this.rows.length; i++) {
this._detachRow(i);
}
this.rows.splice(keys.length, this.rows.length - keys.length);
-this.fire("dom-change");
+this.fire('dom-change');
},
-_sortAndFilter: function() {
+_sortAndFilter: function () {
var c = this.collection;
if (!this._sortFn) {
this._orderedKeys = [];
@@ -3319,20 +3311,20 @@ this._orderedKeys.push(c.getKey(items[i]));
this._orderedKeys = c ? c.getKeys() : [];
}
if (this._filterFn) {
-this._orderedKeys = this._orderedKeys.filter(function(a) {
+this._orderedKeys = this._orderedKeys.filter(function (a) {
return this._filterFn(c.getItem(a));
}, this);
}
if (this._sortFn) {
-this._orderedKeys.sort(function(a, b) {
+this._orderedKeys.sort(function (a, b) {
return this._sortFn(c.getItem(a), c.getItem(b));
}.bind(this));
}
},
-_keySort: function(a, b) {
+_keySort: function (a, b) {
return this.collection.getKey(a) - this.collection.getKey(b);
},
-_applySplicesViewSort: function(splices) {
+_applySplicesViewSort: function (splices) {
var c = this.collection;
var keys = this._orderedKeys;
var rows = this.rows;
@@ -3340,7 +3332,7 @@ var removedRows = [];
var addedKeys = [];
var pool = [];
var sortFn = this._sortFn || this._keySort.bind(this);
-splices.forEach(function(s) {
+splices.forEach(function (s) {
for (var i = 0; i < s.removed.length; i++) {
var idx = this._rowForKey[s.removed[i]];
if (idx != null) {
@@ -3362,11 +3354,11 @@ keys.splice(idx, 1);
}
if (addedKeys.length) {
if (this._filterFn) {
-addedKeys = addedKeys.filter(function(a) {
+addedKeys = addedKeys.filter(function (a) {
return this._filterFn(c.getItem(a));
}, this);
}
-addedKeys.sort(function(a, b) {
+addedKeys.sort(function (a, b) {
return this._sortFn(c.getItem(a), c.getItem(b));
}.bind(this));
var start = 0;
@@ -3375,7 +3367,7 @@ start = this._insertRowIntoViewSort(start, addedKeys[i], pool);
}
}
},
-_insertRowIntoViewSort: function(start, key, pool) {
+_insertRowIntoViewSort: function (start, key, pool) {
var c = this.collection;
var item = c.getItem(key);
var end = this.rows.length - 1;
@@ -3401,18 +3393,21 @@ this._orderedKeys.splice(idx, 0, key);
this.rows.splice(idx, 0, this._insertRow(idx, pool, c.getItem(key)));
return idx;
},
-_applySplicesArraySort: function(splices) {
+_applySplicesArraySort: function (splices) {
var keys = this._orderedKeys;
var pool = [];
-splices.forEach(function(s) {
+splices.forEach(function (s) {
for (var i = 0; i < s.removed.length; i++) {
pool.push(this._detachRow(s.index + i));
}
this.rows.splice(s.index, s.removed.length);
}, this);
var c = this.collection;
-splices.forEach(function(s) {
-var args = [ s.index, s.removed.length ].concat(s.added);
+splices.forEach(function (s) {
+var args = [
+s.index,
+s.removed.length
+].concat(s.added);
keys.splice.apply(keys, args);
for (var i = 0; i < s.added.length; i++) {
var item = c.getItem(s.added[i]);
@@ -3421,7 +3416,7 @@ this.rows.splice(s.index + i, 0, row);
}
}, this);
},
-_detachRow: function(idx) {
+_detachRow: function (idx) {
var row = this.rows[idx];
var parentNode = Polymer.dom(this).parentNode;
for (var i = 0; i < row._children.length; i++) {
@@ -3430,7 +3425,7 @@ Polymer.dom(row.root).appendChild(el);
}
return row;
},
-_insertRow: function(idx, pool, item) {
+_insertRow: function (idx, pool, item) {
var row = pool && pool.pop() || this._generateRow(idx, item);
var beforeRow = this.rows[idx];
var beforeNode = beforeRow ? beforeRow._children[0] : this;
@@ -3438,58 +3433,56 @@ var parentNode = Polymer.dom(this).parentNode;
Polymer.dom(parentNode).insertBefore(row.root, beforeNode);
return row;
},
-_generateRow: function(idx, item) {
-var model = {
-__key__: this.collection.getKey(item)
-};
+_generateRow: function (idx, item) {
+var model = { __key__: this.collection.getKey(item) };
model[this.as] = item;
model[this.indexAs] = idx;
var row = this.stamp(model);
return row;
},
-_hideChildren: function(hidden) {
+_showHideChildren: function (hidden) {
if (this.rows) {
for (var i = 0; i < this.rows.length; i++) {
var c$ = this.rows[i]._children;
for (var j = 0; j < c$.length; j++) {
var c = c$[j];
if (c.style) {
-c.style.display = hidden ? "none" : "";
+c.style.display = hidden ? 'none' : '';
}
c._hideTemplateChildren = hidden;
}
}
}
},
-_forwardInstancePath: function(row, path, value) {
-if (path.indexOf(this.as + ".") === 0) {
-this.notifyPath("items." + row.__key__ + "." + path.slice(this.as.length + 1), value);
+_forwardInstancePath: function (row, path, value) {
+if (path.indexOf(this.as + '.') === 0) {
+this.notifyPath('items.' + row.__key__ + '.' + path.slice(this.as.length + 1), value);
return true;
}
},
-_forwardParentProp: function(prop, value) {
+_forwardParentProp: function (prop, value) {
if (this.rows) {
-this.rows.forEach(function(row) {
+this.rows.forEach(function (row) {
row[prop] = value;
}, this);
}
},
-_forwardParentPath: function(path, value) {
+_forwardParentPath: function (path, value) {
if (this.rows) {
-this.rows.forEach(function(row) {
+this.rows.forEach(function (row) {
row.notifyPath(path, value, true);
}, this);
}
},
-_forwardItemPath: function(path, value) {
+_forwardItemPath: function (path, value) {
if (this._rowForKey) {
-var dot = path.indexOf(".");
+var dot = path.indexOf('.');
var key = path.substring(0, dot < 0 ? path.length : dot);
var idx = this._rowForKey[key];
var row = this.rows[idx];
if (row) {
if (dot >= 0) {
-path = this.as + "." + path.substring(dot + 1);
+path = this.as + '.' + path.substring(dot + 1);
row.notifyPath(path, value, true);
} else {
row[this.as] = value;
@@ -3497,7 +3490,7 @@ row[this.as] = value;
}
}
},
-modelForElement: function(el) {
+modelForElement: function (el) {
var model;
while (el) {
if (model = el._templateInstance) {
@@ -3511,26 +3504,25 @@ el = el.parentNode;
}
}
},
-itemForElement: function(el) {
+itemForElement: function (el) {
var instance = this.modelForElement(el);
return instance && instance[this.as];
},
-keyForElement: function(el) {
+keyForElement: function (el) {
var instance = this.modelForElement(el);
return instance && instance.__key__;
},
-indexForElement: function(el) {
+indexForElement: function (el) {
var instance = this.modelForElement(el);
return instance && instance[this.indexAs];
}
});
-
Polymer({
-is: "array-selector",
+is: 'array-selector',
properties: {
items: {
type: Array,
-observer: "_itemsChanged"
+observer: '_itemsChanged'
},
selected: {
type: Object,
@@ -3539,13 +3531,13 @@ notify: true
toggle: Boolean,
multi: Boolean
},
-_itemsChanged: function() {
+_itemsChanged: function () {
if (Array.isArray(this.selected)) {
for (var i = 0; i < this.selected.length; i++) {
-this.unlinkPaths("selected." + i);
+this.unlinkPaths('selected.' + i);
}
} else {
-this.unlinkPaths("selected");
+this.unlinkPaths('selected');
}
if (this.multi) {
this.selected = [];
@@ -3553,22 +3545,22 @@ this.selected = [];
this.selected = null;
}
},
-deselect: function(item) {
+deselect: function (item) {
if (this.multi) {
var scol = Polymer.Collection.get(this.selected);
var sidx = this.selected.indexOf(item);
if (sidx >= 0) {
var skey = scol.getKey(item);
-this.splice("selected", sidx, 1);
-this.unlinkPaths("selected." + skey);
+this.splice('selected', sidx, 1);
+this.unlinkPaths('selected.' + skey);
return true;
}
} else {
this.selected = null;
-this.unlinkPaths("selected");
+this.unlinkPaths('selected');
}
},
-select: function(item) {
+select: function (item) {
var icol = Polymer.Collection.get(this.items);
var key = icol.getKey(item);
if (this.multi) {
@@ -3577,28 +3569,27 @@ var skey = scol.getKey(item);
if (skey >= 0) {
this.deselect(item);
} else if (this.toggle) {
-this.push("selected", item);
-this.async(function() {
+this.push('selected', item);
+this.async(function () {
skey = scol.getKey(item);
-this.linkPaths("selected." + skey, "items." + key);
+this.linkPaths('selected.' + skey, 'items.' + key);
});
}
} else {
if (this.toggle && item == this.selected) {
this.deselect();
} else {
-this.linkPaths("selected", "items." + key);
+this.linkPaths('selected', 'items.' + key);
this.selected = item;
}
}
}
});
-
Polymer({
-is: "dom-if",
-"extends": "template",
+is: 'dom-if',
+extends: 'template',
properties: {
-"if": {
+'if': {
type: Boolean,
value: false
},
@@ -3607,42 +3598,42 @@ type: Boolean,
value: false
}
},
-behaviors: [ Polymer.Templatizer ],
-observers: [ "_queueRender(if, restamp)" ],
-_queueRender: function() {
+behaviors: [Polymer.Templatizer],
+observers: ['_queueRender(if, restamp)'],
+_queueRender: function () {
this._debounceTemplate(this._render);
},
-detached: function() {
+detached: function () {
this._teardownInstance();
},
-attached: function() {
+attached: function () {
if (this.if && this.ctor) {
this.async(this._ensureInstance);
}
},
-render: function() {
+render: function () {
this._flushTemplates();
},
-_render: function() {
+_render: function () {
if (this.if) {
if (!this.ctor) {
this._wrapTextNodes(this._content || this.content);
this.templatize(this);
}
this._ensureInstance();
-this._hideTemplateChildren = false;
+this._showHideChildren();
} else if (this.restamp) {
this._teardownInstance();
}
if (!this.restamp && this._instance) {
-this._hideTemplateChildren = !this.if;
+this._showHideChildren();
}
if (this.if != this._lastIf) {
-this.fire("dom-change");
+this.fire('dom-change');
this._lastIf = this.if;
}
},
-_ensureInstance: function() {
+_ensureInstance: function () {
if (!this._instance) {
this._instance = this.stamp();
var root = this._instance.root;
@@ -3650,116 +3641,114 @@ var parent = Polymer.dom(Polymer.dom(this).parentNode);
parent.insertBefore(root, this);
}
},
-_teardownInstance: function() {
+_teardownInstance: function () {
if (this._instance) {
var c = this._instance._children;
if (c) {
var parent = Polymer.dom(Polymer.dom(c[0]).parentNode);
-c.forEach(function(n) {
+c.forEach(function (n) {
parent.removeChild(n);
});
}
this._instance = null;
}
},
-_wrapTextNodes: function(root) {
+_wrapTextNodes: function (root) {
for (var n = root.firstChild; n; n = n.nextSibling) {
if (n.nodeType === Node.TEXT_NODE) {
-var s = document.createElement("span");
+var s = document.createElement('span');
root.insertBefore(s, n);
s.appendChild(n);
n = s;
}
}
},
-_hideChildren: function(hidden) {
+_showHideChildren: function () {
+var hidden = this._hideTemplateChildren || !this.if;
if (this._instance) {
var c$ = this._instance._children;
for (var i = 0; i < c$.length; i++) {
var c = c$[i];
-c.style.display = hidden ? "none" : "";
+c.style.display = hidden ? 'none' : '';
c._hideTemplateChildren = hidden;
}
}
},
-_forwardParentProp: function(prop, value) {
+_forwardParentProp: function (prop, value) {
if (this._instance) {
this._instance[prop] = value;
}
},
-_forwardParentPath: function(path, value) {
+_forwardParentPath: function (path, value) {
if (this._instance) {
this._instance.notifyPath(path, value, true);
}
}
});
-
Polymer.ImportStatus = {
_ready: false,
_callbacks: [],
-whenLoaded: function(cb) {
+whenLoaded: function (cb) {
if (this._ready) {
cb();
} else {
this._callbacks.push(cb);
}
},
-_importsLoaded: function() {
+_importsLoaded: function () {
this._ready = true;
-this._callbacks.forEach(function(cb) {
+this._callbacks.forEach(function (cb) {
cb();
});
this._callbacks = [];
}
};
-
-window.addEventListener("load", function() {
+window.addEventListener('load', function () {
Polymer.ImportStatus._importsLoaded();
});
-
if (window.HTMLImports) {
-HTMLImports.whenReady(function() {
+HTMLImports.whenReady(function () {
Polymer.ImportStatus._importsLoaded();
});
}
-
Polymer({
-is: "dom-bind",
-"extends": "template",
-created: function() {
+is: 'dom-bind',
+extends: 'template',
+created: function () {
Polymer.ImportStatus.whenLoaded(this._readySelf.bind(this));
},
-_registerFeatures: function() {
+_registerFeatures: function () {
this._prepExtends();
this._prepConstructor();
},
-_insertChildren: function() {
+_insertChildren: function () {
var parentDom = Polymer.dom(Polymer.dom(this).parentNode);
parentDom.insertBefore(this.root, this);
},
-_removeChildren: function() {
+_removeChildren: function () {
if (this._children) {
for (var i = 0; i < this._children.length; i++) {
this.root.appendChild(this._children[i]);
}
}
},
-_initFeatures: function() {},
-_scopeElementClass: function(element, selector) {
+_initFeatures: function () {
+},
+_scopeElementClass: function (element, selector) {
if (this.dataHost) {
return this.dataHost._scopeElementClass(element, selector);
} else {
return selector;
}
},
-_prepConfigure: function() {
+_prepConfigure: function () {
var config = {};
for (var prop in this._propertyEffects) {
config[prop] = this[prop];
}
this._setupConfigure = this._setupConfigure.bind(this, config);
},
-attached: function() {
+attached: function () {
if (!this._children) {
this._template = this;
this._prepAnnotations();
@@ -3771,9 +3760,9 @@ Polymer.Base._initFeatures.call(this);
this._children = Array.prototype.slice.call(this.root.childNodes);
}
this._insertChildren();
-this.fire("dom-change");
+this.fire('dom-change');
},
-detached: function() {
+detached: function () {
this._removeChildren();
}
});</script>