gobstones-board 1.8.4 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,9 +38,10 @@ settings.useNativeImports = settings.hasNativeImports;
38
38
  settings.useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
39
39
  settings.useNativeShadow = settings.useShadow && settings.nativeShadow;
40
40
  settings.usePolyfillProto = !settings.useNativeCustomElements && !Object.__proto__;
41
- settings.hasNativeCSSProperties = !navigator.userAgent.match('AppleWebKit/601') && window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)');
41
+ settings.hasNativeCSSProperties = !navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/) && window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)');
42
42
  settings.useNativeCSSProperties = settings.hasNativeCSSProperties && settings.lazyRegister && settings.useNativeCSSProperties;
43
43
  settings.isIE = navigator.userAgent.match('Trident');
44
+ settings.passiveTouchGestures = settings.passiveTouchGestures || false;
44
45
  return settings;
45
46
  }()
46
47
  };(function () {
@@ -52,15 +53,15 @@ prototype = prototype.prototype;
52
53
  if (!prototype) {
53
54
  prototype = {};
54
55
  }
55
- var factory = desugar(prototype);
56
- prototype = factory.prototype;
56
+ prototype = desugar(prototype);
57
+ var customCtor = prototype === prototype.constructor.prototype ? prototype.constructor : null;
57
58
  var options = { prototype: prototype };
58
59
  if (prototype.extends) {
59
60
  options.extends = prototype.extends;
60
61
  }
61
62
  Polymer.telemetry._registrate(prototype);
62
- document.registerElement(prototype.is, options);
63
- return factory;
63
+ var ctor = document.registerElement(prototype.is, options);
64
+ return customCtor || ctor;
64
65
  };
65
66
  var desugar = function (prototype) {
66
67
  var base = Polymer.Base;
@@ -69,14 +70,20 @@ base = Polymer.Base._getExtendedPrototype(prototype.extends);
69
70
  }
70
71
  prototype = Polymer.Base.chainObject(prototype, base);
71
72
  prototype.registerCallback();
72
- return prototype.constructor;
73
+ return prototype;
73
74
  };
74
75
  if (userPolymer) {
75
76
  for (var i in userPolymer) {
76
77
  Polymer[i] = userPolymer[i];
77
78
  }
78
79
  }
79
- Polymer.Class = desugar;
80
+ Polymer.Class = function (prototype) {
81
+ if (!prototype.factoryImpl) {
82
+ prototype.factoryImpl = function () {
83
+ };
84
+ }
85
+ return desugar(prototype).constructor;
86
+ };
80
87
  }());
81
88
  Polymer.telemetry = {
82
89
  registrations: [],
@@ -173,7 +180,7 @@ var settings = Polymer.Settings;
173
180
  Polymer.Base = {
174
181
  __isPolymerInstance__: true,
175
182
  _addFeature: function (feature) {
176
- this.extend(this, feature);
183
+ this.mixin(this, feature);
177
184
  },
178
185
  registerCallback: function () {
179
186
  if (settings.lazyRegister === 'max') {
@@ -182,7 +189,15 @@ this.beforeRegister();
182
189
  }
183
190
  } else {
184
191
  this._desugarBehaviors();
185
- this._doBehavior('beforeRegister');
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
+ }
186
201
  }
187
202
  this._registerFeatures();
188
203
  if (!settings.lazyRegister) {
@@ -190,12 +205,33 @@ this.ensureRegisterFinished();
190
205
  }
191
206
  },
192
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 () {
193
221
  if (!this.__hasRegisterFinished) {
194
222
  this._ensureRegisterFinished(this.__proto__);
195
223
  }
196
224
  Polymer.telemetry.instanceCount++;
197
225
  this.root = this;
198
- this._doBehavior('created');
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
+ }
199
235
  this._initFeatures();
200
236
  },
201
237
  ensureRegisterFinished: function () {
@@ -205,13 +241,26 @@ _ensureRegisterFinished: function (proto) {
205
241
  if (proto.__hasRegisterFinished !== proto.is || !proto.is) {
206
242
  if (settings.lazyRegister === 'max') {
207
243
  proto._desugarBehaviors();
208
- proto._doBehaviorOnly('beforeRegister');
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
+ }
209
250
  }
210
251
  proto.__hasRegisterFinished = proto.is;
211
252
  if (proto._finishRegisterFeatures) {
212
253
  proto._finishRegisterFeatures();
213
254
  }
214
- proto._doBehavior('registered');
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
+ }
215
264
  if (settings.usePolyfillProto && proto !== this) {
216
265
  proto.extend(this, proto);
217
266
  }
@@ -221,23 +270,43 @@ attachedCallback: function () {
221
270
  var self = this;
222
271
  Polymer.RenderStatus.whenReady(function () {
223
272
  self.isAttached = true;
224
- self._doBehavior('attached');
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
+ }
225
282
  });
226
283
  },
227
284
  detachedCallback: function () {
228
285
  var self = this;
229
286
  Polymer.RenderStatus.whenReady(function () {
230
287
  self.isAttached = false;
231
- self._doBehavior('detached');
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
+ }
232
297
  });
233
298
  },
234
299
  attributeChangedCallback: function (name, oldValue, newValue) {
235
300
  this._attributeChangedImpl(name);
236
- this._doBehavior('attributeChanged', [
237
- name,
238
- oldValue,
239
- newValue
240
- ]);
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
+ }
241
310
  },
242
311
  _attributeChangedImpl: function (name) {
243
312
  this._setAttributeToProperty(this, name);
@@ -308,6 +377,23 @@ object.__proto__ = inherited;
308
377
  return object;
309
378
  };
310
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
+ }
311
397
  if (window.CustomElements) {
312
398
  Polymer.instanceof = CustomElements.instanceof;
313
399
  } else {
@@ -329,8 +415,7 @@ var DomModule = function () {
329
415
  return document.createElement('dom-module');
330
416
  };
331
417
  DomModule.prototype = Object.create(HTMLElement.prototype);
332
- Polymer.Base.extend(DomModule.prototype, {
333
- constructor: DomModule,
418
+ Polymer.Base.mixin(DomModule.prototype, {
334
419
  createdCallback: function () {
335
420
  this.register();
336
421
  },
@@ -356,6 +441,11 @@ return m;
356
441
  }
357
442
  }
358
443
  });
444
+ Object.defineProperty(DomModule.prototype, 'constructor', {
445
+ value: DomModule,
446
+ configurable: true,
447
+ writable: true
448
+ });
359
449
  var cePolyfill = window.CustomElements && !CustomElements.useNative;
360
450
  document.registerElement('dom-module', DomModule);
361
451
  function forceDomModulesUpgrade() {
@@ -420,11 +510,16 @@ return flat;
420
510
  },
421
511
  _mixinBehavior: function (b) {
422
512
  var n$ = Object.getOwnPropertyNames(b);
513
+ var useAssignment = b._noAccessors;
423
514
  for (var i = 0, n; i < n$.length && (n = n$[i]); i++) {
424
515
  if (!Polymer.Base._behaviorProperties[n] && !this.hasOwnProperty(n)) {
516
+ if (useAssignment) {
517
+ this[n] = b[n];
518
+ } else {
425
519
  this.copyOwnProperty(n, b, this);
426
520
  }
427
521
  }
522
+ }
428
523
  },
429
524
  _prepBehaviors: function () {
430
525
  this._prepFlattenedBehaviors(this.behaviors);
@@ -435,23 +530,6 @@ this._prepBehavior(behaviors[i]);
435
530
  }
436
531
  this._prepBehavior(this);
437
532
  },
