Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
enoyee
Scriptable
提交
983aa579
S
Scriptable
项目概览
enoyee
/
Scriptable
通知
9
Star
0
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Scriptable
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
983aa579
编写于
12月 20, 2022
作者:
AndroidLeaves
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
4738e7a3
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
69 addition
and
939 deletion
+69
-939
_LSP.js
_LSP.js
+14
-10
test.js
test.js
+46
-909
今日事项.js
今日事项.js
+3
-14
桌面启动.js
桌面启动.js
+6
-6
未找到文件。
_LSP.js
浏览文件 @
983aa579
...
...
@@ -8,7 +8,7 @@
*/
// 当前环境版本号
const
VERSION
=
202212
15
const
VERSION
=
202212
20
// 组件配置文件名
const
settingConfigName
=
'
settings.json
'
;
// 组件默认配置
...
...
@@ -302,17 +302,21 @@ class BaseWidget {
notify
=
async
(
title
,
body
,
url
,
opts
=
{})
=>
{
const
widgetSetting
=
await
this
.
readWidgetSetting
();
if
(
widgetSetting
.
notify
)
{
let
n
=
new
Notification
();
n
=
Object
.
assign
(
n
,
opts
);
n
.
title
=
title
;
n
.
body
=
body
;
if
(
url
)
n
.
openURL
=
url
;
return
await
n
.
schedule
();
return
await
this
.
realNotify
(
title
,
body
,
url
,
opts
);
}
else
{
return
null
;
}
}
realNotify
=
async
(
title
,
body
,
url
,
opts
=
{})
=>
{
let
n
=
new
Notification
();
n
=
Object
.
assign
(
n
,
opts
);
n
.
title
=
title
;
n
.
body
=
body
;
if
(
url
)
n
.
openURL
=
url
;
return
await
n
.
schedule
();
}
scaleFontSize
=
(
defaultFontSize
,
textLength
,
startLength
)
=>
{
let
fontSize
=
defaultFontSize
;
if
(
textLength
>=
startLength
)
{
...
...
@@ -2894,7 +2898,7 @@ class BaseWidget {
// -----------------------------------
itemRow
.
dismissOnSelect
=
false
;
itemRow
.
onSelect
=
async
()
=>
{
await
this
.
n
otify
(
"
下载提示
"
,
`开始下载小组件『
${
item
.
title
}
』`
);
await
this
.
realN
otify
(
"
下载提示
"
,
`开始下载小组件『
${
item
.
title
}
』`
);
if
(
item
.
depend
)
{
try
{
for
(
let
index
=
0
;
index
<
item
.
depend
.
length
;
index
++
)
{
...
...
@@ -2904,7 +2908,7 @@ class BaseWidget {
url
:
relyItem
.
scriptURL
,
});
if
(
_isWrite
)
{
await
this
.
notify
(
"
下载提示
"
,
`依赖插件:『
${
relyItem
.
name
}
』下载/更新成功
`
);
await
this
.
realNotify
(
"
下载提示
"
,
`依赖插件:『
${
relyItem
.
name
}
』下载/更新成功`
,
`scriptable:///run/
${
encodeURIComponent
(
relyItem
.
name
)}
`
);
}
}
}
catch
(
e
)
{
...
...
@@ -2918,7 +2922,7 @@ class BaseWidget {
url
:
item
.
scriptURL
,
});
if
(
isWrite
)
{
await
this
.
notify
(
"
下载提示
"
,
`小组件:『
${
item
.
title
}
』 下载/更新成功
`
);
await
this
.
realNotify
(
"
下载提示
"
,
`小组件:『
${
item
.
title
}
』 下载/更新成功`
,
`scriptable:///run/
${
encodeURIComponent
(
relyItem
.
name
)}
`
);
}
};
// -----------------------------------
...
...
test.js
浏览文件 @
983aa579
此差异已折叠。
点击以展开。
今日事项.js
浏览文件 @
983aa579
...
...
@@ -47,7 +47,7 @@ class Widget extends BaseWidget {
widgetProvider
:
{
small
:
false
,
// 是否提供小号组件
medium
:
true
,
// 是否提供中号组件
large
:
tru
e
,
// 是否提供大号组件
large
:
fals
e
,
// 是否提供大号组件
},
// 预览界面的组件设置item
settingItems
:
[
...
...
@@ -78,10 +78,6 @@ class Widget extends BaseWidget {
case
'
medium
'
:
widget
=
await
this
.
provideMediumWidget
(
widgetSetting
);
break
;
case
'
large
'
:
widget
=
await
this
.
provideLargeWidget
(
widgetSetting
);
break
;
}
widget
.
setPadding
(
6
,
12
,
6
,
12
);
return
widget
;
...
...
@@ -178,9 +174,9 @@ class Widget extends BaseWidget {
rdStack
.
size
=
new
Size
(
rightStackWidth
-
20
,
perHeight
);
rdStack
.
setPadding
(
0
,
8
,
0
,
8
);
rdStack
.
centerAlignContent
();
let
alpha
=
0.0
5
;
let
alpha
=
0.0
6
;
if
(
rd
.
isOverdue
)
{
alpha
=
0.
2
;
alpha
=
0.
3
;
}
rdStack
.
backgroundColor
=
new
Color
(
`
${
rd
.
color
}
`
,
alpha
);
rdStack
.
cornerRadius
=
4
;
...
...
@@ -199,13 +195,6 @@ class Widget extends BaseWidget {
return
widget
;
}
/**
* 大型组件
* @returns
*/
async
provideLargeWidget
()
{
}
// --------------------------NET START--------------------------
async
loadReminderList
()
{
const
calendar
=
await
Calendar
.
forReminders
();
...
...
桌面启动.js
浏览文件 @
983aa579
...
...
@@ -56,9 +56,9 @@ class Widget extends BaseWidget {
scheme
:
'
alipay://platformapi/startapp?appId=200011235
'
},
{
icon
:
'
https://gitee.com/enjoyee/img/raw/master/other/ali_scan.png
'
,
name
:
'
粤康码
'
,
scheme
:
'
weixin://dl/business/?t=QDZVQEO2z9f
'
icon
:
'
globe.asia.australia
'
,
name
:
'
蚂蚁森林
'
,
scheme
:
'
alipay://platformapi/startapp?appId=60000002
'
},
],
enFontUrl
:
"
https://gitcode.net/enoyee/scriptable/-/raw/master/font/Facon.ttf
"
,
...
...
@@ -389,7 +389,7 @@ class Widget extends BaseWidget {
const
quickStackBg
=
new
Color
(
'
333
'
,
0.2
);
const
quickPadding
=
10
;
const
quickTextColor
=
new
Color
(
this
.
quickFontColor
(),
0.9
);
const
quickFont
=
Font
.
semiboldSystemFont
(
Number
(
this
.
quickFontSize
())
);
const
quickFont
=
(
textLength
=
3
)
=>
Font
.
semiboldSystemFont
(
textLength
<
3
?
Number
(
this
.
quickFontSize
())
:
Number
(
this
.
quickFontSize
())
-
1
);
const
imageOpacity
=
0.8
;
//---------------------------------
let
leftStack
=
stack
.
addStack
();
...
...
@@ -420,7 +420,7 @@ class Widget extends BaseWidget {
//
let
image
;
let
imgUrl
=
item
.
icon
;
if
(
(
imgUrl
)
.
startsWith
(
'
http
'
))
{
if
(
imgUrl
.
startsWith
(
'
http
'
))
{
image
=
await
this
.
getImageByUrl
(
imgUrl
);
}
else
{
image
=
this
.
getSFSymbol
(
imgUrl
);
...
...
@@ -441,7 +441,7 @@ class Widget extends BaseWidget {
let
textWidget
=
hStack
.
addText
(
item
.
name
);
hStack
.
addSpacer
();
textWidget
.
textColor
=
quickTextColor
;
textWidget
.
font
=
quickFont
;
textWidget
.
font
=
quickFont
(
item
.
name
.
length
)
;
}
//////////////////////////////////////////////////
leftStack
.
addSpacer
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录