easycomments 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.rspec +2 -0
- data/Gemfile +14 -0
- data/LICENSE +21 -0
- data/README.md +92 -0
- data/Rakefile +49 -0
- data/_config.yml +28 -0
- data/bin/ec +45 -0
- data/config.ru +12 -0
- data/dashboard.rb +57 -0
- data/easycomments.gemspec +22 -0
- data/ec.rb +43 -0
- data/lib/easycomments/ec_configuration.rb +42 -0
- data/lib/easycomments/ec_dashboard_model.rb +70 -0
- data/lib/easycomments/ec_model.rb +47 -0
- data/lib/easycomments.rb +14 -0
- data/public/bower.json +32 -0
- data/public/bower_components/core-a11y-keys/.bower.json +28 -0
- data/public/bower_components/core-a11y-keys/README.md +4 -0
- data/public/bower_components/core-a11y-keys/bower.json +18 -0
- data/public/bower_components/core-a11y-keys/core-a11y-keys.html +335 -0
- data/public/bower_components/core-a11y-keys/demo.html +41 -0
- data/public/bower_components/core-a11y-keys/index.html +22 -0
- data/public/bower_components/core-ajax/.bower.json +22 -0
- data/public/bower_components/core-ajax/README.md +4 -0
- data/public/bower_components/core-ajax/bower.json +11 -0
- data/public/bower_components/core-ajax/core-ajax.html +434 -0
- data/public/bower_components/core-ajax/core-xhr.html +116 -0
- data/public/bower_components/core-ajax/demo-progress.html +65 -0
- data/public/bower_components/core-ajax/demo.html +43 -0
- data/public/bower_components/core-ajax/index.html +22 -0
- data/public/bower_components/core-ajax/metadata.html +23 -0
- data/public/bower_components/core-ajax/test/core-ajax-progress.html +108 -0
- data/public/bower_components/core-ajax/test/core-ajax-race.html +81 -0
- data/public/bower_components/core-ajax/test/core-ajax.html +287 -0
- data/public/bower_components/core-ajax/test/index.html +17 -0
- data/public/bower_components/core-collapse/.bower.json +21 -0
- data/public/bower_components/core-collapse/README.md +4 -0
- data/public/bower_components/core-collapse/bower.json +11 -0
- data/public/bower_components/core-collapse/core-collapse.css +16 -0
- data/public/bower_components/core-collapse/core-collapse.html +298 -0
- data/public/bower_components/core-collapse/demo.html +75 -0
- data/public/bower_components/core-collapse/index.html +22 -0
- data/public/bower_components/core-collapse/test/basic.html +85 -0
- data/public/bower_components/core-collapse/test/index.html +24 -0
- data/public/bower_components/core-component-page/.bower.json +19 -0
- data/public/bower_components/core-component-page/README.md +6 -0
- data/public/bower_components/core-component-page/bowager-logo.png +0 -0
- data/public/bower_components/core-component-page/bower.json +9 -0
- data/public/bower_components/core-component-page/core-component-page.html +37 -0
- data/public/bower_components/core-component-page/demo.html +23 -0
- data/public/bower_components/core-component-page/index.html +22 -0
- data/public/bower_components/core-drawer-panel/.bower.json +19 -0
- data/public/bower_components/core-drawer-panel/README.md +4 -0
- data/public/bower_components/core-drawer-panel/bower.json +9 -0
- data/public/bower_components/core-drawer-panel/core-drawer-panel.css +160 -0
- data/public/bower_components/core-drawer-panel/core-drawer-panel.html +418 -0
- data/public/bower_components/core-drawer-panel/demo.html +68 -0
- data/public/bower_components/core-drawer-panel/index.html +22 -0
- data/public/bower_components/core-drawer-panel/metadata.html +37 -0
- data/public/bower_components/core-focusable/.bower.json +18 -0
- data/public/bower_components/core-focusable/README.md +6 -0
- data/public/bower_components/core-focusable/bower.json +8 -0
- data/public/bower_components/core-focusable/core-focusable.html +4 -0
- data/public/bower_components/core-focusable/core-focusable.js +134 -0
- data/public/bower_components/core-focusable/demo.html +109 -0
- data/public/bower_components/core-focusable/polymer-mixin.js +35 -0
- data/public/bower_components/core-header-panel/.bower.json +18 -0
- data/public/bower_components/core-header-panel/README.md +4 -0
- data/public/bower_components/core-header-panel/bower.json +8 -0
- data/public/bower_components/core-header-panel/core-header-panel.css +78 -0
- data/public/bower_components/core-header-panel/core-header-panel.html +277 -0
- data/public/bower_components/core-header-panel/demo.html +100 -0
- data/public/bower_components/core-header-panel/index.html +23 -0
- data/public/bower_components/core-header-panel/metadata.html +37 -0
- data/public/bower_components/core-icon/.bower.json +19 -0
- data/public/bower_components/core-icon/README.md +4 -0
- data/public/bower_components/core-icon/bower.json +9 -0
- data/public/bower_components/core-icon/core-icon.css +16 -0
- data/public/bower_components/core-icon/core-icon.html +201 -0
- data/public/bower_components/core-icon/demo.html +44 -0
- data/public/bower_components/core-icon/index.html +22 -0
- data/public/bower_components/core-icon/metadata.html +21 -0
- data/public/bower_components/core-icon-button/.bower.json +18 -0
- data/public/bower_components/core-icon-button/README.md +4 -0
- data/public/bower_components/core-icon-button/bower.json +8 -0
- data/public/bower_components/core-icon-button/core-icon-button.css +75 -0
- data/public/bower_components/core-icon-button/core-icon-button.html +81 -0
- data/public/bower_components/core-icon-button/demo.html +35 -0
- data/public/bower_components/core-icon-button/index.html +22 -0
- data/public/bower_components/core-icon-button/metadata.html +20 -0
- data/public/bower_components/core-icons/.bower.json +24 -0
- data/public/bower_components/core-icons/.gitignore +2 -0
- data/public/bower_components/core-icons/README.md +8 -0
- data/public/bower_components/core-icons/av-icons.html +65 -0
- data/public/bower_components/core-icons/bower.json +14 -0
- data/public/bower_components/core-icons/communication-icons.html +54 -0
- data/public/bower_components/core-icons/core-icons.html +278 -0
- data/public/bower_components/core-icons/demo.html +98 -0
- data/public/bower_components/core-icons/device-icons.html +90 -0
- data/public/bower_components/core-icons/editor-icons.html +67 -0
- data/public/bower_components/core-icons/hardware-icons.html +56 -0
- data/public/bower_components/core-icons/image-icons.html +152 -0
- data/public/bower_components/core-icons/index.html +22 -0
- data/public/bower_components/core-icons/maps-icons.html +70 -0
- data/public/bower_components/core-icons/notification-icons.html +49 -0
- data/public/bower_components/core-icons/social-icons.html +39 -0
- data/public/bower_components/core-iconset/.bower.json +20 -0
- data/public/bower_components/core-iconset/README.md +4 -0
- data/public/bower_components/core-iconset/bower.json +10 -0
- data/public/bower_components/core-iconset/core-iconset.html +241 -0
- data/public/bower_components/core-iconset/demo.html +62 -0
- data/public/bower_components/core-iconset/index.html +22 -0
- data/public/bower_components/core-iconset/my-icons-big.png +0 -0
- data/public/bower_components/core-iconset/my-icons.png +0 -0
- data/public/bower_components/core-iconset-svg/.bower.json +19 -0
- data/public/bower_components/core-iconset-svg/README.md +4 -0
- data/public/bower_components/core-iconset-svg/bower.json +9 -0
- data/public/bower_components/core-iconset-svg/core-iconset-svg.html +168 -0
- data/public/bower_components/core-iconset-svg/demo.html +66 -0
- data/public/bower_components/core-iconset-svg/index.html +22 -0
- data/public/bower_components/core-iconset-svg/svg-sample-icons.html +68 -0
- data/public/bower_components/core-input/.bower.json +20 -0
- data/public/bower_components/core-input/README.md +2 -0
- data/public/bower_components/core-input/bower.json +10 -0
- data/public/bower_components/core-input/core-input.css +41 -0
- data/public/bower_components/core-input/core-input.html +148 -0
- data/public/bower_components/core-input/demo.html +62 -0
- data/public/bower_components/core-input/index.html +22 -0
- data/public/bower_components/core-input/metadata.html +23 -0
- data/public/bower_components/core-input/test/a11y.html +55 -0
- data/public/bower_components/core-input/test/basic.html +60 -0
- data/public/bower_components/core-input/test/index.html +25 -0
- data/public/bower_components/core-item/.bower.json +19 -0
- data/public/bower_components/core-item/README.md +4 -0
- data/public/bower_components/core-item/bower.json +9 -0
- data/public/bower_components/core-item/core-item.css +45 -0
- data/public/bower_components/core-item/core-item.html +73 -0
- data/public/bower_components/core-item/demo.html +92 -0
- data/public/bower_components/core-item/index.html +22 -0
- data/public/bower_components/core-item/metadata.html +24 -0
- data/public/bower_components/core-media-query/.bower.json +18 -0
- data/public/bower_components/core-media-query/README.md +4 -0
- data/public/bower_components/core-media-query/bower.json +8 -0
- data/public/bower_components/core-media-query/core-media-query.html +87 -0
- data/public/bower_components/core-media-query/demo.html +44 -0
- data/public/bower_components/core-media-query/index.html +22 -0
- data/public/bower_components/core-menu/.bower.json +22 -0
- data/public/bower_components/core-menu/README.md +4 -0
- data/public/bower_components/core-menu/bower.json +11 -0
- data/public/bower_components/core-menu/core-menu.css +18 -0
- data/public/bower_components/core-menu/core-menu.html +73 -0
- data/public/bower_components/core-menu/core-submenu.css +43 -0
- data/public/bower_components/core-menu/core-submenu.html +126 -0
- data/public/bower_components/core-menu/demo.html +101 -0
- data/public/bower_components/core-menu/index.html +22 -0
- data/public/bower_components/core-menu/metadata.html +62 -0
- data/public/bower_components/core-meta/.bower.json +18 -0
- data/public/bower_components/core-meta/README.md +4 -0
- data/public/bower_components/core-meta/bower.json +8 -0
- data/public/bower_components/core-meta/core-meta.html +145 -0
- data/public/bower_components/core-meta/demo.html +58 -0
- data/public/bower_components/core-meta/index.html +22 -0
- data/public/bower_components/core-overlay/.bower.json +20 -0
- data/public/bower_components/core-overlay/README.md +4 -0
- data/public/bower_components/core-overlay/bower.json +10 -0
- data/public/bower_components/core-overlay/core-key-helper.html +22 -0
- data/public/bower_components/core-overlay/core-overlay-layer.html +116 -0
- data/public/bower_components/core-overlay/core-overlay.html +776 -0
- data/public/bower_components/core-overlay/demo.html +155 -0
- data/public/bower_components/core-overlay/gulpfile.js +2 -0
- data/public/bower_components/core-overlay/index.html +22 -0
- data/public/bower_components/core-overlay/tests/html/core-overlay-basic.html +127 -0
- data/public/bower_components/core-overlay/tests/html/core-overlay-positioning-margin.html +153 -0
- data/public/bower_components/core-overlay/tests/html/core-overlay-positioning.html +167 -0
- data/public/bower_components/core-overlay/tests/html/core-overlay-quick-close.html +45 -0
- data/public/bower_components/core-overlay/tests/html/core-overlay-scroll.html +130 -0
- data/public/bower_components/core-overlay/tests/js/htmltests.js +7 -0
- data/public/bower_components/core-overlay/tests/runner.html +14 -0
- data/public/bower_components/core-overlay/tests/tests.json +6 -0
- data/public/bower_components/core-pages/.bower.json +19 -0
- data/public/bower_components/core-pages/README.md +4 -0
- data/public/bower_components/core-pages/bower.json +8 -0
- data/public/bower_components/core-pages/core-pages.css +30 -0
- data/public/bower_components/core-pages/core-pages.html +44 -0
- data/public/bower_components/core-pages/demo.html +136 -0
- data/public/bower_components/core-pages/index.html +22 -0
- data/public/bower_components/core-pages/metadata.html +25 -0
- data/public/bower_components/core-resizable/.bower.json +18 -0
- data/public/bower_components/core-resizable/README.md +4 -0
- data/public/bower_components/core-resizable/bower.json +8 -0
- data/public/bower_components/core-resizable/core-resizable.html +248 -0
- data/public/bower_components/core-resizable/index.html +22 -0
- data/public/bower_components/core-resizable/test/basic.html +504 -0
- data/public/bower_components/core-resizable/test/index.html +16 -0
- data/public/bower_components/core-resizable/test/test-elements.html +66 -0
- data/public/bower_components/core-scaffold/.bower.json +22 -0
- data/public/bower_components/core-scaffold/README.md +4 -0
- data/public/bower_components/core-scaffold/bower.json +11 -0
- data/public/bower_components/core-scaffold/core-scaffold.html +252 -0
- data/public/bower_components/core-scaffold/demo.html +82 -0
- data/public/bower_components/core-scaffold/index.html +22 -0
- data/public/bower_components/core-scaffold/metadata.html +52 -0
- data/public/bower_components/core-selection/.bower.json +21 -0
- data/public/bower_components/core-selection/README.md +4 -0
- data/public/bower_components/core-selection/bower.json +11 -0
- data/public/bower_components/core-selection/core-selection.html +149 -0
- data/public/bower_components/core-selection/demo.html +59 -0
- data/public/bower_components/core-selection/index.html +22 -0
- data/public/bower_components/core-selection/test/basic.html +62 -0
- data/public/bower_components/core-selection/test/index.html +25 -0
- data/public/bower_components/core-selection/test/multi.html +63 -0
- data/public/bower_components/core-selector/.bower.json +22 -0
- data/public/bower_components/core-selector/.gitignore +2 -0
- data/public/bower_components/core-selector/README.md +4 -0
- data/public/bower_components/core-selector/bower.json +12 -0
- data/public/bower_components/core-selector/core-selector.html +548 -0
- data/public/bower_components/core-selector/demo.html +106 -0
- data/public/bower_components/core-selector/index.html +22 -0
- data/public/bower_components/core-selector/metadata.html +20 -0
- data/public/bower_components/core-selector/test/activate-event.html +63 -0
- data/public/bower_components/core-selector/test/basic.html +126 -0
- data/public/bower_components/core-selector/test/content.html +101 -0
- data/public/bower_components/core-selector/test/index.html +30 -0
- data/public/bower_components/core-selector/test/multi.html +115 -0
- data/public/bower_components/core-selector/test/next-previous.html +113 -0
- data/public/bower_components/core-selector/test/selected-attr-prop.html +62 -0
- data/public/bower_components/core-selector/test/template-repeat.html +63 -0
- data/public/bower_components/core-style/.bower.json +18 -0
- data/public/bower_components/core-style/README.md +4 -0
- data/public/bower_components/core-style/bower.json +8 -0
- data/public/bower_components/core-style/core-style.html +387 -0
- data/public/bower_components/core-style/demo.html +58 -0
- data/public/bower_components/core-style/elements.html +55 -0
- data/public/bower_components/core-style/index.html +22 -0
- data/public/bower_components/core-style/my-theme.html +73 -0
- data/public/bower_components/core-toolbar/.bower.json +19 -0
- data/public/bower_components/core-toolbar/README.md +4 -0
- data/public/bower_components/core-toolbar/bower.json +9 -0
- data/public/bower_components/core-toolbar/core-toolbar.css +117 -0
- data/public/bower_components/core-toolbar/core-toolbar.html +155 -0
- data/public/bower_components/core-toolbar/demo.html +119 -0
- data/public/bower_components/core-toolbar/index.html +22 -0
- data/public/bower_components/core-toolbar/metadata.html +28 -0
- data/public/bower_components/core-toolbar/test/basic.html +86 -0
- data/public/bower_components/core-toolbar/test/index.html +24 -0
- data/public/bower_components/core-transition/.bower.json +19 -0
- data/public/bower_components/core-transition/README.md +2 -0
- data/public/bower_components/core-transition/bower.json +9 -0
- data/public/bower_components/core-transition/core-transition-css.html +220 -0
- data/public/bower_components/core-transition/core-transition-overlay.css +46 -0
- data/public/bower_components/core-transition/core-transition.html +140 -0
- data/public/bower_components/core-transition/demo.html +87 -0
- data/public/bower_components/core-transition/index.html +22 -0
- data/public/bower_components/font-roboto/.bower.json +15 -0
- data/public/bower_components/font-roboto/roboto.html +9 -0
- data/public/bower_components/paper-button/.bower.json +27 -0
- data/public/bower_components/paper-button/README.md +4 -0
- data/public/bower_components/paper-button/bower.json +16 -0
- data/public/bower_components/paper-button/demo.html +157 -0
- data/public/bower_components/paper-button/index.html +22 -0
- data/public/bower_components/paper-button/metadata.html +17 -0
- data/public/bower_components/paper-button/paper-button-base.html +164 -0
- data/public/bower_components/paper-button/paper-button.html +197 -0
- data/public/bower_components/paper-button/test/index.html +24 -0
- data/public/bower_components/paper-button/test/paper-button.html +112 -0
- data/public/bower_components/paper-icon-button/.bower.json +25 -0
- data/public/bower_components/paper-icon-button/README.md +4 -0
- data/public/bower_components/paper-icon-button/bower.json +15 -0
- data/public/bower_components/paper-icon-button/demo.html +150 -0
- data/public/bower_components/paper-icon-button/index.html +22 -0
- data/public/bower_components/paper-icon-button/metadata.html +21 -0
- data/public/bower_components/paper-icon-button/paper-icon-button.html +154 -0
- data/public/bower_components/paper-icon-button/test/a11y.html +68 -0
- data/public/bower_components/paper-icon-button/test/basic.html +50 -0
- data/public/bower_components/paper-icon-button/test/index.html +25 -0
- data/public/bower_components/paper-input/.bower.json +26 -0
- data/public/bower_components/paper-input/.gitignore +1 -0
- data/public/bower_components/paper-input/README.md +4 -0
- data/public/bower_components/paper-input/bower.json +15 -0
- data/public/bower_components/paper-input/demo.html +236 -0
- data/public/bower_components/paper-input/index.html +22 -0
- data/public/bower_components/paper-input/metadata.html +20 -0
- data/public/bower_components/paper-input/paper-autogrow-textarea.html +162 -0
- data/public/bower_components/paper-input/paper-char-counter.html +121 -0
- data/public/bower_components/paper-input/paper-input-decorator.css +132 -0
- data/public/bower_components/paper-input/paper-input-decorator.html +547 -0
- data/public/bower_components/paper-input/paper-input.html +145 -0
- data/public/bower_components/paper-input/test/index.html +26 -0
- data/public/bower_components/paper-input/test/paper-autogrow-textarea.html +146 -0
- data/public/bower_components/paper-input/test/paper-input-decorator.html +240 -0
- data/public/bower_components/paper-input/test/paper-input.html +68 -0
- data/public/bower_components/paper-input/test/util.js +15 -0
- data/public/bower_components/paper-radio-button/.bower.json +22 -0
- data/public/bower_components/paper-radio-button/README.md +4 -0
- data/public/bower_components/paper-radio-button/bower.json +12 -0
- data/public/bower_components/paper-radio-button/demo.html +84 -0
- data/public/bower_components/paper-radio-button/index.html +22 -0
- data/public/bower_components/paper-radio-button/metadata.html +17 -0
- data/public/bower_components/paper-radio-button/paper-radio-button.css +108 -0
- data/public/bower_components/paper-radio-button/paper-radio-button.html +166 -0
- data/public/bower_components/paper-ripple/.bower.json +23 -0
- data/public/bower_components/paper-ripple/README.md +4 -0
- data/public/bower_components/paper-ripple/bower.json +13 -0
- data/public/bower_components/paper-ripple/demo.html +414 -0
- data/public/bower_components/paper-ripple/index.html +22 -0
- data/public/bower_components/paper-ripple/metadata.html +20 -0
- data/public/bower_components/paper-ripple/paper-ripple.html +477 -0
- data/public/bower_components/paper-ripple/test/index.html +24 -0
- data/public/bower_components/paper-ripple/test/position.html +109 -0
- data/public/bower_components/paper-shadow/.bower.json +22 -0
- data/public/bower_components/paper-shadow/README.md +4 -0
- data/public/bower_components/paper-shadow/bower.json +11 -0
- data/public/bower_components/paper-shadow/demo.html +134 -0
- data/public/bower_components/paper-shadow/index.html +22 -0
- data/public/bower_components/paper-shadow/metadata.html +17 -0
- data/public/bower_components/paper-shadow/paper-shadow.css +66 -0
- data/public/bower_components/paper-shadow/paper-shadow.html +86 -0
- data/public/bower_components/paper-shadow/test/basic.html +62 -0
- data/public/bower_components/paper-shadow/test/index.html +24 -0
- data/public/bower_components/paper-tabs/.bower.json +26 -0
- data/public/bower_components/paper-tabs/README.md +4 -0
- data/public/bower_components/paper-tabs/bower.json +15 -0
- data/public/bower_components/paper-tabs/demo.html +242 -0
- data/public/bower_components/paper-tabs/index.html +22 -0
- data/public/bower_components/paper-tabs/metadata.html +58 -0
- data/public/bower_components/paper-tabs/paper-tab.css +59 -0
- data/public/bower_components/paper-tabs/paper-tab.html +82 -0
- data/public/bower_components/paper-tabs/paper-tabs.css +80 -0
- data/public/bower_components/paper-tabs/paper-tabs.html +353 -0
- data/public/bower_components/paper-toast/.bower.json +22 -0
- data/public/bower_components/paper-toast/README.md +4 -0
- data/public/bower_components/paper-toast/bower.json +11 -0
- data/public/bower_components/paper-toast/demo.html +63 -0
- data/public/bower_components/paper-toast/index.html +22 -0
- data/public/bower_components/paper-toast/metadata.html +20 -0
- data/public/bower_components/paper-toast/paper-toast.css +80 -0
- data/public/bower_components/paper-toast/paper-toast.html +296 -0
- data/public/bower_components/paper-toggle-button/.bower.json +20 -0
- data/public/bower_components/paper-toggle-button/README.md +4 -0
- data/public/bower_components/paper-toggle-button/bower.json +9 -0
- data/public/bower_components/paper-toggle-button/demo.html +97 -0
- data/public/bower_components/paper-toggle-button/index.html +22 -0
- data/public/bower_components/paper-toggle-button/metadata.html +17 -0
- data/public/bower_components/paper-toggle-button/paper-toggle-button.css +95 -0
- data/public/bower_components/paper-toggle-button/paper-toggle-button.html +179 -0
- data/public/bower_components/polymer/.bower.json +32 -0
- data/public/bower_components/polymer/README.md +21 -0
- data/public/bower_components/polymer/bower.json +23 -0
- data/public/bower_components/polymer/build.log +26 -0
- data/public/bower_components/polymer/layout.html +286 -0
- data/public/bower_components/polymer/polymer.html +12 -0
- data/public/bower_components/polymer/polymer.js +11859 -0
- data/public/bower_components/polymer/polymer.min.js +14 -0
- data/public/bower_components/webcomponentsjs/.bower.json +23 -0
- data/public/bower_components/webcomponentsjs/CustomElements.js +634 -0
- data/public/bower_components/webcomponentsjs/CustomElements.min.js +11 -0
- data/public/bower_components/webcomponentsjs/HTMLImports.js +764 -0
- data/public/bower_components/webcomponentsjs/HTMLImports.min.js +11 -0
- data/public/bower_components/webcomponentsjs/README.md +73 -0
- data/public/bower_components/webcomponentsjs/ShadowDOM.js +4277 -0
- data/public/bower_components/webcomponentsjs/ShadowDOM.min.js +13 -0
- data/public/bower_components/webcomponentsjs/bower.json +14 -0
- data/public/bower_components/webcomponentsjs/build.log +31 -0
- data/public/bower_components/webcomponentsjs/package.json +31 -0
- data/public/bower_components/webcomponentsjs/webcomponents-lite.js +1728 -0
- data/public/bower_components/webcomponentsjs/webcomponents-lite.min.js +11 -0
- data/public/bower_components/webcomponentsjs/webcomponents.js +6114 -0
- data/public/bower_components/webcomponentsjs/webcomponents.min.js +14 -0
- data/public/css/main.css +41 -0
- data/public/elements/ec-dashboard/ec-dashboard.html +269 -0
- data/public/polymer-loader.html +24 -0
- data/public/polymer-loader.vulcanized.html +19 -0
- data/spec/ec/ec_dashboard_spec.rb +78 -0
- data/spec/ec/ec_spec.rb +78 -0
- data/spec/spec_helper.rb +27 -0
- data/views/index.html +88 -0
- metadata +464 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
<!--
|
2
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
+
Code distributed by Google as part of the polymer project is also
|
7
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
+
-->
|
9
|
+
|
10
|
+
<link rel="import" href="../core-icon/core-icon.html">
|
11
|
+
<link rel="import" href="../core-iconset-svg/core-iconset-svg.html">
|
12
|
+
<core-iconset-svg id="social" iconSize="24">
|
13
|
+
<svg><defs>
|
14
|
+
<g id="cake"><path d="M12 6c1.11 0 2-.9 2-2 0-.38-.1-.73-.29-1.03L12 0l-1.71 2.97c-.19.3-.29.65-.29 1.03 0 1.1.9 2 2 2zm4.6 9.99l-1.07-1.07-1.08 1.07c-1.3 1.3-3.58 1.31-4.89 0l-1.07-1.07-1.09 1.07C6.75 16.64 5.88 17 4.96 17c-.73 0-1.4-.23-1.96-.61V21c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-4.61c-.56.38-1.23.61-1.96.61-.92 0-1.79-.36-2.44-1.01zM18 9h-5V7h-2v2H6c-1.66 0-3 1.34-3 3v1.54c0 1.08.88 1.96 1.96 1.96.52 0 1.02-.2 1.38-.57l2.14-2.13 2.13 2.13c.74.74 2.03.74 2.77 0l2.14-2.13 2.13 2.13c.37.37.86.57 1.38.57 1.08 0 1.96-.88 1.96-1.96V12C21 10.34 19.66 9 18 9z"/></g>
|
15
|
+
<g id="domain"><path d="M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"/></g>
|
16
|
+
<g id="group"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></g>
|
17
|
+
<g id="group-add"><path d="M8 10H5V7H3v3H0v2h3v3h2v-3h3v-2zm10 1c1.66 0 2.99-1.34 2.99-3S19.66 5 18 5c-.32 0-.63.05-.91.14.57.81.9 1.79.9 2.86s-.34 2.04-.9 2.86c.28.09.59.14.91.14zm-5 0c1.66 0 2.99-1.34 2.99-3S14.66 5 13 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm6.62 2.16c.83.73 1.38 1.66 1.38 2.84v2h3v-2c0-1.54-2.37-2.49-4.38-2.84zM13 13c-2 0-6 1-6 3v2h12v-2c0-2-4-3-6-3z"/></g>
|
18
|
+
<g id="location-city"><path d="M15 11V5l-3-3-3 3v2H3v14h18V11h-6zm-8 8H5v-2h2v2zm0-4H5v-2h2v2zm0-4H5V9h2v2zm6 8h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V9h2v2zm0-4h-2V5h2v2zm6 12h-2v-2h2v2zm0-4h-2v-2h2v2z"/></g>
|
19
|
+
<g id="mood"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"/></g>
|
20
|
+
<g id="notifications"><path d="M11.5 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6.5-6v-5.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-2.87.68-5 3.25-5 6.32V16l-2 2v1h17v-1l-2-2z"/></g>
|
21
|
+
<g id="notifications-none"><path d="M11.5 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6.5-6v-5.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-2.87.68-5 3.25-5 6.32V16l-2 2v1h17v-1l-2-2zm-2 1H7v-6.5C7 8.01 9.01 6 11.5 6S16 8.01 16 10.5V17z"/></g>
|
22
|
+
<g id="notifications-off"><path d="M11.5 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zM18 10.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-.51.12-.99.32-1.45.56L18 14.18V10.5zm-.27 8.5l2 2L21 19.73 4.27 3 3 4.27l2.92 2.92C5.34 8.16 5 9.29 5 10.5V16l-2 2v1h14.73z"/></g>
|
23
|
+
<g id="notifications-on"><path d="M6.58 3.58L5.15 2.15C2.76 3.97 1.18 6.8 1.03 10h2c.15-2.65 1.51-4.97 3.55-6.42zM19.97 10h2c-.15-3.2-1.73-6.03-4.13-7.85l-1.43 1.43c2.05 1.45 3.41 3.77 3.56 6.42zm-1.97.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-2.87.68-5 3.25-5 6.32V16l-2 2v1h17v-1l-2-2v-5.5zM11.5 22c.14 0 .27-.01.4-.04.65-.13 1.19-.58 1.44-1.18.1-.24.16-.5.16-.78h-4c0 1.1.9 2 2 2z"/></g>
|
24
|
+
<g id="notifications-paused"><path d="M11.5 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6.5-6v-5.5c0-3.07-2.13-5.64-5-6.32V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5v.68c-2.87.68-5 3.25-5 6.32V16l-2 2v1h17v-1l-2-2zm-4-6.2l-2.8 3.4H14V15H9v-1.8l2.8-3.4H9V8h5v1.8z"/></g>
|
25
|
+
<g id="pages"><path d="M3 5v6h5L7 7l4 1V3H5c-1.1 0-2 .9-2 2zm5 8H3v6c0 1.1.9 2 2 2h6v-5l-4 1 1-4zm9 4l-4-1v5h6c1.1 0 2-.9 2-2v-6h-5l1 4zm2-14h-6v5l4-1-1 4h5V5c0-1.1-.9-2-2-2z"/></g>
|
26
|
+
<g id="party-mode"><path d="M20 4h-3.17L15 2H9L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 3c1.63 0 3.06.79 3.98 2H12c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H7.1c-.06-.32-.1-.66-.1-1 0-2.76 2.24-5 5-5zm0 10c-1.63 0-3.06-.79-3.98-2H12c1.66 0 3-1.34 3-3 0-.35-.07-.69-.18-1h2.08c.07.32.1.66.1 1 0 2.76-2.24 5-5 5z"/></g>
|
27
|
+
<g id="people"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></g>
|
28
|
+
<g id="people-outline"><path d="M16.5 13c-1.2 0-3.07.34-4.5 1-1.43-.67-3.3-1-4.5-1C5.33 13 1 14.08 1 16.25V19h22v-2.75c0-2.17-4.33-3.25-6.5-3.25zm-4 4.5h-10v-1.25c0-.54 2.56-1.75 5-1.75s5 1.21 5 1.75v1.25zm9 0H14v-1.25c0-.46-.2-.86-.52-1.22.88-.3 1.96-.53 3.02-.53 2.44 0 5 1.21 5 1.75v1.25zM7.5 12c1.93 0 3.5-1.57 3.5-3.5S9.43 5 7.5 5 4 6.57 4 8.5 5.57 12 7.5 12zm0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 5.5c1.93 0 3.5-1.57 3.5-3.5S18.43 5 16.5 5 13 6.57 13 8.5s1.57 3.5 3.5 3.5zm0-5.5c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2z"/></g>
|
29
|
+
<g id="person"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></g>
|
30
|
+
<g id="person-add"><path d="M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm-9-2V7H4v3H1v2h3v3h2v-3h3v-2H6zm9 4c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></g>
|
31
|
+
<g id="person-outline"><path d="M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z"/></g>
|
32
|
+
<g id="plus-one"><path d="M10 8H8v4H4v2h4v4h2v-4h4v-2h-4zm4.5-1.92V7.9l2.5-.5V18h2V5z"/></g>
|
33
|
+
<g id="poll"><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"/></g>
|
34
|
+
<g id="public"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></g>
|
35
|
+
<g id="school"><path d="M5 13.18v4L12 21l7-3.82v-4L12 17l-7-3.82zM12 3L1 9l11 6 9-4.91V17h2V9L12 3z"/></g>
|
36
|
+
<g id="share"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"/></g>
|
37
|
+
<g id="whatshot"><path d="M13.5.67s.74 2.65.74 4.8c0 2.06-1.35 3.73-3.41 3.73-2.07 0-3.63-1.67-3.63-3.73l.03-.36C5.21 7.51 4 10.62 4 14c0 4.42 3.58 8 8 8s8-3.58 8-8C20 8.61 17.41 3.8 13.5.67zM11.71 19c-1.78 0-3.22-1.4-3.22-3.14 0-1.62 1.05-2.76 2.81-3.12 1.77-.36 3.6-1.21 4.62-2.58.39 1.29.59 2.65.59 4.04 0 2.65-2.15 4.8-4.8 4.8z"/></g>
|
38
|
+
</defs></svg>
|
39
|
+
</core-iconset-svg>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"name": "core-iconset",
|
3
|
+
"private": true,
|
4
|
+
"dependencies": {
|
5
|
+
"polymer": "Polymer/polymer#^0.5",
|
6
|
+
"core-meta": "Polymer/core-meta#^0.5",
|
7
|
+
"core-icon": "Polymer/core-icon#^0.5"
|
8
|
+
},
|
9
|
+
"version": "0.5.5",
|
10
|
+
"homepage": "https://github.com/Polymer/core-iconset",
|
11
|
+
"_release": "0.5.5",
|
12
|
+
"_resolution": {
|
13
|
+
"type": "version",
|
14
|
+
"tag": "0.5.5",
|
15
|
+
"commit": "cbb2b8c90debf31dbfbadf1b821a937b6ca548fc"
|
16
|
+
},
|
17
|
+
"_source": "git://github.com/Polymer/core-iconset.git",
|
18
|
+
"_target": "^0.5",
|
19
|
+
"_originalSource": "Polymer/core-iconset"
|
20
|
+
}
|
@@ -0,0 +1,241 @@
|
|
1
|
+
<!--
|
2
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
+
Code distributed by Google as part of the polymer project is also
|
7
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
+
-->
|
9
|
+
|
10
|
+
<!--
|
11
|
+
/**
|
12
|
+
* @group Polymer Core Elements
|
13
|
+
*
|
14
|
+
* The `core-iconset` element allows users to define their own icon sets.
|
15
|
+
* The `src` property specifies the url of the icon image. Multiple icons may
|
16
|
+
* be included in this image and they may be organized into rows.
|
17
|
+
* The `icons` property is a space separated list of names corresponding to the
|
18
|
+
* icons. The names must be ordered as the icons are ordered in the icon image.
|
19
|
+
* Icons are expected to be square and are the size specified by the `iconSize`
|
20
|
+
* property. The `width` property corresponds to the width of the icon image
|
21
|
+
* and must be specified if icons are arranged into multiple rows in the image.
|
22
|
+
*
|
23
|
+
* All `core-iconset` elements are available for use by other `core-iconset`
|
24
|
+
* elements via a database keyed by id. Typically, an element author that wants
|
25
|
+
* to support a set of custom icons uses a `core-iconset` to retrieve
|
26
|
+
* and use another, user-defined iconset.
|
27
|
+
*
|
28
|
+
* Example:
|
29
|
+
*
|
30
|
+
* <core-iconset id="my-icons" src="my-icons.png" width="96" iconSize="24"
|
31
|
+
* icons="location place starta stopb bus car train walk">
|
32
|
+
* </core-iconset>
|
33
|
+
*
|
34
|
+
* This will automatically register the icon set "my-icons" to the iconset
|
35
|
+
* database. To use these icons from within another element, make a
|
36
|
+
* `core-iconset` element and call the `byId` method to retrieve a
|
37
|
+
* given iconset. To apply a particular icon to an element, use the
|
38
|
+
* `applyIcon` method. For example:
|
39
|
+
*
|
40
|
+
* iconset.applyIcon(iconNode, 'car');
|
41
|
+
*
|
42
|
+
* Themed icon sets are also supported. The `core-iconset` can contain child
|
43
|
+
* `property` elements that specify a theme with an offsetX and offsetY of the
|
44
|
+
* theme within the icon resource. For example.
|
45
|
+
*
|
46
|
+
* <core-iconset id="my-icons" src="my-icons.png" width="96" iconSize="24"
|
47
|
+
* icons="location place starta stopb bus car train walk">
|
48
|
+
* <property theme="special" offsetX="256" offsetY="24"></property>
|
49
|
+
* </core-iconset>
|
50
|
+
*
|
51
|
+
* Then a themed icon can be applied like this:
|
52
|
+
*
|
53
|
+
* iconset.applyIcon(iconNode, 'car', 'special');
|
54
|
+
*
|
55
|
+
* @element core-iconset
|
56
|
+
* @extends core-meta
|
57
|
+
* @homepage github.io
|
58
|
+
*/
|
59
|
+
-->
|
60
|
+
|
61
|
+
<link rel="import" href="../core-meta/core-meta.html">
|
62
|
+
|
63
|
+
<polymer-element name="core-iconset" extends="core-meta" attributes="src width icons iconSize">
|
64
|
+
|
65
|
+
<script>
|
66
|
+
|
67
|
+
Polymer('core-iconset', {
|
68
|
+
|
69
|
+
/**
|
70
|
+
* The URL of the iconset image.
|
71
|
+
*
|
72
|
+
* @attribute src
|
73
|
+
* @type string
|
74
|
+
* @default ''
|
75
|
+
*/
|
76
|
+
src: '',
|
77
|
+
|
78
|
+
/**
|
79
|
+
* The width of the iconset image. This must only be specified if the
|
80
|
+
* icons are arranged into separate rows inside the image.
|
81
|
+
*
|
82
|
+
* @attribute width
|
83
|
+
* @type number
|
84
|
+
* @default 0
|
85
|
+
*/
|
86
|
+
width: 0,
|
87
|
+
|
88
|
+
/**
|
89
|
+
* A space separated list of names corresponding to icons in the iconset
|
90
|
+
* image file. This list must be ordered the same as the icon images
|
91
|
+
* in the image file.
|
92
|
+
*
|
93
|
+
* @attribute icons
|
94
|
+
* @type string
|
95
|
+
* @default ''
|
96
|
+
*/
|
97
|
+
icons: '',
|
98
|
+
|
99
|
+
/**
|
100
|
+
* The size of an individual icon. Note that icons must be square.
|
101
|
+
*
|
102
|
+
* @attribute iconSize
|
103
|
+
* @type number
|
104
|
+
* @default 24
|
105
|
+
*/
|
106
|
+
iconSize: 24,
|
107
|
+
|
108
|
+
/**
|
109
|
+
* The horizontal offset of the icon images in the inconset src image.
|
110
|
+
* This is typically used if the image resource contains additional images
|
111
|
+
* beside those intended for the iconset.
|
112
|
+
*
|
113
|
+
* @attribute offsetX
|
114
|
+
* @type number
|
115
|
+
* @default 0
|
116
|
+
*/
|
117
|
+
offsetX: 0,
|
118
|
+
/**
|
119
|
+
* The vertical offset of the icon images in the inconset src image.
|
120
|
+
* This is typically used if the image resource contains additional images
|
121
|
+
* beside those intended for the iconset.
|
122
|
+
*
|
123
|
+
* @attribute offsetY
|
124
|
+
* @type number
|
125
|
+
* @default 0
|
126
|
+
*/
|
127
|
+
offsetY: 0,
|
128
|
+
type: 'iconset',
|
129
|
+
|
130
|
+
created: function() {
|
131
|
+
this.iconMap = {};
|
132
|
+
this.iconNames = [];
|
133
|
+
this.themes = {};
|
134
|
+
},
|
135
|
+
|
136
|
+
ready: function() {
|
137
|
+
// TODO(sorvell): ensure iconset's src is always relative to the main
|
138
|
+
// document
|
139
|
+
if (this.src && (this.ownerDocument !== document)) {
|
140
|
+
this.src = this.resolvePath(this.src, this.ownerDocument.baseURI);
|
141
|
+
}
|
142
|
+
this.super();
|
143
|
+
this.updateThemes();
|
144
|
+
},
|
145
|
+
|
146
|
+
iconsChanged: function() {
|
147
|
+
var ox = this.offsetX;
|
148
|
+
var oy = this.offsetY;
|
149
|
+
this.icons && this.icons.split(/\s+/g).forEach(function(name, i) {
|
150
|
+
this.iconNames.push(name);
|
151
|
+
this.iconMap[name] = {
|
152
|
+
offsetX: ox,
|
153
|
+
offsetY: oy
|
154
|
+
}
|
155
|
+
if (ox + this.iconSize < this.width) {
|
156
|
+
ox += this.iconSize;
|
157
|
+
} else {
|
158
|
+
ox = this.offsetX;
|
159
|
+
oy += this.iconSize;
|
160
|
+
}
|
161
|
+
}, this);
|
162
|
+
},
|
163
|
+
|
164
|
+
updateThemes: function() {
|
165
|
+
var ts = this.querySelectorAll('property[theme]');
|
166
|
+
ts && ts.array().forEach(function(t) {
|
167
|
+
this.themes[t.getAttribute('theme')] = {
|
168
|
+
offsetX: parseInt(t.getAttribute('offsetX')) || 0,
|
169
|
+
offsetY: parseInt(t.getAttribute('offsetY')) || 0
|
170
|
+
};
|
171
|
+
}, this);
|
172
|
+
},
|
173
|
+
|
174
|
+
// TODO(ffu): support retrived by index e.g. getOffset(10);
|
175
|
+
/**
|
176
|
+
* Returns an object containing `offsetX` and `offsetY` properties which
|
177
|
+
* specify the pixel locaion in the iconset's src file for the given
|
178
|
+
* `icon` and `theme`. It's uncommon to call this method. It is useful,
|
179
|
+
* for example, to manually position a css backgroundImage to the proper
|
180
|
+
* offset. It's more common to use the `applyIcon` method.
|
181
|
+
*
|
182
|
+
* @method getOffset
|
183
|
+
* @param {String|Number} icon The name of the icon or the index of the
|
184
|
+
* icon within in the icon image.
|
185
|
+
* @param {String} theme The name of the theme.
|
186
|
+
* @returns {Object} An object specifying the offset of the given icon
|
187
|
+
* within the icon resource file; `offsetX` is the horizontal offset and
|
188
|
+
* `offsetY` is the vertical offset. Both values are in pixel units.
|
189
|
+
*/
|
190
|
+
getOffset: function(icon, theme) {
|
191
|
+
var i = this.iconMap[icon];
|
192
|
+
if (!i) {
|
193
|
+
var n = this.iconNames[Number(icon)];
|
194
|
+
i = this.iconMap[n];
|
195
|
+
}
|
196
|
+
var t = this.themes[theme];
|
197
|
+
if (i && t) {
|
198
|
+
return {
|
199
|
+
offsetX: i.offsetX + t.offsetX,
|
200
|
+
offsetY: i.offsetY + t.offsetY
|
201
|
+
}
|
202
|
+
}
|
203
|
+
return i;
|
204
|
+
},
|
205
|
+
|
206
|
+
/**
|
207
|
+
* Applies an icon to the given element as a css background image. This
|
208
|
+
* method does not size the element, and it's often necessary to set
|
209
|
+
* the element's height and width so that the background image is visible.
|
210
|
+
*
|
211
|
+
* @method applyIcon
|
212
|
+
* @param {Element} element The element to which the background is
|
213
|
+
* applied.
|
214
|
+
* @param {String|Number} icon The name or index of the icon to apply.
|
215
|
+
* @param {Number} scale (optional, defaults to 1) A scaling factor
|
216
|
+
* with which the icon can be magnified.
|
217
|
+
* @return {Element} The icon element.
|
218
|
+
*/
|
219
|
+
applyIcon: function(element, icon, scale) {
|
220
|
+
var offset = this.getOffset(icon);
|
221
|
+
scale = scale || 1;
|
222
|
+
if (element && offset) {
|
223
|
+
var icon = element._icon || document.createElement('div');
|
224
|
+
var style = icon.style;
|
225
|
+
style.backgroundImage = 'url(' + this.src + ')';
|
226
|
+
style.backgroundPosition = (-offset.offsetX * scale + 'px') +
|
227
|
+
' ' + (-offset.offsetY * scale + 'px');
|
228
|
+
style.backgroundSize = scale === 1 ? 'auto' :
|
229
|
+
this.width * scale + 'px';
|
230
|
+
if (icon.parentNode !== element) {
|
231
|
+
element.appendChild(icon);
|
232
|
+
}
|
233
|
+
return icon;
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
});
|
238
|
+
|
239
|
+
</script>
|
240
|
+
|
241
|
+
</polymer-element>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<!--
|
3
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
4
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
5
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
6
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
7
|
+
Code distributed by Google as part of the polymer project is also
|
8
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
|
+
-->
|
10
|
+
|
11
|
+
<html>
|
12
|
+
<head>
|
13
|
+
|
14
|
+
<title>core-iconset</title>
|
15
|
+
|
16
|
+
<script src="../webcomponentsjs/webcomponents.js"></script>
|
17
|
+
<link rel="import" href="core-iconset.html">
|
18
|
+
<link rel="import" href="../core-icon/core-icon.html">
|
19
|
+
|
20
|
+
</head>
|
21
|
+
<body unresolved>
|
22
|
+
|
23
|
+
<!-- Register an icon set; you can do this anywhere, including an HTMLImport! -->
|
24
|
+
<core-iconset id="my-icons" src="my-icons.png" width="96" iconSize="24"
|
25
|
+
icons="location place starta stopb bus car train walk">
|
26
|
+
</core-iconset>
|
27
|
+
|
28
|
+
<core-iconset id="my-icons-big" src="my-icons-big.png" width="192" iconSize="48"
|
29
|
+
icons="location place starta stopb bus car train walk">
|
30
|
+
</core-iconset>
|
31
|
+
|
32
|
+
<!-- Now create a bunch of icons using our iconset -->
|
33
|
+
<core-icon icon="my-icons:location"></core-icon>
|
34
|
+
<core-icon icon="my-icons:place"></core-icon>
|
35
|
+
<core-icon icon="my-icons:starta"></core-icon>
|
36
|
+
<core-icon icon="my-icons:stopb"></core-icon>
|
37
|
+
<core-icon icon="my-icons:bus"></core-icon>
|
38
|
+
<core-icon icon="my-icons:car"></core-icon>
|
39
|
+
<core-icon icon="my-icons:train"></core-icon>
|
40
|
+
<core-icon icon="my-icons:walk"></core-icon>
|
41
|
+
<br>
|
42
|
+
<!-- icons may also be specified by index -->
|
43
|
+
<style>
|
44
|
+
.embiggen core-icon {
|
45
|
+
width: 48px;
|
46
|
+
height: 48px;
|
47
|
+
}
|
48
|
+
</style>
|
49
|
+
|
50
|
+
<div class="embiggen">
|
51
|
+
<core-icon icon="my-icons-big:0"></core-icon>
|
52
|
+
<core-icon icon="my-icons-big:1"></core-icon>
|
53
|
+
<core-icon icon="my-icons-big:2"></core-icon>
|
54
|
+
<core-icon icon="my-icons-big:3"></core-icon>
|
55
|
+
<core-icon icon="my-icons-big:4"></core-icon>
|
56
|
+
<core-icon icon="my-icons-big:5"></core-icon>
|
57
|
+
<core-icon icon="my-icons-big:6"></core-icon>
|
58
|
+
<core-icon icon="my-icons-big:7"></core-icon>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
</body>
|
62
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<!--
|
3
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
4
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
|
5
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
6
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
7
|
+
Code distributed by Google as part of the polymer project is also
|
8
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
|
9
|
+
-->
|
10
|
+
<html>
|
11
|
+
<head>
|
12
|
+
|
13
|
+
<script src="../webcomponentsjs/webcomponents.js"></script>
|
14
|
+
<link rel="import" href="../core-component-page/core-component-page.html">
|
15
|
+
|
16
|
+
</head>
|
17
|
+
<body unresolved>
|
18
|
+
|
19
|
+
<core-component-page></core-component-page>
|
20
|
+
|
21
|
+
</body>
|
22
|
+
</html>
|
Binary file
|
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"name": "core-iconset-svg",
|
3
|
+
"private": true,
|
4
|
+
"dependencies": {
|
5
|
+
"polymer": "Polymer/polymer#^0.5",
|
6
|
+
"core-iconset": "Polymer/core-iconset#^0.5"
|
7
|
+
},
|
8
|
+
"version": "0.5.5",
|
9
|
+
"homepage": "https://github.com/Polymer/core-iconset-svg",
|
10
|
+
"_release": "0.5.5",
|
11
|
+
"_resolution": {
|
12
|
+
"type": "version",
|
13
|
+
"tag": "0.5.5",
|
14
|
+
"commit": "1cdadf517382c2db9ee2d2abf43a486a8513f760"
|
15
|
+
},
|
16
|
+
"_source": "git://github.com/Polymer/core-iconset-svg.git",
|
17
|
+
"_target": "^0.5",
|
18
|
+
"_originalSource": "Polymer/core-iconset-svg"
|
19
|
+
}
|
@@ -0,0 +1,168 @@
|
|
1
|
+
<!--
|
2
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
3
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
4
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
5
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
6
|
+
Code distributed by Google as part of the polymer project is also
|
7
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
8
|
+
-->
|
9
|
+
|
10
|
+
<!--
|
11
|
+
/**
|
12
|
+
* @group Polymer Core Elements
|
13
|
+
*
|
14
|
+
* The `core-iconset-svg` element allows users to define their own icon sets
|
15
|
+
* that contain svg icons. The svg icon elements should be children of the
|
16
|
+
* `core-iconset-svg` element. Multiple icons should be given distinct id's.
|
17
|
+
*
|
18
|
+
* Using svg elements to create icons has a few advantages over traditional
|
19
|
+
* bitmap graphics like jpg or png. Icons that use svg are vector based so they
|
20
|
+
* are resolution independent and should look good on any device. They are
|
21
|
+
* stylable via css. Icons can be themed, colorized, and even animated.
|
22
|
+
*
|
23
|
+
* Example:
|
24
|
+
*
|
25
|
+
* <core-iconset-svg id="my-svg-icons" iconSize="24">
|
26
|
+
* <svg>
|
27
|
+
* <defs>
|
28
|
+
* <g id="shape">
|
29
|
+
* <rect x="50" y="50" width="50" height="50" />
|
30
|
+
* <circle cx="50" cy="50" r="50" />
|
31
|
+
* </g>
|
32
|
+
* </defs>
|
33
|
+
* </svg>
|
34
|
+
* </core-iconset-svg>
|
35
|
+
*
|
36
|
+
* This will automatically register the icon set "my-svg-icons" to the iconset
|
37
|
+
* database. To use these icons from within another element, make a
|
38
|
+
* `core-iconset` element and call the `byId` method
|
39
|
+
* to retrieve a given iconset. To apply a particular icon inside an
|
40
|
+
* element use the `applyIcon` method. For example:
|
41
|
+
*
|
42
|
+
* iconset.applyIcon(iconNode, 'car');
|
43
|
+
*
|
44
|
+
* @element core-iconset-svg
|
45
|
+
* @extends core-meta
|
46
|
+
* @homepage github.io
|
47
|
+
*/
|
48
|
+
-->
|
49
|
+
|
50
|
+
<link rel="import" href="../core-iconset/core-iconset.html">
|
51
|
+
|
52
|
+
<polymer-element name="core-iconset-svg" extends="core-meta" attributes="iconSize">
|
53
|
+
|
54
|
+
<script>
|
55
|
+
|
56
|
+
Polymer('core-iconset-svg', {
|
57
|
+
|
58
|
+
|
59
|
+
/**
|
60
|
+
* The size of an individual icon. Note that icons must be square.
|
61
|
+
*
|
62
|
+
* @attribute iconSize
|
63
|
+
* @type number
|
64
|
+
* @default 24
|
65
|
+
*/
|
66
|
+
iconSize: 24,
|
67
|
+
type: 'iconset',
|
68
|
+
|
69
|
+
created: function() {
|
70
|
+
this._icons = {};
|
71
|
+
},
|
72
|
+
|
73
|
+
ready: function() {
|
74
|
+
this.super();
|
75
|
+
this.updateIcons();
|
76
|
+
},
|
77
|
+
|
78
|
+
iconById: function(id) {
|
79
|
+
return this._icons[id] || (this._icons[id] = this.querySelector('[id="' + id +'"]'));
|
80
|
+
},
|
81
|
+
|
82
|
+
cloneIcon: function(id) {
|
83
|
+
var icon = this.iconById(id);
|
84
|
+
if (icon) {
|
85
|
+
var content = icon.cloneNode(true);
|
86
|
+
content.removeAttribute('id');
|
87
|
+
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
88
|
+
svg.setAttribute('viewBox', '0 0 ' + this.iconSize + ' ' +
|
89
|
+
this.iconSize);
|
90
|
+
// NOTE(dfreedm): work around https://crbug.com/370136
|
91
|
+
svg.style.pointerEvents = 'none';
|
92
|
+
svg.appendChild(content);
|
93
|
+
return svg;
|
94
|
+
}
|
95
|
+
},
|
96
|
+
|
97
|
+
get iconNames() {
|
98
|
+
if (!this._iconNames) {
|
99
|
+
this._iconNames = this.findIconNames();
|
100
|
+
}
|
101
|
+
return this._iconNames;
|
102
|
+
},
|
103
|
+
|
104
|
+
findIconNames: function() {
|
105
|
+
var icons = this.querySelectorAll('[id]').array();
|
106
|
+
if (icons.length) {
|
107
|
+
return icons.map(function(n){ return n.id });
|
108
|
+
}
|
109
|
+
},
|
110
|
+
|
111
|
+
/**
|
112
|
+
* Applies an icon to the given element. The svg icon is added to the
|
113
|
+
* element's shadowRoot if one exists or directly to itself.
|
114
|
+
*
|
115
|
+
* @method applyIcon
|
116
|
+
* @param {Element} element The element to which the icon is
|
117
|
+
* applied.
|
118
|
+
* @param {String|Number} icon The name the icon to apply.
|
119
|
+
* @return {Element} The icon element
|
120
|
+
*/
|
121
|
+
applyIcon: function(element, icon) {
|
122
|
+
var root = element;
|
123
|
+
// remove old
|
124
|
+
var old = root.querySelector('svg');
|
125
|
+
if (old) {
|
126
|
+
old.remove();
|
127
|
+
}
|
128
|
+
// install new
|
129
|
+
var svg = this.cloneIcon(icon);
|
130
|
+
if (!svg) {
|
131
|
+
return;
|
132
|
+
}
|
133
|
+
svg.setAttribute('height', '100%');
|
134
|
+
svg.setAttribute('width', '100%');
|
135
|
+
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
|
136
|
+
svg.style.display = 'block';
|
137
|
+
root.insertBefore(svg, root.firstElementChild);
|
138
|
+
return svg;
|
139
|
+
},
|
140
|
+
|
141
|
+
/**
|
142
|
+
* Tell users of the iconset, that the set has loaded.
|
143
|
+
* This finds all elements matching the selector argument and calls
|
144
|
+
* the method argument on them.
|
145
|
+
* @method updateIcons
|
146
|
+
* @param selector {string} css selector to identify iconset users,
|
147
|
+
* defaults to '[icon]'
|
148
|
+
* @param method {string} method to call on found elements,
|
149
|
+
* defaults to 'updateIcon'
|
150
|
+
*/
|
151
|
+
updateIcons: function(selector, method) {
|
152
|
+
selector = selector || '[icon]';
|
153
|
+
method = method || 'updateIcon';
|
154
|
+
var deep = window.ShadowDOMPolyfill ? '' : 'html /deep/ ';
|
155
|
+
var i$ = document.querySelectorAll(deep + selector);
|
156
|
+
for (var i=0, e; e=i$[i]; i++) {
|
157
|
+
if (e[method]) {
|
158
|
+
e[method].call(e);
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
|
164
|
+
});
|
165
|
+
|
166
|
+
</script>
|
167
|
+
|
168
|
+
</polymer-element>
|