438
- _doBehavior: function (name, args) {
439
- for (var i = 0; i < this.behaviors.length; i++) {
440
- this._invokeBehavior(this.behaviors[i], name, args);
441
- }
442
- this._invokeBehavior(this, name, args);
443
- },
444
- _doBehaviorOnly: function (name, args) {
445
- for (var i = 0; i < this.behaviors.length; i++) {
446
- this._invokeBehavior(this.behaviors[i], name, args);
447
- }
448
- },
449
- _invokeBehavior: function (b, name, args) {
450
- var fn = b[name];
451
- if (fn) {
452
- fn.apply(this, args || Polymer.nar);
453
- }
454
- },
455
533
  _marshalBehaviors: function () {
456
534
  for (var i = 0; i < this.behaviors.length; i++) {
457
535
  this._marshalBehavior(this.behaviors[i]);
@@ -470,7 +548,8 @@ created: true,
470
548
  attached: true,
471
549
  detached: true,
472
550
  attributeChanged: true,
473
- ready: true
551
+ ready: true,
552
+ _noAccessors: true
474
553
  };Polymer.Base._addFeature({
475
554
  _getExtendedPrototype: function (tag) {
476
555
  return this._getExtendedNativePrototype(tag);
@@ -479,8 +558,14 @@ _nativePrototypes: {},
479
558
  _getExtendedNativePrototype: function (tag) {
480
559
  var p = this._nativePrototypes[tag];
481
560
  if (!p) {
482
- var np = this.getNativePrototype(tag);
483
- p = this.extend(Object.create(np), Polymer.Base);
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);
484
569
  this._nativePrototypes[tag] = p;
485
570
  }
486
571
  return p;
@@ -516,7 +601,6 @@ return elt;
516
601
  }
517
602
  });Polymer.nob = Object.create(null);
518
603
  Polymer.Base._addFeature({
519
- properties: {},
520
604
  getPropertyInfo: function (property) {
521
605
  var info = this._getPropertyInfo(property, this.properties);
522
606
  if (!info) {
@@ -573,7 +657,17 @@ t.readOnly = s.readOnly;
573
657
  }
574
658
  }
575
659
  }
576
- });Polymer.CaseMap = {
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 = {
577
671
  _caseMap: {},
578
672
  _rx: {
579
673
  dashToCamel: /-[a-z]/g,
@@ -697,7 +791,7 @@ default:
697
791
  return value != null ? value : undefined;
698
792
  }
699
793
  }
700
- });Polymer.version = "1.7.1";Polymer.Base._addFeature({
794
+ });Polymer.version = "1.11.2";Polymer.Base._addFeature({
701
795
  _registerFeatures: function () {
702
796
  this._prepIs();
703
797
  this._prepBehaviors();
@@ -6,10 +6,83 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
6
  The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
7
  Code distributed by Google as part of the polymer project is also
8
8
  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
- --><link rel="import" href="polymer-micro.html"><script>Polymer.Base._addFeature({
9
+ --><link rel="import" href="polymer-micro.html"><script>(function () {
10
+ function resolveCss(cssText, ownerDocument) {
11
+ return cssText.replace(CSS_URL_RX, function (m, pre, url, post) {
12
+ return pre + '\'' + resolve(url.replace(/["']/g, ''), ownerDocument) + '\'' + post;
13
+ });
14
+ }
15
+ function resolveAttrs(element, ownerDocument) {
16
+ for (var name in URL_ATTRS) {
17
+ var a$ = URL_ATTRS[name];
18
+ for (var i = 0, l = a$.length, a, at, v; i < l && (a = a$[i]); i++) {
19
+ if (name === '*' || element.localName === name) {
20
+ at = element.attributes[a];
21
+ v = at && at.value;
22
+ if (v && v.search(BINDING_RX) < 0) {
23
+ at.value = a === 'style' ? resolveCss(v, ownerDocument) : resolve(v, ownerDocument);
24
+ }
25
+ }
26
+ }
27
+ }
28
+ }
29
+ function resolve(url, ownerDocument) {
30
+ if (url && ABS_URL.test(url)) {
31
+ return url;
32
+ }
33
+ var resolver = getUrlResolver(ownerDocument);
34
+ resolver.href = url;
35
+ return resolver.href || url;
36
+ }
37
+ var tempDoc;
38
+ var tempDocBase;
39
+ function resolveUrl(url, baseUri) {
40
+ if (!tempDoc) {
41
+ tempDoc = document.implementation.createHTMLDocument('temp');
42
+ tempDocBase = tempDoc.createElement('base');
43
+ tempDoc.head.appendChild(tempDocBase);
44
+ }
45
+ tempDocBase.href = baseUri;
46
+ return resolve(url, tempDoc);
47
+ }
48
+ function getUrlResolver(ownerDocument) {
49
+ return ownerDocument.body.__urlResolver || (ownerDocument.body.__urlResolver = ownerDocument.createElement('a'));
50
+ }
51
+ function pathFromUrl(url) {
52
+ return url.substring(0, url.lastIndexOf('/') + 1);
53
+ }
54
+ var CSS_URL_RX = /(url\()([^)]*)(\))/g;
55
+ var URL_ATTRS = {
56
+ '*': [
57
+ 'href',
58
+ 'src',
59
+ 'style',
60
+ 'url'
61
+ ],
62
+ form: ['action']
63
+ };
64
+ var ABS_URL = /(^\/)|(^#)|(^[\w-\d]*:)/;
65
+ var BINDING_RX = /\{\{|\[\[/;
66
+ Polymer.ResolveUrl = {
67
+ resolveCss: resolveCss,
68
+ resolveAttrs: resolveAttrs,
69
+ resolveUrl: resolveUrl,
70
+ pathFromUrl: pathFromUrl
71
+ };
72
+ Polymer.rootPath = Polymer.Settings.rootPath || pathFromUrl(document.baseURI || window.location.href);
73
+ }());Polymer.Base._addFeature({
10
74
  _prepTemplate: function () {
75
+ var module;
11
76
  if (this._template === undefined) {
12
- this._template = Polymer.DomModule.import(this.is, 'template');
77
+ module = Polymer.DomModule.import(this.is);
78
+ this._template = module && module.querySelector('template');
79
+ }
80
+ if (module) {
81
+ var assetPath = module.getAttribute('assetpath') || '';
82
+ var importURL = Polymer.ResolveUrl.resolveUrl(assetPath, module.ownerDocument.baseURI);
83
+ this._importPath = Polymer.ResolveUrl.pathFromUrl(importURL);
84
+ } else {
85
+ this._importPath = '';
13
86
  }
14
87
  if (this._template && this._template.hasAttribute('is')) {
15
88
  this._warn(this._logf('_prepTemplate', 'top-level Polymer template ' + 'must not be a type-extension, found', this._template, 'Move inside simple <template>.'));
@@ -29,6 +102,7 @@ return dom;
29
102
  }
30
103
  });(function () {
31
104
  var baseAttachedCallback = Polymer.Base.attachedCallback;
105
+ var baseDetachedCallback = Polymer.Base.detachedCallback;
32
106
  Polymer.Base._addFeature({
33
107
  _hostStack: [],
34
108
  ready: function () {
@@ -81,7 +155,15 @@ c._ready();
81
155
  this._finishDistribute();
82
156
  },
83
157
  _readySelf: function () {
84
- this._doBehavior('ready');
158
+ for (var i = 0, b; i < this.behaviors.length; i++) {
159
+ b = this.behaviors[i];
160
+ if (b.ready) {
161
+ b.ready.call(this);
162
+ }
163
+ }
164
+ if (this.ready) {
165
+ this.ready();
166
+ }
85
167
  this._readied = true;
86
168
  if (this._attachedPending) {
87
169
  this._attachedPending = false;
@@ -101,6 +183,13 @@ baseAttachedCallback.call(this);
101
183
  } else {
102
184
  this._attachedPending = true;
103
185
  }
186
+ },
187
+ detachedCallback: function () {
188
+ if (this._readied) {
189
+ baseDetachedCallback.call(this);
190
+ } else {
191
+ this._attachedPending = false;
192
+ }
104
193
  }
105
194
  });
106
195
  }());Polymer.ArraySplice = function () {
@@ -694,7 +783,7 @@ return;
694
783
  }
695
784
  var nativeCloneNode = Element.prototype.cloneNode;
696
785
  var nativeImportNode = Document.prototype.importNode;
697
- Polymer.Base.extend(DomApi.prototype, {
786
+ Polymer.Base.mixin(DomApi.prototype, {
698
787
  _lazyDistribute: function (host) {
699
788
  if (host.shadyRoot && host.shadyRoot._distributionClean) {
700
789
  host.shadyRoot._distributionClean = false;
@@ -1158,7 +1247,7 @@ var DomApi = Polymer.DomApi;
1158
1247
  if (!Settings.useShadow) {
1159
1248
  return;
1160
1249
  }
1161
- Polymer.Base.extend(DomApi.prototype, {
1250
+ Polymer.Base.mixin(DomApi.prototype, {
1162
1251
  querySelectorAll: function (selector) {
1163
1252
  return TreeApi.arrayCopy(this.node.querySelectorAll(selector));
1164
1253
  },
@@ -1268,7 +1357,7 @@ forwardProperties([
1268
1357
  'nextElementSibling',
1269
1358
  'previousElementSibling'
1270
1359
  ]);
1271
- }());Polymer.Base.extend(Polymer.dom, {
1360
+ }());Polymer.Base.mixin(Polymer.dom, {
1272
1361
  _flushGuard: 0,
1273
1362
  _FLUSH_MAX: 100,
1274
1363
  _needsTakeRecords: !Polymer.Settings.useNativeCustomElements,
@@ -1569,7 +1658,7 @@ enableShadowAttributeTracking: function () {
1569
1658
  if (Settings.useShadow) {
1570
1659
  var baseSetup = DomApi.EffectiveNodesObserver.prototype._setup;
1571
1660
  var baseCleanup = DomApi.EffectiveNodesObserver.prototype._cleanup;
1572
- Polymer.Base.extend(DomApi.EffectiveNodesObserver.prototype, {
1661
+ Polymer.Base.mixin(DomApi.EffectiveNodesObserver.prototype, {
1573
1662
  _setup: function () {
1574
1663
  if (!this._observer) {
1575
1664
  var self = this;
@@ -1631,7 +1720,7 @@ DomApi.DistributedNodesObserver = function (domApi) {
1631
1720
  DomApi.EffectiveNodesObserver.call(this, domApi);
1632
1721
  };
1633
1722
  DomApi.DistributedNodesObserver.prototype = Object.create(DomApi.EffectiveNodesObserver.prototype);
1634
- Polymer.Base.extend(DomApi.DistributedNodesObserver.prototype, {
1723
+ Polymer.Base.mixin(DomApi.DistributedNodesObserver.prototype, {
1635
1724
  _setup: function () {
1636
1725
  },
1637
1726
  _cleanup: function () {
@@ -1643,7 +1732,7 @@ return this.domApi.getDistributedNodes();
1643
1732
  }
1644
1733
  });
1645
1734
  if (Settings.useShadow) {
1646
- Polymer.Base.extend(DomApi.DistributedNodesObserver.prototype, {
1735
+ Polymer.Base.mixin(DomApi.DistributedNodesObserver.prototype, {
1647
1736
  _setup: function () {
1648
1737
  if (!this._observer) {
1649
1738
  var root = this.domApi.getOwnerRoot();
@@ -1721,10 +1810,6 @@ TreeApi.Logical.saveChildNodes(c.parentNode);
1721
1810
  }
1722
1811
  this.shadyRoot.host = this;
1723
1812
  },
1724
- get domHost() {
1725
- var root = Polymer.dom(this).getOwnerRoot();
1726
- return root && root.host;
1727
- },
1728
1813
  distributeContent: function (updateInsertionPoints) {
1729
1814
  if (this.shadyRoot) {
1730
1815
  this.shadyRoot._invalidInsertionPoints = this.shadyRoot._invalidInsertionPoints || updateInsertionPoints;
@@ -1911,6 +1996,15 @@ _elementAdd: function () {
1911
1996
  _elementRemove: function () {
1912
1997
  }
1913
1998
  });
1999
+ var domHostDesc = {
2000
+ get: function () {
2001
+ var root = Polymer.dom(this).getOwnerRoot();
2002
+ return root && root.host;
2003
+ },
2004
+ configurable: true
2005
+ };
2006
+ Object.defineProperty(Polymer.Base, 'domHost', domHostDesc);
2007
+ Polymer.BaseDescriptors.domHost = domHostDesc;
1914
2008
  function distributeNodeInto(child, insertionPoint) {
1915
2009
  insertionPoint._distributedNodes.push(child);
1916
2010
  var points = child._destinationInsertionPoints;