Skip to content

Commit

Permalink
fix: Scriptable 小工具在教室為空時會噴錯, feat: 調整課程總表說明文字呈現
Browse files Browse the repository at this point in the history
  • Loading branch information
itshenrywu committed Jan 20, 2025
1 parent 9e8a695 commit c569b18
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pages/my.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ export default {
mounted() {
this.editingCourse = Object.freeze(this.defaultCourse);
this.savedCourses = JSON.parse(localStorage.getItem('savedCourse') || '[]');
this.$axios.get('/scriptable.min.js?v=1').then(res => {
this.$axios.get('/scriptable.min.js?v=2').then(res => {
this.scriptableCodeFile = res.data;
});
try { this.myCourses = JSON.parse(localStorage.myCourses); } catch (e) { }
Expand Down
4 changes: 3 additions & 1 deletion pages/rule/_year/_dept/_id.vue
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,9 @@ export default {
});
let output = '<ol>';
output += _rows.map(row => {
return '<li class="' + row[0] + '" style="margin-left:' + list_styles_margin[row[0]] + 'px;list-style-type:' + row[2] + '">' + row[1] + '</li>';
return '<li class="' + row[0] + '" style="margin-left:' + list_styles_margin[row[0]] + 'px;list-style-type:' + row[2] + '">' +
row[1].replace(/([^\x00-\x7F]+)([A-Za-z0-9]+)/g, '$1 $2').replace(/([A-Za-z0-9]+)([^\x00-\x7F]+)/g, '$1 $2') +
'</li>';
}).join('');
output += '</ul>';
return output;
Expand Down
2 changes: 1 addition & 1 deletion static/scriptable.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function createWidget() {
} else {
let t = w.addText(`${l.st} ~ ${l.et}`);
t.textColor = new Color(color[1]), t.font = Font.systemFont(14);
let d = w.addText(l.c);
let d = w.addText(l.c || '');
d.textColor = new Color(color[1]), d.font = Font.systemFont(14);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion static/scriptable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c569b18

Please sign in to comment.