-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathimport.html
More file actions
211 lines (203 loc) · 12.8 KB
/
import.html
File metadata and controls
211 lines (203 loc) · 12.8 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Import - Workbench Tool</title>
<link rel="stylesheet" href="./css/styles.css" />
<link rel="stylesheet" href="./css/import/import.css" />
<script type="importmap">
{
"imports": {
"preact": "https://esm.sh/preact@10.23.1",
"preact/": "https://esm.sh/preact@10.23.1/",
"@preact/signals": "https://esm.sh/@preact/signals@1.3.0?external=preact",
"htm/preact": "https://esm.sh/htm@3.1.1/preact?external=preact"
}
}
</script>
<script src="./js/shared/log.js"></script>
<script src="./js/dist/spectrum-web-components.js" async></script>
<script src="./js/libs/vendors/html2canvas/html2canvas.min.js"></script>
<script src="./js/libs/vendors/codemirror/codemirror.js"></script>
<script src="./js/libs/vendors/codemirror/xml.js"></script>
<script src="./js/libs/vendors/codemirror/javascript.js"></script>
<script src="./js/libs/vendors/codemirror/css.js"></script>
<script src="./js/libs/vendors/codemirror/htmlmixed.js"></script>
<script src="./js/libs/vendors/codemirror/markdown.js"></script>
<script src="./js/libs/vendors/js-beautify/beautify-html.min.js"></script>
<script src="./js/libs/vendors/babel-polyfill/polyfill.js"></script>
<script src="./js/libs/vendors/exceljs/exceljs.min.js"></script>
<script src="./js/libs/vendors/jszip/jszip.min.js"></script>
<script src="./js/libs/vendors/he/he.min.js"></script>
<script src="./js/dist/helix-importer.js"></script>
<script src="./js/import/import.ui.js" type="module"></script>
</head>
<body class="tool loading">
<sp-theme color="dark" scale="medium">
<main>
<!-- IMPORT SECTION -->
<section class="import">
<div class="section-title">
<div>
<h2>Workbench</h2>
<sp-contextual-help>
<p>Prepare an import script for migrating your site content.</p>
</sp-contextual-help>
</div>
</div>
<sp-divider size="l"></sp-divider>
<div class="section-cols">
<div class="section-col">
<form class="import-form">
<sp-field-label for="import-url" required>URL</sp-field-label>
<sp-textfield class="option-field" id="import-url" type="url">
<sp-help-text slot="help-text">https://www.example.com</sp-help-text>
<sp-help-text slot="negative-help-text">Please enter a valid URL.</sp-help-text>
</sp-textfield>
<sp-accordion>
<sp-accordion-item label="Import Options" open>
<div>
<sp-field-label for="import-file-url">Transformation file
URL</sp-field-label>
<sp-textfield class="option-field" id="import-file-url" type="url"
value="http://localhost:3001/tools/importer/import.js"></sp-textfield>
<sp-field-label for="import-pageload-timeout">Page load timeout</sp-field-label>
<sp-number-field class="option-field" id="import-pageload-timeout" value="100"
min="0" step="100"
format-options='{ "style": "unit", "unit": "millisecond", "unitDisplay": "short" }'></sp-number-field>
<div class="local-save">
<div class="docx-or-jcr">
<sp-checkbox class="option-field" id="import-local-docx" checked>
Save as docx
</sp-checkbox>
<!-- Fields to be dynamically displayed -->
</div>
<div id="xwalk">
<sp-checkbox class="option-field" id="import-jcr-package">
Save as JCR Package
</sp-checkbox>
<div id="jcr-package-fields">
<div>
<div>
<sp-field-label for="jcr-site-folder" required>Content
Import Path</sp-field-label>
<sp-contextual-help>
<p>The import destination must reside under the path:
'/content/'</p>
</sp-contextual-help>
</div>
<sp-textfield id="jcr-site-folder" type="text" class="textfield"
pattern="/content/.+">
<sp-help-text slot="help-text">
Example: /content/mysite
</sp-help-text>
</sp-textfield>
</div>
<div>
<div>
<sp-field-label for="jcr-asset-folder" required>Asset Import
Path</sp-field-label>
<sp-contextual-help>
<p>The asset import destination must reside under the
path: '/content/dam/'</p>
</sp-contextual-help>
</div>
<sp-textfield id="jcr-asset-folder" type="text"
class="textfield" pattern="/content/dam/.+">
<sp-help-text slot="help-text">
Example: /content/dam/assets
</sp-help-text>
</sp-textfield>
</div>
</div>
</div>
<sp-checkbox class="option-field" id="import-local-da">
Save HTML for Document Authoring
</sp-checkbox>
<sp-checkbox class="option-field" id="import-local-html">
Save raw HTML
</sp-checkbox>
<sp-checkbox class="option-field" id="import-local-md">
Save as Markdown
</sp-checkbox>
</div>
<sp-checkbox class="option-field" id="import-enable-js">
Enable JavaScript
</sp-checkbox>
<sp-help-text variant="negative" icon>
Security risk: only enable Javascript execution when importing from trusted
websites.
</sp-help-text>
<sp-checkbox class="option-field" id="import-scroll-to-bottom" checked>
Scroll to bottom
</sp-checkbox>
<sp-field-label for="import-custom-headers">Custom headers</sp-field-label>
<sp-textfield class="option-field" id="import-custom-headers" multiline
placeholder="Define your custom headers as a JSON object with key/value (header name/header value)"></sp-textfield>
</div>
</sp-accordion-item>
</sp-accordion>
<div id="import-action-row">
<sp-button-group>
<sp-button id="import-doimport-button">Import</sp-button>
</sp-button-group>
<div id="transformation-file-default" class="hidden">
<sp-status-light size="s" variant="notice">The default transformation file is being
used</sp-status-light>
</div>
</div>
</form>
<span id="folder-name"></span>
<div class="page-preview hidden">
<sp-divider size="s"></sp-divider>
<h3>Page preview</h3>
<div><iframe id="import-content-frame"></iframe></div>
</div>
</div>
<div class="section-col">
<sp-tabs selected="import-preview">
<sp-tab label="Preview" value="import-preview"></sp-tab>
<sp-tab label="Markdown" value="import-markdown"></sp-tab>
<sp-tab label="JCR" value="import-jcr"></sp-tab>
<sp-tab label="HTML" value="import-html"></sp-tab>
<div id="import-file-picker-container"></div>
<sp-tab-panel value="import-preview">
<sp-theme color="light" scale="medium">
<div id="import-markdown-preview"></div>
</sp-theme>
</sp-tab-panel>
<sp-tab-panel value="import-markdown">
<div data-panel="source">
<div class="code">
<textarea id="import-markdown-source" rows="4" cols="10"></textarea>
</div>
</div>
</sp-tab-panel>
<sp-tab-panel value="import-html">
<div data-panel="source">
<div class="code">
<textarea id="import-transformed-html" rows="4" cols="10"></textarea>
</div>
</div>
</sp-tab-panel>
<sp-tab-panel value="import-jcr">
<div data-panel="source">
<div class="code">
<textarea id="import-jcr" rows="4" cols="10"></textarea>
</div>
</div>
</sp-tab-panel>
</sp-tabs>
<sp-button-group>
<sp-button id="import-downloadImportReport" class="hidden">Download import
report</sp-button>
</sp-button-group>
</div>
</div>
</section>
</main>
<div id="alert-container"></div>
</sp-theme>
<script src="./js/swc_loader.js" type="module"></script>
</body>
</html>