From f945a8043e5e62f4b92f8650fc332278cdfb974b Mon Sep 17 00:00:00 2001 From: enncy <877526278@qq.com> Date: Sat, 11 Jun 2022 17:04:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(core):=20=E4=BF=AE=E6=94=B9=20userjs.temple?= =?UTF-8?q?te=20=E6=A8=A1=E6=9D=BF=E6=96=87=E4=BB=B6=EF=BC=8C=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E8=B7=A8=E5=9F=9F=E5=93=8D=E5=BA=94=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=BF=AE=E6=94=B9=20homepage=20=E7=AD=89=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/build-core.js | 3 ++- userjs.template | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/build-core.js b/scripts/build-core.js index d05cdded..a1a61441 100644 --- a/scripts/build-core.js +++ b/scripts/build-core.js @@ -17,7 +17,8 @@ function createUserJs(cb) { const template = fs.readFileSync('../userjs.template').toString(); const script = fs.readFileSync('../dist/index.js').toString(); const style = fs.readFileSync('../dist/style.css').toString(); - const userjs = template.replace(/{{version}}/g, version).replace(/{{script}}/g, script).replace(/{{style}}/g, style); + const userjs = template.replace(/{{VERSION_SLOT}}/g, version) + .replace(/{{SCRIPT_SLOT}}/g, script).replace(/{{STYLE_SLOT}}/g, style); fs.writeFileSync('../dist/ocs.user.js', userjs); cb(); } diff --git a/userjs.template b/userjs.template index f9efd748..31e0183b 100644 --- a/userjs.template +++ b/userjs.template @@ -1,33 +1,34 @@ // ==UserScript== // @name OCS 网课助手 -// @version {{VERSION}} +// @version {{VERSION_SLOT}} // @description OCS 网课助手,支持各平台网课学习,支持超星学习通,知道智慧树,智慧职教(职教云),等网课的学习,作业,考试功能。 // @author enncy // @license MIT // @namespace https://enncy.cn -// @homepage https://enncy.github.io/online-course-script/ -// @source https://github.com/enncy/online-course-script/ +// @homepage https://docs.ocsjs.com +// @source https://github.com/ocsjs/ocsjs // @icon https://cdn.ocsjs.com/logo.ico // @connect enncy.cn // @connect icodef.com -// @connect ocsjs.com -// @connect localhost +// @connect ocsjs.com +// @connect localhost // @match *://*.chaoxing.com/* // @match *://*.edu.cn/* // @match *://*.org.cn/* // @match *://*.zhihuishu.com/* -// @match *://*.icve.com.cn/* +// @match *://*.icve.com.cn/* // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM_setValue // @grant GM_getValue +// @grant GM_addValueChangeListener +// @grant GM_removeValueChangeListener // @run-at document-start // ==/UserScript== +{{SCRIPT_SLOT}} -{{script}} - -const OCS_STYLE = `{{style}}`; +const OCS_STYLE = `{{STYLE_SLOT}}`; /* eslint no-undef: 0 */