From 80ba98e696f300e453a01719e8a7339b5f366c8c Mon Sep 17 00:00:00 2001 From: shaoying Date: Sat, 17 Dec 2022 09:11:51 +0800 Subject: [PATCH] opt html --- lib/user.js | 2 +- plugin/local/code/inner.js | 2 +- plugin/local/code/inner/syntax.js | 23 ++++++++++++++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/user.js b/lib/user.js index 26dd3ecd..0ff6c2b3 100644 --- a/lib/user.js +++ b/lib/user.js @@ -80,7 +80,7 @@ Volcanos("user", {info: {}, agent: { open: function(event) { meta.content.indexOf(ice.HTTP) == 0 && can.user.open(meta.content), meta.title.indexOf(ice.HTTP) == 0 && can.user.open(meta.title) }, close: function(event) { can.page.Remove(can, action._target), action.timer.stop = true }, timer: can.core.Timer({interval: 100, length: (meta.duration||1000)/100}, function(event, interval, index) { - if (index > 30) { ui.duration.innerHTML = index/10+ice.PT+index%10+"s..." } + if (index > 30) { ui.duration.innerHTML = index/10+"s..." } }, function() { action.close() }), _target: ui._target, ui: ui, }); can.onmotion.story.auto(can, ui._target), meta.resize && can.onmotion.delayResize(can, ui._target, meta.resize) return can._toast && (can._toast.close(), delete(can._toast)), can._toast = action diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index fb5d5abf..94e0a477 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -181,7 +181,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { profile: function(can, msg) { var sup = can.tabview[can.onexport.keys(can)] if (msg.Result().indexOf(" -1) { if (sup._profile_output != can.ui._profile_output) { can.page.Remove(can, sup._profile_output) } can.ui.profile_output = sup._profile_output = can.page.Append(can, can.ui._profile_output.parentNode, [{view: html.OUTPUT, inner: msg.Result()}]).output - var width = can.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/4*3; can.profile_size[can.onexport.keys(can)] = width + var width = can.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2; can.profile_size[can.onexport.keys(can)] = width } else { can.ui.profile_output = sup._profile_output = can.ui._profile_output var width = can.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2 diff --git a/plugin/local/code/inner/syntax.js b/plugin/local/code/inner/syntax.js index 4d450b2c..ce4985b1 100644 --- a/plugin/local/code/inner/syntax.js +++ b/plugin/local/code/inner/syntax.js @@ -558,12 +558,33 @@ Volcanos(chat.ONSYNTAX, { }, html: { split: { - operator: ".[](),{:;}", + operator: "=!&;", }, keyword: { + "DOCTYPE": code.KEYWORD, "html": code.KEYWORD, "head": code.KEYWORD, "body": code.KEYWORD, + + "meta": code.KEYWORD, + "link": code.KEYWORD, + "title": code.KEYWORD, + + "h1": code.KEYWORD, + "h2": code.KEYWORD, + "h3": code.KEYWORD, + "p": code.KEYWORD, + "em": code.KEYWORD, + "strong": code.KEYWORD, + "i": code.KEYWORD, + "b": code.KEYWORD, + "u": code.KEYWORD, + "a": code.KEYWORD, + "ul": code.KEYWORD, + "ol": code.KEYWORD, + "li": code.KEYWORD, + "href": code.FUNCTION, + "rel": code.FUNCTION, }, }, zml: {