<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta charset="utf-8" /> <title>TinyMCE demo</title> <!-- 可选 --> <link rel="stylesheet" href="https://ss.netnr.com/bootstrap@5.3.3/dist/css/bootstrap.min.css" /> <script src="https://ss.netnr.com/tinymce@5.10.9/tinymce.min.js"></script> <!-- tinymce-zh_CN.js --> <script src="https://ss.netnr.com/2021/04/23/0634569394.js"></script> <!-- prismjs.css --> <link rel="stylesheet" href="https://ss.netnr.com/2021/04/23/0631127918.css"> <!-- prismjs.js --> <script src="https://ss.netnr.com/2021/04/23/0631139544.js"></script> </head> <body> <div class="container-fluid"> <div class="row"> <div class="col-10 offset-md-1 my-3"> <textarea id="full-featured-non-premium"> <div class="mce-toc" contenteditable="false" data-mce-selected="1"> <h2 contenteditable="true">内容列表</h2> <ul> <li><a href="#toc_0">安装服务</a></li> <li><a href="#toc_1">安装服务(Linux)</a></li> <li><a href="#toc_2">密钥</a></li> <li><a href="#toc_3">Windows Server(LTSC 版本)</a></li> <li><a href="#toc_4">Windows Server (半年频道版本)</a></li> <li><a href="#toc_5">Windows 11 和 Windows 10 (半年频道版本)</a></li> <li><a href="#toc_6">Windows 10 (LTSC/LTSB 版本)</a></li> <li><a href="#toc_7">激活说明</a></li> </ul> </div> <h3 id="toc_0">安装服务</h3> <ul> <li>ref: <a href="https://github.com/Wind4/vlmcsd/releases">https://github.com/Wind4/vlmcsd/releases</a></li> </ul> <h3 id="toc_1">安装服务(Linux)</h3> <pre><code><span class="hljs-comment"># 一键安装脚本</span> wget --no-check-certificate https://raw.githubusercontent.com/teddysun/across/master/kms.sh && <span class="hljs-built_in">chmod</span> +x kms.sh && ./kms.sh netstat -nxtlp | grep 1688 <span class="hljs-comment"># 查看端口</span> /etc/init.d/kms status <span class="hljs-comment"># 状态</span> /etc/init.d/kms start <span class="hljs-comment"># 启动</span> /etc/init.d/kms stop <span class="hljs-comment"># 停止</span> /etc/init.d/kms restart <span class="hljs-comment"># 重启</span> ./kms.sh uninstall <span class="hljs-comment"># 卸载</span> </code></pre> <p><a href="https://teddysun.com/530.html">https://teddysun.com/530.html</a></p> <h3 id="toc_2">密钥</h3> <p><a href="https://docs.microsoft.com/zh-cn/windows-server/get-started/kmsclientkeys">https://docs.microsoft.com/zh-cn/windows-server/get-started/kmsclientkeys</a></p> <p><a href="https://github.com/MicrosoftDocs/windowsserverdocs/blob/master/WindowsServerDocs/get-started/kms-client-activation-keys.md">kms-client-activation-keys.md</a></p> <h3 id="toc_3">Windows Server(LTSC 版本)</h3> <h4 id="toc-windows-server-2022">Windows Server 2022</h4> <table> <thead> <tr> <th>操作系统版本</th> <th>KMS 客户端安装密钥</th> </tr> </thead> <tbody><tr> <td>Windows Server 2022 Datacenter</td> <td>WX4NM-KYWYW-QJJR4-XV3QB-6VM33</td> </tr> <tr> <td>Windows Server 2022 Standard</td> <td>VDYBN-27WPP-V4HQT-9VMD4-VMK7H</td> </tr> </tbody></table> <h4 id="toc-windows-server-2019">Windows Server 2019</h4> <table> <thead> <tr> <th>操作系统版本</th> <th>KMS 客户端安装密钥</th> </tr> </thead> <tbody><tr> <td>Windows Server 2019 Datacenter</td> <td>WMDGN-G9PQG-XVVXX-R3X43-63DFG</td> </tr> <tr> <td>Windows Server 2019 Standard</td> <td>N69G4-B89J2-4G8F4-WWYCC-J464C</td> </tr> <tr> <td>Windows Server 2019 Essentials</td> <td>WVDHN-86M7X-466P6-VHXV7-YY726</td> </tr> </tbody></table> <h4 id="toc-windows-server-2016">Windows Server 2016</h4> <table> <thead> <tr> <th>操作系统版本</th> <th>KMS 客户端安装密钥</th> </tr> </thead> <tbody><tr> <td>Windows Server 2016 Datacenter</td> <td>CB7KF-BWN84-R7R2Y-793K2-8XDDG</td> </tr> <tr> <td>Windows Server 2016 Standard</td> <td>WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY</td> </tr> <tr> <td>Windows Server 2016 Essentials</td> <td>JCKRF-N37P4-C2D82-9YXRT-4M63B</td> </tr> </tbody></table> <h3 id="toc_4">Windows Server (半年频道版本)</h3> <h4 id="toc-windows-server-版本-20h2、2004、1909、1903-和-1809">Windows Server 版本 20H2、2004、1909、1903 和 1809</h4> <table> <thead> <tr> <th>操作系统版本</th> <th>KMS 客户端安装密钥</th> </tr> </thead> <tbody><tr> <td>Windows Server Datacenter</td> <td>6NMRW-2C8FM-D24W7-TQWMY-CWH2D</td> </tr> <tr> <td>Windows Server Standard</td> <td>N2KJX-J94YW-TQVFB-DG9YT-724CC</td> </tr> </tbody></table> <h3 id="toc_5">Windows 11 和 Windows 10 (半年频道版本)</h3> <table> <thead> <tr> <th>操作系统版本</th> <th>KMS 客户端安装密钥</th> </tr> </thead> <tbody><tr> <td>Windows 10/11 专业版</td> <td>W269N-WFGWX-YVC9B-4J6C9-T83GX</td> </tr> <tr> <td>Windows 10/11 专业版 N</td> <td>MH37W-N47XK-V7XM9-C7227-GCQG9</td> </tr> <tr> <td>Windows 10/11 专业工作站</td> <td>NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J</td> </tr> <tr> <td>Windows 10/11 专业工作站 N</td> <td>9FNHH-K3HBT-3W4TD-6383H-6XYWF</td> </tr> <tr> <td>Windows 10/11 专业教育版</td> <td>6TP4R-GNPTD-KYYHQ-7B7DP-J447Y</td> </tr> <tr> <td>Windows 10/11 专业教育版 N</td> <td>YVWGF-BXNMC-HTQYQ-CPQ99-66QFC</td> </tr> <tr> <td>Windows 10/11 教育版</td> <td>NW6C2-QMPVW-D7KKK-3GKT6-VCFB2</td> </tr> <tr> <td>Windows 10/11 教育版 N</td> <td>2WH4N-8QGBV-H22JP-CT43Q-MDWWJ</td> </tr> <tr> <td>Windows 10/11 企业版</td> <td>NPPR9-FWDCX-D2C8J-H872K-2YT43</td> </tr> <tr> <td>Windows 10/11 企业版 N</td> <td>DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4</td> </tr> <tr> <td>Windows 10/11 企业版 G</td> <td>YYVX9-NTFWV-6MDM3-9PT4T-4M68B</td> </tr> <tr> <td>Windows 10/11 企业版 G N</td> <td>44RPN-FTY23-9VTTB-MP9BX-T84FV</td> </tr> </tbody></table> <h3 id="toc_6">Windows 10 (LTSC/LTSB 版本)</h3> <h4 id="toc-windows-10-ltsc-2019">Windows 10 LTSC 2019</h4> <table> <thead> <tr> <th>操作系统版本</th> <th>KMS 客户端安装密钥</th> </tr> </thead> <tbody><tr> <td>Windows 10 企业版 LTSC 2019</td> <td>M7XTQ-FN8P6-TTKYV-9D4CC-J462D</td> </tr> <tr> <td>Windows 10 企业版 N LTSC 2019</td> <td>92NFX-8DJQP-P6BBQ-THF9C-7CG2H</td> </tr> </tbody></table> <h4 id="toc-windows-10-ltsb-2016">Windows 10 LTSB 2016</h4> <table> <thead> <tr> <th>操作系统版本</th> <th>KMS 客户端安装密钥</th> </tr> </thead> <tbody><tr> <td>Windows 10 企业版 LTSB 2016</td> <td>DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ</td> </tr> <tr> <td>Windows 10 企业版 N LTSB 2016</td> <td>QFFDN-GRT3P-VKWWX-X7T3R-8B639</td> </tr> </tbody></table> <h4 id="toc-windows-10-ltsb-2015">Windows 10 LTSB 2015</h4> <table> <thead> <tr> <th>操作系统版本</th> <th>KMS 客户端安装密钥</th> </tr> </thead> <tbody><tr> <td>Windows 10 企业版 2015 LTSB</td> <td>WNMTR-4C88C-JK8YV-HQ7T2-76DF9</td> </tr> <tr> <td>Windows 10 企业版 2015 LTSB N</td> <td>2F77B-TNFGY-69QQF-B8YKP-D69TJ</td> </tr> </tbody></table> <h3 id="toc_7">激活说明</h3> <ul> <li>KMS 激活有 180 天期限,此期限称为激活有效间隔</li> <li>若要保持激活状态,您的系统必须通过至少每 180 天连接一次 KMS 服务器来续订激活</li> <li>默认情况下,系统每 7 天自动进行一次激活续订尝试</li> <li>在续订客户端激活之后,激活有效间隔重新开始</li> <li>综上所述,只要您不超过 180 天以上无法连接互联网,系统会自行续期保持激活状态</li> </ul> </textarea> </div> <div class="col-10 offset-md-1"> <button class="btn btn-warning btn-block btn-lg nrUpdate">更新富文本内容到页面显示</button> </div> </div> <div class="row my-3"> <div class="col-md-2 offset-md-1"> <div class="vtoc p-3"></div> </div> <div class="col-md-1"> </div> <div class="col-md-7"> <div class="ev p-3"></div> </div> </div> <div> </body> </html>
.ev { border-radius: 6px; border: 3px solid orange; } .ev img { max-width: 100%; } .vtoc { position: sticky; top: 15px; border-radius: 6px; border: 3px solid pink; } .mce-toc ul { padding: 0; margin: 0.3rem; list-style: none; } .mce-toc ul li { font-size: 1.1rem; line-height: 2rem; }
// 初始化 TinyMCE var useDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches; tinymce.init({ selector: 'textarea#full-featured-non-premium', language: 'zh_CN', init_instance_callback: function (editor) { editor.on('ExecCommand', function (event) { if (typeof event.value == "object") { var content = event.value.content; if (content && content.indexOf('<img src="data:image') == 0) { tinyMCE.execCommand('mceInsertContent', false, content); } } }); }, plugins: 'print preview paste importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable help charmap quickbars emoticons', imagetools_cors_hosts: ['picsum.photos'], menubar: 'file edit view insert format tools table help', toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl', codesample_languages: [ { text: 'HTML/XML', value: 'markup' }, { text: 'JavaScript', value: 'javascript' }, { text: 'JSON', value: 'json' }, { text: 'Yaml', value: 'yaml' }, { text: 'CSS', value: 'css' }, { text: 'C', value: 'c' }, { text: 'C++', value: 'cpp' }, { text: 'C#', value: 'csharp' }, { text: 'F#', value: 'fsharp' }, { text: 'Go', value: 'go' }, { text: 'Java', value: 'java' }, { text: 'PHP', value: 'php' }, { text: 'SQL', value: 'sql' }, { text: 'Shell', value: 'bash' }, { text: 'Nginx', value: 'nginx' }, { text: 'Python', value: 'python' }, { text: 'Markdown', value: 'markdown' }, ], toolbar_sticky: true, autosave_ask_before_unload: false, // 禁用 onbeforeunload autosave_interval: '30s', autosave_prefix: '{path}{query}-{id}-', autosave_restore_when_empty: false, autosave_retention: '2m', image_advtab: true, link_list: [ { title: '预置链接1', value: 'http://www.tinymce.com' }, { title: '预置链接2', value: 'http://tinymce.ax-z.cn' } ], image_list: [ { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } ], image_class_list: [ { title: 'None', value: '' }, { title: 'Some class', value: 'class-name' } ], //importcss_append: true, //自定义文件选择器的回调内容 file_picker_callback: function (callback, value, meta) { if (meta.filetype === 'file') { callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); } if (meta.filetype === 'image') { callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); } if (meta.filetype === 'media') { callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); } }, //为内容模板插件提供预置模板 templates: [ { title: '模板1', description: '介绍文字1', content: '模板内容' }, { title: '模板2', description: '介绍文字2', content: '<div class="mceTmpl"><span class="cdate">CDATE</span>,<span class="mdate">MDATE</span>,我的内容</div>' } ], template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]', template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]', height: 890, fontsize_formats: '12px 14px 16px 18px 24px 36px 48px 56px 72px', font_formats: '微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif', image_caption: true, quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable', noneditable_noneditable_class: 'mceNonEditable', toolbar_mode: 'wrap', contextmenu: 'link image imagetools table', skin: useDarkMode ? 'oxide-dark' : 'oxide', content_css: useDarkMode ? 'dark' : 'default', content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }' }); function viewHtml() { document.querySelector('.ev').innerHTML = tinyMCE.activeEditor.getContent(); document.querySelector('.vtoc').innerHTML = ''; Prism.highlightAll(); var toc = document.querySelector('.mce-toc'); var vtocp = document.querySelector('.vtoc').parentNode; var evp = document.querySelector('.ev').parentNode; if (toc) { document.querySelector('.vtoc').appendChild(toc); vtocp.className = "col-md-2 offset-md-1"; evp.className = "col-md-7"; } else { vtocp.className = "d-none"; evp.className = "col-md-10"; } } var cambios = true; setTimeout(function () { viewHtml(); }, 500) document.querySelector(".nrUpdate").onclick = function () { viewHtml() }