Skip to content

Commit d09c29d

Browse files
committed
feat: 修改monaco引用来源(可使用代码导航定位)
1 parent 24bd283 commit d09c29d

File tree

8 files changed

+70
-83
lines changed

8 files changed

+70
-83
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"time": 1746379082847,
3-
"version": "2025.5.5"
2+
"time": 1746412935239,
3+
"version": "2025.5.5.10"
44
}

scripts-vite/GreasyFork优化/dist/GreasyFork优化.meta.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts-vite/GreasyFork优化/dist/GreasyFork优化.min.meta.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts-vite/GreasyFork优化/dist/GreasyFork优化.min.user.js

Lines changed: 45 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts-vite/GreasyFork优化/dist/GreasyFork优化.user.js

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name GreasyFork优化
33
// @name:en-US GreasyFork Optimization
44
// @namespace https://github.com/WhiteSevs/TamperMonkeyScript
5-
// @version 2025.5.5
5+
// @version 2025.5.5.10
66
// @author WhiteSevs
77
// @description 自动登录账号、快捷寻找自己库被其他脚本引用、更新自己的脚本列表、库、优化图片浏览、美化页面、Markdown复制按钮
88
// @description:en-US Automatically log in to the account, quickly find your own library referenced by other scripts, update your own script list, library, optimize image browsing, beautify the page, Markdown copy button
@@ -2741,7 +2741,6 @@
27412741
}
27422742
}
27432743
};
2744-
let isRegisdterMonacoEditorCSS = false;
27452744
const GreasyforkUtils = {
27462745
/**
27472746
* 判断是否是当前已登录账户的主页
@@ -2761,18 +2760,6 @@
27612760
return new Promise((resolve) => {
27622761
const MonacoVersion = "0.52.2";
27632762
const readyEventType = "monaco-editor-ready";
2764-
if (!isRegisdterMonacoEditorCSS) {
2765-
isRegisdterMonacoEditorCSS = true;
2766-
addStyle(
2767-
/*css*/
2768-
`
2769-
@font-face {
2770-
font-family: 'codicon';
2771-
src: url('https://fastly.jsdelivr.net/npm/monaco-editor@${MonacoVersion}/min/vs/base/browser/ui/codicons/codicon/codicon.ttf') format('truetype');
2772-
}
2773-
`
2774-
);
2775-
}
27762763
if (_unsafeWindow.monaco) {
27772764
resolve(_unsafeWindow.monaco);
27782765
return;
@@ -2784,7 +2771,8 @@
27842771
innerHTML: (
27852772
/*js*/
27862773
`
2787-
import * as monaco from "https://fastly.jsdelivr.net/npm/monaco-editor@${MonacoVersion}/+esm";
2774+
// import * as monaco from "https://fastly.jsdelivr.net/npm/monaco-editor@${MonacoVersion}/+esm";
2775+
import { monaco } from "https://fastly.jsdelivr.net/npm/@live-codes/monaco-editor/monaco.js";
27882776
window.monaco = monaco;
27892777
window.dispatchEvent(new CustomEvent("${readyEventType}"));
27902778
`
@@ -5796,7 +5784,8 @@
57965784
formatOnPaste: true,
57975785
overviewRulerBorder: true,
57985786
// 滚动条的边框
5799-
scrollBeyondLastLine: true,
5787+
scrollBeyondLastLine: false,
5788+
// 底部留空白
58005789
theme: "vs-dark",
58015790
// 主题
58025791
fontSize: window.innerWidth > 600 ? 14 : 12,
@@ -6078,7 +6067,8 @@
60786067
formatOnPaste: true,
60796068
overviewRulerBorder: true,
60806069
// 滚动条的边框
6081-
scrollBeyondLastLine: true,
6070+
scrollBeyondLastLine: false,
6071+
// 底部留空白
60826072
theme: "vs-dark",
60836073
// 主题
60846074
fontSize: window.innerWidth > 600 ? 14 : 12,

scripts-vite/GreasyFork优化/src/main/navigator/scripts/code/GreasyforkScriptsCode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export const GreasyforkScriptsCode = {
117117
readOnly: true, //是否只读
118118
formatOnPaste: true,
119119
overviewRulerBorder: true, // 滚动条的边框
120-
scrollBeyondLastLine: true,
120+
scrollBeyondLastLine: false, // 底部留空白
121121
theme: "vs-dark", // 主题
122122
fontSize: window.innerWidth > 600 ? 14 : 12, // 字体
123123
wordWrap: "off", // 换行

scripts-vite/GreasyFork优化/src/main/navigator/scripts/versions/GreasyforkVersions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export const GreasyforkVersions = {
269269
readOnly: true, //是否只读
270270
formatOnPaste: true,
271271
overviewRulerBorder: true, // 滚动条的边框
272-
scrollBeyondLastLine: true,
272+
scrollBeyondLastLine: false, // 底部留空白
273273
theme: "vs-dark", // 主题
274274
fontSize: window.innerWidth > 600 ? 14 : 12, // 字体
275275
wordWrap: "off", // 换行

scripts-vite/GreasyFork优化/src/utils/GreasyforkUtils.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ export const GreasyforkUtils = {
3131
/** 版本号 */
3232
const MonacoVersion = "0.52.2";
3333
const readyEventType = "monaco-editor-ready";
34-
if (!isRegisdterMonacoEditorCSS) {
35-
isRegisdterMonacoEditorCSS = true;
36-
// 字体资源
37-
addStyle(/*css*/ `
38-
@font-face {
39-
font-family: 'codicon';
40-
src: url('https://fastly.jsdelivr.net/npm/monaco-editor@${MonacoVersion}/min/vs/base/browser/ui/codicons/codicon/codicon.ttf') format('truetype');
41-
}
42-
`);
43-
}
34+
// if (!isRegisdterMonacoEditorCSS) {
35+
// isRegisdterMonacoEditorCSS = true;
36+
// // 字体资源
37+
// addStyle(/*css*/ `
38+
// @font-face {
39+
// font-family: 'codicon';
40+
// src: url('https://fastly.jsdelivr.net/npm/monaco-editor@${MonacoVersion}/min/vs/base/browser/ui/codicons/codicon/codicon.ttf') format('truetype');
41+
// }
42+
// `);
43+
// }
4444
// @ts-ignore
4545
if (unsafeWindow.monaco) {
4646
// @ts-ignore
@@ -52,7 +52,8 @@ export const GreasyforkUtils = {
5252
type: "module",
5353
defer: true,
5454
innerHTML: /*js*/ `
55-
import * as monaco from "https://fastly.jsdelivr.net/npm/monaco-editor@${MonacoVersion}/+esm";
55+
// import * as monaco from "https://fastly.jsdelivr.net/npm/monaco-editor@${MonacoVersion}/+esm";
56+
import { monaco } from "https://fastly.jsdelivr.net/npm/@live-codes/monaco-editor/monaco.js";
5657
window.monaco = monaco;
5758
window.dispatchEvent(new CustomEvent("${readyEventType}"));
5859
`,

0 commit comments

Comments
 (0)