Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·197 lines (177 loc) · 7.86 KB
/
Copy pathindex.html
File metadata and controls
executable file
·197 lines (177 loc) · 7.86 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ScandiPWA Documentation</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="shortcut icon" href="/images/favicon.ico" />
<!-- Stylesheets -->
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple.css" title="Light">
<!-- Alternate Stylesheets -->
<link rel="stylesheet alternate" href="//cdn.jsdelivr.net/npm/docsify-themeable@0/dist/css/theme-simple-dark.css" title="Dark">
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
logo: '/images/logo.svg',
name: 'Index',
loadSidebar: true,
executeScript: true,
subMaxLevel: 3,
auto2top: true,
repo: 'https://github.com/scandipwa/',
search: {
depth : 3,
noData : 'No results!',
placeholder: 'Search...'
},
formatUpdated: '{MM}/{DD}/{YYYY} {HH}:{mm}',
alias: {
'/docker/_sidebar.md': '/_sidebar.md',
'/theme/_sidebar.md': '/_sidebar.md'
},
plugins: [
function (hook, vm) {
hook.beforeEach(function (html) {
if (/githubusercontent\.com/.test(vm.route.file)) {
url = vm.route.file
.replace('raw.githubusercontent.com', 'github.com')
.replace(/\/master/, '/blob/master')
} else {
url = 'https://github.com/scandipwa/docs/blob/master/' + vm.route.file
}
var editHtml = '\n\n\n > [:memo: Edit this doc on GitHub](' + url + '), Last modified {docsify-updated}'
return html
+ editHtml
})
},
]
}
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js');
});
}
(function() {
// Functions
// =========================================================================
/**
* Adds event listeners to change active stylesheet and restore previously
* activated stylesheet on reload.
*
* @example
*
* This link:
* <a href="#" data-link-title="Foo">Foo</a>
* Will active this existing link:
* <link rel="stylesheet alternate" title="Foo" href="..." >
*
* @example
*
* This link:
* <a href="#" data-link-href="path/to/file.css">Bar</a>
* Will activate this existing link:
* <link rel="stylesheet alternate" title="[someID]" href="path/to/file.css" >
* Or generate this active link:
* <link rel="stylesheet" title="Bar" href="path/to/file.css" >
*/
function initStyleSwitcher() {
var isInitialzed = false;
var sessionStorageKey = 'activeStylesheetHref';
function handleSwitch(activeHref, activeTitle) {
var activeElm = document.querySelector('link[href*="' + activeHref +'"],link[title="' + activeTitle +'"]');
if (!activeElm && activeHref) {
activeElm = document.createElement('link');
activeElm.setAttribute('href', activeHref);
activeElm.setAttribute('rel', 'stylesheet');
activeElm.setAttribute('title', activeTitle);
document.head.appendChild(activeElm);
activeElm.addEventListener('load', function linkOnLoad() {
activeElm.removeEventListener('load', linkOnLoad);
setActiveLink(activeElm);
});
}
else if (activeElm) {
setActiveLink(activeElm);
}
}
function setActiveLink(activeElm) {
var activeHref = activeElm.getAttribute('href');
var activeTitle = activeElm.getAttribute('title');
var inactiveElms = document.querySelectorAll('link[title]:not([href*="' + activeHref +'"]):not([title="' + activeTitle +'"])');
// Remove "alternate" keyword
activeElm.setAttribute('rel', (activeElm.rel || '').replace(/\s*alternate/g, '').trim());
// Force enable stylesheet (required for some browsers)
activeElm.disabled = true;
activeElm.disabled = false;
// Store active style sheet
sessionStorage.setItem(sessionStorageKey, activeHref);
// Disable other elms
for (var i = 0; i < inactiveElms.length; i++) {
var elm = inactiveElms[i];
elm.disabled = true;
// Fix for browsersync and alternate stylesheet updates. Will
// cause FOUC when switching stylesheets during development, but
// required to properly apply style updates when alternate
// stylesheets are enabled.
if (window.browsersyncObserver) {
var linkRel = elm.getAttribute('rel') || '';
var linkRelAlt = linkRel.indexOf('alternate') > -1 ? linkRel : (linkRel + ' alternate').trim();
elm.setAttribute('rel', linkRelAlt);
}
}
// CSS custom property ponyfil
if ((window.$docsify || {}).themeable) {
window.$docsify.themeable.util.cssVars();
}
}
// Event listeners
if (!isInitialzed) {
isInitialzed = true;
// Restore active stylesheet
document.addEventListener('DOMContentLoaded', function() {
var activeHref = sessionStorage.getItem(sessionStorageKey);
if (activeHref) {
handleSwitch(activeHref);
}
});
// Update active stylesheet
document.addEventListener('click', function(evt) {
var dataHref = evt.target.getAttribute('data-link-href');
var dataTitle = evt.target.getAttribute('data-link-title')
if (dataHref || dataTitle) {
dataTitle = dataTitle
|| evt.target.textContent
|| '_' + Math.random().toString(36).substr(2, 9); // UID
handleSwitch(dataHref, dataTitle);
evt.preventDefault();
}
});
}
}
// Main
// =========================================================================
initStyleSwitcher();
})();
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/external-script.min.js"></script>
<!-- Theme related -->
<script src="//cdn.jsdelivr.net/npm/docsify-themeable@0"></script>
<script src="//cdn.jsdelivr.net/npm/docsify-copy-code@2"></script>
<!-- Functions -->
<script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.min.js"></script>
<!-- Language hightliting -->
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-php.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-yaml.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-docker.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-git.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-jsx.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-scss.min.js"></script>
</body>
</html>