Commit f748e9cf4da73cc932099c4818f77a25a5f9188d
1 parent
b9dd9495
new controllet and update
Showing
270 changed files
with
11004 additions
and
1411 deletions
Too many changes.
To preserve performance only 100 of 270 files are displayed.
bower_components/google-map/.bower.json
1 | 1 | { |
2 | 2 | "name": "google-map", |
3 | - "version": "1.1.4", | |
3 | + "version": "1.1.5", | |
4 | 4 | "description": "Google Maps web components", |
5 | 5 | "homepage": "https://elements.polymer-project.org/elements/google-map", |
6 | 6 | "main": [ |
... | ... | @@ -37,11 +37,11 @@ |
37 | 37 | "web-component-tester": "*", |
38 | 38 | "iron-component-page": "PolymerElements/iron-component-page#^1.0.2" |
39 | 39 | }, |
40 | - "_release": "1.1.4", | |
40 | + "_release": "1.1.5", | |
41 | 41 | "_resolution": { |
42 | 42 | "type": "version", |
43 | - "tag": "1.1.4", | |
44 | - "commit": "571392000956d93dddd9e2f6d3eb9593a588f5f0" | |
43 | + "tag": "1.1.5", | |
44 | + "commit": "3ff5c11d7aa90874d7f0ac75e076f512981ffd26" | |
45 | 45 | }, |
46 | 46 | "_source": "git://github.com/GoogleWebComponents/google-map.git", |
47 | 47 | "_target": "^1.0.0", | ... | ... |
bower_components/google-map/bower.json
bower_components/google-map/google-map.html
... | ... | @@ -330,6 +330,11 @@ The `google-map` element renders a Google Map. |
330 | 330 | * Use to specify additional options we do not expose as |
331 | 331 | * properties. |
332 | 332 | * Ex: `<google-map additional-map-options='{"mapTypeId":"satellite"}'>` |
333 | + * | |
334 | + * Note, you can't use API enums like `google.maps.ControlPosition.TOP_RIGHT` | |
335 | + * when using this property as an HTML attribute. Instead, use the actual | |
336 | + * value (e.g. `3`) or set `.additionalMapOptions` in JS rather than using | |
337 | + * the attribute. | |
333 | 338 | */ |
334 | 339 | additionalMapOptions: { |
335 | 340 | type: Object, | ... | ... |
bower_components/iron-a11y-keys-behavior/.bower.json
1 | 1 | { |
2 | 2 | "name": "iron-a11y-keys-behavior", |
3 | - "version": "1.0.7", | |
3 | + "version": "1.0.8", | |
4 | 4 | "description": "A behavior that enables keybindings for greater a11y.", |
5 | 5 | "keywords": [ |
6 | 6 | "web-components", |
... | ... | @@ -30,11 +30,11 @@ |
30 | 30 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" |
31 | 31 | }, |
32 | 32 | "homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior", |
33 | - "_release": "1.0.7", | |
33 | + "_release": "1.0.8", | |
34 | 34 | "_resolution": { |
35 | 35 | "type": "version", |
36 | - "tag": "v1.0.7", | |
37 | - "commit": "4dfdd8cca76eabe12245e86deb9d5da3cd717460" | |
36 | + "tag": "v1.0.8", | |
37 | + "commit": "df29a9edcff3b4693707f1e3eebce5a1dc46e946" | |
38 | 38 | }, |
39 | 39 | "_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git", |
40 | 40 | "_target": "^1.0.0", | ... | ... |
bower_components/iron-a11y-keys-behavior/bower.json
bower_components/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html
... | ... | @@ -424,10 +424,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
424 | 424 | _triggerKeyHandler: function(keyCombo, handlerName, keyboardEvent) { |
425 | 425 | var detail = Object.create(keyCombo); |
426 | 426 | detail.keyboardEvent = keyboardEvent; |
427 | - | |
428 | - this[handlerName].call(this, new CustomEvent(keyCombo.event, { | |
429 | - detail: detail | |
430 | - })); | |
427 | + var event = new CustomEvent(keyCombo.event, { | |
428 | + detail: detail, | |
429 | + cancelable: true | |
430 | + }); | |
431 | + this[handlerName].call(this, event); | |
432 | + if (event.defaultPrevented) { | |
433 | + keyboardEvent.preventDefault(); | |
434 | + } | |
431 | 435 | } |
432 | 436 | }; |
433 | 437 | })(); | ... | ... |
bower_components/iron-a11y-keys-behavior/test/basic-test.html
... | ... | @@ -70,6 +70,9 @@ suite('Polymer.IronA11yKeysBehavior', function() { |
70 | 70 | _keyHandler: function(event) { |
71 | 71 | this.keyCount++; |
72 | 72 | this.lastEvent = event; |
73 | + }, | |
74 | + _preventDefaultHandler: function(event) { | |
75 | + event.preventDefault(); | |
73 | 76 | } |
74 | 77 | }]; |
75 | 78 | |
... | ... | @@ -124,7 +127,8 @@ suite('Polymer.IronA11yKeysBehavior', function() { |
124 | 127 | ], |
125 | 128 | |
126 | 129 | keyBindings: { |
127 | - 'space': '_keyHandler' | |
130 | + 'space': '_keyHandler', | |
131 | + 'enter': '_preventDefaultHandler' | |
128 | 132 | } |
129 | 133 | }); |
130 | 134 | }); |
... | ... | @@ -273,6 +277,21 @@ suite('Polymer.IronA11yKeysBehavior', function() { |
273 | 277 | }); |
274 | 278 | }); |
275 | 279 | |
280 | + suite('prevent default behavior of event', function() { | |
281 | + setup(function() { | |
282 | + keys = fixture('BehaviorKeys'); | |
283 | + }); | |
284 | + test('defaultPrevented is correctly set', function() { | |
285 | + var keySpy = sinon.spy(); | |
286 | + | |
287 | + document.addEventListener('keydown', keySpy); | |
288 | + | |
289 | + MockInteractions.pressEnter(keys); | |
290 | + | |
291 | + expect(keySpy.getCall(0).args[0].defaultPrevented).to.be.equal(true); | |
292 | + }); | |
293 | + }); | |
294 | + | |
276 | 295 | }); |
277 | 296 | </script> |
278 | 297 | </body> | ... | ... |
bower_components/iron-ajax/.bower.json
1 | 1 | { |
2 | 2 | "name": "iron-ajax", |
3 | - "version": "1.0.6", | |
3 | + "version": "1.0.7", | |
4 | 4 | "description": "Makes it easy to make ajax calls and parse the response", |
5 | 5 | "private": true, |
6 | 6 | "authors": [ |
... | ... | @@ -32,11 +32,11 @@ |
32 | 32 | "web-component-tester": "*", |
33 | 33 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" |
34 | 34 | }, |
35 | - "_release": "1.0.6", | |
35 | + "_release": "1.0.7", | |
36 | 36 | "_resolution": { |
37 | 37 | "type": "version", |
38 | - "tag": "v1.0.6", | |
39 | - "commit": "72f463a166013e12880bb881d680adf386520c49" | |
38 | + "tag": "v1.0.7", | |
39 | + "commit": "dc3dda81a963e9fd788ed69ed350c5f4cf84d857" | |
40 | 40 | }, |
41 | 41 | "_source": "git://github.com/PolymerElements/iron-ajax.git", |
42 | 42 | "_target": "^1.0.0", | ... | ... |
bower_components/iron-ajax/bower.json
bower_components/iron-ajax/iron-ajax.html
... | ... | @@ -69,8 +69,7 @@ element. |
69 | 69 | * The URL target of the request. |
70 | 70 | */ |
71 | 71 | url: { |
72 | - type: String, | |
73 | - value: '' | |
72 | + type: String | |
74 | 73 | }, |
75 | 74 | |
76 | 75 | /** |
... | ... | @@ -242,6 +241,8 @@ element. |
242 | 241 | * |
243 | 242 | * The type of the response is determined by the value of `handleAs` at |
244 | 243 | * the time that the request was generated. |
244 | + * | |
245 | + * @type {Object} | |
245 | 246 | */ |
246 | 247 | lastResponse: { |
247 | 248 | type: Object, |
... | ... | @@ -251,6 +252,8 @@ element. |
251 | 252 | |
252 | 253 | /** |
253 | 254 | * lastRequest's error, if any. |
255 | + * | |
256 | + * @type {Object} | |
254 | 257 | */ |
255 | 258 | lastError: { |
256 | 259 | type: Object, |
... | ... | @@ -353,13 +356,15 @@ element. |
353 | 356 | contentType = 'application/x-www-form-urlencoded'; |
354 | 357 | } |
355 | 358 | if (contentType) { |
356 | - headers['Content-Type'] = contentType; | |
359 | + headers['content-type'] = contentType; | |
357 | 360 | } |
358 | 361 | var header; |
359 | 362 | |
360 | 363 | if (this.headers instanceof Object) { |
361 | 364 | for (header in this.headers) { |
362 | - headers[header] = this.headers[header].toString(); | |
365 | + // Normalize headers in lower case to make it easier for iron-request | |
366 | + // to reason about them. | |
367 | + headers[header.toLowerCase()] = this.headers[header].toString(); | |
363 | 368 | } |
364 | 369 | } |
365 | 370 | |
... | ... | @@ -381,7 +386,7 @@ element. |
381 | 386 | */ |
382 | 387 | toRequestOptions: function() { |
383 | 388 | return { |
384 | - url: this.requestUrl, | |
389 | + url: this.requestUrl || '', | |
385 | 390 | method: this.method, |
386 | 391 | headers: this.requestHeaders, |
387 | 392 | body: this.body, |
... | ... | @@ -462,7 +467,7 @@ element. |
462 | 467 | |
463 | 468 | _requestOptionsChanged: function() { |
464 | 469 | this.debounce('generate-request', function() { |
465 | - if (!this.url && this.url !== '') { | |
470 | + if (this.url == null) { | |
466 | 471 | return; |
467 | 472 | } |
468 | 473 | ... | ... |
bower_components/iron-ajax/iron-request.html
... | ... | @@ -183,7 +183,7 @@ iron-request can be used to perform XMLHttpRequests. |
183 | 183 | * async By default, all requests are sent asynchronously. To send synchronous requests, |
184 | 184 | * set to true. |
185 | 185 | * body The content for the request body for POST method. |
186 | - * headers HTTP request headers. | |
186 | + * headers HTTP request headers. All keys must be lower case. | |
187 | 187 | * handleAs The response type. Default is 'text'. |
188 | 188 | * withCredentials Whether or not to send credentials on the request. Default is false. |
189 | 189 | * timeout: (Number|undefined) |
... | ... | @@ -241,20 +241,28 @@ iron-request can be used to perform XMLHttpRequests. |
241 | 241 | options.async !== false |
242 | 242 | ); |
243 | 243 | |
244 | - if (options.headers) { | |
245 | - Object.keys(options.headers).forEach(function (requestHeader) { | |
246 | - xhr.setRequestHeader( | |
247 | - requestHeader, | |
248 | - options.headers[requestHeader] | |
249 | - ); | |
250 | - }, this); | |
244 | + var acceptType = { | |
245 | + 'json': 'application/json', | |
246 | + 'text': 'text/plain', | |
247 | + 'html': 'text/html', | |
248 | + 'xml': 'application/xml', | |
249 | + 'arraybuffer': 'application/octet-stream' | |
250 | + }[options.handleAs]; | |
251 | + var headers = options.headers || {}; | |
252 | + if (acceptType && !headers['accept']) { | |
253 | + headers['accept'] = acceptType; | |
251 | 254 | } |
255 | + Object.keys(headers).forEach(function (requestHeader) { | |
256 | + if (/[A-Z]/.test(requestHeader)) { | |
257 | + console.error('Headers must be lower case, got', requestHeader); | |
258 | + } | |
259 | + xhr.setRequestHeader( | |
260 | + requestHeader, | |
261 | + headers[requestHeader] | |
262 | + ); | |
263 | + }, this); | |
252 | 264 | |
253 | - var contentType; | |
254 | - if (options.headers) { | |
255 | - contentType = options.headers['Content-Type']; | |
256 | - } | |
257 | - var body = this._encodeBodyObject(options.body, contentType); | |
265 | + var body = this._encodeBodyObject(options.body, headers['content-type']); | |
258 | 266 | |
259 | 267 | // In IE, `xhr.responseType` is an empty string when the response |
260 | 268 | // returns. Hence, caching it as `xhr._responseType`. | ... | ... |
bower_components/iron-ajax/test/iron-ajax.html
... | ... | @@ -55,6 +55,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
55 | 55 | debounce-duration="150"></iron-ajax> |
56 | 56 | </template> |
57 | 57 | </test-fixture> |
58 | + <test-fixture id='BlankUrl'> | |
59 | + <template> | |
60 | + <iron-ajax auto handle-as='text'></iron-ajax> | |
61 | + </template> | |
62 | + </test-fixture> | |
58 | 63 | <!-- note(rictic): |
59 | 64 | This makes us dependent on a third-party server, but we need to be able |
60 | 65 | to check what headers the browser actually sends on the wire. |
... | ... | @@ -197,6 +202,30 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
197 | 202 | }); |
198 | 203 | }); |
199 | 204 | |
205 | + suite('when url isn\'t set yet', function() { | |
206 | + test('we don\'t fire any automatic requests', function() { | |
207 | + expect(server.requests.length).to.be.equal(0); | |
208 | + ajax = fixture('BlankUrl'); | |
209 | + | |
210 | + return timePasses(1).then(function() { | |
211 | + // We don't make any requests. | |
212 | + expect(server.requests.length).to.be.equal(0); | |
213 | + | |
214 | + // Explicitly asking for the request to fire works. | |
215 | + ajax.generateRequest(); | |
216 | + expect(server.requests.length).to.be.equal(1); | |
217 | + server.requests = []; | |
218 | + | |
219 | + // Explicitly setting url to '' works too. | |
220 | + ajax = fixture('BlankUrl'); | |
221 | + ajax.url = ''; | |
222 | + return timePasses(1); | |
223 | + }).then(function() { | |
224 | + expect(server.requests.length).to.be.equal(1); | |
225 | + }); | |
226 | + }); | |
227 | + }); | |
228 | + | |
200 | 229 | suite('when properties are changed', function() { |
201 | 230 | test('generates simple-request elements that reflect the change', function() { |
202 | 231 | request = ajax.generateRequest(); |
... | ... | @@ -590,6 +619,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
590 | 619 | expect(typeof(ajax.lastResponse)).to.be.equal('string'); |
591 | 620 | }); |
592 | 621 | |
622 | + expect(server.requests.length).to.be.equal(1); | |
623 | + expect(server.requests[0].requestHeaders['accept']).to.be.equal( | |
624 | + 'text/plain'); | |
593 | 625 | server.respond(); |
594 | 626 | |
595 | 627 | return promise; |
... | ... | @@ -662,6 +694,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
662 | 694 | expect(typeof(ajax.lastResponse)).to.be.equal('object'); |
663 | 695 | }); |
664 | 696 | |
697 | + expect(server.requests.length).to.be.equal(1); | |
698 | + expect(server.requests[0].requestHeaders['accept']).to.be.equal( | |
699 | + 'application/json'); | |
700 | + | |
665 | 701 | server.respond(); |
666 | 702 | |
667 | 703 | return promise; | ... | ... |
bower_components/iron-ajax/test/iron-request.html
... | ... | @@ -126,6 +126,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
126 | 126 | options.handleAs = 'json'; |
127 | 127 | |
128 | 128 | request.send(options); |
129 | + expect(server.requests.length).to.be.equal(1); | |
130 | + expect(server.requests[0].requestHeaders['accept']).to.be.equal( | |
131 | + 'application/json'); | |
129 | 132 | server.respond(); |
130 | 133 | |
131 | 134 | return request.completes.then(function() { |
... | ... | @@ -139,6 +142,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
139 | 142 | options.async = false; |
140 | 143 | |
141 | 144 | request.send(options); |
145 | + expect(server.requests.length).to.be.equal(1); | |
146 | + expect(server.requests[0].requestHeaders['accept']).to.be.equal( | |
147 | + 'application/json'); | |
142 | 148 | server.respond(); |
143 | 149 | |
144 | 150 | return request.completes.then(function() { | ... | ... |
bower_components/iron-autogrow-textarea/.bower.json
1 | 1 | { |
2 | 2 | "name": "iron-autogrow-textarea", |
3 | - "version": "1.0.7", | |
3 | + "version": "1.0.8", | |
4 | 4 | "description": "A textarea element that automatically grows with input", |
5 | 5 | "authors": [ |
6 | 6 | "The Polymer Authors" |
... | ... | @@ -37,11 +37,11 @@ |
37 | 37 | "paper-styles": "PolymerElements/paper-styles#^1.0.0", |
38 | 38 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" |
39 | 39 | }, |
40 | - "_release": "1.0.7", | |
40 | + "_release": "1.0.8", | |
41 | 41 | "_resolution": { |
42 | 42 | "type": "version", |
43 | - "tag": "v1.0.7", | |
44 | - "commit": "f31131a9c45af7845780f94ec7e69816929ac6cc" | |
43 | + "tag": "v1.0.8", | |
44 | + "commit": "ea7fb14d8038ccbedc6e85b9c4842b68c659a503" | |
45 | 45 | }, |
46 | 46 | "_source": "git://github.com/PolymerElements/iron-autogrow-textarea.git", |
47 | 47 | "_target": "^1.0.0", | ... | ... |
bower_components/iron-autogrow-textarea/bower.json
bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html
... | ... | @@ -10,7 +10,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
10 | 10 | |
11 | 11 | <link rel="import" href="../polymer/polymer.html"> |
12 | 12 | <link rel="import" href="../iron-behaviors/iron-control-state.html"> |
13 | -<link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html"> | |
13 | +<link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> | |
14 | 14 | <link rel="import" href="../iron-validatable-behavior/iron-validatable-behavior.html"> |
15 | 15 | <link rel="import" href="../iron-form-element-behavior/iron-form-element-behavior.html"> |
16 | 16 | |
... | ... | @@ -55,6 +55,10 @@ Custom property | Description | Default |
55 | 55 | word-wrap: break-word; |
56 | 56 | } |
57 | 57 | |
58 | + .fit { | |
59 | + @apply(--layout-fit); | |
60 | + } | |
61 | + | |
58 | 62 | textarea { |
59 | 63 | position: relative; |
60 | 64 | outline: none; |
... | ... | @@ -68,6 +72,7 @@ Custom property | Description | Default |
68 | 72 | font-size: inherit; |
69 | 73 | font-family: inherit; |
70 | 74 | line-height: inherit; |
75 | + text-align: inherit; | |
71 | 76 | @apply(--iron-autogrow-textarea); |
72 | 77 | } |
73 | 78 | |
... | ... | @@ -78,7 +83,8 @@ Custom property | Description | Default |
78 | 83 | </style> |
79 | 84 | <template> |
80 | 85 | <!-- the mirror sizes the input/textarea so it grows with typing --> |
81 | - <div id="mirror" class="mirror-text" aria-hidden="true"> </div> | |
86 | + <!-- use   instead of to allow this element to be used in XHTML --> | |
87 | + <div id="mirror" class="mirror-text" aria-hidden="true"> </div> | |
82 | 88 | |
83 | 89 | <!-- size the input/textarea with a div, because the textarea has intrinsic size in ff --> |
84 | 90 | <div class="textarea-container fit"> |
... | ... | @@ -112,6 +118,8 @@ Custom property | Description | Default |
112 | 118 | |
113 | 119 | /** |
114 | 120 | * Use this property instead of `value` for two-way data binding. |
121 | + * | |
122 | + * @type {string|number|undefined|null} | |
115 | 123 | */ |
116 | 124 | bindValue: { |
117 | 125 | observer: '_bindValueChanged', |
... | ... | @@ -315,7 +323,8 @@ Custom property | Description | Default |
315 | 323 | while (this.rows > 0 && _tokens.length < this.rows) { |
316 | 324 | _tokens.push(''); |
317 | 325 | } |
318 | - return _tokens.join('<br>') + ' '; | |
326 | + // Use   instead of to allow this element to be used in XHTML. | |
327 | + return _tokens.join('<br/>') + ' '; | |
319 | 328 | }, |
320 | 329 | |
321 | 330 | _valueForMirror: function() { | ... | ... |
bower_components/iron-component-page/.bower.json
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 | "type": "git", |
14 | 14 | "url": "git://github.com/PolymerElements/iron-component-page.git" |
15 | 15 | }, |
16 | - "version": "1.0.7", | |
16 | + "version": "1.0.8", | |
17 | 17 | "private": true, |
18 | 18 | "license": "http://polymer.github.io/LICENSE.txt", |
19 | 19 | "dependencies": { |
... | ... | @@ -34,11 +34,11 @@ |
34 | 34 | "web-component-tester": "*" |
35 | 35 | }, |
36 | 36 | "homepage": "https://github.com/PolymerElements/iron-component-page", |
37 | - "_release": "1.0.7", | |
37 | + "_release": "1.0.8", | |
38 | 38 | "_resolution": { |
39 | 39 | "type": "version", |
40 | - "tag": "v1.0.7", | |
41 | - "commit": "77a463d00fcf0f00a764dd01fd01a6f21bd40745" | |
40 | + "tag": "v1.0.8", | |
41 | + "commit": "62c6498987e17b5480d8d05ddcaf2fa9ef8525a0" | |
42 | 42 | }, |
43 | 43 | "_source": "git://github.com/PolymerElements/iron-component-page.git", |
44 | 44 | "_target": "^1.0.0", | ... | ... |
bower_components/iron-component-page/bower.json
bower_components/iron-component-page/iron-component-page.css
... | ... | @@ -98,8 +98,9 @@ paper-toolbar a:hover, paper-toolbar a:hover iron-icon, paper-toolbar a.iron-sel |
98 | 98 | } |
99 | 99 | |
100 | 100 | #docs { |
101 | + max-width: var(--iron-component-page-max-width, 48em); | |
102 | + @apply(--iron-component-page-container); | |
101 | 103 | padding: 20px; |
102 | - max-width: 48em; | |
103 | 104 | margin: 0 auto; |
104 | 105 | } |
105 | 106 | ... | ... |
bower_components/iron-iconset-svg/.bower.json
1 | 1 | { |
2 | 2 | "name": "iron-iconset-svg", |
3 | 3 | "description": "Manages a set of svg icons", |
4 | - "version": "1.0.7", | |
4 | + "version": "1.0.8", | |
5 | 5 | "keywords": [ |
6 | 6 | "web-components", |
7 | 7 | "polymer", |
... | ... | @@ -30,11 +30,11 @@ |
30 | 30 | "web-component-tester": "*" |
31 | 31 | }, |
32 | 32 | "homepage": "https://github.com/PolymerElements/iron-iconset-svg", |
33 | - "_release": "1.0.7", | |
33 | + "_release": "1.0.8", | |
34 | 34 | "_resolution": { |
35 | 35 | "type": "version", |
36 | - "tag": "v1.0.7", | |
37 | - "commit": "e34ed33838b872d38753eefec2e697d8adb8662d" | |
36 | + "tag": "v1.0.8", | |
37 | + "commit": "7f8b0a5800254247cb518356aee983155374f519" | |
38 | 38 | }, |
39 | 39 | "_source": "git://github.com/PolymerElements/iron-iconset-svg.git", |
40 | 40 | "_target": "^1.0.0", | ... | ... |
bower_components/iron-iconset-svg/bower.json
bower_components/iron-iconset-svg/iron-iconset-svg.html
bower_components/iron-iconset-svg/test/iron-iconset-svg.html
... | ... | @@ -78,6 +78,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
78 | 78 | expect(meta.byKey('foo')).to.be.equal(iconset); |
79 | 79 | }); |
80 | 80 | |
81 | + test('it does not have a size', function () { | |
82 | + var rect = iconset.getBoundingClientRect(); | |
83 | + expect(rect.width).to.be.equal(0); | |
84 | + expect(rect.height).to.be.equal(0); | |
85 | + }); | |
86 | + | |
81 | 87 | test('it fires an iron-iconset-added event on the window', function() { |
82 | 88 | return loadedPromise; |
83 | 89 | }); |
... | ... | @@ -93,6 +99,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
93 | 99 | div = elements[1]; |
94 | 100 | }); |
95 | 101 | |
102 | + test('it does not have a size', function () { | |
103 | + var rect = iconset.getBoundingClientRect(); | |
104 | + expect(rect.width).to.be.equal(0); | |
105 | + expect(rect.height).to.be.equal(0); | |
106 | + }); | |
107 | + | |
96 | 108 | test('appends a child to the target element', function () { |
97 | 109 | expect(div.firstElementChild).to.not.be.ok; |
98 | 110 | iconset.applyIcon(div, 'circle'); | ... | ... |
bower_components/iron-list/.bower.json
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | "list", |
8 | 8 | "virtual-list" |
9 | 9 | ], |
10 | - "version": "1.1.4", | |
10 | + "version": "1.1.5", | |
11 | 11 | "homepage": "https://github.com/PolymerElements/iron-list", |
12 | 12 | "authors": [ |
13 | 13 | "The Polymer Authors" |
... | ... | @@ -37,11 +37,11 @@ |
37 | 37 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.2", |
38 | 38 | "web-component-tester": "*" |
39 | 39 | }, |
40 | - "_release": "1.1.4", | |
40 | + "_release": "1.1.5", | |
41 | 41 | "_resolution": { |
42 | 42 | "type": "version", |
43 | - "tag": "v1.1.4", | |
44 | - "commit": "7f1b6c05d96c2655ad138e99f3ee44d074f8df7b" | |
43 | + "tag": "v1.1.5", | |
44 | + "commit": "c6bf7caf1745cc3bed0769d41ac405476ef981b8" | |
45 | 45 | }, |
46 | 46 | "_source": "git://github.com/PolymerElements/iron-list.git", |
47 | 47 | "_target": "^1.0.0", | ... | ... |
bower_components/iron-list/bower.json
bower_components/iron-list/demo/index.html
... | ... | @@ -117,7 +117,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
117 | 117 | <iron-list items="[[data]]" as="item"> |
118 | 118 | <template> |
119 | 119 | <div> |
120 | - <div class="item" tabindex="0"> | |
120 | + <div class="item"> | |
121 | 121 | <img class="avatar" src="[[item.image]]"> |
122 | 122 | <div class="pad"> |
123 | 123 | <div class="primary">[[item.name]]</div> | ... | ... |
bower_components/iron-list/iron-list.html
... | ... | @@ -371,6 +371,13 @@ after the list became visible again. e.g. |
371 | 371 | }, |
372 | 372 | |
373 | 373 | /** |
374 | + * The bottom of the scroll. | |
375 | + */ | |
376 | + get _scrollBottom() { | |
377 | + return this._scrollPosition + this._viewportSize; | |
378 | + }, | |
379 | + | |
380 | + /** | |
374 | 381 | * The n-th item rendered in the last physical item. |
375 | 382 | */ |
376 | 383 | get _virtualEnd() { |
... | ... | @@ -525,19 +532,13 @@ after the list became visible again. e.g. |
525 | 532 | * items in the viewport and recycle tiles as needed. |
526 | 533 | */ |
527 | 534 | _refresh: function() { |
528 | - var SCROLL_DIRECTION_UP = -1; | |
529 | - var SCROLL_DIRECTION_DOWN = 1; | |
530 | - var SCROLL_DIRECTION_NONE = 0; | |
531 | - | |
532 | 535 | // clamp the `scrollTop` value |
533 | 536 | // IE 10|11 scrollTop may go above `_maxScrollTop` |
534 | 537 | // iOS `scrollTop` may go below 0 and above `_maxScrollTop` |
535 | 538 | var scrollTop = Math.max(0, Math.min(this._maxScrollTop, this._scroller.scrollTop)); |
536 | - | |
537 | - var tileHeight, kth, recycledTileSet; | |
539 | + var tileHeight, tileTop, kth, recycledTileSet, scrollBottom; | |
538 | 540 | var ratio = this._ratio; |
539 | 541 | var delta = scrollTop - this._scrollPosition; |
540 | - var direction = SCROLL_DIRECTION_NONE; | |
541 | 542 | var recycledTiles = 0; |
542 | 543 | var hiddenContentSize = this._hiddenContentSize; |
543 | 544 | var currentRatio = ratio; |
... | ... | @@ -549,18 +550,19 @@ after the list became visible again. e.g. |
549 | 550 | // clear cached visible index |
550 | 551 | this._firstVisibleIndexVal = null; |
551 | 552 | |
553 | + scrollBottom = this._scrollBottom; | |
554 | + | |
552 | 555 | // random access |
553 | 556 | if (Math.abs(delta) > this._physicalSize) { |
554 | 557 | this._physicalTop += delta; |
555 | - direction = SCROLL_DIRECTION_NONE; | |
556 | 558 | recycledTiles = Math.round(delta / this._physicalAverage); |
557 | 559 | } |
558 | 560 | // scroll up |
559 | 561 | else if (delta < 0) { |
560 | 562 | var topSpace = scrollTop - this._physicalTop; |
561 | 563 | var virtualStart = this._virtualStart; |
564 | + var physicalBottom = this._physicalBottom; | |
562 | 565 | |
563 | - direction = SCROLL_DIRECTION_UP; | |
564 | 566 | recycledTileSet = []; |
565 | 567 | |
566 | 568 | kth = this._physicalEnd; |
... | ... | @@ -573,12 +575,14 @@ after the list became visible again. e.g. |
573 | 575 | // recycle less physical items than the total |
574 | 576 | recycledTiles < this._physicalCount && |
575 | 577 | // ensure that these recycled tiles are needed |
576 | - virtualStart - recycledTiles > 0 | |
578 | + virtualStart - recycledTiles > 0 && | |
579 | + // ensure that the tile is not visible | |
580 | + physicalBottom - this._physicalSizes[kth] > scrollBottom | |
577 | 581 | ) { |
578 | 582 | |
579 | - tileHeight = this._physicalSizes[kth] || this._physicalAverage; | |
583 | + tileHeight = this._physicalSizes[kth]; | |
580 | 584 | currentRatio += tileHeight / hiddenContentSize; |
581 | - | |
585 | + physicalBottom -= tileHeight; | |
582 | 586 | recycledTileSet.push(kth); |
583 | 587 | recycledTiles++; |
584 | 588 | kth = (kth === 0) ? this._physicalCount - 1 : kth - 1; |
... | ... | @@ -586,15 +590,13 @@ after the list became visible again. e.g. |
586 | 590 | |
587 | 591 | movingUp = recycledTileSet; |
588 | 592 | recycledTiles = -recycledTiles; |
589 | - | |
590 | 593 | } |
591 | 594 | // scroll down |
592 | 595 | else if (delta > 0) { |
593 | - var bottomSpace = this._physicalBottom - (scrollTop + this._viewportSize); | |
596 | + var bottomSpace = this._physicalBottom - scrollBottom; | |
594 | 597 | var virtualEnd = this._virtualEnd; |
595 | 598 | var lastVirtualItemIndex = this._virtualCount-1; |
596 | 599 | |
597 | - direction = SCROLL_DIRECTION_DOWN; | |
598 | 600 | recycledTileSet = []; |
599 | 601 | |
600 | 602 | kth = this._physicalStart; |
... | ... | @@ -607,10 +609,12 @@ after the list became visible again. e.g. |
607 | 609 | // recycle less physical items than the total |
608 | 610 | recycledTiles < this._physicalCount && |
609 | 611 | // ensure that these recycled tiles are needed |
610 | - virtualEnd + recycledTiles < lastVirtualItemIndex | |
612 | + virtualEnd + recycledTiles < lastVirtualItemIndex && | |
613 | + // ensure that the tile is not visible | |
614 | + this._physicalTop + this._physicalSizes[kth] < scrollTop | |
611 | 615 | ) { |
612 | 616 | |
613 | - tileHeight = this._physicalSizes[kth] || this._physicalAverage; | |
617 | + tileHeight = this._physicalSizes[kth]; | |
614 | 618 | currentRatio += tileHeight / hiddenContentSize; |
615 | 619 | |
616 | 620 | this._physicalTop += tileHeight; |
... | ... | @@ -620,7 +624,15 @@ after the list became visible again. e.g. |
620 | 624 | } |
621 | 625 | } |
622 | 626 | |
623 | - if (recycledTiles !== 0) { | |
627 | + if (recycledTiles === 0) { | |
628 | + // If the list ever reach this case, the physical average is not significant enough | |
629 | + // to create all the items needed to cover the entire viewport. | |
630 | + // e.g. A few items have a height that differs from the average by serveral order of magnitude. | |
631 | + if (this._increasePoolIfNeeded()) { | |
632 | + // yield and set models to the new items | |
633 | + this.async(this._update); | |
634 | + } | |
635 | + } else { | |
624 | 636 | this._virtualStart = this._virtualStart + recycledTiles; |
625 | 637 | this._update(recycledTileSet, movingUp); |
626 | 638 | } |
... | ... | @@ -652,7 +664,7 @@ after the list became visible again. e.g. |
652 | 664 | |
653 | 665 | // increase the pool of physical items if needed |
654 | 666 | if (this._increasePoolIfNeeded()) { |
655 | - // set models to the new items | |
667 | + // yield set models to the new items | |
656 | 668 | this.async(this._update); |
657 | 669 | } |
658 | 670 | }, |
... | ... | @@ -678,7 +690,7 @@ after the list became visible again. e.g. |
678 | 690 | }, |
679 | 691 | |
680 | 692 | /** |
681 | - * Increases the pool size. That is, the physical items in the DOM. | |
693 | + * Increases the pool of physical items only if needed. | |
682 | 694 | * This function will allocate additional physical items |
683 | 695 | * (limited by `MAX_PHYSICAL_COUNT`) if the content size is shorter than |
684 | 696 | * `_optPhysicalSize` |
... | ... | @@ -686,16 +698,22 @@ after the list became visible again. e.g. |
686 | 698 | * @return boolean |
687 | 699 | */ |
688 | 700 | _increasePoolIfNeeded: function() { |
689 | - if (this._physicalSize >= this._optPhysicalSize || this._physicalAverage === 0) { | |
701 | + if (this._physicalAverage === 0) { | |
690 | 702 | return false; |
691 | 703 | } |
704 | + if (this._physicalBottom < this._scrollBottom || this._physicalTop > this._scrollPosition) { | |
705 | + return this._increasePool(1); | |
706 | + } | |
707 | + if (this._physicalSize < this._optPhysicalSize) { | |
708 | + return this._increasePool(Math.round((this._optPhysicalSize - this._physicalSize) * 1.2 / this._physicalAverage)); | |
709 | + } | |
710 | + return false; | |
711 | + }, | |
692 | 712 | |
693 | - // the estimated number of physical items that we will need to reach | |
694 | - // the cap established by `_optPhysicalSize`. | |
695 | - var missingItems = Math.round( | |
696 | - (this._optPhysicalSize - this._physicalSize) * 1.2 / this._physicalAverage | |
697 | - ); | |
698 | - | |
713 | + /** | |
714 | + * Increases the pool size. | |
715 | + */ | |
716 | + _increasePool: function(missingItems) { | |
699 | 717 | // limit the size |
700 | 718 | var nextPhysicalCount = Math.min( |
701 | 719 | this._physicalCount + missingItems, |
... | ... | @@ -710,11 +728,8 @@ after the list became visible again. e.g. |
710 | 728 | return false; |
711 | 729 | } |
712 | 730 | |
713 | - var newPhysicalItems = this._createPool(delta); | |
714 | - var emptyArray = new Array(delta); | |
715 | - | |
716 | - [].push.apply(this._physicalItems, newPhysicalItems); | |
717 | - [].push.apply(this._physicalSizes, emptyArray); | |
731 | + [].push.apply(this._physicalItems, this._createPool(delta)); | |
732 | + [].push.apply(this._physicalSizes, new Array(delta)); | |
718 | 733 | |
719 | 734 | this._physicalCount = prevPhysicalCount + delta; |
720 | 735 | |
... | ... | @@ -1109,10 +1124,9 @@ after the list became visible again. e.g. |
1109 | 1124 | |
1110 | 1125 | // increase the pool of physical items if needed |
1111 | 1126 | if (this._increasePoolIfNeeded()) { |
1112 | - // set models to the new items | |
1127 | + // yield set models to the new items | |
1113 | 1128 | this.async(this._update); |
1114 | 1129 | } |
1115 | - | |
1116 | 1130 | // clear cached visible index |
1117 | 1131 | this._firstVisibleIndexVal = null; |
1118 | 1132 | }, | ... | ... |
bower_components/iron-list/test/different-heights.html
0 โ 100644
1 | +<!doctype html> | |
2 | +<!-- | |
3 | +@license | |
4 | +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE | |
6 | +The complete set of authors may be found at http://polymer.github.io/AUTHORS | |
7 | +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS | |
8 | +Code distributed by Google as part of the polymer project is also | |
9 | +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS | |
10 | +--> | |
11 | +<html> | |
12 | +<head> | |
13 | + <meta charset="UTF-8"> | |
14 | + <title>iron-list test</title> | |
15 | + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> | |
16 | + | |
17 | + <script src="../../webcomponentsjs/webcomponents-lite.js"></script> | |
18 | + <script src="../../web-component-tester/browser.js"></script> | |
19 | + <script src="../../test-fixture/test-fixture-mocha.js"></script> | |
20 | + <script src="../../iron-test-helpers/mock-interactions.js"></script> | |
21 | + | |
22 | + <link rel="import" href="../../test-fixture/test-fixture.html"> | |
23 | + <link rel="import" href="../../paper-styles/paper-styles.html"> | |
24 | + <link rel="import" href="helpers.html"> | |
25 | + <link rel="import" href="x-list.html"> | |
26 | + | |
27 | +</head> | |
28 | +<body> | |
29 | + | |
30 | + <test-fixture id="trivialList"> | |
31 | + <template> | |
32 | + <x-list></x-list> | |
33 | + </template> | |
34 | + </test-fixture> | |
35 | + | |
36 | + <script> | |
37 | + | |
38 | + suite('Different heights', function() { | |
39 | + var list, container; | |
40 | + | |
41 | + setup(function() { | |
42 | + container = fixture('trivialList'); | |
43 | + list = container.list; | |
44 | + }); | |
45 | + | |
46 | + test('render without gaps 1', function(done) { | |
47 | + list.items = [ | |
48 | + {index: 0, height: 791}, | |
49 | + {index: 1, height: 671} | |
50 | + ]; | |
51 | + | |
52 | + flush(function() { | |
53 | + list.push('items', | |
54 | + {index: 2, height: 251}, | |
55 | + {index: 3, height: 191}, | |
56 | + {index: 4, height: 151}, | |
57 | + {index: 5, height: 191}, | |
58 | + {index: 6, height: 51}, | |
59 | + {index: 7, height: 51}, | |
60 | + {index: 8, height: 51} | |
61 | + ); | |
62 | + | |
63 | + list.addEventListener('scroll', function() { | |
64 | + assert.isTrue(isFullOfItems(list)); | |
65 | + }); | |
66 | + | |
67 | + simulateScroll({ | |
68 | + list: list, | |
69 | + contribution: 15, | |
70 | + target: 100000 | |
71 | + }, function() { | |
72 | + done(); | |
73 | + }); | |
74 | + }); | |
75 | + }); | |
76 | + | |
77 | + test('render without gaps 2', function(done) { | |
78 | + var height = 2, items = []; | |
79 | + | |
80 | + while (items.length < 15) { | |
81 | + items.push({height: height}); | |
82 | + height *= 1.5; | |
83 | + } | |
84 | + list.items = items; | |
85 | + | |
86 | + flush(function() { | |
87 | + list.addEventListener('scroll', function() { | |
88 | + assert.isTrue(isFullOfItems(list)); | |
89 | + }); | |
90 | + | |
91 | + simulateScroll({ | |
92 | + list: list, | |
93 | + contribution: 20, | |
94 | + target: 100000 | |
95 | + }, function() { | |
96 | + done(); | |
97 | + }); | |
98 | + }); | |
99 | + }); | |
100 | + | |
101 | + test('render without gaps 3', function(done) { | |
102 | + var heights = [20, 100, 140, 117, 800, 50, 15, 80, 90, 255, 20, 15, 19, 250, 314]; | |
103 | + | |
104 | + list.items = heights.map(function(height) { | |
105 | + return {height: height}; | |
106 | + }); | |
107 | + | |
108 | + flush(function() { | |
109 | + list.addEventListener('scroll', function() { | |
110 | + assert.isTrue(isFullOfItems(list)); | |
111 | + }); | |
112 | + | |
113 | + simulateScroll({ | |
114 | + list: list, | |
115 | + contribution: 20, | |
116 | + target: 100000 | |
117 | + }, function() { | |
118 | + done(); | |
119 | + }); | |
120 | + }); | |
121 | + }); | |
122 | + | |
123 | + }); | |
124 | + | |
125 | + </script> | |
126 | + | |
127 | +</body> | |
128 | +</html> | ... | ... |
bower_components/iron-list/test/helpers.html
... | ... | @@ -72,4 +72,23 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
72 | 72 | var listRect = list.getBoundingClientRect(); |
73 | 73 | return document.elementFromPoint(listRect.left + 1, listRect.top + listRect.height - 1); |
74 | 74 | } |
75 | + | |
76 | + function isFullOfItems(list) { | |
77 | + var listRect = list.getBoundingClientRect(); | |
78 | + var listHeight = listRect.height - 1; | |
79 | + var item, y = listRect.top + 1; | |
80 | + // IE 10 & 11 doesn't render propertly :( | |
81 | + var badPixels = 0; | |
82 | + while (y < listHeight) { | |
83 | + item = document.elementFromPoint(listRect.left + 1, y); | |
84 | + if (item.parentNode && !item.parentNode._templateInstance) { | |
85 | + badPixels++; | |
86 | + } | |
87 | + if (badPixels > 3) { | |
88 | + return false; | |
89 | + } | |
90 | + y += 2; | |
91 | + } | |
92 | + return true; | |
93 | + } | |
75 | 94 | </script> | ... | ... |
bower_components/iron-list/test/hidden-list.html
... | ... | @@ -51,15 +51,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
51 | 51 | }); |
52 | 52 | }); |
53 | 53 | |
54 | - test('resize', function(done) { | |
54 | + test('iron-resize', function(done) { | |
55 | 55 | list.items = buildDataSet(100); |
56 | - list.fire('resize'); | |
56 | + list.fire('iron-resize'); | |
57 | 57 | |
58 | 58 | assert.notEqual(getFirstItemFromList(list).textContent, '0'); |
59 | 59 | Polymer.RenderStatus.whenReady(function() { |
60 | 60 | container.removeAttribute('hidden'); |
61 | 61 | assert.notEqual(getFirstItemFromList(list).textContent, '0'); |
62 | - list.fire('resize'); | |
62 | + list.fire('iron-resize'); | |
63 | 63 | flush(function() { |
64 | 64 | assert.isTrue(list.isAttached); |
65 | 65 | assert.equal(getFirstItemFromList(list).textContent, '0'); | ... | ... |
bower_components/iron-list/test/index.html
... | ... | @@ -23,7 +23,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
23 | 23 | 'physical-count.html', |
24 | 24 | 'hidden-list.html', |
25 | 25 | 'selection.html', |
26 | - 'dynamic-item-size.html' | |
26 | + 'dynamic-item-size.html', | |
27 | + 'different-heights.html' | |
27 | 28 | ]); |
28 | 29 | </script> |
29 | 30 | </body> | ... | ... |
bower_components/iron-list/test/physical-count.html
... | ... | @@ -63,7 +63,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
63 | 63 | // change the height of the list |
64 | 64 | container.listHeight = 500; |
65 | 65 | // resize |
66 | - list.fire('resize'); | |
66 | + list.fire('iron-resize'); | |
67 | 67 | |
68 | 68 | flush(function() { |
69 | 69 | var lastItem = getLastItemFromList(list); | ... | ... |
bower_components/iron-list/test/smoke/avg-worst-case.html
0 โ 100644
1 | +<!-- | |
2 | +@license | |
3 | +Copyright (c) 2015 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 | +<!doctype html> | |
12 | +<html> | |
13 | +<head> | |
14 | + | |
15 | + <title>avg worst case</title> | |
16 | + | |
17 | + <meta charset="utf-8"> | |
18 | + <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> | |
19 | + <meta name="mobile-web-app-capable" content="yes"> | |
20 | + <meta name="apple-mobile-web-app-capable" content="yes"> | |
21 | + | |
22 | + <script src="../../../webcomponentsjs/webcomponents-lite.js"></script> | |
23 | + | |
24 | + <link rel="import" href="../../../polymer/polymer.html"> | |
25 | + <link rel="import" href="../../../paper-styles/paper-styles.html"> | |
26 | + <link rel="import" href="../../iron-list.html"> | |
27 | + | |
28 | + <style is="custom-style"> | |
29 | + | |
30 | + iron-list { | |
31 | + width: 500px; | |
32 | + height: 400px; | |
33 | + float: left; | |
34 | + margin: 10px; | |
35 | + } | |
36 | + | |
37 | + .item { | |
38 | + background-color: green; | |
39 | + border-bottom: 1px solid white; | |
40 | + } | |
41 | + | |
42 | + </style> | |
43 | + | |
44 | +</head> | |
45 | +<body class="fullbleed" unresolved> | |
46 | + | |
47 | + <template is="dom-bind"> | |
48 | + | |
49 | + <h1>The physical avarage is not useful in this situations</h1> | |
50 | + <p>The list is correct if it can render all the items without empty spaces.</p> | |
51 | + <iron-list id="list" items="[791, 671]" as="item" style="width: 300px; height: 300px;"> | |
52 | + <template> | |
53 | + <div class="item" style$="[[_getStyle(item)]]"><span>[[index]]</span> height: <span>[[item]]</span> | |
54 | + </div> | |
55 | + </template> | |
56 | + </iron-list> | |
57 | + | |
58 | + <iron-list id="list2" items="[791, 671]" as="item" style="width: 710px; height: 453px;"> | |
59 | + <template> | |
60 | + <div class="item" style$="[[_getStyle(item)]]"><span>[[index]]</span> height: <span>[[item]]</span> | |
61 | + </div> | |
62 | + </template> | |
63 | + </iron-list> | |
64 | + | |
65 | + <iron-list items="[512, 256, 128, 64, 16, 16, 16, 16, 16, 16, 8, 4]" as="item" style="height: 256px;"> | |
66 | + <template> | |
67 | + <div class="item" style$="[[_getStyle(item)]]"><span>[[index]]</span> height: <span>[[item]]</span> | |
68 | + </div> | |
69 | + </template> | |
70 | + </iron-list> | |
71 | + </template> | |
72 | + | |
73 | + <script> | |
74 | + HTMLImports.whenReady(function() { | |
75 | + document.querySelector('template[is=dom-bind]')._getStyle = function(item) { | |
76 | + return 'height:' + item + 'px; '; | |
77 | + }; | |
78 | + | |
79 | + setTimeout(function() { | |
80 | + document.querySelector('#list').push('items', 251, 191, 151, 191, 51, 51, 51); | |
81 | + }, 100); | |
82 | + | |
83 | + setTimeout(function() { | |
84 | + document.querySelector('#list2').push('items', 251, 191, 151, 191, 51, 51, 51); | |
85 | + }, 300); | |
86 | + }); | |
87 | + </script> | |
88 | +</body> | |
89 | +</html> | ... | ... |
bower_components/iron-list/test/x-list.html
... | ... | @@ -39,7 +39,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
39 | 39 | <iron-list style$="[[_computedListHeight(listHeight)]]" items="[[data]]" as="item" id="list"> |
40 | 40 | <template> |
41 | 41 | <div class="item"> |
42 | - <div style$="[[_computedItemHeight()]]">[[item.index]]</div> | |
42 | + <div style$="[[_computedItemHeight(item)]]">[[item.index]]</div> | |
43 | 43 | </div> |
44 | 44 | </template> |
45 | 45 | </iron-list> |
... | ... | @@ -75,10 +75,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
75 | 75 | return this.$.list; |
76 | 76 | }, |
77 | 77 | |
78 | - _computedItemHeight: function() { | |
79 | - var css = ''; | |
80 | - css += this.itemHeight === 0 ? '' : 'height: ' + (this.itemHeight) + 'px;'; | |
81 | - css += this.pre ? 'white-space:pre;' : ''; | |
78 | + _computedItemHeight: function(item) { | |
79 | + var css = this.pre ? 'white-space:pre;' : ''; | |
80 | + if (item.height) { | |
81 | + css += this.itemHeight === 0 ? '' : 'height: ' + (item.height) + 'px;'; | |
82 | + } else if (this.itemHeight) { | |
83 | + css += 'height: ' + (this.itemHeight) + 'px;'; | |
84 | + } | |
82 | 85 | return css; |
83 | 86 | }, |
84 | 87 | ... | ... |
bower_components/iron-meta/.bower.json
100755 โ 100644
1 | -{ | |
2 | - "name": "iron-meta", | |
3 | - "version": "1.0.3", | |
4 | - "keywords": [ | |
5 | - "web-components", | |
6 | - "polymer" | |
7 | - ], | |
8 | - "license": "http://polymer.github.io/LICENSE.txt", | |
9 | - "description": "Useful for sharing information across a DOM tree", | |
10 | - "private": true, | |
11 | - "authors": [ | |
12 | - "The Polymer Authors" | |
13 | - ], | |
14 | - "repository": { | |
15 | - "type": "git", | |
16 | - "url": "git://github.com/PolymerElements/iron-meta.git" | |
17 | - }, | |
18 | - "dependencies": { | |
19 | - "polymer": "Polymer/polymer#^1.0.0" | |
20 | - }, | |
21 | - "devDependencies": { | |
22 | - "paper-styles": "polymerelements/paper-styles#^1.0.4", | |
23 | - "iron-component-page": "polymerelements/iron-component-page#^1.0.0", | |
24 | - "test-fixture": "polymerelements/test-fixture#^1.0.0", | |
25 | - "web-component-tester": "*", | |
26 | - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" | |
27 | - }, | |
28 | - "homepage": "https://github.com/PolymerElements/iron-meta", | |
29 | - "_release": "1.0.3", | |
30 | - "_resolution": { | |
31 | - "type": "version", | |
32 | - "tag": "v1.0.3", | |
33 | - "commit": "91529259262b0d8f33fed44bc3fd47aedf35cb04" | |
34 | - }, | |
35 | - "_source": "git://github.com/PolymerElements/iron-meta.git", | |
36 | - "_target": "^1.0.0", | |
37 | - "_originalSource": "PolymerElements/iron-meta" | |
1 | +{ | |
2 | + "name": "iron-meta", | |
3 | + "version": "1.1.0", | |
4 | + "keywords": [ | |
5 | + "web-components", | |
6 | + "polymer" | |
7 | + ], | |
8 | + "license": "http://polymer.github.io/LICENSE.txt", | |
9 | + "description": "Useful for sharing information across a DOM tree", | |
10 | + "private": true, | |
11 | + "authors": [ | |
12 | + "The Polymer Authors" | |
13 | + ], | |
14 | + "repository": { | |
15 | + "type": "git", | |
16 | + "url": "git://github.com/PolymerElements/iron-meta.git" | |
17 | + }, | |
18 | + "dependencies": { | |
19 | + "polymer": "Polymer/polymer#^1.0.0" | |
20 | + }, | |
21 | + "devDependencies": { | |
22 | + "paper-styles": "polymerelements/paper-styles#^1.0.4", | |
23 | + "iron-component-page": "polymerelements/iron-component-page#^1.0.0", | |
24 | + "test-fixture": "polymerelements/test-fixture#^1.0.0", | |
25 | + "web-component-tester": "*", | |
26 | + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" | |
27 | + }, | |
28 | + "homepage": "https://github.com/PolymerElements/iron-meta", | |
29 | + "_release": "1.1.0", | |
30 | + "_resolution": { | |
31 | + "type": "version", | |
32 | + "tag": "v1.1.0", | |
33 | + "commit": "be7ccf8df650aef1446a4e23af33f5d4e9f3000f" | |
34 | + }, | |
35 | + "_source": "git://github.com/PolymerElements/iron-meta.git", | |
36 | + "_target": "^1.0.0", | |
37 | + "_originalSource": "PolymerElements/iron-meta" | |
38 | 38 | } |
39 | 39 | \ No newline at end of file | ... | ... |
bower_components/iron-meta/.gitignore
100755 โ 100644
bower_components/iron-meta/README.md
100755 โ 100644
1 | -iron-meta | |
2 | -========= | |
3 | - | |
4 | -`iron-meta` is a generic element you can use for sharing information across the DOM tree. | |
5 | -It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that any | |
6 | -instance of iron-meta has access to the shared | |
7 | -information. You can use `iron-meta` to share whatever you want (or create an extension | |
8 | -[like x-meta] for enhancements). | |
9 | - | |
10 | -The `iron-meta` instances containing your actual data can be loaded in an import, | |
11 | -or constructed in any way you see fit. The only requirement is that you create them | |
12 | -before you try to access them. | |
13 | - | |
14 | -Examples: | |
15 | - | |
16 | -If I create an instance like this: | |
17 | - | |
18 | -```html | |
19 | -<iron-meta key="info" value="foo/bar"></iron-meta> | |
20 | -``` | |
21 | - | |
22 | -Note that value="foo/bar" is the metadata I've defined. I could define more | |
23 | -attributes or use child nodes to define additional metadata. | |
24 | - | |
25 | -Now I can access that element (and it's metadata) from any iron-meta instance | |
26 | -via the byKey method, e.g. | |
27 | - | |
28 | -```javascript | |
29 | -meta.byKey('info').getAttribute('value'); | |
30 | -``` | |
31 | - | |
32 | -Pure imperative form would be like: | |
33 | - | |
34 | -```javascript | |
35 | -document.createElement('iron-meta').byKey('info').getAttribute('value'); | |
36 | -``` | |
37 | - | |
38 | -Or, in a Polymer element, you can include a meta in your template: | |
39 | - | |
40 | -```html | |
41 | -<iron-meta id="meta"></iron-meta> | |
42 | -``` | |
43 | - | |
44 | -```javascript | |
45 | -this.$.meta.byKey('info').getAttribute('value'); | |
46 | -``` | |
1 | +iron-meta | |
2 | +========= | |
3 | + | |
4 | +`iron-meta` is a generic element you can use for sharing information across the DOM tree. | |
5 | +It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that any | |
6 | +instance of iron-meta has access to the shared | |
7 | +information. You can use `iron-meta` to share whatever you want (or create an extension | |
8 | +[like x-meta] for enhancements). | |
9 | + | |
10 | +The `iron-meta` instances containing your actual data can be loaded in an import, | |
11 | +or constructed in any way you see fit. The only requirement is that you create them | |
12 | +before you try to access them. | |
13 | + | |
14 | +Examples: | |
15 | + | |
16 | +If I create an instance like this: | |
17 | + | |
18 | +```html | |
19 | +<iron-meta key="info" value="foo/bar"></iron-meta> | |
20 | +``` | |
21 | + | |
22 | +Note that value="foo/bar" is the metadata I've defined. I could define more | |
23 | +attributes or use child nodes to define additional metadata. | |
24 | + | |
25 | +Now I can access that element (and it's metadata) from any iron-meta instance | |
26 | +via the byKey method, e.g. | |
27 | + | |
28 | +```javascript | |
29 | +meta.byKey('info').getAttribute('value'); | |
30 | +``` | |
31 | + | |
32 | +Pure imperative form would be like: | |
33 | + | |
34 | +```javascript | |
35 | +document.createElement('iron-meta').byKey('info').getAttribute('value'); | |
36 | +``` | |
37 | + | |
38 | +Or, in a Polymer element, you can include a meta in your template: | |
39 | + | |
40 | +```html | |
41 | +<iron-meta id="meta"></iron-meta> | |
42 | +``` | |
43 | + | |
44 | +```javascript | |
45 | +this.$.meta.byKey('info').getAttribute('value'); | |
46 | +``` | ... | ... |
bower_components/iron-meta/bower.json
100755 โ 100644
1 | -{ | |
2 | - "name": "iron-meta", | |
3 | - "version": "1.0.3", | |
4 | - "keywords": [ | |
5 | - "web-components", | |
6 | - "polymer" | |
7 | - ], | |
8 | - "license": "http://polymer.github.io/LICENSE.txt", | |
9 | - "description": "Useful for sharing information across a DOM tree", | |
10 | - "private": true, | |
11 | - "authors": [ | |
12 | - "The Polymer Authors" | |
13 | - ], | |
14 | - "repository": { | |
15 | - "type": "git", | |
16 | - "url": "git://github.com/PolymerElements/iron-meta.git" | |
17 | - }, | |
18 | - "dependencies": { | |
19 | - "polymer": "Polymer/polymer#^1.0.0" | |
20 | - }, | |
21 | - "devDependencies": { | |
22 | - "paper-styles": "polymerelements/paper-styles#^1.0.4", | |
23 | - "iron-component-page": "polymerelements/iron-component-page#^1.0.0", | |
24 | - "test-fixture": "polymerelements/test-fixture#^1.0.0", | |
25 | - "web-component-tester": "*", | |
26 | - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" | |
27 | - } | |
28 | -} | |
1 | +{ | |
2 | + "name": "iron-meta", | |
3 | + "version": "1.1.0", | |
4 | + "keywords": [ | |
5 | + "web-components", | |
6 | + "polymer" | |
7 | + ], | |
8 | + "license": "http://polymer.github.io/LICENSE.txt", | |
9 | + "description": "Useful for sharing information across a DOM tree", | |
10 | + "private": true, | |
11 | + "authors": [ | |
12 | + "The Polymer Authors" | |
13 | + ], | |
14 | + "repository": { | |
15 | + "type": "git", | |
16 | + "url": "git://github.com/PolymerElements/iron-meta.git" | |
17 | + }, | |
18 | + "dependencies": { | |
19 | + "polymer": "Polymer/polymer#^1.0.0" | |
20 | + }, | |
21 | + "devDependencies": { | |
22 | + "paper-styles": "polymerelements/paper-styles#^1.0.4", | |
23 | + "iron-component-page": "polymerelements/iron-component-page#^1.0.0", | |
24 | + "test-fixture": "polymerelements/test-fixture#^1.0.0", | |
25 | + "web-component-tester": "*", | |
26 | + "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" | |
27 | + } | |
28 | +} | ... | ... |
bower_components/iron-meta/demo/index.html
100755 โ 100644
1 | -<!doctype html> | |
2 | -<!-- | |
3 | -@license | |
4 | -Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | |
6 | -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
7 | -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | |
8 | -Code distributed by Google as part of the polymer project is also | |
9 | -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | |
10 | ---> | |
11 | -<html> | |
12 | -<head> | |
13 | - | |
14 | - <meta charset="utf-8"> | |
15 | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
16 | - | |
17 | - <title>iron-meta</title> | |
18 | - | |
19 | - <script src="../../webcomponentsjs/webcomponents-lite.js"></script> | |
20 | - <link rel="import" href="../../paper-styles/demo-pages.html"> | |
21 | - <link rel="import" href="../iron-meta.html"> | |
22 | -</head> | |
23 | -<body> | |
24 | - | |
25 | - <div class="vertical-section vertical-section-container centered"> | |
26 | - <h1><iron-meta></h1> | |
27 | - <iron-meta key="info" value="foo/bar"></iron-meta> | |
28 | - The <code>value</code> stored at <code>key="info"</code> is <code><meta-test></meta-test></code>. | |
29 | - </div> | |
30 | - | |
31 | - <script> | |
32 | - | |
33 | - Polymer({ | |
34 | - | |
35 | - is: 'meta-test', | |
36 | - | |
37 | - ready: function() { | |
38 | - this.textContent = new Polymer.IronMetaQuery({key: 'info'}).value; | |
39 | - } | |
40 | - | |
41 | - }); | |
42 | - | |
43 | - </script> | |
44 | - | |
45 | -</body> | |
46 | -</html> | |
1 | +<!doctype html> | |
2 | +<!-- | |
3 | +@license | |
4 | +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | |
6 | +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
7 | +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | |
8 | +Code distributed by Google as part of the polymer project is also | |
9 | +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | |
10 | +--> | |
11 | +<html> | |
12 | +<head> | |
13 | + | |
14 | + <meta charset="utf-8"> | |
15 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
16 | + | |
17 | + <title>iron-meta</title> | |
18 | + | |
19 | + <script src="../../webcomponentsjs/webcomponents-lite.js"></script> | |
20 | + <link rel="import" href="../../paper-styles/demo-pages.html"> | |
21 | + <link rel="import" href="../iron-meta.html"> | |
22 | +</head> | |
23 | +<body> | |
24 | + | |
25 | + <div class="vertical-section vertical-section-container centered"> | |
26 | + <h1><iron-meta></h1> | |
27 | + <iron-meta key="info" value="foo/bar"></iron-meta> | |
28 | + The <code>value</code> stored at <code>key="info"</code> is <code><meta-test></meta-test></code>. | |
29 | + </div> | |
30 | + | |
31 | + <script> | |
32 | + | |
33 | + Polymer({ | |
34 | + | |
35 | + is: 'meta-test', | |
36 | + | |
37 | + ready: function() { | |
38 | + this.textContent = new Polymer.IronMetaQuery({key: 'info'}).value; | |
39 | + } | |
40 | + | |
41 | + }); | |
42 | + | |
43 | + </script> | |
44 | + | |
45 | +</body> | |
46 | +</html> | ... | ... |
bower_components/iron-meta/index.html
100755 โ 100644
1 | -<!doctype html> | |
2 | -<!-- | |
3 | -@license | |
4 | -Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE | |
6 | -The complete set of authors may be found at http://polymer.github.io/AUTHORS | |
7 | -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS | |
8 | -Code distributed by Google as part of the polymer project is also | |
9 | -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS | |
10 | ---> | |
11 | -<html> | |
12 | -<head> | |
13 | - | |
14 | - <meta charset="utf-8"> | |
15 | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
16 | - <title>iron-meta</title> | |
17 | - | |
18 | - <script src="../webcomponentsjs/webcomponents-lite.js"></script> | |
19 | - <link rel="import" href="../iron-component-page/iron-component-page.html"> | |
20 | - | |
21 | -</head> | |
22 | -<body> | |
23 | - | |
24 | - <iron-component-page></iron-component-page> | |
25 | - | |
26 | -</body> | |
27 | -</html> | |
1 | +<!doctype html> | |
2 | +<!-- | |
3 | +@license | |
4 | +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE | |
6 | +The complete set of authors may be found at http://polymer.github.io/AUTHORS | |
7 | +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS | |
8 | +Code distributed by Google as part of the polymer project is also | |
9 | +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS | |
10 | +--> | |
11 | +<html> | |
12 | +<head> | |
13 | + | |
14 | + <meta charset="utf-8"> | |
15 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
16 | + <title>iron-meta</title> | |
17 | + | |
18 | + <script src="../webcomponentsjs/webcomponents-lite.js"></script> | |
19 | + <link rel="import" href="../iron-component-page/iron-component-page.html"> | |
20 | + | |
21 | +</head> | |
22 | +<body> | |
23 | + | |
24 | + <iron-component-page></iron-component-page> | |
25 | + | |
26 | +</body> | |
27 | +</html> | ... | ... |
bower_components/iron-meta/iron-meta.html
100755 โ 100644
1 | -<!-- | |
2 | -@license | |
3 | -Copyright (c) 2015 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 | -<link rel="import" href="../polymer/polymer.html"> | |
12 | - | |
13 | -<!-- | |
14 | -`iron-meta` is a generic element you can use for sharing information across the DOM tree. | |
15 | -It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that any | |
16 | -instance of iron-meta has access to the shared | |
17 | -information. You can use `iron-meta` to share whatever you want (or create an extension | |
18 | -[like x-meta] for enhancements). | |
19 | - | |
20 | -The `iron-meta` instances containing your actual data can be loaded in an import, | |
21 | -or constructed in any way you see fit. The only requirement is that you create them | |
22 | -before you try to access them. | |
23 | - | |
24 | -Examples: | |
25 | - | |
26 | -If I create an instance like this: | |
27 | - | |
28 | - <iron-meta key="info" value="foo/bar"></iron-meta> | |
29 | - | |
30 | -Note that value="foo/bar" is the metadata I've defined. I could define more | |
31 | -attributes or use child nodes to define additional metadata. | |
32 | - | |
33 | -Now I can access that element (and it's metadata) from any iron-meta instance | |
34 | -via the byKey method, e.g. | |
35 | - | |
36 | - meta.byKey('info').getAttribute('value'). | |
37 | - | |
38 | -Pure imperative form would be like: | |
39 | - | |
40 | - document.createElement('iron-meta').byKey('info').getAttribute('value'); | |
41 | - | |
42 | -Or, in a Polymer element, you can include a meta in your template: | |
43 | - | |
44 | - <iron-meta id="meta"></iron-meta> | |
45 | - ... | |
46 | - this.$.meta.byKey('info').getAttribute('value'); | |
47 | - | |
48 | -@group Iron Elements | |
49 | -@demo demo/index.html | |
50 | -@hero hero.svg | |
51 | -@element iron-meta | |
52 | ---> | |
53 | - | |
54 | -<script> | |
55 | - | |
56 | - (function() { | |
57 | - | |
58 | - // monostate data | |
59 | - var metaDatas = {}; | |
60 | - var metaArrays = {}; | |
61 | - | |
62 | - Polymer.IronMeta = Polymer({ | |
63 | - | |
64 | - is: 'iron-meta', | |
65 | - | |
66 | - properties: { | |
67 | - | |
68 | - /** | |
69 | - * The type of meta-data. All meta-data of the same type is stored | |
70 | - * together. | |
71 | - */ | |
72 | - type: { | |
73 | - type: String, | |
74 | - value: 'default', | |
75 | - observer: '_typeChanged' | |
76 | - }, | |
77 | - | |
78 | - /** | |
79 | - * The key used to store `value` under the `type` namespace. | |
80 | - */ | |
81 | - key: { | |
82 | - type: String, | |
83 | - observer: '_keyChanged' | |
84 | - }, | |
85 | - | |
86 | - /** | |
87 | - * The meta-data to store or retrieve. | |
88 | - */ | |
89 | - value: { | |
90 | - type: Object, | |
91 | - notify: true, | |
92 | - observer: '_valueChanged' | |
93 | - }, | |
94 | - | |
95 | - /** | |
96 | - * If true, `value` is set to the iron-meta instance itself. | |
97 | - */ | |
98 | - self: { | |
99 | - type: Boolean, | |
100 | - observer: '_selfChanged' | |
101 | - }, | |
102 | - | |
103 | - /** | |
104 | - * Array of all meta-data values for the given type. | |
105 | - */ | |
106 | - list: { | |
107 | - type: Array, | |
108 | - notify: true | |
109 | - } | |
110 | - | |
111 | - }, | |
112 | - | |
113 | - /** | |
114 | - * Only runs if someone invokes the factory/constructor directly | |
115 | - * e.g. `new Polymer.IronMeta()` | |
116 | - */ | |
117 | - factoryImpl: function(config) { | |
118 | - if (config) { | |
119 | - for (var n in config) { | |
120 | - switch(n) { | |
121 | - case 'type': | |
122 | - case 'key': | |
123 | - case 'value': | |
124 | - this[n] = config[n]; | |
125 | - break; | |
126 | - } | |
127 | - } | |
128 | - } | |
129 | - }, | |
130 | - | |
131 | - created: function() { | |
132 | - // TODO(sjmiles): good for debugging? | |
133 | - this._metaDatas = metaDatas; | |
134 | - this._metaArrays = metaArrays; | |
135 | - }, | |
136 | - | |
137 | - _keyChanged: function(key, old) { | |
138 | - this._resetRegistration(old); | |
139 | - }, | |
140 | - | |
141 | - _valueChanged: function(value) { | |
142 | - this._resetRegistration(this.key); | |
143 | - }, | |
144 | - | |
145 | - _selfChanged: function(self) { | |
146 | - if (self) { | |
147 | - this.value = this; | |
148 | - } | |
149 | - }, | |
150 | - | |
151 | - _typeChanged: function(type) { | |
152 | - this._unregisterKey(this.key); | |
153 | - if (!metaDatas[type]) { | |
154 | - metaDatas[type] = {}; | |
155 | - } | |
156 | - this._metaData = metaDatas[type]; | |
157 | - if (!metaArrays[type]) { | |
158 | - metaArrays[type] = []; | |
159 | - } | |
160 | - this.list = metaArrays[type]; | |
161 | - this._registerKeyValue(this.key, this.value); | |
162 | - }, | |
163 | - | |
164 | - /** | |
165 | - * Retrieves meta data value by key. | |
166 | - * | |
167 | - * @method byKey | |
168 | - * @param {string} key The key of the meta-data to be returned. | |
169 | - * @return {*} | |
170 | - */ | |
171 | - byKey: function(key) { | |
172 | - return this._metaData && this._metaData[key]; | |
173 | - }, | |
174 | - | |
175 | - _resetRegistration: function(oldKey) { | |
176 | - this._unregisterKey(oldKey); | |
177 | - this._registerKeyValue(this.key, this.value); | |
178 | - }, | |
179 | - | |
180 | - _unregisterKey: function(key) { | |
181 | - this._unregister(key, this._metaData, this.list); | |
182 | - }, | |
183 | - | |
184 | - _registerKeyValue: function(key, value) { | |
185 | - this._register(key, value, this._metaData, this.list); | |
186 | - }, | |
187 | - | |
188 | - _register: function(key, value, data, list) { | |
189 | - if (key && data && value !== undefined) { | |
190 | - data[key] = value; | |
191 | - list.push(value); | |
192 | - } | |
193 | - }, | |
194 | - | |
195 | - _unregister: function(key, data, list) { | |
196 | - if (key && data) { | |
197 | - if (key in data) { | |
198 | - var value = data[key]; | |
199 | - delete data[key]; | |
200 | - this.arrayDelete(list, value); | |
201 | - } | |
202 | - } | |
203 | - } | |
204 | - | |
205 | - }); | |
206 | - | |
207 | - /** | |
208 | - `iron-meta-query` can be used to access infomation stored in `iron-meta`. | |
209 | - | |
210 | - Examples: | |
211 | - | |
212 | - If I create an instance like this: | |
213 | - | |
214 | - <iron-meta key="info" value="foo/bar"></iron-meta> | |
215 | - | |
216 | - Note that value="foo/bar" is the metadata I've defined. I could define more | |
217 | - attributes or use child nodes to define additional metadata. | |
218 | - | |
219 | - Now I can access that element (and it's metadata) from any `iron-meta-query` instance: | |
220 | - | |
221 | - var value = new Polymer.IronMetaQuery({key: 'info'}).value; | |
222 | - | |
223 | - @group Polymer Iron Elements | |
224 | - @element iron-meta-query | |
225 | - */ | |
226 | - Polymer.IronMetaQuery = Polymer({ | |
227 | - | |
228 | - is: 'iron-meta-query', | |
229 | - | |
230 | - properties: { | |
231 | - | |
232 | - /** | |
233 | - * The type of meta-data. All meta-data of the same type is stored | |
234 | - * together. | |
235 | - */ | |
236 | - type: { | |
237 | - type: String, | |
238 | - value: 'default', | |
239 | - observer: '_typeChanged' | |
240 | - }, | |
241 | - | |
242 | - /** | |
243 | - * Specifies a key to use for retrieving `value` from the `type` | |
244 | - * namespace. | |
245 | - */ | |
246 | - key: { | |
247 | - type: String, | |
248 | - observer: '_keyChanged' | |
249 | - }, | |
250 | - | |
251 | - /** | |
252 | - * The meta-data to store or retrieve. | |
253 | - */ | |
254 | - value: { | |
255 | - type: Object, | |
256 | - notify: true, | |
257 | - readOnly: true | |
258 | - }, | |
259 | - | |
260 | - /** | |
261 | - * Array of all meta-data values for the given type. | |
262 | - */ | |
263 | - list: { | |
264 | - type: Array, | |
265 | - notify: true | |
266 | - } | |
267 | - | |
268 | - }, | |
269 | - | |
270 | - /** | |
271 | - * Actually a factory method, not a true constructor. Only runs if | |
272 | - * someone invokes it directly (via `new Polymer.IronMeta()`); | |
273 | - */ | |
274 | - factoryImpl: function(config) { | |
275 | - if (config) { | |
276 | - for (var n in config) { | |
277 | - switch(n) { | |
278 | - case 'type': | |
279 | - case 'key': | |
280 | - this[n] = config[n]; | |
281 | - break; | |
282 | - } | |
283 | - } | |
284 | - } | |
285 | - }, | |
286 | - | |
287 | - created: function() { | |
288 | - // TODO(sjmiles): good for debugging? | |
289 | - this._metaDatas = metaDatas; | |
290 | - this._metaArrays = metaArrays; | |
291 | - }, | |
292 | - | |
293 | - _keyChanged: function(key) { | |
294 | - this._setValue(this._metaData && this._metaData[key]); | |
295 | - }, | |
296 | - | |
297 | - _typeChanged: function(type) { | |
298 | - this._metaData = metaDatas[type]; | |
299 | - this.list = metaArrays[type]; | |
300 | - if (this.key) { | |
301 | - this._keyChanged(this.key); | |
302 | - } | |
303 | - }, | |
304 | - | |
305 | - /** | |
306 | - * Retrieves meta data value by key. | |
307 | - * @param {string} key The key of the meta-data to be returned. | |
308 | - * @return {*} | |
309 | - */ | |
310 | - byKey: function(key) { | |
311 | - return this._metaData && this._metaData[key]; | |
312 | - } | |
313 | - | |
314 | - }); | |
315 | - | |
316 | - })(); | |
317 | -</script> | |
1 | +<!-- | |
2 | +@license | |
3 | +Copyright (c) 2015 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 | +<link rel="import" href="../polymer/polymer.html"> | |
12 | + | |
13 | +<!-- | |
14 | +`iron-meta` is a generic element you can use for sharing information across the DOM tree. | |
15 | +It uses [monostate pattern](http://c2.com/cgi/wiki?MonostatePattern) such that any | |
16 | +instance of iron-meta has access to the shared | |
17 | +information. You can use `iron-meta` to share whatever you want (or create an extension | |
18 | +[like x-meta] for enhancements). | |
19 | + | |
20 | +The `iron-meta` instances containing your actual data can be loaded in an import, | |
21 | +or constructed in any way you see fit. The only requirement is that you create them | |
22 | +before you try to access them. | |
23 | + | |
24 | +Examples: | |
25 | + | |
26 | +If I create an instance like this: | |
27 | + | |
28 | + <iron-meta key="info" value="foo/bar"></iron-meta> | |
29 | + | |
30 | +Note that value="foo/bar" is the metadata I've defined. I could define more | |
31 | +attributes or use child nodes to define additional metadata. | |
32 | + | |
33 | +Now I can access that element (and it's metadata) from any iron-meta instance | |
34 | +via the byKey method, e.g. | |
35 | + | |
36 | + meta.byKey('info').getAttribute('value'). | |
37 | + | |
38 | +Pure imperative form would be like: | |
39 | + | |
40 | + document.createElement('iron-meta').byKey('info').getAttribute('value'); | |
41 | + | |
42 | +Or, in a Polymer element, you can include a meta in your template: | |
43 | + | |
44 | + <iron-meta id="meta"></iron-meta> | |
45 | + ... | |
46 | + this.$.meta.byKey('info').getAttribute('value'); | |
47 | + | |
48 | +@group Iron Elements | |
49 | +@demo demo/index.html | |
50 | +@hero hero.svg | |
51 | +@element iron-meta | |
52 | +--> | |
53 | + | |
54 | +<script> | |
55 | + | |
56 | + (function() { | |
57 | + | |
58 | + // monostate data | |
59 | + var metaDatas = {}; | |
60 | + var metaArrays = {}; | |
61 | + var singleton = null; | |
62 | + | |
63 | + Polymer.IronMeta = Polymer({ | |
64 | + | |
65 | + is: 'iron-meta', | |
66 | + | |
67 | + properties: { | |
68 | + | |
69 | + /** | |
70 | + * The type of meta-data. All meta-data of the same type is stored | |
71 | + * together. | |
72 | + */ | |
73 | + type: { | |
74 | + type: String, | |
75 | + value: 'default', | |
76 | + observer: '_typeChanged' | |
77 | + }, | |
78 | + | |
79 | + /** | |
80 | + * The key used to store `value` under the `type` namespace. | |
81 | + */ | |
82 | + key: { | |
83 | + type: String, | |
84 | + observer: '_keyChanged' | |
85 | + }, | |
86 | + | |
87 | + /** | |
88 | + * The meta-data to store or retrieve. | |
89 | + */ | |
90 | + value: { | |
91 | + type: Object, | |
92 | + notify: true, | |
93 | + observer: '_valueChanged' | |
94 | + }, | |
95 | + | |
96 | + /** | |
97 | + * If true, `value` is set to the iron-meta instance itself. | |
98 | + */ | |
99 | + self: { | |
100 | + type: Boolean, | |
101 | + observer: '_selfChanged' | |
102 | + }, | |
103 | + | |
104 | + /** | |
105 | + * Array of all meta-data values for the given type. | |
106 | + */ | |
107 | + list: { | |
108 | + type: Array, | |
109 | + notify: true | |
110 | + } | |
111 | + | |
112 | + }, | |
113 | + | |
114 | + hostAttributes: { | |
115 | + hidden: true | |
116 | + }, | |
117 | + | |
118 | + /** | |
119 | + * Only runs if someone invokes the factory/constructor directly | |
120 | + * e.g. `new Polymer.IronMeta()` | |
121 | + */ | |
122 | + factoryImpl: function(config) { | |
123 | + if (config) { | |
124 | + for (var n in config) { | |
125 | + switch(n) { | |
126 | + case 'type': | |
127 | + case 'key': | |
128 | + case 'value': | |
129 | + this[n] = config[n]; | |
130 | + break; | |
131 | + } | |
132 | + } | |
133 | + } | |
134 | + }, | |
135 | + | |
136 | + created: function() { | |
137 | + // TODO(sjmiles): good for debugging? | |
138 | + this._metaDatas = metaDatas; | |
139 | + this._metaArrays = metaArrays; | |
140 | + }, | |
141 | + | |
142 | + _keyChanged: function(key, old) { | |
143 | + this._resetRegistration(old); | |
144 | + }, | |
145 | + | |
146 | + _valueChanged: function(value) { | |
147 | + this._resetRegistration(this.key); | |
148 | + }, | |
149 | + | |
150 | + _selfChanged: function(self) { | |
151 | + if (self) { | |
152 | + this.value = this; | |
153 | + } | |
154 | + }, | |
155 | + | |
156 | + _typeChanged: function(type) { | |
157 | + this._unregisterKey(this.key); | |
158 | + if (!metaDatas[type]) { | |
159 | + metaDatas[type] = {}; | |
160 | + } | |
161 | + this._metaData = metaDatas[type]; | |
162 | + if (!metaArrays[type]) { | |
163 | + metaArrays[type] = []; | |
164 | + } | |
165 | + this.list = metaArrays[type]; | |
166 | + this._registerKeyValue(this.key, this.value); | |
167 | + }, | |
168 | + | |
169 | + /** | |
170 | + * Retrieves meta data value by key. | |
171 | + * | |
172 | + * @method byKey | |
173 | + * @param {string} key The key of the meta-data to be returned. | |
174 | + * @return {*} | |
175 | + */ | |
176 | + byKey: function(key) { | |
177 | + return this._metaData && this._metaData[key]; | |
178 | + }, | |
179 | + | |
180 | + _resetRegistration: function(oldKey) { | |
181 | + this._unregisterKey(oldKey); | |
182 | + this._registerKeyValue(this.key, this.value); | |
183 | + }, | |
184 | + | |
185 | + _unregisterKey: function(key) { | |
186 | + this._unregister(key, this._metaData, this.list); | |
187 | + }, | |
188 | + | |
189 | + _registerKeyValue: function(key, value) { | |
190 | + this._register(key, value, this._metaData, this.list); | |
191 | + }, | |
192 | + | |
193 | + _register: function(key, value, data, list) { | |
194 | + if (key && data && value !== undefined) { | |
195 | + data[key] = value; | |
196 | + list.push(value); | |
197 | + } | |
198 | + }, | |
199 | + | |
200 | + _unregister: function(key, data, list) { | |
201 | + if (key && data) { | |
202 | + if (key in data) { | |
203 | + var value = data[key]; | |
204 | + delete data[key]; | |
205 | + this.arrayDelete(list, value); | |
206 | + } | |
207 | + } | |
208 | + } | |
209 | + | |
210 | + }); | |
211 | + | |
212 | + Polymer.IronMeta.getIronMeta = function getIronMeta() { | |
213 | + if (singleton === null) { | |
214 | + singleton = new Polymer.IronMeta(); | |
215 | + } | |
216 | + return singleton; | |
217 | + }; | |
218 | + | |
219 | + /** | |
220 | + `iron-meta-query` can be used to access infomation stored in `iron-meta`. | |
221 | + | |
222 | + Examples: | |
223 | + | |
224 | + If I create an instance like this: | |
225 | + | |
226 | + <iron-meta key="info" value="foo/bar"></iron-meta> | |
227 | + | |
228 | + Note that value="foo/bar" is the metadata I've defined. I could define more | |
229 | + attributes or use child nodes to define additional metadata. | |
230 | + | |
231 | + Now I can access that element (and it's metadata) from any `iron-meta-query` instance: | |
232 | + | |
233 | + var value = new Polymer.IronMetaQuery({key: 'info'}).value; | |
234 | + | |
235 | + @group Polymer Iron Elements | |
236 | + @element iron-meta-query | |
237 | + */ | |
238 | + Polymer.IronMetaQuery = Polymer({ | |
239 | + | |
240 | + is: 'iron-meta-query', | |
241 | + | |
242 | + properties: { | |
243 | + | |
244 | + /** | |
245 | + * The type of meta-data. All meta-data of the same type is stored | |
246 | + * together. | |
247 | + */ | |
248 | + type: { | |
249 | + type: String, | |
250 | + value: 'default', | |
251 | + observer: '_typeChanged' | |
252 | + }, | |
253 | + | |
254 | + /** | |
255 | + * Specifies a key to use for retrieving `value` from the `type` | |
256 | + * namespace. | |
257 | + */ | |
258 | + key: { | |
259 | + type: String, | |
260 | + observer: '_keyChanged' | |
261 | + }, | |
262 | + | |
263 | + /** | |
264 | + * The meta-data to store or retrieve. | |
265 | + */ | |
266 | + value: { | |
267 | + type: Object, | |
268 | + notify: true, | |
269 | + readOnly: true | |
270 | + }, | |
271 | + | |
272 | + /** | |
273 | + * Array of all meta-data values for the given type. | |
274 | + */ | |
275 | + list: { | |
276 | + type: Array, | |
277 | + notify: true | |
278 | + } | |
279 | + | |
280 | + }, | |
281 | + | |
282 | + /** | |
283 | + * Actually a factory method, not a true constructor. Only runs if | |
284 | + * someone invokes it directly (via `new Polymer.IronMeta()`); | |
285 | + */ | |
286 | + factoryImpl: function(config) { | |
287 | + if (config) { | |
288 | + for (var n in config) { | |
289 | + switch(n) { | |
290 | + case 'type': | |
291 | + case 'key': | |
292 | + this[n] = config[n]; | |
293 | + break; | |
294 | + } | |
295 | + } | |
296 | + } | |
297 | + }, | |
298 | + | |
299 | + created: function() { | |
300 | + // TODO(sjmiles): good for debugging? | |
301 | + this._metaDatas = metaDatas; | |
302 | + this._metaArrays = metaArrays; | |
303 | + }, | |
304 | + | |
305 | + _keyChanged: function(key) { | |
306 | + this._setValue(this._metaData && this._metaData[key]); | |
307 | + }, | |
308 | + | |
309 | + _typeChanged: function(type) { | |
310 | + this._metaData = metaDatas[type]; | |
311 | + this.list = metaArrays[type]; | |
312 | + if (this.key) { | |
313 | + this._keyChanged(this.key); | |
314 | + } | |
315 | + }, | |
316 | + | |
317 | + /** | |
318 | + * Retrieves meta data value by key. | |
319 | + * @param {string} key The key of the meta-data to be returned. | |
320 | + * @return {*} | |
321 | + */ | |
322 | + byKey: function(key) { | |
323 | + return this._metaData && this._metaData[key]; | |
324 | + } | |
325 | + | |
326 | + }); | |
327 | + | |
328 | + })(); | |
329 | +</script> | ... | ... |
bower_components/iron-meta/test/basic.html
100755 โ 100644
1 | -<!doctype html> | |
2 | -<!-- | |
3 | -@license | |
4 | -Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | |
6 | -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
7 | -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | |
8 | -Code distributed by Google as part of the polymer project is also | |
9 | -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | |
10 | ---> | |
11 | - | |
12 | -<html> | |
13 | -<head> | |
14 | - | |
15 | - <title>iron-meta-basic</title> | |
16 | - <meta charset="utf-8"> | |
17 | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
18 | - | |
19 | - <script src="../../webcomponentsjs/webcomponents-lite.js"></script> | |
20 | - <script src="../../web-component-tester/browser.js"></script> | |
21 | - | |
22 | - <link rel="import" href="../iron-meta.html"> | |
23 | - | |
24 | -</head> | |
25 | -<body> | |
26 | - | |
27 | - <iron-meta key="info" value="foo/bar"></iron-meta> | |
28 | - | |
29 | - <script> | |
30 | - | |
31 | - suite('basic', function() { | |
32 | - | |
33 | - test('byKey', function() { | |
34 | - var meta = document.createElement('iron-meta'); | |
35 | - assert.equal(meta.byKey('info'), 'foo/bar'); | |
36 | - }); | |
37 | - | |
38 | - test('list', function() { | |
39 | - var meta = document.createElement('iron-meta'); | |
40 | - assert.equal(meta.list.length, 1); | |
41 | - }); | |
42 | - | |
43 | - }); | |
44 | - | |
45 | - </script> | |
46 | - | |
47 | -</body> | |
48 | -</html> | |
1 | +<!doctype html> | |
2 | +<!-- | |
3 | +@license | |
4 | +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | |
6 | +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
7 | +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | |
8 | +Code distributed by Google as part of the polymer project is also | |
9 | +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | |
10 | +--> | |
11 | + | |
12 | +<html> | |
13 | +<head> | |
14 | + | |
15 | + <title>iron-meta-basic</title> | |
16 | + <meta charset="utf-8"> | |
17 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
18 | + | |
19 | + <script src="../../webcomponentsjs/webcomponents-lite.js"></script> | |
20 | + <script src="../../web-component-tester/browser.js"></script> | |
21 | + | |
22 | + <link rel="import" href="../iron-meta.html"> | |
23 | + | |
24 | +</head> | |
25 | +<body> | |
26 | + | |
27 | + <iron-meta key="info" value="foo/bar"></iron-meta> | |
28 | + | |
29 | + <script> | |
30 | + | |
31 | + suite('basic', function() { | |
32 | + | |
33 | + test('byKey', function() { | |
34 | + var meta = document.createElement('iron-meta'); | |
35 | + assert.equal(meta.byKey('info'), 'foo/bar'); | |
36 | + }); | |
37 | + | |
38 | + test('list', function() { | |
39 | + var meta = document.createElement('iron-meta'); | |
40 | + assert.equal(meta.list.length, 1); | |
41 | + }); | |
42 | + | |
43 | + }); | |
44 | + | |
45 | + </script> | |
46 | + | |
47 | +</body> | |
48 | +</html> | ... | ... |
bower_components/iron-meta/test/index.html
100755 โ 100644
1 | -<!doctype html> | |
2 | -<!-- | |
3 | -@license | |
4 | -Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | |
6 | -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
7 | -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | |
8 | -Code distributed by Google as part of the polymer project is also | |
9 | -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | |
10 | ---> | |
11 | - | |
12 | -<html> | |
13 | -<head> | |
14 | - | |
15 | - <meta charset="utf-8"> | |
16 | - <title>Tests</title> | |
17 | - <script src="../../web-component-tester/browser.js"></script> | |
18 | - | |
19 | -</head> | |
20 | -<body> | |
21 | - | |
22 | - <script> | |
23 | - WCT.loadSuites([ | |
24 | - 'basic.html', | |
25 | - 'iron-meta.html' | |
26 | - ]); | |
27 | - </script> | |
28 | - | |
29 | -</body> | |
30 | -</html> | |
1 | +<!doctype html> | |
2 | +<!-- | |
3 | +@license | |
4 | +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | |
6 | +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
7 | +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | |
8 | +Code distributed by Google as part of the polymer project is also | |
9 | +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | |
10 | +--> | |
11 | + | |
12 | +<html> | |
13 | +<head> | |
14 | + | |
15 | + <meta charset="utf-8"> | |
16 | + <title>Tests</title> | |
17 | + <script src="../../web-component-tester/browser.js"></script> | |
18 | + | |
19 | +</head> | |
20 | +<body> | |
21 | + | |
22 | + <script> | |
23 | + WCT.loadSuites([ | |
24 | + 'basic.html', | |
25 | + 'iron-meta.html' | |
26 | + ]); | |
27 | + </script> | |
28 | + | |
29 | +</body> | |
30 | +</html> | ... | ... |
bower_components/iron-meta/test/iron-meta.html
100755 โ 100644
1 | -<!doctype html> | |
2 | -<!-- | |
3 | -@license | |
4 | -Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | -This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | |
6 | -The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
7 | -The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | |
8 | -Code distributed by Google as part of the polymer project is also | |
9 | -subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | |
10 | ---> | |
11 | - | |
12 | -<html> | |
13 | - <head> | |
14 | - | |
15 | - <title>iron-meta</title> | |
16 | - <meta charset="utf-8"> | |
17 | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
18 | - | |
19 | - <script src="../../webcomponentsjs/webcomponents-lite.js"></script> | |
20 | - <script src="../../web-component-tester/browser.js"></script> | |
21 | - <script src="../../test-fixture/test-fixture-mocha.js"></script> | |
22 | - | |
23 | - <link rel="import" href="../iron-meta.html"> | |
24 | - <link rel="import" href="../../test-fixture/test-fixture.html"> | |
25 | - | |
26 | - </head> | |
27 | - <body> | |
28 | - | |
29 | - <test-fixture id="TrivialMeta"> | |
30 | - <template> | |
31 | - <iron-meta self key="info"></iron-meta> | |
32 | - </template> | |
33 | - </test-fixture> | |
34 | - | |
35 | - <test-fixture id="ManyMetas"> | |
36 | - <template> | |
37 | - <iron-meta self key="default1"></iron-meta> | |
38 | - <iron-meta self key="default2"></iron-meta> | |
39 | - <iron-meta self key="default3"></iron-meta> | |
40 | - </template> | |
41 | - </test-fixture> | |
42 | - | |
43 | - <test-fixture id="DifferentTypedMetas"> | |
44 | - <template> | |
45 | - <iron-meta self type="foo" key="foobarKey"></iron-meta> | |
46 | - <iron-meta self type="bar" key="foobarKey"></iron-meta> | |
47 | - <iron-meta self key="defaultKey"></iron-meta> | |
48 | - </template> | |
49 | - </test-fixture> | |
50 | - | |
51 | - <test-fixture id="ClashingMetas"> | |
52 | - <template> | |
53 | - <iron-meta self key="baz"></iron-meta> | |
54 | - <iron-meta self key="baz"></iron-meta> | |
55 | - </template> | |
56 | - </test-fixture> | |
57 | - | |
58 | - <script> | |
59 | -suite('<iron-meta>', function () { | |
60 | - suite('basic behavior', function () { | |
61 | - var meta; | |
62 | - | |
63 | - setup(function () { | |
64 | - meta = fixture('TrivialMeta'); | |
65 | - }); | |
66 | - | |
67 | - teardown(function () { | |
68 | - meta.key = null; | |
69 | - }); | |
70 | - | |
71 | - test('uses itself as the default value', function () { | |
72 | - expect(meta.value).to.be.equal(meta); | |
73 | - }); | |
74 | - | |
75 | - test('can be assigned alternative values', function () { | |
76 | - meta.value = 'foobar'; | |
77 | - | |
78 | - expect(meta.list[0]).to.be.equal('foobar'); | |
79 | - }); | |
80 | - | |
81 | - test('can access same-type meta values by key', function () { | |
82 | - expect(meta.byKey(meta.key)).to.be.equal(meta.value); | |
83 | - }); | |
84 | - | |
85 | - test('yields a list of same-type meta data', function () { | |
86 | - expect(meta.list).to.be.ok; | |
87 | - expect(meta.list.length).to.be.equal(1); | |
88 | - expect(meta.list[0]).to.be.equal(meta); | |
89 | - }); | |
90 | - }); | |
91 | - | |
92 | - suite('many same-typed metas', function () { | |
93 | - var metas; | |
94 | - | |
95 | - setup(function () { | |
96 | - metas = fixture('ManyMetas'); | |
97 | - }); | |
98 | - | |
99 | - teardown(function () { | |
100 | - metas.forEach(function (meta) { | |
101 | - meta.key = null; | |
102 | - }); | |
103 | - }); | |
104 | - | |
105 | - test('all cache all meta values', function () { | |
106 | - metas.forEach(function (meta, index) { | |
107 | - expect(meta.list.length).to.be.equal(metas.length); | |
108 | - expect(meta.list[index].value).to.be.equal(meta.value); | |
109 | - }); | |
110 | - }); | |
111 | - | |
112 | - test('can be unregistered individually', function () { | |
113 | - metas[0].key = null; | |
114 | - | |
115 | - expect(metas[0].list.length).to.be.equal(2); | |
116 | - expect(metas[0].list).to.be.deep.equal([metas[1], metas[2]]) | |
117 | - }); | |
118 | - | |
119 | - test('can access each others value by key', function () { | |
120 | - expect(metas[0].byKey('default2')).to.be.equal(metas[1].value); | |
121 | - }); | |
122 | - }); | |
123 | - | |
124 | - suite('different-typed metas', function () { | |
125 | - var metas; | |
126 | - | |
127 | - setup(function () { | |
128 | - metas = fixture('DifferentTypedMetas'); | |
129 | - }); | |
130 | - | |
131 | - teardown(function () { | |
132 | - metas.forEach(function (meta) { | |
133 | - meta.key = null; | |
134 | - }); | |
135 | - }); | |
136 | - | |
137 | - test('cache their values separately', function () { | |
138 | - var fooMeta = metas[0]; | |
139 | - var barMeta = metas[1]; | |
140 | - | |
141 | - expect(fooMeta.value).to.not.be.equal(barMeta.value); | |
142 | - expect(fooMeta.byKey('foobarKey')).to.be.equal(fooMeta.value); | |
143 | - expect(barMeta.byKey('foobarKey')).to.be.equal(barMeta.value); | |
144 | - }); | |
145 | - | |
146 | - test('cannot access values of other types', function () { | |
147 | - var defaultMeta = metas[2]; | |
148 | - | |
149 | - expect(defaultMeta.byKey('foobarKey')).to.be.equal(undefined); | |
150 | - }); | |
151 | - | |
152 | - test('only list values of their type', function () { | |
153 | - metas.forEach(function (meta) { | |
154 | - expect(meta.list.length).to.be.equal(1); | |
155 | - expect(meta.list[0]).to.be.equal(meta.value); | |
156 | - }) | |
157 | - }); | |
158 | - }); | |
159 | - | |
160 | - suite('metas with clashing keys', function () { | |
161 | - var metaPair; | |
162 | - | |
163 | - setup(function () { | |
164 | - metaPair = fixture('ClashingMetas'); | |
165 | - }); | |
166 | - | |
167 | - teardown(function () { | |
168 | - metaPair.forEach(function (meta) { | |
169 | - meta.key = null; | |
170 | - }); | |
171 | - }); | |
172 | - | |
173 | - test('let the last value win registration against the key', function () { | |
174 | - var registeredValue = metaPair[0].byKey(metaPair[0].key); | |
175 | - var firstValue = metaPair[0].value; | |
176 | - var secondValue = metaPair[1].value; | |
177 | - | |
178 | - expect(registeredValue).to.not.be.equal(firstValue); | |
179 | - expect(registeredValue).to.be.equal(secondValue); | |
180 | - }); | |
181 | - }); | |
182 | -}); | |
183 | - </script> | |
184 | - | |
185 | - </body> | |
186 | -</html> | |
1 | +<!doctype html> | |
2 | +<!-- | |
3 | +@license | |
4 | +Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | |
5 | +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | |
6 | +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
7 | +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | |
8 | +Code distributed by Google as part of the polymer project is also | |
9 | +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | |
10 | +--> | |
11 | + | |
12 | +<html> | |
13 | + <head> | |
14 | + | |
15 | + <title>iron-meta</title> | |
16 | + <meta charset="utf-8"> | |
17 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
18 | + | |
19 | + <script src="../../webcomponentsjs/webcomponents-lite.js"></script> | |
20 | + <script src="../../web-component-tester/browser.js"></script> | |
21 | + <script src="../../test-fixture/test-fixture-mocha.js"></script> | |
22 | + | |
23 | + <link rel="import" href="../iron-meta.html"> | |
24 | + <link rel="import" href="../../test-fixture/test-fixture.html"> | |
25 | + | |
26 | + </head> | |
27 | + <body> | |
28 | + | |
29 | + <test-fixture id="TrivialMeta"> | |
30 | + <template> | |
31 | + <iron-meta self key="info"></iron-meta> | |
32 | + </template> | |
33 | + </test-fixture> | |
34 | + | |
35 | + <test-fixture id="ManyMetas"> | |
36 | + <template> | |
37 | + <iron-meta self key="default1"></iron-meta> | |
38 | + <iron-meta self key="default2"></iron-meta> | |
39 | + <iron-meta self key="default3"></iron-meta> | |
40 | + </template> | |
41 | + </test-fixture> | |
42 | + | |
43 | + <test-fixture id="DifferentTypedMetas"> | |
44 | + <template> | |
45 | + <iron-meta self type="foo" key="foobarKey"></iron-meta> | |
46 | + <iron-meta self type="bar" key="foobarKey"></iron-meta> | |
47 | + <iron-meta self key="defaultKey"></iron-meta> | |
48 | + </template> | |
49 | + </test-fixture> | |
50 | + | |
51 | + <test-fixture id="ClashingMetas"> | |
52 | + <template> | |
53 | + <iron-meta self key="baz"></iron-meta> | |
54 | + <iron-meta self key="baz"></iron-meta> | |
55 | + </template> | |
56 | + </test-fixture> | |
57 | + | |
58 | + <script> | |
59 | +suite('<iron-meta>', function () { | |
60 | + suite('basic behavior', function () { | |
61 | + var meta; | |
62 | + | |
63 | + setup(function () { | |
64 | + meta = fixture('TrivialMeta'); | |
65 | + }); | |
66 | + | |
67 | + teardown(function () { | |
68 | + meta.key = null; | |
69 | + }); | |
70 | + | |
71 | + test('uses itself as the default value', function () { | |
72 | + expect(meta.value).to.be.equal(meta); | |
73 | + }); | |
74 | + | |
75 | + test('can be assigned alternative values', function () { | |
76 | + meta.value = 'foobar'; | |
77 | + | |
78 | + expect(meta.list[0]).to.be.equal('foobar'); | |
79 | + }); | |
80 | + | |
81 | + test('can access same-type meta values by key', function () { | |
82 | + expect(meta.byKey(meta.key)).to.be.equal(meta.value); | |
83 | + }); | |
84 | + | |
85 | + test('yields a list of same-type meta data', function () { | |
86 | + expect(meta.list).to.be.ok; | |
87 | + expect(meta.list.length).to.be.equal(1); | |
88 | + expect(meta.list[0]).to.be.equal(meta); | |
89 | + }); | |
90 | + }); | |
91 | + | |
92 | + suite('many same-typed metas', function () { | |
93 | + var metas; | |
94 | + | |
95 | + setup(function () { | |
96 | + metas = fixture('ManyMetas'); | |
97 | + }); | |
98 | + | |
99 | + teardown(function () { | |
100 | + metas.forEach(function (meta) { | |
101 | + meta.key = null; | |
102 | + }); | |
103 | + }); | |
104 | + | |
105 | + test('all cache all meta values', function () { | |
106 | + metas.forEach(function (meta, index) { | |
107 | + expect(meta.list.length).to.be.equal(metas.length); | |
108 | + expect(meta.list[index].value).to.be.equal(meta.value); | |
109 | + }); | |
110 | + }); | |
111 | + | |
112 | + test('can be unregistered individually', function () { | |
113 | + metas[0].key = null; | |
114 | + | |
115 | + expect(metas[0].list.length).to.be.equal(2); | |
116 | + expect(metas[0].list).to.be.deep.equal([metas[1], metas[2]]) | |
117 | + }); | |
118 | + | |
119 | + test('can access each others value by key', function () { | |
120 | + expect(metas[0].byKey('default2')).to.be.equal(metas[1].value); | |
121 | + }); | |
122 | + }); | |
123 | + | |
124 | + suite('different-typed metas', function () { | |
125 | + var metas; | |
126 | + | |
127 | + setup(function () { | |
128 | + metas = fixture('DifferentTypedMetas'); | |
129 | + }); | |
130 | + | |
131 | + teardown(function () { | |
132 | + metas.forEach(function (meta) { | |
133 | + meta.key = null; | |
134 | + }); | |
135 | + }); | |
136 | + | |
137 | + test('cache their values separately', function () { | |
138 | + var fooMeta = metas[0]; | |
139 | + var barMeta = metas[1]; | |
140 | + | |
141 | + expect(fooMeta.value).to.not.be.equal(barMeta.value); | |
142 | + expect(fooMeta.byKey('foobarKey')).to.be.equal(fooMeta.value); | |
143 | + expect(barMeta.byKey('foobarKey')).to.be.equal(barMeta.value); | |
144 | + }); | |
145 | + | |
146 | + test('cannot access values of other types', function () { | |
147 | + var defaultMeta = metas[2]; | |
148 | + | |
149 | + expect(defaultMeta.byKey('foobarKey')).to.be.equal(undefined); | |
150 | + }); | |
151 | + | |
152 | + test('only list values of their type', function () { | |
153 | + metas.forEach(function (meta) { | |
154 | + expect(meta.list.length).to.be.equal(1); | |
155 | + expect(meta.list[0]).to.be.equal(meta.value); | |
156 | + }) | |
157 | + }); | |
158 | + }); | |
159 | + | |
160 | + suite('metas with clashing keys', function () { | |
161 | + var metaPair; | |
162 | + | |
163 | + setup(function () { | |
164 | + metaPair = fixture('ClashingMetas'); | |
165 | + }); | |
166 | + | |
167 | + teardown(function () { | |
168 | + metaPair.forEach(function (meta) { | |
169 | + meta.key = null; | |
170 | + }); | |
171 | + }); | |
172 | + | |
173 | + test('let the last value win registration against the key', function () { | |
174 | + var registeredValue = metaPair[0].byKey(metaPair[0].key); | |
175 | + var firstValue = metaPair[0].value; | |
176 | + var secondValue = metaPair[1].value; | |
177 | + | |
178 | + expect(registeredValue).to.not.be.equal(firstValue); | |
179 | + expect(registeredValue).to.be.equal(secondValue); | |
180 | + }); | |
181 | + }); | |
182 | + | |
183 | + suite('singleton', function () { | |
184 | + | |
185 | + test('only one ironmeta created', function () { | |
186 | + var first = Polymer.IronMeta.getIronMeta(); | |
187 | + var second = Polymer.IronMeta.getIronMeta(); | |
188 | + expect(first).to.be.equal(second); | |
189 | + }); | |
190 | + }); | |
191 | +}); | |
192 | + </script> | |
193 | + | |
194 | + </body> | |
195 | +</html> | ... | ... |
bower_components/iron-test-helpers/.bower.json
1 | 1 | { |
2 | 2 | "name": "iron-test-helpers", |
3 | - "version": "1.0.5", | |
3 | + "version": "1.0.6", | |
4 | 4 | "authors": [ |
5 | 5 | "The Polymer Authors" |
6 | 6 | ], |
... | ... | @@ -25,11 +25,11 @@ |
25 | 25 | "devDependencies": { |
26 | 26 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" |
27 | 27 | }, |
28 | - "_release": "1.0.5", | |
28 | + "_release": "1.0.6", | |
29 | 29 | "_resolution": { |
30 | 30 | "type": "version", |
31 | - "tag": "v1.0.5", | |
32 | - "commit": "336a99b2559ebd79f6eb7d29cc186f68e05b95d6" | |
31 | + "tag": "v1.0.6", | |
32 | + "commit": "940e5b8c5c7c878f51cf259019d3e3243f18d0b3" | |
33 | 33 | }, |
34 | 34 | "_source": "git://github.com/PolymerElements/iron-test-helpers.git", |
35 | 35 | "_target": "^1.0.0", | ... | ... |
bower_components/iron-test-helpers/bower.json
bower_components/iron-test-helpers/mock-interactions.js
bower_components/paper-behaviors/.bower.json
1 | 1 | { |
2 | 2 | "name": "paper-behaviors", |
3 | - "version": "1.0.7", | |
3 | + "version": "1.0.9", | |
4 | 4 | "description": "Common behaviors across the paper elements", |
5 | 5 | "authors": [ |
6 | 6 | "The Polymer Authors" |
7 | 7 | ], |
8 | 8 | "main": [ |
9 | 9 | "paper-button-behavior.html", |
10 | + "paper-checked-element-behavior.html", | |
10 | 11 | "paper-inky-focus-behavior.html" |
11 | 12 | ], |
12 | 13 | "keywords": [ |
... | ... | @@ -37,11 +38,11 @@ |
37 | 38 | "web-component-tester": "*", |
38 | 39 | "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" |
39 | 40 | }, |
40 | - "_release": "1.0.7", | |
41 | + "_release": "1.0.9", | |
41 | 42 | "_resolution": { |
42 | 43 | "type": "version", |
43 | - "tag": "v1.0.7", | |
44 | - "commit": "7a674a3635fcb6db4842d16d3fd768ab07d638a8" | |
44 | + "tag": "v1.0.9", | |
45 | + "commit": "d9c0398cbaf3881bef3533b5b2b6127fc4d0960c" | |
45 | 46 | }, |
46 | 47 | "_source": "git://github.com/PolymerElements/paper-behaviors.git", |
47 | 48 | "_target": "^1.0.0", | ... | ... |
bower_components/paper-behaviors/bower.json
1 | 1 | { |
2 | 2 | "name": "paper-behaviors", |
3 | - "version": "1.0.7", | |
3 | + "version": "1.0.9", | |
4 | 4 | "description": "Common behaviors across the paper elements", |
5 | 5 | "authors": [ |
6 | 6 | "The Polymer Authors" |
7 | 7 | ], |
8 | 8 | "main": [ |
9 | 9 | "paper-button-behavior.html", |
10 | + "paper-checked-element-behavior.html", | |
10 | 11 | "paper-inky-focus-behavior.html" |
11 | 12 | ], |
12 | 13 | "keywords": [ | ... | ... |
bower_components/paper-behaviors/paper-inky-focus-behavior.html
... | ... | @@ -17,7 +17,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
17 | 17 | /** |
18 | 18 | * `Polymer.PaperInkyFocusBehavior` implements a ripple when the element has keyboard focus. |
19 | 19 | * |
20 | - * @polymerBehavior Polymer.PaperInkyFocusBehaviorImpl | |
20 | + * @polymerBehavior Polymer.PaperInkyFocusBehavior | |
21 | 21 | */ |
22 | 22 | Polymer.PaperInkyFocusBehaviorImpl = { |
23 | 23 | ... | ... |
bower_components/paper-card/.bower.json
100755 โ 100644
1 | 1 | { |
2 | 2 | "name": "paper-card", |
3 | - "version": "1.0.6", | |
3 | + "version": "1.0.7", | |
4 | 4 | "description": "Material design piece of paper with unique related data", |
5 | 5 | "authors": [ |
6 | 6 | "The Polymer Authors" |
... | ... | @@ -36,11 +36,11 @@ |
36 | 36 | "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", |
37 | 37 | "paper-styles": "PolymerElements/paper-styles#^1.0.0" |
38 | 38 | }, |
39 | - "_release": "1.0.6", | |
39 | + "_release": "1.0.7", | |
40 | 40 | "_resolution": { |
41 | 41 | "type": "version", |
42 | - "tag": "v1.0.6", | |
43 | - "commit": "f2f4bf05e7b3746b39b9ad1d468d8031b236e2b6" | |
42 | + "tag": "v1.0.7", | |
43 | + "commit": "a1a0b2789b657a9b2bce17483ecc495ce968b104" | |
44 | 44 | }, |
45 | 45 | "_source": "git://github.com/PolymerElements/paper-card.git", |
46 | 46 | "_target": "~1.0.3", | ... | ... |
bower_components/paper-card/.gitignore
100755 โ 100644
bower_components/paper-card/README.md
100755 โ 100644
bower_components/paper-card/bower.json
100755 โ 100644
bower_components/paper-card/demo/index.html
100755 โ 100644
bower_components/paper-card/index.html
100755 โ 100644
bower_components/paper-card/paper-card.html
100755 โ 100644
... | ... | @@ -13,7 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN |
13 | 13 | <link rel="import" href="../iron-flex-layout/iron-flex-layout.html"> |
14 | 14 | |
15 | 15 | <!-- |
16 | -Material Design: <a href="http://www.google.com/design/spec/components/cards.html">Cards</a> | |
16 | +Material design: [Cards](https://www.google.com/design/spec/components/cards.html) | |
17 | 17 | |
18 | 18 | `paper-card` is a container with a drop shadow. |
19 | 19 | |
... | ... | @@ -31,7 +31,7 @@ Example - top card image: |
31 | 31 | <paper-card heading="Card Title" image="/path/to/image.png"> |
32 | 32 | ... |
33 | 33 | </paper-card> |
34 | - | |
34 | + | |
35 | 35 | ### Accessibility |
36 | 36 | |
37 | 37 | By default, the `aria-label` will be set to the value of the `heading` attribute. |
... | ... | @@ -58,7 +58,7 @@ Custom property | Description | Default |
58 | 58 | |
59 | 59 | <dom-module id="paper-card"> |
60 | 60 | <template> |
61 | - <style> | |
61 | + <style include="paper-material"> | |
62 | 62 | :host { |
63 | 63 | display: inline-block; |
64 | 64 | position: relative; |
... | ... | @@ -69,11 +69,6 @@ Custom property | Description | Default |
69 | 69 | @apply(--paper-card); |
70 | 70 | } |
71 | 71 | |
72 | - paper-material { | |
73 | - border-radius: inherit; | |
74 | - @apply(--layout-fit); | |
75 | - } | |
76 | - | |
77 | 72 | /* IE 10 support for HTML5 hidden attr */ |
78 | 73 | [hidden] { |
79 | 74 | display: none !important; |
... | ... | @@ -81,6 +76,9 @@ Custom property | Description | Default |
81 | 76 | |
82 | 77 | .header { |
83 | 78 | position: relative; |
79 | + border-top-left-radius: inherit; | |
80 | + border-top-right-radius: inherit; | |
81 | + overflow: hidden; | |
84 | 82 | @apply(--paper-card-header); |
85 | 83 | } |
86 | 84 | |
... | ... | @@ -118,8 +116,6 @@ Custom property | Description | Default |
118 | 116 | } |
119 | 117 | </style> |
120 | 118 | |
121 | - <paper-material animated$="[[animatedShadow]]" elevation="[[elevation]]"></paper-material> | |
122 | - | |
123 | 119 | <div class="header"> |
124 | 120 | <img hidden$="[[!image]]" src="[[image]]"> |
125 | 121 | <div hidden$="[[!heading]]" class$="[[_computeHeadingClass(image)]]">[[heading]]</div> |
... | ... | @@ -160,7 +156,8 @@ Custom property | Description | Default |
160 | 156 | */ |
161 | 157 | elevation: { |
162 | 158 | type: Number, |
163 | - value: 1 | |
159 | + value: 1, | |
160 | + reflectToAttribute: true | |
164 | 161 | }, |
165 | 162 | |
166 | 163 | /** |
... | ... | @@ -170,6 +167,17 @@ Custom property | Description | Default |
170 | 167 | animatedShadow: { |
171 | 168 | type: Boolean, |
172 | 169 | value: false |
170 | + }, | |
171 | + | |
172 | + /** | |
173 | + * Read-only property used to pass down the `animatedShadow` value to | |
174 | + * the underlying paper-material style (since they have different names). | |
175 | + */ | |
176 | + animated: { | |
177 | + type: Boolean, | |
178 | + reflectToAttribute: true, | |
179 | + readOnly: true, | |
180 | + computed: '_computeAnimated(animatedShadow)' | |
173 | 181 | } |
174 | 182 | }, |
175 | 183 | |
... | ... | @@ -183,6 +191,10 @@ Custom property | Description | Default |
183 | 191 | if (image) |
184 | 192 | cls += ' over-image'; |
185 | 193 | return cls; |
194 | + }, | |
195 | + | |
196 | + _computeAnimated: function(animatedShadow) { | |
197 | + return animatedShadow; | |
186 | 198 | } |
187 | 199 | }); |
188 | 200 | </script> | ... | ... |
bower_components/paper-card/test/basic.html
100755 โ 100644
bower_components/paper-card/test/index.html
100755 โ 100644
bower_components/paper-input/.bower.json
1 | 1 | { |
2 | 2 | "name": "paper-input", |
3 | - "version": "1.0.16", | |
3 | + "version": "1.0.18", | |
4 | 4 | "description": "Material design text fields", |
5 | 5 | "authors": [ |
6 | 6 | "The Polymer Authors" |
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | "homepage": "https://github.com/PolymerElements/paper-input", |
28 | 28 | "ignore": [], |
29 | 29 | "dependencies": { |
30 | - "polymer": "Polymer/polymer#^1.1.0", | |
30 | + "polymer": "Polymer/polymer#^1.2.0", | |
31 | 31 | "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0", |
32 | 32 | "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0", |
33 | 33 | "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0", |
... | ... | @@ -44,13 +44,13 @@ |
44 | 44 | "iron-validator-behavior": "PolymerElements/iron-validator-behavior#^1.0.0", |
45 | 45 | "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0" |
46 | 46 | }, |
47 | - "_release": "1.0.16", | |
47 | + "_release": "1.0.18", | |
48 | 48 | "_resolution": { |
49 | 49 | "type": "version", |
50 | - "tag": "v1.0.16", | |
51 | - "commit": "98a5b3a01ecfcdd85d9dccf6d3d708813fe1dfec" | |
50 | + "tag": "v1.0.18", | |
51 | + "commit": "8bb2b1972158d3a28ca3a350003b8ca78c147b53" | |
52 | 52 | }, |
53 | - "_source": "git://github.com/PolymerElements/paper-input.git", | |
54 | - "_target": "^1.0.0", | |
55 | - "_originalSource": "PolymerElements/paper-input" | |
53 | + "_source": "git://github.com/polymerelements/paper-input.git", | |
54 | + "_target": "^1.0.9", | |
55 | + "_originalSource": "polymerelements/paper-input" | |
56 | 56 | } |
57 | 57 | \ No newline at end of file | ... | ... |
bower_components/paper-input/bower.json
1 | 1 | { |
2 | 2 | "name": "paper-input", |
3 | - "version": "1.0.16", | |
3 | + "version": "1.0.18", | |
4 | 4 | "description": "Material design text fields", |
5 | 5 | "authors": [ |
6 | 6 | "The Polymer Authors" |
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | "homepage": "https://github.com/PolymerElements/paper-input", |
28 | 28 | "ignore": [], |
29 | 29 | "dependencies": { |
30 | - "polymer": "Polymer/polymer#^1.1.0", | |
30 | + "polymer": "Polymer/polymer#^1.2.0", | |
31 | 31 | "iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0", |
32 | 32 | "iron-behaviors": "PolymerElements/iron-behaviors#^1.0.0", |
33 | 33 | "iron-form-element-behavior": "PolymerElements/iron-form-element-behavior#^1.0.0", | ... | ... |
bower_components/paper-input/paper-input-char-counter.html
bower_components/paper-input/paper-input-container.html
... | ... | @@ -195,11 +195,12 @@ This element is `display:block` by default, but you can set the `inline` attribu |
195 | 195 | .input-content.label-is-floating ::content .paper-input-label { |
196 | 196 | -webkit-transform: translateY(-75%) scale(0.75); |
197 | 197 | transform: translateY(-75%) scale(0.75); |
198 | - -webkit-transform-origin: left top; | |
199 | - transform-origin: left top; | |
200 | 198 | -webkit-transition: -webkit-transform 0.25s; |
201 | 199 | transition: transform 0.25s; |
202 | 200 | |
201 | + -webkit-transform-origin: left top; | |
202 | + transform-origin: left top; | |
203 | + | |
203 | 204 | /* Since we scale to 75/100 of the size, we actually have 100/75 of the |
204 | 205 | original space now available */ |
205 | 206 | width: 133%; |
... | ... | @@ -207,6 +208,16 @@ This element is `display:block` by default, but you can set the `inline` attribu |
207 | 208 | @apply(--paper-transition-easing); |
208 | 209 | } |
209 | 210 | |
211 | + :host-context([dir="rtl"]) .input-content.label-is-floating ::content label, | |
212 | + :host-context([dir="rtl"]) .input-content.label-is-floating ::content .paper-input-label { | |
213 | + /* TODO(noms): Figure out why leaving the width at 133% before the animation | |
214 | + * actually makes | |
215 | + * it wider on the right side, not left side, as you would expect in RTL */ | |
216 | + width: 100%; | |
217 | + -webkit-transform-origin: right top; | |
218 | + transform-origin: right top; | |
219 | + } | |
220 | + | |
210 | 221 | .input-content.label-is-highlighted ::content label, |
211 | 222 | .input-content.label-is-highlighted ::content .paper-input-label { |
212 | 223 | color: var(--paper-input-container-focus-color, --default-primary-color); |
... | ... | @@ -237,6 +248,7 @@ This element is `display:block` by default, but you can set the `inline` attribu |
237 | 248 | border: none; |
238 | 249 | color: var(--paper-input-container-input-color, --primary-text-color); |
239 | 250 | -webkit-appearance: none; |
251 | + text-align: inherit; | |
240 | 252 | |
241 | 253 | @apply(--paper-font-subhead); |
242 | 254 | @apply(--paper-input-container-input); |
... | ... | @@ -261,6 +273,10 @@ This element is `display:block` by default, but you can set the `inline` attribu |
261 | 273 | resize: none; |
262 | 274 | } |
263 | 275 | |
276 | + .add-on-content { | |
277 | + position: relative; | |
278 | + } | |
279 | + | |
264 | 280 | .add-on-content.is-invalid ::content * { |
265 | 281 | color: var(--paper-input-container-invalid-color, --google-red-500); |
266 | 282 | } |
... | ... | @@ -276,7 +292,8 @@ This element is `display:block` by default, but you can set the `inline` attribu |
276 | 292 | |
277 | 293 | <div class$="[[_computeInputContentClass(noLabelFloat,alwaysFloatLabel,focused,invalid,_inputHasContent)]]"> |
278 | 294 | <content select="[prefix]" id="prefix"></content> |
279 | - <div class="label-and-input-container"> | |
295 | + | |
296 | + <div class="label-and-input-container" id="labelAndInputContainer"> | |
280 | 297 | <content select=":not([add-on]):not([prefix]):not([suffix])"></content> |
281 | 298 | </div> |
282 | 299 | <content select="[suffix]"></content> |
... | ... | @@ -439,6 +456,21 @@ This element is `display:block` by default, but you can set the `inline` attribu |
439 | 456 | } else { |
440 | 457 | this._handleValue(this._inputElement); |
441 | 458 | } |
459 | + | |
460 | + this._numberOfPrefixNodes = 0; | |
461 | + this._prefixObserver = Polymer.dom(this.$.prefix).observeNodes( | |
462 | + function(mutations) { | |
463 | + // Keep track whether there's at least one prefix node, since it | |
464 | + // affects laying out the floating label. | |
465 | + this._numberOfPrefixNodes += mutations.addedNodes.length - | |
466 | + mutations.removedNodes.length; | |
467 | + }.bind(this)); | |
468 | + }, | |
469 | + | |
470 | + detached: function() { | |
471 | + if (this._prefixObserver) { | |
472 | + Polymer.dom(this.$.prefix).unobserveNodes(this._prefixObserver); | |
473 | + } | |
442 | 474 | }, |
443 | 475 | |
444 | 476 | _onAddonAttached: function(event) { |
... | ... | @@ -535,16 +567,15 @@ This element is `display:block` by default, but you can set the `inline` attribu |
535 | 567 | } else if (focused) { |
536 | 568 | cls += " label-is-highlighted"; |
537 | 569 | } |
538 | - // The label might have a horizontal offset if a prefix element exists | |
570 | + // If a prefix element exists, the label has a horizontal offset | |
539 | 571 | // which needs to be undone when displayed as a floating label. |
540 | - if (Polymer.dom(this.$.prefix).getDistributedNodes().length > 0 && | |
541 | - label && label.offsetParent) { | |
542 | - label.style.left = -label.offsetParent.offsetLeft + 'px'; | |
572 | + if (this._numberOfPrefixNodes > 0) { | |
573 | + this.$.labelAndInputContainer.style.position = 'static'; | |
543 | 574 | } |
544 | 575 | } else { |
545 | 576 | // When the label is not floating, it should overlap the input element. |
546 | 577 | if (label) { |
547 | - label.style.left = 0; | |
578 | + this.$.labelAndInputContainer.style.position = 'relative'; | |
548 | 579 | } |
549 | 580 | } |
550 | 581 | } else { | ... | ... |
bower_components/paper-input/paper-input-error.html
... | ... | @@ -43,6 +43,8 @@ Custom property | Description | Default |
43 | 43 | @apply(--paper-font-caption); |
44 | 44 | @apply(--paper-input-error); |
45 | 45 | position: absolute; |
46 | + left:0; | |
47 | + right:0; | |
46 | 48 | } |
47 | 49 | |
48 | 50 | :host([invalid]) { |
... | ... | @@ -51,7 +53,7 @@ Custom property | Description | Default |
51 | 53 | </style> |
52 | 54 | |
53 | 55 | <content></content> |
54 | - | |
56 | + | |
55 | 57 | </template> |
56 | 58 | </dom-module> |
57 | 59 | ... | ... |
bower_components/paper-menu-button/.bower.json
100755 โ 100644
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 | "tag": "v1.0.3", |
48 | 48 | "commit": "24abacffd443f967125f5eae580eadc7b90f41c7" |
49 | 49 | }, |
50 | - "_source": "git://github.com/PolymerElements/paper-menu-button.git", | |
50 | + "_source": "git://github.com/polymerelements/paper-menu-button.git", | |
51 | 51 | "_target": "^1.0.0", |
52 | - "_originalSource": "PolymerElements/paper-menu-button" | |
52 | + "_originalSource": "polymerelements/paper-menu-button" | |
53 | 53 | } |
54 | 54 | \ No newline at end of file | ... | ... |
bower_components/paper-menu-button/.gitignore
100755 โ 100644
bower_components/paper-menu-button/README.md
100755 โ 100644
bower_components/paper-menu-button/bower.json
100755 โ 100644
bower_components/paper-menu-button/demo/index.html
100755 โ 100644
bower_components/paper-menu-button/index.html
100755 โ 100644
bower_components/paper-menu-button/paper-menu-button-animations.html
100755 โ 100644
bower_components/paper-menu-button/paper-menu-button.html
100755 โ 100644
bower_components/paper-menu-button/test/index.html
100755 โ 100644
bower_components/paper-menu-button/test/paper-menu-button.html
100755 โ 100644
bower_components/paper-styles/.bower.json
... | ... | @@ -36,6 +36,6 @@ |
36 | 36 | "commit": "8ac5128a38249982982b3a1b3533d417d2dd7f18" |
37 | 37 | }, |
38 | 38 | "_source": "git://github.com/PolymerElements/paper-styles.git", |
39 | - "_target": "^1.0.4", | |
39 | + "_target": "^1.0.0", | |
40 | 40 | "_originalSource": "PolymerElements/paper-styles" |
41 | 41 | } |
42 | 42 | \ No newline at end of file | ... | ... |
bower_components/polymer/.bower.json
1 | 1 | { |
2 | 2 | "name": "polymer", |
3 | - "version": "1.1.5", | |
3 | + "version": "1.2.0", | |
4 | 4 | "main": [ |
5 | 5 | "polymer.html" |
6 | 6 | ], |
... | ... | @@ -25,11 +25,11 @@ |
25 | 25 | }, |
26 | 26 | "private": true, |
27 | 27 | "homepage": "https://github.com/Polymer/polymer", |
28 | - "_release": "1.1.5", | |
28 | + "_release": "1.2.0", | |
29 | 29 | "_resolution": { |
30 | 30 | "type": "version", |
31 | - "tag": "v1.1.5", | |
32 | - "commit": "4c94736fac6681e84ec8c00da53484c5d3c2226b" | |
31 | + "tag": "v1.2.0", | |
32 | + "commit": "84d211624cffd04d6894ec90713c2029732e8bb5" | |
33 | 33 | }, |
34 | 34 | "_source": "git://github.com/Polymer/polymer.git", |
35 | 35 | "_target": "^1.0.0", | ... | ... |
bower_components/polymer/bower.json
bower_components/polymer/build.log
1 | 1 | BUILD LOG |
2 | 2 | --------- |
3 | -Build Time: 2015-10-08T14:06:39-0700 | |
3 | +Build Time: 2015-10-22T17:41:58-0700 | |
4 | 4 | |
5 | 5 | NODEJS INFORMATION |
6 | 6 | ================== |
7 | -nodejs: v4.1.2 | |
8 | -del: 1.2.0 | |
9 | -gulp-rename: 1.2.2 | |
7 | +nodejs: v4.2.1 | |
10 | 8 | gulp: 3.9.0 |
11 | 9 | gulp-audit: 1.0.0 |
12 | -gulp-replace: 0.5.3 | |
10 | +gulp-rename: 1.2.2 | |
13 | 11 | gulp-vulcanize: 6.0.1 |
14 | 12 | polyclean: 1.2.0 |
15 | 13 | lazypipe: 0.2.4 |
16 | -run-sequence: 1.1.1 | |
14 | +run-sequence: 1.1.4 | |
15 | +web-component-tester: 3.3.29 | |
16 | +del: 1.2.1 | |
17 | +gulp-replace: 0.5.4 | |
17 | 18 | |
18 | 19 | REPO REVISIONS |
19 | 20 | ============== |
20 | -polymer: 574855a644bcc25ee26c30e0dd881a395fad67b6 | |
21 | +polymer: ec6b18f3e4ff414e6f3692b6641c7506c910546c | |
21 | 22 | |
22 | 23 | BUILD HASHES |
23 | 24 | ============ |
24 | -polymer-mini.html: 72c032eacc45c63431054c111d0ce86357eb07f3 | |
25 | -polymer-micro.html: 62d773e546d387df86bc1b33a3cb61c3c1c9bc76 | |
26 | -polymer.html: 5c626b1aba3107c12cee378876d13b8780fdec67 | |
27 | 25 | \ No newline at end of file |
26 | +polymer-mini.html: d807c77658cac260deb34187c1351be45b414679 | |
27 | +polymer-micro.html: fe27c039dcd2aef07d2b9065ac30a5fd9448d887 | |
28 | +polymer.html: cecea00d47a8682ec01d486a3ac0d45da51eaf24 | |
28 | 29 | \ No newline at end of file | ... | ... |
bower_components/polymer/polymer-micro.html
... | ... | @@ -264,7 +264,7 @@ document.registerElement('dom-module', DomModule); |
264 | 264 | function forceDocumentUpgrade() { |
265 | 265 | if (cePolyfill) { |
266 | 266 | var script = document._currentScript || document.currentScript; |
267 | -var doc = script && script.ownerDocument; | |
267 | +var doc = script && script.ownerDocument || document; | |
268 | 268 | if (doc) { |
269 | 269 | CustomElements.upgradeAll(doc); |
270 | 270 | } |
... | ... | @@ -576,7 +576,7 @@ debouncer.stop(); |
576 | 576 | } |
577 | 577 | } |
578 | 578 | }); |
579 | -Polymer.version = '1.1.5'; | |
579 | +Polymer.version = '1.2.0'; | |
580 | 580 | Polymer.Base._addFeature({ |
581 | 581 | _registerFeatures: function () { |
582 | 582 | this._prepIs(); | ... | ... |
bower_components/polymer/polymer-mini.html
... | ... | @@ -270,61 +270,6 @@ return currentValue === previousValue; |
270 | 270 | }; |
271 | 271 | return new ArraySplice(); |
272 | 272 | }(); |
273 | -Polymer.EventApi = function () { | |
274 | -var Settings = Polymer.Settings; | |
275 | -var EventApi = function (event) { | |
276 | -this.event = event; | |
277 | -}; | |
278 | -if (Settings.useShadow) { | |
279 | -EventApi.prototype = { | |
280 | -get rootTarget() { | |
281 | -return this.event.path[0]; | |
282 | -}, | |
283 | -get localTarget() { | |
284 | -return this.event.target; | |
285 | -}, | |
286 | -get path() { | |
287 | -return this.event.path; | |
288 | -} | |
289 | -}; | |
290 | -} else { | |
291 | -EventApi.prototype = { | |
292 | -get rootTarget() { | |
293 | -return this.event.target; | |
294 | -}, | |
295 | -get localTarget() { | |
296 | -var current = this.event.currentTarget; | |
297 | -var currentRoot = current && Polymer.dom(current).getOwnerRoot(); | |
298 | -var p$ = this.path; | |
299 | -for (var i = 0; i < p$.length; i++) { | |
300 | -if (Polymer.dom(p$[i]).getOwnerRoot() === currentRoot) { | |
301 | -return p$[i]; | |
302 | -} | |
303 | -} | |
304 | -}, | |
305 | -get path() { | |
306 | -if (!this.event._path) { | |
307 | -var path = []; | |
308 | -var o = this.rootTarget; | |
309 | -while (o) { | |
310 | -path.push(o); | |
311 | -o = Polymer.dom(o).parentNode || o.host; | |
312 | -} | |
313 | -path.push(window); | |
314 | -this.event._path = path; | |
315 | -} | |
316 | -return this.event._path; | |
317 | -} | |
318 | -}; | |
319 | -} | |
320 | -var factory = function (event) { | |
321 | -if (!event.__eventApi) { | |
322 | -event.__eventApi = new EventApi(event); | |
323 | -} | |
324 | -return event.__eventApi; | |
325 | -}; | |
326 | -return { factory: factory }; | |
327 | -}(); | |
328 | 273 | Polymer.domInnerHTML = function () { |
329 | 274 | var escapeAttrRegExp = /[&\u00A0"]/g; |
330 | 275 | var escapeDataRegExp = /[&\u00A0<>]/g; |
... | ... | @@ -463,7 +408,7 @@ insertBefore: function (node, ref_node) { |
463 | 408 | return this._addNode(node, ref_node); |
464 | 409 | }, |
465 | 410 | _addNode: function (node, ref_node) { |
466 | -this._removeNodeFromHost(node, true); | |
411 | +this._removeNodeFromParent(node); | |
467 | 412 | var addedInsertionPoint; |
468 | 413 | var root = this.getOwnerRoot(); |
469 | 414 | if (root) { |
... | ... | @@ -495,6 +440,7 @@ nativeAppendChild.call(container, node); |
495 | 440 | if (addedInsertionPoint) { |
496 | 441 | this._updateInsertionPoints(root.host); |
497 | 442 | } |
443 | +this.notifyObserver(); | |
498 | 444 | return node; |
499 | 445 | }, |
500 | 446 | removeChild: function (node) { |
... | ... | @@ -509,6 +455,7 @@ removeFromComposedParent(container, node); |
509 | 455 | nativeRemoveChild.call(container, node); |
510 | 456 | } |
511 | 457 | } |
458 | +this.notifyObserver(); | |
512 | 459 | return node; |
513 | 460 | }, |
514 | 461 | replaceChild: function (node, ref_node) { |
... | ... | @@ -601,6 +548,13 @@ return Boolean(node._lightChildren !== undefined); |
601 | 548 | _parentNeedsDistribution: function (parent) { |
602 | 549 | return parent && parent.shadyRoot && hasInsertionPoint(parent.shadyRoot); |
603 | 550 | }, |
551 | +_removeNodeFromParent: function (node) { | |
552 | +var parent = node._lightParent || node.parentNode; | |
553 | +if (parent && hasDomApi(parent)) { | |
554 | +factory(parent).notifyObserver(); | |
555 | +} | |
556 | +this._removeNodeFromHost(node, true); | |
557 | +}, | |
604 | 558 | _removeNodeFromHost: function (node, ensureComposedRemoval) { |
605 | 559 | var hostNeedsDist; |
606 | 560 | var root; |
... | ... | @@ -612,7 +566,7 @@ if (root) { |
612 | 566 | root.host._elementRemove(node); |
613 | 567 | hostNeedsDist = this._removeDistributedChildren(root, node); |
614 | 568 | } |
615 | -this._removeLogicalInfo(node, node._lightParent); | |
569 | +this._removeLogicalInfo(node, parent); | |
616 | 570 | } |
617 | 571 | this._removeOwnerShadyRoot(node); |
618 | 572 | if (root && hostNeedsDist) { |
... | ... | @@ -731,24 +685,29 @@ getDistributedNodes: function () { |
731 | 685 | return this.node._distributedNodes || []; |
732 | 686 | }, |
733 | 687 | queryDistributedElements: function (selector) { |
734 | -var c$ = this.childNodes; | |
688 | +var c$ = this.getEffectiveChildNodes(); | |
735 | 689 | var list = []; |
736 | -this._distributedFilter(selector, c$, list); | |
737 | 690 | for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) { |
738 | -if (c.localName === CONTENT) { | |
739 | -this._distributedFilter(selector, factory(c).getDistributedNodes(), list); | |
691 | +if (c.nodeType === Node.ELEMENT_NODE && matchesSelector.call(c, selector)) { | |
692 | +list.push(c); | |
740 | 693 | } |
741 | 694 | } |
742 | 695 | return list; |
743 | 696 | }, |
744 | -_distributedFilter: function (selector, list, results) { | |
745 | -results = results || []; | |
746 | -for (var i = 0, l = list.length, d; i < l && (d = list[i]); i++) { | |
747 | -if (d.nodeType === Node.ELEMENT_NODE && d.localName !== CONTENT && matchesSelector.call(d, selector)) { | |
748 | -results.push(d); | |
697 | +getEffectiveChildNodes: function () { | |
698 | +var list = []; | |
699 | +var c$ = this.childNodes; | |
700 | +for (var i = 0, l = c$.length, c; i < l && (c = c$[i]); i++) { | |
701 | +if (c.localName === CONTENT) { | |
702 | +var d$ = factory(c).getDistributedNodes(); | |
703 | +for (var j = 0; j < d$.length; j++) { | |
704 | +list.push(d$[j]); | |
705 | +} | |
706 | +} else { | |
707 | +list.push(c); | |
749 | 708 | } |
750 | 709 | } |
751 | -return results; | |
710 | +return list; | |
752 | 711 | }, |
753 | 712 | _clear: function () { |
754 | 713 | while (this.childNodes.length) { |
... | ... | @@ -792,36 +751,24 @@ d.appendChild(nc); |
792 | 751 | } |
793 | 752 | } |
794 | 753 | return n; |
754 | +}, | |
755 | +observeNodes: function (callback) { | |
756 | +if (callback) { | |
757 | +if (!this.observer) { | |
758 | +this.observer = this.node.localName === CONTENT ? new DomApi.DistributedNodesObserver(this) : new DomApi.EffectiveNodesObserver(this); | |
795 | 759 | } |
796 | -}; | |
797 | -Object.defineProperty(DomApi.prototype, 'classList', { | |
798 | -get: function () { | |
799 | -if (!this._classList) { | |
800 | -this._classList = new DomApi.ClassList(this); | |
760 | +return this.observer.addListener(callback); | |
801 | 761 | } |
802 | -return this._classList; | |
803 | -}, | |
804 | -configurable: true | |
805 | -}); | |
806 | -DomApi.ClassList = function (host) { | |
807 | -this.domApi = host; | |
808 | -this.node = host.node; | |
809 | -}; | |
810 | -DomApi.ClassList.prototype = { | |
811 | -add: function () { | |
812 | -this.node.classList.add.apply(this.node.classList, arguments); | |
813 | -this.domApi._distributeParent(); | |
814 | -}, | |
815 | -remove: function () { | |
816 | -this.node.classList.remove.apply(this.node.classList, arguments); | |
817 | -this.domApi._distributeParent(); | |
818 | 762 | }, |
819 | -toggle: function () { | |
820 | -this.node.classList.toggle.apply(this.node.classList, arguments); | |
821 | -this.domApi._distributeParent(); | |
763 | +unobserveNodes: function (handle) { | |
764 | +if (this.observer) { | |
765 | +this.observer.removeListener(handle); | |
766 | +} | |
822 | 767 | }, |
823 | -contains: function () { | |
824 | -return this.node.classList.contains.apply(this.node.classList, arguments); | |
768 | +notifyObserver: function () { | |
769 | +if (this.observer) { | |
770 | +this.observer.notify(); | |
771 | +} | |
825 | 772 | } |
826 | 773 | }; |
827 | 774 | if (!Settings.useShadow) { |
... | ... | @@ -1003,6 +950,17 @@ return n$ ? Array.prototype.slice.call(n$) : []; |
1003 | 950 | }; |
1004 | 951 | DomApi.prototype._distributeParent = function () { |
1005 | 952 | }; |
953 | +var nativeForwards = [ | |
954 | +'appendChild', | |
955 | +'insertBefore', | |
956 | +'removeChild', | |
957 | +'replaceChild' | |
958 | +]; | |
959 | +nativeForwards.forEach(function (forward) { | |
960 | +DomApi.prototype[forward] = function () { | |
961 | +return this.node[forward].apply(this.node, arguments); | |
962 | +}; | |
963 | +}); | |
1006 | 964 | Object.defineProperties(DomApi.prototype, { |
1007 | 965 | childNodes: { |
1008 | 966 | get: function () { |
... | ... | @@ -1056,13 +1014,17 @@ configurable: true |
1056 | 1014 | }); |
1057 | 1015 | } |
1058 | 1016 | var CONTENT = 'content'; |
1059 | -var factory = function (node, patch) { | |
1017 | +function factory(node, patch) { | |
1060 | 1018 | node = node || document; |
1061 | 1019 | if (!node.__domApi) { |
1062 | 1020 | node.__domApi = new DomApi(node, patch); |
1063 | 1021 | } |
1064 | 1022 | return node.__domApi; |
1065 | -}; | |
1023 | +} | |
1024 | +; | |
1025 | +function hasDomApi(node) { | |
1026 | +return Boolean(node.__domApi); | |
1027 | +} | |
1066 | 1028 | Polymer.dom = function (obj, patch) { |
1067 | 1029 | if (obj instanceof Event) { |
1068 | 1030 | return Polymer.EventApi.factory(obj); |
... | ... | @@ -1070,43 +1032,6 @@ return Polymer.EventApi.factory(obj); |
1070 | 1032 | return factory(obj, patch); |
1071 | 1033 | } |
1072 | 1034 | }; |
1073 | -Polymer.Base.extend(Polymer.dom, { | |
1074 | -_flushGuard: 0, | |
1075 | -_FLUSH_MAX: 100, | |
1076 | -_needsTakeRecords: !Polymer.Settings.useNativeCustomElements, | |
1077 | -_debouncers: [], | |
1078 | -_finishDebouncer: null, | |
1079 | -flush: function () { | |
1080 | -for (var i = 0; i < this._debouncers.length; i++) { | |
1081 | -this._debouncers[i].complete(); | |
1082 | -} | |
1083 | -if (this._finishDebouncer) { | |
1084 | -this._finishDebouncer.complete(); | |
1085 | -} | |
1086 | -this._flushPolyfills(); | |
1087 | -if (this._debouncers.length && this._flushGuard < this._FLUSH_MAX) { | |
1088 | -this._flushGuard++; | |
1089 | -this.flush(); | |
1090 | -} else { | |
1091 | -if (this._flushGuard >= this._FLUSH_MAX) { | |
1092 | -console.warn('Polymer.dom.flush aborted. Flush may not be complete.'); | |
1093 | -} | |
1094 | -this._flushGuard = 0; | |
1095 | -} | |
1096 | -}, | |
1097 | -_flushPolyfills: function () { | |
1098 | -if (this._needsTakeRecords) { | |
1099 | -CustomElements.takeRecords(); | |
1100 | -} | |
1101 | -}, | |
1102 | -addDebouncer: function (debouncer) { | |
1103 | -this._debouncers.push(debouncer); | |
1104 | -this._finishDebouncer = Polymer.Debounce(this._finishDebouncer, this._finishFlush); | |
1105 | -}, | |
1106 | -_finishFlush: function () { | |
1107 | -Polymer.dom._debouncers = []; | |
1108 | -} | |
1109 | -}); | |
1110 | 1035 | function getLightChildren(node) { |
1111 | 1036 | var children = node._lightChildren; |
1112 | 1037 | return children ? children : node.childNodes; |
... | ... | @@ -1170,10 +1095,399 @@ saveLightChildrenIfNeeded: saveLightChildrenIfNeeded, |
1170 | 1095 | matchesSelector: matchesSelector, |
1171 | 1096 | hasInsertionPoint: hasInsertionPoint, |
1172 | 1097 | ctor: DomApi, |
1173 | -factory: factory | |
1098 | +factory: factory, | |
1099 | +hasDomApi: hasDomApi | |
1100 | +}; | |
1101 | +}(); | |
1102 | +Polymer.Base.extend(Polymer.dom, { | |
1103 | +_flushGuard: 0, | |
1104 | +_FLUSH_MAX: 100, | |
1105 | +_needsTakeRecords: !Polymer.Settings.useNativeCustomElements, | |
1106 | +_debouncers: [], | |
1107 | +_staticFlushList: [], | |
1108 | +_finishDebouncer: null, | |
1109 | +flush: function () { | |
1110 | +this._flushGuard = 0; | |
1111 | +this._prepareFlush(); | |
1112 | +while (this._debouncers.length && this._flushGuard < this._FLUSH_MAX) { | |
1113 | +for (var i = 0; i < this._debouncers.length; i++) { | |
1114 | +this._debouncers[i].complete(); | |
1115 | +} | |
1116 | +if (this._finishDebouncer) { | |
1117 | +this._finishDebouncer.complete(); | |
1118 | +} | |
1119 | +this._prepareFlush(); | |
1120 | +this._flushGuard++; | |
1121 | +} | |
1122 | +if (this._flushGuard >= this._FLUSH_MAX) { | |
1123 | +console.warn('Polymer.dom.flush aborted. Flush may not be complete.'); | |
1124 | +} | |
1125 | +}, | |
1126 | +_prepareFlush: function () { | |
1127 | +if (this._needsTakeRecords) { | |
1128 | +CustomElements.takeRecords(); | |
1129 | +} | |
1130 | +for (var i = 0; i < this._staticFlushList.length; i++) { | |
1131 | +this._staticFlushList[i](); | |
1132 | +} | |
1133 | +}, | |
1134 | +addStaticFlush: function (fn) { | |
1135 | +this._staticFlushList.push(fn); | |
1136 | +}, | |
1137 | +removeStaticFlush: function (fn) { | |
1138 | +var i = this._staticFlushList.indexOf(fn); | |
1139 | +if (i >= 0) { | |
1140 | +this._staticFlushList.splice(i, 1); | |
1141 | +} | |
1142 | +}, | |
1143 | +addDebouncer: function (debouncer) { | |
1144 | +this._debouncers.push(debouncer); | |
1145 | +this._finishDebouncer = Polymer.Debounce(this._finishDebouncer, this._finishFlush); | |
1146 | +}, | |
1147 | +_finishFlush: function () { | |
1148 | +Polymer.dom._debouncers = []; | |
1149 | +} | |
1150 | +}); | |
1151 | +Polymer.EventApi = function () { | |
1152 | +'use strict'; | |
1153 | +var DomApi = Polymer.DomApi.ctor; | |
1154 | +var Settings = Polymer.Settings; | |
1155 | +DomApi.Event = function (event) { | |
1156 | +this.event = event; | |
1157 | +}; | |
1158 | +if (Settings.useShadow) { | |
1159 | +DomApi.Event.prototype = { | |
1160 | +get rootTarget() { | |
1161 | +return this.event.path[0]; | |
1162 | +}, | |
1163 | +get localTarget() { | |
1164 | +return this.event.target; | |
1165 | +}, | |
1166 | +get path() { | |
1167 | +return this.event.path; | |
1168 | +} | |
1169 | +}; | |
1170 | +} else { | |
1171 | +DomApi.Event.prototype = { | |
1172 | +get rootTarget() { | |
1173 | +return this.event.target; | |
1174 | +}, | |
1175 | +get localTarget() { | |
1176 | +var current = this.event.currentTarget; | |
1177 | +var currentRoot = current && Polymer.dom(current).getOwnerRoot(); | |
1178 | +var p$ = this.path; | |
1179 | +for (var i = 0; i < p$.length; i++) { | |
1180 | +if (Polymer.dom(p$[i]).getOwnerRoot() === currentRoot) { | |
1181 | +return p$[i]; | |
1182 | +} | |
1183 | +} | |
1184 | +}, | |
1185 | +get path() { | |
1186 | +if (!this.event._path) { | |
1187 | +var path = []; | |
1188 | +var o = this.rootTarget; | |
1189 | +while (o) { | |
1190 | +path.push(o); | |
1191 | +o = Polymer.dom(o).parentNode || o.host; | |
1192 | +} | |
1193 | +path.push(window); | |
1194 | +this.event._path = path; | |
1195 | +} | |
1196 | +return this.event._path; | |
1197 | +} | |
1174 | 1198 | }; |
1199 | +} | |
1200 | +var factory = function (event) { | |
1201 | +if (!event.__eventApi) { | |
1202 | +event.__eventApi = new DomApi.Event(event); | |
1203 | +} | |
1204 | +return event.__eventApi; | |
1205 | +}; | |
1206 | +return { factory: factory }; | |
1175 | 1207 | }(); |
1176 | 1208 | (function () { |
1209 | +'use strict'; | |
1210 | +var DomApi = Polymer.DomApi.ctor; | |
1211 | +Object.defineProperty(DomApi.prototype, 'classList', { | |
1212 | +get: function () { | |
1213 | +if (!this._classList) { | |
1214 | +this._classList = new DomApi.ClassList(this); | |
1215 | +} | |
1216 | +return this._classList; | |
1217 | +}, | |
1218 | +configurable: true | |
1219 | +}); | |
1220 | +DomApi.ClassList = function (host) { | |
1221 | +this.domApi = host; | |
1222 | +this.node = host.node; | |
1223 | +}; | |
1224 | +DomApi.ClassList.prototype = { | |
1225 | +add: function () { | |
1226 | +this.node.classList.add.apply(this.node.classList, arguments); | |
1227 | +this.domApi._distributeParent(); | |
1228 | +}, | |
1229 | +remove: function () { | |
1230 | +this.node.classList.remove.apply(this.node.classList, arguments); | |
1231 | +this.domApi._distributeParent(); | |
1232 | +}, | |
1233 | +toggle: function () { | |
1234 | +this.node.classList.toggle.apply(this.node.classList, arguments); | |
1235 | +this.domApi._distributeParent(); | |
1236 | +}, | |
1237 | +contains: function () { | |
1238 | +return this.node.classList.contains.apply(this.node.classList, arguments); | |
1239 | +} | |
1240 | +}; | |
1241 | +}()); | |
1242 | +(function () { | |
1243 | +'use strict'; | |
1244 | +var DomApi = Polymer.DomApi.ctor; | |
1245 | +var Settings = Polymer.Settings; | |
1246 | +var hasDomApi = Polymer.DomApi.hasDomApi; | |
1247 | +DomApi.EffectiveNodesObserver = function (domApi) { | |
1248 | +this.domApi = domApi; | |
1249 | +this.node = this.domApi.node; | |
1250 | +this._listeners = []; | |
1251 | +}; | |
1252 | +DomApi.EffectiveNodesObserver.prototype = { | |
1253 | +addListener: function (callback) { | |
1254 | +if (!this._isSetup) { | |
1255 | +this._setup(); | |
1256 | +this._isSetup = true; | |
1257 | +} | |
1258 | +var listener = { | |
1259 | +fn: callback, | |
1260 | +_nodes: [] | |
1261 | +}; | |
1262 | +this._listeners.push(listener); | |
1263 | +this._scheduleNotify(); | |
1264 | +return listener; | |
1265 | +}, | |
1266 | +removeListener: function (handle) { | |
1267 | +var i = this._listeners.indexOf(handle); | |
1268 | +if (i >= 0) { | |
1269 | +this._listeners.splice(i, 1); | |
1270 | +handle._nodes = []; | |
1271 | +} | |
1272 | +if (!this._hasListeners()) { | |
1273 | +this._cleanup(); | |
1274 | +this._isSetup = false; | |
1275 | +} | |
1276 | +}, | |
1277 | +_setup: function () { | |
1278 | +this._observeContentElements(this.domApi.childNodes); | |
1279 | +}, | |
1280 | +_cleanup: function () { | |
1281 | +this._unobserveContentElements(this.domApi.childNodes); | |
1282 | +}, | |
1283 | +_hasListeners: function () { | |
1284 | +return Boolean(this._listeners.length); | |
1285 | +}, | |
1286 | +_scheduleNotify: function () { | |
1287 | +if (this._debouncer) { | |
1288 | +this._debouncer.stop(); | |
1289 | +} | |
1290 | +this._debouncer = Polymer.Debounce(this._debouncer, this._notify); | |
1291 | +this._debouncer.context = this; | |
1292 | +Polymer.dom.addDebouncer(this._debouncer); | |
1293 | +}, | |
1294 | +notify: function () { | |
1295 | +if (this._hasListeners()) { | |
1296 | +this._scheduleNotify(); | |
1297 | +} | |
1298 | +}, | |
1299 | +_notify: function (mxns) { | |
1300 | +this._beforeCallListeners(); | |
1301 | +this._callListeners(); | |
1302 | +}, | |
1303 | +_beforeCallListeners: function () { | |
1304 | +this._updateContentElements(); | |
1305 | +}, | |
1306 | +_updateContentElements: function () { | |
1307 | +this._observeContentElements(this.domApi.childNodes); | |
1308 | +}, | |
1309 | +_observeContentElements: function (elements) { | |
1310 | +for (var i = 0, n; i < elements.length && (n = elements[i]); i++) { | |
1311 | +if (this._isContent(n)) { | |
1312 | +n.__observeNodesMap = n.__observeNodesMap || new WeakMap(); | |
1313 | +if (!n.__observeNodesMap.has(this)) { | |
1314 | +n.__observeNodesMap.set(this, this._observeContent(n)); | |
1315 | +} | |
1316 | +} | |
1317 | +} | |
1318 | +}, | |
1319 | +_observeContent: function (content) { | |
1320 | +var h = Polymer.dom(content).observeNodes(this._scheduleNotify.bind(this)); | |
1321 | +h._avoidChangeCalculation = true; | |
1322 | +return h; | |
1323 | +}, | |
1324 | +_unobserveContentElements: function (elements) { | |
1325 | +for (var i = 0, n, h; i < elements.length && (n = elements[i]); i++) { | |
1326 | +if (this._isContent(n)) { | |
1327 | +h = n.__observeNodesMap.get(this); | |
1328 | +if (h) { | |
1329 | +Polymer.dom(n).unobserveNodes(h); | |
1330 | +n.__observeNodesMap.delete(this); | |
1331 | +} | |
1332 | +} | |
1333 | +} | |
1334 | +}, | |
1335 | +_isContent: function (node) { | |
1336 | +return node.localName === 'content'; | |
1337 | +}, | |
1338 | +_callListeners: function () { | |
1339 | +var o$ = this._listeners; | |
1340 | +var nodes = this._getEffectiveNodes(); | |
1341 | +for (var i = 0, o; i < o$.length && (o = o$[i]); i++) { | |
1342 | +var info = this._generateListenerInfo(o, nodes); | |
1343 | +if (info || o._alwaysNotify) { | |
1344 | +this._callListener(o, info); | |
1345 | +} | |
1346 | +} | |
1347 | +}, | |
1348 | +_getEffectiveNodes: function () { | |
1349 | +return this.domApi.getEffectiveChildNodes(); | |
1350 | +}, | |
1351 | +_generateListenerInfo: function (listener, newNodes) { | |
1352 | +if (listener._avoidChangeCalculation) { | |
1353 | +return true; | |
1354 | +} | |
1355 | +var oldNodes = listener._nodes; | |
1356 | +var info = { | |
1357 | +target: this.node, | |
1358 | +addedNodes: [], | |
1359 | +removedNodes: [] | |
1360 | +}; | |
1361 | +var splices = Polymer.ArraySplice.calculateSplices(newNodes, oldNodes); | |
1362 | +for (var i = 0, s; i < splices.length && (s = splices[i]); i++) { | |
1363 | +for (var j = 0, n; j < s.removed.length && (n = s.removed[j]); j++) { | |
1364 | +info.removedNodes.push(n); | |
1365 | +} | |
1366 | +} | |
1367 | +for (var i = 0, s; i < splices.length && (s = splices[i]); i++) { | |
1368 | +for (var j = s.index; j < s.index + s.addedCount; j++) { | |
1369 | +info.addedNodes.push(newNodes[j]); | |
1370 | +} | |
1371 | +} | |
1372 | +listener._nodes = newNodes; | |
1373 | +if (info.addedNodes.length || info.removedNodes.length) { | |
1374 | +return info; | |
1375 | +} | |
1376 | +}, | |
1377 | +_callListener: function (listener, info) { | |
1378 | +return listener.fn.call(this.node, info); | |
1379 | +}, | |
1380 | +enableShadowAttributeTracking: function () { | |
1381 | +} | |
1382 | +}; | |
1383 | +if (Settings.useShadow) { | |
1384 | +var baseSetup = DomApi.EffectiveNodesObserver.prototype._setup; | |
1385 | +var baseCleanup = DomApi.EffectiveNodesObserver.prototype._cleanup; | |
1386 | +var beforeCallListeners = DomApi.EffectiveNodesObserver.prototype._beforeCallListeners; | |
1387 | +Polymer.Base.extend(DomApi.EffectiveNodesObserver.prototype, { | |
1388 | +_setup: function () { | |
1389 | +if (!this._observer) { | |
1390 | +var self = this; | |
1391 | +this._mutationHandler = function (mxns) { | |
1392 | +if (mxns && mxns.length) { | |
1393 | +self._scheduleNotify(); | |
1394 | +} | |
1395 | +}; | |
1396 | +this._observer = new MutationObserver(this._mutationHandler); | |
1397 | +this._boundFlush = this._flush.bind(this); | |
1398 | +Polymer.dom.addStaticFlush(this._boundFlush); | |
1399 | +this._observer.observe(this.node, { childList: true }); | |
1400 | +} | |
1401 | +baseSetup.call(this); | |
1402 | +}, | |
1403 | +_cleanup: function () { | |
1404 | +this._observer.disconnect(); | |
1405 | +this._observer = null; | |
1406 | +this._mutationHandler = null; | |
1407 | +Polymer.dom.removeStaticFlush(this._boundFlush); | |
1408 | +baseCleanup.call(this); | |
1409 | +}, | |
1410 | +_flush: function () { | |
1411 | +if (this._observer) { | |
1412 | +this._mutationHandler(this._observer.takeRecords()); | |
1413 | +} | |
1414 | +}, | |
1415 | +enableShadowAttributeTracking: function () { | |
1416 | +if (this._observer) { | |
1417 | +this._makeContentListenersAlwaysNotify(); | |
1418 | +this._observer.disconnect(); | |
1419 | +this._observer.observe(this.node, { | |
1420 | +childList: true, | |
1421 | +attributes: true, | |
1422 | +subtree: true | |
1423 | +}); | |
1424 | +var root = this.domApi.getOwnerRoot(); | |
1425 | +var host = root && root.host; | |
1426 | +if (host && Polymer.dom(host).observer) { | |
1427 | +Polymer.dom(host).observer.enableShadowAttributeTracking(); | |
1428 | +} | |
1429 | +} | |
1430 | +}, | |
1431 | +_makeContentListenersAlwaysNotify: function () { | |
1432 | +for (var i = 0, h; i < this._listeners.length; i++) { | |
1433 | +h = this._listeners[i]; | |
1434 | +h._alwaysNotify = h._isContentListener; | |
1435 | +} | |
1436 | +} | |
1437 | +}); | |
1438 | +} | |
1439 | +}()); | |
1440 | +(function () { | |
1441 | +'use strict'; | |
1442 | +var DomApi = Polymer.DomApi.ctor; | |
1443 | +var Settings = Polymer.Settings; | |
1444 | +DomApi.DistributedNodesObserver = function (domApi) { | |
1445 | +DomApi.EffectiveNodesObserver.call(this, domApi); | |
1446 | +}; | |
1447 | +DomApi.DistributedNodesObserver.prototype = Object.create(DomApi.EffectiveNodesObserver.prototype); | |
1448 | +Polymer.Base.extend(DomApi.DistributedNodesObserver.prototype, { | |
1449 | +_setup: function () { | |
1450 | +}, | |
1451 | +_cleanup: function () { | |
1452 | +}, | |
1453 | +_beforeCallListeners: function () { | |
1454 | +}, | |
1455 | +_getEffectiveNodes: function () { | |
1456 | +return this.domApi.getDistributedNodes(); | |
1457 | +} | |
1458 | +}); | |
1459 | +if (Settings.useShadow) { | |
1460 | +Polymer.Base.extend(DomApi.DistributedNodesObserver.prototype, { | |
1461 | +_setup: function () { | |
1462 | +if (!this._observer) { | |
1463 | +var root = this.domApi.getOwnerRoot(); | |
1464 | +var host = root && root.host; | |
1465 | +if (host) { | |
1466 | +this._observer = Polymer.dom(host).observeNodes(this._scheduleNotify.bind(this)); | |
1467 | +this._observer._isContentListener = true; | |
1468 | +if (this._hasAttrSelect()) { | |
1469 | +Polymer.dom(host).observer.enableShadowAttributeTracking(); | |
1470 | +} | |
1471 | +} | |
1472 | +} | |
1473 | +}, | |
1474 | +_hasAttrSelect: function () { | |
1475 | +var select = this.node.getAttribute('select'); | |
1476 | +return select && select.match(/[[.]+/); | |
1477 | +}, | |
1478 | +_cleanup: function () { | |
1479 | +var root = this.domApi.getOwnerRoot(); | |
1480 | +var host = root && root.host; | |
1481 | +if (host) { | |
1482 | +Polymer.dom(host).unobserveNodes(this._observer); | |
1483 | +} | |
1484 | +this._observer = null; | |
1485 | +} | |
1486 | +}); | |
1487 | +} | |
1488 | +}()); | |
1489 | +(function () { | |
1490 | +var hasDomApi = Polymer.DomApi.hasDomApi; | |
1177 | 1491 | Polymer.Base._addFeature({ |
1178 | 1492 | _prepShady: function () { |
1179 | 1493 | this._useContent = this._useContent || Boolean(this._template); |
... | ... | @@ -1244,6 +1558,7 @@ if (this._useContent) { |
1244 | 1558 | this.shadyRoot._distributionClean = true; |
1245 | 1559 | if (hasInsertionPoint(this.shadyRoot)) { |
1246 | 1560 | this._composeTree(); |
1561 | +notifyContentObservers(this.shadyRoot); | |
1247 | 1562 | } else { |
1248 | 1563 | if (!this.shadyRoot._hasDistributed) { |
1249 | 1564 | this.textContent = ''; |
... | ... | @@ -1254,6 +1569,9 @@ var children = this._composeNode(this); |
1254 | 1569 | this._updateChildNodes(this, children); |
1255 | 1570 | } |
1256 | 1571 | } |
1572 | +if (!this.shadyRoot._hasDistributed) { | |
1573 | +notifyInitialDistribution(this); | |
1574 | +} | |
1257 | 1575 | this.shadyRoot._hasDistributed = true; |
1258 | 1576 | } |
1259 | 1577 | }, |
... | ... | @@ -1471,6 +1789,19 @@ return host.domHost; |
1471 | 1789 | } |
1472 | 1790 | } |
1473 | 1791 | } |
1792 | +function notifyContentObservers(root) { | |
1793 | +for (var i = 0, c; i < root._insertionPoints.length; i++) { | |
1794 | +c = root._insertionPoints[i]; | |
1795 | +if (hasDomApi(c)) { | |
1796 | +Polymer.dom(c).notifyObserver(); | |
1797 | +} | |
1798 | +} | |
1799 | +} | |
1800 | +function notifyInitialDistribution(host) { | |
1801 | +if (hasDomApi(host)) { | |
1802 | +Polymer.dom(host).notifyObserver(); | |
1803 | +} | |
1804 | +} | |
1474 | 1805 | var needsUpgrade = window.CustomElements && !CustomElements.useNative; |
1475 | 1806 | function upgradeLightChildren(children) { |
1476 | 1807 | if (needsUpgrade && children) { | ... | ... |
bower_components/polymer/polymer.html
... | ... | @@ -27,22 +27,66 @@ return list; |
27 | 27 | _parseNodeAnnotations: function (node, list) { |
28 | 28 | return node.nodeType === Node.TEXT_NODE ? this._parseTextNodeAnnotation(node, list) : this._parseElementAnnotations(node, list); |
29 | 29 | }, |
30 | -_testEscape: function (value) { | |
31 | -var escape = value.slice(0, 2); | |
32 | -if (escape === '{{' || escape === '[[') { | |
33 | -return escape; | |
30 | +_bindingRegex: /([^{[]*)({{|\[\[)([^}\]]*)(?:]]|}})/g, | |
31 | +_parseBindings: function (text) { | |
32 | +var re = this._bindingRegex; | |
33 | +var parts = []; | |
34 | +var m, lastIndex; | |
35 | +while ((m = re.exec(text)) !== null) { | |
36 | +if (m[1]) { | |
37 | +parts.push({ literal: m[1] }); | |
38 | +} | |
39 | +var mode = m[2][0]; | |
40 | +var value = m[3].trim(); | |
41 | +var negate = false; | |
42 | +if (value[0] == '!') { | |
43 | +negate = true; | |
44 | +value = value.substring(1).trim(); | |
45 | +} | |
46 | +var customEvent, notifyEvent, colon; | |
47 | +if (mode == '{' && (colon = value.indexOf('::')) > 0) { | |
48 | +notifyEvent = value.substring(colon + 2); | |
49 | +value = value.substring(0, colon); | |
50 | +customEvent = true; | |
51 | +} | |
52 | +parts.push({ | |
53 | +compoundIndex: parts.length, | |
54 | +value: value, | |
55 | +mode: mode, | |
56 | +negate: negate, | |
57 | +event: notifyEvent, | |
58 | +customEvent: customEvent | |
59 | +}); | |
60 | +lastIndex = re.lastIndex; | |
61 | +} | |
62 | +if (lastIndex && lastIndex < text.length) { | |
63 | +var literal = text.substring(lastIndex); | |
64 | +if (literal) { | |
65 | +parts.push({ literal: literal }); | |
66 | +} | |
67 | +} | |
68 | +if (parts.length) { | |
69 | +return parts; | |
34 | 70 | } |
35 | 71 | }, |
72 | +_literalFromParts: function (parts) { | |
73 | +var s = ''; | |
74 | +for (var i = 0; i < parts.length; i++) { | |
75 | +var literal = parts[i].literal; | |
76 | +s += literal || ''; | |
77 | +} | |
78 | +return s; | |
79 | +}, | |
36 | 80 | _parseTextNodeAnnotation: function (node, list) { |
37 | -var v = node.textContent; | |
38 | -var escape = this._testEscape(v); | |
39 | -if (escape) { | |
40 | -node.textContent = ' '; | |
81 | +var parts = this._parseBindings(node.textContent); | |
82 | +if (parts) { | |
83 | +node.textContent = this._literalFromParts(parts) || ' '; | |
41 | 84 | var annote = { |
42 | 85 | bindings: [{ |
43 | 86 | kind: 'text', |
44 | -mode: escape[0], | |
45 | -value: v.slice(2, -2).trim() | |
87 | +name: 'textContent', | |
88 | +parts: parts, | |
89 | +isCompound: parts.length !== 1 | |
46 | 90 | }] |
47 | 91 | }; |
48 | 92 | list.push(annote); |
... | ... | @@ -104,62 +148,50 @@ index: index |
104 | 148 | }); |
105 | 149 | }, |
106 | 150 | _parseNodeAttributeAnnotations: function (node, annotation) { |
107 | -for (var i = node.attributes.length - 1, a; a = node.attributes[i]; i--) { | |
108 | -var n = a.name, v = a.value; | |
109 | -if (n === 'id' && !this._testEscape(v)) { | |
110 | -annotation.id = v; | |
111 | -} else if (n.slice(0, 3) === 'on-') { | |
151 | +var attrs = Array.prototype.slice.call(node.attributes); | |
152 | +for (var i = attrs.length - 1, a; a = attrs[i]; i--) { | |
153 | +var n = a.name; | |
154 | +var v = a.value; | |
155 | +var b; | |
156 | +if (n.slice(0, 3) === 'on-') { | |
112 | 157 | node.removeAttribute(n); |
113 | 158 | annotation.events.push({ |
114 | 159 | name: n.slice(3), |
115 | 160 | value: v |
116 | 161 | }); |
117 | -} else { | |
118 | -var b = this._parseNodeAttributeAnnotation(node, n, v); | |
119 | -if (b) { | |
162 | +} else if (b = this._parseNodeAttributeAnnotation(node, n, v)) { | |
120 | 163 | annotation.bindings.push(b); |
121 | -} | |
164 | +} else if (n === 'id') { | |
165 | +annotation.id = v; | |
122 | 166 | } |
123 | 167 | } |
124 | 168 | }, |
125 | -_parseNodeAttributeAnnotation: function (node, n, v) { | |
126 | -var escape = this._testEscape(v); | |
127 | -if (escape) { | |
128 | -var customEvent; | |
129 | -var name = n; | |
130 | -var mode = escape[0]; | |
131 | -v = v.slice(2, -2).trim(); | |
132 | -var not = false; | |
133 | -if (v[0] == '!') { | |
134 | -v = v.substring(1); | |
135 | -not = true; | |
136 | -} | |
169 | +_parseNodeAttributeAnnotation: function (node, name, value) { | |
170 | +var parts = this._parseBindings(value); | |
171 | +if (parts) { | |
172 | +var origName = name; | |
137 | 173 | var kind = 'property'; |
138 | -if (n[n.length - 1] == '$') { | |
139 | -name = n.slice(0, -1); | |
174 | +if (name[name.length - 1] == '$') { | |
175 | +name = name.slice(0, -1); | |
140 | 176 | kind = 'attribute'; |
141 | 177 | } |
142 | -var notifyEvent, colon; | |
143 | -if (mode == '{' && (colon = v.indexOf('::')) > 0) { | |
144 | -notifyEvent = v.substring(colon + 2); | |
145 | -v = v.substring(0, colon); | |
146 | -customEvent = true; | |
178 | +var literal = this._literalFromParts(parts); | |
179 | +if (literal && kind == 'attribute') { | |
180 | +node.setAttribute(name, literal); | |
147 | 181 | } |
148 | -if (node.localName == 'input' && n == 'value') { | |
149 | -node.setAttribute(n, ''); | |
182 | +if (node.localName == 'input' && name == 'value') { | |
183 | +node.setAttribute(origName, ''); | |
150 | 184 | } |
151 | -node.removeAttribute(n); | |
185 | +node.removeAttribute(origName); | |
152 | 186 | if (kind === 'property') { |
153 | 187 | name = Polymer.CaseMap.dashToCamelCase(name); |
154 | 188 | } |
155 | 189 | return { |
156 | 190 | kind: kind, |
157 | -mode: mode, | |
158 | 191 | name: name, |
159 | -value: v, | |
160 | -negate: not, | |
161 | -event: notifyEvent, | |
162 | -customEvent: customEvent | |
192 | +parts: parts, | |
193 | +literal: literal, | |
194 | +isCompound: parts.length !== 1 | |
163 | 195 | }; |
164 | 196 | } |
165 | 197 | }, |
... | ... | @@ -250,9 +282,14 @@ for (var i = 0; i < notes.length; i++) { |
250 | 282 | var note = notes[i]; |
251 | 283 | for (var j = 0; j < note.bindings.length; j++) { |
252 | 284 | var b = note.bindings[j]; |
253 | -b.signature = this._parseMethod(b.value); | |
254 | -if (!b.signature) { | |
255 | -b.model = this._modelForPath(b.value); | |
285 | +for (var k = 0; k < b.parts.length; k++) { | |
286 | +var p = b.parts[k]; | |
287 | +if (!p.literal) { | |
288 | +p.signature = this._parseMethod(p.value); | |
289 | +if (!p.signature) { | |
290 | +p.model = this._modelForPath(p.value); | |
291 | +} | |
292 | +} | |
256 | 293 | } |
257 | 294 | } |
258 | 295 | if (note.templateContent) { |
... | ... | @@ -263,10 +300,12 @@ for (var prop in pp) { |
263 | 300 | bindings.push({ |
264 | 301 | index: note.index, |
265 | 302 | kind: 'property', |
266 | -mode: '{', | |
267 | 303 | name: '_parent_' + prop, |
304 | +parts: [{ | |
305 | +mode: '{', | |
268 | 306 | model: prop, |
269 | 307 | value: prop |
308 | +}] | |
270 | 309 | }); |
271 | 310 | } |
272 | 311 | note.bindings = note.bindings.concat(bindings); |
... | ... | @@ -277,15 +316,17 @@ _discoverTemplateParentProps: function (notes) { |
277 | 316 | var pp = {}; |
278 | 317 | notes.forEach(function (n) { |
279 | 318 | n.bindings.forEach(function (b) { |
280 | -if (b.signature) { | |
281 | -var args = b.signature.args; | |
319 | +b.parts.forEach(function (p) { | |
320 | +if (p.signature) { | |
321 | +var args = p.signature.args; | |
282 | 322 | for (var k = 0; k < args.length; k++) { |
283 | 323 | pp[args[k].model] = true; |
284 | 324 | } |
285 | 325 | } else { |
286 | -pp[b.model] = true; | |
326 | +pp[p.model] = true; | |
287 | 327 | } |
288 | 328 | }); |
329 | +}); | |
289 | 330 | if (n.templateContent) { |
290 | 331 | var tpp = n.templateContent._parentProps; |
291 | 332 | Polymer.Base.mixin(pp, tpp); |
... | ... | @@ -304,15 +345,43 @@ this._marshalAnnotatedNodes(); |
304 | 345 | this._marshalAnnotatedListeners(); |
305 | 346 | } |
306 | 347 | }, |
307 | -_configureAnnotationReferences: function () { | |
308 | -this._configureTemplateContent(); | |
348 | +_configureAnnotationReferences: function (config) { | |
349 | +var notes = this._notes; | |
350 | +var nodes = this._nodes; | |
351 | +for (var i = 0; i < notes.length; i++) { | |
352 | +var note = notes[i]; | |
353 | +var node = nodes[i]; | |
354 | +this._configureTemplateContent(note, node); | |
355 | +this._configureCompoundBindings(note, node); | |
356 | +} | |
309 | 357 | }, |
310 | -_configureTemplateContent: function () { | |
311 | -this._notes.forEach(function (note, i) { | |
358 | +_configureTemplateContent: function (note, node) { | |
312 | 359 | if (note.templateContent) { |
313 | -this._nodes[i]._content = note.templateContent; | |
360 | +node._content = note.templateContent; | |
361 | +} | |
362 | +}, | |
363 | +_configureCompoundBindings: function (note, node) { | |
364 | +var bindings = note.bindings; | |
365 | +for (var i = 0; i < bindings.length; i++) { | |
366 | +var binding = bindings[i]; | |
367 | +if (binding.isCompound) { | |
368 | +var storage = node.__compoundStorage__ || (node.__compoundStorage__ = {}); | |
369 | +var parts = binding.parts; | |
370 | +var literals = new Array(parts.length); | |
371 | +for (var j = 0; j < parts.length; j++) { | |
372 | +literals[j] = parts[j].literal; | |
373 | +} | |
374 | +var name = binding.name; | |
375 | +storage[name] = literals; | |
376 | +if (binding.literal && binding.kind == 'property') { | |
377 | +if (node._configValue) { | |
378 | +node._configValue(name, binding.literal); | |
379 | +} else { | |
380 | +node[name] = binding.literal; | |
381 | +} | |
382 | +} | |
383 | +} | |
314 | 384 | } |
315 | -}, this); | |
316 | 385 | }, |
317 | 386 | _marshalIdNodes: function () { |
318 | 387 | this.$ = {}; |
... | ... | @@ -1104,7 +1173,9 @@ this._callbacks.splice(0, len); |
1104 | 1173 | this._lastVal += len; |
1105 | 1174 | } |
1106 | 1175 | }; |
1107 | -new (window.MutationObserver || JsMutationObserver)(Polymer.Async._atEndOfMicrotask.bind(Polymer.Async)).observe(Polymer.Async._twiddle, { characterData: true }); | |
1176 | +new window.MutationObserver(function () { | |
1177 | +Polymer.Async._atEndOfMicrotask(); | |
1178 | +}).observe(Polymer.Async._twiddle, { characterData: true }); | |
1108 | 1179 | Polymer.Debounce = function () { |
1109 | 1180 | var Async = Polymer.Async; |
1110 | 1181 | var Debouncer = function (context) { |
... | ... | @@ -1186,6 +1257,32 @@ if (toElement) { |
1186 | 1257 | Polymer.dom(toElement).setAttribute(name, ''); |
1187 | 1258 | } |
1188 | 1259 | }, |
1260 | +getEffectiveChildNodes: function () { | |
1261 | +return Polymer.dom(this).getEffectiveChildNodes(); | |
1262 | +}, | |
1263 | +getEffectiveChildren: function () { | |
1264 | +var list = Polymer.dom(this).getEffectiveChildNodes(); | |
1265 | +return list.filter(function (n) { | |
1266 | +return n.nodeType === Node.ELEMENT_NODE; | |
1267 | +}); | |
1268 | +}, | |
1269 | +getEffectiveTextContent: function () { | |
1270 | +var cn = this.getEffectiveChildNodes(); | |
1271 | +var tc = []; | |
1272 | +for (var i = 0, c; c = cn[i]; i++) { | |
1273 | +if (c.nodeType !== Node.COMMENT_NODE) { | |
1274 | +tc.push(Polymer.dom(c).textContent); | |
1275 | +} | |
1276 | +} | |
1277 | +return tc.join(''); | |
1278 | +}, | |
1279 | +queryEffectiveChildren: function (slctr) { | |
1280 | +var e$ = Polymer.dom(this).queryDistributedElements(slctr); | |
1281 | +return e$ && e$[0]; | |
1282 | +}, | |
1283 | +queryAllEffectiveChildren: function (slctr) { | |
1284 | +return Polymer.dom(this).queryAllDistributedElements(slctr); | |
1285 | +}, | |
1189 | 1286 | getContentChildNodes: function (slctr) { |
1190 | 1287 | var content = Polymer.dom(this.root).querySelector(slctr || 'content'); |
1191 | 1288 | return content ? Polymer.dom(content).getDistributedNodes() : []; |
... | ... | @@ -1223,7 +1320,7 @@ if (index >= 0) { |
1223 | 1320 | return path.splice(index, 1); |
1224 | 1321 | } |
1225 | 1322 | } else { |
1226 | -var arr = this.get(path); | |
1323 | +var arr = this._get(path); | |
1227 | 1324 | index = arr.indexOf(item); |
1228 | 1325 | if (index >= 0) { |
1229 | 1326 | return this.splice(path, index, 1); |
... | ... | @@ -1405,7 +1502,7 @@ _notedListenerFactory: function (property, path, isStructured, bogusTest) { |
1405 | 1502 | return function (e, target) { |
1406 | 1503 | if (!bogusTest(e, target)) { |
1407 | 1504 | if (e.detail && e.detail.path) { |
1408 | -this.notifyPath(this._fixPath(path, property, e.detail.path), e.detail.value); | |
1505 | +this._notifyPath(this._fixPath(path, property, e.detail.path), e.detail.value); | |
1409 | 1506 | } else { |
1410 | 1507 | var value = target[property]; |
1411 | 1508 | if (!isStructured) { |
... | ... | @@ -1431,16 +1528,16 @@ node.addEventListener(info.event, inst._notifyListener.bind(inst, info.changedFn |
1431 | 1528 | }; |
1432 | 1529 | Polymer.Base.extend(Polymer.Bind, { |
1433 | 1530 | _shouldAddListener: function (effect) { |
1434 | -return effect.name && effect.mode === '{' && !effect.negate && effect.kind != 'attribute'; | |
1531 | +return effect.name && effect.kind != 'attribute' && effect.kind != 'text' && !effect.isCompound && effect.parts[0].mode === '{' && !effect.parts[0].negate; | |
1435 | 1532 | }, |
1436 | 1533 | _annotationEffect: function (source, value, effect) { |
1437 | 1534 | if (source != effect.value) { |
1438 | -value = this.get(effect.value); | |
1535 | +value = this._get(effect.value); | |
1439 | 1536 | this.__data__[effect.value] = value; |
1440 | 1537 | } |
1441 | 1538 | var calc = effect.negate ? !value : value; |
1442 | 1539 | if (!effect.customEvent || this._nodes[effect.index][effect.name] !== calc) { |
1443 | -return this._applyEffectValue(calc, effect); | |
1540 | +return this._applyEffectValue(effect, calc); | |
1444 | 1541 | } |
1445 | 1542 | }, |
1446 | 1543 | _reflectEffect: function (source) { |
... | ... | @@ -1478,7 +1575,7 @@ var args = Polymer.Bind._marshalArgs(this.__data__, effect, source, value); |
1478 | 1575 | if (args) { |
1479 | 1576 | var fn = this[effect.method]; |
1480 | 1577 | if (fn) { |
1481 | -this.__setProperty(effect.property, fn.apply(this, args)); | |
1578 | +this.__setProperty(effect.name, fn.apply(this, args)); | |
1482 | 1579 | } else { |
1483 | 1580 | this._warn(this._logf('_computeEffect', 'compute method `' + effect.method + '` not defined')); |
1484 | 1581 | } |
... | ... | @@ -1494,7 +1591,7 @@ var computedvalue = fn.apply(computedHost, args); |
1494 | 1591 | if (effect.negate) { |
1495 | 1592 | computedvalue = !computedvalue; |
1496 | 1593 | } |
1497 | -this._applyEffectValue(computedvalue, effect); | |
1594 | +this._applyEffectValue(effect, computedvalue); | |
1498 | 1595 | } |
1499 | 1596 | } else { |
1500 | 1597 | computedHost._warn(computedHost._logf('_annotatedComputationEffect', 'compute method `' + effect.method + '` not defined')); |
... | ... | @@ -1510,7 +1607,7 @@ var v; |
1510 | 1607 | if (arg.literal) { |
1511 | 1608 | v = arg.value; |
1512 | 1609 | } else if (arg.structured) { |
1513 | -v = Polymer.Base.get(name, model); | |
1610 | +v = Polymer.Base._get(name, model); | |
1514 | 1611 | } else { |
1515 | 1612 | v = model[name]; |
1516 | 1613 | } |
... | ... | @@ -1573,7 +1670,7 @@ this._addPropertyEffect(arg.model, 'compute', { |
1573 | 1670 | method: sig.method, |
1574 | 1671 | args: sig.args, |
1575 | 1672 | trigger: arg, |
1576 | -property: name | |
1673 | +name: name | |
1577 | 1674 | }); |
1578 | 1675 | }, this); |
1579 | 1676 | }, |
... | ... | @@ -1611,35 +1708,49 @@ this._addAnnotationEffect(binding, index); |
1611 | 1708 | }, |
1612 | 1709 | _addAnnotationEffect: function (note, index) { |
1613 | 1710 | if (Polymer.Bind._shouldAddListener(note)) { |
1614 | -Polymer.Bind._addAnnotatedListener(this, index, note.name, note.value, note.event); | |
1711 | +Polymer.Bind._addAnnotatedListener(this, index, note.name, note.parts[0].value, note.parts[0].event); | |
1712 | +} | |
1713 | +for (var i = 0; i < note.parts.length; i++) { | |
1714 | +var part = note.parts[i]; | |
1715 | +if (part.signature) { | |
1716 | +this._addAnnotatedComputationEffect(note, part, index); | |
1717 | +} else if (!part.literal) { | |
1718 | +this._addPropertyEffect(part.model, 'annotation', { | |
1719 | +kind: note.kind, | |
1720 | +index: index, | |
1721 | +name: note.name, | |
1722 | +value: part.value, | |
1723 | +isCompound: note.isCompound, | |
1724 | +compoundIndex: part.compoundIndex, | |
1725 | +event: part.event, | |
1726 | +customEvent: part.customEvent, | |
1727 | +negate: part.negate | |
1728 | +}); | |
1615 | 1729 | } |
1616 | -if (note.signature) { | |
1617 | -this._addAnnotatedComputationEffect(note, index); | |
1618 | -} else { | |
1619 | -note.index = index; | |
1620 | -this._addPropertyEffect(note.model, 'annotation', note); | |
1621 | 1730 | } |
1622 | 1731 | }, |
1623 | -_addAnnotatedComputationEffect: function (note, index) { | |
1624 | -var sig = note.signature; | |
1732 | +_addAnnotatedComputationEffect: function (note, part, index) { | |
1733 | +var sig = part.signature; | |
1625 | 1734 | if (sig.static) { |
1626 | -this.__addAnnotatedComputationEffect('__static__', index, note, sig, null); | |
1735 | +this.__addAnnotatedComputationEffect('__static__', index, note, part, null); | |
1627 | 1736 | } else { |
1628 | 1737 | sig.args.forEach(function (arg) { |
1629 | 1738 | if (!arg.literal) { |
1630 | -this.__addAnnotatedComputationEffect(arg.model, index, note, sig, arg); | |
1739 | +this.__addAnnotatedComputationEffect(arg.model, index, note, part, arg); | |
1631 | 1740 | } |
1632 | 1741 | }, this); |
1633 | 1742 | } |
1634 | 1743 | }, |
1635 | -__addAnnotatedComputationEffect: function (property, index, note, sig, trigger) { | |
1744 | +__addAnnotatedComputationEffect: function (property, index, note, part, trigger) { | |
1636 | 1745 | this._addPropertyEffect(property, 'annotatedComputation', { |
1637 | 1746 | index: index, |
1747 | +isCompound: note.isCompound, | |
1748 | +compoundIndex: part.compoundIndex, | |
1638 | 1749 | kind: note.kind, |
1639 | -property: note.name, | |
1640 | -negate: note.negate, | |
1641 | -method: sig.method, | |
1642 | -args: sig.args, | |
1750 | +name: note.name, | |
1751 | +negate: part.negate, | |
1752 | +method: part.signature.method, | |
1753 | +args: part.signature.args, | |
1643 | 1754 | trigger: trigger |
1644 | 1755 | }); |
1645 | 1756 | }, |
... | ... | @@ -1708,9 +1819,14 @@ _marshalInstanceEffects: function () { |
1708 | 1819 | Polymer.Bind.prepareInstance(this); |
1709 | 1820 | Polymer.Bind.setupBindListeners(this); |
1710 | 1821 | }, |
1711 | -_applyEffectValue: function (value, info) { | |
1822 | +_applyEffectValue: function (info, value) { | |
1712 | 1823 | var node = this._nodes[info.index]; |
1713 | -var property = info.property || info.name || 'textContent'; | |
1824 | +var property = info.name; | |
1825 | +if (info.isCompound) { | |
1826 | +var storage = node.__compoundStorage__[property]; | |
1827 | +storage[info.compoundIndex] = value; | |
1828 | +value = storage.join(''); | |
1829 | +} | |
1714 | 1830 | if (info.kind == 'attribute') { |
1715 | 1831 | this.serializeValueToAttribute(value, property, node); |
1716 | 1832 | } else { |
... | ... | @@ -1790,10 +1906,10 @@ for (var p in config) { |
1790 | 1906 | var fx = fx$[p]; |
1791 | 1907 | if (fx) { |
1792 | 1908 | for (var i = 0, l = fx.length, x; i < l && (x = fx[i]); i++) { |
1793 | -if (x.kind === 'annotation') { | |
1909 | +if (x.kind === 'annotation' && !x.isCompound) { | |
1794 | 1910 | var node = this._nodes[x.effect.index]; |
1795 | 1911 | if (node._configValue) { |
1796 | -var value = p === x.effect.value ? config[p] : this.get(x.effect.value, config); | |
1912 | +var value = p === x.effect.value ? config[p] : this._get(x.effect.value, config); | |
1797 | 1913 | node._configValue(x.effect.name, value); |
1798 | 1914 | } |
1799 | 1915 | } |
... | ... | @@ -1840,11 +1956,16 @@ this._handlers = []; |
1840 | 1956 | 'use strict'; |
1841 | 1957 | Polymer.Base._addFeature({ |
1842 | 1958 | notifyPath: function (path, value, fromAbove) { |
1959 | +var info = {}; | |
1960 | +path = this._get(path, this, info); | |
1961 | +this._notifyPath(info.path, value, fromAbove); | |
1962 | +}, | |
1963 | +_notifyPath: function (path, value, fromAbove) { | |
1843 | 1964 | var old = this._propertySetter(path, value); |
1844 | 1965 | if (old !== value && (old === old || value === value)) { |
1845 | 1966 | this._pathEffector(path, value); |
1846 | 1967 | if (!fromAbove) { |
1847 | -this._notifyPath(path, value); | |
1968 | +this._notifyPathUp(path, value); | |
1848 | 1969 | } |
1849 | 1970 | return true; |
1850 | 1971 | } |
... | ... | @@ -1871,41 +1992,67 @@ var last = parts[parts.length - 1]; |
1871 | 1992 | if (parts.length > 1) { |
1872 | 1993 | for (var i = 0; i < parts.length - 1; i++) { |
1873 | 1994 | var part = parts[i]; |
1995 | +if (array && part[0] == '#') { | |
1996 | +prop = Polymer.Collection.get(array).getItem(part); | |
1997 | +} else { | |
1874 | 1998 | prop = prop[part]; |
1875 | -if (array && parseInt(part) == part) { | |
1999 | +if (array && parseInt(part, 10) == part) { | |
1876 | 2000 | parts[i] = Polymer.Collection.get(array).getKey(prop); |
1877 | 2001 | } |
2002 | +} | |
1878 | 2003 | if (!prop) { |
1879 | 2004 | return; |
1880 | 2005 | } |
1881 | 2006 | array = Array.isArray(prop) ? prop : null; |
1882 | 2007 | } |
1883 | -if (array && parseInt(last) == last) { | |
2008 | +if (array) { | |
1884 | 2009 | var coll = Polymer.Collection.get(array); |
2010 | +if (last[0] == '#') { | |
2011 | +var key = last; | |
2012 | +var old = coll.getItem(key); | |
2013 | +last = array.indexOf(old); | |
2014 | +coll.setItem(key, value); | |
2015 | +} else if (parseInt(last, 10) == last) { | |
1885 | 2016 | var old = prop[last]; |
1886 | 2017 | var key = coll.getKey(old); |
1887 | 2018 | parts[i] = key; |
1888 | 2019 | coll.setItem(key, value); |
1889 | 2020 | } |
2021 | +} | |
1890 | 2022 | prop[last] = value; |
1891 | 2023 | if (!root) { |
1892 | -this.notifyPath(parts.join('.'), value); | |
2024 | +this._notifyPath(parts.join('.'), value); | |
1893 | 2025 | } |
1894 | 2026 | } else { |
1895 | 2027 | prop[path] = value; |
1896 | 2028 | } |
1897 | 2029 | }, |
1898 | 2030 | get: function (path, root) { |
2031 | +return this._get(path, root); | |
2032 | +}, | |
2033 | +_get: function (path, root, info) { | |
1899 | 2034 | var prop = root || this; |
1900 | 2035 | var parts = this._getPathParts(path); |
1901 | -var last = parts.pop(); | |
1902 | -while (parts.length) { | |
1903 | -prop = prop[parts.shift()]; | |
2036 | +var array; | |
2037 | +for (var i = 0; i < parts.length; i++) { | |
1904 | 2038 | if (!prop) { |
1905 | 2039 | return; |
1906 | 2040 | } |
2041 | +var part = parts[i]; | |
2042 | +if (array && part[0] == '#') { | |
2043 | +prop = Polymer.Collection.get(array).getItem(part); | |
2044 | +} else { | |
2045 | +prop = prop[part]; | |
2046 | +if (info && array && parseInt(part, 10) == part) { | |
2047 | +parts[i] = Polymer.Collection.get(array).getKey(prop); | |
2048 | +} | |
2049 | +} | |
2050 | +array = Array.isArray(prop) ? prop : null; | |
2051 | +} | |
2052 | +if (info) { | |
2053 | +info.path = parts.join('.'); | |
1907 | 2054 | } |
1908 | -return prop[last]; | |
2055 | +return prop; | |
1909 | 2056 | }, |
1910 | 2057 | _pathEffector: function (path, value) { |
1911 | 2058 | var model = this._modelForPath(path); |
... | ... | @@ -1978,7 +2125,7 @@ this.notifyPath(this._fixPath(a, b, path), value); |
1978 | 2125 | _fixPath: function (property, root, path) { |
1979 | 2126 | return property + path.slice(root.length); |
1980 | 2127 | }, |
1981 | -_notifyPath: function (path, value) { | |
2128 | +_notifyPathUp: function (path, value) { | |
1982 | 2129 | var rootName = this._modelForPath(path); |
1983 | 2130 | var dashCaseName = Polymer.CaseMap.camelToDashCase(rootName); |
1984 | 2131 | var eventName = dashCaseName + this._EVENT_CHANGED; |
... | ... | @@ -1992,47 +2139,62 @@ var dot = path.indexOf('.'); |
1992 | 2139 | return dot < 0 ? path : path.slice(0, dot); |
1993 | 2140 | }, |
1994 | 2141 | _EVENT_CHANGED: '-changed', |
1995 | -_notifySplice: function (array, path, index, added, removed) { | |
1996 | -var splices = [{ | |
1997 | -index: index, | |
1998 | -addedCount: added, | |
1999 | -removed: removed, | |
2000 | -object: array, | |
2001 | -type: 'splice' | |
2002 | -}]; | |
2142 | +notifySplices: function (path, splices) { | |
2143 | +var info = {}; | |
2144 | +var array = this._get(path, this, info); | |
2145 | +this._notifySplices(array, info.path, splices); | |
2146 | +}, | |
2147 | +_notifySplices: function (array, path, splices) { | |
2003 | 2148 | var change = { |
2004 | 2149 | keySplices: Polymer.Collection.applySplices(array, splices), |
2005 | 2150 | indexSplices: splices |
2006 | 2151 | }; |
2007 | -this.set(path + '.splices', change); | |
2008 | -if (added != removed.length) { | |
2009 | -this.notifyPath(path + '.length', array.length); | |
2152 | +if (!array.hasOwnProperty('splices')) { | |
2153 | +Object.defineProperty(array, 'splices', { | |
2154 | +configurable: true, | |
2155 | +writable: true | |
2156 | +}); | |
2010 | 2157 | } |
2158 | +array.splices = change; | |
2159 | +this._notifyPath(path + '.splices', change); | |
2160 | +this._notifyPath(path + '.length', array.length); | |
2011 | 2161 | change.keySplices = null; |
2012 | 2162 | change.indexSplices = null; |
2013 | 2163 | }, |
2164 | +_notifySplice: function (array, path, index, added, removed) { | |
2165 | +this._notifySplices(array, path, [{ | |
2166 | +index: index, | |
2167 | +addedCount: added, | |
2168 | +removed: removed, | |
2169 | +object: array, | |
2170 | +type: 'splice' | |
2171 | +}]); | |
2172 | +}, | |
2014 | 2173 | push: function (path) { |
2015 | -var array = this.get(path); | |
2174 | +var info = {}; | |
2175 | +var array = this._get(path, this, info); | |
2016 | 2176 | var args = Array.prototype.slice.call(arguments, 1); |
2017 | 2177 | var len = array.length; |
2018 | 2178 | var ret = array.push.apply(array, args); |
2019 | 2179 | if (args.length) { |
2020 | -this._notifySplice(array, path, len, args.length, []); | |
2180 | +this._notifySplice(array, info.path, len, args.length, []); | |
2021 | 2181 | } |
2022 | 2182 | return ret; |
2023 | 2183 | }, |
2024 | 2184 | pop: function (path) { |
2025 | -var array = this.get(path); | |
2185 | +var info = {}; | |
2186 | +var array = this._get(path, this, info); | |
2026 | 2187 | var hadLength = Boolean(array.length); |
2027 | 2188 | var args = Array.prototype.slice.call(arguments, 1); |
2028 | 2189 | var ret = array.pop.apply(array, args); |
2029 | 2190 | if (hadLength) { |
2030 | -this._notifySplice(array, path, array.length, 0, [ret]); | |
2191 | +this._notifySplice(array, info.path, array.length, 0, [ret]); | |
2031 | 2192 | } |
2032 | 2193 | return ret; |
2033 | 2194 | }, |
2034 | 2195 | splice: function (path, start, deleteCount) { |
2035 | -var array = this.get(path); | |
2196 | +var info = {}; | |
2197 | +var array = this._get(path, this, info); | |
2036 | 2198 | if (start < 0) { |
2037 | 2199 | start = array.length - Math.floor(-start); |
2038 | 2200 | } else { |
... | ... | @@ -2045,26 +2207,28 @@ var args = Array.prototype.slice.call(arguments, 1); |
2045 | 2207 | var ret = array.splice.apply(array, args); |
2046 | 2208 | var addedCount = Math.max(args.length - 2, 0); |
2047 | 2209 | if (addedCount || ret.length) { |
2048 | -this._notifySplice(array, path, start, addedCount, ret); | |
2210 | +this._notifySplice(array, info.path, start, addedCount, ret); | |
2049 | 2211 | } |
2050 | 2212 | return ret; |
2051 | 2213 | }, |
2052 | 2214 | shift: function (path) { |
2053 | -var array = this.get(path); | |
2215 | +var info = {}; | |
2216 | +var array = this._get(path, this, info); | |
2054 | 2217 | var hadLength = Boolean(array.length); |
2055 | 2218 | var args = Array.prototype.slice.call(arguments, 1); |
2056 | 2219 | var ret = array.shift.apply(array, args); |
2057 | 2220 | if (hadLength) { |
2058 | -this._notifySplice(array, path, 0, 0, [ret]); | |
2221 | +this._notifySplice(array, info.path, 0, 0, [ret]); | |
2059 | 2222 | } |
2060 | 2223 | return ret; |
2061 | 2224 | }, |
2062 | 2225 | unshift: function (path) { |
2063 | -var array = this.get(path); | |
2226 | +var info = {}; | |
2227 | +var array = this._get(path, this, info); | |
2064 | 2228 | var args = Array.prototype.slice.call(arguments, 1); |
2065 | 2229 | var ret = array.unshift.apply(array, args); |
2066 | 2230 | if (args.length) { |
2067 | -this._notifySplice(array, path, 0, args.length, []); | |
2231 | +this._notifySplice(array, info.path, 0, args.length, []); | |
2068 | 2232 | } |
2069 | 2233 | return ret; |
2070 | 2234 | }, |
... | ... | @@ -2072,8 +2236,10 @@ prepareModelNotifyPath: function (model) { |
2072 | 2236 | this.mixin(model, { |
2073 | 2237 | fire: Polymer.Base.fire, |
2074 | 2238 | notifyPath: Polymer.Base.notifyPath, |
2239 | +_get: Polymer.Base._get, | |
2075 | 2240 | _EVENT_CHANGED: Polymer.Base._EVENT_CHANGED, |
2076 | 2241 | _notifyPath: Polymer.Base._notifyPath, |
2242 | +_notifyPathUp: Polymer.Base._notifyPathUp, | |
2077 | 2243 | _pathEffector: Polymer.Base._pathEffector, |
2078 | 2244 | _annotationPathEffect: Polymer.Base._annotationPathEffect, |
2079 | 2245 | _complexObserverPathEffect: Polymer.Base._complexObserverPathEffect, |
... | ... | @@ -2081,7 +2247,8 @@ _annotatedComputationPathEffect: Polymer.Base._annotatedComputationPathEffect, |
2081 | 2247 | _computePathEffect: Polymer.Base._computePathEffect, |
2082 | 2248 | _modelForPath: Polymer.Base._modelForPath, |
2083 | 2249 | _pathMatchesEffect: Polymer.Base._pathMatchesEffect, |
2084 | -_notifyBoundPaths: Polymer.Base._notifyBoundPaths | |
2250 | +_notifyBoundPaths: Polymer.Base._notifyBoundPaths, | |
2251 | +_getPathParts: Polymer.Base._getPathParts | |
2085 | 2252 | }); |
2086 | 2253 | } |
2087 | 2254 | }); |
... | ... | @@ -3306,7 +3473,7 @@ archetype._prepEffects(); |
3306 | 3473 | this._customPrepEffects(archetype); |
3307 | 3474 | archetype._prepBehaviors(); |
3308 | 3475 | archetype._prepBindings(); |
3309 | -archetype._notifyPath = this._notifyPathImpl; | |
3476 | +archetype._notifyPathUp = this._notifyPathUpImpl; | |
3310 | 3477 | archetype._scopeElementClass = this._scopeElementClassImpl; |
3311 | 3478 | archetype.listen = this._listenImpl; |
3312 | 3479 | archetype._showHideChildren = this._showHideChildrenImpl; |
... | ... | @@ -3444,7 +3611,7 @@ _forwardInstancePath: function (inst, path, value) { |
3444 | 3611 | }, |
3445 | 3612 | _forwardInstanceProp: function (inst, prop, value) { |
3446 | 3613 | }, |
3447 | -_notifyPathImpl: function (path, value) { | |
3614 | +_notifyPathUpImpl: function (path, value) { | |
3448 | 3615 | var dataHost = this.dataHost; |
3449 | 3616 | var dot = path.indexOf('.'); |
3450 | 3617 | var root = dot < 0 ? path : path.slice(0, dot); |
... | ... | @@ -3562,9 +3729,10 @@ this.omap.set(item, key); |
3562 | 3729 | } else { |
3563 | 3730 | this.pmap[item] = key; |
3564 | 3731 | } |
3565 | -return key; | |
3732 | +return '#' + key; | |
3566 | 3733 | }, |
3567 | 3734 | removeKey: function (key) { |
3735 | +key = this._parseKey(key); | |
3568 | 3736 | this._removeFromMap(this.store[key]); |
3569 | 3737 | delete this.store[key]; |
3570 | 3738 | }, |
... | ... | @@ -3581,16 +3749,29 @@ this.removeKey(key); |
3581 | 3749 | return key; |
3582 | 3750 | }, |
3583 | 3751 | getKey: function (item) { |
3752 | +var key; | |
3584 | 3753 | if (item && typeof item == 'object') { |
3585 | -return this.omap.get(item); | |
3754 | +key = this.omap.get(item); | |
3586 | 3755 | } else { |
3587 | -return this.pmap[item]; | |
3756 | +key = this.pmap[item]; | |
3757 | +} | |
3758 | +if (key != undefined) { | |
3759 | +return '#' + key; | |
3588 | 3760 | } |
3589 | 3761 | }, |
3590 | 3762 | getKeys: function () { |
3591 | -return Object.keys(this.store); | |
3763 | +return Object.keys(this.store).map(function (key) { | |
3764 | +return '#' + key; | |
3765 | +}); | |
3766 | +}, | |
3767 | +_parseKey: function (key) { | |
3768 | +if (key[0] == '#') { | |
3769 | +return key.slice(1); | |
3770 | +} | |
3771 | +throw new Error('unexpected key ' + key); | |
3592 | 3772 | }, |
3593 | 3773 | setItem: function (key, item) { |
3774 | +key = this._parseKey(key); | |
3594 | 3775 | var old = this.store[key]; |
3595 | 3776 | if (old) { |
3596 | 3777 | this._removeFromMap(old); |
... | ... | @@ -3603,6 +3784,7 @@ this.pmap[item] = key; |
3603 | 3784 | this.store[key] = item; |
3604 | 3785 | }, |
3605 | 3786 | getItem: function (key) { |
3787 | +key = this._parseKey(key); | |
3606 | 3788 | return this.store[key]; |
3607 | 3789 | }, |
3608 | 3790 | getItems: function () { |
... | ... | @@ -3996,7 +4178,7 @@ this.set('items.' + idx, value); |
3996 | 4178 | }, |
3997 | 4179 | _forwardInstancePath: function (inst, path, value) { |
3998 | 4180 | if (path.indexOf(this.as + '.') === 0) { |
3999 | -this.notifyPath('items.' + inst.__key__ + '.' + path.slice(this.as.length + 1), value); | |
4181 | +this._notifyPath('items.' + inst.__key__ + '.' + path.slice(this.as.length + 1), value); | |
4000 | 4182 | } |
4001 | 4183 | }, |
4002 | 4184 | _forwardParentProp: function (prop, value) { |
... | ... | @@ -4006,7 +4188,7 @@ inst.__setProperty(prop, value, true); |
4006 | 4188 | }, |
4007 | 4189 | _forwardParentPath: function (path, value) { |
4008 | 4190 | this._instances.forEach(function (inst) { |
4009 | -inst.notifyPath(path, value, true); | |
4191 | +inst._notifyPath(path, value, true); | |
4010 | 4192 | }, this); |
4011 | 4193 | }, |
4012 | 4194 | _forwardItemPath: function (path, value) { |
... | ... | @@ -4018,7 +4200,7 @@ var inst = this._instances[idx]; |
4018 | 4200 | if (inst) { |
4019 | 4201 | if (dot >= 0) { |
4020 | 4202 | path = this.as + '.' + path.substring(dot + 1); |
4021 | -inst.notifyPath(path, value, true); | |
4203 | +inst._notifyPath(path, value, true); | |
4022 | 4204 | } else { |
4023 | 4205 | inst.__setProperty(this.as, value, true); |
4024 | 4206 | } |
... | ... | @@ -4070,6 +4252,7 @@ this.unlinkPaths('selected.' + i); |
4070 | 4252 | } |
4071 | 4253 | } else { |
4072 | 4254 | this.unlinkPaths('selected'); |
4255 | +this.unlinkPaths('selectedItem'); | |
4073 | 4256 | } |
4074 | 4257 | if (this.multi) { |
4075 | 4258 | if (!this.selected || this.selected.length) { |
... | ... | @@ -4209,7 +4392,7 @@ this._instance[prop] = value; |
4209 | 4392 | }, |
4210 | 4393 | _forwardParentPath: function (path, value) { |
4211 | 4394 | if (this._instance) { |
4212 | -this._instance.notifyPath(path, value, true); | |
4395 | +this._instance._notifyPath(path, value, true); | |
4213 | 4396 | } |
4214 | 4397 | } |
4215 | 4398 | }); | ... | ... |
bower_components/prism/.bower.json
... | ... | @@ -26,12 +26,12 @@ |
26 | 26 | "utopia.js", |
27 | 27 | "code.js" |
28 | 28 | ], |
29 | - "version": "1.2.0", | |
30 | - "_release": "1.2.0", | |
29 | + "version": "1.3.0", | |
30 | + "_release": "1.3.0", | |
31 | 31 | "_resolution": { |
32 | 32 | "type": "version", |
33 | - "tag": "v1.2.0", | |
34 | - "commit": "0924b070349284d8a705ad9ff2c70fbdb43e76bf" | |
33 | + "tag": "v1.3.0", | |
34 | + "commit": "ad97b23be583f01e84ec5f17197d2c2b109ca7d0" | |
35 | 35 | }, |
36 | 36 | "_source": "git://github.com/LeaVerou/prism.git", |
37 | 37 | "_target": "*", | ... | ... |
bower_components/prism/CHANGELOG.md
1 | 1 | # Prism Changelog |
2 | 2 | |
3 | +## 1.3.0 (2015-10-26) | |
4 | + | |
5 | +### New components | |
6 | + | |
7 | +* __AsciiDoc__ ([#800](https://github.com/PrismJS/prism/issues/800)) [[`6803ca0`](https://github.com/PrismJS/prism/commit/6803ca0)] | |
8 | +* __Haxe__ ([#811](https://github.com/PrismJS/prism/issues/811)) [[`bd44341`](https://github.com/PrismJS/prism/commit/bd44341)] | |
9 | +* __Icon__ ([#803](https://github.com/PrismJS/prism/issues/803)) [[`b43c5f3`](https://github.com/PrismJS/prism/commit/b43c5f3)] | |
10 | +* __Kotlin ([#814](https://github.com/PrismJS/prism/issues/814)) [[`e8a31a5`](https://github.com/PrismJS/prism/commit/e8a31a5)] | |
11 | +* __Lua__ ([#804](https://github.com/PrismJS/prism/issues/804)) [[`a36bc4a`](https://github.com/PrismJS/prism/commit/a36bc4a)] | |
12 | +* __Nix__ ([#795](https://github.com/PrismJS/prism/issues/795)) [[`9b275c8`](https://github.com/PrismJS/prism/commit/9b275c8)] | |
13 | +* __Oz__ ([#805](https://github.com/PrismJS/prism/issues/805)) [[`388c53f`](https://github.com/PrismJS/prism/commit/388c53f)] | |
14 | +* __PARI/GP__ ([#802](https://github.com/PrismJS/prism/issues/802)) [[`253c035`](https://github.com/PrismJS/prism/commit/253c035)] | |
15 | +* __Parser__ ([#808](https://github.com/PrismJS/prism/issues/808)) [[`a953b3a`](https://github.com/PrismJS/prism/commit/a953b3a)] | |
16 | +* __Puppet__ ([#813](https://github.com/PrismJS/prism/issues/813)) [[`81933ee`](https://github.com/PrismJS/prism/commit/81933ee)] | |
17 | +* __Roboconf__ ([#812](https://github.com/PrismJS/prism/issues/812)) [[`f5db346`](https://github.com/PrismJS/prism/commit/f5db346)] | |
18 | + | |
19 | +### Updated components | |
20 | + | |
21 | +* __C__: | |
22 | + * Highlight directives in preprocessor lines ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)] | |
23 | +* __C#__: | |
24 | + * Highlight directives in preprocessor lines ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)] | |
25 | + * Fix detection of float numbers ([#806](https://github.com/PrismJS/prism/issues/806)) [[`1dae72b`](https://github.com/PrismJS/prism/commit/1dae72b)] | |
26 | +* __F#__: | |
27 | + * Highlight directives in preprocessor lines ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)] | |
28 | +* __JavaScript__: | |
29 | + * Highlight true and false as booleans ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)] | |
30 | +* __Python__: | |
31 | + * Highlight triple-quoted strings before comments. Fix [#815](https://github.com/PrismJS/prism/issues/815) [[`90fbf0b`](https://github.com/PrismJS/prism/commit/90fbf0b)] | |
32 | + | |
33 | +### New plugins | |
34 | + | |
35 | +* __Previewer: Time__ ([#790](https://github.com/PrismJS/prism/issues/790)) [[`88173de`](https://github.com/PrismJS/prism/commit/88173de)] | |
36 | +* __Previewer: Angle__ ([#791](https://github.com/PrismJS/prism/issues/791)) [[`a434c86`](https://github.com/PrismJS/prism/commit/a434c86)] | |
37 | + | |
38 | +### Other changes | |
39 | + | |
40 | +* Increase mocha's timeout [[`f1c41db`](https://github.com/PrismJS/prism/commit/f1c41db)] | |
41 | +* Prevent most errors in IE8. Fix [#9](https://github.com/PrismJS/prism/issues/9) [[`9652d75`](https://github.com/PrismJS/prism/commit/9652d75)] | |
42 | +* Add U.S. Web Design Standards on homepage. Fix [#785](https://github.com/PrismJS/prism/issues/785) [[`e10d48b`](https://github.com/PrismJS/prism/commit/e10d48b), [`79ebbf8`](https://github.com/PrismJS/prism/commit/79ebbf8), [`2f7088d`](https://github.com/PrismJS/prism/commit/2f7088d)] | |
43 | +* Added gulp task to autolink PRs and commits in changelog [[`5ec4e4d`](https://github.com/PrismJS/prism/commit/5ec4e4d)] | |
44 | +* Use child processes to run each set of tests, in order to deal with the memory leak in vm.runInNewContext() [[`9a4b6fa`](https://github.com/PrismJS/prism/commit/9a4b6fa)] | |
45 | + | |
3 | 46 | ## 1.2.0 (2015-10-07) |
4 | 47 | |
5 | 48 | ### New components | ... | ... |
bower_components/prism/components.js
... | ... | @@ -79,6 +79,10 @@ var components = { |
79 | 79 | "title": "AppleScript", |
80 | 80 | "owner": "Golmote" |
81 | 81 | }, |
82 | + "asciidoc": { | |
83 | + "title": "AsciiDoc", | |
84 | + "owner": "Golmote" | |
85 | + }, | |
82 | 86 | "aspnet": { |
83 | 87 | "title": "ASP.NET (C#)", |
84 | 88 | "require": "markup", |
... | ... | @@ -219,10 +223,19 @@ var components = { |
219 | 223 | "title": "Haskell", |
220 | 224 | "owner": "bholst" |
221 | 225 | }, |
226 | + "haxe": { | |
227 | + "title": "Haxe", | |
228 | + "require": "clike", | |
229 | + "owner": "Golmote" | |
230 | + }, | |
222 | 231 | "http": { |
223 | 232 | "title": "HTTP", |
224 | 233 | "owner": "danielgtaylor" |
225 | 234 | }, |
235 | + "icon": { | |
236 | + "title": "Icon", | |
237 | + "owner": "Golmote" | |
238 | + }, | |
226 | 239 | "inform7": { |
227 | 240 | "title": "Inform 7", |
228 | 241 | "owner": "Golmote" |
... | ... | @@ -253,6 +266,11 @@ var components = { |
253 | 266 | "title": "Keyman", |
254 | 267 | "owner": "mcdurdin" |
255 | 268 | }, |
269 | + "kotlin": { | |
270 | + "title": "Kotlin", | |
271 | + "require": "clike", | |
272 | + "owner": "Golmote" | |
273 | + }, | |
256 | 274 | "latex": { |
257 | 275 | "title": "LaTeX", |
258 | 276 | "owner": "japborst" |
... | ... | @@ -266,6 +284,10 @@ var components = { |
266 | 284 | "title": "LOLCODE", |
267 | 285 | "owner": "Golmote" |
268 | 286 | }, |
287 | + "lua": { | |
288 | + "title": "Lua", | |
289 | + "owner": "Golmote" | |
290 | + }, | |
269 | 291 | "makefile": { |
270 | 292 | "title": "Makefile", |
271 | 293 | "owner": "Golmote" |
... | ... | @@ -304,6 +326,10 @@ var components = { |
304 | 326 | "title": "Nim", |
305 | 327 | "owner": "Golmote" |
306 | 328 | }, |
329 | + "nix": { | |
330 | + "title": "Nix", | |
331 | + "owner": "Golmote" | |
332 | + }, | |
307 | 333 | "nsis": { |
308 | 334 | "title": "NSIS", |
309 | 335 | "owner": "idleberg" |
... | ... | @@ -317,6 +343,19 @@ var components = { |
317 | 343 | "title": "OCaml", |
318 | 344 | "owner": "Golmote" |
319 | 345 | }, |
346 | + "oz": { | |
347 | + "title": "Oz", | |
348 | + "owner": "Golmote" | |
349 | + }, | |
350 | + "parigp": { | |
351 | + "title": "PARI/GP", | |
352 | + "owner": "Golmote" | |
353 | + }, | |
354 | + "parser": { | |
355 | + "title": "Parser", | |
356 | + "require": "markup", | |
357 | + "owner": "Golmote" | |
358 | + }, | |
320 | 359 | "pascal": { |
321 | 360 | "title": "Pascal", |
322 | 361 | "owner": "Golmote" |
... | ... | @@ -348,6 +387,10 @@ var components = { |
348 | 387 | "title": "Prolog", |
349 | 388 | "owner": "Golmote" |
350 | 389 | }, |
390 | + "puppet": { | |
391 | + "title": "Puppet", | |
392 | + "owner": "Golmote" | |
393 | + }, | |
351 | 394 | "pure": { |
352 | 395 | "title": "Pure", |
353 | 396 | "owner": "Golmote" |
... | ... | @@ -382,6 +425,10 @@ var components = { |
382 | 425 | "title": "Rip", |
383 | 426 | "owner": "ravinggenius" |
384 | 427 | }, |
428 | + "roboconf": { | |
429 | + "title": "Roboconf", | |
430 | + "owner": "Golmote" | |
431 | + }, | |
385 | 432 | "ruby": { |
386 | 433 | "title": "Ruby", |
387 | 434 | "require": "clike", |
... | ... | @@ -532,6 +579,16 @@ var components = { |
532 | 579 | "require": "previewer-base", |
533 | 580 | "owner": "Golmote" |
534 | 581 | }, |
582 | + "previewer-time": { | |
583 | + "title": "Previewer: Time", | |
584 | + "require": "previewer-base", | |
585 | + "owner": "Golmote" | |
586 | + }, | |
587 | + "previewer-angle": { | |
588 | + "title": "Previewer: Angle", | |
589 | + "require": "previewer-base", | |
590 | + "owner": "Golmote" | |
591 | + }, | |
535 | 592 | "autoloader": { |
536 | 593 | "title": "Autoloader", |
537 | 594 | "owner": "Golmote", | ... | ... |
bower_components/prism/components/prism-asciidoc.js
0 โ 100644
1 | +(function (Prism) { | |
2 | + | |
3 | + var attributes = { | |
4 | + pattern: /(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\]\\]|\\.)*\]|[^\]\\]|\\.)*\]/m, | |
5 | + lookbehind: true, | |
6 | + inside: { | |
7 | + 'quoted': { | |
8 | + pattern: /([$`])(?:(?!\1)[^\\]|\\.)*\1/, | |
9 | + inside: { | |
10 | + 'punctuation': /^[$`]|[$`]$/ | |
11 | + } | |
12 | + }, | |
13 | + 'interpreted': { | |
14 | + pattern: /'(?:[^'\\]|\\.)*'/, | |
15 | + inside: { | |
16 | + 'punctuation': /^'|'$/ | |
17 | + // See rest below | |
18 | + } | |
19 | + }, | |
20 | + 'string': /"(?:[^"\\]|\\.)*"/, | |
21 | + 'variable': /\w+(?==)/, | |
22 | + 'punctuation': /^\[|\]$|,/, | |
23 | + 'operator': /=/, | |
24 | + // The negative look-ahead prevents blank matches | |
25 | + 'attr-value': /(?!^\s+$).+/ | |
26 | + } | |
27 | + }; | |
28 | + Prism.languages.asciidoc = { | |
29 | + 'comment-block': { | |
30 | + pattern: /^(\/{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1/m, | |
31 | + alias: 'comment' | |
32 | + }, | |
33 | + 'table': { | |
34 | + pattern: /^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m, | |
35 | + inside: { | |
36 | + 'specifiers': { | |
37 | + pattern: /(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/, | |
38 | + alias: 'attr-value' | |
39 | + }, | |
40 | + 'punctuation': { | |
41 | + pattern: /(^|[^\\])[|!]=*/, | |
42 | + lookbehind: true | |
43 | + } | |
44 | + // See rest below | |
45 | + } | |
46 | + }, | |
47 | + | |
48 | + 'passthrough-block': { | |
49 | + pattern: /^(\+{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m, | |
50 | + inside: { | |
51 | + 'punctuation': /^\++|\++$/ | |
52 | + // See rest below | |
53 | + } | |
54 | + }, | |
55 | + // Literal blocks and listing blocks | |
56 | + 'literal-block': { | |
57 | + pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m, | |
58 | + inside: { | |
59 | + 'punctuation': /^(?:-+|\.+)|(?:-+|\.+)$/ | |
60 | + // See rest below | |
61 | + } | |
62 | + }, | |
63 | + // Sidebar blocks, quote blocks, example blocks and open blocks | |
64 | + 'other-block': { | |
65 | + pattern: /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m, | |
66 | + inside: { | |
67 | + 'punctuation': /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/ | |
68 | + // See rest below | |
69 | + } | |
70 | + }, | |
71 | + | |
72 | + // list-punctuation and list-label must appear before indented-block | |
73 | + 'list-punctuation': { | |
74 | + pattern: /(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im, | |
75 | + lookbehind: true, | |
76 | + alias: 'punctuation' | |
77 | + }, | |
78 | + 'list-label': { | |
79 | + pattern: /(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im, | |
80 | + lookbehind: true, | |
81 | + alias: 'symbol' | |
82 | + }, | |
83 | + 'indented-block': { | |
84 | + pattern: /((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/, | |
85 | + lookbehind: true | |
86 | + }, | |
87 | + | |
88 | + 'comment': /^\/\/.*/m, | |
89 | + 'title': { | |
90 | + pattern: /^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} +.+|^\.(?![\s.]).*/m, | |
91 | + alias: 'important', | |
92 | + inside: { | |
93 | + 'punctuation': /^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/ | |
94 | + // See rest below | |
95 | + } | |
96 | + }, | |
97 | + 'attribute-entry': { | |
98 | + pattern: /^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m, | |
99 | + alias: 'tag' | |
100 | + }, | |
101 | + 'attributes': attributes, | |
102 | + 'hr': { | |
103 | + pattern: /^'{3,}$/m, | |
104 | + alias: 'punctuation' | |
105 | + }, | |
106 | + 'page-break': { | |
107 | + pattern: /^<{3,}$/m, | |
108 | + alias: 'punctuation' | |
109 | + }, | |
110 | + 'admonition': { | |
111 | + pattern: /^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m, | |
112 | + alias: 'keyword' | |
113 | + }, | |
114 | + 'callout': [ | |
115 | + { | |
116 | + pattern: /(^[ \t]*)<?\d*>/m, | |
117 | + lookbehind: true, | |
118 | + alias: 'symbol' | |
119 | + }, | |
120 | + { | |
121 | + pattern: /<\d+>/, | |
122 | + alias: 'symbol' | |
123 | + } | |
124 | + ], | |
125 | + 'macro': { | |
126 | + pattern: /\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, | |
127 | + inside: { | |
128 | + 'function': /^[a-z\d-]+(?=:)/, | |
129 | + 'punctuation': /^::?/, | |
130 | + 'attributes': { | |
131 | + pattern: /(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, | |
132 | + inside: attributes.inside | |
133 | + } | |
134 | + } | |
135 | + }, | |
136 | + 'inline': { | |
137 | + /* | |
138 | + The initial look-behind prevents the highlighting of escaped quoted text. | |
139 | + | |
140 | + Quoted text can be multi-line but cannot span an empty line. | |
141 | + All quoted text can have attributes before [foobar, 'foobar', baz="bar"]. | |
142 | + | |
143 | + First, we handle the constrained quotes. | |
144 | + Those must be bounded by non-word chars and cannot have spaces between the delimiter and the first char. | |
145 | + They are, in order: _emphasis_, ``double quotes'', `single quotes', `monospace`, 'emphasis', *strong*, +monospace+ and #unquoted# | |
146 | + | |
147 | + Then we handle the unconstrained quotes. | |
148 | + Those do not have the restrictions of the constrained quotes. | |
149 | + They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++, ##unquoted##, $$passthrough$$, ~subscript~, ^superscript^, {attribute-reference}, [[anchor]], [[[bibliography anchor]]], <<xref>>, (((indexes))) and ((indexes)) | |
150 | + */ | |
151 | + pattern: /(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m, | |
152 | + lookbehind: true, | |
153 | + inside: { | |
154 | + 'attributes': attributes, | |
155 | + 'url': { | |
156 | + pattern: /^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/, | |
157 | + inside: { | |
158 | + 'punctuation': /^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/ | |
159 | + } | |
160 | + }, | |
161 | + 'attribute-ref': { | |
162 | + pattern: /^\{.+\}$/, | |
163 | + inside: { | |
164 | + 'variable': { | |
165 | + pattern: /(^\{)[a-z\d,+_-]+/, | |
166 | + lookbehind: true | |
167 | + }, | |
168 | + 'operator': /^[=?!#%@$]|!(?=[:}])/, | |
169 | + 'punctuation': /^\{|\}$|::?/ | |
170 | + } | |
171 | + }, | |
172 | + 'italic': { | |
173 | + pattern: /^(['_])[\s\S]+\1$/, | |
174 | + inside: { | |
175 | + 'punctuation': /^(?:''?|__?)|(?:''?|__?)$/ | |
176 | + } | |
177 | + }, | |
178 | + 'bold': { | |
179 | + pattern: /^\*[\s\S]+\*$/, | |
180 | + inside: { | |
181 | + punctuation: /^\*\*?|\*\*?$/ | |
182 | + } | |
183 | + }, | |
184 | + 'punctuation': /^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/ | |
185 | + } | |
186 | + }, | |
187 | + 'replacement': { | |
188 | + pattern: /\((?:C|TM|R)\)/, | |
189 | + alias: 'builtin' | |
190 | + }, | |
191 | + 'entity': /&#?[\da-z]{1,8};/i, | |
192 | + 'line-continuation': { | |
193 | + pattern: /(^| )\+$/m, | |
194 | + lookbehind: true, | |
195 | + alias: 'punctuation' | |
196 | + } | |
197 | + }; | |
198 | + | |
199 | + | |
200 | + // Allow some nesting. There is no recursion though, so cloning should not be needed. | |
201 | + | |
202 | + attributes.inside['interpreted'].inside.rest = { | |
203 | + 'macro': Prism.languages.asciidoc['macro'], | |
204 | + 'inline': Prism.languages.asciidoc['inline'], | |
205 | + 'replacement': Prism.languages.asciidoc['replacement'], | |
206 | + 'entity': Prism.languages.asciidoc['entity'] | |
207 | + }; | |
208 | + | |
209 | + Prism.languages.asciidoc['passthrough-block'].inside.rest = { | |
210 | + 'macro': Prism.languages.asciidoc['macro'] | |
211 | + }; | |
212 | + | |
213 | + Prism.languages.asciidoc['literal-block'].inside.rest = { | |
214 | + 'callout': Prism.languages.asciidoc['callout'] | |
215 | + }; | |
216 | + | |
217 | + Prism.languages.asciidoc['table'].inside.rest = { | |
218 | + 'comment-block': Prism.languages.asciidoc['comment-block'], | |
219 | + 'passthrough-block': Prism.languages.asciidoc['passthrough-block'], | |
220 | + 'literal-block': Prism.languages.asciidoc['literal-block'], | |
221 | + 'other-block': Prism.languages.asciidoc['other-block'], | |
222 | + 'list-punctuation': Prism.languages.asciidoc['list-punctuation'], | |
223 | + 'indented-block': Prism.languages.asciidoc['indented-block'], | |
224 | + 'comment': Prism.languages.asciidoc['comment'], | |
225 | + 'title': Prism.languages.asciidoc['title'], | |
226 | + 'attribute-entry': Prism.languages.asciidoc['attribute-entry'], | |
227 | + 'attributes': Prism.languages.asciidoc['attributes'], | |
228 | + 'hr': Prism.languages.asciidoc['hr'], | |
229 | + 'page-break': Prism.languages.asciidoc['page-break'], | |
230 | + 'admonition': Prism.languages.asciidoc['admonition'], | |
231 | + 'list-label': Prism.languages.asciidoc['list-label'], | |
232 | + 'callout': Prism.languages.asciidoc['callout'], | |
233 | + 'macro': Prism.languages.asciidoc['macro'], | |
234 | + 'inline': Prism.languages.asciidoc['inline'], | |
235 | + 'replacement': Prism.languages.asciidoc['replacement'], | |
236 | + 'entity': Prism.languages.asciidoc['entity'], | |
237 | + 'line-continuation': Prism.languages.asciidoc['line-continuation'] | |
238 | + }; | |
239 | + | |
240 | + Prism.languages.asciidoc['other-block'].inside.rest = { | |
241 | + 'table': Prism.languages.asciidoc['table'], | |
242 | + 'list-punctuation': Prism.languages.asciidoc['list-punctuation'], | |
243 | + 'indented-block': Prism.languages.asciidoc['indented-block'], | |
244 | + 'comment': Prism.languages.asciidoc['comment'], | |
245 | + 'attribute-entry': Prism.languages.asciidoc['attribute-entry'], | |
246 | + 'attributes': Prism.languages.asciidoc['attributes'], | |
247 | + 'hr': Prism.languages.asciidoc['hr'], | |
248 | + 'page-break': Prism.languages.asciidoc['page-break'], | |
249 | + 'admonition': Prism.languages.asciidoc['admonition'], | |
250 | + 'list-label': Prism.languages.asciidoc['list-label'], | |
251 | + 'macro': Prism.languages.asciidoc['macro'], | |
252 | + 'inline': Prism.languages.asciidoc['inline'], | |
253 | + 'replacement': Prism.languages.asciidoc['replacement'], | |
254 | + 'entity': Prism.languages.asciidoc['entity'], | |
255 | + 'line-continuation': Prism.languages.asciidoc['line-continuation'] | |
256 | + }; | |
257 | + | |
258 | + Prism.languages.asciidoc['title'].inside.rest = { | |
259 | + 'macro': Prism.languages.asciidoc['macro'], | |
260 | + 'inline': Prism.languages.asciidoc['inline'], | |
261 | + 'replacement': Prism.languages.asciidoc['replacement'], | |
262 | + 'entity': Prism.languages.asciidoc['entity'] | |
263 | + }; | |
264 | + | |
265 | + // Plugin to make entity title show the real entity, idea by Roman Komarov | |
266 | + Prism.hooks.add('wrap', function(env) { | |
267 | + if (env.type === 'entity') { | |
268 | + env.attributes['title'] = env.content.replace(/&/, '&'); | |
269 | + } | |
270 | + }); | |
271 | +}(Prism)); | |
0 | 272 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-asciidoc.min.js
0 โ 100644
1 | +!function(a){var i={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\]\\]|\\.)*\]|[^\]\\]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}};a.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} +.+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:i,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)<?\d*>/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{"function":/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:i.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:i,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|TM|R)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}},i.inside.interpreted.inside.rest={macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity},a.languages.asciidoc["passthrough-block"].inside.rest={macro:a.languages.asciidoc.macro},a.languages.asciidoc["literal-block"].inside.rest={callout:a.languages.asciidoc.callout},a.languages.asciidoc.table.inside.rest={"comment-block":a.languages.asciidoc["comment-block"],"passthrough-block":a.languages.asciidoc["passthrough-block"],"literal-block":a.languages.asciidoc["literal-block"],"other-block":a.languages.asciidoc["other-block"],"list-punctuation":a.languages.asciidoc["list-punctuation"],"indented-block":a.languages.asciidoc["indented-block"],comment:a.languages.asciidoc.comment,title:a.languages.asciidoc.title,"attribute-entry":a.languages.asciidoc["attribute-entry"],attributes:a.languages.asciidoc.attributes,hr:a.languages.asciidoc.hr,"page-break":a.languages.asciidoc["page-break"],admonition:a.languages.asciidoc.admonition,"list-label":a.languages.asciidoc["list-label"],callout:a.languages.asciidoc.callout,macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity,"line-continuation":a.languages.asciidoc["line-continuation"]},a.languages.asciidoc["other-block"].inside.rest={table:a.languages.asciidoc.table,"list-punctuation":a.languages.asciidoc["list-punctuation"],"indented-block":a.languages.asciidoc["indented-block"],comment:a.languages.asciidoc.comment,"attribute-entry":a.languages.asciidoc["attribute-entry"],attributes:a.languages.asciidoc.attributes,hr:a.languages.asciidoc.hr,"page-break":a.languages.asciidoc["page-break"],admonition:a.languages.asciidoc.admonition,"list-label":a.languages.asciidoc["list-label"],macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity,"line-continuation":a.languages.asciidoc["line-continuation"]},a.languages.asciidoc.title.inside.rest={macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity},a.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})}(Prism); | |
0 | 2 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-c.js
... | ... | @@ -16,9 +16,17 @@ Prism.languages.insertBefore('c', 'string', { |
16 | 16 | 'string': { |
17 | 17 | pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/, |
18 | 18 | lookbehind: true |
19 | + }, | |
20 | + // highlight macro directives as keywords | |
21 | + 'directive': { | |
22 | + pattern: /(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/, | |
23 | + lookbehind: true, | |
24 | + alias: 'keyword' | |
19 | 25 | } |
20 | 26 | } |
21 | - } | |
27 | + }, | |
28 | + // highlight predefined macros as constants | |
29 | + 'constant': /\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/ | |
22 | 30 | }); |
23 | 31 | |
24 | 32 | delete Prism.languages.c['class-name']; | ... | ... |
bower_components/prism/components/prism-c.min.js
1 | -Prism.languages.c=Prism.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete Prism.languages.c["class-name"],delete Prism.languages.c["boolean"]; | |
2 | 1 | \ No newline at end of file |
2 | +Prism.languages.c=Prism.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/}),delete Prism.languages.c["class-name"],delete Prism.languages.c["boolean"]; | |
3 | 3 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-csharp.js
... | ... | @@ -4,12 +4,21 @@ Prism.languages.csharp = Prism.languages.extend('clike', { |
4 | 4 | /@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/, |
5 | 5 | /("|')(\\?.)*?\1/ |
6 | 6 | ], |
7 | - 'number': /\b-?(0x[\da-f]+|\d*\.?\d+)\b/i | |
7 | + 'number': /\b-?(0x[\da-f]+|\d*\.?\d+f?)\b/i | |
8 | 8 | }); |
9 | 9 | |
10 | 10 | Prism.languages.insertBefore('csharp', 'keyword', { |
11 | 11 | 'preprocessor': { |
12 | 12 | pattern: /(^\s*)#.*/m, |
13 | - lookbehind: true | |
13 | + lookbehind: true, | |
14 | + alias: 'property', | |
15 | + inside: { | |
16 | + // highlight preprocessor directives as keywords | |
17 | + 'directive': { | |
18 | + pattern: /(\s*#)\b(define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/, | |
19 | + lookbehind: true, | |
20 | + alias: 'keyword' | |
21 | + } | |
22 | + } | |
14 | 23 | } |
15 | 24 | }); | ... | ... |
bower_components/prism/components/prism-csharp.min.js
1 | -Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),Prism.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}); | |
2 | 1 | \ No newline at end of file |
2 | +Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+f?)\b/i}),Prism.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}}); | |
3 | 3 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-fsharp.js
... | ... | @@ -19,5 +19,15 @@ Prism.languages.fsharp = Prism.languages.extend('clike', { |
19 | 19 | ] |
20 | 20 | }); |
21 | 21 | Prism.languages.insertBefore('fsharp', 'keyword', { |
22 | - 'preprocessor': /^[^\r\n\S]*#.*/m | |
23 | -}); | |
24 | 22 | \ No newline at end of file |
23 | + 'preprocessor': { | |
24 | + pattern: /^[^\r\n\S]*#.*/m, | |
25 | + alias: 'property', | |
26 | + inside: { | |
27 | + 'directive': { | |
28 | + pattern: /(\s*#)\b(else|endif|if|light|line|nowarn)\b/, | |
29 | + lookbehind: true, | |
30 | + alias: 'keyword' | |
31 | + } | |
32 | + } | |
33 | + } | |
34 | +}); | ... | ... |
bower_components/prism/components/prism-fsharp.min.js
1 | -Prism.languages.fsharp=Prism.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*[\w\W]*?\*\)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],keyword:/\b(?:let|return|use|yield)(?:!\B|\b)|\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,string:/(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|("|')(?:\\\1|\\?(?!\1)[\s\S])*\1)B?/,number:[/\b-?0x[\da-fA-F]+(un|lf|LF)?\b/,/\b-?0b[01]+(y|uy)?\b/,/\b-?(\d*\.?\d+|\d+\.)([fFmM]|[eE][+-]?\d+)?\b/,/\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/]}),Prism.languages.insertBefore("fsharp","keyword",{preprocessor:/^[^\r\n\S]*#.*/m}); | |
2 | 1 | \ No newline at end of file |
2 | +Prism.languages.fsharp=Prism.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*[\w\W]*?\*\)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],keyword:/\b(?:let|return|use|yield)(?:!\B|\b)|\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,string:/(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|("|')(?:\\\1|\\?(?!\1)[\s\S])*\1)B?/,number:[/\b-?0x[\da-fA-F]+(un|lf|LF)?\b/,/\b-?0b[01]+(y|uy)?\b/,/\b-?(\d*\.?\d+|\d+\.)([fFmM]|[eE][+-]?\d+)?\b/,/\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/]}),Prism.languages.insertBefore("fsharp","keyword",{preprocessor:{pattern:/^[^\r\n\S]*#.*/m,alias:"property",inside:{directive:{pattern:/(\s*#)\b(else|endif|if|light|line|nowarn)\b/,lookbehind:!0,alias:"keyword"}}}}); | |
3 | 3 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-haxe.js
0 โ 100644
1 | +Prism.languages.haxe = Prism.languages.extend('clike', { | |
2 | + // Strings can be multi-line | |
3 | + 'string': { | |
4 | + pattern: /(["'])(?:(?!\1)[^\\]|\\[\s\S])*\1/, | |
5 | + inside: { | |
6 | + 'interpolation': { | |
7 | + pattern: /(^|[^\\])\$(?:\w+|\{[^}]+\})/, | |
8 | + lookbehind: true, | |
9 | + inside: { | |
10 | + 'interpolation': { | |
11 | + pattern: /^\$\w*/, | |
12 | + alias: 'variable' | |
13 | + } | |
14 | + // See rest below | |
15 | + } | |
16 | + } | |
17 | + } | |
18 | + }, | |
19 | + // The final look-ahead prevents highlighting of keywords if expressions such as "haxe.macro.Expr" | |
20 | + 'keyword': /\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|from|for|function|if|implements|import|in|inline|interface|macro|new|null|override|public|private|return|static|super|switch|throw|to|try|typedef|using|var|while)(?!\.)\b/, | |
21 | + 'operator': /\.{3}|\+\+?|-[->]?|[=!]=?|&&?|\|\|?|<[<=]?|>[>=]?|[*\/%~^]/ | |
22 | +}); | |
23 | +Prism.languages.insertBefore('haxe', 'class-name', { | |
24 | + 'regex': { | |
25 | + pattern: /~\/(?:[^\/\\\r\n]|\\.)+\/[igmsu]*/ | |
26 | + } | |
27 | +}); | |
28 | +Prism.languages.insertBefore('haxe', 'keyword', { | |
29 | + 'preprocessor': { | |
30 | + pattern: /#\w+/, | |
31 | + alias: 'builtin' | |
32 | + }, | |
33 | + 'metadata': { | |
34 | + pattern: /@:?\w+/, | |
35 | + alias: 'symbol' | |
36 | + }, | |
37 | + 'reification': { | |
38 | + pattern: /\$(?:\w+|(?=\{))/, | |
39 | + alias: 'variable' | |
40 | + } | |
41 | +}); | |
42 | +Prism.languages.haxe['string'].inside['interpolation'].inside.rest = Prism.util.clone(Prism.languages.haxe); | |
43 | +delete Prism.languages.haxe['class-name']; | |
0 | 44 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-haxe.min.js
0 โ 100644
1 | +Prism.languages.haxe=Prism.languages.extend("clike",{string:{pattern:/(["'])(?:(?!\1)[^\\]|\\[\s\S])*\1/,inside:{interpolation:{pattern:/(^|[^\\])\$(?:\w+|\{[^}]+\})/,lookbehind:!0,inside:{interpolation:{pattern:/^\$\w*/,alias:"variable"}}}}},keyword:/\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|from|for|function|if|implements|import|in|inline|interface|macro|new|null|override|public|private|return|static|super|switch|throw|to|try|typedef|using|var|while)(?!\.)\b/,operator:/\.{3}|\+\+?|-[->]?|[=!]=?|&&?|\|\|?|<[<=]?|>[>=]?|[*\/%~^]/}),Prism.languages.insertBefore("haxe","class-name",{regex:{pattern:/~\/(?:[^\/\\\r\n]|\\.)+\/[igmsu]*/}}),Prism.languages.insertBefore("haxe","keyword",{preprocessor:{pattern:/#\w+/,alias:"builtin"},metadata:{pattern:/@:?\w+/,alias:"symbol"},reification:{pattern:/\$(?:\w+|(?=\{))/,alias:"variable"}}),Prism.languages.haxe.string.inside.interpolation.inside.rest=Prism.util.clone(Prism.languages.haxe),delete Prism.languages.haxe["class-name"]; | |
0 | 2 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-icon.js
0 โ 100644
1 | +Prism.languages.icon = { | |
2 | + 'comment': /#.*/, | |
3 | + 'string': /(["'])(?:(?!\1)[^\\\r\n]|\\.|_(?:\r?\n|\r))*\1/, | |
4 | + 'number': /\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i, | |
5 | + 'builtin-keyword': { | |
6 | + pattern: /&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/, | |
7 | + alias: 'variable' | |
8 | + }, | |
9 | + 'directive': { | |
10 | + pattern: /\$\w+/, | |
11 | + alias: 'builtin' | |
12 | + }, | |
13 | + 'keyword': /\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/, | |
14 | + 'function': /(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/, | |
15 | + 'operator': /[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|<?=?)|>>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/, | |
16 | + 'punctuation': /[\[\](){},;]/ | |
17 | +}; | |
0 | 18 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-icon.min.js
0 โ 100644
1 | +Prism.languages.icon={comment:/#.*/,string:/(["'])(?:(?!\1)[^\\\r\n]|\\.|_(?:\r?\n|\r))*\1/,number:/\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,"builtin-keyword":{pattern:/&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,alias:"variable"},directive:{pattern:/\$\w+/,alias:"builtin"},keyword:/\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,"function":/(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,operator:/[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|<?=?)|>>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,punctuation:/[\[\](){},;]/}; | |
0 | 2 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-javascript.js
1 | 1 | Prism.languages.javascript = Prism.languages.extend('clike', { |
2 | - 'keyword': /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/, | |
2 | + 'keyword': /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/, | |
3 | 3 | 'number': /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/, |
4 | 4 | // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) |
5 | 5 | 'function': /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i | ... | ... |
bower_components/prism/components/prism-javascript.min.js
1 | -Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),Prism.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript; | |
2 | 1 | \ No newline at end of file |
2 | +Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),Prism.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<script[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript; | |
3 | 3 | \ No newline at end of file | ... | ... |
bower_components/prism/components/prism-jsx.js
... | ... | @@ -14,7 +14,8 @@ Prism.languages.insertBefore('inside', 'attr-value',{ |
14 | 14 | inside: { |
15 | 15 | 'function' : Prism.languages.javascript.function, |
16 | 16 | 'punctuation': /[={}[\];(),.:]/, |
17 | - 'keyword': Prism.languages.javascript.keyword | |
17 | + 'keyword': Prism.languages.javascript.keyword, | |
18 | + 'boolean': Prism.languages.javascript.boolean | |
18 | 19 | }, |
19 | 20 | 'alias': 'language-javascript' |
20 | 21 | } | ... | ... |
bower_components/prism/components/prism-jsx.min.js
1 | -!function(a){var s=a.util.clone(a.languages.javascript);a.languages.jsx=a.languages.extend("markup",s),a.languages.jsx.tag.pattern=/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+|(\{[\w\W]*?\})))?\s*)*\/?>/i,a.languages.jsx.tag.inside["attr-value"].pattern=/=[^\{](?:('|")[\w\W]*?(\1)|[^\s>]+)/i,a.languages.insertBefore("inside","attr-value",{script:{pattern:/=(\{(?:\{[^}]*\}|[^}])+\})/i,inside:{"function":a.languages.javascript.function,punctuation:/[={}[\];(),.:]/,keyword:a.languages.javascript.keyword},alias:"language-javascript"}},a.languages.jsx.tag)}(Prism); | |
2 | 1 | \ No newline at end of file |
2 | +!function(a){var s=a.util.clone(a.languages.javascript);a.languages.jsx=a.languages.extend("markup",s),a.languages.jsx.tag.pattern=/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+|(\{[\w\W]*?\})))?\s*)*\/?>/i,a.languages.jsx.tag.inside["attr-value"].pattern=/=[^\{](?:('|")[\w\W]*?(\1)|[^\s>]+)/i,a.languages.insertBefore("inside","attr-value",{script:{pattern:/=(\{(?:\{[^}]*\}|[^}])+\})/i,inside:{"function":a.languages.javascript.function,punctuation:/[={}[\];(),.:]/,keyword:a.languages.javascript.keyword,"boolean":a.languages.javascript.boolean},alias:"language-javascript"}},a.languages.jsx.tag)}(Prism); | |
3 | 3 | \ No newline at end of file | ... | ... |