|
6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
7 | 7 | <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> |
8 | 8 | <title>API Console with RAML editor demo</title> |
9 | | - <script src="../../node_modules/cryptojslib/components/core.js"></script> |
10 | | - <script src="../../node_modules/cryptojslib/rollups/sha1.js"></script> |
11 | | - <script src="../../node_modules/cryptojslib/components/enc-base64-min.js"></script> |
12 | | - <script src="../../node_modules/cryptojslib/rollups/md5.js"></script> |
13 | | - <script src="../../node_modules/cryptojslib/rollups/hmac-sha1.js"></script> |
14 | | - <script src="../../node_modules/jsrsasign/lib/jsrsasign-rsa-min.js"></script> |
15 | | - <!-- |
16 | | - Previously this was included into the compoennt. |
17 | | - Since compoennts are ES6 modules this libraries cannot be loaded into |
18 | | - the component as they do not export anything and won't set global variable. |
19 | | - --> |
20 | | - <script src="../../node_modules/jsonlint/lib/jsonlint.js"></script> |
21 | | - <script src="../../node_modules/codemirror/lib/codemirror.js"></script> |
22 | | - <script src="../../node_modules/codemirror/addon/mode/loadmode.js"></script> |
23 | | - <script src="../../node_modules/codemirror/mode/meta.js"></script> |
24 | | - <script src="../../node_modules/codemirror/mode/javascript/javascript.js"></script> |
25 | | - <script src="../../node_modules/codemirror/mode/xml/xml.js"></script> |
26 | | - <script src="../../node_modules/codemirror/mode/yaml/yaml.js"></script> |
27 | | - <script src="../../node_modules/codemirror/mode/htmlmixed/htmlmixed.js"></script> |
28 | | - <script src="../../node_modules/codemirror/addon/lint/lint.js"></script> |
29 | | - <script src="../../node_modules/codemirror/addon/lint/json-lint.js"></script> |
30 | | - <!-- |
31 | | - From the inside of a web component it is hard to determine where |
32 | | - scripts are actually located. This should be set if the page won't load all possible |
33 | | - scripts at run time. The component will download the "mode" from this location. |
34 | | - --> |
35 | | - <script> |
36 | | - /* global CodeMirror */ |
37 | | - CodeMirror.modeURL = '../../node_modules/codemirror/mode/%N/%N.js'; |
38 | | - </script> |
39 | 9 |
|
40 | 10 | <link rel="stylesheet" type="text/css" crossorigin="anonymous" href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,700|Roboto:400,300,300italic,400italic,500,500italic,700,700italic"> |
41 | 11 | <link rel="stylesheet" type="text/css" href="../api-console-master-styles.css"> |
|
132 | 102 | <body> |
133 | 103 | <div id="demo"></div> |
134 | 104 | <script type="module" src="./app.js" async></script> |
| 105 | + |
| 106 | + <script src="../vendor.js"></script> |
| 107 | + <script> |
| 108 | + document.addEventListener('WebComponentsReady', function() { |
| 109 | + if (!window.ShadyCSS) { |
| 110 | + return; |
| 111 | + } |
| 112 | + function shouldAddDocumentStyle(n) { |
| 113 | + return n.nodeType === Node.ELEMENT_NODE && n.localName === 'style' && !n.hasAttribute('scope'); |
| 114 | + } |
| 115 | + const CustomStyleInterface = window.ShadyCSS.CustomStyleInterface; |
| 116 | + |
| 117 | + const candidates = document.querySelectorAll('style'); |
| 118 | + for (let i = 0; i < candidates.length; i++) { |
| 119 | + const candidate = candidates[i]; |
| 120 | + if (shouldAddDocumentStyle(candidate)) { |
| 121 | + CustomStyleInterface.addCustomStyle(candidate); |
| 122 | + } |
| 123 | + } |
| 124 | + }); |
| 125 | + </script> |
135 | 126 | </body> |
136 | 127 |
|
137 | 128 | </html> |
0 commit comments