forked from Polymer/polymer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
polymer.js
59 lines (50 loc) · 1.36 KB
/
polymer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Copyright 2013 The Polymer Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
(function() {
var thisFile = 'polymer.js';
var scopeName = 'Polymer';
var modules = [
"../platform/platform.js"
].concat([
"boot.js",
"lib/lang.js",
"lib/job.js",
"lib/dom.js",
"lib/super.js",
"lib/deserialize.js",
"api.js",
"instance/utils.js",
"instance/events.js",
"instance/attributes.js",
"instance/properties.js",
"instance/mdv.js",
"instance/base.js",
"instance/styles.js",
"declaration/path.js",
"declaration/styles.js",
"declaration/events.js",
"declaration/properties.js",
"declaration/attributes.js",
"declaration/prototype.js",
"declaration/polymer-element.js"
].map(function(n) {
return "src/" + n;
}));
// export
window[scopeName] = {
entryPointName: thisFile,
modules: modules
};
// bootstrap
var script = document.querySelector('script[src*="' + thisFile + '"]');
var src = script.attributes.src.value;
var basePath = src.slice(0, src.indexOf(thisFile));
if (!window.PolymerLoader) {
var path = basePath + '../tools/loader/loader.js';
document.write('<script src="' + path + '"></script>');
}
document.write('<script>PolymerLoader.load("' + scopeName + '")</script>');
})();