Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jun 16, 2020
1 parent d8ed172 commit 4bbe333
Show file tree
Hide file tree
Showing 31 changed files with 331 additions and 187 deletions.
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-cache.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ <h2>Vditor</h2>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
let vditor
const setCache = (options) => {
vditor = new Vditor('vditor', Object.assign({
Expand All @@ -125,5 +125,6 @@ <h2>Vditor</h2>
}
setCache({})
</script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-counter.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const setCounter = (options) => {
document.getElementById('vditor').innerHTML = ''
new Vditor('vditor', Object.assign({
Expand All @@ -94,5 +94,6 @@ <h1>Vditor</h1>
}
setCounter()
</script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-hint.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const emojiTail = '<a href="https://hacpai.com/settings/function" target="_blank">设置常用表情</a>'
const setHint = (options) => {
document.getElementById('vditor').innerHTML = ''
Expand Down Expand Up @@ -141,5 +141,6 @@ <h1>Vditor</h1>
)
}
</script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-hljs.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const setHljs = (options) => {
document.getElementById('vditor').innerHTML = ''
new Vditor('vditor', Object.assign({
Expand Down Expand Up @@ -165,6 +166,6 @@ <h1>Vditor</h1>
})
}
</script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-keymap.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const setKeymap = (options) => {
document.getElementById('vditor').innerHTML = ''
new Vditor('vditor', Object.assign({
Expand All @@ -94,5 +94,6 @@ <h1>Vditor</h1>
}
setKeymap()
</script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-markdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
document.querySelectorAll('.actions .btn').forEach(btn => {
btn.addEventListener('click', function () {
document.getElementById('vditor').innerHTML = ''
Expand Down Expand Up @@ -196,5 +196,6 @@ <h1>Vditor</h1>

setConfig()
</script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-math.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const setMath = (options) => {
document.getElementById('vditor').innerHTML = ''
new Vditor('vditor', Object.assign({
Expand Down Expand Up @@ -126,6 +127,6 @@ <h1>Vditor</h1>
}
setMath()
</script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const setPreview = (options) => {
document.getElementById('vditor').innerHTML = ''
new Vditor('vditor', Object.assign({
Expand All @@ -107,5 +107,6 @@ <h1>Vditor</h1>
}
setPreview()
</script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-resize.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const setResize = (options) => {
document.getElementById('vditor').innerHTML = ''
new Vditor('vditor', Object.assign({
Expand All @@ -94,5 +94,6 @@ <h1>Vditor</h1>
}
setResize()
</script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/advanced-toolbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const boldIcon = '<svg t="1589994502940" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1961" width="32" height="32"><path d="M0 0h1024v1024H0z" fill="#FFFFFF" p-id="1962"></path><path d="M384 256V224h-32v32h32z m0 160h-32v32h32v-32z m0 192v-32h-32v32h32z m0 160h-32v32h32v-32z m321.92-265.504l-18.56-26.048a32 32 0 0 0 4.576 54.816l13.984-28.8zM384 288h176V224H384v64z m176 96H384v64h176v-64zM416 416V256h-64v160h64z m192-80a48 48 0 0 1-48 48v64a112 112 0 0 0 112-112h-64zM560 288a48 48 0 0 1 48 48h64A112 112 0 0 0 560 224v64zM384 640h176v-64H384v64z m176 96H384v64h176v-64zM416 768v-160h-64v160h64z m192-80a48 48 0 0 1-48 48v64a112 112 0 0 0 112-112h-64zM560 640a48 48 0 0 1 48 48h64a112 112 0 0 0-112-112v64zM576 64H256v64h320V64zM192 128v768h64V128H192z m64 832h352v-64H256v64z m-64-64a64 64 0 0 0 64 64v-64H192zM256 64a64 64 0 0 0-64 64h64V64z m512 256a191.712 191.712 0 0 1-80.64 156.448l37.152 52.096A255.712 255.712 0 0 0 832 320h-64z m-192-192a192 192 0 0 1 192 192h64a256 256 0 0 0-256-256v64z m224 576a192 192 0 0 1-192 192v64a256 256 0 0 0 256-256h-64z m-108.064-172.736A192 192 0 0 1 800 704h64a256 256 0 0 0-144.064-230.304l-28 57.568z" fill="#000000" p-id="1963"></path></svg>'
const sponsorIcon = '<svg t="1589994565028" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2808" width="32" height="32"><path d="M506.6 423.6m-29.8 0a29.8 29.8 0 1 0 59.6 0 29.8 29.8 0 1 0-59.6 0Z" fill="#0F0F0F" p-id="2809"></path><path d="M717.8 114.5c-83.5 0-158.4 65.4-211.2 122-52.7-56.6-127.7-122-211.2-122-159.5 0-273.9 129.3-273.9 288.9C21.5 562.9 429.3 913 506.6 913s485.1-350.1 485.1-509.7c0.1-159.5-114.4-288.8-273.9-288.8z" fill="#FAFCFB" p-id="2810"></path><path d="M506.6 926c-22 0-61-20.1-116-59.6-51.5-37-109.9-86.4-164.6-139-65.4-63-217.5-220.6-217.5-324 0-81.4 28.6-157.1 80.6-213.1 53.2-57.2 126.4-88.8 206.3-88.8 40 0 81.8 14.1 124.2 41.9 28.1 18.4 56.6 42.8 86.9 74.2 30.3-31.5 58.9-55.8 86.9-74.2 42.5-27.8 84.3-41.9 124.2-41.9 79.9 0 153.2 31.5 206.3 88.8 52 56 80.6 131.7 80.6 213.1 0 103.4-152.1 261-217.5 324-54.6 52.6-113.1 102-164.6 139-54.8 39.5-93.8 59.6-115.8 59.6zM295.4 127.5c-72.6 0-139.1 28.6-187.3 80.4-47.5 51.2-73.7 120.6-73.7 195.4 0 64.8 78.3 178.9 209.6 305.3 53.8 51.8 111.2 100.3 161.7 136.6 56.1 40.4 88.9 54.8 100.9 54.8s44.7-14.4 100.9-54.8c50.5-36.3 108-84.9 161.7-136.6 131.2-126.4 209.6-240.5 209.6-305.3 0-74.9-26.2-144.2-73.7-195.4-48.2-51.9-114.7-80.4-187.3-80.4-61.8 0-127.8 38.5-201.7 117.9-2.5 2.6-5.9 4.1-9.5 4.1s-7.1-1.5-9.5-4.1C423.2 166 357.2 127.5 295.4 127.5z" fill="#141414" p-id="2811"></path><path d="M353.9 415.6m-33.8 0a33.8 33.8 0 1 0 67.6 0 33.8 33.8 0 1 0-67.6 0Z" fill="#0F0F0F" p-id="2812"></path><path d="M659.3 415.6m-33.8 0a33.8 33.8 0 1 0 67.6 0 33.8 33.8 0 1 0-67.6 0Z" fill="#0F0F0F" p-id="2813"></path><path d="M411.6 538.5c0 52.3 42.8 95 95 95 52.3 0 95-42.8 95-95v-31.7h-190v31.7z" fill="#5B5143" p-id="2814"></path><path d="M506.6 646.5c-59.6 0-108-48.5-108-108v-31.7c0-7.2 5.8-13 13-13h190.1c7.2 0 13 5.8 13 13v31.7c0 59.5-48.5 108-108.1 108z m-82-126.7v18.7c0 45.2 36.8 82 82 82s82-36.8 82-82v-18.7h-164z" fill="#141414" p-id="2815"></path><path d="M450.4 578.9a54.7 27.5 0 1 0 109.4 0 54.7 27.5 0 1 0-109.4 0Z" fill="#EA64F9" p-id="2816"></path><path d="M256 502.7a32.1 27.5 0 1 0 64.2 0 32.1 27.5 0 1 0-64.2 0Z" fill="#EFAFF9" p-id="2817"></path><path d="M703.3 502.7a32.1 27.5 0 1 0 64.2 0 32.1 27.5 0 1 0-64.2 0Z" fill="#EFAFF9" p-id="2818"></path></svg>'
const setToolbar = (options) => {
Expand All @@ -107,5 +107,6 @@ <h1>Vditor</h1>
}
setToolbar()
</script>
<script src="../vditor.js"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions src/vditor/demo/advanced-upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ <h2 class="fn-left">参与讨论</h2>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const vditor = new Vditor('vditor', {
cache: {
enable: false,
Expand Down Expand Up @@ -134,5 +133,6 @@ <h2 class="fn-left">参与讨论</h2>

vcomment.render()
</script>
<script src="../vditor.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion src/vditor/demo/angular/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ <h2 class="fn-left">参与讨论</h2>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js"></script>
<script src="//vditor.b3log.org/vditor.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion src/vditor/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ <h2 class="fn-left">参与讨论</h2>
</div>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js"></script>
<script src="//vditor.b3log.org/vditor.js"></script>
</body>
</html>
6 changes: 0 additions & 6 deletions src/vditor/demo/markdown/preview-config.md

This file was deleted.

5 changes: 3 additions & 2 deletions src/vditor/demo/method-CRUD.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const vditor = new Vditor('vditor', {
mode: 'sv',
cache: {
Expand All @@ -96,5 +96,6 @@ <h1>Vditor</h1>
value: '所见即所得模式对不熟悉 Markdown 的用户较为友好,熟悉 Markdown 的话也可以无缝使用。'
})
</script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/method-get.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,13 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const vditor = new Vditor('vditor', {
typewriterMode: true,
value: '下一代的 Markdown 编辑器,为未来而构建',
})
</script>
<script src="../vditor.js"></script>
</body>
</html>
5 changes: 3 additions & 2 deletions src/vditor/demo/method-other.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const vditor = new Vditor('vditor', {
typewriterMode: true,
height: 500,
})
</script>
<script src="../vditor.js"></script>
</body>
</html>
6 changes: 3 additions & 3 deletions src/vditor/demo/method-theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>

<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const vditor = new Vditor('vditor', {
height: 500,
cache: {
Expand All @@ -162,5 +161,6 @@ <h1>Vditor</h1>
}
})
</script>
<script src="../vditor.js"></script>
</body>
</html>
17 changes: 14 additions & 3 deletions src/vditor/demo/option-callback.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,18 @@ <h1>Vditor</h1>
<div id="log" class="ft-fade"></div>
</div>
<div id="vditor"></div>
<div id="vditorDemoCode" class="vditor-reset">
<pre><code class="javascript"></code></pre>
</div>
<div class="fn-100"></div>
<div class="fn-clear">
<h2 class="fn-left">参与讨论</h2>
<span class="fn-right" style="line-height: 36px" id="commentCnt"></span>
</div>
<div class="fn-50"></div>
<div id="vditorComments"></div>
<div class="fn-100"></div>
</div>
<div class="fn-50"></div>
<!-- end main -->

<div class="footer">
Expand All @@ -88,8 +98,8 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const logElement = document.getElementById('log')
new Vditor('vditor', {
typewriterMode: true,
Expand All @@ -116,5 +126,6 @@ <h1>Vditor</h1>
},
})
</script>
<script src="../vditor.js"></script>
</body>
</html>
38 changes: 28 additions & 10 deletions src/vditor/demo/option-lang.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,26 @@ <h1>Vditor</h1>
options.lang
<div class="fn-50"></div>
<div>
<button class="btn btn--small" onclick="setLang('zh_CN')">中文</button> &nbsp;
<button class="btn btn--small" onclick="setLang('en_US')">英文</button> &nbsp;
<button class="btn btn--small" onclick="setLang('ko_KR')">韩文</button> &nbsp;
<button class="btn btn--small" onclick="setLang(this, 'zh_CN')">中文</button> &nbsp;
<button class="btn btn--small" onclick="setLang(this, 'en_US')">英文</button> &nbsp;
<button class="btn btn--small" onclick="setLang(this, 'ko_KR')">韩文</button> &nbsp;
</div>
<div id="vditor"></div>
<div id="vditorDemoCode" class="vditor-reset">
<pre><code class="javascript">new Vditor('vditor', {
lang: 'zh_CN'
})
</code></pre>
</div>
<div class="fn-100"></div>
<div class="fn-clear">
<h2 class="fn-left">参与讨论</h2>
<span class="fn-right" style="line-height: 36px" id="commentCnt"></span>
</div>
<div class="fn-50"></div>
<div id="vditorComments"></div>
<div class="fn-100"></div>
</div>
<div class="fn-50"></div>
<!-- end main -->

<div class="footer">
Expand All @@ -82,16 +95,21 @@ <h1>Vditor</h1>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vditor@latest/dist/index.min.js"></script>
<script type="text/javascript" src="//vditor.b3log.org/vditor.js" charset="utf-8"></script>
<script>
const setLang = (lang) => {
<script src="https://cdn.jsdelivr.net/npm/vcmt@1.2.4/dist/index.min.js"></script>
<script id="vditorScript">
const setLang = (it, lang) => {
document.getElementById('vditor').innerHTML = ''
new Vditor('vditor', {
typewriterMode: true,
lang,
lang
})
if (it) {
updateCode(it, `new Vditor('vditor', {
lang: '${lang}'
})`)
}
}
setLang('zh_CN')
setLang(undefined, 'zh_CN')
</script>
<script src="../vditor.js"></script>
</body>
</html>
Loading

0 comments on commit 4bbe333

Please sign in to comment.