提交 8c98498e 编写于 作者: AndroidLeaves's avatar AndroidLeaves

update

上级 f6d5aa8c
......@@ -11,6 +11,8 @@
const VERSION = 20230129
// 组件配置文件名
const settingConfigName = 'settings.json';
// 仓库根目录
const remoteRoot = 'https://gitcode.net/enoyee/scriptable/-/raw/master';
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
......@@ -1936,7 +1938,7 @@ class BaseWidget {
settingItems = [],
onItemClick,
onCheckedChange,
authorAvatar = 'https://gitcode.net/enoyee/scriptable/-/raw/master/img/ic_avatar_lsp.jpg',
authorAvatar = `${remoteRoot}/img/ic_avatar_lsp.jpg`,
authorName = '杂货万事屋',
authorDesc = '点击查看/添加Scriptable小组件订阅',
homePage = 'https://gitcode.net/enoyee/scriptable/-/tree/master',
......@@ -1955,8 +1957,8 @@ class BaseWidget {
nightBackgroundImage = nightBackgroundImageUrl ? await this.getImageByUrl(nightBackgroundImageUrl, 'pointOnLineNight') : null;
}
}
const showDayImg = dayBackgroundImage ? `data:image/png;base64,${Data.fromPNG(dayBackgroundImage).toBase64String()}` : 'https://gitcode.net/enoyee/scriptable/-/raw/master/img/bg_placeholder.png';
const showNightImg = nightBackgroundImage ? `data:image/png;base64,${Data.fromPNG(nightBackgroundImage).toBase64String()}` : 'https://gitcode.net/enoyee/scriptable/-/raw/master/img/bg_placeholder.png';
const showDayImg = dayBackgroundImage ? `data:image/png;base64,${Data.fromPNG(dayBackgroundImage).toBase64String()}` : `${remoteRoot}/img/bg_placeholder.png`;
const showNightImg = nightBackgroundImage ? `data:image/png;base64,${Data.fromPNG(nightBackgroundImage).toBase64String()}` : `${remoteRoot}/img/bg_placeholder.png`;
let bgType = widgetSetting.bgType ?? widgetProvider.defaultBgType ?? this.defaultConfig.bgType;
// ================== 配置界面样式 ===================
const style = `
......@@ -2774,7 +2776,7 @@ class BaseWidget {
case 'widgetUpdate':
await this.downloadUpdate(
this.scriptName,
`https://gitcode.net/enoyee/scriptable/-/raw/master/${encodeURIComponent(this.scriptName)}.js`
`${remoteRoot}/${encodeURIComponent(this.scriptName)}.js`
);
this.dismissLoading(previewWebView);
break
......@@ -3015,7 +3017,7 @@ class BaseWidget {
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
fetchEnv = async () => {
const dependencyURL = "https://gitcode.net/enoyee/scriptable/-/raw/master/_LSP.js";
const dependencyURL = `${remoteRoot}/_LSP.js`;
const { fm, rootDir } = this.useFileManager({ useICloud: false });
// 下载
console.log('🤖 开始更新依赖~');
......@@ -3166,7 +3168,7 @@ class BaseWidget {
// 默认订阅列表
const defaultSubscribeList = [{
author: 'LSP-杂货万事屋',
scriptURL: 'https://gitcode.net/enoyee/scriptable/-/raw/master/install/package.json'
scriptURL: `${remoteRoot}/install/package.json`
}]
const subscribeList = JSON.parse(this.keyGet(cacheKey, JSON.stringify(defaultSubscribeList)));
// 弹窗
......@@ -3189,7 +3191,7 @@ class BaseWidget {
await this.generateInputAlert({
title: '订阅地址',
options: [
{ hint: '🔗 请输入订阅地址', value: 'https://gitcode.net/enoyee/scriptable/-/raw/master/install/package.json' },
{ hint: '🔗 请输入订阅地址', value: `${remoteRoot}/install/package.json` },
]
}, async (inputArr) => {
const scriptURL = inputArr[0].value;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册