From c2ab02d97a38262179cd63a75ff132a0b5b47376 Mon Sep 17 00:00:00 2001 From: Bhsd <55071315+bhsd-harry@users.noreply.github.com> Date: Thu, 1 Feb 2024 11:32:28 +0800 Subject: [PATCH 1/2] Update MediaWiki:Gadget-wikieditor-highlight.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 大更新 --- .../MediaWiki:Gadget-wikieditor-highlight.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gadgets/wikieditor-highlight/MediaWiki:Gadget-wikieditor-highlight.js b/src/gadgets/wikieditor-highlight/MediaWiki:Gadget-wikieditor-highlight.js index fabeb9bb..edfa75af 100644 --- a/src/gadgets/wikieditor-highlight/MediaWiki:Gadget-wikieditor-highlight.js +++ b/src/gadgets/wikieditor-highlight/MediaWiki:Gadget-wikieditor-highlight.js @@ -18,7 +18,7 @@ const script = document.createElement("script"); script.addEventListener("load", resolve); script.type = "module"; - script.src = "https://testingcf.jsdelivr.net/npm/@bhsd/codemirror-mediawiki/mw/dist/base.js"; + script.src = "https://testingcf.jsdelivr.net/npm/@bhsd/codemirror-mediawiki/dist/mw.min.js"; document.head.append(script); }); } From 0026888e1f986d2395ef15efd601fc0eeb47b13c Mon Sep 17 00:00:00 2001 From: Bhsd <55071315+bhsd-harry@users.noreply.github.com> Date: Thu, 1 Feb 2024 11:45:39 +0800 Subject: [PATCH 2/2] Update MediaWiki:Gadget-wikieditor-highlight.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 让用户自行选择加载的插件 --- .../MediaWiki:Gadget-wikieditor-highlight.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/gadgets/wikieditor-highlight/MediaWiki:Gadget-wikieditor-highlight.js b/src/gadgets/wikieditor-highlight/MediaWiki:Gadget-wikieditor-highlight.js index edfa75af..2fb9df25 100644 --- a/src/gadgets/wikieditor-highlight/MediaWiki:Gadget-wikieditor-highlight.js +++ b/src/gadgets/wikieditor-highlight/MediaWiki:Gadget-wikieditor-highlight.js @@ -22,23 +22,7 @@ document.head.append(script); }); } - cm = await window.CodeMirror6.fromTextArea($textarea[0], lang); - cm.prefer([ - "highlightSpecialChars", - "highlightActiveLine", - "bracketMatching", - "closeBrackets", - "allowMultipleSelections", - ]); - const [config] = await Promise.all([ - libCachedCode.getCachedCode("https://testingcf.jsdelivr.net/npm/wikiparser-node/config/moegirl.json"), - cm.defaultLint(true, { include: [2, 10, 828].includes(ns) }), - ]); - try { - window.wikiparse?.setConfig(JSON.parse(config)); - } catch (e) { - console.error(e); - } + window.CodeMirror6.fromTextArea($textarea[0], lang, ns); }; if (!isAdvanced) { init();