| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 @license | 2 @license |
| 3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.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/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 7 Code distributed by Google as part of the polymer project is also | 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/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 9 --> | 9 --><script>(function () { |
| 10 | |
| 11 | |
| 12 | |
| 13 <script>(function () { | |
| 14 function resolve() { | 10 function resolve() { |
| 15 document.body.removeAttribute('unresolved'); | 11 document.body.removeAttribute('unresolved'); |
| 16 } | 12 } |
| 17 if (window.WebComponents) { | 13 if (window.WebComponents) { |
| 18 addEventListener('WebComponentsReady', resolve); | 14 addEventListener('WebComponentsReady', resolve); |
| 19 } else { | 15 } else { |
| 20 if (document.readyState === 'interactive' || document.readyState === 'complete')
{ | 16 if (document.readyState === 'interactive' || document.readyState === 'complete')
{ |
| 21 resolve(); | 17 resolve(); |
| 22 } else { | 18 } else { |
| 23 addEventListener('DOMContentLoaded', resolve); | 19 addEventListener('DOMContentLoaded', resolve); |
| 24 } | 20 } |
| 25 } | 21 } |
| 26 }()); | 22 }());window.Polymer = { |
| 27 window.Polymer = { | |
| 28 Settings: function () { | 23 Settings: function () { |
| 29 var settings = window.Polymer || {}; | 24 var settings = window.Polymer || {}; |
| 30 var parts = location.search.slice(1).split('&'); | 25 var parts = location.search.slice(1).split('&'); |
| 31 for (var i = 0, o; i < parts.length && (o = parts[i]); i++) { | 26 for (var i = 0, o; i < parts.length && (o = parts[i]); i++) { |
| 32 o = o.split('='); | 27 o = o.split('='); |
| 33 o[0] && (settings[o[0]] = o[1] || true); | 28 o[0] && (settings[o[0]] = o[1] || true); |
| 34 } | 29 } |
| 35 settings.wantShadow = settings.dom === 'shadow'; | 30 settings.wantShadow = settings.dom === 'shadow'; |
| 36 settings.hasShadow = Boolean(Element.prototype.createShadowRoot); | 31 settings.hasShadow = Boolean(Element.prototype.createShadowRoot); |
| 37 settings.nativeShadow = settings.hasShadow && !window.ShadowDOMPolyfill; | 32 settings.nativeShadow = settings.hasShadow && !window.ShadowDOMPolyfill; |
| 38 settings.useShadow = settings.wantShadow && settings.hasShadow; | 33 settings.useShadow = settings.wantShadow && settings.hasShadow; |
| 39 settings.hasNativeImports = Boolean('import' in document.createElement('link')); | 34 settings.hasNativeImports = Boolean('import' in document.createElement('link')); |
| 40 settings.useNativeImports = settings.hasNativeImports; | 35 settings.useNativeImports = settings.hasNativeImports; |
| 41 settings.useNativeCustomElements = !window.CustomElements || window.CustomElemen
ts.useNative; | 36 settings.useNativeCustomElements = !window.CustomElements || window.CustomElemen
ts.useNative; |
| 42 settings.useNativeShadow = settings.useShadow && settings.nativeShadow; | 37 settings.useNativeShadow = settings.useShadow && settings.nativeShadow; |
| 43 settings.usePolyfillProto = !settings.useNativeCustomElements && !Object.__proto
__; | 38 settings.usePolyfillProto = !settings.useNativeCustomElements && !Object.__proto
__; |
| 39 settings.hasNativeCSSProperties = !navigator.userAgent.match('AppleWebKit/601')
&& window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'); |
| 40 settings.useNativeCSSProperties = settings.hasNativeCSSProperties && settings.la
zyRegister && settings.useNativeCSSProperties; |
| 44 return settings; | 41 return settings; |
| 45 }() | 42 }() |
| 46 }; | 43 };(function () { |
| 47 (function () { | |
| 48 var userPolymer = window.Polymer; | 44 var userPolymer = window.Polymer; |
| 49 window.Polymer = function (prototype) { | 45 window.Polymer = function (prototype) { |
| 50 if (typeof prototype === 'function') { | 46 if (typeof prototype === 'function') { |
| 51 prototype = prototype.prototype; | 47 prototype = prototype.prototype; |
| 52 } | 48 } |
| 53 if (!prototype) { | 49 if (!prototype) { |
| 54 prototype = {}; | 50 prototype = {}; |
| 55 } | 51 } |
| 56 var factory = desugar(prototype); | 52 var factory = desugar(prototype); |
| 57 prototype = factory.prototype; | 53 prototype = factory.prototype; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 84 _regLog: function (prototype) { | 80 _regLog: function (prototype) { |
| 85 console.log('[' + prototype.is + ']: registered'); | 81 console.log('[' + prototype.is + ']: registered'); |
| 86 }, | 82 }, |
| 87 _registrate: function (prototype) { | 83 _registrate: function (prototype) { |
| 88 this.registrations.push(prototype); | 84 this.registrations.push(prototype); |
| 89 Polymer.log && this._regLog(prototype); | 85 Polymer.log && this._regLog(prototype); |
| 90 }, | 86 }, |
| 91 dumpRegistrations: function () { | 87 dumpRegistrations: function () { |
| 92 this.registrations.forEach(this._regLog); | 88 this.registrations.forEach(this._regLog); |
| 93 } | 89 } |
| 94 }; | 90 };Object.defineProperty(window, 'currentImport', { |
| 95 Object.defineProperty(window, 'currentImport', { | |
| 96 enumerable: true, | 91 enumerable: true, |
| 97 configurable: true, | 92 configurable: true, |
| 98 get: function () { | 93 get: function () { |
| 99 return (document._currentScript || document.currentScript).ownerDocument; | 94 return (document._currentScript || document.currentScript).ownerDocument; |
| 100 } | 95 } |
| 101 }); | 96 });Polymer.RenderStatus = { |
| 102 Polymer.RenderStatus = { | |
| 103 _ready: false, | 97 _ready: false, |
| 104 _callbacks: [], | 98 _callbacks: [], |
| 105 whenReady: function (cb) { | 99 whenReady: function (cb) { |
| 106 if (this._ready) { | 100 if (this._ready) { |
| 107 cb(); | 101 cb(); |
| 108 } else { | 102 } else { |
| 109 this._callbacks.push(cb); | 103 this._callbacks.push(cb); |
| 110 } | 104 } |
| 111 }, | 105 }, |
| 112 _makeReady: function () { | 106 _makeReady: function () { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 124 _afterNextRenderQueue: [], | 118 _afterNextRenderQueue: [], |
| 125 _waitingNextRender: false, | 119 _waitingNextRender: false, |
| 126 afterNextRender: function (element, fn, args) { | 120 afterNextRender: function (element, fn, args) { |
| 127 this._watchNextRender(); | 121 this._watchNextRender(); |
| 128 this._afterNextRenderQueue.push([ | 122 this._afterNextRenderQueue.push([ |
| 129 element, | 123 element, |
| 130 fn, | 124 fn, |
| 131 args | 125 args |
| 132 ]); | 126 ]); |
| 133 }, | 127 }, |
| 128 hasRendered: function () { |
| 129 return this._ready; |
| 130 }, |
| 134 _watchNextRender: function () { | 131 _watchNextRender: function () { |
| 135 if (!this._waitingNextRender) { | 132 if (!this._waitingNextRender) { |
| 136 this._waitingNextRender = true; | 133 this._waitingNextRender = true; |
| 137 var fn = function () { | 134 var fn = function () { |
| 138 Polymer.RenderStatus._flushNextRender(); | 135 Polymer.RenderStatus._flushNextRender(); |
| 139 }; | 136 }; |
| 140 if (!this._ready) { | 137 if (!this._ready) { |
| 141 this.whenReady(fn); | 138 this.whenReady(fn); |
| 142 } else { | 139 } else { |
| 143 requestAnimationFrame(fn); | 140 requestAnimationFrame(fn); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 160 } | 157 } |
| 161 }; | 158 }; |
| 162 if (window.HTMLImports) { | 159 if (window.HTMLImports) { |
| 163 HTMLImports.whenReady(function () { | 160 HTMLImports.whenReady(function () { |
| 164 Polymer.RenderStatus._catchFirstRender(); | 161 Polymer.RenderStatus._catchFirstRender(); |
| 165 }); | 162 }); |
| 166 } else { | 163 } else { |
| 167 Polymer.RenderStatus._catchFirstRender(); | 164 Polymer.RenderStatus._catchFirstRender(); |
| 168 } | 165 } |
| 169 Polymer.ImportStatus = Polymer.RenderStatus; | 166 Polymer.ImportStatus = Polymer.RenderStatus; |
| 170 Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady; | 167 Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;(function () { |
| 171 (function () { | |
| 172 'use strict'; | 168 'use strict'; |
| 173 var settings = Polymer.Settings; | 169 var settings = Polymer.Settings; |
| 174 Polymer.Base = { | 170 Polymer.Base = { |
| 175 __isPolymerInstance__: true, | 171 __isPolymerInstance__: true, |
| 176 _addFeature: function (feature) { | 172 _addFeature: function (feature) { |
| 177 this.extend(this, feature); | 173 this.extend(this, feature); |
| 178 }, | 174 }, |
| 179 registerCallback: function () { | 175 registerCallback: function () { |
| 180 this._desugarBehaviors(); | 176 this._desugarBehaviors(); |
| 181 this._doBehavior('beforeRegister'); | 177 this._doBehavior('beforeRegister'); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 196 ensureRegisterFinished: function () { | 192 ensureRegisterFinished: function () { |
| 197 this._ensureRegisterFinished(this); | 193 this._ensureRegisterFinished(this); |
| 198 }, | 194 }, |
| 199 _ensureRegisterFinished: function (proto) { | 195 _ensureRegisterFinished: function (proto) { |
| 200 if (proto.__hasRegisterFinished !== proto.is) { | 196 if (proto.__hasRegisterFinished !== proto.is) { |
| 201 proto.__hasRegisterFinished = proto.is; | 197 proto.__hasRegisterFinished = proto.is; |
| 202 if (proto._finishRegisterFeatures) { | 198 if (proto._finishRegisterFeatures) { |
| 203 proto._finishRegisterFeatures(); | 199 proto._finishRegisterFeatures(); |
| 204 } | 200 } |
| 205 proto._doBehavior('registered'); | 201 proto._doBehavior('registered'); |
| 202 if (settings.usePolyfillProto && proto !== this) { |
| 203 proto.extend(this, proto); |
| 204 } |
| 206 } | 205 } |
| 207 }, | 206 }, |
| 208 attachedCallback: function () { | 207 attachedCallback: function () { |
| 209 var self = this; | 208 var self = this; |
| 210 Polymer.RenderStatus.whenReady(function () { | 209 Polymer.RenderStatus.whenReady(function () { |
| 211 self.isAttached = true; | 210 self.isAttached = true; |
| 212 self._doBehavior('attached'); | 211 self._doBehavior('attached'); |
| 213 }); | 212 }); |
| 214 }, | 213 }, |
| 215 detachedCallback: function () { | 214 detachedCallback: function () { |
| 216 this.isAttached = false; | 215 var self = this; |
| 217 this._doBehavior('detached'); | 216 Polymer.RenderStatus.whenReady(function () { |
| 217 self.isAttached = false; |
| 218 self._doBehavior('detached'); |
| 219 }); |
| 218 }, | 220 }, |
| 219 attributeChangedCallback: function (name, oldValue, newValue) { | 221 attributeChangedCallback: function (name, oldValue, newValue) { |
| 220 this._attributeChangedImpl(name); | 222 this._attributeChangedImpl(name); |
| 221 this._doBehavior('attributeChanged', [ | 223 this._doBehavior('attributeChanged', [ |
| 222 name, | 224 name, |
| 223 oldValue, | 225 oldValue, |
| 224 newValue | 226 newValue |
| 225 ]); | 227 ]); |
| 226 }, | 228 }, |
| 227 _attributeChangedImpl: function (name) { | 229 _attributeChangedImpl: function (name) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 241 target[i] = source[i]; | 243 target[i] = source[i]; |
| 242 } | 244 } |
| 243 return target; | 245 return target; |
| 244 }, | 246 }, |
| 245 copyOwnProperty: function (name, source, target) { | 247 copyOwnProperty: function (name, source, target) { |
| 246 var pd = Object.getOwnPropertyDescriptor(source, name); | 248 var pd = Object.getOwnPropertyDescriptor(source, name); |
| 247 if (pd) { | 249 if (pd) { |
| 248 Object.defineProperty(target, name, pd); | 250 Object.defineProperty(target, name, pd); |
| 249 } | 251 } |
| 250 }, | 252 }, |
| 251 _log: console.log.apply.bind(console.log, console), | 253 _logger: function (level, args) { |
| 252 _warn: console.warn.apply.bind(console.warn, console), | 254 if (args.length === 1 && Array.isArray(args[0])) { |
| 253 _error: console.error.apply.bind(console.error, console), | 255 args = args[0]; |
| 256 } |
| 257 switch (level) { |
| 258 case 'log': |
| 259 case 'warn': |
| 260 case 'error': |
| 261 console[level].apply(console, args); |
| 262 break; |
| 263 } |
| 264 }, |
| 265 _log: function () { |
| 266 var args = Array.prototype.slice.call(arguments, 0); |
| 267 this._logger('log', args); |
| 268 }, |
| 269 _warn: function () { |
| 270 var args = Array.prototype.slice.call(arguments, 0); |
| 271 this._logger('warn', args); |
| 272 }, |
| 273 _error: function () { |
| 274 var args = Array.prototype.slice.call(arguments, 0); |
| 275 this._logger('error', args); |
| 276 }, |
| 254 _logf: function () { | 277 _logf: function () { |
| 255 return this._logPrefix.concat([this.is]).concat(Array.prototype.slice.call(argum
ents, 0)); | 278 return this._logPrefix.concat(this.is).concat(Array.prototype.slice.call(argumen
ts, 0)); |
| 256 } | 279 } |
| 257 }; | 280 }; |
| 258 Polymer.Base._logPrefix = function () { | 281 Polymer.Base._logPrefix = function () { |
| 259 var color = window.chrome || /firefox/i.test(navigator.userAgent); | 282 var color = window.chrome && !/edge/i.test(navigator.userAgent) || /firefox/i.te
st(navigator.userAgent); |
| 260 return color ? [ | 283 return color ? [ |
| 261 '%c[%s::%s]:', | 284 '%c[%s::%s]:', |
| 262 'font-weight: bold; background-color:#EEEE00;' | 285 'font-weight: bold; background-color:#EEEE00;' |
| 263 ] : ['[%s::%s]:']; | 286 ] : ['[%s::%s]:']; |
| 264 }(); | 287 }(); |
| 265 Polymer.Base.chainObject = function (object, inherited) { | 288 Polymer.Base.chainObject = function (object, inherited) { |
| 266 if (object && inherited && object !== inherited) { | 289 if (object && inherited && object !== inherited) { |
| 267 if (!Object.__proto__) { | 290 if (!Object.__proto__) { |
| 268 object = Polymer.Base.extend(Object.create(inherited), object); | 291 object = Polymer.Base.extend(Object.create(inherited), object); |
| 269 } | 292 } |
| 270 object.__proto__ = inherited; | 293 object.__proto__ = inherited; |
| 271 } | 294 } |
| 272 return object; | 295 return object; |
| 273 }; | 296 }; |
| 274 Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype); | 297 Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype); |
| 275 if (window.CustomElements) { | 298 if (window.CustomElements) { |
| 276 Polymer.instanceof = CustomElements.instanceof; | 299 Polymer.instanceof = CustomElements.instanceof; |
| 277 } else { | 300 } else { |
| 278 Polymer.instanceof = function (obj, ctor) { | 301 Polymer.instanceof = function (obj, ctor) { |
| 279 return obj instanceof ctor; | 302 return obj instanceof ctor; |
| 280 }; | 303 }; |
| 281 } | 304 } |
| 282 Polymer.isInstance = function (obj) { | 305 Polymer.isInstance = function (obj) { |
| 283 return Boolean(obj && obj.__isPolymerInstance__); | 306 return Boolean(obj && obj.__isPolymerInstance__); |
| 284 }; | 307 }; |
| 285 Polymer.telemetry.instanceCount = 0; | 308 Polymer.telemetry.instanceCount = 0; |
| 286 }()); | 309 }());(function () { |
| 287 (function () { | |
| 288 var modules = {}; | 310 var modules = {}; |
| 289 var lcModules = {}; | 311 var lcModules = {}; |
| 290 var findModule = function (id) { | 312 var findModule = function (id) { |
| 291 return modules[id] || lcModules[id.toLowerCase()]; | 313 return modules[id] || lcModules[id.toLowerCase()]; |
| 292 }; | 314 }; |
| 293 var DomModule = function () { | 315 var DomModule = function () { |
| 294 return document.createElement('dom-module'); | 316 return document.createElement('dom-module'); |
| 295 }; | 317 }; |
| 296 DomModule.prototype = Object.create(HTMLElement.prototype); | 318 DomModule.prototype = Object.create(HTMLElement.prototype); |
| 297 Polymer.Base.extend(DomModule.prototype, { | 319 Polymer.Base.extend(DomModule.prototype, { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 var modules = doc.querySelectorAll('dom-module'); | 352 var modules = doc.querySelectorAll('dom-module'); |
| 331 for (var i = modules.length - 1, m; i >= 0 && (m = modules[i]); i--) { | 353 for (var i = modules.length - 1, m; i >= 0 && (m = modules[i]); i--) { |
| 332 if (m.__upgraded__) { | 354 if (m.__upgraded__) { |
| 333 return; | 355 return; |
| 334 } else { | 356 } else { |
| 335 CustomElements.upgrade(m); | 357 CustomElements.upgrade(m); |
| 336 } | 358 } |
| 337 } | 359 } |
| 338 } | 360 } |
| 339 } | 361 } |
| 340 }()); | 362 }());Polymer.Base._addFeature({ |
| 341 Polymer.Base._addFeature({ | |
| 342 _prepIs: function () { | 363 _prepIs: function () { |
| 343 if (!this.is) { | 364 if (!this.is) { |
| 344 var module = (document._currentScript || document.currentScript).parentNode; | 365 var module = (document._currentScript || document.currentScript).parentNode; |
| 345 if (module.localName === 'dom-module') { | 366 if (module.localName === 'dom-module') { |
| 346 var id = module.id || module.getAttribute('name') || module.getAttribute('is'); | 367 var id = module.id || module.getAttribute('name') || module.getAttribute('is'); |
| 347 this.is = id; | 368 this.is = id; |
| 348 } | 369 } |
| 349 } | 370 } |
| 350 if (this.is) { | 371 if (this.is) { |
| 351 this.is = this.is.toLowerCase(); | 372 this.is = this.is.toLowerCase(); |
| 352 } | 373 } |
| 353 } | 374 } |
| 354 }); | 375 });Polymer.Base._addFeature({ |
| 355 Polymer.Base._addFeature({ | |
| 356 behaviors: [], | 376 behaviors: [], |
| 357 _desugarBehaviors: function () { | 377 _desugarBehaviors: function () { |
| 358 if (this.behaviors.length) { | 378 if (this.behaviors.length) { |
| 359 this.behaviors = this._desugarSomeBehaviors(this.behaviors); | 379 this.behaviors = this._desugarSomeBehaviors(this.behaviors); |
| 360 } | 380 } |
| 361 }, | 381 }, |
| 362 _desugarSomeBehaviors: function (behaviors) { | 382 _desugarSomeBehaviors: function (behaviors) { |
| 363 var behaviorSet = []; | 383 var behaviorSet = []; |
| 364 behaviors = this._flattenBehaviorsList(behaviors); | 384 behaviors = this._flattenBehaviorsList(behaviors); |
| 365 for (var i = behaviors.length - 1; i >= 0; i--) { | 385 for (var i = behaviors.length - 1; i >= 0; i--) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 beforeRegister: true, | 446 beforeRegister: true, |
| 427 registered: true, | 447 registered: true, |
| 428 properties: true, | 448 properties: true, |
| 429 observers: true, | 449 observers: true, |
| 430 listeners: true, | 450 listeners: true, |
| 431 created: true, | 451 created: true, |
| 432 attached: true, | 452 attached: true, |
| 433 detached: true, | 453 detached: true, |
| 434 attributeChanged: true, | 454 attributeChanged: true, |
| 435 ready: true | 455 ready: true |
| 436 }; | 456 };Polymer.Base._addFeature({ |
| 437 Polymer.Base._addFeature({ | |
| 438 _getExtendedPrototype: function (tag) { | 457 _getExtendedPrototype: function (tag) { |
| 439 return this._getExtendedNativePrototype(tag); | 458 return this._getExtendedNativePrototype(tag); |
| 440 }, | 459 }, |
| 441 _nativePrototypes: {}, | 460 _nativePrototypes: {}, |
| 442 _getExtendedNativePrototype: function (tag) { | 461 _getExtendedNativePrototype: function (tag) { |
| 443 var p = this._nativePrototypes[tag]; | 462 var p = this._nativePrototypes[tag]; |
| 444 if (!p) { | 463 if (!p) { |
| 445 var np = this.getNativePrototype(tag); | 464 var np = this.getNativePrototype(tag); |
| 446 p = this.extend(Object.create(np), Polymer.Base); | 465 p = this.extend(Object.create(np), Polymer.Base); |
| 447 this._nativePrototypes[tag] = p; | 466 this._nativePrototypes[tag] = p; |
| 448 } | 467 } |
| 449 return p; | 468 return p; |
| 450 }, | 469 }, |
| 451 getNativePrototype: function (tag) { | 470 getNativePrototype: function (tag) { |
| 452 return Object.getPrototypeOf(document.createElement(tag)); | 471 return Object.getPrototypeOf(document.createElement(tag)); |
| 453 } | 472 } |
| 454 }); | 473 });Polymer.Base._addFeature({ |
| 455 Polymer.Base._addFeature({ | |
| 456 _prepConstructor: function () { | 474 _prepConstructor: function () { |
| 457 this._factoryArgs = this.extends ? [ | 475 this._factoryArgs = this.extends ? [ |
| 458 this.extends, | 476 this.extends, |
| 459 this.is | 477 this.is |
| 460 ] : [this.is]; | 478 ] : [this.is]; |
| 461 var ctor = function () { | 479 var ctor = function () { |
| 462 return this._factory(arguments); | 480 return this._factory(arguments); |
| 463 }; | 481 }; |
| 464 if (this.hasOwnProperty('extends')) { | 482 if (this.hasOwnProperty('extends')) { |
| 465 ctor.extends = this.extends; | 483 ctor.extends = this.extends; |
| 466 } | 484 } |
| 467 Object.defineProperty(this, 'constructor', { | 485 Object.defineProperty(this, 'constructor', { |
| 468 value: ctor, | 486 value: ctor, |
| 469 writable: true, | 487 writable: true, |
| 470 configurable: true | 488 configurable: true |
| 471 }); | 489 }); |
| 472 ctor.prototype = this; | 490 ctor.prototype = this; |
| 473 }, | 491 }, |
| 474 _factory: function (args) { | 492 _factory: function (args) { |
| 475 var elt = document.createElement.apply(document, this._factoryArgs); | 493 var elt = document.createElement.apply(document, this._factoryArgs); |
| 476 if (this.factoryImpl) { | 494 if (this.factoryImpl) { |
| 477 this.factoryImpl.apply(elt, args); | 495 this.factoryImpl.apply(elt, args); |
| 478 } | 496 } |
| 479 return elt; | 497 return elt; |
| 480 } | 498 } |
| 481 }); | 499 });Polymer.nob = Object.create(null); |
| 482 Polymer.nob = Object.create(null); | |
| 483 Polymer.Base._addFeature({ | 500 Polymer.Base._addFeature({ |
| 484 properties: {}, | 501 properties: {}, |
| 485 getPropertyInfo: function (property) { | 502 getPropertyInfo: function (property) { |
| 486 var info = this._getPropertyInfo(property, this.properties); | 503 var info = this._getPropertyInfo(property, this.properties); |
| 487 if (!info) { | 504 if (!info) { |
| 488 for (var i = 0; i < this.behaviors.length; i++) { | 505 for (var i = 0; i < this.behaviors.length; i++) { |
| 489 info = this._getPropertyInfo(property, this.behaviors[i].properties); | 506 info = this._getPropertyInfo(property, this.behaviors[i].properties); |
| 490 if (info) { | 507 if (info) { |
| 491 return info; | 508 return info; |
| 492 } | 509 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 if (!t.type) { | 548 if (!t.type) { |
| 532 t.type = s.type; | 549 t.type = s.type; |
| 533 } | 550 } |
| 534 if (!t.readOnly) { | 551 if (!t.readOnly) { |
| 535 t.readOnly = s.readOnly; | 552 t.readOnly = s.readOnly; |
| 536 } | 553 } |
| 537 } | 554 } |
| 538 } | 555 } |
| 539 } | 556 } |
| 540 } | 557 } |
| 541 }); | 558 });Polymer.CaseMap = { |
| 542 Polymer.CaseMap = { | |
| 543 _caseMap: {}, | 559 _caseMap: {}, |
| 544 _rx: { | 560 _rx: { |
| 545 dashToCamel: /-[a-z]/g, | 561 dashToCamel: /-[a-z]/g, |
| 546 camelToDash: /([A-Z])/g | 562 camelToDash: /([A-Z])/g |
| 547 }, | 563 }, |
| 548 dashToCamelCase: function (dash) { | 564 dashToCamelCase: function (dash) { |
| 549 return this._caseMap[dash] || (this._caseMap[dash] = dash.indexOf('-') < 0 ? das
h : dash.replace(this._rx.dashToCamel, function (m) { | 565 return this._caseMap[dash] || (this._caseMap[dash] = dash.indexOf('-') < 0 ? das
h : dash.replace(this._rx.dashToCamel, function (m) { |
| 550 return m[1].toUpperCase(); | 566 return m[1].toUpperCase(); |
| 551 })); | 567 })); |
| 552 }, | 568 }, |
| 553 camelToDashCase: function (camel) { | 569 camelToDashCase: function (camel) { |
| 554 return this._caseMap[camel] || (this._caseMap[camel] = camel.replace(this._rx.ca
melToDash, '-$1').toLowerCase()); | 570 return this._caseMap[camel] || (this._caseMap[camel] = camel.replace(this._rx.ca
melToDash, '-$1').toLowerCase()); |
| 555 } | 571 } |
| 556 }; | 572 };Polymer.Base._addFeature({ |
| 557 Polymer.Base._addFeature({ | |
| 558 _addHostAttributes: function (attributes) { | 573 _addHostAttributes: function (attributes) { |
| 559 if (!this._aggregatedAttributes) { | 574 if (!this._aggregatedAttributes) { |
| 560 this._aggregatedAttributes = {}; | 575 this._aggregatedAttributes = {}; |
| 561 } | 576 } |
| 562 if (attributes) { | 577 if (attributes) { |
| 563 this.mixin(this._aggregatedAttributes, attributes); | 578 this.mixin(this._aggregatedAttributes, attributes); |
| 564 } | 579 } |
| 565 }, | 580 }, |
| 566 _marshalHostAttributes: function () { | 581 _marshalHostAttributes: function () { |
| 567 if (this._aggregatedAttributes) { | 582 if (this._aggregatedAttributes) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 try { | 672 try { |
| 658 return JSON.stringify(value); | 673 return JSON.stringify(value); |
| 659 } catch (x) { | 674 } catch (x) { |
| 660 return ''; | 675 return ''; |
| 661 } | 676 } |
| 662 } | 677 } |
| 663 default: | 678 default: |
| 664 return value != null ? value : undefined; | 679 return value != null ? value : undefined; |
| 665 } | 680 } |
| 666 } | 681 } |
| 667 }); | 682 });Polymer.version = '1.6.0';Polymer.Base._addFeature({ |
| 668 Polymer.version = '1.4.0'; | |
| 669 Polymer.Base._addFeature({ | |
| 670 _registerFeatures: function () { | 683 _registerFeatures: function () { |
| 671 this._prepIs(); | 684 this._prepIs(); |
| 672 this._prepBehaviors(); | 685 this._prepBehaviors(); |
| 673 this._prepConstructor(); | 686 this._prepConstructor(); |
| 674 this._prepPropertyInfo(); | 687 this._prepPropertyInfo(); |
| 675 }, | 688 }, |
| 676 _prepBehavior: function (b) { | 689 _prepBehavior: function (b) { |
| 677 this._addHostAttributes(b.hostAttributes); | 690 this._addHostAttributes(b.hostAttributes); |
| 678 }, | 691 }, |
| 679 _marshalBehavior: function (b) { | 692 _marshalBehavior: function (b) { |
| 680 }, | 693 }, |
| 681 _initFeatures: function () { | 694 _initFeatures: function () { |
| 682 this._marshalHostAttributes(); | 695 this._marshalHostAttributes(); |
| 683 this._marshalBehaviors(); | 696 this._marshalBehaviors(); |
| 684 } | 697 } |
| 685 });</script> | 698 });</script> |
| 699 |
| 700 |
| 701 |
| 702 |
| 703 |
| 704 |
| 705 |
| 706 |
| 707 |
| 708 |
| 709 |
| 710 |
| 711 |
| 712 |
| 713 |
| 714 |
| 715 |
| OLD | NEW |