forked from googlearchive/CustomElements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom-elements.js
40 lines (32 loc) · 939 Bytes
/
custom-elements.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
/*
* 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 = 'custom-elements.js';
var scopeName = 'CustomElements';
var modules = [
'src/sidetable.js',
'MutationObservers/MutationObserver.js',
'src/MutationObserver.js',
'src/Observer.js',
'src/CustomElements.js',
'src/Parser.js',
'src/boot.js'
];
// 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>');
})();