-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
84 lines (75 loc) · 2.54 KB
/
index.html
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
<!doctype html>
<!--
https://github.com/moos/wordpos-web
Copyright (c) 2012-2020 [email protected]
(The MIT License)
-->
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' https: http: 'unsafe-inline' 'unsafe-eval'">
<link rel="icon" href="data:," />
<title>Wordpos in the browser -- CDN</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/github.min.css">
<script defer src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
<!-- cdn source -->
<!-- <script class="cdn" src="https://unpkg.com/browse/[email protected]/dist/wordpos.min.js"></script> -->
<script class="cdn" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/wordpos.min.js"></script>
<script class="init">
let wordpos = window.wordpos = new WordPOS({
// preload: true,
// dictPath: 'https://unpkg.com/browse/[email protected]/dict',
dictPath: 'https://cdn.jsdelivr.net/npm/[email protected]/dict',
profile: true,
debug: true,
// stopwords: false
});
</script>
<script src="../main.js" name="main"></script>
<style>
pre {
padding: 0 2em;
display: block;
}
</style>
</head>
<body>
<h1>WordPOS CDN browser sample</h1>
Open console to see results.
<h4>Load</h4>
<pre><code class="cdn lang-html"> </code></pre>
<script>
document.querySelector('code.cdn').textContent =
document.querySelector('script.cdn').outerHTML;
</script>
<h4>Initialize</h4>
<pre><code class="init lang-javascript"> </code></pre>
<script>
document.querySelector('code.init').innerHTML =
document.querySelector('script.init').innerHTML;
</script>
<h4>Execute</h4>
<pre><code class="main lang-javascript"> </code></pre>
<script>
var el = document.querySelector('code.main');
if (fetch) {
fetch('../main.js')
.then(res => res.text())
.then(txt => {
el.innerText = txt;
document.querySelectorAll('pre code').forEach(hljs.highlightBlock);
})
.catch(() => {
el.innerHTML = 'Open <a href="../main.js">main.js</a>.';
});
} else {
el.innerHTML = 'Open <a href="../main.js">main.js</a>.';
}
</script>
<div style="white-space: pre; color: gray; font-size: small; position: relative; top: 64vh">
<p><small>v1.0.2</small></p>
<a href="https://github.com/moos/wordpos-web">https://github.com/moos/wordpos-web</a>
Copyright (c) 2012-2020 [email protected]
(The MIT License)
</div>
</body>
</html>