1
+ <!--
2
+ @license
3
+ Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
+ Code distributed by Google as part of the polymer project is also
8
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9
+ -->
10
+
11
+ < link rel ="import " href ="../utils/boot.html ">
12
+ < link rel ="import " href ="../utils/resolve-url.html ">
13
+
14
+ < script >
15
+ ( function ( ) {
16
+ 'use strict' ;
17
+
18
+ /**
19
+ * Legacy settings.
20
+ * @namespace
21
+ * @memberof Polymer
22
+ */
23
+ const settings = Polymer . Settings || { } ;
24
+ settings . useShadow = ! ( window . ShadyDOM ) ;
25
+ settings . useNativeCSSProperties =
26
+ Boolean ( ! window . ShadyCSS || window . ShadyCSS . nativeCss ) ;
27
+ settings . useNativeCustomElements =
28
+ ! ( window . customElements . polyfillWrapFlushCallback ) ;
29
+
30
+ /**
31
+ * Sets the global, legacy settings.
32
+ *
33
+ * @deprecated
34
+ * @memberof Polymer
35
+ */
36
+ Polymer . Settings = settings ;
37
+
38
+ /**
39
+ * Globally settable property that is automatically assigned to
40
+ * `Polymer.ElementMixin` instances, useful for binding in templates to
41
+ * make URL's relative to an application's root. Defaults to the main
42
+ * document URL, but can be overridden by users. It may be useful to set
43
+ * `Polymer.rootPath` to provide a stable application mount path when
44
+ * using client side routing.
45
+ *
46
+ * @memberof Polymer
47
+ */
48
+ let rootPath = Polymer . rootPath ||
49
+ Polymer . ResolveUrl . pathFromUrl ( document . baseURI || window . location . href ) ;
50
+
51
+ Polymer . rootPath = rootPath ;
52
+
53
+ /**
54
+ * Sets the global rootPath property used by `Polymer.ElementMixin` and
55
+ * available via `Polymer.rootPath`.
56
+ *
57
+ * @memberof Polymer
58
+ * @param {string } path The new root path
59
+ */
60
+ Polymer . setRootPath = function ( path ) {
61
+ Polymer . rootPath = path ;
62
+ }
63
+ } ) ( ) ;
64
+ </ script >
0 commit comments