Q3 Webinar - Jen's content
This commit is contained in:
Родитель
e1b0bb8678
Коммит
17b10dab7e
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "emoji-rain",
|
||||
"version": "1.0.0",
|
||||
"description": "A polymer element that makes it rain emoji",
|
||||
"main": "emoji-rain.html",
|
||||
"author": [
|
||||
"Monica Dinculescu <noms@google.com>"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"emoji",
|
||||
"rain"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/notwaldorf/emoji-rain.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"homepage": "https://github.com/notwaldorf/emoji-rain",
|
||||
"_release": "1.0.0",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.0",
|
||||
"commit": "a5d9d393826f0ff0c883dbd7241445ca4b7a4677"
|
||||
},
|
||||
"_source": "git://github.com/notwaldorf/emoji-rain.git",
|
||||
"_target": "~1.0.0",
|
||||
"_originalSource": "emoji-rain",
|
||||
"_direct": true
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
# :sparkles: emoji-rain :sparkles:
|
||||
|
||||
`<emoji-rain>` is a Polymer element that makes it rain emoji on any page. Because it can.
|
||||
|
||||
<img width="500" alt="emoji rain" src="https://cloud.githubusercontent.com/assets/1369170/9401459/86c67a76-4784-11e5-8716-3300c96a7e20.gif">
|
||||
|
||||
☔️ The number of drops is configurable (by default it's set to 250). The `active`
|
||||
attribute determines whether the emoji are raining, but you can also manually
|
||||
`start()` and `stop()` the rain.
|
||||
|
||||
Example:
|
||||
```html
|
||||
<emoji-rain drops="100" active></emoji-rain>
|
||||
```
|
||||
|
||||
💸️ Optionally, you can also use the Twitter emoji instead of the native ones.
|
||||
`twemoji.js` and all its images will only be loaded on demand, so if you don't
|
||||
want to eat the performance cost, you don't have to:
|
||||
```html
|
||||
<emoji-rain use-twemoji></emoji-rain>
|
||||
```
|
||||
|
||||
## Usage
|
||||
Install with bower:
|
||||
```
|
||||
mkdir emoji-rain-demo && cd emoji-rain-demo
|
||||
bower install emoji-rain
|
||||
```
|
||||
Drop it in a page, next to the newly created `bower_components` folder:
|
||||
```html
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>zomg</title>
|
||||
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="bower_components/emoji-rain/emoji-rain.html">
|
||||
</head>
|
||||
<body>
|
||||
<emoji-rain active></emoji-rain>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
# :sparkles::umbrella::joy_cat:
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "emoji-rain",
|
||||
"version": "1.0.0",
|
||||
"description": "A polymer element that makes it rain emoji",
|
||||
"main": "emoji-rain.html",
|
||||
"author": [
|
||||
"Monica Dinculescu <noms@google.com>"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"emoji",
|
||||
"rain"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/notwaldorf/emoji-rain.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*"
|
||||
}
|
||||
}
|
37
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/.bower.json
поставляемый
Normal file
37
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/.bower.json
поставляемый
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.1.1",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"ignore": [
|
||||
"/.*",
|
||||
"/test/",
|
||||
"gen-changelog.sh"
|
||||
],
|
||||
"authors": [
|
||||
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Polymer/polymer.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"webcomponentsjs": "^0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"private": true,
|
||||
"homepage": "https://github.com/Polymer/polymer",
|
||||
"_release": "1.1.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.1",
|
||||
"commit": "c0bd5a73b4bd694b7fa5ead01ff558ed542f6bd8"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/polymer.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "Polymer/polymer"
|
||||
}
|
27
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/LICENSE.txt
поставляемый
Normal file
27
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/LICENSE.txt
поставляемый
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) 2014 The Polymer Authors. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/bower.json
поставляемый
Normal file
27
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/bower.json
поставляемый
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.1.1",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"ignore": [
|
||||
"/.*",
|
||||
"/test/",
|
||||
"gen-changelog.sh"
|
||||
],
|
||||
"authors": [
|
||||
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Polymer/polymer.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"webcomponentsjs": "^0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"private": true
|
||||
}
|
583
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer-micro.html
поставляемый
Normal file
583
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer-micro.html
поставляемый
Normal file
|
@ -0,0 +1,583 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
--><script>(function () {
|
||||
function resolve() {
|
||||
document.body.removeAttribute('unresolved');
|
||||
}
|
||||
if (window.WebComponents) {
|
||||
addEventListener('WebComponentsReady', resolve);
|
||||
} else {
|
||||
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
||||
resolve();
|
||||
} else {
|
||||
addEventListener('DOMContentLoaded', resolve);
|
||||
}
|
||||
}
|
||||
}());
|
||||
Polymer = {
|
||||
Settings: function () {
|
||||
var user = window.Polymer || {};
|
||||
location.search.slice(1).split('&').forEach(function (o) {
|
||||
o = o.split('=');
|
||||
o[0] && (user[o[0]] = o[1] || true);
|
||||
});
|
||||
var wantShadow = user.dom === 'shadow';
|
||||
var hasShadow = Boolean(Element.prototype.createShadowRoot);
|
||||
var nativeShadow = hasShadow && !window.ShadowDOMPolyfill;
|
||||
var useShadow = wantShadow && hasShadow;
|
||||
var hasNativeImports = Boolean('import' in document.createElement('link'));
|
||||
var useNativeImports = hasNativeImports;
|
||||
var useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
|
||||
return {
|
||||
wantShadow: wantShadow,
|
||||
hasShadow: hasShadow,
|
||||
nativeShadow: nativeShadow,
|
||||
useShadow: useShadow,
|
||||
useNativeShadow: useShadow && nativeShadow,
|
||||
useNativeImports: useNativeImports,
|
||||
useNativeCustomElements: useNativeCustomElements
|
||||
};
|
||||
}()
|
||||
};
|
||||
(function () {
|
||||
var userPolymer = window.Polymer;
|
||||
window.Polymer = function (prototype) {
|
||||
var ctor = desugar(prototype);
|
||||
prototype = ctor.prototype;
|
||||
var options = { prototype: prototype };
|
||||
if (prototype.extends) {
|
||||
options.extends = prototype.extends;
|
||||
}
|
||||
Polymer.telemetry._registrate(prototype);
|
||||
document.registerElement(prototype.is, options);
|
||||
return ctor;
|
||||
};
|
||||
var desugar = function (prototype) {
|
||||
var base = Polymer.Base;
|
||||
if (prototype.extends) {
|
||||
base = Polymer.Base._getExtendedPrototype(prototype.extends);
|
||||
}
|
||||
prototype = Polymer.Base.chainObject(prototype, base);
|
||||
prototype.registerCallback();
|
||||
return prototype.constructor;
|
||||
};
|
||||
window.Polymer = Polymer;
|
||||
if (userPolymer) {
|
||||
for (var i in userPolymer) {
|
||||
Polymer[i] = userPolymer[i];
|
||||
}
|
||||
}
|
||||
Polymer.Class = desugar;
|
||||
}());
|
||||
Polymer.telemetry = {
|
||||
registrations: [],
|
||||
_regLog: function (prototype) {
|
||||
console.log('[' + prototype.is + ']: registered');
|
||||
},
|
||||
_registrate: function (prototype) {
|
||||
this.registrations.push(prototype);
|
||||
Polymer.log && this._regLog(prototype);
|
||||
},
|
||||
dumpRegistrations: function () {
|
||||
this.registrations.forEach(this._regLog);
|
||||
}
|
||||
};
|
||||
Object.defineProperty(window, 'currentImport', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: function () {
|
||||
return (document._currentScript || document.currentScript).ownerDocument;
|
||||
}
|
||||
});
|
||||
Polymer.RenderStatus = {
|
||||
_ready: false,
|
||||
_callbacks: [],
|
||||
whenReady: function (cb) {
|
||||
if (this._ready) {
|
||||
cb();
|
||||
} else {
|
||||
this._callbacks.push(cb);
|
||||
}
|
||||
},
|
||||
_makeReady: function () {
|
||||
this._ready = true;
|
||||
this._callbacks.forEach(function (cb) {
|
||||
cb();
|
||||
});
|
||||
this._callbacks = [];
|
||||
},
|
||||
_catchFirstRender: function () {
|
||||
requestAnimationFrame(function () {
|
||||
Polymer.RenderStatus._makeReady();
|
||||
});
|
||||
}
|
||||
};
|
||||
if (window.HTMLImports) {
|
||||
HTMLImports.whenReady(function () {
|
||||
Polymer.RenderStatus._catchFirstRender();
|
||||
});
|
||||
} else {
|
||||
Polymer.RenderStatus._catchFirstRender();
|
||||
}
|
||||
Polymer.ImportStatus = Polymer.RenderStatus;
|
||||
Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;
|
||||
Polymer.Base = {
|
||||
__isPolymerInstance__: true,
|
||||
_addFeature: function (feature) {
|
||||
this.extend(this, feature);
|
||||
},
|
||||
registerCallback: function () {
|
||||
this._registerFeatures();
|
||||
this._doBehavior('registered');
|
||||
},
|
||||
createdCallback: function () {
|
||||
Polymer.telemetry.instanceCount++;
|
||||
this.root = this;
|
||||
this._doBehavior('created');
|
||||
this._initFeatures();
|
||||
},
|
||||
attachedCallback: function () {
|
||||
Polymer.RenderStatus.whenReady(function () {
|
||||
this.isAttached = true;
|
||||
this._doBehavior('attached');
|
||||
}.bind(this));
|
||||
},
|
||||
detachedCallback: function () {
|
||||
this.isAttached = false;
|
||||
this._doBehavior('detached');
|
||||
},
|
||||
attributeChangedCallback: function (name) {
|
||||
this._attributeChangedImpl(name);
|
||||
this._doBehavior('attributeChanged', arguments);
|
||||
},
|
||||
_attributeChangedImpl: function (name) {
|
||||
this._setAttributeToProperty(this, name);
|
||||
},
|
||||
extend: function (prototype, api) {
|
||||
if (prototype && api) {
|
||||
Object.getOwnPropertyNames(api).forEach(function (n) {
|
||||
this.copyOwnProperty(n, api, prototype);
|
||||
}, this);
|
||||
}
|
||||
return prototype || api;
|
||||
},
|
||||
mixin: function (target, source) {
|
||||
for (var i in source) {
|
||||
target[i] = source[i];
|
||||
}
|
||||
return target;
|
||||
},
|
||||
copyOwnProperty: function (name, source, target) {
|
||||
var pd = Object.getOwnPropertyDescriptor(source, name);
|
||||
if (pd) {
|
||||
Object.defineProperty(target, name, pd);
|
||||
}
|
||||
},
|
||||
_log: console.log.apply.bind(console.log, console),
|
||||
_warn: console.warn.apply.bind(console.warn, console),
|
||||
_error: console.error.apply.bind(console.error, console),
|
||||
_logf: function () {
|
||||
return this._logPrefix.concat([this.is]).concat(Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
};
|
||||
Polymer.Base._logPrefix = function () {
|
||||
var color = window.chrome || /firefox/i.test(navigator.userAgent);
|
||||
return color ? [
|
||||
'%c[%s::%s]:',
|
||||
'font-weight: bold; background-color:#EEEE00;'
|
||||
] : ['[%s::%s]:'];
|
||||
}();
|
||||
Polymer.Base.chainObject = function (object, inherited) {
|
||||
if (object && inherited && object !== inherited) {
|
||||
if (!Object.__proto__) {
|
||||
object = Polymer.Base.extend(Object.create(inherited), object);
|
||||
}
|
||||
object.__proto__ = inherited;
|
||||
}
|
||||
return object;
|
||||
};
|
||||
Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype);
|
||||
if (window.CustomElements) {
|
||||
Polymer.instanceof = CustomElements.instanceof;
|
||||
} else {
|
||||
Polymer.instanceof = function (obj, ctor) {
|
||||
return obj instanceof ctor;
|
||||
};
|
||||
}
|
||||
Polymer.isInstance = function (obj) {
|
||||
return Boolean(obj && obj.__isPolymerInstance__);
|
||||
};
|
||||
Polymer.telemetry.instanceCount = 0;
|
||||
(function () {
|
||||
var modules = {};
|
||||
var lcModules = {};
|
||||
var findModule = function (id) {
|
||||
return modules[id] || lcModules[id.toLowerCase()];
|
||||
};
|
||||
var DomModule = function () {
|
||||
return document.createElement('dom-module');
|
||||
};
|
||||
DomModule.prototype = Object.create(HTMLElement.prototype);
|
||||
Polymer.Base.extend(DomModule.prototype, {
|
||||
constructor: DomModule,
|
||||
createdCallback: function () {
|
||||
this.register();
|
||||
},
|
||||
register: function (id) {
|
||||
var id = id || this.id || this.getAttribute('name') || this.getAttribute('is');
|
||||
if (id) {
|
||||
this.id = id;
|
||||
modules[id] = this;
|
||||
lcModules[id.toLowerCase()] = this;
|
||||
}
|
||||
},
|
||||
import: function (id, selector) {
|
||||
var m = findModule(id);
|
||||
if (!m) {
|
||||
forceDocumentUpgrade();
|
||||
m = findModule(id);
|
||||
}
|
||||
if (m && selector) {
|
||||
m = m.querySelector(selector);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
});
|
||||
var cePolyfill = window.CustomElements && !CustomElements.useNative;
|
||||
document.registerElement('dom-module', DomModule);
|
||||
function forceDocumentUpgrade() {
|
||||
if (cePolyfill) {
|
||||
var script = document._currentScript || document.currentScript;
|
||||
var doc = script && script.ownerDocument;
|
||||
if (doc && !doc.__customElementsForceUpgraded) {
|
||||
doc.__customElementsForceUpgraded = true;
|
||||
CustomElements.upgradeAll(doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}());
|
||||
Polymer.Base._addFeature({
|
||||
_prepIs: function () {
|
||||
if (!this.is) {
|
||||
var module = (document._currentScript || document.currentScript).parentNode;
|
||||
if (module.localName === 'dom-module') {
|
||||
var id = module.id || module.getAttribute('name') || module.getAttribute('is');
|
||||
this.is = id;
|
||||
}
|
||||
}
|
||||
if (this.is) {
|
||||
this.is = this.is.toLowerCase();
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
behaviors: [],
|
||||
_prepBehaviors: function () {
|
||||
if (this.behaviors.length) {
|
||||
this.behaviors = this._flattenBehaviorsList(this.behaviors);
|
||||
}
|
||||
this._prepAllBehaviors(this.behaviors);
|
||||
},
|
||||
_flattenBehaviorsList: function (behaviors) {
|
||||
var flat = [];
|
||||
behaviors.forEach(function (b) {
|
||||
if (b instanceof Array) {
|
||||
flat = flat.concat(this._flattenBehaviorsList(b));
|
||||
} else if (b) {
|
||||
flat.push(b);
|
||||
} else {
|
||||
this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for missing or 404 import'));
|
||||
}
|
||||
}, this);
|
||||
return flat;
|
||||
},
|
||||
_prepAllBehaviors: function (behaviors) {
|
||||
for (var i = behaviors.length - 1; i >= 0; i--) {
|
||||
this._mixinBehavior(behaviors[i]);
|
||||
}
|
||||
for (var i = 0, l = behaviors.length; i < l; i++) {
|
||||
this._prepBehavior(behaviors[i]);
|
||||
}
|
||||
this._prepBehavior(this);
|
||||
},
|
||||
_mixinBehavior: function (b) {
|
||||
Object.getOwnPropertyNames(b).forEach(function (n) {
|
||||
switch (n) {
|
||||
case 'hostAttributes':
|
||||
case 'registered':
|
||||
case 'properties':
|
||||
case 'observers':
|
||||
case 'listeners':
|
||||
case 'created':
|
||||
case 'attached':
|
||||
case 'detached':
|
||||
case 'attributeChanged':
|
||||
case 'configure':
|
||||
case 'ready':
|
||||
break;
|
||||
default:
|
||||
if (!this.hasOwnProperty(n)) {
|
||||
this.copyOwnProperty(n, b, this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
_doBehavior: function (name, args) {
|
||||
this.behaviors.forEach(function (b) {
|
||||
this._invokeBehavior(b, name, args);
|
||||
}, this);
|
||||
this._invokeBehavior(this, name, args);
|
||||
},
|
||||
_invokeBehavior: function (b, name, args) {
|
||||
var fn = b[name];
|
||||
if (fn) {
|
||||
fn.apply(this, args || Polymer.nar);
|
||||
}
|
||||
},
|
||||
_marshalBehaviors: function () {
|
||||
this.behaviors.forEach(function (b) {
|
||||
this._marshalBehavior(b);
|
||||
}, this);
|
||||
this._marshalBehavior(this);
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_getExtendedPrototype: function (tag) {
|
||||
return this._getExtendedNativePrototype(tag);
|
||||
},
|
||||
_nativePrototypes: {},
|
||||
_getExtendedNativePrototype: function (tag) {
|
||||
var p = this._nativePrototypes[tag];
|
||||
if (!p) {
|
||||
var np = this.getNativePrototype(tag);
|
||||
p = this.extend(Object.create(np), Polymer.Base);
|
||||
this._nativePrototypes[tag] = p;
|
||||
}
|
||||
return p;
|
||||
},
|
||||
getNativePrototype: function (tag) {
|
||||
return Object.getPrototypeOf(document.createElement(tag));
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_prepConstructor: function () {
|
||||
this._factoryArgs = this.extends ? [
|
||||
this.extends,
|
||||
this.is
|
||||
] : [this.is];
|
||||
var ctor = function () {
|
||||
return this._factory(arguments);
|
||||
};
|
||||
if (this.hasOwnProperty('extends')) {
|
||||
ctor.extends = this.extends;
|
||||
}
|
||||
Object.defineProperty(this, 'constructor', {
|
||||
value: ctor,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
ctor.prototype = this;
|
||||
},
|
||||
_factory: function (args) {
|
||||
var elt = document.createElement.apply(document, this._factoryArgs);
|
||||
if (this.factoryImpl) {
|
||||
this.factoryImpl.apply(elt, args);
|
||||
}
|
||||
return elt;
|
||||
}
|
||||
});
|
||||
Polymer.nob = Object.create(null);
|
||||
Polymer.Base._addFeature({
|
||||
properties: {},
|
||||
getPropertyInfo: function (property) {
|
||||
var info = this._getPropertyInfo(property, this.properties);
|
||||
if (!info) {
|
||||
this.behaviors.some(function (b) {
|
||||
return info = this._getPropertyInfo(property, b.properties);
|
||||
}, this);
|
||||
}
|
||||
return info || Polymer.nob;
|
||||
},
|
||||
_getPropertyInfo: function (property, properties) {
|
||||
var p = properties && properties[property];
|
||||
if (typeof p === 'function') {
|
||||
p = properties[property] = { type: p };
|
||||
}
|
||||
if (p) {
|
||||
p.defined = true;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
});
|
||||
Polymer.CaseMap = {
|
||||
_caseMap: {},
|
||||
dashToCamelCase: function (dash) {
|
||||
var mapped = Polymer.CaseMap._caseMap[dash];
|
||||
if (mapped) {
|
||||
return mapped;
|
||||
}
|
||||
if (dash.indexOf('-') < 0) {
|
||||
return Polymer.CaseMap._caseMap[dash] = dash;
|
||||
}
|
||||
return Polymer.CaseMap._caseMap[dash] = dash.replace(/-([a-z])/g, function (m) {
|
||||
return m[1].toUpperCase();
|
||||
});
|
||||
},
|
||||
camelToDashCase: function (camel) {
|
||||
var mapped = Polymer.CaseMap._caseMap[camel];
|
||||
if (mapped) {
|
||||
return mapped;
|
||||
}
|
||||
return Polymer.CaseMap._caseMap[camel] = camel.replace(/([a-z][A-Z])/g, function (g) {
|
||||
return g[0] + '-' + g[1].toLowerCase();
|
||||
});
|
||||
}
|
||||
};
|
||||
Polymer.Base._addFeature({
|
||||
_prepAttributes: function () {
|
||||
this._aggregatedAttributes = {};
|
||||
},
|
||||
_addHostAttributes: function (attributes) {
|
||||
if (attributes) {
|
||||
this.mixin(this._aggregatedAttributes, attributes);
|
||||
}
|
||||
},
|
||||
_marshalHostAttributes: function () {
|
||||
this._applyAttributes(this, this._aggregatedAttributes);
|
||||
},
|
||||
_applyAttributes: function (node, attr$) {
|
||||
for (var n in attr$) {
|
||||
if (!this.hasAttribute(n) && n !== 'class') {
|
||||
this.serializeValueToAttribute(attr$[n], n, this);
|
||||
}
|
||||
}
|
||||
},
|
||||
_marshalAttributes: function () {
|
||||
this._takeAttributesToModel(this);
|
||||
},
|
||||
_takeAttributesToModel: function (model) {
|
||||
for (var i = 0, l = this.attributes.length; i < l; i++) {
|
||||
this._setAttributeToProperty(model, this.attributes[i].name);
|
||||
}
|
||||
},
|
||||
_setAttributeToProperty: function (model, attrName) {
|
||||
if (!this._serializing) {
|
||||
var propName = Polymer.CaseMap.dashToCamelCase(attrName);
|
||||
var info = this.getPropertyInfo(propName);
|
||||
if (info.defined || this._propertyEffects && this._propertyEffects[propName]) {
|
||||
var val = this.getAttribute(attrName);
|
||||
model[propName] = this.deserialize(val, info.type);
|
||||
}
|
||||
}
|
||||
},
|
||||
_serializing: false,
|
||||
reflectPropertyToAttribute: function (name) {
|
||||
this._serializing = true;
|
||||
this.serializeValueToAttribute(this[name], Polymer.CaseMap.camelToDashCase(name));
|
||||
this._serializing = false;
|
||||
},
|
||||
serializeValueToAttribute: function (value, attribute, node) {
|
||||
var str = this.serialize(value);
|
||||
(node || this)[str === undefined ? 'removeAttribute' : 'setAttribute'](attribute, str);
|
||||
},
|
||||
deserialize: function (value, type) {
|
||||
switch (type) {
|
||||
case Number:
|
||||
value = Number(value);
|
||||
break;
|
||||
case Boolean:
|
||||
value = value !== null;
|
||||
break;
|
||||
case Object:
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (x) {
|
||||
}
|
||||
break;
|
||||
case Array:
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (x) {
|
||||
value = null;
|
||||
console.warn('Polymer::Attributes: couldn`t decode Array as JSON');
|
||||
}
|
||||
break;
|
||||
case Date:
|
||||
value = new Date(value);
|
||||
break;
|
||||
case String:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
serialize: function (value) {
|
||||
switch (typeof value) {
|
||||
case 'boolean':
|
||||
return value ? '' : undefined;
|
||||
case 'object':
|
||||
if (value instanceof Date) {
|
||||
return value;
|
||||
} else if (value) {
|
||||
try {
|
||||
return JSON.stringify(value);
|
||||
} catch (x) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
default:
|
||||
return value != null ? value : undefined;
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_setupDebouncers: function () {
|
||||
this._debouncers = {};
|
||||
},
|
||||
debounce: function (jobName, callback, wait) {
|
||||
return this._debouncers[jobName] = Polymer.Debounce.call(this, this._debouncers[jobName], callback, wait);
|
||||
},
|
||||
isDebouncerActive: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
return debouncer && debouncer.finish;
|
||||
},
|
||||
flushDebouncer: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
if (debouncer) {
|
||||
debouncer.complete();
|
||||
}
|
||||
},
|
||||
cancelDebouncer: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
if (debouncer) {
|
||||
debouncer.stop();
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.version = '1.1.1';
|
||||
Polymer.Base._addFeature({
|
||||
_registerFeatures: function () {
|
||||
this._prepIs();
|
||||
this._prepAttributes();
|
||||
this._prepBehaviors();
|
||||
this._prepConstructor();
|
||||
},
|
||||
_prepBehavior: function (b) {
|
||||
this._addHostAttributes(b.hostAttributes);
|
||||
},
|
||||
_marshalBehavior: function (b) {
|
||||
},
|
||||
_initFeatures: function () {
|
||||
this._marshalHostAttributes();
|
||||
this._setupDebouncers();
|
||||
this._marshalBehaviors();
|
||||
}
|
||||
});</script>
|
||||
|
1508
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer-mini.html
поставляемый
Normal file
1508
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer-mini.html
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
4241
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer.html
поставляемый
Normal file
4241
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer.html
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
27
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/.bower.json
поставляемый
Normal file
27
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/.bower.json
поставляемый
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.12",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"webcomponents"
|
||||
],
|
||||
"license": "BSD",
|
||||
"ignore": [],
|
||||
"_release": "0.7.12",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.7.12",
|
||||
"commit": "044234d00f966292390d02cbe88184861e673cc7"
|
||||
},
|
||||
"_source": "git://github.com/webcomponents/webcomponentsjs.git",
|
||||
"_target": "^0.7.0",
|
||||
"_originalSource": "webcomponents/webcomponentsjs"
|
||||
}
|
973
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/CustomElements.js
поставляемый
Normal file
973
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/CustomElements.js
поставляемый
Normal file
|
@ -0,0 +1,973 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
// @version 0.7.12
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
var counter = Date.now() % 1e9;
|
||||
var WeakMap = function() {
|
||||
this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
|
||||
};
|
||||
WeakMap.prototype = {
|
||||
set: function(key, value) {
|
||||
var entry = key[this.name];
|
||||
if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
|
||||
value: [ key, value ],
|
||||
writable: true
|
||||
});
|
||||
return this;
|
||||
},
|
||||
get: function(key) {
|
||||
var entry;
|
||||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
|
||||
},
|
||||
"delete": function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry || entry[0] !== key) return false;
|
||||
entry[0] = entry[1] = undefined;
|
||||
return true;
|
||||
},
|
||||
has: function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry) return false;
|
||||
return entry[0] === key;
|
||||
}
|
||||
};
|
||||
window.WeakMap = WeakMap;
|
||||
})();
|
||||
}
|
||||
|
||||
(function(global) {
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
setImmediate = setTimeout;
|
||||
} else if (window.setImmediate) {
|
||||
setImmediate = window.setImmediate;
|
||||
} else {
|
||||
var setImmediateQueue = [];
|
||||
var sentinel = String(Math.random());
|
||||
window.addEventListener("message", function(e) {
|
||||
if (e.data === sentinel) {
|
||||
var queue = setImmediateQueue;
|
||||
setImmediateQueue = [];
|
||||
queue.forEach(function(func) {
|
||||
func();
|
||||
});
|
||||
}
|
||||
});
|
||||
setImmediate = function(func) {
|
||||
setImmediateQueue.push(func);
|
||||
window.postMessage(sentinel, "*");
|
||||
};
|
||||
}
|
||||
var isScheduled = false;
|
||||
var scheduledObservers = [];
|
||||
function scheduleCallback(observer) {
|
||||
scheduledObservers.push(observer);
|
||||
if (!isScheduled) {
|
||||
isScheduled = true;
|
||||
setImmediate(dispatchCallbacks);
|
||||
}
|
||||
}
|
||||
function wrapIfNeeded(node) {
|
||||
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
|
||||
}
|
||||
function dispatchCallbacks() {
|
||||
isScheduled = false;
|
||||
var observers = scheduledObservers;
|
||||
scheduledObservers = [];
|
||||
observers.sort(function(o1, o2) {
|
||||
return o1.uid_ - o2.uid_;
|
||||
});
|
||||
var anyNonEmpty = false;
|
||||
observers.forEach(function(observer) {
|
||||
var queue = observer.takeRecords();
|
||||
removeTransientObserversFor(observer);
|
||||
if (queue.length) {
|
||||
observer.callback_(queue, observer);
|
||||
anyNonEmpty = true;
|
||||
}
|
||||
});
|
||||
if (anyNonEmpty) dispatchCallbacks();
|
||||
}
|
||||
function removeTransientObserversFor(observer) {
|
||||
observer.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) return;
|
||||
registrations.forEach(function(registration) {
|
||||
if (registration.observer === observer) registration.removeTransientObservers();
|
||||
});
|
||||
});
|
||||
}
|
||||
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
|
||||
for (var node = target; node; node = node.parentNode) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (registrations) {
|
||||
for (var j = 0; j < registrations.length; j++) {
|
||||
var registration = registrations[j];
|
||||
var options = registration.options;
|
||||
if (node !== target && !options.subtree) continue;
|
||||
var record = callback(options);
|
||||
if (record) registration.enqueue(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var uidCounter = 0;
|
||||
function JsMutationObserver(callback) {
|
||||
this.callback_ = callback;
|
||||
this.nodes_ = [];
|
||||
this.records_ = [];
|
||||
this.uid_ = ++uidCounter;
|
||||
}
|
||||
JsMutationObserver.prototype = {
|
||||
observe: function(target, options) {
|
||||
target = wrapIfNeeded(target);
|
||||
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
|
||||
throw new SyntaxError();
|
||||
}
|
||||
var registrations = registrationsTable.get(target);
|
||||
if (!registrations) registrationsTable.set(target, registrations = []);
|
||||
var registration;
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i].observer === this) {
|
||||
registration = registrations[i];
|
||||
registration.removeListeners();
|
||||
registration.options = options;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!registration) {
|
||||
registration = new Registration(this, target, options);
|
||||
registrations.push(registration);
|
||||
this.nodes_.push(target);
|
||||
}
|
||||
registration.addListeners();
|
||||
},
|
||||
disconnect: function() {
|
||||
this.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
var registration = registrations[i];
|
||||
if (registration.observer === this) {
|
||||
registration.removeListeners();
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
this.records_ = [];
|
||||
},
|
||||
takeRecords: function() {
|
||||
var copyOfRecords = this.records_;
|
||||
this.records_ = [];
|
||||
return copyOfRecords;
|
||||
}
|
||||
};
|
||||
function MutationRecord(type, target) {
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.addedNodes = [];
|
||||
this.removedNodes = [];
|
||||
this.previousSibling = null;
|
||||
this.nextSibling = null;
|
||||
this.attributeName = null;
|
||||
this.attributeNamespace = null;
|
||||
this.oldValue = null;
|
||||
}
|
||||
function copyMutationRecord(original) {
|
||||
var record = new MutationRecord(original.type, original.target);
|
||||
record.addedNodes = original.addedNodes.slice();
|
||||
record.removedNodes = original.removedNodes.slice();
|
||||
record.previousSibling = original.previousSibling;
|
||||
record.nextSibling = original.nextSibling;
|
||||
record.attributeName = original.attributeName;
|
||||
record.attributeNamespace = original.attributeNamespace;
|
||||
record.oldValue = original.oldValue;
|
||||
return record;
|
||||
}
|
||||
var currentRecord, recordWithOldValue;
|
||||
function getRecord(type, target) {
|
||||
return currentRecord = new MutationRecord(type, target);
|
||||
}
|
||||
function getRecordWithOldValue(oldValue) {
|
||||
if (recordWithOldValue) return recordWithOldValue;
|
||||
recordWithOldValue = copyMutationRecord(currentRecord);
|
||||
recordWithOldValue.oldValue = oldValue;
|
||||
return recordWithOldValue;
|
||||
}
|
||||
function clearRecords() {
|
||||
currentRecord = recordWithOldValue = undefined;
|
||||
}
|
||||
function recordRepresentsCurrentMutation(record) {
|
||||
return record === recordWithOldValue || record === currentRecord;
|
||||
}
|
||||
function selectRecord(lastRecord, newRecord) {
|
||||
if (lastRecord === newRecord) return lastRecord;
|
||||
if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
|
||||
return null;
|
||||
}
|
||||
function Registration(observer, target, options) {
|
||||
this.observer = observer;
|
||||
this.target = target;
|
||||
this.options = options;
|
||||
this.transientObservedNodes = [];
|
||||
}
|
||||
Registration.prototype = {
|
||||
enqueue: function(record) {
|
||||
var records = this.observer.records_;
|
||||
var length = records.length;
|
||||
if (records.length > 0) {
|
||||
var lastRecord = records[length - 1];
|
||||
var recordToReplaceLast = selectRecord(lastRecord, record);
|
||||
if (recordToReplaceLast) {
|
||||
records[length - 1] = recordToReplaceLast;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
scheduleCallback(this.observer);
|
||||
}
|
||||
records[length] = record;
|
||||
},
|
||||
addListeners: function() {
|
||||
this.addListeners_(this.target);
|
||||
},
|
||||
addListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
removeListeners: function() {
|
||||
this.removeListeners_(this.target);
|
||||
},
|
||||
removeListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
addTransientObserver: function(node) {
|
||||
if (node === this.target) return;
|
||||
this.addListeners_(node);
|
||||
this.transientObservedNodes.push(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) registrationsTable.set(node, registrations = []);
|
||||
registrations.push(this);
|
||||
},
|
||||
removeTransientObservers: function() {
|
||||
var transientObservedNodes = this.transientObservedNodes;
|
||||
this.transientObservedNodes = [];
|
||||
transientObservedNodes.forEach(function(node) {
|
||||
this.removeListeners_(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i] === this) {
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
handleEvent: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
switch (e.type) {
|
||||
case "DOMAttrModified":
|
||||
var name = e.attrName;
|
||||
var namespace = e.relatedNode.namespaceURI;
|
||||
var target = e.target;
|
||||
var record = new getRecord("attributes", target);
|
||||
record.attributeName = name;
|
||||
record.attributeNamespace = namespace;
|
||||
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.attributes) return;
|
||||
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
|
||||
return;
|
||||
}
|
||||
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMCharacterDataModified":
|
||||
var target = e.target;
|
||||
var record = getRecord("characterData", target);
|
||||
var oldValue = e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.characterData) return;
|
||||
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMNodeRemoved":
|
||||
this.addTransientObserver(e.target);
|
||||
|
||||
case "DOMNodeInserted":
|
||||
var changedNode = e.target;
|
||||
var addedNodes, removedNodes;
|
||||
if (e.type === "DOMNodeInserted") {
|
||||
addedNodes = [ changedNode ];
|
||||
removedNodes = [];
|
||||
} else {
|
||||
addedNodes = [];
|
||||
removedNodes = [ changedNode ];
|
||||
}
|
||||
var previousSibling = changedNode.previousSibling;
|
||||
var nextSibling = changedNode.nextSibling;
|
||||
var record = getRecord("childList", e.target.parentNode);
|
||||
record.addedNodes = addedNodes;
|
||||
record.removedNodes = removedNodes;
|
||||
record.previousSibling = previousSibling;
|
||||
record.nextSibling = nextSibling;
|
||||
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
|
||||
if (!options.childList) return;
|
||||
return record;
|
||||
});
|
||||
}
|
||||
clearRecords();
|
||||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
})(window);
|
||||
|
||||
window.CustomElements = window.CustomElements || {
|
||||
flags: {}
|
||||
};
|
||||
|
||||
(function(scope) {
|
||||
var flags = scope.flags;
|
||||
var modules = [];
|
||||
var addModule = function(module) {
|
||||
modules.push(module);
|
||||
};
|
||||
var initializeModules = function() {
|
||||
modules.forEach(function(module) {
|
||||
module(scope);
|
||||
});
|
||||
};
|
||||
scope.addModule = addModule;
|
||||
scope.initializeModules = initializeModules;
|
||||
scope.hasNative = Boolean(document.registerElement);
|
||||
scope.isIE = /Trident/.test(navigator.userAgent);
|
||||
scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);
|
||||
})(window.CustomElements);
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none";
|
||||
function forSubtree(node, cb) {
|
||||
findAllElements(node, function(e) {
|
||||
if (cb(e)) {
|
||||
return true;
|
||||
}
|
||||
forRoots(e, cb);
|
||||
});
|
||||
forRoots(node, cb);
|
||||
}
|
||||
function findAllElements(node, find, data) {
|
||||
var e = node.firstElementChild;
|
||||
if (!e) {
|
||||
e = node.firstChild;
|
||||
while (e && e.nodeType !== Node.ELEMENT_NODE) {
|
||||
e = e.nextSibling;
|
||||
}
|
||||
}
|
||||
while (e) {
|
||||
if (find(e, data) !== true) {
|
||||
findAllElements(e, find, data);
|
||||
}
|
||||
e = e.nextElementSibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function forRoots(node, cb) {
|
||||
var root = node.shadowRoot;
|
||||
while (root) {
|
||||
forSubtree(root, cb);
|
||||
root = root.olderShadowRoot;
|
||||
}
|
||||
}
|
||||
function forDocumentTree(doc, cb) {
|
||||
_forDocumentTree(doc, cb, []);
|
||||
}
|
||||
function _forDocumentTree(doc, cb, processingDocuments) {
|
||||
doc = window.wrap(doc);
|
||||
if (processingDocuments.indexOf(doc) >= 0) {
|
||||
return;
|
||||
}
|
||||
processingDocuments.push(doc);
|
||||
var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]");
|
||||
for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {
|
||||
if (n.import) {
|
||||
_forDocumentTree(n.import, cb, processingDocuments);
|
||||
}
|
||||
}
|
||||
cb(doc);
|
||||
}
|
||||
scope.forDocumentTree = forDocumentTree;
|
||||
scope.forSubtree = forSubtree;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
var forSubtree = scope.forSubtree;
|
||||
var forDocumentTree = scope.forDocumentTree;
|
||||
function addedNode(node, isAttached) {
|
||||
return added(node, isAttached) || addedSubtree(node, isAttached);
|
||||
}
|
||||
function added(node, isAttached) {
|
||||
if (scope.upgrade(node, isAttached)) {
|
||||
return true;
|
||||
}
|
||||
if (isAttached) {
|
||||
attached(node);
|
||||
}
|
||||
}
|
||||
function addedSubtree(node, isAttached) {
|
||||
forSubtree(node, function(e) {
|
||||
if (added(e, isAttached)) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
||||
scope.hasPolyfillMutations = hasPolyfillMutations;
|
||||
var isPendingMutations = false;
|
||||
var pendingMutations = [];
|
||||
function deferMutation(fn) {
|
||||
pendingMutations.push(fn);
|
||||
if (!isPendingMutations) {
|
||||
isPendingMutations = true;
|
||||
setTimeout(takeMutations);
|
||||
}
|
||||
}
|
||||
function takeMutations() {
|
||||
isPendingMutations = false;
|
||||
var $p = pendingMutations;
|
||||
for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
|
||||
p();
|
||||
}
|
||||
pendingMutations = [];
|
||||
}
|
||||
function attached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
deferMutation(function() {
|
||||
_attached(element);
|
||||
});
|
||||
} else {
|
||||
_attached(element);
|
||||
}
|
||||
}
|
||||
function _attached(element) {
|
||||
if (element.__upgraded__ && !element.__attached) {
|
||||
element.__attached = true;
|
||||
if (element.attachedCallback) {
|
||||
element.attachedCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
function detachedNode(node) {
|
||||
detached(node);
|
||||
forSubtree(node, function(e) {
|
||||
detached(e);
|
||||
});
|
||||
}
|
||||
function detached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
deferMutation(function() {
|
||||
_detached(element);
|
||||
});
|
||||
} else {
|
||||
_detached(element);
|
||||
}
|
||||
}
|
||||
function _detached(element) {
|
||||
if (element.__upgraded__ && element.__attached) {
|
||||
element.__attached = false;
|
||||
if (element.detachedCallback) {
|
||||
element.detachedCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
function inDocument(element) {
|
||||
var p = element;
|
||||
var doc = window.wrap(document);
|
||||
while (p) {
|
||||
if (p == doc) {
|
||||
return true;
|
||||
}
|
||||
p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host;
|
||||
}
|
||||
}
|
||||
function watchShadow(node) {
|
||||
if (node.shadowRoot && !node.shadowRoot.__watched) {
|
||||
flags.dom && console.log("watching shadow-root for: ", node.localName);
|
||||
var root = node.shadowRoot;
|
||||
while (root) {
|
||||
observe(root);
|
||||
root = root.olderShadowRoot;
|
||||
}
|
||||
}
|
||||
}
|
||||
function handler(root, mutations) {
|
||||
if (flags.dom) {
|
||||
var mx = mutations[0];
|
||||
if (mx && mx.type === "childList" && mx.addedNodes) {
|
||||
if (mx.addedNodes) {
|
||||
var d = mx.addedNodes[0];
|
||||
while (d && d !== document && !d.host) {
|
||||
d = d.parentNode;
|
||||
}
|
||||
var u = d && (d.URL || d._URL || d.host && d.host.localName) || "";
|
||||
u = u.split("/?").shift().split("/").pop();
|
||||
}
|
||||
}
|
||||
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
||||
}
|
||||
var isAttached = inDocument(root);
|
||||
mutations.forEach(function(mx) {
|
||||
if (mx.type === "childList") {
|
||||
forEach(mx.addedNodes, function(n) {
|
||||
if (!n.localName) {
|
||||
return;
|
||||
}
|
||||
addedNode(n, isAttached);
|
||||
});
|
||||
forEach(mx.removedNodes, function(n) {
|
||||
if (!n.localName) {
|
||||
return;
|
||||
}
|
||||
detachedNode(n);
|
||||
});
|
||||
}
|
||||
});
|
||||
flags.dom && console.groupEnd();
|
||||
}
|
||||
function takeRecords(node) {
|
||||
node = window.wrap(node);
|
||||
if (!node) {
|
||||
node = window.wrap(document);
|
||||
}
|
||||
while (node.parentNode) {
|
||||
node = node.parentNode;
|
||||
}
|
||||
var observer = node.__observer;
|
||||
if (observer) {
|
||||
handler(node, observer.takeRecords());
|
||||
takeMutations();
|
||||
}
|
||||
}
|
||||
var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);
|
||||
function observe(inRoot) {
|
||||
if (inRoot.__observer) {
|
||||
return;
|
||||
}
|
||||
var observer = new MutationObserver(handler.bind(this, inRoot));
|
||||
observer.observe(inRoot, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
inRoot.__observer = observer;
|
||||
}
|
||||
function upgradeDocument(doc) {
|
||||
doc = window.wrap(doc);
|
||||
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
||||
var isMainDocument = doc === window.wrap(document);
|
||||
addedNode(doc, isMainDocument);
|
||||
observe(doc);
|
||||
flags.dom && console.groupEnd();
|
||||
}
|
||||
function upgradeDocumentTree(doc) {
|
||||
forDocumentTree(doc, upgradeDocument);
|
||||
}
|
||||
var originalCreateShadowRoot = Element.prototype.createShadowRoot;
|
||||
if (originalCreateShadowRoot) {
|
||||
Element.prototype.createShadowRoot = function() {
|
||||
var root = originalCreateShadowRoot.call(this);
|
||||
window.CustomElements.watchShadow(this);
|
||||
return root;
|
||||
};
|
||||
}
|
||||
scope.watchShadow = watchShadow;
|
||||
scope.upgradeDocumentTree = upgradeDocumentTree;
|
||||
scope.upgradeDocument = upgradeDocument;
|
||||
scope.upgradeSubtree = addedSubtree;
|
||||
scope.upgradeAll = addedNode;
|
||||
scope.attached = attached;
|
||||
scope.takeRecords = takeRecords;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
function upgrade(node, isAttached) {
|
||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||
var is = node.getAttribute("is");
|
||||
var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is);
|
||||
if (definition) {
|
||||
if (is && definition.tag == node.localName || !is && !definition.extends) {
|
||||
return upgradeWithDefinition(node, definition, isAttached);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function upgradeWithDefinition(element, definition, isAttached) {
|
||||
flags.upgrade && console.group("upgrade:", element.localName);
|
||||
if (definition.is) {
|
||||
element.setAttribute("is", definition.is);
|
||||
}
|
||||
implementPrototype(element, definition);
|
||||
element.__upgraded__ = true;
|
||||
created(element);
|
||||
if (isAttached) {
|
||||
scope.attached(element);
|
||||
}
|
||||
scope.upgradeSubtree(element, isAttached);
|
||||
flags.upgrade && console.groupEnd();
|
||||
return element;
|
||||
}
|
||||
function implementPrototype(element, definition) {
|
||||
if (Object.__proto__) {
|
||||
element.__proto__ = definition.prototype;
|
||||
} else {
|
||||
customMixin(element, definition.prototype, definition.native);
|
||||
element.__proto__ = definition.prototype;
|
||||
}
|
||||
}
|
||||
function customMixin(inTarget, inSrc, inNative) {
|
||||
var used = {};
|
||||
var p = inSrc;
|
||||
while (p !== inNative && p !== HTMLElement.prototype) {
|
||||
var keys = Object.getOwnPropertyNames(p);
|
||||
for (var i = 0, k; k = keys[i]; i++) {
|
||||
if (!used[k]) {
|
||||
Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));
|
||||
used[k] = 1;
|
||||
}
|
||||
}
|
||||
p = Object.getPrototypeOf(p);
|
||||
}
|
||||
}
|
||||
function created(element) {
|
||||
if (element.createdCallback) {
|
||||
element.createdCallback();
|
||||
}
|
||||
}
|
||||
scope.upgrade = upgrade;
|
||||
scope.upgradeWithDefinition = upgradeWithDefinition;
|
||||
scope.implementPrototype = implementPrototype;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var isIE = scope.isIE;
|
||||
var upgradeDocumentTree = scope.upgradeDocumentTree;
|
||||
var upgradeAll = scope.upgradeAll;
|
||||
var upgradeWithDefinition = scope.upgradeWithDefinition;
|
||||
var implementPrototype = scope.implementPrototype;
|
||||
var useNative = scope.useNative;
|
||||
function register(name, options) {
|
||||
var definition = options || {};
|
||||
if (!name) {
|
||||
throw new Error("document.registerElement: first argument `name` must not be empty");
|
||||
}
|
||||
if (name.indexOf("-") < 0) {
|
||||
throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'.");
|
||||
}
|
||||
if (isReservedTag(name)) {
|
||||
throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid.");
|
||||
}
|
||||
if (getRegisteredDefinition(name)) {
|
||||
throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered");
|
||||
}
|
||||
if (!definition.prototype) {
|
||||
definition.prototype = Object.create(HTMLElement.prototype);
|
||||
}
|
||||
definition.__name = name.toLowerCase();
|
||||
definition.lifecycle = definition.lifecycle || {};
|
||||
definition.ancestry = ancestry(definition.extends);
|
||||
resolveTagName(definition);
|
||||
resolvePrototypeChain(definition);
|
||||
overrideAttributeApi(definition.prototype);
|
||||
registerDefinition(definition.__name, definition);
|
||||
definition.ctor = generateConstructor(definition);
|
||||
definition.ctor.prototype = definition.prototype;
|
||||
definition.prototype.constructor = definition.ctor;
|
||||
if (scope.ready) {
|
||||
upgradeDocumentTree(document);
|
||||
}
|
||||
return definition.ctor;
|
||||
}
|
||||
function overrideAttributeApi(prototype) {
|
||||
if (prototype.setAttribute._polyfilled) {
|
||||
return;
|
||||
}
|
||||
var setAttribute = prototype.setAttribute;
|
||||
prototype.setAttribute = function(name, value) {
|
||||
changeAttribute.call(this, name, value, setAttribute);
|
||||
};
|
||||
var removeAttribute = prototype.removeAttribute;
|
||||
prototype.removeAttribute = function(name) {
|
||||
changeAttribute.call(this, name, null, removeAttribute);
|
||||
};
|
||||
prototype.setAttribute._polyfilled = true;
|
||||
}
|
||||
function changeAttribute(name, value, operation) {
|
||||
name = name.toLowerCase();
|
||||
var oldValue = this.getAttribute(name);
|
||||
operation.apply(this, arguments);
|
||||
var newValue = this.getAttribute(name);
|
||||
if (this.attributeChangedCallback && newValue !== oldValue) {
|
||||
this.attributeChangedCallback(name, oldValue, newValue);
|
||||
}
|
||||
}
|
||||
function isReservedTag(name) {
|
||||
for (var i = 0; i < reservedTagList.length; i++) {
|
||||
if (name === reservedTagList[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ];
|
||||
function ancestry(extnds) {
|
||||
var extendee = getRegisteredDefinition(extnds);
|
||||
if (extendee) {
|
||||
return ancestry(extendee.extends).concat([ extendee ]);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
function resolveTagName(definition) {
|
||||
var baseTag = definition.extends;
|
||||
for (var i = 0, a; a = definition.ancestry[i]; i++) {
|
||||
baseTag = a.is && a.tag;
|
||||
}
|
||||
definition.tag = baseTag || definition.__name;
|
||||
if (baseTag) {
|
||||
definition.is = definition.__name;
|
||||
}
|
||||
}
|
||||
function resolvePrototypeChain(definition) {
|
||||
if (!Object.__proto__) {
|
||||
var nativePrototype = HTMLElement.prototype;
|
||||
if (definition.is) {
|
||||
var inst = document.createElement(definition.tag);
|
||||
nativePrototype = Object.getPrototypeOf(inst);
|
||||
}
|
||||
var proto = definition.prototype, ancestor;
|
||||
var foundPrototype = false;
|
||||
while (proto) {
|
||||
if (proto == nativePrototype) {
|
||||
foundPrototype = true;
|
||||
}
|
||||
ancestor = Object.getPrototypeOf(proto);
|
||||
if (ancestor) {
|
||||
proto.__proto__ = ancestor;
|
||||
}
|
||||
proto = ancestor;
|
||||
}
|
||||
if (!foundPrototype) {
|
||||
console.warn(definition.tag + " prototype not found in prototype chain for " + definition.is);
|
||||
}
|
||||
definition.native = nativePrototype;
|
||||
}
|
||||
}
|
||||
function instantiate(definition) {
|
||||
return upgradeWithDefinition(domCreateElement(definition.tag), definition);
|
||||
}
|
||||
var registry = {};
|
||||
function getRegisteredDefinition(name) {
|
||||
if (name) {
|
||||
return registry[name.toLowerCase()];
|
||||
}
|
||||
}
|
||||
function registerDefinition(name, definition) {
|
||||
registry[name] = definition;
|
||||
}
|
||||
function generateConstructor(definition) {
|
||||
return function() {
|
||||
return instantiate(definition);
|
||||
};
|
||||
}
|
||||
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
||||
function createElementNS(namespace, tag, typeExtension) {
|
||||
if (namespace === HTML_NAMESPACE) {
|
||||
return createElement(tag, typeExtension);
|
||||
} else {
|
||||
return domCreateElementNS(namespace, tag);
|
||||
}
|
||||
}
|
||||
function createElement(tag, typeExtension) {
|
||||
if (tag) {
|
||||
tag = tag.toLowerCase();
|
||||
}
|
||||
if (typeExtension) {
|
||||
typeExtension = typeExtension.toLowerCase();
|
||||
}
|
||||
var definition = getRegisteredDefinition(typeExtension || tag);
|
||||
if (definition) {
|
||||
if (tag == definition.tag && typeExtension == definition.is) {
|
||||
return new definition.ctor();
|
||||
}
|
||||
if (!typeExtension && !definition.is) {
|
||||
return new definition.ctor();
|
||||
}
|
||||
}
|
||||
var element;
|
||||
if (typeExtension) {
|
||||
element = createElement(tag);
|
||||
element.setAttribute("is", typeExtension);
|
||||
return element;
|
||||
}
|
||||
element = domCreateElement(tag);
|
||||
if (tag.indexOf("-") >= 0) {
|
||||
implementPrototype(element, HTMLElement);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
var domCreateElement = document.createElement.bind(document);
|
||||
var domCreateElementNS = document.createElementNS.bind(document);
|
||||
var isInstance;
|
||||
if (!Object.__proto__ && !useNative) {
|
||||
isInstance = function(obj, ctor) {
|
||||
if (obj instanceof ctor) {
|
||||
return true;
|
||||
}
|
||||
var p = obj;
|
||||
while (p) {
|
||||
if (p === ctor.prototype) {
|
||||
return true;
|
||||
}
|
||||
p = p.__proto__;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
} else {
|
||||
isInstance = function(obj, base) {
|
||||
return obj instanceof base;
|
||||
};
|
||||
}
|
||||
function wrapDomMethodToForceUpgrade(obj, methodName) {
|
||||
var orig = obj[methodName];
|
||||
obj[methodName] = function() {
|
||||
var n = orig.apply(this, arguments);
|
||||
upgradeAll(n);
|
||||
return n;
|
||||
};
|
||||
}
|
||||
wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
|
||||
wrapDomMethodToForceUpgrade(document, "importNode");
|
||||
if (isIE) {
|
||||
(function() {
|
||||
var importNode = document.importNode;
|
||||
document.importNode = function() {
|
||||
var n = importNode.apply(document, arguments);
|
||||
if (n.nodeType == n.DOCUMENT_FRAGMENT_NODE) {
|
||||
var f = document.createDocumentFragment();
|
||||
f.appendChild(n);
|
||||
return f;
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
};
|
||||
})();
|
||||
}
|
||||
document.registerElement = register;
|
||||
document.createElement = createElement;
|
||||
document.createElementNS = createElementNS;
|
||||
scope.registry = registry;
|
||||
scope.instanceof = isInstance;
|
||||
scope.reservedTagList = reservedTagList;
|
||||
scope.getRegisteredDefinition = getRegisteredDefinition;
|
||||
document.register = document.registerElement;
|
||||
});
|
||||
|
||||
(function(scope) {
|
||||
var useNative = scope.useNative;
|
||||
var initializeModules = scope.initializeModules;
|
||||
var isIE = scope.isIE;
|
||||
if (useNative) {
|
||||
var nop = function() {};
|
||||
scope.watchShadow = nop;
|
||||
scope.upgrade = nop;
|
||||
scope.upgradeAll = nop;
|
||||
scope.upgradeDocumentTree = nop;
|
||||
scope.upgradeSubtree = nop;
|
||||
scope.takeRecords = nop;
|
||||
scope.instanceof = function(obj, base) {
|
||||
return obj instanceof base;
|
||||
};
|
||||
} else {
|
||||
initializeModules();
|
||||
}
|
||||
var upgradeDocumentTree = scope.upgradeDocumentTree;
|
||||
var upgradeDocument = scope.upgradeDocument;
|
||||
if (!window.wrap) {
|
||||
if (window.ShadowDOMPolyfill) {
|
||||
window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded;
|
||||
window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded;
|
||||
} else {
|
||||
window.wrap = window.unwrap = function(node) {
|
||||
return node;
|
||||
};
|
||||
}
|
||||
}
|
||||
if (window.HTMLImports) {
|
||||
window.HTMLImports.__importsParsingHook = function(elt) {
|
||||
if (elt.import) {
|
||||
upgradeDocument(wrap(elt.import));
|
||||
}
|
||||
};
|
||||
}
|
||||
function bootstrap() {
|
||||
upgradeDocumentTree(window.wrap(document));
|
||||
window.CustomElements.ready = true;
|
||||
var requestAnimationFrame = window.requestAnimationFrame || function(f) {
|
||||
setTimeout(f, 16);
|
||||
};
|
||||
requestAnimationFrame(function() {
|
||||
setTimeout(function() {
|
||||
window.CustomElements.readyTime = Date.now();
|
||||
if (window.HTMLImports) {
|
||||
window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime;
|
||||
}
|
||||
document.dispatchEvent(new CustomEvent("WebComponentsReady", {
|
||||
bubbles: true
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
e.preventDefault = function() {
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (document.readyState === "complete" || scope.flags.eager) {
|
||||
bootstrap();
|
||||
} else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
|
||||
bootstrap();
|
||||
} else {
|
||||
var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
|
||||
window.addEventListener(loadEvent, bootstrap);
|
||||
}
|
||||
})(window.CustomElements);
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
1090
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/HTMLImports.js
поставляемый
Normal file
1090
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/HTMLImports.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
11
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/HTMLImports.min.js
поставляемый
Normal file
11
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/HTMLImports.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
344
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/MutationObserver.js
поставляемый
Normal file
344
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/MutationObserver.js
поставляемый
Normal file
|
@ -0,0 +1,344 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
// @version 0.7.12
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
var counter = Date.now() % 1e9;
|
||||
var WeakMap = function() {
|
||||
this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
|
||||
};
|
||||
WeakMap.prototype = {
|
||||
set: function(key, value) {
|
||||
var entry = key[this.name];
|
||||
if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
|
||||
value: [ key, value ],
|
||||
writable: true
|
||||
});
|
||||
return this;
|
||||
},
|
||||
get: function(key) {
|
||||
var entry;
|
||||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
|
||||
},
|
||||
"delete": function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry || entry[0] !== key) return false;
|
||||
entry[0] = entry[1] = undefined;
|
||||
return true;
|
||||
},
|
||||
has: function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry) return false;
|
||||
return entry[0] === key;
|
||||
}
|
||||
};
|
||||
window.WeakMap = WeakMap;
|
||||
})();
|
||||
}
|
||||
|
||||
(function(global) {
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
setImmediate = setTimeout;
|
||||
} else if (window.setImmediate) {
|
||||
setImmediate = window.setImmediate;
|
||||
} else {
|
||||
var setImmediateQueue = [];
|
||||
var sentinel = String(Math.random());
|
||||
window.addEventListener("message", function(e) {
|
||||
if (e.data === sentinel) {
|
||||
var queue = setImmediateQueue;
|
||||
setImmediateQueue = [];
|
||||
queue.forEach(function(func) {
|
||||
func();
|
||||
});
|
||||
}
|
||||
});
|
||||
setImmediate = function(func) {
|
||||
setImmediateQueue.push(func);
|
||||
window.postMessage(sentinel, "*");
|
||||
};
|
||||
}
|
||||
var isScheduled = false;
|
||||
var scheduledObservers = [];
|
||||
function scheduleCallback(observer) {
|
||||
scheduledObservers.push(observer);
|
||||
if (!isScheduled) {
|
||||
isScheduled = true;
|
||||
setImmediate(dispatchCallbacks);
|
||||
}
|
||||
}
|
||||
function wrapIfNeeded(node) {
|
||||
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
|
||||
}
|
||||
function dispatchCallbacks() {
|
||||
isScheduled = false;
|
||||
var observers = scheduledObservers;
|
||||
scheduledObservers = [];
|
||||
observers.sort(function(o1, o2) {
|
||||
return o1.uid_ - o2.uid_;
|
||||
});
|
||||
var anyNonEmpty = false;
|
||||
observers.forEach(function(observer) {
|
||||
var queue = observer.takeRecords();
|
||||
removeTransientObserversFor(observer);
|
||||
if (queue.length) {
|
||||
observer.callback_(queue, observer);
|
||||
anyNonEmpty = true;
|
||||
}
|
||||
});
|
||||
if (anyNonEmpty) dispatchCallbacks();
|
||||
}
|
||||
function removeTransientObserversFor(observer) {
|
||||
observer.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) return;
|
||||
registrations.forEach(function(registration) {
|
||||
if (registration.observer === observer) registration.removeTransientObservers();
|
||||
});
|
||||
});
|
||||
}
|
||||
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
|
||||
for (var node = target; node; node = node.parentNode) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (registrations) {
|
||||
for (var j = 0; j < registrations.length; j++) {
|
||||
var registration = registrations[j];
|
||||
var options = registration.options;
|
||||
if (node !== target && !options.subtree) continue;
|
||||
var record = callback(options);
|
||||
if (record) registration.enqueue(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var uidCounter = 0;
|
||||
function JsMutationObserver(callback) {
|
||||
this.callback_ = callback;
|
||||
this.nodes_ = [];
|
||||
this.records_ = [];
|
||||
this.uid_ = ++uidCounter;
|
||||
}
|
||||
JsMutationObserver.prototype = {
|
||||
observe: function(target, options) {
|
||||
target = wrapIfNeeded(target);
|
||||
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
|
||||
throw new SyntaxError();
|
||||
}
|
||||
var registrations = registrationsTable.get(target);
|
||||
if (!registrations) registrationsTable.set(target, registrations = []);
|
||||
var registration;
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i].observer === this) {
|
||||
registration = registrations[i];
|
||||
registration.removeListeners();
|
||||
registration.options = options;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!registration) {
|
||||
registration = new Registration(this, target, options);
|
||||
registrations.push(registration);
|
||||
this.nodes_.push(target);
|
||||
}
|
||||
registration.addListeners();
|
||||
},
|
||||
disconnect: function() {
|
||||
this.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
var registration = registrations[i];
|
||||
if (registration.observer === this) {
|
||||
registration.removeListeners();
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
this.records_ = [];
|
||||
},
|
||||
takeRecords: function() {
|
||||
var copyOfRecords = this.records_;
|
||||
this.records_ = [];
|
||||
return copyOfRecords;
|
||||
}
|
||||
};
|
||||
function MutationRecord(type, target) {
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.addedNodes = [];
|
||||
this.removedNodes = [];
|
||||
this.previousSibling = null;
|
||||
this.nextSibling = null;
|
||||
this.attributeName = null;
|
||||
this.attributeNamespace = null;
|
||||
this.oldValue = null;
|
||||
}
|
||||
function copyMutationRecord(original) {
|
||||
var record = new MutationRecord(original.type, original.target);
|
||||
record.addedNodes = original.addedNodes.slice();
|
||||
record.removedNodes = original.removedNodes.slice();
|
||||
record.previousSibling = original.previousSibling;
|
||||
record.nextSibling = original.nextSibling;
|
||||
record.attributeName = original.attributeName;
|
||||
record.attributeNamespace = original.attributeNamespace;
|
||||
record.oldValue = original.oldValue;
|
||||
return record;
|
||||
}
|
||||
var currentRecord, recordWithOldValue;
|
||||
function getRecord(type, target) {
|
||||
return currentRecord = new MutationRecord(type, target);
|
||||
}
|
||||
function getRecordWithOldValue(oldValue) {
|
||||
if (recordWithOldValue) return recordWithOldValue;
|
||||
recordWithOldValue = copyMutationRecord(currentRecord);
|
||||
recordWithOldValue.oldValue = oldValue;
|
||||
return recordWithOldValue;
|
||||
}
|
||||
function clearRecords() {
|
||||
currentRecord = recordWithOldValue = undefined;
|
||||
}
|
||||
function recordRepresentsCurrentMutation(record) {
|
||||
return record === recordWithOldValue || record === currentRecord;
|
||||
}
|
||||
function selectRecord(lastRecord, newRecord) {
|
||||
if (lastRecord === newRecord) return lastRecord;
|
||||
if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
|
||||
return null;
|
||||
}
|
||||
function Registration(observer, target, options) {
|
||||
this.observer = observer;
|
||||
this.target = target;
|
||||
this.options = options;
|
||||
this.transientObservedNodes = [];
|
||||
}
|
||||
Registration.prototype = {
|
||||
enqueue: function(record) {
|
||||
var records = this.observer.records_;
|
||||
var length = records.length;
|
||||
if (records.length > 0) {
|
||||
var lastRecord = records[length - 1];
|
||||
var recordToReplaceLast = selectRecord(lastRecord, record);
|
||||
if (recordToReplaceLast) {
|
||||
records[length - 1] = recordToReplaceLast;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
scheduleCallback(this.observer);
|
||||
}
|
||||
records[length] = record;
|
||||
},
|
||||
addListeners: function() {
|
||||
this.addListeners_(this.target);
|
||||
},
|
||||
addListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
removeListeners: function() {
|
||||
this.removeListeners_(this.target);
|
||||
},
|
||||
removeListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
addTransientObserver: function(node) {
|
||||
if (node === this.target) return;
|
||||
this.addListeners_(node);
|
||||
this.transientObservedNodes.push(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) registrationsTable.set(node, registrations = []);
|
||||
registrations.push(this);
|
||||
},
|
||||
removeTransientObservers: function() {
|
||||
var transientObservedNodes = this.transientObservedNodes;
|
||||
this.transientObservedNodes = [];
|
||||
transientObservedNodes.forEach(function(node) {
|
||||
this.removeListeners_(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i] === this) {
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
handleEvent: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
switch (e.type) {
|
||||
case "DOMAttrModified":
|
||||
var name = e.attrName;
|
||||
var namespace = e.relatedNode.namespaceURI;
|
||||
var target = e.target;
|
||||
var record = new getRecord("attributes", target);
|
||||
record.attributeName = name;
|
||||
record.attributeNamespace = namespace;
|
||||
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.attributes) return;
|
||||
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
|
||||
return;
|
||||
}
|
||||
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMCharacterDataModified":
|
||||
var target = e.target;
|
||||
var record = getRecord("characterData", target);
|
||||
var oldValue = e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.characterData) return;
|
||||
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMNodeRemoved":
|
||||
this.addTransientObserver(e.target);
|
||||
|
||||
case "DOMNodeInserted":
|
||||
var changedNode = e.target;
|
||||
var addedNodes, removedNodes;
|
||||
if (e.type === "DOMNodeInserted") {
|
||||
addedNodes = [ changedNode ];
|
||||
removedNodes = [];
|
||||
} else {
|
||||
addedNodes = [];
|
||||
removedNodes = [ changedNode ];
|
||||
}
|
||||
var previousSibling = changedNode.previousSibling;
|
||||
var nextSibling = changedNode.nextSibling;
|
||||
var record = getRecord("childList", e.target.parentNode);
|
||||
record.addedNodes = addedNodes;
|
||||
record.removedNodes = removedNodes;
|
||||
record.previousSibling = previousSibling;
|
||||
record.nextSibling = nextSibling;
|
||||
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
|
||||
if (!options.childList) return;
|
||||
return record;
|
||||
});
|
||||
}
|
||||
clearRecords();
|
||||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
})(window);
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
125
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/README.md
поставляемый
Normal file
125
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/README.md
поставляемый
Normal file
|
@ -0,0 +1,125 @@
|
|||
webcomponents.js
|
||||
================
|
||||
|
||||
[![Join the chat at https://gitter.im/webcomponents/webcomponentsjs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/webcomponents/webcomponentsjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
A suite of polyfills supporting the [Web Components](http://webcomponents.org) specs:
|
||||
|
||||
**Custom Elements**: allows authors to define their own custom tags ([spec](https://w3c.github.io/webcomponents/spec/custom/)).
|
||||
|
||||
**HTML Imports**: a way to include and reuse HTML documents via other HTML documents ([spec](https://w3c.github.io/webcomponents/spec/imports/)).
|
||||
|
||||
**Shadow DOM**: provides encapsulation by hiding DOM subtrees under shadow roots ([spec](https://w3c.github.io/webcomponents/spec/shadow/)).
|
||||
|
||||
This also folds in polyfills for `MutationObserver` and `WeakMap`.
|
||||
|
||||
|
||||
## Releases
|
||||
|
||||
Pre-built (concatenated & minified) versions of the polyfills are maintained in the [tagged versions](https://github.com/webcomponents/webcomponentsjs/releases) of this repo. There are two variants:
|
||||
|
||||
`webcomponents.js` includes all of the polyfills.
|
||||
|
||||
`webcomponents-lite.js` includes all polyfills except for shadow DOM.
|
||||
|
||||
|
||||
## Browser Support
|
||||
|
||||
Our polyfills are intended to work in the latest versions of evergreen browsers. See below
|
||||
for our complete browser support matrix:
|
||||
|
||||
| Polyfill | IE10 | IE11+ | Chrome* | Firefox* | Safari 7+* | Chrome Android* | Mobile Safari* |
|
||||
| ---------- |:----:|:-----:|:-------:|:--------:|:----------:|:---------------:|:--------------:|
|
||||
| Custom Elements | ~ | ✓ | ✓ | ✓ | ✓ | ✓| ✓ |
|
||||
| HTML Imports | ~ | ✓ | ✓ | ✓ | ✓| ✓| ✓ |
|
||||
| Shadow DOM | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Templates | ✓ | ✓ | ✓ | ✓| ✓ | ✓ | ✓ |
|
||||
|
||||
|
||||
*Indicates the current version of the browser
|
||||
|
||||
~Indicates support may be flaky. If using Custom Elements or HTML Imports with Shadow DOM,
|
||||
you will get the non-flaky Mutation Observer polyfill that Shadow DOM includes.
|
||||
|
||||
The polyfills may work in older browsers, however require additional polyfills (such as classList)
|
||||
to be used. We cannot guarantee support for browsers outside of our compatibility matrix.
|
||||
|
||||
|
||||
### Manually Building
|
||||
|
||||
If you wish to build the polyfills yourself, you'll need `node` and `gulp` on your system:
|
||||
|
||||
* install [node.js](http://nodejs.org/) using the instructions on their website
|
||||
* use `npm` to install [gulp.js](http://gulpjs.com/): `npm install -g gulp`
|
||||
|
||||
Now you are ready to build the polyfills with:
|
||||
|
||||
# install dependencies
|
||||
npm install
|
||||
# build
|
||||
gulp build
|
||||
|
||||
The builds will be placed into the `dist/` directory.
|
||||
|
||||
## Contribute
|
||||
|
||||
See the [contributing guide](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
Everything in this repository is BSD style license unless otherwise specified.
|
||||
|
||||
Copyright (c) 2015 The Polymer Authors. All rights reserved.
|
||||
|
||||
## Helper utilities
|
||||
|
||||
### `WebComponentsReady`
|
||||
|
||||
Under native HTML Imports, `<script>` tags in the main document block the loading of such imports. This is to ensure the imports have loaded and any registered elements in them have been upgraded.
|
||||
|
||||
The webcomponents.js and webcomponents-lite.js polyfills parse element definitions and handle their upgrade asynchronously. If prematurely fetching the element from the DOM before it has an opportunity to upgrade, you'll be working with an `HTMLUnknownElement`.
|
||||
|
||||
For these situations (or when you need an approximate replacement for the Polymer 0.5 `polymer-ready` behavior), you can use the `WebComponentsReady` event as a signal before interacting with the element. The criteria for this event to fire is all Custom Elements with definitions registered by the time HTML Imports available at load time have loaded have upgraded.
|
||||
|
||||
```js
|
||||
window.addEventListener('WebComponentsReady', function(e) {
|
||||
// imports are loaded and elements have been registered
|
||||
console.log('Components are ready');
|
||||
});
|
||||
```
|
||||
|
||||
## Known Issues
|
||||
|
||||
* [Custom element's constructor property is unreliable](#constructor)
|
||||
* [Contenteditable elements do not trigger MutationObserver](#contentedit)
|
||||
* [ShadowCSS: :host-context(...):host(...) doesn't work](#hostcontext)
|
||||
* [execCommand isn't supported under Shadow DOM](#execcommand)
|
||||
|
||||
### Custom element's constructor property is unreliable <a id="constructor"></a>
|
||||
See [#215](https://github.com/webcomponents/webcomponentsjs/issues/215) for background.
|
||||
|
||||
In Safari and IE, instances of Custom Elements have a `constructor` property of `HTMLUnknownElementConstructor` and `HTMLUnknownElement`, respectively. It's unsafe to rely on this property for checking element types.
|
||||
|
||||
It's worth noting that `customElement.__proto__.__proto__.constructor` is `HTMLElementPrototype` and that the prototype chain isn't modified by the polyfills(onto `ElementPrototype`, etc.)
|
||||
|
||||
### Contenteditable elements do not trigger MutationObserver <a id="contentedit"></a>
|
||||
Using the MutationObserver polyfill, it isn't possible to monitor mutations of an element marked `contenteditable`.
|
||||
See [the mailing list](https://groups.google.com/forum/#!msg/polymer-dev/LHdtRVXXVsA/v1sGoiTYWUkJ)
|
||||
|
||||
### ShadowCSS: :host-context(...):host(...) doesn't work <a id="hostcontext"></a>
|
||||
See [#16](https://github.com/webcomponents/webcomponentsjs/issues/16) for background.
|
||||
|
||||
Under the shadow DOM polyfill, rules like:
|
||||
```
|
||||
:host-context(.foo):host(.bar) {...}
|
||||
```
|
||||
don't work, despite working under native Shadow DOM. The solution is to use `polyfill-next-selector` like:
|
||||
|
||||
```
|
||||
polyfill-next-selector { content: '.foo :host.bar, :host.foo.bar'; }
|
||||
```
|
||||
|
||||
### execCommand and contenteditable isn't supported under Shadow DOM <a id="execcommand"></a>
|
||||
See [#212](https://github.com/webcomponents/webcomponentsjs/issues/212)
|
||||
|
||||
`execCommand`, and `contenteditable` aren't supported under the ShadowDOM polyfill, with commands that insert or remove nodes being especially prone to failure.
|
4414
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/ShadowDOM.js
поставляемый
Normal file
4414
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/ShadowDOM.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
15
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/ShadowDOM.min.js
поставляемый
Normal file
15
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/ShadowDOM.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
18
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/bower.json
поставляемый
Normal file
18
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/bower.json
поставляемый
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.12",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"webcomponents"
|
||||
],
|
||||
"license": "BSD",
|
||||
"ignore": []
|
||||
}
|
31
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/package.json
поставляемый
Normal file
31
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/package.json
поставляемый
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"name": "webcomponents.js",
|
||||
"version": "0.7.12",
|
||||
"description": "webcomponents.js",
|
||||
"main": "webcomponents.js",
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"author": "The Polymer Authors",
|
||||
"license": {
|
||||
"type": "BSD-3-Clause",
|
||||
"url": "http://polymer.github.io/LICENSE.txt"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs/issues"
|
||||
},
|
||||
"homepage": "http://webcomponents.org",
|
||||
"devDependencies": {
|
||||
"gulp": "^3.8.8",
|
||||
"gulp-audit": "^1.0.0",
|
||||
"gulp-concat": "^2.4.1",
|
||||
"gulp-header": "^1.1.1",
|
||||
"gulp-uglify": "^1.0.1",
|
||||
"run-sequence": "^1.0.1",
|
||||
"web-component-tester": "*"
|
||||
}
|
||||
}
|
2376
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents-lite.js
поставляемый
Normal file
2376
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents-lite.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
7112
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents.js
поставляемый
Normal file
7112
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
15
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents.min.js
поставляемый
Normal file
15
q3-2015/data.driven.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
336
q3-2015/data.driven.deliveries/bower_components/emoji-rain/emoji-rain.html
поставляемый
Normal file
336
q3-2015/data.driven.deliveries/bower_components/emoji-rain/emoji-rain.html
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,137 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta content='emoji-rain' name='title' />
|
||||
<title>emoji-rain</title>
|
||||
<meta content='width=460' name='viewport'>
|
||||
<meta content='text/html; charset=utf-8' http-equiv='content-type' />
|
||||
<link href='http://fonts.googleapis.com/css?family=Lato:300,400' rel='stylesheet' type='text/css'>
|
||||
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="bower_components/polymer/polymer.html">
|
||||
<link rel="import" href="emoji-rain.html">
|
||||
</head>
|
||||
<body>
|
||||
<emoji-rain id="rainmaker" drops="350"></emoji-rain>
|
||||
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>What is this even</h1>
|
||||
<p>This is a Polymer element that you can drop on any web page and make it rain emoji.
|
||||
Because, seriously, why wouldn't you?
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<button onclick="rain(this, false)" id="button-rain">Make it rain!</button>
|
||||
<input id="use-twemoji" type="checkbox" onclick="twemojiChanged(event)">
|
||||
<span class="big">with Twitter emoji</span>
|
||||
</section>
|
||||
|
||||
<div id="footer">
|
||||
<p>made with <span style="color: #E91E63">❤︎</span> by <a href="https://twitter.com/notwaldorf">monica</a>.
|
||||
find this on <a href="https://github.com/notwaldorf/emoji-rain">github</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<style>
|
||||
|
||||
body {
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
font-weight: 300;
|
||||
background: #fff;
|
||||
color: #535353;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 50px;
|
||||
overflow: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
section {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
margin-top: 50px;
|
||||
padding-top: 20px;
|
||||
border-top: 2px solid #E91E63;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
h1, button, .big {
|
||||
font-family: 'Lato', 'Helvetica', Arial, sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
#footer p {
|
||||
text-transform: uppercase;
|
||||
font-size: 10px;
|
||||
letter-spacing: .2em;
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
a:link, a:visited, button {
|
||||
color: #E91E63;
|
||||
text-decoration: none;
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
background: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
outline:none;
|
||||
}
|
||||
|
||||
a:hover, button:hover, a:focus, button:focus {
|
||||
background-color: #E91E63;
|
||||
color: white;
|
||||
border-radius: 3px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: #F4FF81;
|
||||
}
|
||||
|
||||
#use-twemoji {
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
var rainmaker = document.getElementById('rainmaker');
|
||||
|
||||
function rain(button) {
|
||||
if (rainmaker.active) {
|
||||
rainmaker.stop();
|
||||
button.innerHTML = "Make it rain!";
|
||||
} else {
|
||||
rainmaker.start();
|
||||
button.innerHTML = "OMG stop the rain!";
|
||||
}
|
||||
}
|
||||
|
||||
function twemojiChanged(event) {
|
||||
rainmaker.useTwemoji = event.target.checked;
|
||||
}
|
||||
</script>
|
||||
</html>
|
121
q3-2015/data.driven.deliveries/bower_components/emoji-rain/test/basic.html
поставляемый
Normal file
121
q3-2015/data.driven.deliveries/bower_components/emoji-rain/test/basic.html
поставляемый
Normal file
|
@ -0,0 +1,121 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>emoji-rain tests</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../emoji-rain.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<emoji-rain drops="2"></emoji-rain>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('basic', function() {
|
||||
test('generates as many emoji as told', function() {
|
||||
var rain = fixture('basic');
|
||||
expect(rain.dropsForDrawing.length).to.be.eql(2);
|
||||
|
||||
// Both should have a character
|
||||
expect(rain.dropsForDrawing[0].code).to.be.ok;
|
||||
expect(rain.dropsForDrawing[1].code).to.be.ok;
|
||||
|
||||
// Neither should have twemoji images
|
||||
expect(rain.dropsForDrawing[0].img).to.be.not.ok;
|
||||
expect(rain.dropsForDrawing[1].img).to.be.not.ok;
|
||||
});
|
||||
|
||||
test('it can rain', function(done) {
|
||||
var rain = fixture('basic');
|
||||
rain.addEventListener('emoji-rain-start', function() {
|
||||
expect(rain.active).to.be.eql(true);
|
||||
done();
|
||||
});
|
||||
rain.start();
|
||||
});
|
||||
|
||||
test('it can stop raining', function(done) {
|
||||
var rain = fixture('basic');
|
||||
rain.addEventListener('emoji-rain-start', function() {
|
||||
expect(rain.active).to.be.eql(true);
|
||||
rain.stop();
|
||||
});
|
||||
rain.addEventListener('emoji-rain-stop', function() {
|
||||
expect(rain.active).to.be.eql(false);
|
||||
done();
|
||||
});
|
||||
rain.start();
|
||||
});
|
||||
});
|
||||
|
||||
suite('twemoji', function() {
|
||||
test('does not load twemoji by default', function() {
|
||||
var rain = fixture('basic');
|
||||
expect(rain.useTwemoji).to.be.eql(false);
|
||||
expect(rain.importedTwemoji).to.be.not.ok;
|
||||
});
|
||||
|
||||
test('loads twemoji on demand', function(done) {
|
||||
var rain = fixture('basic');
|
||||
expect(rain.useTwemoji).to.be.eql(false);
|
||||
expect(rain.importedTwemoji).to.be.not.ok;
|
||||
|
||||
rain.addEventListener('emoji-rain-twemoji-ready', function() {
|
||||
setTimeout(function() {
|
||||
expect(rain.useTwemoji).to.be.eql(true);
|
||||
expect(rain.importedTwemoji).to.be.eql(true);
|
||||
expect(rain.active).to.be.eql(false);
|
||||
|
||||
expect(rain.dropsForDrawing.length).to.be.eql(2);
|
||||
|
||||
// Both should have a character
|
||||
expect(rain.dropsForDrawing[0].code).to.be.ok;
|
||||
expect(rain.dropsForDrawing[1].code).to.be.ok;
|
||||
|
||||
// Noth should have twemoji images
|
||||
expect(rain.dropsForDrawing[0].img).to.be.ok;
|
||||
expect(rain.dropsForDrawing[1].img).to.be.ok;
|
||||
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
rain.useTwemoji = true;
|
||||
});
|
||||
|
||||
test('raining continues after loading twemoji', function() {
|
||||
var rain = fixture('basic');
|
||||
rain.start();
|
||||
expect(rain.useTwemoji).to.be.eql(false);
|
||||
expect(rain.importedTwemoji).to.be.not.ok;
|
||||
|
||||
rain.addEventListener('emoji-rain-twemoji-ready', function() {
|
||||
setTimeout(function() {
|
||||
expect(rain.useTwemoji).to.be.eql(true);
|
||||
expect(rain.importedTwemoji).to.be.eql(true);
|
||||
expect(rain.active).to.be.eql(true);
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
rain.useTwemoji = true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
23
q3-2015/data.driven.deliveries/bower_components/emoji-rain/test/index.html
поставляемый
Normal file
23
q3-2015/data.driven.deliveries/bower_components/emoji-rain/test/index.html
поставляемый
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'basic.html'
|
||||
]);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
11
q3-2015/data.driven.deliveries/bower_components/emoji-rain/twemoji-script-holder.html
поставляемый
Normal file
11
q3-2015/data.driven.deliveries/bower_components/emoji-rain/twemoji-script-holder.html
поставляемый
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<!-- Holds the script for async loading -->
|
||||
<script src="https://twemoji.maxcdn.com/twemoji.min.js"></script>
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "everlive",
|
||||
"version": "1.5.6",
|
||||
"main": "min/everlive.all.min.js",
|
||||
"ignore": [
|
||||
"bower.json",
|
||||
"readme",
|
||||
"license",
|
||||
"README.md"
|
||||
],
|
||||
"homepage": "https://github.com/telerik/backend-services-js-sdk",
|
||||
"_release": "1.5.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.5.6",
|
||||
"commit": "fb1427b0c3d257dae2c1bb0eba1d50e145152549"
|
||||
},
|
||||
"_source": "git://github.com/telerik/backend-services-js-sdk.git",
|
||||
"_target": "~1.5.6",
|
||||
"_originalSource": "everlive",
|
||||
"_direct": true
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
* -crlf
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "everlive",
|
||||
"version": "1.5.6",
|
||||
"main": "min/everlive.all.min.js",
|
||||
"ignore": [
|
||||
"bower.json",
|
||||
"readme",
|
||||
"license",
|
||||
"README.md"
|
||||
]
|
||||
}
|
176
q3-2015/data.driven.deliveries/bower_components/everlive/min/everlive.all.min.js
поставляемый
Normal file
176
q3-2015/data.driven.deliveries/bower_components/everlive/min/everlive.all.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
28393
q3-2015/data.driven.deliveries/bower_components/everlive/src/everlive.all.js
поставляемый
Normal file
28393
q3-2015/data.driven.deliveries/bower_components/everlive/src/everlive.all.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
211
q3-2015/data.driven.deliveries/bower_components/everlive/src/everlive.all.map
поставляемый
Normal file
211
q3-2015/data.driven.deliveries/bower_components/everlive/src/everlive.all.map
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.2.1",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"ignore": [
|
||||
"/.*",
|
||||
"/test/",
|
||||
"gen-changelog.sh"
|
||||
],
|
||||
"authors": [
|
||||
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Polymer/polymer.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"webcomponentsjs": "^0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"private": true,
|
||||
"homepage": "https://github.com/Polymer/polymer",
|
||||
"_release": "1.2.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.2.1",
|
||||
"commit": "be2d57a329244735ca7aac34ac56c96b6270ae79"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/polymer.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "Polymer/polymer"
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) 2014 The Polymer Authors. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.2.1",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"ignore": [
|
||||
"/.*",
|
||||
"/test/",
|
||||
"gen-changelog.sh"
|
||||
],
|
||||
"authors": [
|
||||
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Polymer/polymer.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"webcomponentsjs": "^0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"private": true
|
||||
}
|
598
q3-2015/data.driven.deliveries/bower_components/polymer/polymer-micro.html
поставляемый
Normal file
598
q3-2015/data.driven.deliveries/bower_components/polymer/polymer-micro.html
поставляемый
Normal file
|
@ -0,0 +1,598 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
--><script>(function () {
|
||||
function resolve() {
|
||||
document.body.removeAttribute('unresolved');
|
||||
}
|
||||
if (window.WebComponents) {
|
||||
addEventListener('WebComponentsReady', resolve);
|
||||
} else {
|
||||
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
||||
resolve();
|
||||
} else {
|
||||
addEventListener('DOMContentLoaded', resolve);
|
||||
}
|
||||
}
|
||||
}());
|
||||
window.Polymer = {
|
||||
Settings: function () {
|
||||
var user = window.Polymer || {};
|
||||
location.search.slice(1).split('&').forEach(function (o) {
|
||||
o = o.split('=');
|
||||
o[0] && (user[o[0]] = o[1] || true);
|
||||
});
|
||||
var wantShadow = user.dom === 'shadow';
|
||||
var hasShadow = Boolean(Element.prototype.createShadowRoot);
|
||||
var nativeShadow = hasShadow && !window.ShadowDOMPolyfill;
|
||||
var useShadow = wantShadow && hasShadow;
|
||||
var hasNativeImports = Boolean('import' in document.createElement('link'));
|
||||
var useNativeImports = hasNativeImports;
|
||||
var useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
|
||||
return {
|
||||
wantShadow: wantShadow,
|
||||
hasShadow: hasShadow,
|
||||
nativeShadow: nativeShadow,
|
||||
useShadow: useShadow,
|
||||
useNativeShadow: useShadow && nativeShadow,
|
||||
useNativeImports: useNativeImports,
|
||||
useNativeCustomElements: useNativeCustomElements
|
||||
};
|
||||
}()
|
||||
};
|
||||
(function () {
|
||||
var userPolymer = window.Polymer;
|
||||
window.Polymer = function (prototype) {
|
||||
if (typeof prototype === 'function') {
|
||||
prototype = prototype.prototype;
|
||||
}
|
||||
if (!prototype) {
|
||||
prototype = {};
|
||||
}
|
||||
var factory = desugar(prototype);
|
||||
prototype = factory.prototype;
|
||||
var options = { prototype: prototype };
|
||||
if (prototype.extends) {
|
||||
options.extends = prototype.extends;
|
||||
}
|
||||
Polymer.telemetry._registrate(prototype);
|
||||
document.registerElement(prototype.is, options);
|
||||
return factory;
|
||||
};
|
||||
var desugar = function (prototype) {
|
||||
var base = Polymer.Base;
|
||||
if (prototype.extends) {
|
||||
base = Polymer.Base._getExtendedPrototype(prototype.extends);
|
||||
}
|
||||
prototype = Polymer.Base.chainObject(prototype, base);
|
||||
prototype.registerCallback();
|
||||
return prototype.constructor;
|
||||
};
|
||||
window.Polymer = Polymer;
|
||||
if (userPolymer) {
|
||||
for (var i in userPolymer) {
|
||||
Polymer[i] = userPolymer[i];
|
||||
}
|
||||
}
|
||||
Polymer.Class = desugar;
|
||||
}());
|
||||
Polymer.telemetry = {
|
||||
registrations: [],
|
||||
_regLog: function (prototype) {
|
||||
console.log('[' + prototype.is + ']: registered');
|
||||
},
|
||||
_registrate: function (prototype) {
|
||||
this.registrations.push(prototype);
|
||||
Polymer.log && this._regLog(prototype);
|
||||
},
|
||||
dumpRegistrations: function () {
|
||||
this.registrations.forEach(this._regLog);
|
||||
}
|
||||
};
|
||||
Object.defineProperty(window, 'currentImport', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: function () {
|
||||
return (document._currentScript || document.currentScript).ownerDocument;
|
||||
}
|
||||
});
|
||||
Polymer.RenderStatus = {
|
||||
_ready: false,
|
||||
_callbacks: [],
|
||||
whenReady: function (cb) {
|
||||
if (this._ready) {
|
||||
cb();
|
||||
} else {
|
||||
this._callbacks.push(cb);
|
||||
}
|
||||
},
|
||||
_makeReady: function () {
|
||||
this._ready = true;
|
||||
this._callbacks.forEach(function (cb) {
|
||||
cb();
|
||||
});
|
||||
this._callbacks = [];
|
||||
},
|
||||
_catchFirstRender: function () {
|
||||
requestAnimationFrame(function () {
|
||||
Polymer.RenderStatus._makeReady();
|
||||
});
|
||||
}
|
||||
};
|
||||
if (window.HTMLImports) {
|
||||
HTMLImports.whenReady(function () {
|
||||
Polymer.RenderStatus._catchFirstRender();
|
||||
});
|
||||
} else {
|
||||
Polymer.RenderStatus._catchFirstRender();
|
||||
}
|
||||
Polymer.ImportStatus = Polymer.RenderStatus;
|
||||
Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;
|
||||
Polymer.Base = {
|
||||
__isPolymerInstance__: true,
|
||||
_addFeature: function (feature) {
|
||||
this.extend(this, feature);
|
||||
},
|
||||
registerCallback: function () {
|
||||
this._desugarBehaviors();
|
||||
this._doBehavior('beforeRegister');
|
||||
this._registerFeatures();
|
||||
this._doBehavior('registered');
|
||||
},
|
||||
createdCallback: function () {
|
||||
Polymer.telemetry.instanceCount++;
|
||||
this.root = this;
|
||||
this._doBehavior('created');
|
||||
this._initFeatures();
|
||||
},
|
||||
attachedCallback: function () {
|
||||
Polymer.RenderStatus.whenReady(function () {
|
||||
this.isAttached = true;
|
||||
this._doBehavior('attached');
|
||||
}.bind(this));
|
||||
},
|
||||
detachedCallback: function () {
|
||||
this.isAttached = false;
|
||||
this._doBehavior('detached');
|
||||
},
|
||||
attributeChangedCallback: function (name) {
|
||||
this._attributeChangedImpl(name);
|
||||
this._doBehavior('attributeChanged', arguments);
|
||||
},
|
||||
_attributeChangedImpl: function (name) {
|
||||
this._setAttributeToProperty(this, name);
|
||||
},
|
||||
extend: function (prototype, api) {
|
||||
if (prototype && api) {
|
||||
Object.getOwnPropertyNames(api).forEach(function (n) {
|
||||
this.copyOwnProperty(n, api, prototype);
|
||||
}, this);
|
||||
}
|
||||
return prototype || api;
|
||||
},
|
||||
mixin: function (target, source) {
|
||||
for (var i in source) {
|
||||
target[i] = source[i];
|
||||
}
|
||||
return target;
|
||||
},
|
||||
copyOwnProperty: function (name, source, target) {
|
||||
var pd = Object.getOwnPropertyDescriptor(source, name);
|
||||
if (pd) {
|
||||
Object.defineProperty(target, name, pd);
|
||||
}
|
||||
},
|
||||
_log: console.log.apply.bind(console.log, console),
|
||||
_warn: console.warn.apply.bind(console.warn, console),
|
||||
_error: console.error.apply.bind(console.error, console),
|
||||
_logf: function () {
|
||||
return this._logPrefix.concat([this.is]).concat(Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
};
|
||||
Polymer.Base._logPrefix = function () {
|
||||
var color = window.chrome || /firefox/i.test(navigator.userAgent);
|
||||
return color ? [
|
||||
'%c[%s::%s]:',
|
||||
'font-weight: bold; background-color:#EEEE00;'
|
||||
] : ['[%s::%s]:'];
|
||||
}();
|
||||
Polymer.Base.chainObject = function (object, inherited) {
|
||||
if (object && inherited && object !== inherited) {
|
||||
if (!Object.__proto__) {
|
||||
object = Polymer.Base.extend(Object.create(inherited), object);
|
||||
}
|
||||
object.__proto__ = inherited;
|
||||
}
|
||||
return object;
|
||||
};
|
||||
Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype);
|
||||
if (window.CustomElements) {
|
||||
Polymer.instanceof = CustomElements.instanceof;
|
||||
} else {
|
||||
Polymer.instanceof = function (obj, ctor) {
|
||||
return obj instanceof ctor;
|
||||
};
|
||||
}
|
||||
Polymer.isInstance = function (obj) {
|
||||
return Boolean(obj && obj.__isPolymerInstance__);
|
||||
};
|
||||
Polymer.telemetry.instanceCount = 0;
|
||||
(function () {
|
||||
var modules = {};
|
||||
var lcModules = {};
|
||||
var findModule = function (id) {
|
||||
return modules[id] || lcModules[id.toLowerCase()];
|
||||
};
|
||||
var DomModule = function () {
|
||||
return document.createElement('dom-module');
|
||||
};
|
||||
DomModule.prototype = Object.create(HTMLElement.prototype);
|
||||
Polymer.Base.extend(DomModule.prototype, {
|
||||
constructor: DomModule,
|
||||
createdCallback: function () {
|
||||
this.register();
|
||||
},
|
||||
register: function (id) {
|
||||
var id = id || this.id || this.getAttribute('name') || this.getAttribute('is');
|
||||
if (id) {
|
||||
this.id = id;
|
||||
modules[id] = this;
|
||||
lcModules[id.toLowerCase()] = this;
|
||||
}
|
||||
},
|
||||
import: function (id, selector) {
|
||||
if (id) {
|
||||
var m = findModule(id);
|
||||
if (!m) {
|
||||
forceDocumentUpgrade();
|
||||
m = findModule(id);
|
||||
}
|
||||
if (m && selector) {
|
||||
m = m.querySelector(selector);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
}
|
||||
});
|
||||
var cePolyfill = window.CustomElements && !CustomElements.useNative;
|
||||
document.registerElement('dom-module', DomModule);
|
||||
function forceDocumentUpgrade() {
|
||||
if (cePolyfill) {
|
||||
var script = document._currentScript || document.currentScript;
|
||||
var doc = script && script.ownerDocument || document;
|
||||
if (doc) {
|
||||
CustomElements.upgradeAll(doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}());
|
||||
Polymer.Base._addFeature({
|
||||
_prepIs: function () {
|
||||
if (!this.is) {
|
||||
var module = (document._currentScript || document.currentScript).parentNode;
|
||||
if (module.localName === 'dom-module') {
|
||||
var id = module.id || module.getAttribute('name') || module.getAttribute('is');
|
||||
this.is = id;
|
||||
}
|
||||
}
|
||||
if (this.is) {
|
||||
this.is = this.is.toLowerCase();
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
behaviors: [],
|
||||
_desugarBehaviors: function () {
|
||||
if (this.behaviors.length) {
|
||||
this.behaviors = this._desugarSomeBehaviors(this.behaviors);
|
||||
}
|
||||
},
|
||||
_desugarSomeBehaviors: function (behaviors) {
|
||||
behaviors = this._flattenBehaviorsList(behaviors);
|
||||
for (var i = behaviors.length - 1; i >= 0; i--) {
|
||||
this._mixinBehavior(behaviors[i]);
|
||||
}
|
||||
return behaviors;
|
||||
},
|
||||
_flattenBehaviorsList: function (behaviors) {
|
||||
var flat = [];
|
||||
behaviors.forEach(function (b) {
|
||||
if (b instanceof Array) {
|
||||
flat = flat.concat(this._flattenBehaviorsList(b));
|
||||
} else if (b) {
|
||||
flat.push(b);
|
||||
} else {
|
||||
this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for missing or 404 import'));
|
||||
}
|
||||
}, this);
|
||||
return flat;
|
||||
},
|
||||
_mixinBehavior: function (b) {
|
||||
Object.getOwnPropertyNames(b).forEach(function (n) {
|
||||
switch (n) {
|
||||
case 'hostAttributes':
|
||||
case 'registered':
|
||||
case 'properties':
|
||||
case 'observers':
|
||||
case 'listeners':
|
||||
case 'created':
|
||||
case 'attached':
|
||||
case 'detached':
|
||||
case 'attributeChanged':
|
||||
case 'configure':
|
||||
case 'ready':
|
||||
break;
|
||||
default:
|
||||
if (!this.hasOwnProperty(n)) {
|
||||
this.copyOwnProperty(n, b, this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
_prepBehaviors: function () {
|
||||
this._prepFlattenedBehaviors(this.behaviors);
|
||||
},
|
||||
_prepFlattenedBehaviors: function (behaviors) {
|
||||
for (var i = 0, l = behaviors.length; i < l; i++) {
|
||||
this._prepBehavior(behaviors[i]);
|
||||
}
|
||||
this._prepBehavior(this);
|
||||
},
|
||||
_doBehavior: function (name, args) {
|
||||
this.behaviors.forEach(function (b) {
|
||||
this._invokeBehavior(b, name, args);
|
||||
}, this);
|
||||
this._invokeBehavior(this, name, args);
|
||||
},
|
||||
_invokeBehavior: function (b, name, args) {
|
||||
var fn = b[name];
|
||||
if (fn) {
|
||||
fn.apply(this, args || Polymer.nar);
|
||||
}
|
||||
},
|
||||
_marshalBehaviors: function () {
|
||||
this.behaviors.forEach(function (b) {
|
||||
this._marshalBehavior(b);
|
||||
}, this);
|
||||
this._marshalBehavior(this);
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_getExtendedPrototype: function (tag) {
|
||||
return this._getExtendedNativePrototype(tag);
|
||||
},
|
||||
_nativePrototypes: {},
|
||||
_getExtendedNativePrototype: function (tag) {
|
||||
var p = this._nativePrototypes[tag];
|
||||
if (!p) {
|
||||
var np = this.getNativePrototype(tag);
|
||||
p = this.extend(Object.create(np), Polymer.Base);
|
||||
this._nativePrototypes[tag] = p;
|
||||
}
|
||||
return p;
|
||||
},
|
||||
getNativePrototype: function (tag) {
|
||||
return Object.getPrototypeOf(document.createElement(tag));
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_prepConstructor: function () {
|
||||
this._factoryArgs = this.extends ? [
|
||||
this.extends,
|
||||
this.is
|
||||
] : [this.is];
|
||||
var ctor = function () {
|
||||
return this._factory(arguments);
|
||||
};
|
||||
if (this.hasOwnProperty('extends')) {
|
||||
ctor.extends = this.extends;
|
||||
}
|
||||
Object.defineProperty(this, 'constructor', {
|
||||
value: ctor,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
ctor.prototype = this;
|
||||
},
|
||||
_factory: function (args) {
|
||||
var elt = document.createElement.apply(document, this._factoryArgs);
|
||||
if (this.factoryImpl) {
|
||||
this.factoryImpl.apply(elt, args);
|
||||
}
|
||||
return elt;
|
||||
}
|
||||
});
|
||||
Polymer.nob = Object.create(null);
|
||||
Polymer.Base._addFeature({
|
||||
properties: {},
|
||||
getPropertyInfo: function (property) {
|
||||
var info = this._getPropertyInfo(property, this.properties);
|
||||
if (!info) {
|
||||
this.behaviors.some(function (b) {
|
||||
return info = this._getPropertyInfo(property, b.properties);
|
||||
}, this);
|
||||
}
|
||||
return info || Polymer.nob;
|
||||
},
|
||||
_getPropertyInfo: function (property, properties) {
|
||||
var p = properties && properties[property];
|
||||
if (typeof p === 'function') {
|
||||
p = properties[property] = { type: p };
|
||||
}
|
||||
if (p) {
|
||||
p.defined = true;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
});
|
||||
Polymer.CaseMap = {
|
||||
_caseMap: {},
|
||||
dashToCamelCase: function (dash) {
|
||||
var mapped = Polymer.CaseMap._caseMap[dash];
|
||||
if (mapped) {
|
||||
return mapped;
|
||||
}
|
||||
if (dash.indexOf('-') < 0) {
|
||||
return Polymer.CaseMap._caseMap[dash] = dash;
|
||||
}
|
||||
return Polymer.CaseMap._caseMap[dash] = dash.replace(/-([a-z])/g, function (m) {
|
||||
return m[1].toUpperCase();
|
||||
});
|
||||
},
|
||||
camelToDashCase: function (camel) {
|
||||
var mapped = Polymer.CaseMap._caseMap[camel];
|
||||
if (mapped) {
|
||||
return mapped;
|
||||
}
|
||||
return Polymer.CaseMap._caseMap[camel] = camel.replace(/([a-z][A-Z])/g, function (g) {
|
||||
return g[0] + '-' + g[1].toLowerCase();
|
||||
});
|
||||
}
|
||||
};
|
||||
Polymer.Base._addFeature({
|
||||
_prepAttributes: function () {
|
||||
this._aggregatedAttributes = {};
|
||||
},
|
||||
_addHostAttributes: function (attributes) {
|
||||
if (attributes) {
|
||||
this.mixin(this._aggregatedAttributes, attributes);
|
||||
}
|
||||
},
|
||||
_marshalHostAttributes: function () {
|
||||
this._applyAttributes(this, this._aggregatedAttributes);
|
||||
},
|
||||
_applyAttributes: function (node, attr$) {
|
||||
for (var n in attr$) {
|
||||
if (!this.hasAttribute(n) && n !== 'class') {
|
||||
this.serializeValueToAttribute(attr$[n], n, this);
|
||||
}
|
||||
}
|
||||
},
|
||||
_marshalAttributes: function () {
|
||||
this._takeAttributesToModel(this);
|
||||
},
|
||||
_takeAttributesToModel: function (model) {
|
||||
for (var i = 0, l = this.attributes.length; i < l; i++) {
|
||||
this._setAttributeToProperty(model, this.attributes[i].name);
|
||||
}
|
||||
},
|
||||
_setAttributeToProperty: function (model, attrName) {
|
||||
if (!this._serializing) {
|
||||
var propName = Polymer.CaseMap.dashToCamelCase(attrName);
|
||||
var info = this.getPropertyInfo(propName);
|
||||
if (info.defined || this._propertyEffects && this._propertyEffects[propName]) {
|
||||
var val = this.getAttribute(attrName);
|
||||
model[propName] = this.deserialize(val, info.type);
|
||||
}
|
||||
}
|
||||
},
|
||||
_serializing: false,
|
||||
reflectPropertyToAttribute: function (name) {
|
||||
this._serializing = true;
|
||||
this.serializeValueToAttribute(this[name], Polymer.CaseMap.camelToDashCase(name));
|
||||
this._serializing = false;
|
||||
},
|
||||
serializeValueToAttribute: function (value, attribute, node) {
|
||||
var str = this.serialize(value);
|
||||
(node || this)[str === undefined ? 'removeAttribute' : 'setAttribute'](attribute, str);
|
||||
},
|
||||
deserialize: function (value, type) {
|
||||
switch (type) {
|
||||
case Number:
|
||||
value = Number(value);
|
||||
break;
|
||||
case Boolean:
|
||||
value = value !== null;
|
||||
break;
|
||||
case Object:
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (x) {
|
||||
}
|
||||
break;
|
||||
case Array:
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (x) {
|
||||
value = null;
|
||||
console.warn('Polymer::Attributes: couldn`t decode Array as JSON');
|
||||
}
|
||||
break;
|
||||
case Date:
|
||||
value = new Date(value);
|
||||
break;
|
||||
case String:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
serialize: function (value) {
|
||||
switch (typeof value) {
|
||||
case 'boolean':
|
||||
return value ? '' : undefined;
|
||||
case 'object':
|
||||
if (value instanceof Date) {
|
||||
return value;
|
||||
} else if (value) {
|
||||
try {
|
||||
return JSON.stringify(value);
|
||||
} catch (x) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
default:
|
||||
return value != null ? value : undefined;
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_setupDebouncers: function () {
|
||||
this._debouncers = {};
|
||||
},
|
||||
debounce: function (jobName, callback, wait) {
|
||||
return this._debouncers[jobName] = Polymer.Debounce.call(this, this._debouncers[jobName], callback, wait);
|
||||
},
|
||||
isDebouncerActive: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
return debouncer && debouncer.finish;
|
||||
},
|
||||
flushDebouncer: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
if (debouncer) {
|
||||
debouncer.complete();
|
||||
}
|
||||
},
|
||||
cancelDebouncer: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
if (debouncer) {
|
||||
debouncer.stop();
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.version = '1.2.1';
|
||||
Polymer.Base._addFeature({
|
||||
_registerFeatures: function () {
|
||||
this._prepIs();
|
||||
this._prepAttributes();
|
||||
this._prepBehaviors();
|
||||
this._prepConstructor();
|
||||
},
|
||||
_prepBehavior: function (b) {
|
||||
this._addHostAttributes(b.hostAttributes);
|
||||
},
|
||||
_marshalBehavior: function (b) {
|
||||
},
|
||||
_initFeatures: function () {
|
||||
this._marshalHostAttributes();
|
||||
this._setupDebouncers();
|
||||
this._marshalBehaviors();
|
||||
}
|
||||
});</script>
|
||||
|
1870
q3-2015/data.driven.deliveries/bower_components/polymer/polymer-mini.html
поставляемый
Normal file
1870
q3-2015/data.driven.deliveries/bower_components/polymer/polymer-mini.html
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
27
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/.bower.json
поставляемый
Normal file
27
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/.bower.json
поставляемый
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.15",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"webcomponents"
|
||||
],
|
||||
"license": "BSD",
|
||||
"ignore": [],
|
||||
"_release": "0.7.15",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.7.15",
|
||||
"commit": "d90a442cdf31ae10a7b5b62e667cc749a2a6da61"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/webcomponentsjs.git",
|
||||
"_target": "^0.7.2",
|
||||
"_originalSource": "webcomponentsjs"
|
||||
}
|
980
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/CustomElements.js
поставляемый
Normal file
980
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/CustomElements.js
поставляемый
Normal file
|
@ -0,0 +1,980 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
// @version 0.7.15
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
var counter = Date.now() % 1e9;
|
||||
var WeakMap = function() {
|
||||
this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
|
||||
};
|
||||
WeakMap.prototype = {
|
||||
set: function(key, value) {
|
||||
var entry = key[this.name];
|
||||
if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
|
||||
value: [ key, value ],
|
||||
writable: true
|
||||
});
|
||||
return this;
|
||||
},
|
||||
get: function(key) {
|
||||
var entry;
|
||||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
|
||||
},
|
||||
"delete": function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry || entry[0] !== key) return false;
|
||||
entry[0] = entry[1] = undefined;
|
||||
return true;
|
||||
},
|
||||
has: function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry) return false;
|
||||
return entry[0] === key;
|
||||
}
|
||||
};
|
||||
window.WeakMap = WeakMap;
|
||||
})();
|
||||
}
|
||||
|
||||
(function(global) {
|
||||
if (global.JsMutationObserver) {
|
||||
return;
|
||||
}
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
setImmediate = setTimeout;
|
||||
} else if (window.setImmediate) {
|
||||
setImmediate = window.setImmediate;
|
||||
} else {
|
||||
var setImmediateQueue = [];
|
||||
var sentinel = String(Math.random());
|
||||
window.addEventListener("message", function(e) {
|
||||
if (e.data === sentinel) {
|
||||
var queue = setImmediateQueue;
|
||||
setImmediateQueue = [];
|
||||
queue.forEach(function(func) {
|
||||
func();
|
||||
});
|
||||
}
|
||||
});
|
||||
setImmediate = function(func) {
|
||||
setImmediateQueue.push(func);
|
||||
window.postMessage(sentinel, "*");
|
||||
};
|
||||
}
|
||||
var isScheduled = false;
|
||||
var scheduledObservers = [];
|
||||
function scheduleCallback(observer) {
|
||||
scheduledObservers.push(observer);
|
||||
if (!isScheduled) {
|
||||
isScheduled = true;
|
||||
setImmediate(dispatchCallbacks);
|
||||
}
|
||||
}
|
||||
function wrapIfNeeded(node) {
|
||||
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
|
||||
}
|
||||
function dispatchCallbacks() {
|
||||
isScheduled = false;
|
||||
var observers = scheduledObservers;
|
||||
scheduledObservers = [];
|
||||
observers.sort(function(o1, o2) {
|
||||
return o1.uid_ - o2.uid_;
|
||||
});
|
||||
var anyNonEmpty = false;
|
||||
observers.forEach(function(observer) {
|
||||
var queue = observer.takeRecords();
|
||||
removeTransientObserversFor(observer);
|
||||
if (queue.length) {
|
||||
observer.callback_(queue, observer);
|
||||
anyNonEmpty = true;
|
||||
}
|
||||
});
|
||||
if (anyNonEmpty) dispatchCallbacks();
|
||||
}
|
||||
function removeTransientObserversFor(observer) {
|
||||
observer.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) return;
|
||||
registrations.forEach(function(registration) {
|
||||
if (registration.observer === observer) registration.removeTransientObservers();
|
||||
});
|
||||
});
|
||||
}
|
||||
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
|
||||
for (var node = target; node; node = node.parentNode) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (registrations) {
|
||||
for (var j = 0; j < registrations.length; j++) {
|
||||
var registration = registrations[j];
|
||||
var options = registration.options;
|
||||
if (node !== target && !options.subtree) continue;
|
||||
var record = callback(options);
|
||||
if (record) registration.enqueue(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var uidCounter = 0;
|
||||
function JsMutationObserver(callback) {
|
||||
this.callback_ = callback;
|
||||
this.nodes_ = [];
|
||||
this.records_ = [];
|
||||
this.uid_ = ++uidCounter;
|
||||
}
|
||||
JsMutationObserver.prototype = {
|
||||
observe: function(target, options) {
|
||||
target = wrapIfNeeded(target);
|
||||
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
|
||||
throw new SyntaxError();
|
||||
}
|
||||
var registrations = registrationsTable.get(target);
|
||||
if (!registrations) registrationsTable.set(target, registrations = []);
|
||||
var registration;
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i].observer === this) {
|
||||
registration = registrations[i];
|
||||
registration.removeListeners();
|
||||
registration.options = options;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!registration) {
|
||||
registration = new Registration(this, target, options);
|
||||
registrations.push(registration);
|
||||
this.nodes_.push(target);
|
||||
}
|
||||
registration.addListeners();
|
||||
},
|
||||
disconnect: function() {
|
||||
this.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
var registration = registrations[i];
|
||||
if (registration.observer === this) {
|
||||
registration.removeListeners();
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
this.records_ = [];
|
||||
},
|
||||
takeRecords: function() {
|
||||
var copyOfRecords = this.records_;
|
||||
this.records_ = [];
|
||||
return copyOfRecords;
|
||||
}
|
||||
};
|
||||
function MutationRecord(type, target) {
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.addedNodes = [];
|
||||
this.removedNodes = [];
|
||||
this.previousSibling = null;
|
||||
this.nextSibling = null;
|
||||
this.attributeName = null;
|
||||
this.attributeNamespace = null;
|
||||
this.oldValue = null;
|
||||
}
|
||||
function copyMutationRecord(original) {
|
||||
var record = new MutationRecord(original.type, original.target);
|
||||
record.addedNodes = original.addedNodes.slice();
|
||||
record.removedNodes = original.removedNodes.slice();
|
||||
record.previousSibling = original.previousSibling;
|
||||
record.nextSibling = original.nextSibling;
|
||||
record.attributeName = original.attributeName;
|
||||
record.attributeNamespace = original.attributeNamespace;
|
||||
record.oldValue = original.oldValue;
|
||||
return record;
|
||||
}
|
||||
var currentRecord, recordWithOldValue;
|
||||
function getRecord(type, target) {
|
||||
return currentRecord = new MutationRecord(type, target);
|
||||
}
|
||||
function getRecordWithOldValue(oldValue) {
|
||||
if (recordWithOldValue) return recordWithOldValue;
|
||||
recordWithOldValue = copyMutationRecord(currentRecord);
|
||||
recordWithOldValue.oldValue = oldValue;
|
||||
return recordWithOldValue;
|
||||
}
|
||||
function clearRecords() {
|
||||
currentRecord = recordWithOldValue = undefined;
|
||||
}
|
||||
function recordRepresentsCurrentMutation(record) {
|
||||
return record === recordWithOldValue || record === currentRecord;
|
||||
}
|
||||
function selectRecord(lastRecord, newRecord) {
|
||||
if (lastRecord === newRecord) return lastRecord;
|
||||
if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
|
||||
return null;
|
||||
}
|
||||
function Registration(observer, target, options) {
|
||||
this.observer = observer;
|
||||
this.target = target;
|
||||
this.options = options;
|
||||
this.transientObservedNodes = [];
|
||||
}
|
||||
Registration.prototype = {
|
||||
enqueue: function(record) {
|
||||
var records = this.observer.records_;
|
||||
var length = records.length;
|
||||
if (records.length > 0) {
|
||||
var lastRecord = records[length - 1];
|
||||
var recordToReplaceLast = selectRecord(lastRecord, record);
|
||||
if (recordToReplaceLast) {
|
||||
records[length - 1] = recordToReplaceLast;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
scheduleCallback(this.observer);
|
||||
}
|
||||
records[length] = record;
|
||||
},
|
||||
addListeners: function() {
|
||||
this.addListeners_(this.target);
|
||||
},
|
||||
addListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
removeListeners: function() {
|
||||
this.removeListeners_(this.target);
|
||||
},
|
||||
removeListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
addTransientObserver: function(node) {
|
||||
if (node === this.target) return;
|
||||
this.addListeners_(node);
|
||||
this.transientObservedNodes.push(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) registrationsTable.set(node, registrations = []);
|
||||
registrations.push(this);
|
||||
},
|
||||
removeTransientObservers: function() {
|
||||
var transientObservedNodes = this.transientObservedNodes;
|
||||
this.transientObservedNodes = [];
|
||||
transientObservedNodes.forEach(function(node) {
|
||||
this.removeListeners_(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i] === this) {
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
handleEvent: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
switch (e.type) {
|
||||
case "DOMAttrModified":
|
||||
var name = e.attrName;
|
||||
var namespace = e.relatedNode.namespaceURI;
|
||||
var target = e.target;
|
||||
var record = new getRecord("attributes", target);
|
||||
record.attributeName = name;
|
||||
record.attributeNamespace = namespace;
|
||||
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.attributes) return;
|
||||
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
|
||||
return;
|
||||
}
|
||||
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMCharacterDataModified":
|
||||
var target = e.target;
|
||||
var record = getRecord("characterData", target);
|
||||
var oldValue = e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.characterData) return;
|
||||
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMNodeRemoved":
|
||||
this.addTransientObserver(e.target);
|
||||
|
||||
case "DOMNodeInserted":
|
||||
var changedNode = e.target;
|
||||
var addedNodes, removedNodes;
|
||||
if (e.type === "DOMNodeInserted") {
|
||||
addedNodes = [ changedNode ];
|
||||
removedNodes = [];
|
||||
} else {
|
||||
addedNodes = [];
|
||||
removedNodes = [ changedNode ];
|
||||
}
|
||||
var previousSibling = changedNode.previousSibling;
|
||||
var nextSibling = changedNode.nextSibling;
|
||||
var record = getRecord("childList", e.target.parentNode);
|
||||
record.addedNodes = addedNodes;
|
||||
record.removedNodes = removedNodes;
|
||||
record.previousSibling = previousSibling;
|
||||
record.nextSibling = nextSibling;
|
||||
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
|
||||
if (!options.childList) return;
|
||||
return record;
|
||||
});
|
||||
}
|
||||
clearRecords();
|
||||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) {
|
||||
global.MutationObserver = JsMutationObserver;
|
||||
JsMutationObserver._isPolyfilled = true;
|
||||
}
|
||||
})(self);
|
||||
|
||||
window.CustomElements = window.CustomElements || {
|
||||
flags: {}
|
||||
};
|
||||
|
||||
(function(scope) {
|
||||
var flags = scope.flags;
|
||||
var modules = [];
|
||||
var addModule = function(module) {
|
||||
modules.push(module);
|
||||
};
|
||||
var initializeModules = function() {
|
||||
modules.forEach(function(module) {
|
||||
module(scope);
|
||||
});
|
||||
};
|
||||
scope.addModule = addModule;
|
||||
scope.initializeModules = initializeModules;
|
||||
scope.hasNative = Boolean(document.registerElement);
|
||||
scope.isIE = /Trident/.test(navigator.userAgent);
|
||||
scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);
|
||||
})(window.CustomElements);
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none";
|
||||
function forSubtree(node, cb) {
|
||||
findAllElements(node, function(e) {
|
||||
if (cb(e)) {
|
||||
return true;
|
||||
}
|
||||
forRoots(e, cb);
|
||||
});
|
||||
forRoots(node, cb);
|
||||
}
|
||||
function findAllElements(node, find, data) {
|
||||
var e = node.firstElementChild;
|
||||
if (!e) {
|
||||
e = node.firstChild;
|
||||
while (e && e.nodeType !== Node.ELEMENT_NODE) {
|
||||
e = e.nextSibling;
|
||||
}
|
||||
}
|
||||
while (e) {
|
||||
if (find(e, data) !== true) {
|
||||
findAllElements(e, find, data);
|
||||
}
|
||||
e = e.nextElementSibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function forRoots(node, cb) {
|
||||
var root = node.shadowRoot;
|
||||
while (root) {
|
||||
forSubtree(root, cb);
|
||||
root = root.olderShadowRoot;
|
||||
}
|
||||
}
|
||||
function forDocumentTree(doc, cb) {
|
||||
_forDocumentTree(doc, cb, []);
|
||||
}
|
||||
function _forDocumentTree(doc, cb, processingDocuments) {
|
||||
doc = window.wrap(doc);
|
||||
if (processingDocuments.indexOf(doc) >= 0) {
|
||||
return;
|
||||
}
|
||||
processingDocuments.push(doc);
|
||||
var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]");
|
||||
for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {
|
||||
if (n.import) {
|
||||
_forDocumentTree(n.import, cb, processingDocuments);
|
||||
}
|
||||
}
|
||||
cb(doc);
|
||||
}
|
||||
scope.forDocumentTree = forDocumentTree;
|
||||
scope.forSubtree = forSubtree;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
var forSubtree = scope.forSubtree;
|
||||
var forDocumentTree = scope.forDocumentTree;
|
||||
function addedNode(node, isAttached) {
|
||||
return added(node, isAttached) || addedSubtree(node, isAttached);
|
||||
}
|
||||
function added(node, isAttached) {
|
||||
if (scope.upgrade(node, isAttached)) {
|
||||
return true;
|
||||
}
|
||||
if (isAttached) {
|
||||
attached(node);
|
||||
}
|
||||
}
|
||||
function addedSubtree(node, isAttached) {
|
||||
forSubtree(node, function(e) {
|
||||
if (added(e, isAttached)) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags["throttle-attached"];
|
||||
scope.hasPolyfillMutations = hasThrottledAttached;
|
||||
scope.hasThrottledAttached = hasThrottledAttached;
|
||||
var isPendingMutations = false;
|
||||
var pendingMutations = [];
|
||||
function deferMutation(fn) {
|
||||
pendingMutations.push(fn);
|
||||
if (!isPendingMutations) {
|
||||
isPendingMutations = true;
|
||||
setTimeout(takeMutations);
|
||||
}
|
||||
}
|
||||
function takeMutations() {
|
||||
isPendingMutations = false;
|
||||
var $p = pendingMutations;
|
||||
for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
|
||||
p();
|
||||
}
|
||||
pendingMutations = [];
|
||||
}
|
||||
function attached(element) {
|
||||
if (hasThrottledAttached) {
|
||||
deferMutation(function() {
|
||||
_attached(element);
|
||||
});
|
||||
} else {
|
||||
_attached(element);
|
||||
}
|
||||
}
|
||||
function _attached(element) {
|
||||
if (element.__upgraded__ && !element.__attached) {
|
||||
element.__attached = true;
|
||||
if (element.attachedCallback) {
|
||||
element.attachedCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
function detachedNode(node) {
|
||||
detached(node);
|
||||
forSubtree(node, function(e) {
|
||||
detached(e);
|
||||
});
|
||||
}
|
||||
function detached(element) {
|
||||
if (hasThrottledAttached) {
|
||||
deferMutation(function() {
|
||||
_detached(element);
|
||||
});
|
||||
} else {
|
||||
_detached(element);
|
||||
}
|
||||
}
|
||||
function _detached(element) {
|
||||
if (element.__upgraded__ && element.__attached) {
|
||||
element.__attached = false;
|
||||
if (element.detachedCallback) {
|
||||
element.detachedCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
function inDocument(element) {
|
||||
var p = element;
|
||||
var doc = window.wrap(document);
|
||||
while (p) {
|
||||
if (p == doc) {
|
||||
return true;
|
||||
}
|
||||
p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host;
|
||||
}
|
||||
}
|
||||
function watchShadow(node) {
|
||||
if (node.shadowRoot && !node.shadowRoot.__watched) {
|
||||
flags.dom && console.log("watching shadow-root for: ", node.localName);
|
||||
var root = node.shadowRoot;
|
||||
while (root) {
|
||||
observe(root);
|
||||
root = root.olderShadowRoot;
|
||||
}
|
||||
}
|
||||
}
|
||||
function handler(root, mutations) {
|
||||
if (flags.dom) {
|
||||
var mx = mutations[0];
|
||||
if (mx && mx.type === "childList" && mx.addedNodes) {
|
||||
if (mx.addedNodes) {
|
||||
var d = mx.addedNodes[0];
|
||||
while (d && d !== document && !d.host) {
|
||||
d = d.parentNode;
|
||||
}
|
||||
var u = d && (d.URL || d._URL || d.host && d.host.localName) || "";
|
||||
u = u.split("/?").shift().split("/").pop();
|
||||
}
|
||||
}
|
||||
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
||||
}
|
||||
var isAttached = inDocument(root);
|
||||
mutations.forEach(function(mx) {
|
||||
if (mx.type === "childList") {
|
||||
forEach(mx.addedNodes, function(n) {
|
||||
if (!n.localName) {
|
||||
return;
|
||||
}
|
||||
addedNode(n, isAttached);
|
||||
});
|
||||
forEach(mx.removedNodes, function(n) {
|
||||
if (!n.localName) {
|
||||
return;
|
||||
}
|
||||
detachedNode(n);
|
||||
});
|
||||
}
|
||||
});
|
||||
flags.dom && console.groupEnd();
|
||||
}
|
||||
function takeRecords(node) {
|
||||
node = window.wrap(node);
|
||||
if (!node) {
|
||||
node = window.wrap(document);
|
||||
}
|
||||
while (node.parentNode) {
|
||||
node = node.parentNode;
|
||||
}
|
||||
var observer = node.__observer;
|
||||
if (observer) {
|
||||
handler(node, observer.takeRecords());
|
||||
takeMutations();
|
||||
}
|
||||
}
|
||||
var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);
|
||||
function observe(inRoot) {
|
||||
if (inRoot.__observer) {
|
||||
return;
|
||||
}
|
||||
var observer = new MutationObserver(handler.bind(this, inRoot));
|
||||
observer.observe(inRoot, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
inRoot.__observer = observer;
|
||||
}
|
||||
function upgradeDocument(doc) {
|
||||
doc = window.wrap(doc);
|
||||
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
||||
var isMainDocument = doc === window.wrap(document);
|
||||
addedNode(doc, isMainDocument);
|
||||
observe(doc);
|
||||
flags.dom && console.groupEnd();
|
||||
}
|
||||
function upgradeDocumentTree(doc) {
|
||||
forDocumentTree(doc, upgradeDocument);
|
||||
}
|
||||
var originalCreateShadowRoot = Element.prototype.createShadowRoot;
|
||||
if (originalCreateShadowRoot) {
|
||||
Element.prototype.createShadowRoot = function() {
|
||||
var root = originalCreateShadowRoot.call(this);
|
||||
window.CustomElements.watchShadow(this);
|
||||
return root;
|
||||
};
|
||||
}
|
||||
scope.watchShadow = watchShadow;
|
||||
scope.upgradeDocumentTree = upgradeDocumentTree;
|
||||
scope.upgradeDocument = upgradeDocument;
|
||||
scope.upgradeSubtree = addedSubtree;
|
||||
scope.upgradeAll = addedNode;
|
||||
scope.attached = attached;
|
||||
scope.takeRecords = takeRecords;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
function upgrade(node, isAttached) {
|
||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||
var is = node.getAttribute("is");
|
||||
var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is);
|
||||
if (definition) {
|
||||
if (is && definition.tag == node.localName || !is && !definition.extends) {
|
||||
return upgradeWithDefinition(node, definition, isAttached);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function upgradeWithDefinition(element, definition, isAttached) {
|
||||
flags.upgrade && console.group("upgrade:", element.localName);
|
||||
if (definition.is) {
|
||||
element.setAttribute("is", definition.is);
|
||||
}
|
||||
implementPrototype(element, definition);
|
||||
element.__upgraded__ = true;
|
||||
created(element);
|
||||
if (isAttached) {
|
||||
scope.attached(element);
|
||||
}
|
||||
scope.upgradeSubtree(element, isAttached);
|
||||
flags.upgrade && console.groupEnd();
|
||||
return element;
|
||||
}
|
||||
function implementPrototype(element, definition) {
|
||||
if (Object.__proto__) {
|
||||
element.__proto__ = definition.prototype;
|
||||
} else {
|
||||
customMixin(element, definition.prototype, definition.native);
|
||||
element.__proto__ = definition.prototype;
|
||||
}
|
||||
}
|
||||
function customMixin(inTarget, inSrc, inNative) {
|
||||
var used = {};
|
||||
var p = inSrc;
|
||||
while (p !== inNative && p !== HTMLElement.prototype) {
|
||||
var keys = Object.getOwnPropertyNames(p);
|
||||
for (var i = 0, k; k = keys[i]; i++) {
|
||||
if (!used[k]) {
|
||||
Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));
|
||||
used[k] = 1;
|
||||
}
|
||||
}
|
||||
p = Object.getPrototypeOf(p);
|
||||
}
|
||||
}
|
||||
function created(element) {
|
||||
if (element.createdCallback) {
|
||||
element.createdCallback();
|
||||
}
|
||||
}
|
||||
scope.upgrade = upgrade;
|
||||
scope.upgradeWithDefinition = upgradeWithDefinition;
|
||||
scope.implementPrototype = implementPrototype;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var isIE = scope.isIE;
|
||||
var upgradeDocumentTree = scope.upgradeDocumentTree;
|
||||
var upgradeAll = scope.upgradeAll;
|
||||
var upgradeWithDefinition = scope.upgradeWithDefinition;
|
||||
var implementPrototype = scope.implementPrototype;
|
||||
var useNative = scope.useNative;
|
||||
function register(name, options) {
|
||||
var definition = options || {};
|
||||
if (!name) {
|
||||
throw new Error("document.registerElement: first argument `name` must not be empty");
|
||||
}
|
||||
if (name.indexOf("-") < 0) {
|
||||
throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'.");
|
||||
}
|
||||
if (isReservedTag(name)) {
|
||||
throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid.");
|
||||
}
|
||||
if (getRegisteredDefinition(name)) {
|
||||
throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered");
|
||||
}
|
||||
if (!definition.prototype) {
|
||||
definition.prototype = Object.create(HTMLElement.prototype);
|
||||
}
|
||||
definition.__name = name.toLowerCase();
|
||||
definition.lifecycle = definition.lifecycle || {};
|
||||
definition.ancestry = ancestry(definition.extends);
|
||||
resolveTagName(definition);
|
||||
resolvePrototypeChain(definition);
|
||||
overrideAttributeApi(definition.prototype);
|
||||
registerDefinition(definition.__name, definition);
|
||||
definition.ctor = generateConstructor(definition);
|
||||
definition.ctor.prototype = definition.prototype;
|
||||
definition.prototype.constructor = definition.ctor;
|
||||
if (scope.ready) {
|
||||
upgradeDocumentTree(document);
|
||||
}
|
||||
return definition.ctor;
|
||||
}
|
||||
function overrideAttributeApi(prototype) {
|
||||
if (prototype.setAttribute._polyfilled) {
|
||||
return;
|
||||
}
|
||||
var setAttribute = prototype.setAttribute;
|
||||
prototype.setAttribute = function(name, value) {
|
||||
changeAttribute.call(this, name, value, setAttribute);
|
||||
};
|
||||
var removeAttribute = prototype.removeAttribute;
|
||||
prototype.removeAttribute = function(name) {
|
||||
changeAttribute.call(this, name, null, removeAttribute);
|
||||
};
|
||||
prototype.setAttribute._polyfilled = true;
|
||||
}
|
||||
function changeAttribute(name, value, operation) {
|
||||
name = name.toLowerCase();
|
||||
var oldValue = this.getAttribute(name);
|
||||
operation.apply(this, arguments);
|
||||
var newValue = this.getAttribute(name);
|
||||
if (this.attributeChangedCallback && newValue !== oldValue) {
|
||||
this.attributeChangedCallback(name, oldValue, newValue);
|
||||
}
|
||||
}
|
||||
function isReservedTag(name) {
|
||||
for (var i = 0; i < reservedTagList.length; i++) {
|
||||
if (name === reservedTagList[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ];
|
||||
function ancestry(extnds) {
|
||||
var extendee = getRegisteredDefinition(extnds);
|
||||
if (extendee) {
|
||||
return ancestry(extendee.extends).concat([ extendee ]);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
function resolveTagName(definition) {
|
||||
var baseTag = definition.extends;
|
||||
for (var i = 0, a; a = definition.ancestry[i]; i++) {
|
||||
baseTag = a.is && a.tag;
|
||||
}
|
||||
definition.tag = baseTag || definition.__name;
|
||||
if (baseTag) {
|
||||
definition.is = definition.__name;
|
||||
}
|
||||
}
|
||||
function resolvePrototypeChain(definition) {
|
||||
if (!Object.__proto__) {
|
||||
var nativePrototype = HTMLElement.prototype;
|
||||
if (definition.is) {
|
||||
var inst = document.createElement(definition.tag);
|
||||
nativePrototype = Object.getPrototypeOf(inst);
|
||||
}
|
||||
var proto = definition.prototype, ancestor;
|
||||
var foundPrototype = false;
|
||||
while (proto) {
|
||||
if (proto == nativePrototype) {
|
||||
foundPrototype = true;
|
||||
}
|
||||
ancestor = Object.getPrototypeOf(proto);
|
||||
if (ancestor) {
|
||||
proto.__proto__ = ancestor;
|
||||
}
|
||||
proto = ancestor;
|
||||
}
|
||||
if (!foundPrototype) {
|
||||
console.warn(definition.tag + " prototype not found in prototype chain for " + definition.is);
|
||||
}
|
||||
definition.native = nativePrototype;
|
||||
}
|
||||
}
|
||||
function instantiate(definition) {
|
||||
return upgradeWithDefinition(domCreateElement(definition.tag), definition);
|
||||
}
|
||||
var registry = {};
|
||||
function getRegisteredDefinition(name) {
|
||||
if (name) {
|
||||
return registry[name.toLowerCase()];
|
||||
}
|
||||
}
|
||||
function registerDefinition(name, definition) {
|
||||
registry[name] = definition;
|
||||
}
|
||||
function generateConstructor(definition) {
|
||||
return function() {
|
||||
return instantiate(definition);
|
||||
};
|
||||
}
|
||||
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
||||
function createElementNS(namespace, tag, typeExtension) {
|
||||
if (namespace === HTML_NAMESPACE) {
|
||||
return createElement(tag, typeExtension);
|
||||
} else {
|
||||
return domCreateElementNS(namespace, tag);
|
||||
}
|
||||
}
|
||||
function createElement(tag, typeExtension) {
|
||||
if (tag) {
|
||||
tag = tag.toLowerCase();
|
||||
}
|
||||
if (typeExtension) {
|
||||
typeExtension = typeExtension.toLowerCase();
|
||||
}
|
||||
var definition = getRegisteredDefinition(typeExtension || tag);
|
||||
if (definition) {
|
||||
if (tag == definition.tag && typeExtension == definition.is) {
|
||||
return new definition.ctor();
|
||||
}
|
||||
if (!typeExtension && !definition.is) {
|
||||
return new definition.ctor();
|
||||
}
|
||||
}
|
||||
var element;
|
||||
if (typeExtension) {
|
||||
element = createElement(tag);
|
||||
element.setAttribute("is", typeExtension);
|
||||
return element;
|
||||
}
|
||||
element = domCreateElement(tag);
|
||||
if (tag.indexOf("-") >= 0) {
|
||||
implementPrototype(element, HTMLElement);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
var domCreateElement = document.createElement.bind(document);
|
||||
var domCreateElementNS = document.createElementNS.bind(document);
|
||||
var isInstance;
|
||||
if (!Object.__proto__ && !useNative) {
|
||||
isInstance = function(obj, ctor) {
|
||||
if (obj instanceof ctor) {
|
||||
return true;
|
||||
}
|
||||
var p = obj;
|
||||
while (p) {
|
||||
if (p === ctor.prototype) {
|
||||
return true;
|
||||
}
|
||||
p = p.__proto__;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
} else {
|
||||
isInstance = function(obj, base) {
|
||||
return obj instanceof base;
|
||||
};
|
||||
}
|
||||
function wrapDomMethodToForceUpgrade(obj, methodName) {
|
||||
var orig = obj[methodName];
|
||||
obj[methodName] = function() {
|
||||
var n = orig.apply(this, arguments);
|
||||
upgradeAll(n);
|
||||
return n;
|
||||
};
|
||||
}
|
||||
wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
|
||||
wrapDomMethodToForceUpgrade(document, "importNode");
|
||||
if (isIE) {
|
||||
(function() {
|
||||
var importNode = document.importNode;
|
||||
document.importNode = function() {
|
||||
var n = importNode.apply(document, arguments);
|
||||
if (n.nodeType == n.DOCUMENT_FRAGMENT_NODE) {
|
||||
var f = document.createDocumentFragment();
|
||||
f.appendChild(n);
|
||||
return f;
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
};
|
||||
})();
|
||||
}
|
||||
document.registerElement = register;
|
||||
document.createElement = createElement;
|
||||
document.createElementNS = createElementNS;
|
||||
scope.registry = registry;
|
||||
scope.instanceof = isInstance;
|
||||
scope.reservedTagList = reservedTagList;
|
||||
scope.getRegisteredDefinition = getRegisteredDefinition;
|
||||
document.register = document.registerElement;
|
||||
});
|
||||
|
||||
(function(scope) {
|
||||
var useNative = scope.useNative;
|
||||
var initializeModules = scope.initializeModules;
|
||||
var isIE = scope.isIE;
|
||||
if (useNative) {
|
||||
var nop = function() {};
|
||||
scope.watchShadow = nop;
|
||||
scope.upgrade = nop;
|
||||
scope.upgradeAll = nop;
|
||||
scope.upgradeDocumentTree = nop;
|
||||
scope.upgradeSubtree = nop;
|
||||
scope.takeRecords = nop;
|
||||
scope.instanceof = function(obj, base) {
|
||||
return obj instanceof base;
|
||||
};
|
||||
} else {
|
||||
initializeModules();
|
||||
}
|
||||
var upgradeDocumentTree = scope.upgradeDocumentTree;
|
||||
var upgradeDocument = scope.upgradeDocument;
|
||||
if (!window.wrap) {
|
||||
if (window.ShadowDOMPolyfill) {
|
||||
window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded;
|
||||
window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded;
|
||||
} else {
|
||||
window.wrap = window.unwrap = function(node) {
|
||||
return node;
|
||||
};
|
||||
}
|
||||
}
|
||||
if (window.HTMLImports) {
|
||||
window.HTMLImports.__importsParsingHook = function(elt) {
|
||||
if (elt.import) {
|
||||
upgradeDocument(wrap(elt.import));
|
||||
}
|
||||
};
|
||||
}
|
||||
function bootstrap() {
|
||||
upgradeDocumentTree(window.wrap(document));
|
||||
window.CustomElements.ready = true;
|
||||
var requestAnimationFrame = window.requestAnimationFrame || function(f) {
|
||||
setTimeout(f, 16);
|
||||
};
|
||||
requestAnimationFrame(function() {
|
||||
setTimeout(function() {
|
||||
window.CustomElements.readyTime = Date.now();
|
||||
if (window.HTMLImports) {
|
||||
window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime;
|
||||
}
|
||||
document.dispatchEvent(new CustomEvent("WebComponentsReady", {
|
||||
bubbles: true
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
e.preventDefault = function() {
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (document.readyState === "complete" || scope.flags.eager) {
|
||||
bootstrap();
|
||||
} else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
|
||||
bootstrap();
|
||||
} else {
|
||||
var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
|
||||
window.addEventListener(loadEvent, bootstrap);
|
||||
}
|
||||
})(window.CustomElements);
|
11
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/CustomElements.min.js
поставляемый
Normal file
11
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/CustomElements.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
1096
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/HTMLImports.js
поставляемый
Normal file
1096
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/HTMLImports.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
11
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/HTMLImports.min.js
поставляемый
Normal file
11
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/HTMLImports.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
350
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/MutationObserver.js
поставляемый
Normal file
350
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/MutationObserver.js
поставляемый
Normal file
|
@ -0,0 +1,350 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
// @version 0.7.15
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
var counter = Date.now() % 1e9;
|
||||
var WeakMap = function() {
|
||||
this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
|
||||
};
|
||||
WeakMap.prototype = {
|
||||
set: function(key, value) {
|
||||
var entry = key[this.name];
|
||||
if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
|
||||
value: [ key, value ],
|
||||
writable: true
|
||||
});
|
||||
return this;
|
||||
},
|
||||
get: function(key) {
|
||||
var entry;
|
||||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
|
||||
},
|
||||
"delete": function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry || entry[0] !== key) return false;
|
||||
entry[0] = entry[1] = undefined;
|
||||
return true;
|
||||
},
|
||||
has: function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry) return false;
|
||||
return entry[0] === key;
|
||||
}
|
||||
};
|
||||
window.WeakMap = WeakMap;
|
||||
})();
|
||||
}
|
||||
|
||||
(function(global) {
|
||||
if (global.JsMutationObserver) {
|
||||
return;
|
||||
}
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
setImmediate = setTimeout;
|
||||
} else if (window.setImmediate) {
|
||||
setImmediate = window.setImmediate;
|
||||
} else {
|
||||
var setImmediateQueue = [];
|
||||
var sentinel = String(Math.random());
|
||||
window.addEventListener("message", function(e) {
|
||||
if (e.data === sentinel) {
|
||||
var queue = setImmediateQueue;
|
||||
setImmediateQueue = [];
|
||||
queue.forEach(function(func) {
|
||||
func();
|
||||
});
|
||||
}
|
||||
});
|
||||
setImmediate = function(func) {
|
||||
setImmediateQueue.push(func);
|
||||
window.postMessage(sentinel, "*");
|
||||
};
|
||||
}
|
||||
var isScheduled = false;
|
||||
var scheduledObservers = [];
|
||||
function scheduleCallback(observer) {
|
||||
scheduledObservers.push(observer);
|
||||
if (!isScheduled) {
|
||||
isScheduled = true;
|
||||
setImmediate(dispatchCallbacks);
|
||||
}
|
||||
}
|
||||
function wrapIfNeeded(node) {
|
||||
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
|
||||
}
|
||||
function dispatchCallbacks() {
|
||||
isScheduled = false;
|
||||
var observers = scheduledObservers;
|
||||
scheduledObservers = [];
|
||||
observers.sort(function(o1, o2) {
|
||||
return o1.uid_ - o2.uid_;
|
||||
});
|
||||
var anyNonEmpty = false;
|
||||
observers.forEach(function(observer) {
|
||||
var queue = observer.takeRecords();
|
||||
removeTransientObserversFor(observer);
|
||||
if (queue.length) {
|
||||
observer.callback_(queue, observer);
|
||||
anyNonEmpty = true;
|
||||
}
|
||||
});
|
||||
if (anyNonEmpty) dispatchCallbacks();
|
||||
}
|
||||
function removeTransientObserversFor(observer) {
|
||||
observer.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) return;
|
||||
registrations.forEach(function(registration) {
|
||||
if (registration.observer === observer) registration.removeTransientObservers();
|
||||
});
|
||||
});
|
||||
}
|
||||
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
|
||||
for (var node = target; node; node = node.parentNode) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (registrations) {
|
||||
for (var j = 0; j < registrations.length; j++) {
|
||||
var registration = registrations[j];
|
||||
var options = registration.options;
|
||||
if (node !== target && !options.subtree) continue;
|
||||
var record = callback(options);
|
||||
if (record) registration.enqueue(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var uidCounter = 0;
|
||||
function JsMutationObserver(callback) {
|
||||
this.callback_ = callback;
|
||||
this.nodes_ = [];
|
||||
this.records_ = [];
|
||||
this.uid_ = ++uidCounter;
|
||||
}
|
||||
JsMutationObserver.prototype = {
|
||||
observe: function(target, options) {
|
||||
target = wrapIfNeeded(target);
|
||||
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
|
||||
throw new SyntaxError();
|
||||
}
|
||||
var registrations = registrationsTable.get(target);
|
||||
if (!registrations) registrationsTable.set(target, registrations = []);
|
||||
var registration;
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i].observer === this) {
|
||||
registration = registrations[i];
|
||||
registration.removeListeners();
|
||||
registration.options = options;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!registration) {
|
||||
registration = new Registration(this, target, options);
|
||||
registrations.push(registration);
|
||||
this.nodes_.push(target);
|
||||
}
|
||||
registration.addListeners();
|
||||
},
|
||||
disconnect: function() {
|
||||
this.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
var registration = registrations[i];
|
||||
if (registration.observer === this) {
|
||||
registration.removeListeners();
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
this.records_ = [];
|
||||
},
|
||||
takeRecords: function() {
|
||||
var copyOfRecords = this.records_;
|
||||
this.records_ = [];
|
||||
return copyOfRecords;
|
||||
}
|
||||
};
|
||||
function MutationRecord(type, target) {
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.addedNodes = [];
|
||||
this.removedNodes = [];
|
||||
this.previousSibling = null;
|
||||
this.nextSibling = null;
|
||||
this.attributeName = null;
|
||||
this.attributeNamespace = null;
|
||||
this.oldValue = null;
|
||||
}
|
||||
function copyMutationRecord(original) {
|
||||
var record = new MutationRecord(original.type, original.target);
|
||||
record.addedNodes = original.addedNodes.slice();
|
||||
record.removedNodes = original.removedNodes.slice();
|
||||
record.previousSibling = original.previousSibling;
|
||||
record.nextSibling = original.nextSibling;
|
||||
record.attributeName = original.attributeName;
|
||||
record.attributeNamespace = original.attributeNamespace;
|
||||
record.oldValue = original.oldValue;
|
||||
return record;
|
||||
}
|
||||
var currentRecord, recordWithOldValue;
|
||||
function getRecord(type, target) {
|
||||
return currentRecord = new MutationRecord(type, target);
|
||||
}
|
||||
function getRecordWithOldValue(oldValue) {
|
||||
if (recordWithOldValue) return recordWithOldValue;
|
||||
recordWithOldValue = copyMutationRecord(currentRecord);
|
||||
recordWithOldValue.oldValue = oldValue;
|
||||
return recordWithOldValue;
|
||||
}
|
||||
function clearRecords() {
|
||||
currentRecord = recordWithOldValue = undefined;
|
||||
}
|
||||
function recordRepresentsCurrentMutation(record) {
|
||||
return record === recordWithOldValue || record === currentRecord;
|
||||
}
|
||||
function selectRecord(lastRecord, newRecord) {
|
||||
if (lastRecord === newRecord) return lastRecord;
|
||||
if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
|
||||
return null;
|
||||
}
|
||||
function Registration(observer, target, options) {
|
||||
this.observer = observer;
|
||||
this.target = target;
|
||||
this.options = options;
|
||||
this.transientObservedNodes = [];
|
||||
}
|
||||
Registration.prototype = {
|
||||
enqueue: function(record) {
|
||||
var records = this.observer.records_;
|
||||
var length = records.length;
|
||||
if (records.length > 0) {
|
||||
var lastRecord = records[length - 1];
|
||||
var recordToReplaceLast = selectRecord(lastRecord, record);
|
||||
if (recordToReplaceLast) {
|
||||
records[length - 1] = recordToReplaceLast;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
scheduleCallback(this.observer);
|
||||
}
|
||||
records[length] = record;
|
||||
},
|
||||
addListeners: function() {
|
||||
this.addListeners_(this.target);
|
||||
},
|
||||
addListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
removeListeners: function() {
|
||||
this.removeListeners_(this.target);
|
||||
},
|
||||
removeListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
addTransientObserver: function(node) {
|
||||
if (node === this.target) return;
|
||||
this.addListeners_(node);
|
||||
this.transientObservedNodes.push(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) registrationsTable.set(node, registrations = []);
|
||||
registrations.push(this);
|
||||
},
|
||||
removeTransientObservers: function() {
|
||||
var transientObservedNodes = this.transientObservedNodes;
|
||||
this.transientObservedNodes = [];
|
||||
transientObservedNodes.forEach(function(node) {
|
||||
this.removeListeners_(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i] === this) {
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
handleEvent: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
switch (e.type) {
|
||||
case "DOMAttrModified":
|
||||
var name = e.attrName;
|
||||
var namespace = e.relatedNode.namespaceURI;
|
||||
var target = e.target;
|
||||
var record = new getRecord("attributes", target);
|
||||
record.attributeName = name;
|
||||
record.attributeNamespace = namespace;
|
||||
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.attributes) return;
|
||||
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
|
||||
return;
|
||||
}
|
||||
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMCharacterDataModified":
|
||||
var target = e.target;
|
||||
var record = getRecord("characterData", target);
|
||||
var oldValue = e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.characterData) return;
|
||||
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMNodeRemoved":
|
||||
this.addTransientObserver(e.target);
|
||||
|
||||
case "DOMNodeInserted":
|
||||
var changedNode = e.target;
|
||||
var addedNodes, removedNodes;
|
||||
if (e.type === "DOMNodeInserted") {
|
||||
addedNodes = [ changedNode ];
|
||||
removedNodes = [];
|
||||
} else {
|
||||
addedNodes = [];
|
||||
removedNodes = [ changedNode ];
|
||||
}
|
||||
var previousSibling = changedNode.previousSibling;
|
||||
var nextSibling = changedNode.nextSibling;
|
||||
var record = getRecord("childList", e.target.parentNode);
|
||||
record.addedNodes = addedNodes;
|
||||
record.removedNodes = removedNodes;
|
||||
record.previousSibling = previousSibling;
|
||||
record.nextSibling = nextSibling;
|
||||
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
|
||||
if (!options.childList) return;
|
||||
return record;
|
||||
});
|
||||
}
|
||||
clearRecords();
|
||||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) {
|
||||
global.MutationObserver = JsMutationObserver;
|
||||
JsMutationObserver._isPolyfilled = true;
|
||||
}
|
||||
})(self);
|
11
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/MutationObserver.min.js
поставляемый
Normal file
11
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/MutationObserver.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
125
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/README.md
поставляемый
Normal file
125
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/README.md
поставляемый
Normal file
|
@ -0,0 +1,125 @@
|
|||
webcomponents.js
|
||||
================
|
||||
|
||||
[![Join the chat at https://gitter.im/webcomponents/webcomponentsjs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/webcomponents/webcomponentsjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
A suite of polyfills supporting the [Web Components](http://webcomponents.org) specs:
|
||||
|
||||
**Custom Elements**: allows authors to define their own custom tags ([spec](https://w3c.github.io/webcomponents/spec/custom/)).
|
||||
|
||||
**HTML Imports**: a way to include and reuse HTML documents via other HTML documents ([spec](https://w3c.github.io/webcomponents/spec/imports/)).
|
||||
|
||||
**Shadow DOM**: provides encapsulation by hiding DOM subtrees under shadow roots ([spec](https://w3c.github.io/webcomponents/spec/shadow/)).
|
||||
|
||||
This also folds in polyfills for `MutationObserver` and `WeakMap`.
|
||||
|
||||
|
||||
## Releases
|
||||
|
||||
Pre-built (concatenated & minified) versions of the polyfills are maintained in the [tagged versions](https://github.com/webcomponents/webcomponentsjs/releases) of this repo. There are two variants:
|
||||
|
||||
`webcomponents.js` includes all of the polyfills.
|
||||
|
||||
`webcomponents-lite.js` includes all polyfills except for shadow DOM.
|
||||
|
||||
|
||||
## Browser Support
|
||||
|
||||
Our polyfills are intended to work in the latest versions of evergreen browsers. See below
|
||||
for our complete browser support matrix:
|
||||
|
||||
| Polyfill | IE10 | IE11+ | Chrome* | Firefox* | Safari 7+* | Chrome Android* | Mobile Safari* |
|
||||
| ---------- |:----:|:-----:|:-------:|:--------:|:----------:|:---------------:|:--------------:|
|
||||
| Custom Elements | ~ | ✓ | ✓ | ✓ | ✓ | ✓| ✓ |
|
||||
| HTML Imports | ~ | ✓ | ✓ | ✓ | ✓| ✓| ✓ |
|
||||
| Shadow DOM | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Templates | ✓ | ✓ | ✓ | ✓| ✓ | ✓ | ✓ |
|
||||
|
||||
|
||||
*Indicates the current version of the browser
|
||||
|
||||
~Indicates support may be flaky. If using Custom Elements or HTML Imports with Shadow DOM,
|
||||
you will get the non-flaky Mutation Observer polyfill that Shadow DOM includes.
|
||||
|
||||
The polyfills may work in older browsers, however require additional polyfills (such as classList)
|
||||
to be used. We cannot guarantee support for browsers outside of our compatibility matrix.
|
||||
|
||||
|
||||
### Manually Building
|
||||
|
||||
If you wish to build the polyfills yourself, you'll need `node` and `gulp` on your system:
|
||||
|
||||
* install [node.js](http://nodejs.org/) using the instructions on their website
|
||||
* use `npm` to install [gulp.js](http://gulpjs.com/): `npm install -g gulp`
|
||||
|
||||
Now you are ready to build the polyfills with:
|
||||
|
||||
# install dependencies
|
||||
npm install
|
||||
# build
|
||||
gulp build
|
||||
|
||||
The builds will be placed into the `dist/` directory.
|
||||
|
||||
## Contribute
|
||||
|
||||
See the [contributing guide](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
Everything in this repository is BSD style license unless otherwise specified.
|
||||
|
||||
Copyright (c) 2015 The Polymer Authors. All rights reserved.
|
||||
|
||||
## Helper utilities
|
||||
|
||||
### `WebComponentsReady`
|
||||
|
||||
Under native HTML Imports, `<script>` tags in the main document block the loading of such imports. This is to ensure the imports have loaded and any registered elements in them have been upgraded.
|
||||
|
||||
The webcomponents.js and webcomponents-lite.js polyfills parse element definitions and handle their upgrade asynchronously. If prematurely fetching the element from the DOM before it has an opportunity to upgrade, you'll be working with an `HTMLUnknownElement`.
|
||||
|
||||
For these situations (or when you need an approximate replacement for the Polymer 0.5 `polymer-ready` behavior), you can use the `WebComponentsReady` event as a signal before interacting with the element. The criteria for this event to fire is all Custom Elements with definitions registered by the time HTML Imports available at load time have loaded have upgraded.
|
||||
|
||||
```js
|
||||
window.addEventListener('WebComponentsReady', function(e) {
|
||||
// imports are loaded and elements have been registered
|
||||
console.log('Components are ready');
|
||||
});
|
||||
```
|
||||
|
||||
## Known Issues
|
||||
|
||||
* [Custom element's constructor property is unreliable](#constructor)
|
||||
* [Contenteditable elements do not trigger MutationObserver](#contentedit)
|
||||
* [ShadowCSS: :host-context(...):host(...) doesn't work](#hostcontext)
|
||||
* [execCommand isn't supported under Shadow DOM](#execcommand)
|
||||
|
||||
### Custom element's constructor property is unreliable <a id="constructor"></a>
|
||||
See [#215](https://github.com/webcomponents/webcomponentsjs/issues/215) for background.
|
||||
|
||||
In Safari and IE, instances of Custom Elements have a `constructor` property of `HTMLUnknownElementConstructor` and `HTMLUnknownElement`, respectively. It's unsafe to rely on this property for checking element types.
|
||||
|
||||
It's worth noting that `customElement.__proto__.__proto__.constructor` is `HTMLElementPrototype` and that the prototype chain isn't modified by the polyfills(onto `ElementPrototype`, etc.)
|
||||
|
||||
### Contenteditable elements do not trigger MutationObserver <a id="contentedit"></a>
|
||||
Using the MutationObserver polyfill, it isn't possible to monitor mutations of an element marked `contenteditable`.
|
||||
See [the mailing list](https://groups.google.com/forum/#!msg/polymer-dev/LHdtRVXXVsA/v1sGoiTYWUkJ)
|
||||
|
||||
### ShadowCSS: :host-context(...):host(...) doesn't work <a id="hostcontext"></a>
|
||||
See [#16](https://github.com/webcomponents/webcomponentsjs/issues/16) for background.
|
||||
|
||||
Under the shadow DOM polyfill, rules like:
|
||||
```
|
||||
:host-context(.foo):host(.bar) {...}
|
||||
```
|
||||
don't work, despite working under native Shadow DOM. The solution is to use `polyfill-next-selector` like:
|
||||
|
||||
```
|
||||
polyfill-next-selector { content: '.foo :host.bar, :host.foo.bar'; }
|
||||
```
|
||||
|
||||
### execCommand and contenteditable isn't supported under Shadow DOM <a id="execcommand"></a>
|
||||
See [#212](https://github.com/webcomponents/webcomponentsjs/issues/212)
|
||||
|
||||
`execCommand`, and `contenteditable` aren't supported under the ShadowDOM polyfill, with commands that insert or remove nodes being especially prone to failure.
|
4432
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/ShadowDOM.js
поставляемый
Normal file
4432
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/ShadowDOM.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
13
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/ShadowDOM.min.js
поставляемый
Normal file
13
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/ShadowDOM.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
18
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/bower.json
поставляемый
Normal file
18
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/bower.json
поставляемый
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.15",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"webcomponents"
|
||||
],
|
||||
"license": "BSD",
|
||||
"ignore": []
|
||||
}
|
31
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/package.json
поставляемый
Normal file
31
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/package.json
поставляемый
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"name": "webcomponents.js",
|
||||
"version": "0.7.15",
|
||||
"description": "webcomponents.js",
|
||||
"main": "webcomponents.js",
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"author": "The Polymer Authors",
|
||||
"license": {
|
||||
"type": "BSD-3-Clause",
|
||||
"url": "http://polymer.github.io/LICENSE.txt"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs/issues"
|
||||
},
|
||||
"homepage": "http://webcomponents.org",
|
||||
"devDependencies": {
|
||||
"gulp": "^3.8.8",
|
||||
"gulp-audit": "^1.0.0",
|
||||
"gulp-concat": "^2.4.1",
|
||||
"gulp-header": "^1.1.1",
|
||||
"gulp-uglify": "^1.0.1",
|
||||
"run-sequence": "^1.0.1",
|
||||
"web-component-tester": "*"
|
||||
}
|
||||
}
|
2409
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/webcomponents-lite.js
поставляемый
Normal file
2409
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/webcomponents-lite.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
12
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/webcomponents-lite.min.js
поставляемый
Normal file
12
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/webcomponents-lite.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
7138
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/webcomponents.js
поставляемый
Normal file
7138
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/webcomponents.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
14
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/webcomponents.min.js
поставляемый
Normal file
14
q3-2015/data.driven.deliveries/bower_components/webcomponentsjs/webcomponents.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,124 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Jen's Awesome Party Spreadsheet</title>
|
||||
<link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>
|
||||
|
||||
|
||||
<link href="//kendo.cdn.telerik.com/2015.3.930/styles/kendo.common-nova.min.css" rel="stylesheet">
|
||||
<link href="//kendo.cdn.telerik.com/2015.3.930/styles/kendo.nova.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="styles/custom.css" />
|
||||
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/kendo.all.min.js"></script>
|
||||
<script src="js/faker.min.js"></script>
|
||||
|
||||
<script src="bower_components/everlive/min/everlive.all.min.js"></script>
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="cake">
|
||||
<div class="plate"></div>
|
||||
<div class="layer layer-middle"></div>
|
||||
<div class="layer layer-top"></div>
|
||||
<div class="icing"></div>
|
||||
<div class="drip drip1"></div>
|
||||
<div class="drip drip3"></div>
|
||||
<div class="candle1">
|
||||
<div class="flame1"></div>
|
||||
</div>
|
||||
<div class="candle2">
|
||||
<div class="flame2"></div>
|
||||
</div>
|
||||
<div class="candle3">
|
||||
<div class="flame3"></div>
|
||||
</div>
|
||||
<div class="candle4">
|
||||
<div class="flame4"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text">Kendo UI Birthday Party Deliveries!</div>
|
||||
|
||||
<div id="example">
|
||||
|
||||
<div id="spreadsheet" style="width: 100%"></div>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
var el = new Everlive({
|
||||
apiKey: 'oUEbTsfEZtk5tvas',
|
||||
scheme: 'https'
|
||||
});
|
||||
var fieldsExp = {
|
||||
"Id":1,
|
||||
"Description": 1,
|
||||
"Status": 1,
|
||||
"Source": 1
|
||||
};
|
||||
var dataSource = new kendo.data.DataSource({
|
||||
type: 'everlive',
|
||||
transport: {
|
||||
typeName: 'Deliveries',
|
||||
read: {
|
||||
headers: {
|
||||
"X-Everlive-Fields": JSON.stringify(fieldsExp)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
schema: {
|
||||
model: { id: Everlive.idField }
|
||||
}
|
||||
});
|
||||
|
||||
$("#spreadsheet").kendoSpreadsheet({
|
||||
columns: 20,
|
||||
rows: 100,
|
||||
sheets: [{
|
||||
name: "Deliveries",
|
||||
dataSource: dataSource,
|
||||
rows: [{
|
||||
height: 40,
|
||||
cells: [
|
||||
{
|
||||
bold: "true",
|
||||
background: "#9c27b0",
|
||||
textAlign: "center",
|
||||
color: "white"
|
||||
},{
|
||||
bold: "true",
|
||||
background: "#9c27b0",
|
||||
textAlign: "center",
|
||||
color: "white"
|
||||
},{
|
||||
bold: "true",
|
||||
background: "#9c27b0",
|
||||
textAlign: "center",
|
||||
color: "white"
|
||||
},{
|
||||
bold: "true",
|
||||
background: "#9c27b0",
|
||||
textAlign: "center",
|
||||
color: "white"
|
||||
}]
|
||||
}],
|
||||
columns: [
|
||||
{ width: 200 },
|
||||
{ width: 200 },
|
||||
{ width: 200 },
|
||||
{ width: 300 }
|
||||
]
|
||||
}]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -0,0 +1,254 @@
|
|||
|
||||
body {
|
||||
background-color: #0099CC;
|
||||
}
|
||||
|
||||
#example{
|
||||
padding-top:100px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
.text{
|
||||
font: 50px "Pacifico", cursive;
|
||||
color: white;
|
||||
padding-top: 50px;
|
||||
padding-left:20%;
|
||||
text-shadow: 1px 1px #0082AD;
|
||||
}
|
||||
/*Nova override*/
|
||||
.k-tabstrip-items {
|
||||
background-image: none;
|
||||
background-image: none,-webkit-gradient(linear,left top,left bottom,from(#B1E645),to(#A5E234)) !important;
|
||||
/* background-image: none,-webkit-linear-gradient(top,#303553 0,#072138 100%); */
|
||||
/* background-image: none,linear-gradient(to bottom,#303553 0,#072138 100%); */
|
||||
}
|
||||
.k-tabstrip-top>.k-tabstrip-items .k-item.k-state-active, .k-tabstrip-top>.k-tabstrip-items .k-item.k-state-hover, .k-spreadsheet .k-spreadsheet-quick-access-toolbar .k-button:hover, .k-spreadsheet .k-spreadsheet-sheets-bar .k-button:hover {
|
||||
background-image: none;
|
||||
background-image: none,-webkit-gradient(linear,left top,left bottom,from(#FFB600),to(#FCBC19)) !important;
|
||||
background-image: none,-webkit-linear-gradient(top,#FFB600 0,#FCBC19 100%) !important;
|
||||
background-image: none,linear-gradient(to bottom,#FFB600 0,#FCBC19 100%) !important;
|
||||
border-bottom-color: #DA4FBC !important;
|
||||
}
|
||||
|
||||
/*css cake* - forked from http://codepen.io/WithAnEs/pen/OVZRvg*/
|
||||
.cake {
|
||||
position: absolute;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
top: 50px;
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
.plate {
|
||||
width: 220px;
|
||||
height: 110px;
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
left: -10px;
|
||||
background-color: #ccc;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 2px 0 #b3b3b3, 0 4px 0 #b3b3b3, 0 5px 40px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.cake > * {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.layer {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 200px;
|
||||
height: 100px;
|
||||
border-radius: 50%;
|
||||
background-color: #553c13;
|
||||
box-shadow: 0 2px 0px #6a4b18, 0 4px 0px #33240b, 0 6px 0px #32230b, 0 8px 0px #31230b, 0 10px 0px #30220b, 0 12px 0px #2f220b, 0 14px 0px #2f210a, 0 16px 0px #2e200a, 0 18px 0px #2d200a, 0 20px 0px #2c1f0a, 0 22px 0px #2b1f0a, 0 24px 0px #2a1e09, 0 26px 0px #2a1d09, 0 28px 0px #291d09, 0 30px 0px #281c09;
|
||||
}
|
||||
|
||||
.layer-top {
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.layer-middle {
|
||||
top: 33px;
|
||||
}
|
||||
|
||||
.layer-bottom {
|
||||
top: 66px;
|
||||
}
|
||||
|
||||
.icing {
|
||||
top: 2px;
|
||||
left: 5px;
|
||||
background-color: #f0e4d0;
|
||||
width: 190px;
|
||||
height: 90px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.icing:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 5px;
|
||||
bottom: 6px;
|
||||
left: 5px;
|
||||
background-color: #f4ebdc;
|
||||
box-shadow: 0 0 4px #f6efe3, 0 0 4px #f6efe3, 0 0 4px #f6efe3;
|
||||
border-radius: 50%;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.drip {
|
||||
display: block;
|
||||
width: 50px;
|
||||
height: 60px;
|
||||
border-bottom-left-radius: 25px;
|
||||
border-bottom-right-radius: 25px;
|
||||
background-color: #f0e4d0;
|
||||
}
|
||||
|
||||
.drip1 {
|
||||
top: 53px;
|
||||
left: 5px;
|
||||
transform: skewY(15deg);
|
||||
height: 48px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.drip3 {
|
||||
top: 54px;
|
||||
left: 90px;
|
||||
width: 80px;
|
||||
border-bottom-left-radius: 40px;
|
||||
border-bottom-right-radius: 40px;
|
||||
}
|
||||
|
||||
.candle1 {
|
||||
background-color: #886CCC;
|
||||
width: 16px;
|
||||
height: 50px;
|
||||
border-radius: 8px / 4px;
|
||||
top: 10px;
|
||||
left: 40%;
|
||||
margin-left: -8px;
|
||||
z-index: 10;
|
||||
}
|
||||
.candle2 {
|
||||
background-color: #DA4FBC;
|
||||
width: 16px;
|
||||
height: 50px;
|
||||
border-radius: 8px / 4px;
|
||||
top: -10px;
|
||||
left: 60%;
|
||||
margin-left: -8px;
|
||||
z-index: 10;
|
||||
}
|
||||
.candle3 {
|
||||
background-color: #B1E645;
|
||||
width: 16px;
|
||||
height: 50px;
|
||||
border-radius: 8px / 4px;
|
||||
top: -5px;
|
||||
left: 20%;
|
||||
margin-left: -8px;
|
||||
z-index: 10;
|
||||
}
|
||||
.candle4 {
|
||||
background-color: #FFB600;
|
||||
width: 16px;
|
||||
height: 50px;
|
||||
border-radius: 8px / 4px;
|
||||
top: 5px;
|
||||
left: 80%;
|
||||
margin-left: -8px;
|
||||
z-index: 10;
|
||||
}
|
||||
.candle:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 16px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: #E24F61;
|
||||
}
|
||||
|
||||
.flame1 {
|
||||
position: absolute;
|
||||
background-color: orange;
|
||||
width: 15px;
|
||||
height: 35px;
|
||||
border-radius: 10px 10px 10px 10px / 25px 25px 10px 10px;
|
||||
top: -34px;
|
||||
left: 50%;
|
||||
margin-left: -7.5px;
|
||||
z-index: 10;
|
||||
box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
|
||||
transform-origin: 50% 90%;
|
||||
animation: flicker .85s ease-in-out alternate infinite;
|
||||
}
|
||||
.flame2 {
|
||||
position: absolute;
|
||||
background-color: orange;
|
||||
width: 15px;
|
||||
height: 35px;
|
||||
border-radius: 10px 10px 10px 10px / 25px 25px 10px 10px;
|
||||
top: -34px;
|
||||
left: 50%;
|
||||
margin-left: -7.5px;
|
||||
z-index: 10;
|
||||
box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
|
||||
transform-origin: 50% 90%;
|
||||
animation: flicker .75s ease-in-out alternate infinite;
|
||||
}
|
||||
.flame3 {
|
||||
position: absolute;
|
||||
background-color: orange;
|
||||
width: 15px;
|
||||
height: 35px;
|
||||
border-radius: 10px 10px 10px 10px / 25px 25px 10px 10px;
|
||||
top: -34px;
|
||||
left: 50%;
|
||||
margin-left: -7.5px;
|
||||
z-index: 10;
|
||||
box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
|
||||
transform-origin: 50% 90%;
|
||||
animation: flicker .95s ease-in-out alternate infinite;
|
||||
}
|
||||
.flame4 {
|
||||
position: absolute;
|
||||
background-color: orange;
|
||||
width: 15px;
|
||||
height: 35px;
|
||||
border-radius: 10px 10px 10px 10px / 25px 25px 10px 10px;
|
||||
top: -34px;
|
||||
left: 50%;
|
||||
margin-left: -7.5px;
|
||||
z-index: 10;
|
||||
box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
|
||||
transform-origin: 50% 90%;
|
||||
animation: flicker .78s ease-in-out alternate infinite;
|
||||
}
|
||||
|
||||
@keyframes flicker {
|
||||
0% {
|
||||
transform: skewX(5deg);
|
||||
box-shadow: 0 0 10px rgba(255, 165, 0, 0.2), 0 0 20px rgba(255, 165, 0, 0.2), 0 0 60px rgba(255, 165, 0, 0.2), 0 0 80px rgba(255, 165, 0, 0.2);
|
||||
}
|
||||
25% {
|
||||
transform: skewX(-5deg);
|
||||
box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
|
||||
}
|
||||
50% {
|
||||
transform: skewX(10deg);
|
||||
box-shadow: 0 0 10px rgba(255, 165, 0, 0.3), 0 0 20px rgba(255, 165, 0, 0.3), 0 0 60px rgba(255, 165, 0, 0.3), 0 0 80px rgba(255, 165, 0, 0.3);
|
||||
}
|
||||
75% {
|
||||
transform: skewX(-10deg);
|
||||
box-shadow: 0 0 10px rgba(255, 165, 0, 0.4), 0 0 20px rgba(255, 165, 0, 0.4), 0 0 60px rgba(255, 165, 0, 0.4), 0 0 80px rgba(255, 165, 0, 0.4);
|
||||
}
|
||||
100% {
|
||||
transform: skewX(5deg);
|
||||
box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
|
||||
}
|
||||
}
|
38
q3-2015/import.export.deliveries/bower_components/emoji-rain/.bower.json
поставляемый
Normal file
38
q3-2015/import.export.deliveries/bower_components/emoji-rain/.bower.json
поставляемый
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "emoji-rain",
|
||||
"version": "1.0.0",
|
||||
"description": "A polymer element that makes it rain emoji",
|
||||
"main": "emoji-rain.html",
|
||||
"author": [
|
||||
"Monica Dinculescu <noms@google.com>"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"emoji",
|
||||
"rain"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/notwaldorf/emoji-rain.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"homepage": "https://github.com/notwaldorf/emoji-rain",
|
||||
"_release": "1.0.0",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.0",
|
||||
"commit": "a5d9d393826f0ff0c883dbd7241445ca4b7a4677"
|
||||
},
|
||||
"_source": "git://github.com/notwaldorf/emoji-rain.git",
|
||||
"_target": "~1.0.0",
|
||||
"_originalSource": "emoji-rain",
|
||||
"_direct": true
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
# :sparkles: emoji-rain :sparkles:
|
||||
|
||||
`<emoji-rain>` is a Polymer element that makes it rain emoji on any page. Because it can.
|
||||
|
||||
<img width="500" alt="emoji rain" src="https://cloud.githubusercontent.com/assets/1369170/9401459/86c67a76-4784-11e5-8716-3300c96a7e20.gif">
|
||||
|
||||
☔️ The number of drops is configurable (by default it's set to 250). The `active`
|
||||
attribute determines whether the emoji are raining, but you can also manually
|
||||
`start()` and `stop()` the rain.
|
||||
|
||||
Example:
|
||||
```html
|
||||
<emoji-rain drops="100" active></emoji-rain>
|
||||
```
|
||||
|
||||
💸️ Optionally, you can also use the Twitter emoji instead of the native ones.
|
||||
`twemoji.js` and all its images will only be loaded on demand, so if you don't
|
||||
want to eat the performance cost, you don't have to:
|
||||
```html
|
||||
<emoji-rain use-twemoji></emoji-rain>
|
||||
```
|
||||
|
||||
## Usage
|
||||
Install with bower:
|
||||
```
|
||||
mkdir emoji-rain-demo && cd emoji-rain-demo
|
||||
bower install emoji-rain
|
||||
```
|
||||
Drop it in a page, next to the newly created `bower_components` folder:
|
||||
```html
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>zomg</title>
|
||||
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="bower_components/emoji-rain/emoji-rain.html">
|
||||
</head>
|
||||
<body>
|
||||
<emoji-rain active></emoji-rain>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
# :sparkles::umbrella::joy_cat:
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "emoji-rain",
|
||||
"version": "1.0.0",
|
||||
"description": "A polymer element that makes it rain emoji",
|
||||
"main": "emoji-rain.html",
|
||||
"author": [
|
||||
"Monica Dinculescu <noms@google.com>"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"emoji",
|
||||
"rain"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/notwaldorf/emoji-rain.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*"
|
||||
}
|
||||
}
|
37
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/.bower.json
поставляемый
Normal file
37
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/.bower.json
поставляемый
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.1.1",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"ignore": [
|
||||
"/.*",
|
||||
"/test/",
|
||||
"gen-changelog.sh"
|
||||
],
|
||||
"authors": [
|
||||
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Polymer/polymer.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"webcomponentsjs": "^0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"private": true,
|
||||
"homepage": "https://github.com/Polymer/polymer",
|
||||
"_release": "1.1.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.1",
|
||||
"commit": "c0bd5a73b4bd694b7fa5ead01ff558ed542f6bd8"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/polymer.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "Polymer/polymer"
|
||||
}
|
27
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/LICENSE.txt
поставляемый
Normal file
27
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/LICENSE.txt
поставляемый
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) 2014 The Polymer Authors. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
27
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/bower.json
поставляемый
Normal file
27
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/bower.json
поставляемый
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.1.1",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"ignore": [
|
||||
"/.*",
|
||||
"/test/",
|
||||
"gen-changelog.sh"
|
||||
],
|
||||
"authors": [
|
||||
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Polymer/polymer.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"webcomponentsjs": "^0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"private": true
|
||||
}
|
583
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer-micro.html
поставляемый
Normal file
583
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer-micro.html
поставляемый
Normal file
|
@ -0,0 +1,583 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
--><script>(function () {
|
||||
function resolve() {
|
||||
document.body.removeAttribute('unresolved');
|
||||
}
|
||||
if (window.WebComponents) {
|
||||
addEventListener('WebComponentsReady', resolve);
|
||||
} else {
|
||||
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
||||
resolve();
|
||||
} else {
|
||||
addEventListener('DOMContentLoaded', resolve);
|
||||
}
|
||||
}
|
||||
}());
|
||||
Polymer = {
|
||||
Settings: function () {
|
||||
var user = window.Polymer || {};
|
||||
location.search.slice(1).split('&').forEach(function (o) {
|
||||
o = o.split('=');
|
||||
o[0] && (user[o[0]] = o[1] || true);
|
||||
});
|
||||
var wantShadow = user.dom === 'shadow';
|
||||
var hasShadow = Boolean(Element.prototype.createShadowRoot);
|
||||
var nativeShadow = hasShadow && !window.ShadowDOMPolyfill;
|
||||
var useShadow = wantShadow && hasShadow;
|
||||
var hasNativeImports = Boolean('import' in document.createElement('link'));
|
||||
var useNativeImports = hasNativeImports;
|
||||
var useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
|
||||
return {
|
||||
wantShadow: wantShadow,
|
||||
hasShadow: hasShadow,
|
||||
nativeShadow: nativeShadow,
|
||||
useShadow: useShadow,
|
||||
useNativeShadow: useShadow && nativeShadow,
|
||||
useNativeImports: useNativeImports,
|
||||
useNativeCustomElements: useNativeCustomElements
|
||||
};
|
||||
}()
|
||||
};
|
||||
(function () {
|
||||
var userPolymer = window.Polymer;
|
||||
window.Polymer = function (prototype) {
|
||||
var ctor = desugar(prototype);
|
||||
prototype = ctor.prototype;
|
||||
var options = { prototype: prototype };
|
||||
if (prototype.extends) {
|
||||
options.extends = prototype.extends;
|
||||
}
|
||||
Polymer.telemetry._registrate(prototype);
|
||||
document.registerElement(prototype.is, options);
|
||||
return ctor;
|
||||
};
|
||||
var desugar = function (prototype) {
|
||||
var base = Polymer.Base;
|
||||
if (prototype.extends) {
|
||||
base = Polymer.Base._getExtendedPrototype(prototype.extends);
|
||||
}
|
||||
prototype = Polymer.Base.chainObject(prototype, base);
|
||||
prototype.registerCallback();
|
||||
return prototype.constructor;
|
||||
};
|
||||
window.Polymer = Polymer;
|
||||
if (userPolymer) {
|
||||
for (var i in userPolymer) {
|
||||
Polymer[i] = userPolymer[i];
|
||||
}
|
||||
}
|
||||
Polymer.Class = desugar;
|
||||
}());
|
||||
Polymer.telemetry = {
|
||||
registrations: [],
|
||||
_regLog: function (prototype) {
|
||||
console.log('[' + prototype.is + ']: registered');
|
||||
},
|
||||
_registrate: function (prototype) {
|
||||
this.registrations.push(prototype);
|
||||
Polymer.log && this._regLog(prototype);
|
||||
},
|
||||
dumpRegistrations: function () {
|
||||
this.registrations.forEach(this._regLog);
|
||||
}
|
||||
};
|
||||
Object.defineProperty(window, 'currentImport', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: function () {
|
||||
return (document._currentScript || document.currentScript).ownerDocument;
|
||||
}
|
||||
});
|
||||
Polymer.RenderStatus = {
|
||||
_ready: false,
|
||||
_callbacks: [],
|
||||
whenReady: function (cb) {
|
||||
if (this._ready) {
|
||||
cb();
|
||||
} else {
|
||||
this._callbacks.push(cb);
|
||||
}
|
||||
},
|
||||
_makeReady: function () {
|
||||
this._ready = true;
|
||||
this._callbacks.forEach(function (cb) {
|
||||
cb();
|
||||
});
|
||||
this._callbacks = [];
|
||||
},
|
||||
_catchFirstRender: function () {
|
||||
requestAnimationFrame(function () {
|
||||
Polymer.RenderStatus._makeReady();
|
||||
});
|
||||
}
|
||||
};
|
||||
if (window.HTMLImports) {
|
||||
HTMLImports.whenReady(function () {
|
||||
Polymer.RenderStatus._catchFirstRender();
|
||||
});
|
||||
} else {
|
||||
Polymer.RenderStatus._catchFirstRender();
|
||||
}
|
||||
Polymer.ImportStatus = Polymer.RenderStatus;
|
||||
Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;
|
||||
Polymer.Base = {
|
||||
__isPolymerInstance__: true,
|
||||
_addFeature: function (feature) {
|
||||
this.extend(this, feature);
|
||||
},
|
||||
registerCallback: function () {
|
||||
this._registerFeatures();
|
||||
this._doBehavior('registered');
|
||||
},
|
||||
createdCallback: function () {
|
||||
Polymer.telemetry.instanceCount++;
|
||||
this.root = this;
|
||||
this._doBehavior('created');
|
||||
this._initFeatures();
|
||||
},
|
||||
attachedCallback: function () {
|
||||
Polymer.RenderStatus.whenReady(function () {
|
||||
this.isAttached = true;
|
||||
this._doBehavior('attached');
|
||||
}.bind(this));
|
||||
},
|
||||
detachedCallback: function () {
|
||||
this.isAttached = false;
|
||||
this._doBehavior('detached');
|
||||
},
|
||||
attributeChangedCallback: function (name) {
|
||||
this._attributeChangedImpl(name);
|
||||
this._doBehavior('attributeChanged', arguments);
|
||||
},
|
||||
_attributeChangedImpl: function (name) {
|
||||
this._setAttributeToProperty(this, name);
|
||||
},
|
||||
extend: function (prototype, api) {
|
||||
if (prototype && api) {
|
||||
Object.getOwnPropertyNames(api).forEach(function (n) {
|
||||
this.copyOwnProperty(n, api, prototype);
|
||||
}, this);
|
||||
}
|
||||
return prototype || api;
|
||||
},
|
||||
mixin: function (target, source) {
|
||||
for (var i in source) {
|
||||
target[i] = source[i];
|
||||
}
|
||||
return target;
|
||||
},
|
||||
copyOwnProperty: function (name, source, target) {
|
||||
var pd = Object.getOwnPropertyDescriptor(source, name);
|
||||
if (pd) {
|
||||
Object.defineProperty(target, name, pd);
|
||||
}
|
||||
},
|
||||
_log: console.log.apply.bind(console.log, console),
|
||||
_warn: console.warn.apply.bind(console.warn, console),
|
||||
_error: console.error.apply.bind(console.error, console),
|
||||
_logf: function () {
|
||||
return this._logPrefix.concat([this.is]).concat(Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
};
|
||||
Polymer.Base._logPrefix = function () {
|
||||
var color = window.chrome || /firefox/i.test(navigator.userAgent);
|
||||
return color ? [
|
||||
'%c[%s::%s]:',
|
||||
'font-weight: bold; background-color:#EEEE00;'
|
||||
] : ['[%s::%s]:'];
|
||||
}();
|
||||
Polymer.Base.chainObject = function (object, inherited) {
|
||||
if (object && inherited && object !== inherited) {
|
||||
if (!Object.__proto__) {
|
||||
object = Polymer.Base.extend(Object.create(inherited), object);
|
||||
}
|
||||
object.__proto__ = inherited;
|
||||
}
|
||||
return object;
|
||||
};
|
||||
Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype);
|
||||
if (window.CustomElements) {
|
||||
Polymer.instanceof = CustomElements.instanceof;
|
||||
} else {
|
||||
Polymer.instanceof = function (obj, ctor) {
|
||||
return obj instanceof ctor;
|
||||
};
|
||||
}
|
||||
Polymer.isInstance = function (obj) {
|
||||
return Boolean(obj && obj.__isPolymerInstance__);
|
||||
};
|
||||
Polymer.telemetry.instanceCount = 0;
|
||||
(function () {
|
||||
var modules = {};
|
||||
var lcModules = {};
|
||||
var findModule = function (id) {
|
||||
return modules[id] || lcModules[id.toLowerCase()];
|
||||
};
|
||||
var DomModule = function () {
|
||||
return document.createElement('dom-module');
|
||||
};
|
||||
DomModule.prototype = Object.create(HTMLElement.prototype);
|
||||
Polymer.Base.extend(DomModule.prototype, {
|
||||
constructor: DomModule,
|
||||
createdCallback: function () {
|
||||
this.register();
|
||||
},
|
||||
register: function (id) {
|
||||
var id = id || this.id || this.getAttribute('name') || this.getAttribute('is');
|
||||
if (id) {
|
||||
this.id = id;
|
||||
modules[id] = this;
|
||||
lcModules[id.toLowerCase()] = this;
|
||||
}
|
||||
},
|
||||
import: function (id, selector) {
|
||||
var m = findModule(id);
|
||||
if (!m) {
|
||||
forceDocumentUpgrade();
|
||||
m = findModule(id);
|
||||
}
|
||||
if (m && selector) {
|
||||
m = m.querySelector(selector);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
});
|
||||
var cePolyfill = window.CustomElements && !CustomElements.useNative;
|
||||
document.registerElement('dom-module', DomModule);
|
||||
function forceDocumentUpgrade() {
|
||||
if (cePolyfill) {
|
||||
var script = document._currentScript || document.currentScript;
|
||||
var doc = script && script.ownerDocument;
|
||||
if (doc && !doc.__customElementsForceUpgraded) {
|
||||
doc.__customElementsForceUpgraded = true;
|
||||
CustomElements.upgradeAll(doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}());
|
||||
Polymer.Base._addFeature({
|
||||
_prepIs: function () {
|
||||
if (!this.is) {
|
||||
var module = (document._currentScript || document.currentScript).parentNode;
|
||||
if (module.localName === 'dom-module') {
|
||||
var id = module.id || module.getAttribute('name') || module.getAttribute('is');
|
||||
this.is = id;
|
||||
}
|
||||
}
|
||||
if (this.is) {
|
||||
this.is = this.is.toLowerCase();
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
behaviors: [],
|
||||
_prepBehaviors: function () {
|
||||
if (this.behaviors.length) {
|
||||
this.behaviors = this._flattenBehaviorsList(this.behaviors);
|
||||
}
|
||||
this._prepAllBehaviors(this.behaviors);
|
||||
},
|
||||
_flattenBehaviorsList: function (behaviors) {
|
||||
var flat = [];
|
||||
behaviors.forEach(function (b) {
|
||||
if (b instanceof Array) {
|
||||
flat = flat.concat(this._flattenBehaviorsList(b));
|
||||
} else if (b) {
|
||||
flat.push(b);
|
||||
} else {
|
||||
this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for missing or 404 import'));
|
||||
}
|
||||
}, this);
|
||||
return flat;
|
||||
},
|
||||
_prepAllBehaviors: function (behaviors) {
|
||||
for (var i = behaviors.length - 1; i >= 0; i--) {
|
||||
this._mixinBehavior(behaviors[i]);
|
||||
}
|
||||
for (var i = 0, l = behaviors.length; i < l; i++) {
|
||||
this._prepBehavior(behaviors[i]);
|
||||
}
|
||||
this._prepBehavior(this);
|
||||
},
|
||||
_mixinBehavior: function (b) {
|
||||
Object.getOwnPropertyNames(b).forEach(function (n) {
|
||||
switch (n) {
|
||||
case 'hostAttributes':
|
||||
case 'registered':
|
||||
case 'properties':
|
||||
case 'observers':
|
||||
case 'listeners':
|
||||
case 'created':
|
||||
case 'attached':
|
||||
case 'detached':
|
||||
case 'attributeChanged':
|
||||
case 'configure':
|
||||
case 'ready':
|
||||
break;
|
||||
default:
|
||||
if (!this.hasOwnProperty(n)) {
|
||||
this.copyOwnProperty(n, b, this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
_doBehavior: function (name, args) {
|
||||
this.behaviors.forEach(function (b) {
|
||||
this._invokeBehavior(b, name, args);
|
||||
}, this);
|
||||
this._invokeBehavior(this, name, args);
|
||||
},
|
||||
_invokeBehavior: function (b, name, args) {
|
||||
var fn = b[name];
|
||||
if (fn) {
|
||||
fn.apply(this, args || Polymer.nar);
|
||||
}
|
||||
},
|
||||
_marshalBehaviors: function () {
|
||||
this.behaviors.forEach(function (b) {
|
||||
this._marshalBehavior(b);
|
||||
}, this);
|
||||
this._marshalBehavior(this);
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_getExtendedPrototype: function (tag) {
|
||||
return this._getExtendedNativePrototype(tag);
|
||||
},
|
||||
_nativePrototypes: {},
|
||||
_getExtendedNativePrototype: function (tag) {
|
||||
var p = this._nativePrototypes[tag];
|
||||
if (!p) {
|
||||
var np = this.getNativePrototype(tag);
|
||||
p = this.extend(Object.create(np), Polymer.Base);
|
||||
this._nativePrototypes[tag] = p;
|
||||
}
|
||||
return p;
|
||||
},
|
||||
getNativePrototype: function (tag) {
|
||||
return Object.getPrototypeOf(document.createElement(tag));
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_prepConstructor: function () {
|
||||
this._factoryArgs = this.extends ? [
|
||||
this.extends,
|
||||
this.is
|
||||
] : [this.is];
|
||||
var ctor = function () {
|
||||
return this._factory(arguments);
|
||||
};
|
||||
if (this.hasOwnProperty('extends')) {
|
||||
ctor.extends = this.extends;
|
||||
}
|
||||
Object.defineProperty(this, 'constructor', {
|
||||
value: ctor,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
ctor.prototype = this;
|
||||
},
|
||||
_factory: function (args) {
|
||||
var elt = document.createElement.apply(document, this._factoryArgs);
|
||||
if (this.factoryImpl) {
|
||||
this.factoryImpl.apply(elt, args);
|
||||
}
|
||||
return elt;
|
||||
}
|
||||
});
|
||||
Polymer.nob = Object.create(null);
|
||||
Polymer.Base._addFeature({
|
||||
properties: {},
|
||||
getPropertyInfo: function (property) {
|
||||
var info = this._getPropertyInfo(property, this.properties);
|
||||
if (!info) {
|
||||
this.behaviors.some(function (b) {
|
||||
return info = this._getPropertyInfo(property, b.properties);
|
||||
}, this);
|
||||
}
|
||||
return info || Polymer.nob;
|
||||
},
|
||||
_getPropertyInfo: function (property, properties) {
|
||||
var p = properties && properties[property];
|
||||
if (typeof p === 'function') {
|
||||
p = properties[property] = { type: p };
|
||||
}
|
||||
if (p) {
|
||||
p.defined = true;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
});
|
||||
Polymer.CaseMap = {
|
||||
_caseMap: {},
|
||||
dashToCamelCase: function (dash) {
|
||||
var mapped = Polymer.CaseMap._caseMap[dash];
|
||||
if (mapped) {
|
||||
return mapped;
|
||||
}
|
||||
if (dash.indexOf('-') < 0) {
|
||||
return Polymer.CaseMap._caseMap[dash] = dash;
|
||||
}
|
||||
return Polymer.CaseMap._caseMap[dash] = dash.replace(/-([a-z])/g, function (m) {
|
||||
return m[1].toUpperCase();
|
||||
});
|
||||
},
|
||||
camelToDashCase: function (camel) {
|
||||
var mapped = Polymer.CaseMap._caseMap[camel];
|
||||
if (mapped) {
|
||||
return mapped;
|
||||
}
|
||||
return Polymer.CaseMap._caseMap[camel] = camel.replace(/([a-z][A-Z])/g, function (g) {
|
||||
return g[0] + '-' + g[1].toLowerCase();
|
||||
});
|
||||
}
|
||||
};
|
||||
Polymer.Base._addFeature({
|
||||
_prepAttributes: function () {
|
||||
this._aggregatedAttributes = {};
|
||||
},
|
||||
_addHostAttributes: function (attributes) {
|
||||
if (attributes) {
|
||||
this.mixin(this._aggregatedAttributes, attributes);
|
||||
}
|
||||
},
|
||||
_marshalHostAttributes: function () {
|
||||
this._applyAttributes(this, this._aggregatedAttributes);
|
||||
},
|
||||
_applyAttributes: function (node, attr$) {
|
||||
for (var n in attr$) {
|
||||
if (!this.hasAttribute(n) && n !== 'class') {
|
||||
this.serializeValueToAttribute(attr$[n], n, this);
|
||||
}
|
||||
}
|
||||
},
|
||||
_marshalAttributes: function () {
|
||||
this._takeAttributesToModel(this);
|
||||
},
|
||||
_takeAttributesToModel: function (model) {
|
||||
for (var i = 0, l = this.attributes.length; i < l; i++) {
|
||||
this._setAttributeToProperty(model, this.attributes[i].name);
|
||||
}
|
||||
},
|
||||
_setAttributeToProperty: function (model, attrName) {
|
||||
if (!this._serializing) {
|
||||
var propName = Polymer.CaseMap.dashToCamelCase(attrName);
|
||||
var info = this.getPropertyInfo(propName);
|
||||
if (info.defined || this._propertyEffects && this._propertyEffects[propName]) {
|
||||
var val = this.getAttribute(attrName);
|
||||
model[propName] = this.deserialize(val, info.type);
|
||||
}
|
||||
}
|
||||
},
|
||||
_serializing: false,
|
||||
reflectPropertyToAttribute: function (name) {
|
||||
this._serializing = true;
|
||||
this.serializeValueToAttribute(this[name], Polymer.CaseMap.camelToDashCase(name));
|
||||
this._serializing = false;
|
||||
},
|
||||
serializeValueToAttribute: function (value, attribute, node) {
|
||||
var str = this.serialize(value);
|
||||
(node || this)[str === undefined ? 'removeAttribute' : 'setAttribute'](attribute, str);
|
||||
},
|
||||
deserialize: function (value, type) {
|
||||
switch (type) {
|
||||
case Number:
|
||||
value = Number(value);
|
||||
break;
|
||||
case Boolean:
|
||||
value = value !== null;
|
||||
break;
|
||||
case Object:
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (x) {
|
||||
}
|
||||
break;
|
||||
case Array:
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (x) {
|
||||
value = null;
|
||||
console.warn('Polymer::Attributes: couldn`t decode Array as JSON');
|
||||
}
|
||||
break;
|
||||
case Date:
|
||||
value = new Date(value);
|
||||
break;
|
||||
case String:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
serialize: function (value) {
|
||||
switch (typeof value) {
|
||||
case 'boolean':
|
||||
return value ? '' : undefined;
|
||||
case 'object':
|
||||
if (value instanceof Date) {
|
||||
return value;
|
||||
} else if (value) {
|
||||
try {
|
||||
return JSON.stringify(value);
|
||||
} catch (x) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
default:
|
||||
return value != null ? value : undefined;
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_setupDebouncers: function () {
|
||||
this._debouncers = {};
|
||||
},
|
||||
debounce: function (jobName, callback, wait) {
|
||||
return this._debouncers[jobName] = Polymer.Debounce.call(this, this._debouncers[jobName], callback, wait);
|
||||
},
|
||||
isDebouncerActive: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
return debouncer && debouncer.finish;
|
||||
},
|
||||
flushDebouncer: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
if (debouncer) {
|
||||
debouncer.complete();
|
||||
}
|
||||
},
|
||||
cancelDebouncer: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
if (debouncer) {
|
||||
debouncer.stop();
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.version = '1.1.1';
|
||||
Polymer.Base._addFeature({
|
||||
_registerFeatures: function () {
|
||||
this._prepIs();
|
||||
this._prepAttributes();
|
||||
this._prepBehaviors();
|
||||
this._prepConstructor();
|
||||
},
|
||||
_prepBehavior: function (b) {
|
||||
this._addHostAttributes(b.hostAttributes);
|
||||
},
|
||||
_marshalBehavior: function (b) {
|
||||
},
|
||||
_initFeatures: function () {
|
||||
this._marshalHostAttributes();
|
||||
this._setupDebouncers();
|
||||
this._marshalBehaviors();
|
||||
}
|
||||
});</script>
|
||||
|
1508
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer-mini.html
поставляемый
Normal file
1508
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer-mini.html
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
4241
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer.html
поставляемый
Normal file
4241
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/polymer/polymer.html
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
27
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/.bower.json
поставляемый
Normal file
27
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/.bower.json
поставляемый
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.12",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"webcomponents"
|
||||
],
|
||||
"license": "BSD",
|
||||
"ignore": [],
|
||||
"_release": "0.7.12",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v0.7.12",
|
||||
"commit": "044234d00f966292390d02cbe88184861e673cc7"
|
||||
},
|
||||
"_source": "git://github.com/webcomponents/webcomponentsjs.git",
|
||||
"_target": "^0.7.0",
|
||||
"_originalSource": "webcomponents/webcomponentsjs"
|
||||
}
|
973
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/CustomElements.js
поставляемый
Normal file
973
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/CustomElements.js
поставляемый
Normal file
|
@ -0,0 +1,973 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
// @version 0.7.12
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
var counter = Date.now() % 1e9;
|
||||
var WeakMap = function() {
|
||||
this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
|
||||
};
|
||||
WeakMap.prototype = {
|
||||
set: function(key, value) {
|
||||
var entry = key[this.name];
|
||||
if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
|
||||
value: [ key, value ],
|
||||
writable: true
|
||||
});
|
||||
return this;
|
||||
},
|
||||
get: function(key) {
|
||||
var entry;
|
||||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
|
||||
},
|
||||
"delete": function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry || entry[0] !== key) return false;
|
||||
entry[0] = entry[1] = undefined;
|
||||
return true;
|
||||
},
|
||||
has: function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry) return false;
|
||||
return entry[0] === key;
|
||||
}
|
||||
};
|
||||
window.WeakMap = WeakMap;
|
||||
})();
|
||||
}
|
||||
|
||||
(function(global) {
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
setImmediate = setTimeout;
|
||||
} else if (window.setImmediate) {
|
||||
setImmediate = window.setImmediate;
|
||||
} else {
|
||||
var setImmediateQueue = [];
|
||||
var sentinel = String(Math.random());
|
||||
window.addEventListener("message", function(e) {
|
||||
if (e.data === sentinel) {
|
||||
var queue = setImmediateQueue;
|
||||
setImmediateQueue = [];
|
||||
queue.forEach(function(func) {
|
||||
func();
|
||||
});
|
||||
}
|
||||
});
|
||||
setImmediate = function(func) {
|
||||
setImmediateQueue.push(func);
|
||||
window.postMessage(sentinel, "*");
|
||||
};
|
||||
}
|
||||
var isScheduled = false;
|
||||
var scheduledObservers = [];
|
||||
function scheduleCallback(observer) {
|
||||
scheduledObservers.push(observer);
|
||||
if (!isScheduled) {
|
||||
isScheduled = true;
|
||||
setImmediate(dispatchCallbacks);
|
||||
}
|
||||
}
|
||||
function wrapIfNeeded(node) {
|
||||
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
|
||||
}
|
||||
function dispatchCallbacks() {
|
||||
isScheduled = false;
|
||||
var observers = scheduledObservers;
|
||||
scheduledObservers = [];
|
||||
observers.sort(function(o1, o2) {
|
||||
return o1.uid_ - o2.uid_;
|
||||
});
|
||||
var anyNonEmpty = false;
|
||||
observers.forEach(function(observer) {
|
||||
var queue = observer.takeRecords();
|
||||
removeTransientObserversFor(observer);
|
||||
if (queue.length) {
|
||||
observer.callback_(queue, observer);
|
||||
anyNonEmpty = true;
|
||||
}
|
||||
});
|
||||
if (anyNonEmpty) dispatchCallbacks();
|
||||
}
|
||||
function removeTransientObserversFor(observer) {
|
||||
observer.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) return;
|
||||
registrations.forEach(function(registration) {
|
||||
if (registration.observer === observer) registration.removeTransientObservers();
|
||||
});
|
||||
});
|
||||
}
|
||||
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
|
||||
for (var node = target; node; node = node.parentNode) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (registrations) {
|
||||
for (var j = 0; j < registrations.length; j++) {
|
||||
var registration = registrations[j];
|
||||
var options = registration.options;
|
||||
if (node !== target && !options.subtree) continue;
|
||||
var record = callback(options);
|
||||
if (record) registration.enqueue(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var uidCounter = 0;
|
||||
function JsMutationObserver(callback) {
|
||||
this.callback_ = callback;
|
||||
this.nodes_ = [];
|
||||
this.records_ = [];
|
||||
this.uid_ = ++uidCounter;
|
||||
}
|
||||
JsMutationObserver.prototype = {
|
||||
observe: function(target, options) {
|
||||
target = wrapIfNeeded(target);
|
||||
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
|
||||
throw new SyntaxError();
|
||||
}
|
||||
var registrations = registrationsTable.get(target);
|
||||
if (!registrations) registrationsTable.set(target, registrations = []);
|
||||
var registration;
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i].observer === this) {
|
||||
registration = registrations[i];
|
||||
registration.removeListeners();
|
||||
registration.options = options;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!registration) {
|
||||
registration = new Registration(this, target, options);
|
||||
registrations.push(registration);
|
||||
this.nodes_.push(target);
|
||||
}
|
||||
registration.addListeners();
|
||||
},
|
||||
disconnect: function() {
|
||||
this.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
var registration = registrations[i];
|
||||
if (registration.observer === this) {
|
||||
registration.removeListeners();
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
this.records_ = [];
|
||||
},
|
||||
takeRecords: function() {
|
||||
var copyOfRecords = this.records_;
|
||||
this.records_ = [];
|
||||
return copyOfRecords;
|
||||
}
|
||||
};
|
||||
function MutationRecord(type, target) {
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.addedNodes = [];
|
||||
this.removedNodes = [];
|
||||
this.previousSibling = null;
|
||||
this.nextSibling = null;
|
||||
this.attributeName = null;
|
||||
this.attributeNamespace = null;
|
||||
this.oldValue = null;
|
||||
}
|
||||
function copyMutationRecord(original) {
|
||||
var record = new MutationRecord(original.type, original.target);
|
||||
record.addedNodes = original.addedNodes.slice();
|
||||
record.removedNodes = original.removedNodes.slice();
|
||||
record.previousSibling = original.previousSibling;
|
||||
record.nextSibling = original.nextSibling;
|
||||
record.attributeName = original.attributeName;
|
||||
record.attributeNamespace = original.attributeNamespace;
|
||||
record.oldValue = original.oldValue;
|
||||
return record;
|
||||
}
|
||||
var currentRecord, recordWithOldValue;
|
||||
function getRecord(type, target) {
|
||||
return currentRecord = new MutationRecord(type, target);
|
||||
}
|
||||
function getRecordWithOldValue(oldValue) {
|
||||
if (recordWithOldValue) return recordWithOldValue;
|
||||
recordWithOldValue = copyMutationRecord(currentRecord);
|
||||
recordWithOldValue.oldValue = oldValue;
|
||||
return recordWithOldValue;
|
||||
}
|
||||
function clearRecords() {
|
||||
currentRecord = recordWithOldValue = undefined;
|
||||
}
|
||||
function recordRepresentsCurrentMutation(record) {
|
||||
return record === recordWithOldValue || record === currentRecord;
|
||||
}
|
||||
function selectRecord(lastRecord, newRecord) {
|
||||
if (lastRecord === newRecord) return lastRecord;
|
||||
if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
|
||||
return null;
|
||||
}
|
||||
function Registration(observer, target, options) {
|
||||
this.observer = observer;
|
||||
this.target = target;
|
||||
this.options = options;
|
||||
this.transientObservedNodes = [];
|
||||
}
|
||||
Registration.prototype = {
|
||||
enqueue: function(record) {
|
||||
var records = this.observer.records_;
|
||||
var length = records.length;
|
||||
if (records.length > 0) {
|
||||
var lastRecord = records[length - 1];
|
||||
var recordToReplaceLast = selectRecord(lastRecord, record);
|
||||
if (recordToReplaceLast) {
|
||||
records[length - 1] = recordToReplaceLast;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
scheduleCallback(this.observer);
|
||||
}
|
||||
records[length] = record;
|
||||
},
|
||||
addListeners: function() {
|
||||
this.addListeners_(this.target);
|
||||
},
|
||||
addListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
removeListeners: function() {
|
||||
this.removeListeners_(this.target);
|
||||
},
|
||||
removeListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
addTransientObserver: function(node) {
|
||||
if (node === this.target) return;
|
||||
this.addListeners_(node);
|
||||
this.transientObservedNodes.push(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) registrationsTable.set(node, registrations = []);
|
||||
registrations.push(this);
|
||||
},
|
||||
removeTransientObservers: function() {
|
||||
var transientObservedNodes = this.transientObservedNodes;
|
||||
this.transientObservedNodes = [];
|
||||
transientObservedNodes.forEach(function(node) {
|
||||
this.removeListeners_(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i] === this) {
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
handleEvent: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
switch (e.type) {
|
||||
case "DOMAttrModified":
|
||||
var name = e.attrName;
|
||||
var namespace = e.relatedNode.namespaceURI;
|
||||
var target = e.target;
|
||||
var record = new getRecord("attributes", target);
|
||||
record.attributeName = name;
|
||||
record.attributeNamespace = namespace;
|
||||
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.attributes) return;
|
||||
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
|
||||
return;
|
||||
}
|
||||
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMCharacterDataModified":
|
||||
var target = e.target;
|
||||
var record = getRecord("characterData", target);
|
||||
var oldValue = e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.characterData) return;
|
||||
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMNodeRemoved":
|
||||
this.addTransientObserver(e.target);
|
||||
|
||||
case "DOMNodeInserted":
|
||||
var changedNode = e.target;
|
||||
var addedNodes, removedNodes;
|
||||
if (e.type === "DOMNodeInserted") {
|
||||
addedNodes = [ changedNode ];
|
||||
removedNodes = [];
|
||||
} else {
|
||||
addedNodes = [];
|
||||
removedNodes = [ changedNode ];
|
||||
}
|
||||
var previousSibling = changedNode.previousSibling;
|
||||
var nextSibling = changedNode.nextSibling;
|
||||
var record = getRecord("childList", e.target.parentNode);
|
||||
record.addedNodes = addedNodes;
|
||||
record.removedNodes = removedNodes;
|
||||
record.previousSibling = previousSibling;
|
||||
record.nextSibling = nextSibling;
|
||||
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
|
||||
if (!options.childList) return;
|
||||
return record;
|
||||
});
|
||||
}
|
||||
clearRecords();
|
||||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
})(window);
|
||||
|
||||
window.CustomElements = window.CustomElements || {
|
||||
flags: {}
|
||||
};
|
||||
|
||||
(function(scope) {
|
||||
var flags = scope.flags;
|
||||
var modules = [];
|
||||
var addModule = function(module) {
|
||||
modules.push(module);
|
||||
};
|
||||
var initializeModules = function() {
|
||||
modules.forEach(function(module) {
|
||||
module(scope);
|
||||
});
|
||||
};
|
||||
scope.addModule = addModule;
|
||||
scope.initializeModules = initializeModules;
|
||||
scope.hasNative = Boolean(document.registerElement);
|
||||
scope.isIE = /Trident/.test(navigator.userAgent);
|
||||
scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative);
|
||||
})(window.CustomElements);
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none";
|
||||
function forSubtree(node, cb) {
|
||||
findAllElements(node, function(e) {
|
||||
if (cb(e)) {
|
||||
return true;
|
||||
}
|
||||
forRoots(e, cb);
|
||||
});
|
||||
forRoots(node, cb);
|
||||
}
|
||||
function findAllElements(node, find, data) {
|
||||
var e = node.firstElementChild;
|
||||
if (!e) {
|
||||
e = node.firstChild;
|
||||
while (e && e.nodeType !== Node.ELEMENT_NODE) {
|
||||
e = e.nextSibling;
|
||||
}
|
||||
}
|
||||
while (e) {
|
||||
if (find(e, data) !== true) {
|
||||
findAllElements(e, find, data);
|
||||
}
|
||||
e = e.nextElementSibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function forRoots(node, cb) {
|
||||
var root = node.shadowRoot;
|
||||
while (root) {
|
||||
forSubtree(root, cb);
|
||||
root = root.olderShadowRoot;
|
||||
}
|
||||
}
|
||||
function forDocumentTree(doc, cb) {
|
||||
_forDocumentTree(doc, cb, []);
|
||||
}
|
||||
function _forDocumentTree(doc, cb, processingDocuments) {
|
||||
doc = window.wrap(doc);
|
||||
if (processingDocuments.indexOf(doc) >= 0) {
|
||||
return;
|
||||
}
|
||||
processingDocuments.push(doc);
|
||||
var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]");
|
||||
for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) {
|
||||
if (n.import) {
|
||||
_forDocumentTree(n.import, cb, processingDocuments);
|
||||
}
|
||||
}
|
||||
cb(doc);
|
||||
}
|
||||
scope.forDocumentTree = forDocumentTree;
|
||||
scope.forSubtree = forSubtree;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
var forSubtree = scope.forSubtree;
|
||||
var forDocumentTree = scope.forDocumentTree;
|
||||
function addedNode(node, isAttached) {
|
||||
return added(node, isAttached) || addedSubtree(node, isAttached);
|
||||
}
|
||||
function added(node, isAttached) {
|
||||
if (scope.upgrade(node, isAttached)) {
|
||||
return true;
|
||||
}
|
||||
if (isAttached) {
|
||||
attached(node);
|
||||
}
|
||||
}
|
||||
function addedSubtree(node, isAttached) {
|
||||
forSubtree(node, function(e) {
|
||||
if (added(e, isAttached)) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
var hasPolyfillMutations = !window.MutationObserver || window.MutationObserver === window.JsMutationObserver;
|
||||
scope.hasPolyfillMutations = hasPolyfillMutations;
|
||||
var isPendingMutations = false;
|
||||
var pendingMutations = [];
|
||||
function deferMutation(fn) {
|
||||
pendingMutations.push(fn);
|
||||
if (!isPendingMutations) {
|
||||
isPendingMutations = true;
|
||||
setTimeout(takeMutations);
|
||||
}
|
||||
}
|
||||
function takeMutations() {
|
||||
isPendingMutations = false;
|
||||
var $p = pendingMutations;
|
||||
for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) {
|
||||
p();
|
||||
}
|
||||
pendingMutations = [];
|
||||
}
|
||||
function attached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
deferMutation(function() {
|
||||
_attached(element);
|
||||
});
|
||||
} else {
|
||||
_attached(element);
|
||||
}
|
||||
}
|
||||
function _attached(element) {
|
||||
if (element.__upgraded__ && !element.__attached) {
|
||||
element.__attached = true;
|
||||
if (element.attachedCallback) {
|
||||
element.attachedCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
function detachedNode(node) {
|
||||
detached(node);
|
||||
forSubtree(node, function(e) {
|
||||
detached(e);
|
||||
});
|
||||
}
|
||||
function detached(element) {
|
||||
if (hasPolyfillMutations) {
|
||||
deferMutation(function() {
|
||||
_detached(element);
|
||||
});
|
||||
} else {
|
||||
_detached(element);
|
||||
}
|
||||
}
|
||||
function _detached(element) {
|
||||
if (element.__upgraded__ && element.__attached) {
|
||||
element.__attached = false;
|
||||
if (element.detachedCallback) {
|
||||
element.detachedCallback();
|
||||
}
|
||||
}
|
||||
}
|
||||
function inDocument(element) {
|
||||
var p = element;
|
||||
var doc = window.wrap(document);
|
||||
while (p) {
|
||||
if (p == doc) {
|
||||
return true;
|
||||
}
|
||||
p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host;
|
||||
}
|
||||
}
|
||||
function watchShadow(node) {
|
||||
if (node.shadowRoot && !node.shadowRoot.__watched) {
|
||||
flags.dom && console.log("watching shadow-root for: ", node.localName);
|
||||
var root = node.shadowRoot;
|
||||
while (root) {
|
||||
observe(root);
|
||||
root = root.olderShadowRoot;
|
||||
}
|
||||
}
|
||||
}
|
||||
function handler(root, mutations) {
|
||||
if (flags.dom) {
|
||||
var mx = mutations[0];
|
||||
if (mx && mx.type === "childList" && mx.addedNodes) {
|
||||
if (mx.addedNodes) {
|
||||
var d = mx.addedNodes[0];
|
||||
while (d && d !== document && !d.host) {
|
||||
d = d.parentNode;
|
||||
}
|
||||
var u = d && (d.URL || d._URL || d.host && d.host.localName) || "";
|
||||
u = u.split("/?").shift().split("/").pop();
|
||||
}
|
||||
}
|
||||
console.group("mutations (%d) [%s]", mutations.length, u || "");
|
||||
}
|
||||
var isAttached = inDocument(root);
|
||||
mutations.forEach(function(mx) {
|
||||
if (mx.type === "childList") {
|
||||
forEach(mx.addedNodes, function(n) {
|
||||
if (!n.localName) {
|
||||
return;
|
||||
}
|
||||
addedNode(n, isAttached);
|
||||
});
|
||||
forEach(mx.removedNodes, function(n) {
|
||||
if (!n.localName) {
|
||||
return;
|
||||
}
|
||||
detachedNode(n);
|
||||
});
|
||||
}
|
||||
});
|
||||
flags.dom && console.groupEnd();
|
||||
}
|
||||
function takeRecords(node) {
|
||||
node = window.wrap(node);
|
||||
if (!node) {
|
||||
node = window.wrap(document);
|
||||
}
|
||||
while (node.parentNode) {
|
||||
node = node.parentNode;
|
||||
}
|
||||
var observer = node.__observer;
|
||||
if (observer) {
|
||||
handler(node, observer.takeRecords());
|
||||
takeMutations();
|
||||
}
|
||||
}
|
||||
var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach);
|
||||
function observe(inRoot) {
|
||||
if (inRoot.__observer) {
|
||||
return;
|
||||
}
|
||||
var observer = new MutationObserver(handler.bind(this, inRoot));
|
||||
observer.observe(inRoot, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
inRoot.__observer = observer;
|
||||
}
|
||||
function upgradeDocument(doc) {
|
||||
doc = window.wrap(doc);
|
||||
flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop());
|
||||
var isMainDocument = doc === window.wrap(document);
|
||||
addedNode(doc, isMainDocument);
|
||||
observe(doc);
|
||||
flags.dom && console.groupEnd();
|
||||
}
|
||||
function upgradeDocumentTree(doc) {
|
||||
forDocumentTree(doc, upgradeDocument);
|
||||
}
|
||||
var originalCreateShadowRoot = Element.prototype.createShadowRoot;
|
||||
if (originalCreateShadowRoot) {
|
||||
Element.prototype.createShadowRoot = function() {
|
||||
var root = originalCreateShadowRoot.call(this);
|
||||
window.CustomElements.watchShadow(this);
|
||||
return root;
|
||||
};
|
||||
}
|
||||
scope.watchShadow = watchShadow;
|
||||
scope.upgradeDocumentTree = upgradeDocumentTree;
|
||||
scope.upgradeDocument = upgradeDocument;
|
||||
scope.upgradeSubtree = addedSubtree;
|
||||
scope.upgradeAll = addedNode;
|
||||
scope.attached = attached;
|
||||
scope.takeRecords = takeRecords;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var flags = scope.flags;
|
||||
function upgrade(node, isAttached) {
|
||||
if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) {
|
||||
var is = node.getAttribute("is");
|
||||
var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is);
|
||||
if (definition) {
|
||||
if (is && definition.tag == node.localName || !is && !definition.extends) {
|
||||
return upgradeWithDefinition(node, definition, isAttached);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function upgradeWithDefinition(element, definition, isAttached) {
|
||||
flags.upgrade && console.group("upgrade:", element.localName);
|
||||
if (definition.is) {
|
||||
element.setAttribute("is", definition.is);
|
||||
}
|
||||
implementPrototype(element, definition);
|
||||
element.__upgraded__ = true;
|
||||
created(element);
|
||||
if (isAttached) {
|
||||
scope.attached(element);
|
||||
}
|
||||
scope.upgradeSubtree(element, isAttached);
|
||||
flags.upgrade && console.groupEnd();
|
||||
return element;
|
||||
}
|
||||
function implementPrototype(element, definition) {
|
||||
if (Object.__proto__) {
|
||||
element.__proto__ = definition.prototype;
|
||||
} else {
|
||||
customMixin(element, definition.prototype, definition.native);
|
||||
element.__proto__ = definition.prototype;
|
||||
}
|
||||
}
|
||||
function customMixin(inTarget, inSrc, inNative) {
|
||||
var used = {};
|
||||
var p = inSrc;
|
||||
while (p !== inNative && p !== HTMLElement.prototype) {
|
||||
var keys = Object.getOwnPropertyNames(p);
|
||||
for (var i = 0, k; k = keys[i]; i++) {
|
||||
if (!used[k]) {
|
||||
Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k));
|
||||
used[k] = 1;
|
||||
}
|
||||
}
|
||||
p = Object.getPrototypeOf(p);
|
||||
}
|
||||
}
|
||||
function created(element) {
|
||||
if (element.createdCallback) {
|
||||
element.createdCallback();
|
||||
}
|
||||
}
|
||||
scope.upgrade = upgrade;
|
||||
scope.upgradeWithDefinition = upgradeWithDefinition;
|
||||
scope.implementPrototype = implementPrototype;
|
||||
});
|
||||
|
||||
window.CustomElements.addModule(function(scope) {
|
||||
var isIE = scope.isIE;
|
||||
var upgradeDocumentTree = scope.upgradeDocumentTree;
|
||||
var upgradeAll = scope.upgradeAll;
|
||||
var upgradeWithDefinition = scope.upgradeWithDefinition;
|
||||
var implementPrototype = scope.implementPrototype;
|
||||
var useNative = scope.useNative;
|
||||
function register(name, options) {
|
||||
var definition = options || {};
|
||||
if (!name) {
|
||||
throw new Error("document.registerElement: first argument `name` must not be empty");
|
||||
}
|
||||
if (name.indexOf("-") < 0) {
|
||||
throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'.");
|
||||
}
|
||||
if (isReservedTag(name)) {
|
||||
throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid.");
|
||||
}
|
||||
if (getRegisteredDefinition(name)) {
|
||||
throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered");
|
||||
}
|
||||
if (!definition.prototype) {
|
||||
definition.prototype = Object.create(HTMLElement.prototype);
|
||||
}
|
||||
definition.__name = name.toLowerCase();
|
||||
definition.lifecycle = definition.lifecycle || {};
|
||||
definition.ancestry = ancestry(definition.extends);
|
||||
resolveTagName(definition);
|
||||
resolvePrototypeChain(definition);
|
||||
overrideAttributeApi(definition.prototype);
|
||||
registerDefinition(definition.__name, definition);
|
||||
definition.ctor = generateConstructor(definition);
|
||||
definition.ctor.prototype = definition.prototype;
|
||||
definition.prototype.constructor = definition.ctor;
|
||||
if (scope.ready) {
|
||||
upgradeDocumentTree(document);
|
||||
}
|
||||
return definition.ctor;
|
||||
}
|
||||
function overrideAttributeApi(prototype) {
|
||||
if (prototype.setAttribute._polyfilled) {
|
||||
return;
|
||||
}
|
||||
var setAttribute = prototype.setAttribute;
|
||||
prototype.setAttribute = function(name, value) {
|
||||
changeAttribute.call(this, name, value, setAttribute);
|
||||
};
|
||||
var removeAttribute = prototype.removeAttribute;
|
||||
prototype.removeAttribute = function(name) {
|
||||
changeAttribute.call(this, name, null, removeAttribute);
|
||||
};
|
||||
prototype.setAttribute._polyfilled = true;
|
||||
}
|
||||
function changeAttribute(name, value, operation) {
|
||||
name = name.toLowerCase();
|
||||
var oldValue = this.getAttribute(name);
|
||||
operation.apply(this, arguments);
|
||||
var newValue = this.getAttribute(name);
|
||||
if (this.attributeChangedCallback && newValue !== oldValue) {
|
||||
this.attributeChangedCallback(name, oldValue, newValue);
|
||||
}
|
||||
}
|
||||
function isReservedTag(name) {
|
||||
for (var i = 0; i < reservedTagList.length; i++) {
|
||||
if (name === reservedTagList[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ];
|
||||
function ancestry(extnds) {
|
||||
var extendee = getRegisteredDefinition(extnds);
|
||||
if (extendee) {
|
||||
return ancestry(extendee.extends).concat([ extendee ]);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
function resolveTagName(definition) {
|
||||
var baseTag = definition.extends;
|
||||
for (var i = 0, a; a = definition.ancestry[i]; i++) {
|
||||
baseTag = a.is && a.tag;
|
||||
}
|
||||
definition.tag = baseTag || definition.__name;
|
||||
if (baseTag) {
|
||||
definition.is = definition.__name;
|
||||
}
|
||||
}
|
||||
function resolvePrototypeChain(definition) {
|
||||
if (!Object.__proto__) {
|
||||
var nativePrototype = HTMLElement.prototype;
|
||||
if (definition.is) {
|
||||
var inst = document.createElement(definition.tag);
|
||||
nativePrototype = Object.getPrototypeOf(inst);
|
||||
}
|
||||
var proto = definition.prototype, ancestor;
|
||||
var foundPrototype = false;
|
||||
while (proto) {
|
||||
if (proto == nativePrototype) {
|
||||
foundPrototype = true;
|
||||
}
|
||||
ancestor = Object.getPrototypeOf(proto);
|
||||
if (ancestor) {
|
||||
proto.__proto__ = ancestor;
|
||||
}
|
||||
proto = ancestor;
|
||||
}
|
||||
if (!foundPrototype) {
|
||||
console.warn(definition.tag + " prototype not found in prototype chain for " + definition.is);
|
||||
}
|
||||
definition.native = nativePrototype;
|
||||
}
|
||||
}
|
||||
function instantiate(definition) {
|
||||
return upgradeWithDefinition(domCreateElement(definition.tag), definition);
|
||||
}
|
||||
var registry = {};
|
||||
function getRegisteredDefinition(name) {
|
||||
if (name) {
|
||||
return registry[name.toLowerCase()];
|
||||
}
|
||||
}
|
||||
function registerDefinition(name, definition) {
|
||||
registry[name] = definition;
|
||||
}
|
||||
function generateConstructor(definition) {
|
||||
return function() {
|
||||
return instantiate(definition);
|
||||
};
|
||||
}
|
||||
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
||||
function createElementNS(namespace, tag, typeExtension) {
|
||||
if (namespace === HTML_NAMESPACE) {
|
||||
return createElement(tag, typeExtension);
|
||||
} else {
|
||||
return domCreateElementNS(namespace, tag);
|
||||
}
|
||||
}
|
||||
function createElement(tag, typeExtension) {
|
||||
if (tag) {
|
||||
tag = tag.toLowerCase();
|
||||
}
|
||||
if (typeExtension) {
|
||||
typeExtension = typeExtension.toLowerCase();
|
||||
}
|
||||
var definition = getRegisteredDefinition(typeExtension || tag);
|
||||
if (definition) {
|
||||
if (tag == definition.tag && typeExtension == definition.is) {
|
||||
return new definition.ctor();
|
||||
}
|
||||
if (!typeExtension && !definition.is) {
|
||||
return new definition.ctor();
|
||||
}
|
||||
}
|
||||
var element;
|
||||
if (typeExtension) {
|
||||
element = createElement(tag);
|
||||
element.setAttribute("is", typeExtension);
|
||||
return element;
|
||||
}
|
||||
element = domCreateElement(tag);
|
||||
if (tag.indexOf("-") >= 0) {
|
||||
implementPrototype(element, HTMLElement);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
var domCreateElement = document.createElement.bind(document);
|
||||
var domCreateElementNS = document.createElementNS.bind(document);
|
||||
var isInstance;
|
||||
if (!Object.__proto__ && !useNative) {
|
||||
isInstance = function(obj, ctor) {
|
||||
if (obj instanceof ctor) {
|
||||
return true;
|
||||
}
|
||||
var p = obj;
|
||||
while (p) {
|
||||
if (p === ctor.prototype) {
|
||||
return true;
|
||||
}
|
||||
p = p.__proto__;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
} else {
|
||||
isInstance = function(obj, base) {
|
||||
return obj instanceof base;
|
||||
};
|
||||
}
|
||||
function wrapDomMethodToForceUpgrade(obj, methodName) {
|
||||
var orig = obj[methodName];
|
||||
obj[methodName] = function() {
|
||||
var n = orig.apply(this, arguments);
|
||||
upgradeAll(n);
|
||||
return n;
|
||||
};
|
||||
}
|
||||
wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode");
|
||||
wrapDomMethodToForceUpgrade(document, "importNode");
|
||||
if (isIE) {
|
||||
(function() {
|
||||
var importNode = document.importNode;
|
||||
document.importNode = function() {
|
||||
var n = importNode.apply(document, arguments);
|
||||
if (n.nodeType == n.DOCUMENT_FRAGMENT_NODE) {
|
||||
var f = document.createDocumentFragment();
|
||||
f.appendChild(n);
|
||||
return f;
|
||||
} else {
|
||||
return n;
|
||||
}
|
||||
};
|
||||
})();
|
||||
}
|
||||
document.registerElement = register;
|
||||
document.createElement = createElement;
|
||||
document.createElementNS = createElementNS;
|
||||
scope.registry = registry;
|
||||
scope.instanceof = isInstance;
|
||||
scope.reservedTagList = reservedTagList;
|
||||
scope.getRegisteredDefinition = getRegisteredDefinition;
|
||||
document.register = document.registerElement;
|
||||
});
|
||||
|
||||
(function(scope) {
|
||||
var useNative = scope.useNative;
|
||||
var initializeModules = scope.initializeModules;
|
||||
var isIE = scope.isIE;
|
||||
if (useNative) {
|
||||
var nop = function() {};
|
||||
scope.watchShadow = nop;
|
||||
scope.upgrade = nop;
|
||||
scope.upgradeAll = nop;
|
||||
scope.upgradeDocumentTree = nop;
|
||||
scope.upgradeSubtree = nop;
|
||||
scope.takeRecords = nop;
|
||||
scope.instanceof = function(obj, base) {
|
||||
return obj instanceof base;
|
||||
};
|
||||
} else {
|
||||
initializeModules();
|
||||
}
|
||||
var upgradeDocumentTree = scope.upgradeDocumentTree;
|
||||
var upgradeDocument = scope.upgradeDocument;
|
||||
if (!window.wrap) {
|
||||
if (window.ShadowDOMPolyfill) {
|
||||
window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded;
|
||||
window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded;
|
||||
} else {
|
||||
window.wrap = window.unwrap = function(node) {
|
||||
return node;
|
||||
};
|
||||
}
|
||||
}
|
||||
if (window.HTMLImports) {
|
||||
window.HTMLImports.__importsParsingHook = function(elt) {
|
||||
if (elt.import) {
|
||||
upgradeDocument(wrap(elt.import));
|
||||
}
|
||||
};
|
||||
}
|
||||
function bootstrap() {
|
||||
upgradeDocumentTree(window.wrap(document));
|
||||
window.CustomElements.ready = true;
|
||||
var requestAnimationFrame = window.requestAnimationFrame || function(f) {
|
||||
setTimeout(f, 16);
|
||||
};
|
||||
requestAnimationFrame(function() {
|
||||
setTimeout(function() {
|
||||
window.CustomElements.readyTime = Date.now();
|
||||
if (window.HTMLImports) {
|
||||
window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime;
|
||||
}
|
||||
document.dispatchEvent(new CustomEvent("WebComponentsReady", {
|
||||
bubbles: true
|
||||
}));
|
||||
});
|
||||
});
|
||||
}
|
||||
if (isIE && typeof window.CustomEvent !== "function") {
|
||||
window.CustomEvent = function(inType, params) {
|
||||
params = params || {};
|
||||
var e = document.createEvent("CustomEvent");
|
||||
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
|
||||
e.preventDefault = function() {
|
||||
Object.defineProperty(this, "defaultPrevented", {
|
||||
get: function() {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
return e;
|
||||
};
|
||||
window.CustomEvent.prototype = window.Event.prototype;
|
||||
}
|
||||
if (document.readyState === "complete" || scope.flags.eager) {
|
||||
bootstrap();
|
||||
} else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) {
|
||||
bootstrap();
|
||||
} else {
|
||||
var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded";
|
||||
window.addEventListener(loadEvent, bootstrap);
|
||||
}
|
||||
})(window.CustomElements);
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
1090
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/HTMLImports.js
поставляемый
Normal file
1090
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/HTMLImports.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
11
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/HTMLImports.min.js
поставляемый
Normal file
11
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/HTMLImports.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
344
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/MutationObserver.js
поставляемый
Normal file
344
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/MutationObserver.js
поставляемый
Normal file
|
@ -0,0 +1,344 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
* Code distributed by Google as part of the polymer project is also
|
||||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
*/
|
||||
// @version 0.7.12
|
||||
if (typeof WeakMap === "undefined") {
|
||||
(function() {
|
||||
var defineProperty = Object.defineProperty;
|
||||
var counter = Date.now() % 1e9;
|
||||
var WeakMap = function() {
|
||||
this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__");
|
||||
};
|
||||
WeakMap.prototype = {
|
||||
set: function(key, value) {
|
||||
var entry = key[this.name];
|
||||
if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, {
|
||||
value: [ key, value ],
|
||||
writable: true
|
||||
});
|
||||
return this;
|
||||
},
|
||||
get: function(key) {
|
||||
var entry;
|
||||
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
|
||||
},
|
||||
"delete": function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry || entry[0] !== key) return false;
|
||||
entry[0] = entry[1] = undefined;
|
||||
return true;
|
||||
},
|
||||
has: function(key) {
|
||||
var entry = key[this.name];
|
||||
if (!entry) return false;
|
||||
return entry[0] === key;
|
||||
}
|
||||
};
|
||||
window.WeakMap = WeakMap;
|
||||
})();
|
||||
}
|
||||
|
||||
(function(global) {
|
||||
var registrationsTable = new WeakMap();
|
||||
var setImmediate;
|
||||
if (/Trident|Edge/.test(navigator.userAgent)) {
|
||||
setImmediate = setTimeout;
|
||||
} else if (window.setImmediate) {
|
||||
setImmediate = window.setImmediate;
|
||||
} else {
|
||||
var setImmediateQueue = [];
|
||||
var sentinel = String(Math.random());
|
||||
window.addEventListener("message", function(e) {
|
||||
if (e.data === sentinel) {
|
||||
var queue = setImmediateQueue;
|
||||
setImmediateQueue = [];
|
||||
queue.forEach(function(func) {
|
||||
func();
|
||||
});
|
||||
}
|
||||
});
|
||||
setImmediate = function(func) {
|
||||
setImmediateQueue.push(func);
|
||||
window.postMessage(sentinel, "*");
|
||||
};
|
||||
}
|
||||
var isScheduled = false;
|
||||
var scheduledObservers = [];
|
||||
function scheduleCallback(observer) {
|
||||
scheduledObservers.push(observer);
|
||||
if (!isScheduled) {
|
||||
isScheduled = true;
|
||||
setImmediate(dispatchCallbacks);
|
||||
}
|
||||
}
|
||||
function wrapIfNeeded(node) {
|
||||
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
|
||||
}
|
||||
function dispatchCallbacks() {
|
||||
isScheduled = false;
|
||||
var observers = scheduledObservers;
|
||||
scheduledObservers = [];
|
||||
observers.sort(function(o1, o2) {
|
||||
return o1.uid_ - o2.uid_;
|
||||
});
|
||||
var anyNonEmpty = false;
|
||||
observers.forEach(function(observer) {
|
||||
var queue = observer.takeRecords();
|
||||
removeTransientObserversFor(observer);
|
||||
if (queue.length) {
|
||||
observer.callback_(queue, observer);
|
||||
anyNonEmpty = true;
|
||||
}
|
||||
});
|
||||
if (anyNonEmpty) dispatchCallbacks();
|
||||
}
|
||||
function removeTransientObserversFor(observer) {
|
||||
observer.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) return;
|
||||
registrations.forEach(function(registration) {
|
||||
if (registration.observer === observer) registration.removeTransientObservers();
|
||||
});
|
||||
});
|
||||
}
|
||||
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
|
||||
for (var node = target; node; node = node.parentNode) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (registrations) {
|
||||
for (var j = 0; j < registrations.length; j++) {
|
||||
var registration = registrations[j];
|
||||
var options = registration.options;
|
||||
if (node !== target && !options.subtree) continue;
|
||||
var record = callback(options);
|
||||
if (record) registration.enqueue(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var uidCounter = 0;
|
||||
function JsMutationObserver(callback) {
|
||||
this.callback_ = callback;
|
||||
this.nodes_ = [];
|
||||
this.records_ = [];
|
||||
this.uid_ = ++uidCounter;
|
||||
}
|
||||
JsMutationObserver.prototype = {
|
||||
observe: function(target, options) {
|
||||
target = wrapIfNeeded(target);
|
||||
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
|
||||
throw new SyntaxError();
|
||||
}
|
||||
var registrations = registrationsTable.get(target);
|
||||
if (!registrations) registrationsTable.set(target, registrations = []);
|
||||
var registration;
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i].observer === this) {
|
||||
registration = registrations[i];
|
||||
registration.removeListeners();
|
||||
registration.options = options;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!registration) {
|
||||
registration = new Registration(this, target, options);
|
||||
registrations.push(registration);
|
||||
this.nodes_.push(target);
|
||||
}
|
||||
registration.addListeners();
|
||||
},
|
||||
disconnect: function() {
|
||||
this.nodes_.forEach(function(node) {
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
var registration = registrations[i];
|
||||
if (registration.observer === this) {
|
||||
registration.removeListeners();
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
this.records_ = [];
|
||||
},
|
||||
takeRecords: function() {
|
||||
var copyOfRecords = this.records_;
|
||||
this.records_ = [];
|
||||
return copyOfRecords;
|
||||
}
|
||||
};
|
||||
function MutationRecord(type, target) {
|
||||
this.type = type;
|
||||
this.target = target;
|
||||
this.addedNodes = [];
|
||||
this.removedNodes = [];
|
||||
this.previousSibling = null;
|
||||
this.nextSibling = null;
|
||||
this.attributeName = null;
|
||||
this.attributeNamespace = null;
|
||||
this.oldValue = null;
|
||||
}
|
||||
function copyMutationRecord(original) {
|
||||
var record = new MutationRecord(original.type, original.target);
|
||||
record.addedNodes = original.addedNodes.slice();
|
||||
record.removedNodes = original.removedNodes.slice();
|
||||
record.previousSibling = original.previousSibling;
|
||||
record.nextSibling = original.nextSibling;
|
||||
record.attributeName = original.attributeName;
|
||||
record.attributeNamespace = original.attributeNamespace;
|
||||
record.oldValue = original.oldValue;
|
||||
return record;
|
||||
}
|
||||
var currentRecord, recordWithOldValue;
|
||||
function getRecord(type, target) {
|
||||
return currentRecord = new MutationRecord(type, target);
|
||||
}
|
||||
function getRecordWithOldValue(oldValue) {
|
||||
if (recordWithOldValue) return recordWithOldValue;
|
||||
recordWithOldValue = copyMutationRecord(currentRecord);
|
||||
recordWithOldValue.oldValue = oldValue;
|
||||
return recordWithOldValue;
|
||||
}
|
||||
function clearRecords() {
|
||||
currentRecord = recordWithOldValue = undefined;
|
||||
}
|
||||
function recordRepresentsCurrentMutation(record) {
|
||||
return record === recordWithOldValue || record === currentRecord;
|
||||
}
|
||||
function selectRecord(lastRecord, newRecord) {
|
||||
if (lastRecord === newRecord) return lastRecord;
|
||||
if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue;
|
||||
return null;
|
||||
}
|
||||
function Registration(observer, target, options) {
|
||||
this.observer = observer;
|
||||
this.target = target;
|
||||
this.options = options;
|
||||
this.transientObservedNodes = [];
|
||||
}
|
||||
Registration.prototype = {
|
||||
enqueue: function(record) {
|
||||
var records = this.observer.records_;
|
||||
var length = records.length;
|
||||
if (records.length > 0) {
|
||||
var lastRecord = records[length - 1];
|
||||
var recordToReplaceLast = selectRecord(lastRecord, record);
|
||||
if (recordToReplaceLast) {
|
||||
records[length - 1] = recordToReplaceLast;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
scheduleCallback(this.observer);
|
||||
}
|
||||
records[length] = record;
|
||||
},
|
||||
addListeners: function() {
|
||||
this.addListeners_(this.target);
|
||||
},
|
||||
addListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
removeListeners: function() {
|
||||
this.removeListeners_(this.target);
|
||||
},
|
||||
removeListeners_: function(node) {
|
||||
var options = this.options;
|
||||
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
|
||||
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
|
||||
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
|
||||
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
|
||||
},
|
||||
addTransientObserver: function(node) {
|
||||
if (node === this.target) return;
|
||||
this.addListeners_(node);
|
||||
this.transientObservedNodes.push(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
if (!registrations) registrationsTable.set(node, registrations = []);
|
||||
registrations.push(this);
|
||||
},
|
||||
removeTransientObservers: function() {
|
||||
var transientObservedNodes = this.transientObservedNodes;
|
||||
this.transientObservedNodes = [];
|
||||
transientObservedNodes.forEach(function(node) {
|
||||
this.removeListeners_(node);
|
||||
var registrations = registrationsTable.get(node);
|
||||
for (var i = 0; i < registrations.length; i++) {
|
||||
if (registrations[i] === this) {
|
||||
registrations.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
handleEvent: function(e) {
|
||||
e.stopImmediatePropagation();
|
||||
switch (e.type) {
|
||||
case "DOMAttrModified":
|
||||
var name = e.attrName;
|
||||
var namespace = e.relatedNode.namespaceURI;
|
||||
var target = e.target;
|
||||
var record = new getRecord("attributes", target);
|
||||
record.attributeName = name;
|
||||
record.attributeNamespace = namespace;
|
||||
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.attributes) return;
|
||||
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
|
||||
return;
|
||||
}
|
||||
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMCharacterDataModified":
|
||||
var target = e.target;
|
||||
var record = getRecord("characterData", target);
|
||||
var oldValue = e.prevValue;
|
||||
forEachAncestorAndObserverEnqueueRecord(target, function(options) {
|
||||
if (!options.characterData) return;
|
||||
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
|
||||
return record;
|
||||
});
|
||||
break;
|
||||
|
||||
case "DOMNodeRemoved":
|
||||
this.addTransientObserver(e.target);
|
||||
|
||||
case "DOMNodeInserted":
|
||||
var changedNode = e.target;
|
||||
var addedNodes, removedNodes;
|
||||
if (e.type === "DOMNodeInserted") {
|
||||
addedNodes = [ changedNode ];
|
||||
removedNodes = [];
|
||||
} else {
|
||||
addedNodes = [];
|
||||
removedNodes = [ changedNode ];
|
||||
}
|
||||
var previousSibling = changedNode.previousSibling;
|
||||
var nextSibling = changedNode.nextSibling;
|
||||
var record = getRecord("childList", e.target.parentNode);
|
||||
record.addedNodes = addedNodes;
|
||||
record.removedNodes = removedNodes;
|
||||
record.previousSibling = previousSibling;
|
||||
record.nextSibling = nextSibling;
|
||||
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) {
|
||||
if (!options.childList) return;
|
||||
return record;
|
||||
});
|
||||
}
|
||||
clearRecords();
|
||||
}
|
||||
};
|
||||
global.JsMutationObserver = JsMutationObserver;
|
||||
if (!global.MutationObserver) global.MutationObserver = JsMutationObserver;
|
||||
})(window);
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
125
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/README.md
поставляемый
Normal file
125
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/README.md
поставляемый
Normal file
|
@ -0,0 +1,125 @@
|
|||
webcomponents.js
|
||||
================
|
||||
|
||||
[![Join the chat at https://gitter.im/webcomponents/webcomponentsjs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/webcomponents/webcomponentsjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
A suite of polyfills supporting the [Web Components](http://webcomponents.org) specs:
|
||||
|
||||
**Custom Elements**: allows authors to define their own custom tags ([spec](https://w3c.github.io/webcomponents/spec/custom/)).
|
||||
|
||||
**HTML Imports**: a way to include and reuse HTML documents via other HTML documents ([spec](https://w3c.github.io/webcomponents/spec/imports/)).
|
||||
|
||||
**Shadow DOM**: provides encapsulation by hiding DOM subtrees under shadow roots ([spec](https://w3c.github.io/webcomponents/spec/shadow/)).
|
||||
|
||||
This also folds in polyfills for `MutationObserver` and `WeakMap`.
|
||||
|
||||
|
||||
## Releases
|
||||
|
||||
Pre-built (concatenated & minified) versions of the polyfills are maintained in the [tagged versions](https://github.com/webcomponents/webcomponentsjs/releases) of this repo. There are two variants:
|
||||
|
||||
`webcomponents.js` includes all of the polyfills.
|
||||
|
||||
`webcomponents-lite.js` includes all polyfills except for shadow DOM.
|
||||
|
||||
|
||||
## Browser Support
|
||||
|
||||
Our polyfills are intended to work in the latest versions of evergreen browsers. See below
|
||||
for our complete browser support matrix:
|
||||
|
||||
| Polyfill | IE10 | IE11+ | Chrome* | Firefox* | Safari 7+* | Chrome Android* | Mobile Safari* |
|
||||
| ---------- |:----:|:-----:|:-------:|:--------:|:----------:|:---------------:|:--------------:|
|
||||
| Custom Elements | ~ | ✓ | ✓ | ✓ | ✓ | ✓| ✓ |
|
||||
| HTML Imports | ~ | ✓ | ✓ | ✓ | ✓| ✓| ✓ |
|
||||
| Shadow DOM | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
|
||||
| Templates | ✓ | ✓ | ✓ | ✓| ✓ | ✓ | ✓ |
|
||||
|
||||
|
||||
*Indicates the current version of the browser
|
||||
|
||||
~Indicates support may be flaky. If using Custom Elements or HTML Imports with Shadow DOM,
|
||||
you will get the non-flaky Mutation Observer polyfill that Shadow DOM includes.
|
||||
|
||||
The polyfills may work in older browsers, however require additional polyfills (such as classList)
|
||||
to be used. We cannot guarantee support for browsers outside of our compatibility matrix.
|
||||
|
||||
|
||||
### Manually Building
|
||||
|
||||
If you wish to build the polyfills yourself, you'll need `node` and `gulp` on your system:
|
||||
|
||||
* install [node.js](http://nodejs.org/) using the instructions on their website
|
||||
* use `npm` to install [gulp.js](http://gulpjs.com/): `npm install -g gulp`
|
||||
|
||||
Now you are ready to build the polyfills with:
|
||||
|
||||
# install dependencies
|
||||
npm install
|
||||
# build
|
||||
gulp build
|
||||
|
||||
The builds will be placed into the `dist/` directory.
|
||||
|
||||
## Contribute
|
||||
|
||||
See the [contributing guide](CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
Everything in this repository is BSD style license unless otherwise specified.
|
||||
|
||||
Copyright (c) 2015 The Polymer Authors. All rights reserved.
|
||||
|
||||
## Helper utilities
|
||||
|
||||
### `WebComponentsReady`
|
||||
|
||||
Under native HTML Imports, `<script>` tags in the main document block the loading of such imports. This is to ensure the imports have loaded and any registered elements in them have been upgraded.
|
||||
|
||||
The webcomponents.js and webcomponents-lite.js polyfills parse element definitions and handle their upgrade asynchronously. If prematurely fetching the element from the DOM before it has an opportunity to upgrade, you'll be working with an `HTMLUnknownElement`.
|
||||
|
||||
For these situations (or when you need an approximate replacement for the Polymer 0.5 `polymer-ready` behavior), you can use the `WebComponentsReady` event as a signal before interacting with the element. The criteria for this event to fire is all Custom Elements with definitions registered by the time HTML Imports available at load time have loaded have upgraded.
|
||||
|
||||
```js
|
||||
window.addEventListener('WebComponentsReady', function(e) {
|
||||
// imports are loaded and elements have been registered
|
||||
console.log('Components are ready');
|
||||
});
|
||||
```
|
||||
|
||||
## Known Issues
|
||||
|
||||
* [Custom element's constructor property is unreliable](#constructor)
|
||||
* [Contenteditable elements do not trigger MutationObserver](#contentedit)
|
||||
* [ShadowCSS: :host-context(...):host(...) doesn't work](#hostcontext)
|
||||
* [execCommand isn't supported under Shadow DOM](#execcommand)
|
||||
|
||||
### Custom element's constructor property is unreliable <a id="constructor"></a>
|
||||
See [#215](https://github.com/webcomponents/webcomponentsjs/issues/215) for background.
|
||||
|
||||
In Safari and IE, instances of Custom Elements have a `constructor` property of `HTMLUnknownElementConstructor` and `HTMLUnknownElement`, respectively. It's unsafe to rely on this property for checking element types.
|
||||
|
||||
It's worth noting that `customElement.__proto__.__proto__.constructor` is `HTMLElementPrototype` and that the prototype chain isn't modified by the polyfills(onto `ElementPrototype`, etc.)
|
||||
|
||||
### Contenteditable elements do not trigger MutationObserver <a id="contentedit"></a>
|
||||
Using the MutationObserver polyfill, it isn't possible to monitor mutations of an element marked `contenteditable`.
|
||||
See [the mailing list](https://groups.google.com/forum/#!msg/polymer-dev/LHdtRVXXVsA/v1sGoiTYWUkJ)
|
||||
|
||||
### ShadowCSS: :host-context(...):host(...) doesn't work <a id="hostcontext"></a>
|
||||
See [#16](https://github.com/webcomponents/webcomponentsjs/issues/16) for background.
|
||||
|
||||
Under the shadow DOM polyfill, rules like:
|
||||
```
|
||||
:host-context(.foo):host(.bar) {...}
|
||||
```
|
||||
don't work, despite working under native Shadow DOM. The solution is to use `polyfill-next-selector` like:
|
||||
|
||||
```
|
||||
polyfill-next-selector { content: '.foo :host.bar, :host.foo.bar'; }
|
||||
```
|
||||
|
||||
### execCommand and contenteditable isn't supported under Shadow DOM <a id="execcommand"></a>
|
||||
See [#212](https://github.com/webcomponents/webcomponentsjs/issues/212)
|
||||
|
||||
`execCommand`, and `contenteditable` aren't supported under the ShadowDOM polyfill, with commands that insert or remove nodes being especially prone to failure.
|
4414
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/ShadowDOM.js
поставляемый
Normal file
4414
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/ShadowDOM.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
15
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/ShadowDOM.min.js
поставляемый
Normal file
15
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/ShadowDOM.min.js
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
18
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/bower.json
поставляемый
Normal file
18
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/bower.json
поставляемый
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "webcomponentsjs",
|
||||
"main": "webcomponents.js",
|
||||
"version": "0.7.12",
|
||||
"homepage": "http://webcomponents.org",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"webcomponents"
|
||||
],
|
||||
"license": "BSD",
|
||||
"ignore": []
|
||||
}
|
31
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/package.json
поставляемый
Normal file
31
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/package.json
поставляемый
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"name": "webcomponents.js",
|
||||
"version": "0.7.12",
|
||||
"description": "webcomponents.js",
|
||||
"main": "webcomponents.js",
|
||||
"directories": {
|
||||
"test": "tests"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs.git"
|
||||
},
|
||||
"author": "The Polymer Authors",
|
||||
"license": {
|
||||
"type": "BSD-3-Clause",
|
||||
"url": "http://polymer.github.io/LICENSE.txt"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/webcomponents/webcomponentsjs/issues"
|
||||
},
|
||||
"homepage": "http://webcomponents.org",
|
||||
"devDependencies": {
|
||||
"gulp": "^3.8.8",
|
||||
"gulp-audit": "^1.0.0",
|
||||
"gulp-concat": "^2.4.1",
|
||||
"gulp-header": "^1.1.1",
|
||||
"gulp-uglify": "^1.0.1",
|
||||
"run-sequence": "^1.0.1",
|
||||
"web-component-tester": "*"
|
||||
}
|
||||
}
|
2376
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents-lite.js
поставляемый
Normal file
2376
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents-lite.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
7112
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents.js
поставляемый
Normal file
7112
q3-2015/import.export.deliveries/bower_components/emoji-rain/bower_components/webcomponentsjs/webcomponents.js
поставляемый
Normal file
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
336
q3-2015/import.export.deliveries/bower_components/emoji-rain/emoji-rain.html
поставляемый
Normal file
336
q3-2015/import.export.deliveries/bower_components/emoji-rain/emoji-rain.html
поставляемый
Normal file
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
137
q3-2015/import.export.deliveries/bower_components/emoji-rain/index.html
поставляемый
Normal file
137
q3-2015/import.export.deliveries/bower_components/emoji-rain/index.html
поставляемый
Normal file
|
@ -0,0 +1,137 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta content='emoji-rain' name='title' />
|
||||
<title>emoji-rain</title>
|
||||
<meta content='width=460' name='viewport'>
|
||||
<meta content='text/html; charset=utf-8' http-equiv='content-type' />
|
||||
<link href='http://fonts.googleapis.com/css?family=Lato:300,400' rel='stylesheet' type='text/css'>
|
||||
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="bower_components/polymer/polymer.html">
|
||||
<link rel="import" href="emoji-rain.html">
|
||||
</head>
|
||||
<body>
|
||||
<emoji-rain id="rainmaker" drops="350"></emoji-rain>
|
||||
|
||||
<div class="container">
|
||||
<section>
|
||||
<h1>What is this even</h1>
|
||||
<p>This is a Polymer element that you can drop on any web page and make it rain emoji.
|
||||
Because, seriously, why wouldn't you?
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<button onclick="rain(this, false)" id="button-rain">Make it rain!</button>
|
||||
<input id="use-twemoji" type="checkbox" onclick="twemojiChanged(event)">
|
||||
<span class="big">with Twitter emoji</span>
|
||||
</section>
|
||||
|
||||
<div id="footer">
|
||||
<p>made with <span style="color: #E91E63">❤︎</span> by <a href="https://twitter.com/notwaldorf">monica</a>.
|
||||
find this on <a href="https://github.com/notwaldorf/emoji-rain">github</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<style>
|
||||
|
||||
body {
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
font-weight: 300;
|
||||
background: #fff;
|
||||
color: #535353;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 50px;
|
||||
overflow: auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
section {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
margin-top: 50px;
|
||||
padding-top: 20px;
|
||||
border-top: 2px solid #E91E63;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
h1, button, .big {
|
||||
font-family: 'Lato', 'Helvetica', Arial, sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
#footer p {
|
||||
text-transform: uppercase;
|
||||
font-size: 10px;
|
||||
letter-spacing: .2em;
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
a:link, a:visited, button {
|
||||
color: #E91E63;
|
||||
text-decoration: none;
|
||||
padding-bottom: 5px;
|
||||
padding-top: 5px;
|
||||
background: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
outline:none;
|
||||
}
|
||||
|
||||
a:hover, button:hover, a:focus, button:focus {
|
||||
background-color: #E91E63;
|
||||
color: white;
|
||||
border-radius: 3px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: #F4FF81;
|
||||
}
|
||||
|
||||
#use-twemoji {
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
var rainmaker = document.getElementById('rainmaker');
|
||||
|
||||
function rain(button) {
|
||||
if (rainmaker.active) {
|
||||
rainmaker.stop();
|
||||
button.innerHTML = "Make it rain!";
|
||||
} else {
|
||||
rainmaker.start();
|
||||
button.innerHTML = "OMG stop the rain!";
|
||||
}
|
||||
}
|
||||
|
||||
function twemojiChanged(event) {
|
||||
rainmaker.useTwemoji = event.target.checked;
|
||||
}
|
||||
</script>
|
||||
</html>
|
121
q3-2015/import.export.deliveries/bower_components/emoji-rain/test/basic.html
поставляемый
Normal file
121
q3-2015/import.export.deliveries/bower_components/emoji-rain/test/basic.html
поставляемый
Normal file
|
@ -0,0 +1,121 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>emoji-rain tests</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../emoji-rain.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<emoji-rain drops="2"></emoji-rain>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('basic', function() {
|
||||
test('generates as many emoji as told', function() {
|
||||
var rain = fixture('basic');
|
||||
expect(rain.dropsForDrawing.length).to.be.eql(2);
|
||||
|
||||
// Both should have a character
|
||||
expect(rain.dropsForDrawing[0].code).to.be.ok;
|
||||
expect(rain.dropsForDrawing[1].code).to.be.ok;
|
||||
|
||||
// Neither should have twemoji images
|
||||
expect(rain.dropsForDrawing[0].img).to.be.not.ok;
|
||||
expect(rain.dropsForDrawing[1].img).to.be.not.ok;
|
||||
});
|
||||
|
||||
test('it can rain', function(done) {
|
||||
var rain = fixture('basic');
|
||||
rain.addEventListener('emoji-rain-start', function() {
|
||||
expect(rain.active).to.be.eql(true);
|
||||
done();
|
||||
});
|
||||
rain.start();
|
||||
});
|
||||
|
||||
test('it can stop raining', function(done) {
|
||||
var rain = fixture('basic');
|
||||
rain.addEventListener('emoji-rain-start', function() {
|
||||
expect(rain.active).to.be.eql(true);
|
||||
rain.stop();
|
||||
});
|
||||
rain.addEventListener('emoji-rain-stop', function() {
|
||||
expect(rain.active).to.be.eql(false);
|
||||
done();
|
||||
});
|
||||
rain.start();
|
||||
});
|
||||
});
|
||||
|
||||
suite('twemoji', function() {
|
||||
test('does not load twemoji by default', function() {
|
||||
var rain = fixture('basic');
|
||||
expect(rain.useTwemoji).to.be.eql(false);
|
||||
expect(rain.importedTwemoji).to.be.not.ok;
|
||||
});
|
||||
|
||||
test('loads twemoji on demand', function(done) {
|
||||
var rain = fixture('basic');
|
||||
expect(rain.useTwemoji).to.be.eql(false);
|
||||
expect(rain.importedTwemoji).to.be.not.ok;
|
||||
|
||||
rain.addEventListener('emoji-rain-twemoji-ready', function() {
|
||||
setTimeout(function() {
|
||||
expect(rain.useTwemoji).to.be.eql(true);
|
||||
expect(rain.importedTwemoji).to.be.eql(true);
|
||||
expect(rain.active).to.be.eql(false);
|
||||
|
||||
expect(rain.dropsForDrawing.length).to.be.eql(2);
|
||||
|
||||
// Both should have a character
|
||||
expect(rain.dropsForDrawing[0].code).to.be.ok;
|
||||
expect(rain.dropsForDrawing[1].code).to.be.ok;
|
||||
|
||||
// Noth should have twemoji images
|
||||
expect(rain.dropsForDrawing[0].img).to.be.ok;
|
||||
expect(rain.dropsForDrawing[1].img).to.be.ok;
|
||||
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
rain.useTwemoji = true;
|
||||
});
|
||||
|
||||
test('raining continues after loading twemoji', function() {
|
||||
var rain = fixture('basic');
|
||||
rain.start();
|
||||
expect(rain.useTwemoji).to.be.eql(false);
|
||||
expect(rain.importedTwemoji).to.be.not.ok;
|
||||
|
||||
rain.addEventListener('emoji-rain-twemoji-ready', function() {
|
||||
setTimeout(function() {
|
||||
expect(rain.useTwemoji).to.be.eql(true);
|
||||
expect(rain.importedTwemoji).to.be.eql(true);
|
||||
expect(rain.active).to.be.eql(true);
|
||||
done();
|
||||
}, 1);
|
||||
});
|
||||
rain.useTwemoji = true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
23
q3-2015/import.export.deliveries/bower_components/emoji-rain/test/index.html
поставляемый
Normal file
23
q3-2015/import.export.deliveries/bower_components/emoji-rain/test/index.html
поставляемый
Normal file
|
@ -0,0 +1,23 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'basic.html'
|
||||
]);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
11
q3-2015/import.export.deliveries/bower_components/emoji-rain/twemoji-script-holder.html
поставляемый
Normal file
11
q3-2015/import.export.deliveries/bower_components/emoji-rain/twemoji-script-holder.html
поставляемый
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<!-- Holds the script for async loading -->
|
||||
<script src="https://twemoji.maxcdn.com/twemoji.min.js"></script>
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.2.1",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"ignore": [
|
||||
"/.*",
|
||||
"/test/",
|
||||
"gen-changelog.sh"
|
||||
],
|
||||
"authors": [
|
||||
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Polymer/polymer.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"webcomponentsjs": "^0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"private": true,
|
||||
"homepage": "https://github.com/Polymer/polymer",
|
||||
"_release": "1.2.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.2.1",
|
||||
"commit": "be2d57a329244735ca7aac34ac56c96b6270ae79"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/polymer.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "Polymer/polymer"
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) 2014 The Polymer Authors. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "polymer",
|
||||
"version": "1.2.1",
|
||||
"main": [
|
||||
"polymer.html"
|
||||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"ignore": [
|
||||
"/.*",
|
||||
"/test/",
|
||||
"gen-changelog.sh"
|
||||
],
|
||||
"authors": [
|
||||
"The Polymer Authors (http://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Polymer/polymer.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"webcomponentsjs": "^0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"private": true
|
||||
}
|
598
q3-2015/import.export.deliveries/bower_components/polymer/polymer-micro.html
поставляемый
Normal file
598
q3-2015/import.export.deliveries/bower_components/polymer/polymer-micro.html
поставляемый
Normal file
|
@ -0,0 +1,598 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
--><script>(function () {
|
||||
function resolve() {
|
||||
document.body.removeAttribute('unresolved');
|
||||
}
|
||||
if (window.WebComponents) {
|
||||
addEventListener('WebComponentsReady', resolve);
|
||||
} else {
|
||||
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
||||
resolve();
|
||||
} else {
|
||||
addEventListener('DOMContentLoaded', resolve);
|
||||
}
|
||||
}
|
||||
}());
|
||||
window.Polymer = {
|
||||
Settings: function () {
|
||||
var user = window.Polymer || {};
|
||||
location.search.slice(1).split('&').forEach(function (o) {
|
||||
o = o.split('=');
|
||||
o[0] && (user[o[0]] = o[1] || true);
|
||||
});
|
||||
var wantShadow = user.dom === 'shadow';
|
||||
var hasShadow = Boolean(Element.prototype.createShadowRoot);
|
||||
var nativeShadow = hasShadow && !window.ShadowDOMPolyfill;
|
||||
var useShadow = wantShadow && hasShadow;
|
||||
var hasNativeImports = Boolean('import' in document.createElement('link'));
|
||||
var useNativeImports = hasNativeImports;
|
||||
var useNativeCustomElements = !window.CustomElements || window.CustomElements.useNative;
|
||||
return {
|
||||
wantShadow: wantShadow,
|
||||
hasShadow: hasShadow,
|
||||
nativeShadow: nativeShadow,
|
||||
useShadow: useShadow,
|
||||
useNativeShadow: useShadow && nativeShadow,
|
||||
useNativeImports: useNativeImports,
|
||||
useNativeCustomElements: useNativeCustomElements
|
||||
};
|
||||
}()
|
||||
};
|
||||
(function () {
|
||||
var userPolymer = window.Polymer;
|
||||
window.Polymer = function (prototype) {
|
||||
if (typeof prototype === 'function') {
|
||||
prototype = prototype.prototype;
|
||||
}
|
||||
if (!prototype) {
|
||||
prototype = {};
|
||||
}
|
||||
var factory = desugar(prototype);
|
||||
prototype = factory.prototype;
|
||||
var options = { prototype: prototype };
|
||||
if (prototype.extends) {
|
||||
options.extends = prototype.extends;
|
||||
}
|
||||
Polymer.telemetry._registrate(prototype);
|
||||
document.registerElement(prototype.is, options);
|
||||
return factory;
|
||||
};
|
||||
var desugar = function (prototype) {
|
||||
var base = Polymer.Base;
|
||||
if (prototype.extends) {
|
||||
base = Polymer.Base._getExtendedPrototype(prototype.extends);
|
||||
}
|
||||
prototype = Polymer.Base.chainObject(prototype, base);
|
||||
prototype.registerCallback();
|
||||
return prototype.constructor;
|
||||
};
|
||||
window.Polymer = Polymer;
|
||||
if (userPolymer) {
|
||||
for (var i in userPolymer) {
|
||||
Polymer[i] = userPolymer[i];
|
||||
}
|
||||
}
|
||||
Polymer.Class = desugar;
|
||||
}());
|
||||
Polymer.telemetry = {
|
||||
registrations: [],
|
||||
_regLog: function (prototype) {
|
||||
console.log('[' + prototype.is + ']: registered');
|
||||
},
|
||||
_registrate: function (prototype) {
|
||||
this.registrations.push(prototype);
|
||||
Polymer.log && this._regLog(prototype);
|
||||
},
|
||||
dumpRegistrations: function () {
|
||||
this.registrations.forEach(this._regLog);
|
||||
}
|
||||
};
|
||||
Object.defineProperty(window, 'currentImport', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
get: function () {
|
||||
return (document._currentScript || document.currentScript).ownerDocument;
|
||||
}
|
||||
});
|
||||
Polymer.RenderStatus = {
|
||||
_ready: false,
|
||||
_callbacks: [],
|
||||
whenReady: function (cb) {
|
||||
if (this._ready) {
|
||||
cb();
|
||||
} else {
|
||||
this._callbacks.push(cb);
|
||||
}
|
||||
},
|
||||
_makeReady: function () {
|
||||
this._ready = true;
|
||||
this._callbacks.forEach(function (cb) {
|
||||
cb();
|
||||
});
|
||||
this._callbacks = [];
|
||||
},
|
||||
_catchFirstRender: function () {
|
||||
requestAnimationFrame(function () {
|
||||
Polymer.RenderStatus._makeReady();
|
||||
});
|
||||
}
|
||||
};
|
||||
if (window.HTMLImports) {
|
||||
HTMLImports.whenReady(function () {
|
||||
Polymer.RenderStatus._catchFirstRender();
|
||||
});
|
||||
} else {
|
||||
Polymer.RenderStatus._catchFirstRender();
|
||||
}
|
||||
Polymer.ImportStatus = Polymer.RenderStatus;
|
||||
Polymer.ImportStatus.whenLoaded = Polymer.ImportStatus.whenReady;
|
||||
Polymer.Base = {
|
||||
__isPolymerInstance__: true,
|
||||
_addFeature: function (feature) {
|
||||
this.extend(this, feature);
|
||||
},
|
||||
registerCallback: function () {
|
||||
this._desugarBehaviors();
|
||||
this._doBehavior('beforeRegister');
|
||||
this._registerFeatures();
|
||||
this._doBehavior('registered');
|
||||
},
|
||||
createdCallback: function () {
|
||||
Polymer.telemetry.instanceCount++;
|
||||
this.root = this;
|
||||
this._doBehavior('created');
|
||||
this._initFeatures();
|
||||
},
|
||||
attachedCallback: function () {
|
||||
Polymer.RenderStatus.whenReady(function () {
|
||||
this.isAttached = true;
|
||||
this._doBehavior('attached');
|
||||
}.bind(this));
|
||||
},
|
||||
detachedCallback: function () {
|
||||
this.isAttached = false;
|
||||
this._doBehavior('detached');
|
||||
},
|
||||
attributeChangedCallback: function (name) {
|
||||
this._attributeChangedImpl(name);
|
||||
this._doBehavior('attributeChanged', arguments);
|
||||
},
|
||||
_attributeChangedImpl: function (name) {
|
||||
this._setAttributeToProperty(this, name);
|
||||
},
|
||||
extend: function (prototype, api) {
|
||||
if (prototype && api) {
|
||||
Object.getOwnPropertyNames(api).forEach(function (n) {
|
||||
this.copyOwnProperty(n, api, prototype);
|
||||
}, this);
|
||||
}
|
||||
return prototype || api;
|
||||
},
|
||||
mixin: function (target, source) {
|
||||
for (var i in source) {
|
||||
target[i] = source[i];
|
||||
}
|
||||
return target;
|
||||
},
|
||||
copyOwnProperty: function (name, source, target) {
|
||||
var pd = Object.getOwnPropertyDescriptor(source, name);
|
||||
if (pd) {
|
||||
Object.defineProperty(target, name, pd);
|
||||
}
|
||||
},
|
||||
_log: console.log.apply.bind(console.log, console),
|
||||
_warn: console.warn.apply.bind(console.warn, console),
|
||||
_error: console.error.apply.bind(console.error, console),
|
||||
_logf: function () {
|
||||
return this._logPrefix.concat([this.is]).concat(Array.prototype.slice.call(arguments, 0));
|
||||
}
|
||||
};
|
||||
Polymer.Base._logPrefix = function () {
|
||||
var color = window.chrome || /firefox/i.test(navigator.userAgent);
|
||||
return color ? [
|
||||
'%c[%s::%s]:',
|
||||
'font-weight: bold; background-color:#EEEE00;'
|
||||
] : ['[%s::%s]:'];
|
||||
}();
|
||||
Polymer.Base.chainObject = function (object, inherited) {
|
||||
if (object && inherited && object !== inherited) {
|
||||
if (!Object.__proto__) {
|
||||
object = Polymer.Base.extend(Object.create(inherited), object);
|
||||
}
|
||||
object.__proto__ = inherited;
|
||||
}
|
||||
return object;
|
||||
};
|
||||
Polymer.Base = Polymer.Base.chainObject(Polymer.Base, HTMLElement.prototype);
|
||||
if (window.CustomElements) {
|
||||
Polymer.instanceof = CustomElements.instanceof;
|
||||
} else {
|
||||
Polymer.instanceof = function (obj, ctor) {
|
||||
return obj instanceof ctor;
|
||||
};
|
||||
}
|
||||
Polymer.isInstance = function (obj) {
|
||||
return Boolean(obj && obj.__isPolymerInstance__);
|
||||
};
|
||||
Polymer.telemetry.instanceCount = 0;
|
||||
(function () {
|
||||
var modules = {};
|
||||
var lcModules = {};
|
||||
var findModule = function (id) {
|
||||
return modules[id] || lcModules[id.toLowerCase()];
|
||||
};
|
||||
var DomModule = function () {
|
||||
return document.createElement('dom-module');
|
||||
};
|
||||
DomModule.prototype = Object.create(HTMLElement.prototype);
|
||||
Polymer.Base.extend(DomModule.prototype, {
|
||||
constructor: DomModule,
|
||||
createdCallback: function () {
|
||||
this.register();
|
||||
},
|
||||
register: function (id) {
|
||||
var id = id || this.id || this.getAttribute('name') || this.getAttribute('is');
|
||||
if (id) {
|
||||
this.id = id;
|
||||
modules[id] = this;
|
||||
lcModules[id.toLowerCase()] = this;
|
||||
}
|
||||
},
|
||||
import: function (id, selector) {
|
||||
if (id) {
|
||||
var m = findModule(id);
|
||||
if (!m) {
|
||||
forceDocumentUpgrade();
|
||||
m = findModule(id);
|
||||
}
|
||||
if (m && selector) {
|
||||
m = m.querySelector(selector);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
}
|
||||
});
|
||||
var cePolyfill = window.CustomElements && !CustomElements.useNative;
|
||||
document.registerElement('dom-module', DomModule);
|
||||
function forceDocumentUpgrade() {
|
||||
if (cePolyfill) {
|
||||
var script = document._currentScript || document.currentScript;
|
||||
var doc = script && script.ownerDocument || document;
|
||||
if (doc) {
|
||||
CustomElements.upgradeAll(doc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}());
|
||||
Polymer.Base._addFeature({
|
||||
_prepIs: function () {
|
||||
if (!this.is) {
|
||||
var module = (document._currentScript || document.currentScript).parentNode;
|
||||
if (module.localName === 'dom-module') {
|
||||
var id = module.id || module.getAttribute('name') || module.getAttribute('is');
|
||||
this.is = id;
|
||||
}
|
||||
}
|
||||
if (this.is) {
|
||||
this.is = this.is.toLowerCase();
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
behaviors: [],
|
||||
_desugarBehaviors: function () {
|
||||
if (this.behaviors.length) {
|
||||
this.behaviors = this._desugarSomeBehaviors(this.behaviors);
|
||||
}
|
||||
},
|
||||
_desugarSomeBehaviors: function (behaviors) {
|
||||
behaviors = this._flattenBehaviorsList(behaviors);
|
||||
for (var i = behaviors.length - 1; i >= 0; i--) {
|
||||
this._mixinBehavior(behaviors[i]);
|
||||
}
|
||||
return behaviors;
|
||||
},
|
||||
_flattenBehaviorsList: function (behaviors) {
|
||||
var flat = [];
|
||||
behaviors.forEach(function (b) {
|
||||
if (b instanceof Array) {
|
||||
flat = flat.concat(this._flattenBehaviorsList(b));
|
||||
} else if (b) {
|
||||
flat.push(b);
|
||||
} else {
|
||||
this._warn(this._logf('_flattenBehaviorsList', 'behavior is null, check for missing or 404 import'));
|
||||
}
|
||||
}, this);
|
||||
return flat;
|
||||
},
|
||||
_mixinBehavior: function (b) {
|
||||
Object.getOwnPropertyNames(b).forEach(function (n) {
|
||||
switch (n) {
|
||||
case 'hostAttributes':
|
||||
case 'registered':
|
||||
case 'properties':
|
||||
case 'observers':
|
||||
case 'listeners':
|
||||
case 'created':
|
||||
case 'attached':
|
||||
case 'detached':
|
||||
case 'attributeChanged':
|
||||
case 'configure':
|
||||
case 'ready':
|
||||
break;
|
||||
default:
|
||||
if (!this.hasOwnProperty(n)) {
|
||||
this.copyOwnProperty(n, b, this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
_prepBehaviors: function () {
|
||||
this._prepFlattenedBehaviors(this.behaviors);
|
||||
},
|
||||
_prepFlattenedBehaviors: function (behaviors) {
|
||||
for (var i = 0, l = behaviors.length; i < l; i++) {
|
||||
this._prepBehavior(behaviors[i]);
|
||||
}
|
||||
this._prepBehavior(this);
|
||||
},
|
||||
_doBehavior: function (name, args) {
|
||||
this.behaviors.forEach(function (b) {
|
||||
this._invokeBehavior(b, name, args);
|
||||
}, this);
|
||||
this._invokeBehavior(this, name, args);
|
||||
},
|
||||
_invokeBehavior: function (b, name, args) {
|
||||
var fn = b[name];
|
||||
if (fn) {
|
||||
fn.apply(this, args || Polymer.nar);
|
||||
}
|
||||
},
|
||||
_marshalBehaviors: function () {
|
||||
this.behaviors.forEach(function (b) {
|
||||
this._marshalBehavior(b);
|
||||
}, this);
|
||||
this._marshalBehavior(this);
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_getExtendedPrototype: function (tag) {
|
||||
return this._getExtendedNativePrototype(tag);
|
||||
},
|
||||
_nativePrototypes: {},
|
||||
_getExtendedNativePrototype: function (tag) {
|
||||
var p = this._nativePrototypes[tag];
|
||||
if (!p) {
|
||||
var np = this.getNativePrototype(tag);
|
||||
p = this.extend(Object.create(np), Polymer.Base);
|
||||
this._nativePrototypes[tag] = p;
|
||||
}
|
||||
return p;
|
||||
},
|
||||
getNativePrototype: function (tag) {
|
||||
return Object.getPrototypeOf(document.createElement(tag));
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_prepConstructor: function () {
|
||||
this._factoryArgs = this.extends ? [
|
||||
this.extends,
|
||||
this.is
|
||||
] : [this.is];
|
||||
var ctor = function () {
|
||||
return this._factory(arguments);
|
||||
};
|
||||
if (this.hasOwnProperty('extends')) {
|
||||
ctor.extends = this.extends;
|
||||
}
|
||||
Object.defineProperty(this, 'constructor', {
|
||||
value: ctor,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
ctor.prototype = this;
|
||||
},
|
||||
_factory: function (args) {
|
||||
var elt = document.createElement.apply(document, this._factoryArgs);
|
||||
if (this.factoryImpl) {
|
||||
this.factoryImpl.apply(elt, args);
|
||||
}
|
||||
return elt;
|
||||
}
|
||||
});
|
||||
Polymer.nob = Object.create(null);
|
||||
Polymer.Base._addFeature({
|
||||
properties: {},
|
||||
getPropertyInfo: function (property) {
|
||||
var info = this._getPropertyInfo(property, this.properties);
|
||||
if (!info) {
|
||||
this.behaviors.some(function (b) {
|
||||
return info = this._getPropertyInfo(property, b.properties);
|
||||
}, this);
|
||||
}
|
||||
return info || Polymer.nob;
|
||||
},
|
||||
_getPropertyInfo: function (property, properties) {
|
||||
var p = properties && properties[property];
|
||||
if (typeof p === 'function') {
|
||||
p = properties[property] = { type: p };
|
||||
}
|
||||
if (p) {
|
||||
p.defined = true;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
});
|
||||
Polymer.CaseMap = {
|
||||
_caseMap: {},
|
||||
dashToCamelCase: function (dash) {
|
||||
var mapped = Polymer.CaseMap._caseMap[dash];
|
||||
if (mapped) {
|
||||
return mapped;
|
||||
}
|
||||
if (dash.indexOf('-') < 0) {
|
||||
return Polymer.CaseMap._caseMap[dash] = dash;
|
||||
}
|
||||
return Polymer.CaseMap._caseMap[dash] = dash.replace(/-([a-z])/g, function (m) {
|
||||
return m[1].toUpperCase();
|
||||
});
|
||||
},
|
||||
camelToDashCase: function (camel) {
|
||||
var mapped = Polymer.CaseMap._caseMap[camel];
|
||||
if (mapped) {
|
||||
return mapped;
|
||||
}
|
||||
return Polymer.CaseMap._caseMap[camel] = camel.replace(/([a-z][A-Z])/g, function (g) {
|
||||
return g[0] + '-' + g[1].toLowerCase();
|
||||
});
|
||||
}
|
||||
};
|
||||
Polymer.Base._addFeature({
|
||||
_prepAttributes: function () {
|
||||
this._aggregatedAttributes = {};
|
||||
},
|
||||
_addHostAttributes: function (attributes) {
|
||||
if (attributes) {
|
||||
this.mixin(this._aggregatedAttributes, attributes);
|
||||
}
|
||||
},
|
||||
_marshalHostAttributes: function () {
|
||||
this._applyAttributes(this, this._aggregatedAttributes);
|
||||
},
|
||||
_applyAttributes: function (node, attr$) {
|
||||
for (var n in attr$) {
|
||||
if (!this.hasAttribute(n) && n !== 'class') {
|
||||
this.serializeValueToAttribute(attr$[n], n, this);
|
||||
}
|
||||
}
|
||||
},
|
||||
_marshalAttributes: function () {
|
||||
this._takeAttributesToModel(this);
|
||||
},
|
||||
_takeAttributesToModel: function (model) {
|
||||
for (var i = 0, l = this.attributes.length; i < l; i++) {
|
||||
this._setAttributeToProperty(model, this.attributes[i].name);
|
||||
}
|
||||
},
|
||||
_setAttributeToProperty: function (model, attrName) {
|
||||
if (!this._serializing) {
|
||||
var propName = Polymer.CaseMap.dashToCamelCase(attrName);
|
||||
var info = this.getPropertyInfo(propName);
|
||||
if (info.defined || this._propertyEffects && this._propertyEffects[propName]) {
|
||||
var val = this.getAttribute(attrName);
|
||||
model[propName] = this.deserialize(val, info.type);
|
||||
}
|
||||
}
|
||||
},
|
||||
_serializing: false,
|
||||
reflectPropertyToAttribute: function (name) {
|
||||
this._serializing = true;
|
||||
this.serializeValueToAttribute(this[name], Polymer.CaseMap.camelToDashCase(name));
|
||||
this._serializing = false;
|
||||
},
|
||||
serializeValueToAttribute: function (value, attribute, node) {
|
||||
var str = this.serialize(value);
|
||||
(node || this)[str === undefined ? 'removeAttribute' : 'setAttribute'](attribute, str);
|
||||
},
|
||||
deserialize: function (value, type) {
|
||||
switch (type) {
|
||||
case Number:
|
||||
value = Number(value);
|
||||
break;
|
||||
case Boolean:
|
||||
value = value !== null;
|
||||
break;
|
||||
case Object:
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (x) {
|
||||
}
|
||||
break;
|
||||
case Array:
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (x) {
|
||||
value = null;
|
||||
console.warn('Polymer::Attributes: couldn`t decode Array as JSON');
|
||||
}
|
||||
break;
|
||||
case Date:
|
||||
value = new Date(value);
|
||||
break;
|
||||
case String:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return value;
|
||||
},
|
||||
serialize: function (value) {
|
||||
switch (typeof value) {
|
||||
case 'boolean':
|
||||
return value ? '' : undefined;
|
||||
case 'object':
|
||||
if (value instanceof Date) {
|
||||
return value;
|
||||
} else if (value) {
|
||||
try {
|
||||
return JSON.stringify(value);
|
||||
} catch (x) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
default:
|
||||
return value != null ? value : undefined;
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.Base._addFeature({
|
||||
_setupDebouncers: function () {
|
||||
this._debouncers = {};
|
||||
},
|
||||
debounce: function (jobName, callback, wait) {
|
||||
return this._debouncers[jobName] = Polymer.Debounce.call(this, this._debouncers[jobName], callback, wait);
|
||||
},
|
||||
isDebouncerActive: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
return debouncer && debouncer.finish;
|
||||
},
|
||||
flushDebouncer: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
if (debouncer) {
|
||||
debouncer.complete();
|
||||
}
|
||||
},
|
||||
cancelDebouncer: function (jobName) {
|
||||
var debouncer = this._debouncers[jobName];
|
||||
if (debouncer) {
|
||||
debouncer.stop();
|
||||
}
|
||||
}
|
||||
});
|
||||
Polymer.version = '1.2.1';
|
||||
Polymer.Base._addFeature({
|
||||
_registerFeatures: function () {
|
||||
this._prepIs();
|
||||
this._prepAttributes();
|
||||
this._prepBehaviors();
|
||||
this._prepConstructor();
|
||||
},
|
||||
_prepBehavior: function (b) {
|
||||
this._addHostAttributes(b.hostAttributes);
|
||||
},
|
||||
_marshalBehavior: function (b) {
|
||||
},
|
||||
_initFeatures: function () {
|
||||
this._marshalHostAttributes();
|
||||
this._setupDebouncers();
|
||||
this._marshalBehaviors();
|
||||
}
|
||||
});</script>
|
||||
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче