gobstones-blockly 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +92 -0
- data/Rakefile +32 -0
- data/app/assets/htmls/gs-element-blockly.html +6168 -0
- data/app/assets/htmls/vendor/polymer-micro.html +821 -0
- data/app/assets/htmls/vendor/polymer-mini.html +2246 -0
- data/app/assets/htmls/vendor/polymer.html +5468 -0
- data/app/assets/javascripts/vendor/webcomponents.min.js +14 -0
- data/lib/gobstones/blockly.rb +14 -0
- data/lib/gobstones/blockly/version.rb +5 -0
- metadata +95 -0
@@ -0,0 +1,821 @@
|
|
1
|
+
<!--
|
2
|
+
@license
|
3
|
+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
4
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
5
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
6
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
7
|
+
Code distributed by Google as part of the polymer project is also
|
8
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
9
|
+
--><script>(function () {
|
10
|
+
function resolve() {
|
11
|
+
document.body.removeAttribute('unresolved');
|
12
|
+
}
|
13
|
+
if (window.WebComponents) {
|
14
|
+
addEventListener('WebComponentsReady', resolve);
|
15
|
+
} else {
|
16
|
+
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
17
|
+
resolve();
|
18
|
+
} else {
|
19
|
+
addEventListener('DOMContentLoaded', resolve);
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}());window.Polymer = {
|
23
|
+
Settings: function () {
|
24
|
+
var settings = window.Polymer || {};
|
25
|
+
if (!settings.noUrlSettings) {
|
26
|
+
var parts = location.search.slice(1).split('&');
|
27
|
+
for (var i = 0, o; i < parts.length && (o = parts[i]); i++) {
|
28
|
+
o = o.split('=');
|
29
|
+
o[0] && (settings[o[0]] = o[1] || true);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
settings.wantShadow = settings.dom === 'shadow';
|
33
|
+
settings.hasShadow = Boolean(Element.prototype.createShadowRoot);
|
34
|
+
settings.nativeShadow = settings.hasShadow && !window.ShadowDOMPolyfill;
|
35
|
+
settings.useShadow = settings.wantShadow && settings.hasShadow;
|
36
|
+
settings.hasNativeImports = Boolean('import' in document.createElement('link'));
|
37
|
+
settings.useNativeImports = settings.hasNativeImports;
|
38
|
+
settings.useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
|
39
|
+
settings.useNativeShadow = settings.useShadow && settings.nativeShadow;
|
40
|
+
settings.usePolyfillProto = !settings.useNativeCustomElements && !Object.__proto__;
|
41
|
+
settings.hasNativeCSSProperties = !navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) && window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)');
|
42
|
+
settings.useNativeCSSProperties = settings.hasNativeCSSProperties && settings.lazyRegister && settings.useNativeCSSProperties;
|
43
|
+
settings.isIE = navigator.userAgent.match('Trident');
|
44
|
+
settings.passiveTouchGestures = settings.passiveTouchGestures || false;
|
45
|
+
return settings;
|
46
|
+
}()
|
47
|
+
};(function () {
|
48
|
+
var userPolymer = window.Polymer;
|
49
|
+
window.Polymer = function (prototype) {
|
50
|
+
if (typeof prototype === 'function') {
|
51
|
+
prototype = prototype.prototype;
|
52
|
+
}
|
53
|
+
if (!prototype) {
|
54
|
+
prototype = {};
|
55
|
+
}
|
56
|
+
prototype = desugar(prototype);
|
57
|
+
var customCtor = prototype === prototype.constructor.prototype ? prototype.constructor : null;
|
58
|
+
var options = { prototype: prototype };
|
59
|
+
if (prototype.extends) {
|
60
|
+
options.extends = prototype.extends;
|
61
|
+
}
|
62
|
+
Polymer.telemetry._registrate(prototype);
|
63
|
+
var ctor = document.registerElement(prototype.is, options);
|
64
|
+
return customCtor || ctor;
|
65
|
+
};
|
66
|
+
var desugar = function (prototype) {
|
67
|
+
var base = Polymer.Base;
|
68
|
+
if (prototype.extends) {
|
69
|
+
base = Polymer.Base._getExtendedPrototype(prototype.extends);
|
70
|
+
}
|
71
|
+
prototype = Polymer.Base.chainObject(prototype, base);
|
72
|
+
prototype.registerCallback();
|
73
|
+
return prototype;
|
74
|
+
};
|
75
|
+
if (userPolymer) {
|
76
|
+
for (var i in userPolymer) {
|
77
|
+
Polymer[i] = userPolymer[i];
|
78
|
+
}
|
79
|
+
}
|
80
|
+
Polymer.Class = function (prototype) {
|
81
|
+
if (!prototype.factoryImpl) {
|
82
|
+
prototype.factoryImpl = function () {
|
83
|
+
};
|
84
|
+
}
|
85
|
+
return desugar(prototype).constructor;
|
86
|
+
};
|
87
|
+
}());
|
88
|
+
Polymer.telemetry = {
|
89
|
+
registrations: [],
|
90
|
+
_regLog: function (prototype) {
|
91
|
+
console.log('[' + prototype.is + ']: registered');
|
92
|
+
},
|
93
|
+
_registrate: function (prototype) {
|
94
|
+
this.registrations.push(prototype);
|
95
|
+
Polymer.log && this._regLog(prototype);
|
96
|
+
},
|
97
|
+
dumpRegistrations: function () {
|
98
|
+
this.registrations.forEach(this._regLog);
|
99
|
+
}
|
100
|
+
};Object.defineProperty(window, 'currentImport', {
|
101
|
+
enumerable: true,
|
102
|
+
configurable: true,
|
103
|
+
get: function () {
|
104
|
+
return (document._currentScript || document.currentScript || {}).ownerDocument;
|
105
|
+
}
|
106
|
+
});Polymer.RenderStatus = {
|
107
|
+
_ready: false,
|
108
|
+
_callbacks: [],
|
109
|
+
whenReady: function (cb) {
|
110
|
+
if (this._ready) {
|
111
|
+
cb();
|
112
|
+
} else {
|
113
|
+
this._callbacks.push(cb);
|
114
|
+
}
|
115
|
+
},
|
116
|
+
_makeReady: function () {
|
117
|
+
this._ready = true;
|
118
|
+
for (var i = 0; i < this._callbacks.length; i++) {
|
119
|
+
this._callbacks[i]();
|
120
|
+
}
|
121
|
+
this._callbacks = [];
|
122
|
+
},
|
123
|
+
_catchFirstRender: function () {
|
124
|
+
requestAnimationFrame(function () {
|
125
|
+
Polymer.RenderStatus._makeReady();
|
126
|
+
});
|
127
|
+
},
|
128
|
+
_afterNextRenderQueue: [],
|
129
|
+
_waitingNextRender: false,
|
130
|
+
afterNextRender: function (element, fn, args) {
|
131
|
+
this._watchNextRender();
|
132
|
+
this._afterNextRenderQueue.push([
|
133
|
+
element,
|
134
|
+
fn,
|
135
|
+
args
|
136
|
+
]);
|
137
|
+
},
|
138
|
+
hasRendered: function () {
|
139
|
+
return this._ready;
|
140
|
+
},
|
141
|
+
_watchNextRender: function () {
|
142
|
+
if (!this._waitingNextRender) {
|
143
|
+
this._waitingNextRender = true;
|
144
|
+
var fn = function () {
|
145
|
+
Polymer.RenderStatus._flushNextRender();
|
146
|
+
};
|
147
|
+
if (!this._ready) {
|
148
|
+
this.whenReady(fn);
|
149
|
+
} else {
|
150
|
+
requestAnimationFrame(fn);
|
151
|
+
}
|
152
|
+
}
|
153
|
+
},
|
154
|
+
_flushNextRender: function () {
|
155
|
+
var self = this;
|
156
|
+
setTimeout(function () {
|
157
|
+
self._flushRenderCallbacks(self._afterNextRenderQueue);
|
158
|
+
self._afterNextRenderQueue = [];
|
159
|
+
self._waitingNextRender = false;
|
160
|
+
});
|
161
|
+
},
|
162
|
+
_flushRenderCallbacks: function (callbacks) {
|
163
|
+
for (var i = 0, h; i < callbacks.length; i++) {
|
164
|
+
h = callbacks[i];
|
165
|
+
h[1].apply(h[0], h[2] || Polymer.nar);
|
166
|
+
}
|
167
|
+
}
|
168
|
+
};
|
169
|
+
if (window.HTMLImports) {
|
170
|
+
HTMLImports.whenReady(function () {
|
171
|
+
Polymer.RenderStatus._catchFirstRender();
|
172
|
+
});
|
173
|
+
} else {
|
174
|
+
Polymer.RenderStatus._catchFirstRender();
|
175
|
+
}
|
176
|
+
Polymer.ImportStatus = Polymer.RenderStatus;
|
177
|
+
Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;(function () {
|
178
|
+
'use strict';
|
179
|
+
var settings = Polymer.Settings;
|
180
|
+
Polymer.Base = {
|
181
|
+
__isPolymerInstance__: true,
|
182
|
+
_addFeature: function (feature) {
|
183
|
+
this.mixin(this, feature);
|
184
|
+
},
|
185
|
+
registerCallback: function () {
|
186
|
+
if (settings.lazyRegister === 'max') {
|
187
|
+
if (this.beforeRegister) {
|
188
|
+
this.beforeRegister();
|
189
|
+
}
|
190
|
+
} else {
|
191
|
+
this._desugarBehaviors();
|
192
|
+
for (var i = 0, b; i < this.behaviors.length; i++) {
|
193
|
+
b = this.behaviors[i];
|
194
|
+
if (b.beforeRegister) {
|
195
|
+
b.beforeRegister.call(this);
|
196
|
+
}
|
197
|
+
}
|
198
|
+
if (this.beforeRegister) {
|
199
|
+
this.beforeRegister();
|
200
|
+
}
|
201
|
+
}
|
202
|
+
this._registerFeatures();
|
203
|
+
if (!settings.lazyRegister) {
|
204
|
+
this.ensureRegisterFinished();
|
205
|
+
}
|
206
|
+
},
|
207
|
+
createdCallback: function () {
|
208
|
+
if (settings.disableUpgradeEnabled) {
|
209
|
+
if (this.hasAttribute('disable-upgrade')) {
|
210
|
+
this._propertySetter = disableUpgradePropertySetter;
|
211
|
+
this._configValue = null;
|
212
|
+
this.__data__ = {};
|
213
|
+
return;
|
214
|
+
} else {
|
215
|
+
this.__hasInitialized = true;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
this.__initialize();
|
219
|
+
},
|
220
|
+
__initialize: function () {
|
221
|
+
if (!this.__hasRegisterFinished) {
|
222
|
+
this._ensureRegisterFinished(this.__proto__);
|
223
|
+
}
|
224
|
+
Polymer.telemetry.instanceCount++;
|
225
|
+
this.root = this;
|
226
|
+
for (var i = 0, b; i < this.behaviors.length; i++) {
|
227
|
+
b = this.behaviors[i];
|
228
|
+
if (b.created) {
|
229
|
+
b.created.call(this);
|
230
|
+
}
|
231
|
+
}
|
232
|
+
if (this.created) {
|
233
|
+
this.created();
|
234
|
+
}
|
235
|
+
this._initFeatures();
|
236
|
+
},
|
237
|
+
ensureRegisterFinished: function () {
|
238
|
+
this._ensureRegisterFinished(this);
|
239
|
+
},
|
240
|
+
_ensureRegisterFinished: function (proto) {
|
241
|
+
if (proto.__hasRegisterFinished !== proto.is || !proto.is) {
|
242
|
+
if (settings.lazyRegister === 'max') {
|
243
|
+
proto._desugarBehaviors();
|
244
|
+
for (var i = 0, b; i < proto.behaviors.length; i++) {
|
245
|
+
b = proto.behaviors[i];
|
246
|
+
if (b.beforeRegister) {
|
247
|
+
b.beforeRegister.call(proto);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}
|
251
|
+
proto.__hasRegisterFinished = proto.is;
|
252
|
+
if (proto._finishRegisterFeatures) {
|
253
|
+
proto._finishRegisterFeatures();
|
254
|
+
}
|
255
|
+
for (var j = 0, pb; j < proto.behaviors.length; j++) {
|
256
|
+
pb = proto.behaviors[j];
|
257
|
+
if (pb.registered) {
|
258
|
+
pb.registered.call(proto);
|
259
|
+
}
|
260
|
+
}
|
261
|
+
if (proto.registered) {
|
262
|
+
proto.registered();
|
263
|
+
}
|
264
|
+
if (settings.usePolyfillProto && proto !== this) {
|
265
|
+
proto.extend(this, proto);
|
266
|
+
}
|
267
|
+
}
|
268
|
+
},
|
269
|
+
attachedCallback: function () {
|
270
|
+
var self = this;
|
271
|
+
Polymer.RenderStatus.whenReady(function () {
|
272
|
+
self.isAttached = true;
|
273
|
+
for (var i = 0, b; i < self.behaviors.length; i++) {
|
274
|
+
b = self.behaviors[i];
|
275
|
+
if (b.attached) {
|
276
|
+
b.attached.call(self);
|
277
|
+
}
|
278
|
+
}
|
279
|
+
if (self.attached) {
|
280
|
+
self.attached();
|
281
|
+
}
|
282
|
+
});
|
283
|
+
},
|
284
|
+
detachedCallback: function () {
|
285
|
+
var self = this;
|
286
|
+
Polymer.RenderStatus.whenReady(function () {
|
287
|
+
self.isAttached = false;
|
288
|
+
for (var i = 0, b; i < self.behaviors.length; i++) {
|
289
|
+
b = self.behaviors[i];
|
290
|
+
if (b.detached) {
|
291
|
+
b.detached.call(self);
|
292
|
+
}
|
293
|
+
}
|
294
|
+
if (self.detached) {
|
295
|
+
self.detached();
|
296
|
+
}
|
297
|
+
});
|
298
|
+
},
|
299
|
+
attributeChangedCallback: function (name, oldValue, newValue) {
|
300
|
+
this._attributeChangedImpl(name);
|
301
|
+
for (var i = 0, b; i < this.behaviors.length; i++) {
|
302
|
+
b = this.behaviors[i];
|
303
|
+
if (b.attributeChanged) {
|
304
|
+
b.attributeChanged.call(this, name, oldValue, newValue);
|
305
|
+
}
|
306
|
+
}
|
307
|
+
if (this.attributeChanged) {
|
308
|
+
this.attributeChanged(name, oldValue, newValue);
|
309
|
+
}
|
310
|
+
},
|
311
|
+
_attributeChangedImpl: function (name) {
|
312
|
+
this._setAttributeToProperty(this, name);
|
313
|
+
},
|
314
|
+
extend: function (target, source) {
|
315
|
+
if (target && source) {
|
316
|
+
var n$ = Object.getOwnPropertyNames(source);
|
317
|
+
for (var i = 0, n; i < n$.length && (n = n$[i]); i++) {
|
318
|
+
this.copyOwnProperty(n, source, target);
|
319
|
+
}
|
320
|
+
}
|
321
|
+
return target || source;
|
322
|
+
},
|
323
|
+
mixin: function (target, source) {
|
324
|
+
for (var i in source) {
|
325
|
+
target[i] = source[i];
|
326
|
+
}
|
327
|
+
return target;
|
328
|
+
},
|
329
|
+
copyOwnProperty: function (name, source, target) {
|
330
|
+
var pd = Object.getOwnPropertyDescriptor(source, name);
|
331
|
+
if (pd) {
|
332
|
+
Object.defineProperty(target, name, pd);
|
333
|
+
}
|
334
|
+
},
|
335
|
+
_logger: function (level, args) {
|
336
|
+
if (args.length === 1 && Array.isArray(args[0])) {
|
337
|
+
args = args[0];
|
338
|
+
}
|
339
|
+
switch (level) {
|
340
|
+
case 'log':
|
341
|
+
case 'warn':
|
342
|
+
case 'error':
|
343
|
+
console[level].apply(console, args);
|
344
|
+
break;
|
345
|
+
}
|
346
|
+
},
|
347
|
+
_log: function () {
|
348
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
349
|
+
this._logger('log', args);
|
350
|
+
},
|
351
|
+
_warn: function () {
|
352
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
353
|
+
this._logger('warn', args);
|
354
|
+
},
|
355
|
+
_error: function () {
|
356
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
357
|
+
this._logger('error', args);
|
358
|
+
},
|
359
|
+
_logf: function () {
|
360
|
+
return this._logPrefix.concat(this.is).concat(Array.prototype.slice.call(arguments, 0));
|
361
|
+
}
|
362
|
+
};
|
363
|
+
Polymer.Base._logPrefix = function () {
|
364
|
+
var color = window.chrome && !/edge/i.test(navigator.userAgent) || /firefox/i.test(navigator.userAgent);
|
365
|
+
return color ? [
|
366
|
+
'%c[%s::%s]:',
|
367
|
+
'font-weight: bold; background-color:#EEEE00;'
|
368
|
+
] : ['[%s::%s]:'];
|
369
|
+
}();
|
370
|
+
Polymer.Base.chainObject = function (object, inherited) {
|
371
|
+
if (object && inherited && object !== inherited) {
|
372
|
+
if (!Object.__proto__) {
|
373
|
+
object = Polymer.Base.extend(Object.create(inherited), object);
|
374
|
+
}
|
375
|
+
object.__proto__ = inherited;
|
376
|
+
}
|
377
|
+
return object;
|
378
|
+
};
|
379
|
+
Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype);
|
380
|
+
Polymer.BaseDescriptors = {};
|
381
|
+
var disableUpgradePropertySetter;
|
382
|
+
if (settings.disableUpgradeEnabled) {
|
383
|
+
disableUpgradePropertySetter = function (property, value) {
|
384
|
+
this.__data__[property] = value;
|
385
|
+
};
|
386
|
+
var origAttributeChangedCallback = Polymer.Base.attributeChangedCallback;
|
387
|
+
Polymer.Base.attributeChangedCallback = function (name, oldValue, newValue) {
|
388
|
+
if (!this.__hasInitialized && name === 'disable-upgrade') {
|
389
|
+
this.__hasInitialized = true;
|
390
|
+
this._propertySetter = Polymer.Bind._modelApi._propertySetter;
|
391
|
+
this._configValue = Polymer.Base._configValue;
|
392
|
+
this.__initialize();
|
393
|
+
}
|
394
|
+
origAttributeChangedCallback.call(this, name, oldValue, newValue);
|
395
|
+
};
|
396
|
+
}
|
397
|
+
if (window.CustomElements) {
|
398
|
+
Polymer.instanceof = CustomElements.instanceof;
|
399
|
+
} else {
|
400
|
+
Polymer.instanceof = function (obj, ctor) {
|
401
|
+
return obj instanceof ctor;
|
402
|
+
};
|
403
|
+
}
|
404
|
+
Polymer.isInstance = function (obj) {
|
405
|
+
return Boolean(obj && obj.__isPolymerInstance__);
|
406
|
+
};
|
407
|
+
Polymer.telemetry.instanceCount = 0;
|
408
|
+
}());(function () {
|
409
|
+
var modules = {};
|
410
|
+
var lcModules = {};
|
411
|
+
var findModule = function (id) {
|
412
|
+
return modules[id] || lcModules[id.toLowerCase()];
|
413
|
+
};
|
414
|
+
var DomModule = function () {
|
415
|
+
return document.createElement('dom-module');
|
416
|
+
};
|
417
|
+
DomModule.prototype = Object.create(HTMLElement.prototype);
|
418
|
+
Polymer.Base.mixin(DomModule.prototype, {
|
419
|
+
createdCallback: function () {
|
420
|
+
this.register();
|
421
|
+
},
|
422
|
+
register: function (id) {
|
423
|
+
id = id || this.id || this.getAttribute('name') || this.getAttribute('is');
|
424
|
+
if (id) {
|
425
|
+
this.id = id;
|
426
|
+
modules[id] = this;
|
427
|
+
lcModules[id.toLowerCase()] = this;
|
428
|
+
}
|
429
|
+
},
|
430
|
+
import: function (id, selector) {
|
431
|
+
if (id) {
|
432
|
+
var m = findModule(id);
|
433
|
+
if (!m) {
|
434
|
+
forceDomModulesUpgrade();
|
435
|
+
m = findModule(id);
|
436
|
+
}
|
437
|
+
if (m && selector) {
|
438
|
+
m = m.querySelector(selector);
|
439
|
+
}
|
440
|
+
return m;
|
441
|
+
}
|
442
|
+
}
|
443
|
+
});
|
444
|
+
Object.defineProperty(DomModule.prototype, 'constructor', {
|
445
|
+
value: DomModule,
|
446
|
+
configurable: true,
|
447
|
+
writable: true
|
448
|
+
});
|
449
|
+
var cePolyfill = window.CustomElements && !CustomElements.useNative;
|
450
|
+
document.registerElement('dom-module', DomModule);
|
451
|
+
function forceDomModulesUpgrade() {
|
452
|
+
if (cePolyfill) {
|
453
|
+
var script = document._currentScript || document.currentScript;
|
454
|
+
var doc = script && script.ownerDocument || document;
|
455
|
+
var modules = doc.querySelectorAll('dom-module');
|
456
|
+
for (var i = modules.length - 1, m; i >= 0 && (m = modules[i]); i--) {
|
457
|
+
if (m.__upgraded__) {
|
458
|
+
return;
|
459
|
+
} else {
|
460
|
+
CustomElements.upgrade(m);
|
461
|
+
}
|
462
|
+
}
|
463
|
+
}
|
464
|
+
}
|
465
|
+
}());Polymer.Base._addFeature({
|
466
|
+
_prepIs: function () {
|
467
|
+
if (!this.is) {
|
468
|
+
var module = (document._currentScript || document.currentScript).parentNode;
|
469
|
+
if (module.localName === 'dom-module') {
|
470
|
+
var id = module.id || module.getAttribute('name') || module.getAttribute('is');
|
471
|
+
this.is = id;
|
472
|
+
}
|
473
|
+
}
|
474
|
+
if (this.is) {
|
475
|
+
this.is = this.is.toLowerCase();
|
476
|
+
}
|
477
|
+
}
|
478
|
+
});Polymer.Base._addFeature({
|
479
|
+
behaviors: [],
|
480
|
+
_desugarBehaviors: function () {
|
481
|
+
if (this.behaviors.length) {
|
482
|
+
this.behaviors = this._desugarSomeBehaviors(this.behaviors);
|
483
|
+
}
|
484
|
+
},
|
485
|
+
_desugarSomeBehaviors: function (behaviors) {
|
486
|
+
var behaviorSet = [];
|
487
|
+
behaviors = this._flattenBehaviorsList(behaviors);
|
488
|
+
for (var i = behaviors.length - 1; i >= 0; i--) {
|
489
|
+
var b = behaviors[i];
|
490
|
+
if (behaviorSet.indexOf(b) === -1) {
|
491
|
+
this._mixinBehavior(b);
|
492
|
+
behaviorSet.unshift(b);
|
493
|
+
}
|
494
|
+
}
|
495
|
+
return behaviorSet;
|
496
|
+
},
|
497
|
+
_flattenBehaviorsList: function (behaviors) {
|
498
|
+
var flat = [];
|
499
|
+
for (var i = 0; i < behaviors.length; i++) {
|
500
|
+
var b = behaviors[i];
|
501
|
+
if (b instanceof Array) {
|
502
|
+
flat = flat.concat(this._flattenBehaviorsList(b));
|
503
|
+
} else if (b) {
|
504
|
+
flat.push(b);
|
505
|
+
} else {
|
506
|
+
this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for missing or 404 import'));
|
507
|
+
}
|
508
|
+
}
|
509
|
+
return flat;
|
510
|
+
},
|
511
|
+
_mixinBehavior: function (b) {
|
512
|
+
var n$ = Object.getOwnPropertyNames(b);
|
513
|
+
var useAssignment = b._noAccessors;
|
514
|
+
for (var i = 0, n; i < n$.length && (n = n$[i]); i++) {
|
515
|
+
if (!Polymer.Base._behaviorProperties[n] && !this.hasOwnProperty(n)) {
|
516
|
+
if (useAssignment) {
|
517
|
+
this[n] = b[n];
|
518
|
+
} else {
|
519
|
+
this.copyOwnProperty(n, b, this);
|
520
|
+
}
|
521
|
+
}
|
522
|
+
}
|
523
|
+
},
|
524
|
+
_prepBehaviors: function () {
|
525
|
+
this._prepFlattenedBehaviors(this.behaviors);
|
526
|
+
},
|
527
|
+
_prepFlattenedBehaviors: function (behaviors) {
|
528
|
+
for (var i = 0, l = behaviors.length; i < l; i++) {
|
529
|
+
this._prepBehavior(behaviors[i]);
|
530
|
+
}
|
531
|
+
this._prepBehavior(this);
|
532
|
+
},
|
533
|
+
_marshalBehaviors: function () {
|
534
|
+
for (var i = 0; i < this.behaviors.length; i++) {
|
535
|
+
this._marshalBehavior(this.behaviors[i]);
|
536
|
+
}
|
537
|
+
this._marshalBehavior(this);
|
538
|
+
}
|
539
|
+
});
|
540
|
+
Polymer.Base._behaviorProperties = {
|
541
|
+
hostAttributes: true,
|
542
|
+
beforeRegister: true,
|
543
|
+
registered: true,
|
544
|
+
properties: true,
|
545
|
+
observers: true,
|
546
|
+
listeners: true,
|
547
|
+
created: true,
|
548
|
+
attached: true,
|
549
|
+
detached: true,
|
550
|
+
attributeChanged: true,
|
551
|
+
ready: true,
|
552
|
+
_noAccessors: true
|
553
|
+
};Polymer.Base._addFeature({
|
554
|
+
_getExtendedPrototype: function (tag) {
|
555
|
+
return this._getExtendedNativePrototype(tag);
|
556
|
+
},
|
557
|
+
_nativePrototypes: {},
|
558
|
+
_getExtendedNativePrototype: function (tag) {
|
559
|
+
var p = this._nativePrototypes[tag];
|
560
|
+
if (!p) {
|
561
|
+
p = Object.create(this.getNativePrototype(tag));
|
562
|
+
var p$ = Object.getOwnPropertyNames(Polymer.Base);
|
563
|
+
for (var i = 0, n; i < p$.length && (n = p$[i]); i++) {
|
564
|
+
if (!Polymer.BaseDescriptors[n]) {
|
565
|
+
p[n] = Polymer.Base[n];
|
566
|
+
}
|
567
|
+
}
|
568
|
+
Object.defineProperties(p, Polymer.BaseDescriptors);
|
569
|
+
this._nativePrototypes[tag] = p;
|
570
|
+
}
|
571
|
+
return p;
|
572
|
+
},
|
573
|
+
getNativePrototype: function (tag) {
|
574
|
+
return Object.getPrototypeOf(document.createElement(tag));
|
575
|
+
}
|
576
|
+
});Polymer.Base._addFeature({
|
577
|
+
_prepConstructor: function () {
|
578
|
+
this._factoryArgs = this.extends ? [
|
579
|
+
this.extends,
|
580
|
+
this.is
|
581
|
+
] : [this.is];
|
582
|
+
var ctor = function () {
|
583
|
+
return this._factory(arguments);
|
584
|
+
};
|
585
|
+
if (this.hasOwnProperty('extends')) {
|
586
|
+
ctor.extends = this.extends;
|
587
|
+
}
|
588
|
+
Object.defineProperty(this, 'constructor', {
|
589
|
+
value: ctor,
|
590
|
+
writable: true,
|
591
|
+
configurable: true
|
592
|
+
});
|
593
|
+
ctor.prototype = this;
|
594
|
+
},
|
595
|
+
_factory: function (args) {
|
596
|
+
var elt = document.createElement.apply(document, this._factoryArgs);
|
597
|
+
if (this.factoryImpl) {
|
598
|
+
this.factoryImpl.apply(elt, args);
|
599
|
+
}
|
600
|
+
return elt;
|
601
|
+
}
|
602
|
+
});Polymer.nob = Object.create(null);
|
603
|
+
Polymer.Base._addFeature({
|
604
|
+
getPropertyInfo: function (property) {
|
605
|
+
var info = this._getPropertyInfo(property, this.properties);
|
606
|
+
if (!info) {
|
607
|
+
for (var i = 0; i < this.behaviors.length; i++) {
|
608
|
+
info = this._getPropertyInfo(property, this.behaviors[i].properties);
|
609
|
+
if (info) {
|
610
|
+
return info;
|
611
|
+
}
|
612
|
+
}
|
613
|
+
}
|
614
|
+
return info || Polymer.nob;
|
615
|
+
},
|
616
|
+
_getPropertyInfo: function (property, properties) {
|
617
|
+
var p = properties && properties[property];
|
618
|
+
if (typeof p === 'function') {
|
619
|
+
p = properties[property] = { type: p };
|
620
|
+
}
|
621
|
+
if (p) {
|
622
|
+
p.defined = true;
|
623
|
+
}
|
624
|
+
return p;
|
625
|
+
},
|
626
|
+
_prepPropertyInfo: function () {
|
627
|
+
this._propertyInfo = {};
|
628
|
+
for (var i = 0; i < this.behaviors.length; i++) {
|
629
|
+
this._addPropertyInfo(this._propertyInfo, this.behaviors[i].properties);
|
630
|
+
}
|
631
|
+
this._addPropertyInfo(this._propertyInfo, this.properties);
|
632
|
+
this._addPropertyInfo(this._propertyInfo, this._propertyEffects);
|
633
|
+
},
|
634
|
+
_addPropertyInfo: function (target, source) {
|
635
|
+
if (source) {
|
636
|
+
var t, s;
|
637
|
+
for (var i in source) {
|
638
|
+
t = target[i];
|
639
|
+
s = source[i];
|
640
|
+
if (i[0] === '_' && !s.readOnly) {
|
641
|
+
continue;
|
642
|
+
}
|
643
|
+
if (!target[i]) {
|
644
|
+
target[i] = {
|
645
|
+
type: typeof s === 'function' ? s : s.type,
|
646
|
+
readOnly: s.readOnly,
|
647
|
+
attribute: Polymer.CaseMap.camelToDashCase(i)
|
648
|
+
};
|
649
|
+
} else {
|
650
|
+
if (!t.type) {
|
651
|
+
t.type = s.type;
|
652
|
+
}
|
653
|
+
if (!t.readOnly) {
|
654
|
+
t.readOnly = s.readOnly;
|
655
|
+
}
|
656
|
+
}
|
657
|
+
}
|
658
|
+
}
|
659
|
+
}
|
660
|
+
});
|
661
|
+
(function () {
|
662
|
+
var propertiesDesc = {
|
663
|
+
configurable: true,
|
664
|
+
writable: true,
|
665
|
+
enumerable: true,
|
666
|
+
value: {}
|
667
|
+
};
|
668
|
+
Polymer.BaseDescriptors.properties = propertiesDesc;
|
669
|
+
Object.defineProperty(Polymer.Base, 'properties', propertiesDesc);
|
670
|
+
}());Polymer.CaseMap = {
|
671
|
+
_caseMap: {},
|
672
|
+
_rx: {
|
673
|
+
dashToCamel: /-[a-z]/g,
|
674
|
+
camelToDash: /([A-Z])/g
|
675
|
+
},
|
676
|
+
dashToCamelCase: function (dash) {
|
677
|
+
return this._caseMap[dash] || (this._caseMap[dash] = dash.indexOf('-') < 0 ? dash : dash.replace(this._rx.dashToCamel, function (m) {
|
678
|
+
return m[1].toUpperCase();
|
679
|
+
}));
|
680
|
+
},
|
681
|
+
camelToDashCase: function (camel) {
|
682
|
+
return this._caseMap[camel] || (this._caseMap[camel] = camel.replace(this._rx.camelToDash, '-$1').toLowerCase());
|
683
|
+
}
|
684
|
+
};Polymer.Base._addFeature({
|
685
|
+
_addHostAttributes: function (attributes) {
|
686
|
+
if (!this._aggregatedAttributes) {
|
687
|
+
this._aggregatedAttributes = {};
|
688
|
+
}
|
689
|
+
if (attributes) {
|
690
|
+
this.mixin(this._aggregatedAttributes, attributes);
|
691
|
+
}
|
692
|
+
},
|
693
|
+
_marshalHostAttributes: function () {
|
694
|
+
if (this._aggregatedAttributes) {
|
695
|
+
this._applyAttributes(this, this._aggregatedAttributes);
|
696
|
+
}
|
697
|
+
},
|
698
|
+
_applyAttributes: function (node, attr$) {
|
699
|
+
for (var n in attr$) {
|
700
|
+
if (!this.hasAttribute(n) && n !== 'class') {
|
701
|
+
var v = attr$[n];
|
702
|
+
this.serializeValueToAttribute(v, n, this);
|
703
|
+
}
|
704
|
+
}
|
705
|
+
},
|
706
|
+
_marshalAttributes: function () {
|
707
|
+
this._takeAttributesToModel(this);
|
708
|
+
},
|
709
|
+
_takeAttributesToModel: function (model) {
|
710
|
+
if (this.hasAttributes()) {
|
711
|
+
for (var i in this._propertyInfo) {
|
712
|
+
var info = this._propertyInfo[i];
|
713
|
+
if (this.hasAttribute(info.attribute)) {
|
714
|
+
this._setAttributeToProperty(model, info.attribute, i, info);
|
715
|
+
}
|
716
|
+
}
|
717
|
+
}
|
718
|
+
},
|
719
|
+
_setAttributeToProperty: function (model, attribute, property, info) {
|
720
|
+
if (!this._serializing) {
|
721
|
+
property = property || Polymer.CaseMap.dashToCamelCase(attribute);
|
722
|
+
info = info || this._propertyInfo && this._propertyInfo[property];
|
723
|
+
if (info && !info.readOnly) {
|
724
|
+
var v = this.getAttribute(attribute);
|
725
|
+
model[property] = this.deserialize(v, info.type);
|
726
|
+
}
|
727
|
+
}
|
728
|
+
},
|
729
|
+
_serializing: false,
|
730
|
+
reflectPropertyToAttribute: function (property, attribute, value) {
|
731
|
+
this._serializing = true;
|
732
|
+
value = value === undefined ? this[property] : value;
|
733
|
+
this.serializeValueToAttribute(value, attribute || Polymer.CaseMap.camelToDashCase(property));
|
734
|
+
this._serializing = false;
|
735
|
+
},
|
736
|
+
serializeValueToAttribute: function (value, attribute, node) {
|
737
|
+
var str = this.serialize(value);
|
738
|
+
node = node || this;
|
739
|
+
if (str === undefined) {
|
740
|
+
node.removeAttribute(attribute);
|
741
|
+
} else {
|
742
|
+
node.setAttribute(attribute, str);
|
743
|
+
}
|
744
|
+
},
|
745
|
+
deserialize: function (value, type) {
|
746
|
+
switch (type) {
|
747
|
+
case Number:
|
748
|
+
value = Number(value);
|
749
|
+
break;
|
750
|
+
case Boolean:
|
751
|
+
value = value != null;
|
752
|
+
break;
|
753
|
+
case Object:
|
754
|
+
try {
|
755
|
+
value = JSON.parse(value);
|
756
|
+
} catch (x) {
|
757
|
+
}
|
758
|
+
break;
|
759
|
+
case Array:
|
760
|
+
try {
|
761
|
+
value = JSON.parse(value);
|
762
|
+
} catch (x) {
|
763
|
+
value = null;
|
764
|
+
console.warn('Polymer::Attributes: couldn`t decode Array as JSON');
|
765
|
+
}
|
766
|
+
break;
|
767
|
+
case Date:
|
768
|
+
value = new Date(value);
|
769
|
+
break;
|
770
|
+
case String:
|
771
|
+
default:
|
772
|
+
break;
|
773
|
+
}
|
774
|
+
return value;
|
775
|
+
},
|
776
|
+
serialize: function (value) {
|
777
|
+
switch (typeof value) {
|
778
|
+
case 'boolean':
|
779
|
+
return value ? '' : undefined;
|
780
|
+
case 'object':
|
781
|
+
if (value instanceof Date) {
|
782
|
+
return value.toString();
|
783
|
+
} else if (value) {
|
784
|
+
try {
|
785
|
+
return JSON.stringify(value);
|
786
|
+
} catch (x) {
|
787
|
+
return '';
|
788
|
+
}
|
789
|
+
}
|
790
|
+
default:
|
791
|
+
return value != null ? value : undefined;
|
792
|
+
}
|
793
|
+
}
|
794
|
+
});Polymer.version = "1.11.0";Polymer.Base._addFeature({
|
795
|
+
_registerFeatures: function () {
|
796
|
+
this._prepIs();
|
797
|
+
this._prepBehaviors();
|
798
|
+
this._prepConstructor();
|
799
|
+
this._prepPropertyInfo();
|
800
|
+
},
|
801
|
+
_prepBehavior: function (b) {
|
802
|
+
this._addHostAttributes(b.hostAttributes);
|
803
|
+
},
|
804
|
+
_marshalBehavior: function (b) {
|
805
|
+
},
|
806
|
+
_initFeatures: function () {
|
807
|
+
this._marshalHostAttributes();
|
808
|
+
this._marshalBehaviors();
|
809
|
+
}
|
810
|
+
});</script>
|
811
|
+
|
812
|
+
|
813
|
+
|
814
|
+
|
815
|
+
|
816
|
+
|
817
|
+
|
818
|
+
|
819
|
+
|
820
|
+
|
821
|
+
|