Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #37

Merged
merged 11 commits into from
Oct 1, 2022
Merged

Dev #37

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"info": {
"name": "WAIO",
"version": "1.7.0",
"version": "1.7.1",
"author": "ipuppet",
"module": false
},
Expand Down
17 changes: 1 addition & 16 deletions scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,6 @@ class AppKernel extends Kernel {
* 注入设置中的脚本类型方法
*/
initSettingMethods() {
this.setting.method.readme = animate => {
const content = $file.read("/README.md").string
const sheet = new Sheet()
sheet
.setView({
type: "markdown",
props: { content: content },
layout: (make, view) => {
make.size.equalTo(view.super)
}
})
.init()
.present()
}

this.setting.method.tips = animate => {
$ui.alert("每个小组件中都有README文件,点击可以得到一些信息。")
}
Expand Down Expand Up @@ -404,7 +389,7 @@ class Widget {

module.exports = {
run: () => {
//Widget.render("MyDays"); return
//Widget.render("Calendar"); return
if ($app.env === $env.widget) {
Widget.render()
} else if ($app.env === $env.app) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/libs/easy-jsbox.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions scripts/widget/Calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,13 +688,14 @@ class Calendar {
// 计算周数
const dateInstance = new Date()
const saturday = dateInstance.getDate() + (6 - dateInstance.getDay())
const week = Math.ceil(saturday / 7)
const week = Math.ceil(saturday / 7) // start from 1
const length = this.calendar.calendar.length
const weekStart = week + 2 > length ? length - 2 : week
const weekLength = Math.min(weekStart + 2, length) // 最多显示 3 周

// 生成视图
const days = this.weekIndexTemplate().views
for (let i = weekStart - 1; i < length; i++) {
for (let i = weekStart - 1; i < weekLength; i++) {
// 设置不同日期显示不同样式
for (let dayInfo of this.calendar.calendar[i]) {
const props = this.singleContentDayStyleModifier(dayInfo)
Expand Down