Skip to content

Commit

Permalink
Merge pull request #40 from Hi-Windom/dev2301
Browse files Browse the repository at this point in the history
1.0.7
  • Loading branch information
Soltus authored Jan 2, 2023
2 parents 3a24e8f + 07db8b2 commit ce05c50
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
20 changes: 10 additions & 10 deletions script/kernel.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ async function winsayKernel(path_way) {
let xiao = await new Promise((resolve, reject) => {
isFileExisted(path_way).then((response) => {
if (response) {
window.funs.loadScript(
window.funs.addURLParam("/appearance/themes/Sofill-/theme.js"),
window.sofill.funs.loadScript(
window.sofill.funs.addURLParam("/appearance/themes/Sofill-/theme.js"),
undefined,
true
);
Expand Down Expand Up @@ -57,28 +57,28 @@ setTimeout(() => {
let ready = winsayKernel(`${config.winsay_ROOT_ABS}theme.js`);
if (ready) {
if (lili) {
window.funs.loadScript(
window.funs.addURLParam("/appearance/themes/Sofill=/script/VS.js"),
window.sofill.funs.loadScript(
window.sofill.funs.addURLParam("/appearance/themes/Sofill=/script/VS.js"),
undefined,
true
);
window.funs.loadScript(
window.funs.addURLParam(
window.sofill.funs.loadScript(
window.sofill.funs.addURLParam(
"/appearance/themes/Sofill=/script/lili_sprite.js"
),
undefined,
true
);
window.funs.loadScript(
window.funs.addURLParam(
window.sofill.funs.loadScript(
window.sofill.funs.addURLParam(
"/appearance/themes/Sofill=/script/module/CPext.js"
),
undefined,
true
);
} else {
window.funs.loadScript(
window.funs.addURLParam("/appearance/themes/Sofill-/theme.js"),
window.sofill.funs.loadScript(
window.sofill.funs.addURLParam("/appearance/themes/Sofill-/theme.js"),
undefined,
true
);
Expand Down
22 changes: 12 additions & 10 deletions theme.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
window.sofill = {};
window.sofill.cp = {};
window.sofill.funs = {};
var fs = null;
var path = null;
var clientMode = (() => {
Expand Down Expand Up @@ -36,30 +39,29 @@ if (isAppMode) {
path = require("path");
console.log("isAppMode");
}
window.theme = {};
window.funs = {};

/**
* 获取操作系统 'windows' 或 'darwin' (MacOS) 或 'android'
*/
window.theme.OS = window.siyuan.config.system.os;
window.sofill.OS = window.siyuan.config.system.os;

window.funs.loadStyle = function (href, id = null) {
window.sofill.funs.loadStyle = function (href, id = null) {
let style = document.createElement("link");
if (id) style.id = id;
style.type = "text/css";
style.rel = "stylesheet";
style.href = href;
document.head.appendChild(style);
};
window.funs.updateStyle = function (id, href) {
window.sofill.funs.updateStyle = function (id, href) {
let style = document.getElementById(id);
if (style) {
style.setAttribute("href", href);
} else {
window.funs.loadStyle(href, id);
window.sofill.funs.loadStyle(href, id);
}
};
window.funs.loadScript = function (
window.sofill.funs.loadScript = function (
src,
type = "module",
async = false,
Expand All @@ -72,7 +74,7 @@ window.funs.loadScript = function (
script.src = src;
document.head.appendChild(script);
};
window.funs.addURLParam = function (
window.sofill.funs.addURLParam = function (
url,
param = {
v: window.siyuan.config.appearance.themeVer,
Expand Down Expand Up @@ -167,8 +169,8 @@ if (SelfProtection && SelfProtection === "true") {
}
}

window.funs.loadScript(
window.funs.addURLParam("/appearance/themes/Sofill=/script/kernel.js"),
window.sofill.funs.loadScript(
window.sofill.funs.addURLParam("/appearance/themes/Sofill=/script/kernel.js"),
undefined,
true
);
2 changes: 1 addition & 1 deletion theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Sofill=",
"author": "Soltus",
"url": "https://github.com/Hi-Windom/lili",
"version": "1.0.6",
"version": "1.0.7",
"modes": [
"light"
]
Expand Down

0 comments on commit ce05c50

Please sign in to comment.