mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt vimer.css
This commit is contained in:
parent
80ba98e696
commit
7a9b171341
105
frame.js
105
frame.js
@ -140,7 +140,11 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
sub._trans = can.base.Copy(sub._trans||{}, can.core.Value(sub, [chat.ONACTION, chat._TRANS]))
|
sub._trans = can.base.Copy(sub._trans||{}, can.core.Value(sub, [chat.ONACTION, chat._TRANS]))
|
||||||
can.core.Item(meta.feature, function(key, cb) { cb.help && sub.user.trans(sub, kit.Dict(key, cb.help)) })
|
can.core.Item(meta.feature, function(key, cb) { cb.help && sub.user.trans(sub, kit.Dict(key, cb.help)) })
|
||||||
meta.inputs && sub.onappend._option(sub, meta, sub._option, meta.msg)
|
meta.inputs && sub.onappend._option(sub, meta, sub._option, meta.msg)
|
||||||
if (meta.msg) { var msg = sub.request(); msg.Copy(can.base.Obj(meta.msg)), sub.onappend._output(sub, msg, meta.display||msg.Option(ice.MSG_DISPLAY)||meta.feature.display) }
|
if (meta.msg) {
|
||||||
|
can.onmotion.delay(can, function() {
|
||||||
|
var msg = sub.request(); msg.Copy(can.base.Obj(meta.msg)), sub.onappend._output(sub, msg, meta.display||msg.Option(ice.MSG_DISPLAY)||meta.feature.display)
|
||||||
|
})
|
||||||
|
}
|
||||||
if (can._root && can._root.name == "popup") { can.onmotion.hidden(can, sub._action) }
|
if (can._root && can._root.name == "popup") { can.onmotion.hidden(can, sub._action) }
|
||||||
|
|
||||||
can.core.Value(sub._legend, chat.ONMOUSEENTER, function(event) {
|
can.core.Value(sub._legend, chat.ONMOUSEENTER, function(event) {
|
||||||
@ -328,6 +332,94 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
} }), can.onfigure[input]._init && can.onfigure[input]._init(can, meta, target, _cb)
|
} }), can.onfigure[input]._init && can.onfigure[input]._init(can, meta, target, _cb)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
layout: function(can, target, type, list) {
|
||||||
|
switch (type||ice.AUTO) {
|
||||||
|
case ice.AUTO: const FLOW = "flow", FLEX = "flex"
|
||||||
|
var ui = {size: {}}; function append(target, type, list) { can.page.ClassList.add(can, target, [html.LAYOUT, type]),
|
||||||
|
can.core.List(list, function(item) {
|
||||||
|
if (can.base.isArray(item)) {
|
||||||
|
append(can.page.Append(can, target, [{}])._target, type==FLOW? FLEX: FLOW, item)
|
||||||
|
} else {
|
||||||
|
ui[item] = can.page.Append(can, target, [item])._target
|
||||||
|
}
|
||||||
|
}); return list
|
||||||
|
}
|
||||||
|
var defer = []; function layout(type, list, width, height) { can.core.List(list, function(item) {
|
||||||
|
if (item == html.CONTENT) {
|
||||||
|
defer.push(function() { can.page.style(can, ui[item], html.HEIGHT, height, html.WIDTH, width) })
|
||||||
|
} else if (can.base.isString(item)) {
|
||||||
|
function calc(item, size, total) {
|
||||||
|
if (!ui.size[item]) {
|
||||||
|
return size
|
||||||
|
} else if (ui.size[item] < 1){
|
||||||
|
return total*ui.size[item]
|
||||||
|
} else {
|
||||||
|
return ui.size[item]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!can.page.isDisplay(ui[item])){
|
||||||
|
|
||||||
|
} else if (type == FLOW) {
|
||||||
|
can.page.style(can, ui[item], html.WIDTH, width)
|
||||||
|
height -= calc(item, ui[item].offsetHeight, height)
|
||||||
|
} else {
|
||||||
|
can.page.style(can, ui[item], html.HEIGHT, height, html.WIDTH, calc(item, ui[item].offsetWidth, width))
|
||||||
|
width -= calc(item, ui[item].offsetWidth, width)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}), can.core.List(list, function(item) { if (!can.base.isString(item)) { layout(type == FLOW? FLEX: FLOW, item, width, height) } }) }
|
||||||
|
list = append(target, FLEX, list||[html.PROJECT, [[html.CONTENT, html.PROFILE], html.DISPLAY]])
|
||||||
|
ui.layout = function(width, height) { defer = [], layout(FLEX, list, width, height), defer.forEach(function(cb) { cb() }) }
|
||||||
|
return ui
|
||||||
|
case "tabs-box":
|
||||||
|
can.page.ClassList.add(can, target, "layout tabs box")
|
||||||
|
can.core.List(list, function(item) {
|
||||||
|
var ui = can.page.Append(can, target, [{view: "tabs", inner: item.name, onclick: function() {
|
||||||
|
can.onmotion.toggle(can, ui.list)
|
||||||
|
}}, {view: "list", list: item.list}])
|
||||||
|
})
|
||||||
|
break
|
||||||
|
case "tabs-top":
|
||||||
|
can.page.ClassList.add(can, target, "layout tabs top")
|
||||||
|
var ui = can.page.Append(can, target, ["tabs", "list"])
|
||||||
|
break
|
||||||
|
case "tabs-left":
|
||||||
|
can.page.ClassList.add(can, target, "layout tabs left")
|
||||||
|
var ui = can.page.Append(can, target, ["tabs", "list"])
|
||||||
|
break
|
||||||
|
case "tabs-right":
|
||||||
|
can.page.ClassList.add(can, target, "layout tabs right")
|
||||||
|
var ui = can.page.Append(can, target, ["list", "tabs"])
|
||||||
|
break
|
||||||
|
case "tabs-bottom":
|
||||||
|
can.page.ClassList.add(can, target, "layout tabs bottom")
|
||||||
|
var ui = can.page.Append(can, target, ["list", "tabs"])
|
||||||
|
break
|
||||||
|
}
|
||||||
|
ui.append = function(item, carte) {
|
||||||
|
var tabs = can.page.Append(can, ui.tabs, [{type: html.DIV, inner: item.name, onclick: function(event) {
|
||||||
|
can.onmotion.select(can, ui.tabs, html.DIV, tabs), can.onmotion.select(can, ui.list, html.DIV, view)
|
||||||
|
}, onmouseenter: function(event) {
|
||||||
|
// can.user.carte(event, can, carte.meta, carte.list, carte)
|
||||||
|
}}])._target
|
||||||
|
var view = can.page.Append(can, ui.list, [{type: html.DIV, list: item.list}])._target
|
||||||
|
if (ui.tabs.childElementCount == 1) { tabs.click() }
|
||||||
|
return {
|
||||||
|
close: function() {
|
||||||
|
if (can.page.ClassList.has(can, tabs, html.SELECT)) {
|
||||||
|
(tabs.nextSibling||tabs.previousSibling).click()
|
||||||
|
}
|
||||||
|
can.page.Remove(can, tabs), can.page.Remove(can, view)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
can.core.List(list, function(item) {
|
||||||
|
var view = ui.append(item, shy({
|
||||||
|
"close": function() { view.close() },
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
return ui
|
||||||
|
},
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._root._target; var height = can.page.height(), width = can.page.width()
|
Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._root._target; var height = can.page.height(), width = can.page.width()
|
||||||
can.page.SelectChild(can, target, can.page.Keys(html.FIELDSET_HEAD, html.FIELDSET_FOOT), function(field) { height -= field.offsetHeight })
|
can.page.SelectChild(can, target, can.page.Keys(html.FIELDSET_HEAD, html.FIELDSET_FOOT), function(field) { height -= field.offsetHeight })
|
||||||
@ -335,7 +427,7 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
|
|||||||
can.page.styleHeight(can, field, height), can.user.isMobile || (width -= field.offsetWidth)
|
can.page.styleHeight(can, field, height), can.user.isMobile || (width -= field.offsetWidth)
|
||||||
can.page.SelectChild(can, field, html.DIV_OUTPUT, function(output) { can.page.styleHeight(can, output, height-html.ACTION_HEIGHT) })
|
can.page.SelectChild(can, field, html.DIV_OUTPUT, function(output) { can.page.styleHeight(can, output, height-html.ACTION_HEIGHT) })
|
||||||
})
|
})
|
||||||
can.user.isMobile || can.page.SelectChild(can, target, html.FIELDSET_MAIN, function(field) {
|
can.page.SelectChild(can, target, html.FIELDSET_MAIN, function(field) {
|
||||||
can.page.style(can, field, html.HEIGHT, height, html.WIDTH, width)
|
can.page.style(can, field, html.HEIGHT, height, html.WIDTH, width)
|
||||||
can.page.SelectChild(can, field, html.DIV_ACTION, function(action) { height -= action.offsetHeight })
|
can.page.SelectChild(can, field, html.DIV_ACTION, function(action) { height -= action.offsetHeight })
|
||||||
can.page.SelectChild(can, field, html.DIV_OUTPUT, function(output) { can.page.styleHeight(can, output, height) })
|
can.page.SelectChild(can, field, html.DIV_OUTPUT, function(output) { can.page.styleHeight(can, output, height) })
|
||||||
@ -467,7 +559,12 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
|||||||
can.page.style(can, target, html.WIDTH, _target.offsetWidth, html.LEFT, (window.innerWidth-_target.offsetWidth)/2)
|
can.page.style(can, target, html.WIDTH, _target.offsetWidth, html.LEFT, (window.innerWidth-_target.offsetWidth)/2)
|
||||||
}) })
|
}) })
|
||||||
},
|
},
|
||||||
delay: function(can, cb, interval) { can.core.Timer(interval||30, cb) },
|
delayLong: function(can, cb, interval, key) { can.onmotion.delay(can, cb, interval||300, key) },
|
||||||
|
delay: function(can, cb, interval, key) { if (!key) { return can.core.Timer(interval||30, cb) }
|
||||||
|
can._delay_list = can._delay_list||shy({}, [])
|
||||||
|
var last = can._delay_list.meta[key]||0, self = can._delay_list.meta[key] = can._delay_list.list.push(cb)
|
||||||
|
can.core.Timer(interval||30, function() { cb(self, last, can._delay_list.meta[key]) })
|
||||||
|
},
|
||||||
clear: function(can, target) { return can.page.Modify(can, target||can._output, ""), target },
|
clear: function(can, target) { return can.page.Modify(can, target||can._output, ""), target },
|
||||||
cache: function(can, next) { var list = can.base.getValid(can.base.Obj(can.core.List(arguments).slice(2)), [can._output])
|
cache: function(can, next) { var list = can.base.getValid(can.base.Obj(can.core.List(arguments).slice(2)), [can._output])
|
||||||
can.core.List(list, function(target) { target && target._cache_key && can.page.Cache(target._cache_key, target, target.scrollTop+1) })
|
can.core.List(list, function(target) { target && target._cache_key && can.page.Cache(target._cache_key, target, target.scrollTop+1) })
|
||||||
@ -600,7 +697,7 @@ Volcanos(chat.ONKEYMAP, {_init: function(can, target) { target = target||documen
|
|||||||
},
|
},
|
||||||
|
|
||||||
selectCtrlN: function(event, can, target, key, cb) { if (!event.ctrlKey || event.key < "0" || event.key > "9") { return }
|
selectCtrlN: function(event, can, target, key, cb) { if (!event.ctrlKey || event.key < "0" || event.key > "9") { return }
|
||||||
return can.page.Select(can, target, key, function(target, index) { if (index+1 == event.key) { return cb(target) } })[0]
|
return can.page.Select(can, target, key, function(target, index) { if (index+1 == event.key) { return cb? cb(target): target.click() } })[0]
|
||||||
},
|
},
|
||||||
selectInputs: function(event, can, cb, target) { if (can.page.ismodkey(event)) { return } if (event.key == lang.ESCAPE) { return target.blur() }
|
selectInputs: function(event, can, cb, target) { if (can.page.ismodkey(event)) { return } if (event.key == lang.ESCAPE) { return target.blur() }
|
||||||
if (event.ctrlKey || event.key == lang.TAB) { if (can.base.isUndefined(target._index)) { target._index = -1, target._value = target.value }
|
if (event.ctrlKey || event.key == lang.TAB) { if (can.base.isUndefined(target._index)) { target._index = -1, target._value = target.value }
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
Volcanos("page", {ClassList: {
|
Volcanos("page", {ClassList: {
|
||||||
has: function(can, obj, key) { var list = obj.className? obj.className.split(ice.SP): []; return list.indexOf(key) > -1 },
|
has: function(can, obj, key) { var list = obj.className? obj.className.split(ice.SP): []; return list.indexOf(key) > -1 },
|
||||||
add: function(can, obj, key) { var list = obj.className? obj.className.split(ice.SP): [], value = can.base.AddUniq(list, key).join(ice.SP).trim()
|
add: function(can, obj, key) { typeof key == lang.OBJECT && (key = key.join(ice.SP))
|
||||||
|
var list = obj.className? obj.className.split(ice.SP): [], value = can.base.AddUniq(list, key).join(ice.SP).trim()
|
||||||
return value != obj.className && (obj.className = value), value
|
return value != obj.className && (obj.className = value), value
|
||||||
},
|
},
|
||||||
del: function(can, obj, key) { var list = obj.className? obj.className.split(ice.SP): []
|
del: function(can, obj, key) { var list = obj.className? obj.className.split(ice.SP): []
|
||||||
@ -23,7 +24,7 @@ Volcanos("page", {ClassList: {
|
|||||||
can.page.Select(can, target, html.IFRAME, function(item) { can.page.SelectAll(can, item.contentWindow.document.body, key, cb, interval, cbs) })
|
can.page.Select(can, target, html.IFRAME, function(item) { can.page.SelectAll(can, item.contentWindow.document.body, key, cb, interval, cbs) })
|
||||||
return can.core.List(target && target.querySelectorAll(key), cb, interval, cbs)
|
return can.core.List(target && target.querySelectorAll(key), cb, interval, cbs)
|
||||||
},
|
},
|
||||||
SelectOne: function(can, target, key, cb) { return can.page.Select(can, target, key, function(target, index) { index == 0 && can.base.isFunc(cb) && cb(target) })[0] },
|
SelectOne: function(can, target, key, cb) { return can.page.Select(can, target, key, function(target, index) { return index == 0 && can.base.isFunc(cb) && cb(target), target })[0] },
|
||||||
Select: function(can, target, key, cb, interval, cbs) { target = target || document.body; if (key == ice.PT) { cb(target); return [] }
|
Select: function(can, target, key, cb, interval, cbs) { target = target || document.body; if (key == ice.PT) { cb(target); return [] }
|
||||||
return can.core.List(target.querySelectorAll(can.page.Keys(key)), cb, interval, cbs)
|
return can.core.List(target.querySelectorAll(can.page.Keys(key)), cb, interval, cbs)
|
||||||
},
|
},
|
||||||
@ -231,5 +232,5 @@ Volcanos("page", {ClassList: {
|
|||||||
height: function() { return window.innerHeight },
|
height: function() { return window.innerHeight },
|
||||||
width: function() { return window.innerWidth },
|
width: function() { return window.innerWidth },
|
||||||
ismodkey: function(event) { return [lang.META, lang.ALT, lang.CONTROL, lang.SHIFT].indexOf(event.key) > -1 },
|
ismodkey: function(event) { return [lang.META, lang.ALT, lang.CONTROL, lang.SHIFT].indexOf(event.key) > -1 },
|
||||||
isDisplay: function(target) { return target.style.display != html.NONE && target.innerHTML != "" },
|
isDisplay: function(target) { return target.style.display != html.NONE },
|
||||||
})
|
})
|
||||||
|
@ -101,7 +101,8 @@ Volcanos("user", {info: {}, agent: {
|
|||||||
cb = cb||function(event, button, meta) { var cb = meta[button]||meta[chat._ENGINE]; can.base.isFunc(cb) && cb(event, can, button) }
|
cb = cb||function(event, button, meta) { var cb = meta[button]||meta[chat._ENGINE]; can.base.isFunc(cb) && cb(event, can, button) }
|
||||||
parent || can.page.Select(can, document.body, "div.carte.float", function(target) { can.onmotion.delay(can, function () { can.page.Remove(can, target) }) })
|
parent || can.page.Select(can, document.body, "div.carte.float", function(target) { can.onmotion.delay(can, function () { can.page.Remove(can, target) }) })
|
||||||
function remove_sub(carte) { carte._sub && can.page.Remove(can, carte._sub._target), delete(carte._sub) }
|
function remove_sub(carte) { carte._sub && can.page.Remove(can, carte._sub._target), delete(carte._sub) }
|
||||||
function click(event, item) { can.base.isFunc(cb) && cb(event, item, meta), can.onkeymap.prevent(event), can.user.isMobile && can.page.Remove(can, ui._target) }
|
function click(event, item) {
|
||||||
|
meta[item]? meta[item](event, can, item): can.base.isFunc(cb) && cb(event, item, meta), can.onkeymap.prevent(event), can.user.isMobile && can.page.Remove(can, ui._target) }
|
||||||
var ui = can.page.Append(can, document.body, [{view: [[chat.CARTE, chat.FLOAT]], list: can.core.List(list, function(item, index) {
|
var ui = can.page.Append(can, document.body, [{view: [[chat.CARTE, chat.FLOAT]], list: can.core.List(list, function(item, index) {
|
||||||
return can.base.isString(item)? item ==""? /* space */ {view: html.SPACE}: /* string */ {view: [html.ITEM, html.DIV, can.user.trans(can, item)], onclick: function(event) { click(event, item) }, onmouseenter: function(event) { remove_sub(carte) } }:
|
return can.base.isString(item)? item ==""? /* space */ {view: html.SPACE}: /* string */ {view: [html.ITEM, html.DIV, can.user.trans(can, item)], onclick: function(event) { click(event, item) }, onmouseenter: function(event) { remove_sub(carte) } }:
|
||||||
can.base.isArray(item)? /* array */ {view: html.ITEM, list: [{text: can.user.trans(can, item[0])+" -> "}], onmouseenter: function(event) {
|
can.base.isArray(item)? /* array */ {view: html.ITEM, list: [{text: can.user.trans(can, item[0])+" -> "}], onmouseenter: function(event) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
body, fieldset, table, tr, th, td { padding:0; border:0; margin:0; }
|
* { box-sizing:border-box; }
|
||||||
|
body, iframe, fieldset, table, tr, th, td { padding:0; border:0; margin:0; }
|
||||||
body { background-color:black; color:cyan; font-size:16px; }
|
body { background-color:black; color:cyan; font-size:16px; }
|
||||||
legend { background-color:cadetblue; color:white; padding:0 20px; margin-right:2px; float:left; }
|
legend { background-color:cadetblue; color:white; padding:0 20px; margin-right:2px; float:left; }
|
||||||
select { background-color:black; color:cyan; padding:0 10px; margin:0 2px; border:0; }
|
select { background-color:black; color:cyan; padding:0 10px; margin:0 2px; border:0; }
|
||||||
@ -24,6 +25,7 @@ input[type=button][name=trash] { background-color:red; }
|
|||||||
input[type=button][name=delete] { background-color:red; }
|
input[type=button][name=delete] { background-color:red; }
|
||||||
input[type=button][name=remove] { background-color:red; }
|
input[type=button][name=remove] { background-color:red; }
|
||||||
|
|
||||||
|
div.layout.flex>div { float:left; }
|
||||||
table.layout { border-spacing:0; }
|
table.layout { border-spacing:0; }
|
||||||
table.layout td { vertical-align:top; }
|
table.layout td { vertical-align:top; }
|
||||||
table.layout td.content div.toggle { background-color:#4682b46b; color:white; font-size:24px; position:absolute; }
|
table.layout td.content div.toggle { background-color:#4682b46b; color:white; font-size:24px; position:absolute; }
|
||||||
@ -32,7 +34,6 @@ table.layout td.content div.toggle.project { padding-top:50px; height:100px; wid
|
|||||||
table.layout td.content div.toggle.profile { padding-top:50px; height:100px; width:15px; top:20%; right:0px; border-top-left-radius:10px; border-bottom-left-radius:10px; }
|
table.layout td.content div.toggle.profile { padding-top:50px; height:100px; width:15px; top:20%; right:0px; border-top-left-radius:10px; border-bottom-left-radius:10px; }
|
||||||
table.layout td.content div.toggle.display { margin-top:-15px; height:15px; width:100px; position:sticky; left:40%; border-top-left-radius:10px; border-top-right-radius:10px; overflow:hidden; }
|
table.layout td.content div.toggle.display { margin-top:-15px; height:15px; width:100px; position:sticky; left:40%; border-top-left-radius:10px; border-top-right-radius:10px; overflow:hidden; }
|
||||||
table.layout td.content div.toggle.display>div { text-align:center; width:100px; transform: rotate(-90deg) translate(5px, 0px); }
|
table.layout td.content div.toggle.display>div { text-align:center; width:100px; transform: rotate(-90deg) translate(5px, 0px); }
|
||||||
// table.content { width:-webkit-fill-available;}
|
|
||||||
table.content thead { position:sticky; top:2px; }
|
table.content thead { position:sticky; top:2px; }
|
||||||
table.content th { background-color:steelblue; padding:2px 6px; }
|
table.content th { background-color:steelblue; padding:2px 6px; }
|
||||||
table.content td { padding:2px 6px; }
|
table.content td { padding:2px 6px; }
|
||||||
@ -57,6 +58,10 @@ fieldset.contexts {
|
|||||||
background:radial-gradient(black, #00000073); color:white;
|
background:radial-gradient(black, #00000073); color:white;
|
||||||
position:fixed; left:20px; top:100px; z-index:10;
|
position:fixed; left:20px; top:100px; z-index:10;
|
||||||
}
|
}
|
||||||
|
fieldset.simple>legend { display:none; }
|
||||||
|
fieldset.simple>form.option { display:none; }
|
||||||
|
fieldset.simple>div.status { display:none; }
|
||||||
|
fieldset.simple div.toggle { display:none; }
|
||||||
fieldset.plugin { background-color:#061c3c9e; padding:10px; margin:10px; }
|
fieldset.plugin { background-color:#061c3c9e; padding:10px; margin:10px; }
|
||||||
fieldset.float { background-color:#0e3369; color:white; padding:0; margin:0; }
|
fieldset.float { background-color:#0e3369; color:white; padding:0; margin:0; }
|
||||||
fieldset.full { background-color:#0e3369; color:white; padding:0; margin:0; left:0; top:0; overflow:auto; }
|
fieldset.full { background-color:#0e3369; color:white; padding:0; margin:0; left:0; top:0; overflow:auto; }
|
||||||
@ -65,6 +70,8 @@ fieldset.float>form.option input[type=button][name=close]{ display:block; }
|
|||||||
fieldset.full>form.option input[type=button][name=close]{ display:block; }
|
fieldset.full>form.option input[type=button][name=close]{ display:block; }
|
||||||
fieldset.plugin>div.status { border-top:1px solid darkcyan; }
|
fieldset.plugin>div.status { border-top:1px solid darkcyan; }
|
||||||
fieldset.story>div.status { border-top:1px solid darkcyan; }
|
fieldset.story>div.status { border-top:1px solid darkcyan; }
|
||||||
|
fieldset.panel>div.status { display:none; }
|
||||||
|
fieldset.cmd>div.output { overflow:hidden; }
|
||||||
|
|
||||||
fieldset.output { padding:0; margin:0; }
|
fieldset.output { padding:0; margin:0; }
|
||||||
fieldset.output>form.option { display:none; }
|
fieldset.output>form.option { display:none; }
|
||||||
@ -123,10 +130,10 @@ body>div.upload input[type=file] { width:320px; }
|
|||||||
textarea { tab-size:2; height:60px; }
|
textarea { tab-size:2; height:60px; }
|
||||||
legend { font-size:1.2rem; height:31px; }
|
legend { font-size:1.2rem; height:31px; }
|
||||||
select, input { font-size:1.0rem; height:31px; }
|
select, input { font-size:1.0rem; height:31px; }
|
||||||
table.content th, table.content td, div.zone>div.name, div.item, code.story, div.story[data-type=spark] { font-size:1.1rem; font-family:monospace; }
|
table.content th, table.content td, div.zone>div.name, div.item, code.story, div.story[data-type=spark] { font-family:monospace; }
|
||||||
div.code { font-family:monospace; }
|
div.code { font-family:monospace; }
|
||||||
div.action>div.tabs { padding:5px 10px; height:21px; }
|
div.action>div.tabs { padding:5px 10px; height:31px; }
|
||||||
div.status>div.item { padding:4px; height:22px; }
|
div.status>div.item { padding:4px; height:30px; }
|
||||||
div.status>div.item>label { font-size:0.6rem; font-family:monospace; }
|
div.status>div.item>label { font-size:0.6rem; font-family:monospace; }
|
||||||
svg { font-family:monospace; }
|
svg { font-family:monospace; }
|
||||||
|
|
||||||
@ -351,3 +358,19 @@ body.black a { color:yellow; }
|
|||||||
body.white fieldset.panel.Search a { color:yellow; }
|
body.white fieldset.panel.Search a { color:yellow; }
|
||||||
body.mobile fieldset.plan>div.action { display:none; }
|
body.mobile fieldset.plan>div.action { display:none; }
|
||||||
body.mobile.simple div.output.card div.item { width:-webkit-fill-available; }
|
body.mobile.simple div.output.card div.item { width:-webkit-fill-available; }
|
||||||
|
|
||||||
|
div.layout.tabs>div.tabs { display:flex; overflow:auto; }
|
||||||
|
div.layout.tabs>div.tabs>div { padding:10px; height:32px; flex:1; }
|
||||||
|
div.layout.tabs>div.tabs>div:hover { background:steelblue; }
|
||||||
|
div.layout.tabs>div.list { width:100%; height:100%; flex:1; }
|
||||||
|
div.layout.tabs>div.list>div { height:100%; display:none; }
|
||||||
|
div.layout.tabs>div.list>div.select { display:block; }
|
||||||
|
div.layout.tabs.left { display:flex; }
|
||||||
|
div.layout.tabs.left>div.tabs { flex-direction:column; }
|
||||||
|
div.layout.tabs.left>div.tabs>div { writing-mode:tb; }
|
||||||
|
div.layout.tabs.right { display:flex; }
|
||||||
|
div.layout.tabs.right>div.tabs { flex-direction:column; }
|
||||||
|
div.layout.tabs.right>div.tabs>div { writing-mode:tb; }
|
||||||
|
div.layout.tabs.box>div.list { height:unset; }
|
||||||
|
div.layout.tabs.box>div.tabs { background-color:steelblue; text-align:center; padding:3px; display:block; }
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
fieldset.Action { background-color:rgba(114, 153, 162, 0.54); min-width:160px; }
|
fieldset.Action { background-color:rgba(114, 153, 162, 0.54); min-width:160px; }
|
||||||
fieldset.Action>div.action { background-color:#4682b46b; width:inherit; display:none; }
|
fieldset.Action>div.action { background-color:#4682b46b; width:inherit; display:none; }
|
||||||
fieldset.Action>div.action div { font-size:1.1rem; padding:5px 20px; height:21px; float:left; cursor:pointer; }
|
fieldset.Action>div.action div { font-size:1.1rem; padding:5px 20px; height:31px; float:left; cursor:pointer; }
|
||||||
fieldset.Action>div.action div.select { background-color:#6495ed63; }
|
fieldset.Action>div.action div.select { background-color:#6495ed63; }
|
||||||
fieldset.Action>div.action div:hover { background-color:#6495ed63; }
|
fieldset.Action>div.action div:hover { background-color:#6495ed63; }
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ div.foot div.menu { cursor:pointer; padding:10px; float:left; }
|
|||||||
div.foot>div.menu:hover { background-color:#323232; }
|
div.foot>div.menu:hover { background-color:#323232; }
|
||||||
|
|
||||||
div.tabs:hover {
|
div.tabs:hover {
|
||||||
background-color:#272727;
|
/* background-color:#272727; */
|
||||||
}
|
}
|
||||||
div.tabs div.name {
|
div.tabs div.name {
|
||||||
height:46px; width:-webkit-fill-available;
|
height:46px; width:-webkit-fill-available;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
fieldset.Footer { font-size:1.1rem; padding:0 5px; clear:both; }
|
fieldset.Footer { font-size:1.1rem; padding:0 5px; clear:both; }
|
||||||
fieldset.Footer>div.output { overflow:hidden; }
|
fieldset.Footer>div.output { overflow:hidden; }
|
||||||
fieldset.Footer>div.output div { padding:5px; height:21px; cursor:pointer; }
|
fieldset.Footer>div.output div { padding:5px; height:31px; cursor:pointer; }
|
||||||
fieldset.Footer>div.output div:hover { background-color:#2e515f; }
|
fieldset.Footer>div.output div:hover { background-color:#2e515f; }
|
||||||
fieldset.Footer>div.output div.title { float:left; }
|
fieldset.Footer>div.output div.title { float:left; }
|
||||||
fieldset.Footer>div.output div.state { font-family:monospace; float:right; }
|
fieldset.Footer>div.output div.state { font-family:monospace; float:right; }
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
fieldset.Header { font-size:1.1rem; padding:0 5px; height:31px; overflow:auto; z-index:10; }
|
fieldset.Header { font-size:1.1rem; padding:0 5px; height:31px; overflow:auto; z-index:10; }
|
||||||
fieldset.Header>div.output { overflow:hidden; }
|
fieldset.Header>div.output { overflow:hidden; }
|
||||||
fieldset.Header>div.output div { padding:5px; height:21px; float:left; cursor:pointer; }
|
fieldset.Header>div.output div { padding:5px; height:31px; float:left; cursor:pointer; }
|
||||||
fieldset.Header>div.output div:hover { background-color:#2e515f; }
|
fieldset.Header>div.output div:hover { background-color:#2e515f; }
|
||||||
fieldset.Header>div.output div.title { float:left; }
|
fieldset.Header>div.output div.title { float:left; }
|
||||||
fieldset.Header>div.output div.state { float:right; }
|
fieldset.Header>div.output div.state { float:right; }
|
||||||
@ -8,5 +8,4 @@ fieldset.Header>div.output div.state.avatar { padding:0; height:31px; }
|
|||||||
fieldset.Header>div.output div.state.avatar>img { height:31px; }
|
fieldset.Header>div.output div.state.avatar>img { height:31px; }
|
||||||
fieldset.Header>div.output div.search { margin-left:20px; float:left; }
|
fieldset.Header>div.output div.search { margin-left:20px; float:left; }
|
||||||
fieldset.Header>div.output div.search>input { margin-top:-5px; border-radius:0; }
|
fieldset.Header>div.output div.search>input { margin-top:-5px; border-radius:0; }
|
||||||
|
fieldset.Header>div.output river { margin-right:100px; }
|
||||||
fieldset.Header>div.output river { margin-right:100px; }
|
|
||||||
|
@ -2,3 +2,4 @@ fieldset.Search { background-color:#041a25bd; padding:10px; position:fixed; left
|
|||||||
fieldset.Search input.word { width:-webkit-fill-available; }
|
fieldset.Search input.word { width:-webkit-fill-available; }
|
||||||
fieldset.Search>div.output table { width:-webkit-fill-available; }
|
fieldset.Search>div.output table { width:-webkit-fill-available; }
|
||||||
fieldset.Search>div.status { border-top:1px solid darkcyan; }
|
fieldset.Search>div.status { border-top:1px solid darkcyan; }
|
||||||
|
fieldset.Search>div.status { display:block; overflow:auto; }
|
||||||
|
@ -19,7 +19,7 @@ Volcanos(chat.ONFIGURE, {key: {
|
|||||||
}) },
|
}) },
|
||||||
onblur: function(event, can, sub) { can.onmotion.delay(can, function() {
|
onblur: function(event, can, sub) { can.onmotion.delay(can, function() {
|
||||||
// sub._delay_hidden || can.onmotion.hidden(can, sub._target), sub._delay_hidden = false
|
// sub._delay_hidden || can.onmotion.hidden(can, sub._target), sub._delay_hidden = false
|
||||||
sub._delay_hidden || sub.close(), sub._delay_hidden = false
|
if (sub) { sub._delay_hidden || sub.close(), sub._delay_hidden = false }
|
||||||
}, 300) },
|
}, 300) },
|
||||||
onkeydown: function(event, can, meta, cb, target, sub, last) {
|
onkeydown: function(event, can, meta, cb, target, sub, last) {
|
||||||
if (event.key == lang.ENTER && meta._enter && (!can.page.tagis(event.target, html.TEXTAREA) || event.ctrlKey) && meta._enter(event)) { return sub.close() }
|
if (event.key == lang.ENTER && meta._enter && (!can.page.tagis(event.target, html.TEXTAREA) || event.ctrlKey) && meta._enter(event)) { return sub.close() }
|
||||||
|
@ -1,107 +1,55 @@
|
|||||||
fieldset.word fieldset.inner>form.option input[name=path] { width:240px; }
|
|
||||||
|
|
||||||
fieldset.inner.cmd>div.output { overflow:hidden; }
|
|
||||||
fieldset.inner>form.option input[name=path] { width:80px; }
|
fieldset.inner>form.option input[name=path] { width:80px; }
|
||||||
fieldset.inner>form.option input[name=file] { width:160px; }
|
fieldset.inner>form.option input[name=file] { width:160px; }
|
||||||
fieldset.inner>div.action>div.tabs { padding:5px; margin:0 1px; }
|
fieldset.inner>div.action>div.tabs { padding:5px; margin:0 1px; }
|
||||||
fieldset.inner>div.action>div.tabs:hover { background-color:steelblue; }
|
fieldset.inner>div.output>div.project { width:230px; }
|
||||||
fieldset.inner>div.action>div.tabs.select { background-color:steelblue; }
|
fieldset.inner>div.output>div.layout.flow { width:min-content; }
|
||||||
|
fieldset.inner>div.output>div.layout.flow>div.tabs { display:none; }
|
||||||
// fieldset.inner>div.output div.project { width:240px; }
|
fieldset.inner>div.output>div.layout.flow>div.path { display:none; }
|
||||||
fieldset.inner>div.output td.content { position:relative; }
|
|
||||||
fieldset.inner>div.output div.content { color:white; font-size:16px; font-family:monospace; position:relative; }
|
fieldset.inner>div.output div.content { color:white; font-size:16px; font-family:monospace; position:relative; }
|
||||||
fieldset.inner>div.output div.content td.line { position:sticky; left:0; text-align:right; padding:0 6px; border-right:solid 2px red; }
|
|
||||||
fieldset.inner>div.output div.content>tr:hover { background-color:#4682b46b; }
|
fieldset.inner>div.output div.content>tr:hover { background-color:#4682b46b; }
|
||||||
fieldset.inner>div.output div.content>tr.select { background-color:#4682b46b; }
|
fieldset.inner>div.output div.content>tr.select { background-color:#4682b46b; }
|
||||||
fieldset.inner>div.output div.content>tr.select td.line { background-color:#6495ed63; border:solid 1px red; border-right:solid 2px red; }
|
fieldset.inner>div.output div.content>tr.select td.line { background-color:#6495ed63; border:solid 1px red; border-right:solid 2px red; }
|
||||||
|
fieldset.inner>div.output div.content td.line { position:sticky; left:0; text-align:right; padding:0 6px; border-right:solid 2px red; }
|
||||||
fieldset.inner>div.output div.content td.text { white-space:pre; padding-left:10px; cursor:text; }
|
fieldset.inner>div.output div.content td.text { white-space:pre; padding-left:10px; cursor:text; }
|
||||||
fieldset.inner>div.output div.content td.text span.comment { background-color:blue; color:cyan; }
|
fieldset.inner>div.output div.content td.text span.comment { background-color:blue; color:cyan; }
|
||||||
fieldset.inner>div.output div.content td.text span.keyword { color:blue; font-weight:bold; }
|
fieldset.inner>div.output div.content td.text span.keyword { color:yellow; font-weight:bold; }
|
||||||
fieldset.inner>div.output div.content td.text span.string { color:magenta; }
|
fieldset.inner>div.output div.content td.text span.package { color:lightgreen; }
|
||||||
|
fieldset.inner>div.output div.content td.text span.datatype { color:cyan; }
|
||||||
|
fieldset.inner>div.output div.content td.text span.function { color:lightgreen; }
|
||||||
fieldset.inner>div.output div.content td.text span.constant { color:magenta; }
|
fieldset.inner>div.output div.content td.text span.constant { color:magenta; }
|
||||||
fieldset.inner>div.output div.content td.text span.datatype { color:green; }
|
fieldset.inner>div.output div.content td.text span.string { color:magenta; }
|
||||||
fieldset.inner>div.output div.content td.text span.function { color:purple; }
|
fieldset.inner>div.output div.content td.text span.object { color:cyan; }
|
||||||
fieldset.inner.float>div.output div.content td.text span.keyword { color:yellow; }
|
fieldset.inner>div.output div.find.float { position:absolute; }
|
||||||
fieldset.inner.float>div.output div.content td.text span.datatype { color:cyan; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs { background-color:#70809096; height:28px; overflow:auto; display:block; }
|
||||||
fieldset.inner.float>div.output div.content td.text span.function { color:lightgreen; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div { background-color:teal; font-family:monospace; padding:5px 10px; float:left; }
|
||||||
body.black fieldset.inner>div.output div.content td.text span.keyword { color:yellow; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div:hover { background-color:#1d3349; }
|
||||||
body.black fieldset.inner>div.output div.content td.text span.datatype { color:cyan; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.select { background-color:#1d3349; }
|
||||||
body.black fieldset.inner>div.output div.content td.text span.function { color:lightgreen; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar { padding:0; height:28px; float:right; }
|
||||||
fieldset.inner>div.output td.content iframe { border:0; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar>img { height:28px; }
|
||||||
fieldset.inner>div.output td.profile iframe { border:0; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.time { float:right; }
|
||||||
fieldset.inner.float>div.status { display:none; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.path { background-color:#1d3349; font-family:monospace; padding:5px 10px; display:block; }
|
||||||
|
fieldset.inner.cmd>div.output>div.layout.flow>div.path span.item { padding:3px 12px; }
|
||||||
fieldset.inner>div.output td.content>div.tabs { display:none; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.path span.item:hover { background-color:cornflowerblue; cursor:pointer; }
|
||||||
fieldset.inner>div.output td.content>div.path { display:none; }
|
body.white fieldset.inner:not(.float):not(.full)>div.output div.content { color:black; }
|
||||||
fieldset.inner>div.output td.content>div.path { font-family:monospace; }
|
body.white fieldset.inner:not(.float):not(.full)>div.output div.content td.text span.keyword { color:blue; }
|
||||||
fieldset.inner>div.output td.content>div.path span.item { padding:3px 12px; }
|
body.white fieldset.inner:not(.float):not(.full)>div.output div.content td.text span.datatype { color:green; }
|
||||||
fieldset.inner>div.output td.content>div.path span.item:hover { background-color:cornflowerblue; }
|
body.white fieldset.inner:not(.float):not(.full)>div.output div.content td.text span.function { color:green; }
|
||||||
fieldset.inner div.output fieldset.toolkit { position:absolute; bottom:0px; right:0px; }
|
body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div:hover { background-color:white; }
|
||||||
fieldset.inner>div.output fieldset.toolkit>div.output>fieldset { display:none; }
|
body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.select { background-color:white; }
|
||||||
fieldset.inner>div.output fieldset.toolkit>div.output>fieldset.select { background-color:#0e3369b3; color:white; display:block; z-index:10; }
|
body.white fieldset.inner.cmd>div.output>div.layout.flow>div.path { background-color:white; }
|
||||||
fieldset.inner>div.output fieldset.toolkit>div.output fieldset { display:none; }
|
body.white fieldset.inner.cmd>div.output div.project { background-color:whitesmoke; }
|
||||||
fieldset.inner>div.output fieldset.toolkit>div.output fieldset.select { background-color:#0e3369b3; color:white; display:block; z-index:10; }
|
body.white fieldset.inner.cmd>div.output div.project.toggle { background-color:#4682b46b; }
|
||||||
fieldset.inner div.output fieldset.toolkit>div.output { position:unset; }
|
body.white fieldset.inner.cmd>div.output div.content { background-color:white; }
|
||||||
|
body.white fieldset.inner.cmd>div.output div.content tr.select { background-color:white; }
|
||||||
fieldset>div.output>fieldset.plug { position:absolute; bottom:0px; right:0px; }
|
body.white fieldset.inner.cmd>div.output div.content tr.select td.line { background-color:steelblue; color:white; border:none; }
|
||||||
fieldset>div.output>fieldset.plug { display:none; }
|
body.white fieldset.inner.cmd>div.output div.content tr.select td.text { border:solid 1px lightgray; }
|
||||||
fieldset>div.output>fieldset.plug.select { background-color:#0e3369b3; color:white; display:block; z-index:10; }
|
body.white fieldset.inner.cmd>div.output div.content td.line { padding-top:4px; border-right:none; }
|
||||||
fieldset>div.status legend { float:right; height:30px; }
|
body.white fieldset.inner.cmd>div.output div.content td.text { padding-top:2px; border:solid 1px transparent; }
|
||||||
fieldset>div.status legend.select { background-color:green; }
|
body.white fieldset.inner.cmd>div.output div.content td.text span.string { color:royalblue; }
|
||||||
fieldset>div.status legend:hover { background-color:green; }
|
|
||||||
fieldset.inner>div.status { height:30px; overflow:auto; }
|
|
||||||
fieldset.panel>div.status { display:none; overflow:auto; }
|
|
||||||
fieldset.Search.panel>div.status { display:block; overflow:auto; }
|
|
||||||
fieldset.inner.simple>legend { display:none; }
|
|
||||||
fieldset.inner.simple>form.option { display:none; }
|
|
||||||
fieldset.inner.simple>div.status { display:none; }
|
|
||||||
fieldset.inner.simple div.toggle { display:none; }
|
|
||||||
|
|
||||||
fieldset.inner.float>div.action { display:none; }
|
|
||||||
|
|
||||||
fieldset.Action>div.status { display:none; }
|
|
||||||
|
|
||||||
body.white fieldset.inner>div.output div.content { color:black; }
|
|
||||||
body.white fieldset.inner.float>div.output div.content { color:white; }
|
|
||||||
body.black fieldset.inner.float>div.output div.content { color:white; }
|
|
||||||
body.white fieldset.inner.full>div.output div.content { color:white; }
|
|
||||||
body.black fieldset.inner.full>div.output div.content { color:white; }
|
|
||||||
|
|
||||||
/* body.white fieldset.inner.float>div.output div.profile { color:black; } */
|
|
||||||
|
|
||||||
// body.simple fieldset.inner>div.output td.content>div.tabs { background-color:slategrey; padding:0px; height:31px; overflow:auto; display:block; }
|
|
||||||
body.simple fieldset.inner>div.output td.content>div.tabs { background-color:#70809096; padding:0px; height:31px; overflow:auto; display:block; }
|
|
||||||
body.simple fieldset.inner>div.output td.content>div.tabs div { background-color:teal; font-family:monospace; padding:7px 20px; height:17px; float:left; }
|
|
||||||
body.simple fieldset.inner>div.output td.content>div.tabs div.select { background-color:#1d3349; }
|
|
||||||
body.simple fieldset.inner>div.output td.content>div.tabs div:hover { background-color:#1d3349; }
|
|
||||||
body.simple fieldset.inner>div.output td.content>div.path { background-color:#1d3349; padding:4px 10px; margin-bottom:4px; display:block; clear:both; }
|
|
||||||
body.simple fieldset.inner>div.output div.content td.line { padding-top:4px; border-right:none; }
|
|
||||||
body.simple fieldset.inner>div.output div.content td.text { padding-top:2px; border:solid 1px transparent; }
|
|
||||||
|
|
||||||
body.white.simple fieldset.inner>div.output div.project { background-color:whitesmoke; }
|
|
||||||
body.white.simple fieldset.inner>div.output div.project.toggle { background-color:#4682b46b; }
|
|
||||||
body.white.simple fieldset.inner>div.output div.project div.item { color:black; }
|
|
||||||
body.white.simple fieldset.inner>div.output td.content>div.tabs { background-color:whitesmoke; }
|
|
||||||
body.white.simple fieldset.inner>div.output td.content>div.tabs div.tabs { background-color:lightgray; color:black; }
|
|
||||||
body.white.simple fieldset.inner>div.output td.content>div.tabs div.tabs.select { background-color: white; box-shadow:0px 0px 5px 1px grey; }
|
|
||||||
body.white.simple fieldset.inner>div.output td.content>div.path { background-color:white; color:black; }
|
|
||||||
body.white.simple fieldset.inner>div.output div.content { background-color:white; color:black; }
|
|
||||||
body.white.simple fieldset.inner>div.output div.content tr.select { background-color:white; }
|
|
||||||
body.white.simple fieldset.inner>div.output div.content tr.select td.line { background-color:steelblue; color:white; border:none; }
|
|
||||||
body.white.simple fieldset.inner>div.output div.content tr.select td.text { border:solid 1px lightgray; }
|
|
||||||
body.white.simple fieldset.inner>div.output div.content td.text span.string { color:royalblue; }
|
|
||||||
body.white.simple fieldset.inner>div.output div.content td.text span.function { color:darkred; }
|
|
||||||
body.white.simple fieldset.inner>div.output div.content td.text span.keyword { color:blue; }
|
|
||||||
body.white.simple fieldset.inner>div.status legend { background-color:lightgray; color:black; padding:0px 10px; border-left:solid 2px red; height:30px; float:right; border-radius:0; box-shadow:none; }
|
|
||||||
|
|
||||||
body.mobile fieldset.inner>form.option input[name=file] { width:90px; }
|
body.mobile fieldset.inner>form.option input[name=file] { width:90px; }
|
||||||
body.mobile fieldset.plugin.inner div.action { display:none; }
|
body.mobile fieldset.inner.cmd>div.output div.toggle { display:block; }
|
||||||
body.mobile.landscape fieldset.plugin.inner div.action { display:contents; }
|
body.mobile fieldset.inner.cmd>div.output div.toggle { background-color:lightblue; width:30px; }
|
||||||
|
body.mobile fieldset.inner.cmd>div.output div.toggle.display { background-color:lightblue; margin-top:-33px; height:30px; width:100px; }
|
||||||
body.mobile.simple fieldset.inner>div.output div.toggle { display:block; }
|
|
||||||
body.mobile.simple fieldset.inner>div.output div.toggle { background-color:lightblue; width:30px; }
|
|
||||||
body.mobile.simple fieldset.inner>div.output div.toggle.display { background-color:lightblue; margin-top:-33px; height:30px; width:100px; }
|
|
||||||
|
|
||||||
.unselectable {
|
.unselectable {
|
||||||
-webkit-touch-callout:none;
|
-webkit-touch-callout:none;
|
||||||
-webkit-user-select:none;
|
-webkit-user-select:none;
|
||||||
@ -111,4 +59,23 @@ body.mobile.simple fieldset.inner>div.output div.toggle.display { background-col
|
|||||||
-o-user-select:none;
|
-o-user-select:none;
|
||||||
user-select:none;
|
user-select:none;
|
||||||
}
|
}
|
||||||
|
div.project div.zone.create>div.action { display:none; }
|
||||||
|
div.project div.zone.create>div.list div.item { padding:2px; float:left; clear:none; }
|
||||||
|
div.project div.zone.create>div.list div.item input { font-family:monospace; }
|
||||||
|
fieldset.word fieldset.inner>form.option input[name=path] { width:240px; }
|
||||||
|
body.webview div.project div.zone.create>div.list div.item { padding:2px; }
|
||||||
body.white.simple fieldset.plugin div.output.json div.item span.nonce { color:lightgray; }
|
body.white.simple fieldset.plugin div.output.json div.item span.nonce { color:lightgray; }
|
||||||
|
|
||||||
|
fieldset>div.output>fieldset.plug { position:absolute; bottom:0px; right:0px; }
|
||||||
|
fieldset>div.output>fieldset.plug { display:none; }
|
||||||
|
fieldset>div.output>fieldset.plug.select { background-color:#0e3369b3; color:white; display:block; z-index:10; }
|
||||||
|
fieldset>div.status legend { float:right; height:30px; }
|
||||||
|
fieldset>div.status legend.select { background-color:green; }
|
||||||
|
fieldset>div.status legend:hover { background-color:green; }
|
||||||
|
fieldset.inner>div.status { height:30px; overflow:auto; }
|
||||||
|
fieldset.inner div.output fieldset.toolkit { position:absolute; bottom:0px; right:0px; }
|
||||||
|
fieldset.inner>div.output fieldset.toolkit>div.output>fieldset { display:none; }
|
||||||
|
fieldset.inner>div.output fieldset.toolkit>div.output>fieldset.select { background-color:#0e3369b3; color:white; display:block; z-index:10; }
|
||||||
|
fieldset.inner>div.output fieldset.toolkit>div.output fieldset { display:none; }
|
||||||
|
fieldset.inner>div.output fieldset.toolkit>div.output fieldset.select { background-color:#0e3369b3; color:white; display:block; z-index:10; }
|
||||||
|
fieldset.inner div.output fieldset.toolkit>div.output { position:unset; }
|
||||||
|
@ -1,156 +1,95 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) {
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.clear(can), can.page.ClassList.add(can, can._fields, code.INNER)
|
||||||
can.onmotion.clear(can), can.page.ClassList.add(can, can._fields, code.INNER), can.onlayout.profile(can)
|
if (msg.Option(nfs.FILE)) { can.Option(nfs.FILE, msg.Option(nfs.FILE))
|
||||||
can.onimport._profile(can, can.ui.profile), can.onimport._display(can, can.ui.display)
|
|
||||||
if (msg.Result() == "" && can.Option(nfs.LINE) == "1") { return }
|
|
||||||
can.page.styleWidth(can, can.ui.project, 240)
|
|
||||||
|
|
||||||
can.isCmdMode() && can.ConfHeight(can.ConfHeight()+2*html.ACTION_HEIGHT)
|
|
||||||
if (msg.Option(nfs.FILE)) {
|
|
||||||
msg.Option(nfs.PATH) && can.Option(nfs.PATH, msg.Option(nfs.PATH))
|
msg.Option(nfs.PATH) && can.Option(nfs.PATH, msg.Option(nfs.PATH))
|
||||||
can.Option(nfs.FILE, msg.Option(nfs.FILE))
|
|
||||||
msg.Option(nfs.LINE) && can.Option(nfs.LINE, msg.Option(nfs.LINE))
|
msg.Option(nfs.LINE) && can.Option(nfs.LINE, msg.Option(nfs.LINE))
|
||||||
}
|
} if (msg.Result() == "" && can.Option(nfs.LINE) == "1") { return }
|
||||||
|
|
||||||
can.onengine.plugin(can, can.onplugin)
|
|
||||||
var paths = can.core.Split(can.Option(nfs.PATH), ice.FS); can.Option(nfs.PATH, paths[0])
|
|
||||||
var files = can.core.Split(can.Option(nfs.FILE), ice.FS); can.Option(nfs.FILE, files[0])
|
var files = can.core.Split(can.Option(nfs.FILE), ice.FS); can.Option(nfs.FILE, files[0])
|
||||||
can.core.List(paths.concat(msg.modules||[], can.sup.paths||[], can.core.Split(msg.Option("repos"))), function(p) { if (paths.indexOf(p) == -1 && p[0] != ice.PS) { paths.push(p) } })
|
var paths = can.core.Split(can.Option(nfs.PATH), ice.FS); can.Option(nfs.PATH, paths[0])
|
||||||
can.sup.paths = paths
|
can.core.List(paths.concat(msg.modules||[], can.core.Split(msg.Option(nfs.REPOS)), can.sup.paths||[]), function(p) { if (p && paths.indexOf(p) == -1 && p[0] != ice.PS) { paths.push(p) } }), can.sup.paths = paths
|
||||||
|
can.toolkit = {}, can.extentions = {}, can.onengine.plugin(can, can.onplugin)
|
||||||
can.ui._content = can.ui.content, can.ui._profile_output = can.ui.profile_output
|
can.tabview = can.tabview||{}, can.history = can.history||[], can.profile_size = {}, can.display_size = {}
|
||||||
can.tabview = can.tabview||{}, can.history = can.history||[], can.toolkit = {}, can.extentions = {}
|
can.ui = can.onappend.layout(can, can._output, "", [html.PROJECT, [html.TABS, nfs.PATH, [html.CONTENT, html.PROFILE], html.DISPLAY]])
|
||||||
can.profile_size = {}, can.display_size = {}
|
can.ui._content = can.ui.content, can.ui._profile = can.ui.profile, can.ui._display = can.ui.display
|
||||||
|
|
||||||
if (can.user.isWebview) { var last = can.misc.localStorage(can, "web.code.inner:currentFile"); if (last) { var ls = can.core.Split(last, ice.DF) } }
|
|
||||||
|
|
||||||
switch (can.Mode()) {
|
switch (can.Mode()) {
|
||||||
case chat.SIMPLE: can.onmotion.hidden(can, can.ui.project); break
|
case chat.SIMPLE: can.onmotion.hidden(can, can.ui.project); break
|
||||||
case chat.FLOAT: can.onmotion.hidden(can, can.ui.project); break
|
case chat.FLOAT: can.onmotion.hidden(can, can.ui.project); break
|
||||||
case chat.CMD: can.onimport._tabs(can), can.onmotion.hidden(can, can._status) // no break
|
case chat.CMD: can.onmotion.hidden(can, can._status), can.onimport._keydown(can) // no break
|
||||||
case chat.FULL: // no break
|
case chat.FULL: // no break
|
||||||
default: can.onimport.project(can, paths)
|
default: can.onimport.project(can, paths), can.onimport._tabs(can)
|
||||||
can.onengine.listen(can, "tabview.view.init", function() { if (can.user.isMobile) { return } var p = can.onsyntax[can.parse]
|
can.onmotion.delay(can, function() { can.core.Next(files.slice(1), function(file, next) {
|
||||||
can.Option(nfs.PATH).indexOf("src/") == 0 && p && p.render && can.onaction[ice.SHOW]({}, can); if (can.page.ClassList.has(can, can._fields, chat.PLUGIN)) {
|
can.onimport.tabview(can, can.Option(nfs.PATH), file, "", next)
|
||||||
p && p.engine && can.onaction[ice.EXEC]({}, can)
|
}, function() { files.length > 1 && can.onimport.tabview(can, paths[0], files[0], "")
|
||||||
}
|
if (can.user.isWebview) { var last = can.misc.localStorage(can, "web.code.inner:currentFile"); if (!last) { return } }
|
||||||
})
|
var ls = can.core.Split(last, ice.DF); ls.length > 0 && can.onmotion.delayLong(can, function() { can.onimport.tabview(can, ls[0], ls[1], ls[2]) })
|
||||||
can.onimport._keydown(can), can.onimport._toolkit(can, can.ui.toolkit), can.onimport._session(can, msg, function() {
|
}) })
|
||||||
files.length > 1 && can.onmotion.delay(can, function() { can.core.Next(files.slice(1), function(file, next) {
|
|
||||||
can.onimport.tabview(can, can.Option(nfs.PATH), file, can.Option(nfs.LINE), next)
|
|
||||||
}, function() { can.onimport.tabview(can, paths[0], files[0], "") }) })
|
|
||||||
last && ls.length > 0 && can.onmotion.delay(can, function() { can.onimport.tabview(can, ls[0], ls[1], ls[2]) }, 500)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var hash = location.hash; can.tabview[can.onexport.keys(can)] = msg
|
var hash = location.hash; can.tabview[can.onexport.keys(can)] = msg
|
||||||
can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE), function() {
|
can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE), function() {
|
||||||
if (can.isCmdMode() && hash) { var args = can.core.Split(decodeURIComponent(hash).slice(1))
|
if (can.isCmdMode() && hash) { var args = can.core.Split(decodeURIComponent(hash).slice(1))
|
||||||
can.onmotion.delay(can, function() { can.onimport.tabview(can, args[args.length-3]||can.Option(nfs.PATH), args[args.length-2]||can.Option(nfs.FILE), args[args.length-1]) }, 500)
|
can.onmotion.delayLong(can, function() { can.onimport.tabview(can, args[args.length-3]||can.Option(nfs.PATH), args[args.length-2]||can.Option(nfs.FILE), args[args.length-1]) })
|
||||||
}
|
}
|
||||||
}), can.base.isFunc(cb) && cb(msg)
|
}), can.base.isFunc(cb) && cb(msg)
|
||||||
},
|
},
|
||||||
_profile: function(can, target) {
|
_keydown: function(can) {
|
||||||
var ui = can.onimport._panel(can, target, kit.Dict(
|
|
||||||
mdb.LINK, function(event) {
|
|
||||||
if ([nfs.ZML, nfs.IML].indexOf(can.base.Ext(can.Option(nfs.FILE))) > -1) {
|
|
||||||
can.user.open(can.misc.MergePodCmd(can, {website: can.base.trimPrefix(can.base.Path(can.Option(nfs.PATH), can.Option(nfs.FILE)), "src/website/")}))
|
|
||||||
} else {
|
|
||||||
can.user.open(can.misc.MergePodCmd(can, {cmd: can.base.Path(can.Option(nfs.PATH), can.Option(nfs.FILE))}))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
html.WIDTH, function(event) {
|
|
||||||
can.user.input(event, can, [{name: html.WIDTH, value: can.profile_size[can.onexport.keys(can)]*100/can.ConfWidth()||50}], function(list) {
|
|
||||||
can.profile_size[can.onexport.keys(can)] = can.ConfWidth()*parseInt(list[0])/100, can.onaction[ice.SHOW](event, can)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
)); can.ui.profile_output = ui.output
|
|
||||||
},
|
|
||||||
_display: function(can, target) {
|
|
||||||
},
|
|
||||||
_toolkit: function(can, target) {
|
|
||||||
can.ui.toolkit = can.onappend.field(can, "toolkit", {}, can._output)
|
|
||||||
},
|
|
||||||
_keydown: function(can) { if (!can.isCmdMode()) { return }
|
|
||||||
can.onkeymap._build(can), can._root.onengine.listen(can, chat.ONKEYDOWN, function(event) {
|
can.onkeymap._build(can), can._root.onengine.listen(can, chat.ONKEYDOWN, function(event) {
|
||||||
if (event.ctrlKey && event.key >= "0" && event.key <= "9") {
|
if (can.onkeymap.selectCtrlN(event, can, can.ui.tabs, html.DIV_TABS)) { return }
|
||||||
return can.page.Select(can, can.ui._tabs, "div.tabs", function(target, index) { index+1 == event.key && target.click() })
|
|
||||||
}
|
|
||||||
can._key_list = can.onkeymap._parse(event, can, mdb.PLUGIN, can._key_list, can.ui.content)
|
can._key_list = can.onkeymap._parse(event, can, mdb.PLUGIN, can._key_list, can.ui.content)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
_session: function(can, msg, cb) {
|
_tabs: function(can) { if (!can.isCmdMode()) { return can.ui.tabs = can._action }
|
||||||
can.onimport.sess(can, "", function() { can.onimport.sess(can, {
|
can.page.Append(can, can.ui.tabs, [{view: [[mdb.TIME, html.SELECT]], _init: function(target) {
|
||||||
exts: can.core.Split(msg.SearchOrOption("exts")).reverse(),
|
can.core.Timer({interval: 100}, function() { can.page.Modify(can, target, can.base.Time()) })
|
||||||
plug: can.core.Split(msg.SearchOrOption("plug")).reverse(),
|
|
||||||
tabs: can.core.Split(msg.SearchOrOption("tabs")),
|
|
||||||
}, cb) })
|
|
||||||
},
|
|
||||||
_tabs: function(can) {
|
|
||||||
can.ui._tabs = can.page.insertBefore(can, ["tabs"], can.ui._content), can.ui._path = can.page.insertBefore(can, ["path"], can.ui._content)
|
|
||||||
can.page.Append(can, can.ui._tabs, [{view: [["time", "select"]], style: {"float": html.RIGHT}, _init: function(target) {
|
|
||||||
can.core.Timer({interval: 100}, function() { can.page.Appends(can, target, [{text: can.base.Time()}]) })
|
|
||||||
can.onappend.figure(can, {action: "date", _hold: true}, target, function(sub, value) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.team.plan", ctx.INDEX) })
|
can.onappend.figure(can, {action: "date", _hold: true}, target, function(sub, value) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.team.plan", ctx.INDEX) })
|
||||||
target.onmouseenter = target.click
|
|
||||||
}}])
|
}}])
|
||||||
|
can.page.Append(can, can.ui.tabs, [{view: [aaa.AVATAR], list: [{img: can.user.info.avatar}]}])
|
||||||
},
|
},
|
||||||
_tabInputs: function(can, ps, key, value, cb) {
|
_tabInputs: function(can, ps, key, value, cb) {
|
||||||
can.core.List(can.core.Split(value, ps), function(value, index, array) {
|
can.core.List(can.core.Split(value, ps), function(value, index, array) {
|
||||||
can.page.Append(can, can.ui._path, [{text: [value, html.SPAN, html.ITEM], onclick: function(event) {
|
can.page.Append(can, can.ui.path, [{text: [value, html.SPAN, html.ITEM], onclick: function(event) {
|
||||||
can.onimport.tabInputs(event, can, ps, key, array.slice(0, index).join(ps)+ps, cb)
|
can.onimport.tabInputs(event, can, ps, key, array.slice(0, index).join(ps)+ps, cb)
|
||||||
}}, index < array.length-1? {text: ps}: null])
|
}}, index < array.length-1? {text: ps}: null])
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
tabInputs: function(event, can, ps, key, pre, cb, parent) {
|
tabInputs: function(event, can, ps, key, pre, cb, parent) {
|
||||||
var core = ["usr/icebergs/core/", "usr/volcanos/plugin/local/"]
|
|
||||||
can.runAction(event, mdb.INPUTS, [key, pre], function(msg) { var _trans = {}
|
can.runAction(event, mdb.INPUTS, [key, pre], function(msg) { var _trans = {}
|
||||||
var carte = can.user[parent? "carteRight": "carte"](event, can, {}, msg.Table(function(value) { var p = can.base.trimPrefix(value[key], pre)
|
var carte = can.user[parent? "carteRight": "carte"](event, can, {}, msg.Table(function(value) {
|
||||||
if (can.base.beginWith(pre, core[0]) && can.base.beginWith(value[key], core[1])) { var p = can.base.trimPrefix(can.base.replaceAll(value[key], core[1], core[0]), pre) }
|
var p = can.core.Split(value[key], ice.PS).pop()+(can.base.endWith(value[key], ice.PS)? ice.PS: ""); return _trans[p] = value[key], p
|
||||||
if (can.base.beginWith(pre, core[1]) && can.base.beginWith(value[key], core[0])) { var p = can.base.trimPrefix(can.base.replaceAll(value[key], core[0], core[1]), pre) }
|
|
||||||
return _trans[p] = value[key], p
|
|
||||||
}), function(event, button) {
|
}), function(event, button) {
|
||||||
can.base.endWith(button, ps)? can.onimport.tabInputs(event, can, ps, key, pre+button, cb, carte): cb(can.core.Split(_trans[button], ps), pre)
|
can.base.endWith(button, ps)? can.onimport.tabInputs(event, can, ps, key, pre+button, cb, carte): cb(can.core.Split(_trans[button], ps))
|
||||||
}, parent)._target, _p = can.core.Split(event.target.innerHTML.trim(), ice.PT)[0]
|
}, parent)._target, _p = can.core.Split(event.target.innerHTML.trim(), ice.PT)[0]
|
||||||
can.page.Select(can, carte, html.DIV_ITEM, function(target) { event.target.innerHTML.trim() != target.innerHTML.trim() && can.base.beginWith(target.innerHTML, _p) && carte.insertBefore(target, carte.firstChild) })
|
can.page.Select(can, carte, html.DIV_ITEM, function(target) { target.innerHTML.trim() != event.target.innerHTML.trim() && can.base.beginWith(target.innerHTML, _p) && carte.insertBefore(target, carte.firstChild) })
|
||||||
function remove(p) { if (p && p._sub) { remove(p._sub), can.page.Remove(can, p._sub), delete(p._sub) } } if (parent) { remove(parent), parent._sub = carte }
|
function remove(p) { if (p && p._sub) { remove(p._sub), can.page.Remove(can, p._sub), delete(p._sub) } } if (parent) { remove(parent), parent._sub = carte }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
tabview: function(can, path, file, line, cb) { var key = can.onexport.keys(can, path, file)
|
tabview: function(can, path, file, line, cb) { var key = can.onexport.keys(can, path, file)
|
||||||
function isCommand() { return path == ctx.COMMAND || line == ctx.INDEX || line == code.XTERM }
|
function isCommand() { return path == ctx.COMMAND || line == ctx.INDEX || line == code.XTERM }
|
||||||
function isDream() { return line == web.DREAM }
|
function isDream() { return line == web.DREAM }
|
||||||
|
|
||||||
function show(skip) { if (can.isCmdMode()) { can.onimport._title(can, path+file) }
|
function show(skip) { if (can.isCmdMode()) { can.onimport._title(can, path+file) }
|
||||||
can._msg && can._msg.Option(nfs.LINE, can.Option(nfs.LINE)), can._msg = can.tabview[key]
|
can._msg && can._msg.Option(nfs.LINE, can.Option(nfs.LINE)), can._msg = can.tabview[key]
|
||||||
|
can.Option(can.onimport.history(can, {path: path, file: file, line: line||can.misc.localStorage(can, "web.code.vimer:selectLine:"+path+file)||can._msg.Option(nfs.LINE)||1}))
|
||||||
can.Option(can.onimport.history(can, {path: path, file: file, line: line||can.misc.localStorage(can, "web.code.vimer:selectLine:"+path+file)||can._msg.Option(nfs.LINE)|| 1}))
|
|
||||||
can.onsyntax._init(can, can._msg, function(content) { var msg = can._msg
|
can.onsyntax._init(can, can._msg, function(content) { var msg = can._msg
|
||||||
can.onexport.hash(can), msg._tab && can.onmotion.select(can, msg._tab.parentNode, html.DIV_TABS, msg._tab)
|
can.onexport.hash(can), can.onmotion.select(can, can.ui.tabs, html.DIV_TABS, msg._tab)
|
||||||
if (can.ui._path) { can.ui._path.innerHTML = ""
|
if (can.ui.path) { can.ui.path.innerHTML = ""
|
||||||
if (isDream()) {
|
if (isCommand()) {
|
||||||
can.ui._path.innerHTML = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)}))
|
can.ui.path.innerHTML = can.Option(nfs.FILE)
|
||||||
} else if (isCommand()) {
|
} else if (isDream()) {
|
||||||
can.ui._path.innerHTML = can.Option(nfs.FILE)
|
can.ui.path.innerHTML = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)}))
|
||||||
} else {
|
} else {
|
||||||
can.onimport._tabInputs(can, ice.PS, nfs.PATH, can.base.Path(can.Option(nfs.PATH), can.Option(nfs.FILE)), function(ls, pre) {
|
can.onimport._tabInputs(can, ice.PS, nfs.PATH, can.base.Path(can.Option(nfs.PATH), can.Option(nfs.FILE)), function(ls) {
|
||||||
if (can.base.beginWith(pre, "usr/")) {
|
if (ls[0] == ice.SRC) {
|
||||||
can.onimport.tabview(can, ls.slice(0, 2).join(ice.PS)+ice.PS, ls.slice(2).join(ice.PS))
|
|
||||||
} else {
|
|
||||||
can.onimport.tabview(can, ls.slice(0, 1).join(ice.PS)+ice.PS, ls.slice(1).join(ice.PS))
|
can.onimport.tabview(can, ls.slice(0, 1).join(ice.PS)+ice.PS, ls.slice(1).join(ice.PS))
|
||||||
|
} else {
|
||||||
|
can.onimport.tabview(can, ls.slice(0, 2).join(ice.PS)+ice.PS, ls.slice(2).join(ice.PS))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
can.ui.current && can.onmotion.toggle(can, can.ui.current, !isCommand() && !isDream())
|
can.page.SelectChild(can, can.ui._content.parentNode, can.page.Keys(html.DIV_CONTENT, [[[html.IFRAME, html.CONTENT]]]), function(item) {
|
||||||
|
|
||||||
can.page.Select(can, can.ui._content.parentNode, can.page.Keys(html.DIV_CONTENT, html.IFRAME), function(item) {
|
|
||||||
if (item.parentNode != can.ui._content.parentNode) { return }
|
|
||||||
if (can.onmotion.toggle(can, item, item == msg._content)) { can.ui.content = msg._content }
|
if (can.onmotion.toggle(can, item, item == msg._content)) { can.ui.content = msg._content }
|
||||||
}), can.ui.content._plugin = msg._plugin, msg._plugin && can.onmotion.delay(can, function() { msg._plugin.Focus() })
|
}), can.ui.content._plugin = msg._plugin, msg._plugin && can.onmotion.delay(can, function() { msg._plugin.Focus() })
|
||||||
|
can.page.SelectChild(can, can.ui._content.parentNode, can.page.Keys(html.DIV_PROFILE, [[[html.IFRAME, html.PROFILE]]]), function(item) {
|
||||||
can.page.Select(can, can.ui._profile_output.parentNode, can.page.Keys(html.DIV_OUTPUT, html.IFRAME), function(item) {
|
if (can.onmotion.toggle(can, item, item == msg._profile)) { can.ui.profile = msg._profile }
|
||||||
if (item.parentNode != can.ui._profile_output.parentNode) { return }
|
}), can.ui.current && can.onmotion.toggle(can, can.ui.current, !isCommand() && !isDream())
|
||||||
if (can.onmotion.toggle(can, item, item == msg._profile_output)) { can.ui.profile_output = msg._profile_output }
|
|
||||||
})
|
|
||||||
|
|
||||||
var ls = can.file.split(ice.PS); if (ls.length > 4) { ls = [ls.slice(0, 2).join(ice.PS)+"/.../"+ls.slice(-2).join(ice.PS)] }
|
var ls = can.file.split(ice.PS); if (ls.length > 4) { ls = [ls.slice(0, 2).join(ice.PS)+"/.../"+ls.slice(-2).join(ice.PS)] }
|
||||||
can.Status(kit.Dict("文件名", ls.join(ice.PS), "解析器", can.parse)), can.onimport.layout(can)
|
can.Status(kit.Dict("文件名", ls.join(ice.PS), "解析器", can.parse)), can.onimport.layout(can)
|
||||||
skip || can.onaction.selectLine(can, can.Option(nfs.LINE)), can.base.isFunc(cb) && cb(), cb = null
|
skip || can.onaction.selectLine(can, can.Option(nfs.LINE)), can.base.isFunc(cb) && cb(), cb = null
|
||||||
@ -160,13 +99,12 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) {
|
|||||||
can.onimport.tabs(can, [{name: file.split(isCommand()? ice.PT: ice.PS).pop(), text: file}], function(event) {
|
can.onimport.tabs(can, [{name: file.split(isCommand()? ice.PT: ice.PS).pop(), text: file}], function(event) {
|
||||||
can._tab = msg._tab = event.target, show(true)
|
can._tab = msg._tab = event.target, show(true)
|
||||||
}, function(item) { can.onengine.signal(can, "tabview.view.delete", msg)
|
}, function(item) { can.onengine.signal(can, "tabview.view.delete", msg)
|
||||||
delete(can.tabview[key]), delete(can._cache_data[key]), delete(can.ui._content._cache[key])
|
msg._content != can.ui._content && can.page.Remove(can, msg._content), msg._profile != can.ui._profile && can.page.Remove(can, msg._profile)
|
||||||
delete(can.ui._profile_output._cache[key]), delete(can.ui.display._cache[key])
|
delete(can.ui._content._cache[key]), delete(can.ui._profile._cache[key]), delete(can.ui.display._cache[key])
|
||||||
msg._content != can.ui._content && can.page.Remove(can, msg._content)
|
delete(can._cache_data[key]), delete(can.tabview[key])
|
||||||
}, can.ui._tabs)
|
}, can.ui.tabs)
|
||||||
}
|
}
|
||||||
|
if (can.tabview[key]) { return !can._msg._tab && !can.isSimpleMode()? load(can.tabview[key]): show() }
|
||||||
if (can.tabview[key]) { return !can._msg._tab? load(can.tabview[key]): show() }
|
|
||||||
isCommand()||isDream()? load(can.request({}, {index: file, line: line})): can.run({}, [path, file], load, true)
|
isCommand()||isDream()? load(can.request({}, {index: file, line: line})): can.run({}, [path, file], load, true)
|
||||||
},
|
},
|
||||||
history: function(can, record) {
|
history: function(can, record) {
|
||||||
@ -179,46 +117,37 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) {
|
|||||||
}), can.ui.project), can.user.isMobile && !can.user.isLandscape() && can.onmotion.hidden(can, can.ui.project)
|
}), can.ui.project), can.user.isMobile && !can.user.isLandscape() && can.onmotion.hidden(can, can.ui.project)
|
||||||
},
|
},
|
||||||
profile: function(can, msg) { var sup = can.tabview[can.onexport.keys(can)]
|
profile: function(can, msg) { var sup = can.tabview[can.onexport.keys(can)]
|
||||||
if (msg.Result().indexOf("<iframe") > -1) { if (sup._profile_output != can.ui._profile_output) { can.page.Remove(can, sup._profile_output) }
|
if (msg.Result().indexOf("<iframe ") > -1) { if (sup._profile != can.ui._profile) { can.page.Remove(can, sup._profile) }
|
||||||
can.ui.profile_output = sup._profile_output = can.page.Append(can, can.ui._profile_output.parentNode, [{view: html.OUTPUT, inner: msg.Result()}]).output
|
can.ui.profile = sup._profile = can.page.Append(can, can.ui._profile.parentNode, [{view: [html.PROFILE, html.IFRAME], src: msg.Append(mdb.LINK)}])._target
|
||||||
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 = sup._profile = can.ui._profile
|
||||||
} else {
|
can.onimport.process(can, msg, can.ui.profile, can.ui.profile.offsetHeight, can.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2)
|
||||||
can.ui.profile_output = sup._profile_output = can.ui._profile_output
|
can.page.Select(can, can.ui.profile, html.TABLE, function(target) { can.onmotion.delay(can, function() {
|
||||||
var width = can.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2
|
if (target.offsetWidth < can.ui._profile.offsetWidth) { can.profile_size[can.onexport.keys(can)] = target.offsetWidth, can.onimport.layout(can) }
|
||||||
can.onimport.process(can, msg, can.ui._profile_output, can.ui.profile.offsetHeight, width)
|
|
||||||
can.onappend._status(can, msg.Option(ice.MSG_STATUS), can.page.Append(can, can.ui._profile_output, [html.STATUS])._target)
|
|
||||||
can.page.Select(can, can.ui._profile_output, html.TABLE, function(target) { can.onmotion.delay(can, function() {
|
|
||||||
if (target.offsetWidth < can.ui._profile_output.offsetWidth) { can.profile_size[can.onexport.keys(can)] = target.offsetWidth, can.onimport.layout(can) }
|
|
||||||
}) })
|
}) })
|
||||||
}
|
} can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can)
|
||||||
can.onmotion.toggle(can, can.ui.profile_output, true)
|
|
||||||
can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can)
|
|
||||||
},
|
},
|
||||||
display: function(can, msg) { var target = can.ui.display
|
display: function(can, msg) { var target = can.ui.display
|
||||||
var height = can.display_size[can.onexport.keys(can)]||can.ConfHeight()/2
|
can.onimport.process(can, msg, target, can.display_size[can.onexport.keys(can)]||can.ConfHeight()/2, target.offsetWidth, function(sub) {
|
||||||
can.onimport.process(can, msg, can.ui.display, height, can.ui.display.offsetWidth, function(sub) {
|
can.onmotion.delay(can, function() { can.page.style(can, sub._output, html.HEIGHT, "", html.MAX_HEIGHT, "")
|
||||||
can.page.style(can, sub._output, html.HEIGHT, "", html.MAX_HEIGHT, ""), can.onmotion.delay(can, function() {
|
can.display_size[can.onexport.keys(can)] = can.base.Max(sub._output.offsetHeight, can.ConfHeight()/2)+html.ACTION_HEIGHT+sub.onexport.statusHeight(sub)
|
||||||
can.display_size[can.onexport.keys(can)] = can.base.Max(sub._output.offsetHeight, can.ConfHeight()/2)+html.ACTION_HEIGHT+sub.onexport.statusHeight(sub)
|
can.page.style(can, sub._output, html.MAX_HEIGHT, can.display_size[can.onexport.keys(can)]-html.ACTION_HEIGHT-sub.onexport.statusHeight(sub))
|
||||||
can.page.style(can, sub._output, html.MAX_HEIGHT, can.display_size[can.onexport.keys(can)]-html.ACTION_HEIGHT-sub.onexport.statusHeight(sub))
|
|
||||||
can.onimport.layout(can)
|
can.onimport.layout(can)
|
||||||
}), sub.onaction.close = function() { can.onmotion.hidden(can, can.ui.display), can.onimport.layout(can) }
|
}), sub.onaction.close = function() { can.onmotion.hidden(can, target), can.onimport.layout(can) }
|
||||||
})
|
}), can.onmotion.toggle(can, target, true), can.onimport.layout(can)
|
||||||
can.onmotion.toggle(can, can.ui.display, true), can.onimport.layout(can)
|
|
||||||
if (msg.Option(ice.MSG_PROCESS) != "_field") {
|
if (msg.Option(ice.MSG_PROCESS) != "_field") {
|
||||||
can.onmotion.delay(can, function() { can.page.style(can, target, html.HEIGHT, "", html.MAX_HEIGHT, "")
|
can.onmotion.delay(can, function() { can.page.style(can, target, html.HEIGHT, "", html.MAX_HEIGHT, "")
|
||||||
can.display_size[can.onexport.keys(can)] = can.base.Max(target.offsetHeight, can.ConfHeight()/2)
|
can.display_size[can.onexport.keys(can)] = can.base.Max(target.offsetHeight, can.ConfHeight()/2)
|
||||||
can.page.style(can, target, html.MAX_HEIGHT, can.display_size[can.onexport.keys(can)])
|
can.page.style(can, target, html.MAX_HEIGHT, can.display_size[can.onexport.keys(can)]), can.onimport.layout(can)
|
||||||
can.onimport.layout(can)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
process: function(can, msg, target, height, width, cb) { can.onmotion.clear(can, target), can.user.toastSuccess(can)
|
process: function(can, msg, target, height, width, cb) { can.onmotion.clear(can, target), can.user.toastSuccess(can)
|
||||||
if (msg.Option(ice.MSG_PROCESS) == "_field") {
|
if (msg.Option(ice.MSG_PROCESS) == "_field") {
|
||||||
msg.Table(function(item) { item.display = msg.Option(ice.MSG_DISPLAY), item.height = height-3*html.ACTION_HEIGHT
|
msg.Table(function(item) { item.display = msg.Option(ice.MSG_DISPLAY), item.height = height-2*html.ACTION_HEIGHT
|
||||||
can.onimport.plug(can, item, function(sub) {
|
can.onimport.plug(can, item, function(sub) {
|
||||||
sub.onaction._output = function(_sub, _msg) { can.base.isFunc(cb) && cb(_sub, _msg) }
|
sub.onaction._output = function(_sub, _msg) { can.base.isFunc(cb) && cb(_sub, _msg) }
|
||||||
sub.onaction.close = function() { can.onmotion.hidden(can, target.parentNode), can.onimport.layout(can) }
|
sub.onaction.close = function() { can.onmotion.hidden(can, target), can.onimport.layout(can) }
|
||||||
height && sub.ConfHeight(height-3*html.ACTION_HEIGHT), width && sub.ConfWidth(width), sub.Focus()
|
height && sub.ConfHeight(height-2*html.ACTION_HEIGHT), width && sub.ConfWidth(width)
|
||||||
}, target)
|
}, target)
|
||||||
})
|
})
|
||||||
} else if (msg.Option(ice.MSG_DISPLAY) != "") {
|
} else if (msg.Option(ice.MSG_DISPLAY) != "") {
|
||||||
@ -230,77 +159,54 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) {
|
|||||||
can.current.scroll(can.current.scroll()-9)
|
can.current.scroll(can.current.scroll()-9)
|
||||||
})
|
})
|
||||||
} }}
|
} }}
|
||||||
}, target), can.onappend.board(can, msg, target)
|
}, target), can.onappend.board(can, msg, target), can.onappend._status(can, msg.Option(ice.MSG_STATUS), can.page.Append(can, target, [html.STATUS])._target)
|
||||||
can.onappend._status(can, msg.Option(ice.MSG_STATUS), can.page.Append(can, target, ["status"])._target)
|
|
||||||
} else {
|
} else {
|
||||||
can.onmotion.hidden(can, target.parentNode)
|
can.onmotion.hidden(can, target)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toolkit: function(can, meta, cb) { meta.msg = true
|
toolkit: function(can, meta, cb) { meta.msg = true
|
||||||
can.onimport.plug(can, meta, function(sub) {
|
can.onimport.plug(can, meta, function(sub) {
|
||||||
sub.onexport.record = function(sub, line) { if (!line.file && !line.line) { return }
|
|
||||||
can.onimport.tabview(can, line.path||can.Option(nfs.PATH), can.base.trimPrefix(line.file, nfs.PWD)||can.Option(nfs.FILE), parseInt(line.line)), can.current.scroll(can.current.scroll()-4)
|
|
||||||
}
|
|
||||||
sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth() - can.ui.profile.offsetWidth, true)
|
|
||||||
can._status.appendChild(sub._legend), sub._legend.onclick = function(event) {
|
can._status.appendChild(sub._legend), sub._legend.onclick = function(event) {
|
||||||
if (can.page.Select(can, can._status, ice.PT+html.SELECT)[0] == event.target) {
|
if (can.page.SelectOne(can, can._status, ice.PT+html.SELECT) == event.target) {
|
||||||
can.page.ClassList.del(can, event.target, html.SELECT)
|
can.page.ClassList.del(can, event.target, html.SELECT)
|
||||||
can.page.ClassList.del(can, sub._target, html.SELECT)
|
can.page.ClassList.del(can, sub._target, html.SELECT)
|
||||||
return
|
} else {
|
||||||
|
can.page.SelectChild(can, can._output, can.core.Keys(html.FIELDSET, "plug"), function(target) {
|
||||||
|
if (target == sub._target) { can.page.ClassList.neg(can, target, html.SELECT) } else {
|
||||||
|
can.page.ClassList.del(can, target, html.SELECT)
|
||||||
|
}
|
||||||
|
}), can.onmotion.select(can, can._status, html.LEGEND, event.target)
|
||||||
|
if (meta.msg == true) { meta.msg = false, sub.Update() }
|
||||||
}
|
}
|
||||||
can.onmotion.select(can, can.ui.toolkit.output, html.FIELDSET, sub._target), sub.Focus()
|
|
||||||
can.onmotion.select(can, can._status, html.LEGEND, event.target)
|
|
||||||
if (meta.msg == true) { meta.msg = false, sub.Update() }
|
|
||||||
}, sub._legend.onmouseenter = null
|
}, sub._legend.onmouseenter = null
|
||||||
sub.onaction.close = sub.select = function() { return sub._legend.click(), sub }
|
sub.onaction.close = sub.select = function() { return sub._legend.click(), sub }
|
||||||
|
sub.onexport.record = function(sub, line) { if (!line.file && !line.line) { return }
|
||||||
|
can.onimport.tabview(can, line.path||can.Option(nfs.PATH), can.base.trimPrefix(line.file, nfs.PWD)||can.Option(nfs.FILE), parseInt(line.line)), can.current.scroll(can.current.scroll()-4)
|
||||||
|
}, sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth() - can.ui.project.offsetWidth, true)
|
||||||
can.base.isFunc(cb) && cb(sub)
|
can.base.isFunc(cb) && cb(sub)
|
||||||
}, can.ui.toolkit.output)
|
}, can._output)
|
||||||
},
|
},
|
||||||
layout: function(can) {
|
layout: function(can) {
|
||||||
if (can.isSimpleMode()) { return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) }
|
if (can.isSimpleMode()) { return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) }
|
||||||
if (can.isCmdMode()) { can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) }
|
if (can.isCmdMode()) { can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) }
|
||||||
can.isFloatMode() && can.onmotion.hidden(can, can.ui.profile)
|
can.isFloatMode() && can.onmotion.hidden(can, can.ui.profile)
|
||||||
|
|
||||||
var width = can.ConfWidth()+(can.user.isMobile && can.isCmdMode() && can.user.isLandscape()? 16: 0)-(can.user.isWindows && !can.isCmdMode()? 20: 0)
|
var width = can.ConfWidth()+(can.user.isMobile && can.isCmdMode() && can.user.isLandscape()? 16: 0)-(can.user.isWindows && !can.isCmdMode()? 20: 0)
|
||||||
var project_width = can.ui.project.style.display == html.NONE? 0: (can.ui.project.offsetWidth||240)
|
|
||||||
var profile_width = can.ui.profile.style.display == html.NONE? 0: can.profile_size[can.onexport.keys(can)]||(width-project_width)/2
|
|
||||||
var content_width = width-project_width-profile_width
|
|
||||||
can.page.styleWidth(can, can.ui.content, content_width)
|
|
||||||
can.page.styleWidth(can, can.ui.profile_output, profile_width)
|
|
||||||
can.page.styleWidth(can, can.ui.display, width-project_width)
|
|
||||||
|
|
||||||
var height = can.user.isMobile && can.isFloatMode()? can.page.height()-2*html.ACTION_HEIGHT: can.base.Min(can.ConfHeight(), 320)-1
|
var height = can.user.isMobile && can.isFloatMode()? can.page.height()-2*html.ACTION_HEIGHT: can.base.Min(can.ConfHeight(), 320)-1
|
||||||
can.user.isMobile && can.isCmdMode() && can.page.style(can, can._output, html.MAX_HEIGHT, height)
|
can.user.isMobile && can.isCmdMode() && can.page.style(can, can._output, html.MAX_HEIGHT, height)
|
||||||
var display_height = can.ui.display.style.display == html.NONE? 0: (can.display_size[can.onexport.keys(can)]||html.ACTION_HEIGHT)
|
can.ui.size = {profile: can.profile_size[can.onexport.keys(can)]||0.5, display: can.display_size[can.onexport.keys(can)]||3*html.ACTION_HEIGHT}
|
||||||
var content_height = height-display_height; if (can.isCmdMode()) { content_height -= can.ui._tabs.offsetHeight + can.ui._path.offsetHeight + 4 }
|
can.ui.layout(width, height)
|
||||||
var profile_height = height-html.ACTION_HEIGHT-display_height
|
var sub = can.ui.content._plugin; sub && sub.onimport.size(sub, can.ui.content.offsetHeight-2*html.ACTION_HEIGHT, can.ui.content.offsetWidth, true)
|
||||||
can.page.styleHeight(can, can.ui.profile_output, profile_height)
|
|
||||||
can.page.styleHeight(can, can.ui.display, display_height)
|
|
||||||
can.page.styleHeight(can, can.ui.content, content_height-(can.ui.content != can.ui._content? 4: 0))
|
|
||||||
can.page.styleHeight(can, can.ui.project, height)
|
|
||||||
|
|
||||||
var sub = can.ui.content._plugin; sub && sub.onimport.size(sub, content_height-2*html.ACTION_HEIGHT, content_width, true)
|
|
||||||
can.page.Select(can, can.ui.profile, html.IFRAME, function(iframe) { can.page.Modify(can, iframe, {height: profile_height-html.ACTION_HEIGHT-4, width: profile_width}) })
|
|
||||||
},
|
},
|
||||||
exts: function(can, url, cb) {
|
exts: function(can, url, cb) {
|
||||||
can.require([url], function() {}, function(can, name, sub) { sub._init(can, sub, function(sub) {
|
can.require([url], function() {}, function(can, name, sub) { sub._init(can, sub, function(sub) {
|
||||||
can.extentions[url.split("?")[0]] = sub, can.base.isFunc(cb)? cb(sub): sub.select()
|
can.extentions[url.split("?")[0]] = sub, can.base.isFunc(cb)? cb(sub): sub.select()
|
||||||
}) })
|
}) })
|
||||||
},
|
},
|
||||||
sess: function(can, sess, cb) { sess = sess||can.base.Obj(can.misc.localStorage(can, "web.code.inner.sess"), {})
|
|
||||||
can.core.Next(sess.plug, function(item, next) { can.onimport.toolkit(can, {index: item}, function(sub) { can.toolkit[item] = sub, next() }) }, function() {
|
|
||||||
can.core.Next(sess.exts, function(item, next) { can.onimport.exts(can, item, next) }, function() {
|
|
||||||
var path = can.Option(nfs.PATH), file = can.Option(nfs.FILE), line = can.Option(nfs.LINE)
|
|
||||||
can.base.getValid(sess.tabs)? can.core.Next(sess.tabs, function(item, next) { var ls = item.split(ice.DF); can.onimport.tabview(can, ls[0], ls[1], ls[2], next) },
|
|
||||||
function() { can.onimport.tabview(can, path, file, line, cb) }): can.base.isFunc(cb) && cb()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}, [""])
|
}, [""])
|
||||||
Volcanos(chat.ONFIGURE, {
|
Volcanos(chat.ONFIGURE, {
|
||||||
source: function(can, target, zone, path) { var total = 0
|
source: function(can, target, zone, path) { var total = 0
|
||||||
function show(target, path) { can.run(can.request({}, {dir_root: path, dir_deep: true}), [nfs.PWD], function(msg) { var list = msg.Table()
|
function show(target, path) { can.run(can.request({}, {dir_root: path, dir_deep: true}), [nfs.PWD], function(msg) {
|
||||||
can.onimport.tree(can, list, nfs.PATH, ice.PS, function(event, item) { can.onimport.tabview(can, path, item.path) }, target)
|
can.onimport.tree(can, msg.Table(), nfs.PATH, ice.PS, function(event, item) { can.onimport.tabview(can, path, item.path) }, target)
|
||||||
can.Status("文件数", zone._total(total += msg.Length()))
|
can.Status("文件数", zone._total(total += msg.Length()))
|
||||||
}, true) }
|
}, true) }
|
||||||
|
|
||||||
@ -320,20 +226,14 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
|
|||||||
var p = cache_data[can.file]; if (p) { can.current = p.current, can.max = p.max }
|
var p = cache_data[can.file]; if (p) { can.current = p.current, can.max = p.max }
|
||||||
can.page.style(can, can.ui.profile, html.DISPLAY, p? p.profile_display: html.NONE)
|
can.page.style(can, can.ui.profile, html.DISPLAY, p? p.profile_display: html.NONE)
|
||||||
can.page.style(can, can.ui.display, html.DISPLAY, p? p.display_display: html.NONE)
|
can.page.style(can, can.ui.display, html.DISPLAY, p? p.display_display: html.NONE)
|
||||||
can.parse = can.base.Ext(can.file), can.Status("模式", "plugin")
|
can.parse = can.base.Ext(can.file), can.Status("模式", mdb.PLUGIN); return can.file
|
||||||
return can.file
|
}, can.ui._content, can.ui._profile, can.ui._display)) { return can.base.isFunc(cb) && cb(msg._content) }
|
||||||
}, can.ui._content, can.ui._profile_output, can.ui.display)) {
|
|
||||||
return can.base.isFunc(cb) && cb(msg._content)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg.Option(ctx.INDEX)) { return can.onsyntax._index(can, msg, cb) }
|
if (msg.Option(ctx.INDEX)) { return can.onsyntax._index(can, msg, cb) }
|
||||||
|
|
||||||
function init(p) {
|
function init(p) {
|
||||||
can.max = 0, can.core.List(can.ls = msg.Result().split(ice.NL), function(item) { can.onaction.appendLine(can, item) })
|
can.max = 0, can.core.List(can.ls = msg.Result().split(ice.NL), function(item) { can.onaction.appendLine(can, item) })
|
||||||
can.onaction.selectLine(can, can.Option(nfs.LINE)), can.current.scroll(can.current.scroll()-can.current.window()/2)
|
can.onaction.selectLine(can, can.Option(nfs.LINE)), can.current.scroll(can.current.scroll()-can.current.window()/4)
|
||||||
can.onengine.signal(can, "tabview.view.init", msg), can.base.isFunc(cb) && cb(msg._content = can.ui._content)
|
can.onengine.signal(can, "tabview.view.init", msg), can.base.isFunc(cb) && cb(msg._content = can.ui._content)
|
||||||
}
|
} can.require(["inner/syntax.js"], function() { can.Conf("plug") && (can.onsyntax[can.parse] = can.Conf("plug"))
|
||||||
can.require(["inner/syntax.js"], function() { can.Conf("plug") && (can.onsyntax[can.parse] = can.Conf("plug"))
|
|
||||||
var p = can.onsyntax[can.parse]; !p? can.runAction({}, mdb.PLUGIN, [can.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) {
|
var p = can.onsyntax[can.parse]; !p? can.runAction({}, mdb.PLUGIN, [can.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) {
|
||||||
init(p = can.onsyntax[can.parse] = can.base.Obj(msg.Result()||"{}"))
|
init(p = can.onsyntax[can.parse] = can.base.Obj(msg.Result()||"{}"))
|
||||||
}): init(p)
|
}): init(p)
|
||||||
@ -341,46 +241,38 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
|
|||||||
},
|
},
|
||||||
_index: function(can, msg, cb) {
|
_index: function(can, msg, cb) {
|
||||||
if (can.Option(nfs.LINE) == web.DREAM) {
|
if (can.Option(nfs.LINE) == web.DREAM) {
|
||||||
return can.base.isFunc(cb) && cb(msg._content = msg._content||can.page.insertBefore(can, [{type: html.IFRAME,
|
return can.base.isFunc(cb) && cb(msg._content = msg._content||can.page.insertBefore(can, [{view: [html.CONTENT, html.IFRAME],
|
||||||
src: can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)}), height: can.ui.content.offsetHeight-4, width: can.ui.content.offsetWidth}], can.ui._content))
|
src: can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)}), height: can.ui.content.offsetHeight, width: can.ui.content.offsetWidth}], can.ui._content))
|
||||||
}
|
} var meta = {index: msg.Option(ctx.INDEX), args: can.Option(nfs.PATH) == ctx.COMMAND && can.Option(nfs.LINE) != ctx.INDEX? [can.Option(nfs.LINE)]: []}
|
||||||
|
|
||||||
var meta = {index: msg.Option(ctx.INDEX), args: can.Option(nfs.PATH) == ctx.COMMAND && can.Option(nfs.LINE) != ctx.INDEX? [can.Option(nfs.LINE)]: []}
|
|
||||||
if (can.Option(nfs.LINE) == code.XTERM) {
|
|
||||||
meta = {index: "web.code.xterm", args: can.Option(nfs.FILE)}
|
|
||||||
} else {
|
|
||||||
can.onimport.layout(can)
|
|
||||||
}
|
|
||||||
|
|
||||||
return can.onimport.plug(can, meta, function(sub) {
|
return can.onimport.plug(can, meta, function(sub) {
|
||||||
sub.onimport.size(sub, sub.ConfHeight(can.ui.content.offsetHeight-html.ACTION_HEIGHT-sub.onexport.statusHeight(sub)), sub.ConfWidth(can.ui.content.offsetWidth), true)
|
|
||||||
msg._plugin = sub, can.base.isFunc(cb) && cb(msg._content = can.ui._content), can.onmotion.delay(can, function() { sub.Focus() })
|
|
||||||
sub.onaction.close = function() { can.onaction.back(can), msg._tab._close() }
|
sub.onaction.close = function() { can.onaction.back(can), msg._tab._close() }
|
||||||
sub.onimport.title = function(_, title) { can.page.Modify(can, msg._tab, title) }
|
sub.onimport.title = function(_, title) { can.page.Modify(can, msg._tab, title) }
|
||||||
sub.onimport._open = function(sub, msg, _arg) { var url = can.base.ParseURL(_arg), ls = url.origin.split("/chat/pod/")
|
sub.onimport._open = function(sub, msg, _arg) { var url = can.base.ParseURL(_arg), ls = url.origin.split("/chat/pod/")
|
||||||
if (_arg.indexOf(location.origin) == 0 && ls.length > 1) {
|
if (_arg.indexOf(location.origin) == 0 && ls.length > 1) {
|
||||||
return can.onimport.tabview(can, can.Option(nfs.PATH), ls[1].split(ice.PS)[0], web.DREAM), sub.Update()
|
return can.onimport.tabview(can, can.Option(nfs.PATH), ls[1].split(ice.PS)[0], web.DREAM), sub.Update()
|
||||||
}
|
} return can.user.open(_arg), sub.Update()
|
||||||
return can.user.open(_arg), sub.Update()
|
}, sub.onimport.size(sub, sub.ConfHeight(can.ui.content.offsetHeight-html.ACTION_HEIGHT-sub.onexport.statusHeight(sub)), sub.ConfWidth(can.ui.content.offsetWidth), true)
|
||||||
}
|
msg._plugin = sub, can.base.isFunc(cb) && cb(msg._content = can.ui._content), can.onmotion.delay(can, function() { sub.Focus() })
|
||||||
}, can.ui._content)
|
}, can.ui._content)
|
||||||
},
|
},
|
||||||
_parse: function(can, line) { line = can.page.replace(can, line||"")
|
_parse: function(can, line) { line = can.page.replace(can, line||"")
|
||||||
function wrap(text, type) { return can.page.Format(html.SPAN, text, type) }
|
function wrap(text, type) { return can.page.Format(html.SPAN, text, type) }
|
||||||
var p = can.onsyntax[can.parse]||{}; p = can.onsyntax[p.link]||p, p.split = p.split||{}
|
var p = can.onsyntax[can.parse]||{}; p = can.onsyntax[p.link]||p, p.split = p.split||{}
|
||||||
p.keyword && (line = can.core.List(can.core.Split(line, p.split.space||"\t ", p.split.operator||"{[(,:;!?|<*>)]}", {detail: true}), function(item, index, array) {
|
p.keyword && (line = can.core.List(can.core.Split(line, p.split.space||"\t ", p.split.operator||"{[(.,:;!?|&*/+-<=>)]}", {detail: true}), function(item, index, array) {
|
||||||
item = can.base.isObject(item)? item: {text: item}; var text = item.text, type = p.keyword[text]
|
item = can.base.isObject(item)? item: {text: item}; var text = item.text, type = p.keyword[text]
|
||||||
switch (item.type||type) {
|
switch (item.type||type) {
|
||||||
case html.SPACE: return text
|
case html.SPACE: return text
|
||||||
case lang.STRING: return wrap(item.left+text+item.right, lang.STRING)
|
case lang.STRING: return wrap(item.left+text+item.right, lang.STRING)
|
||||||
case code.COMMENT:
|
case code.COMMENT:
|
||||||
case code.KEYWORD:
|
case code.KEYWORD:
|
||||||
case code.CONSTANT:
|
case code.PACKAGE:
|
||||||
case code.DATATYPE:
|
case code.DATATYPE:
|
||||||
case code.FUNCTION: return wrap(text, type)
|
case code.FUNCTION:
|
||||||
|
case code.CONSTANT:
|
||||||
|
case code.OBJECT: return wrap(text, type)
|
||||||
default:
|
default:
|
||||||
var t = can.core.Item(p.regexp, function(reg, type) { var m = text.match(new RegExp(reg)); if (m && m.length > 0 && m[0] == text) { return type} })
|
var t = can.core.Item(p.regexp, function(reg, type) { var m = text.match(new RegExp(reg)); if (m && m.length > 0 && m[0] == text) { return type} })
|
||||||
return t && t.length > 0? wrap(text, t[0]): text
|
return t && t.length > 0? wrap(text, t[0]): type? wrap(text, type): text
|
||||||
}
|
}
|
||||||
}).join(""))
|
}).join(""))
|
||||||
p.prefix && can.core.Item(p.prefix, function(pre, type) { if (can.base.beginWith(line, pre)) { line = wrap(line, type) } })
|
p.prefix && can.core.Item(p.prefix, function(pre, type) { if (can.base.beginWith(line, pre)) { line = wrap(line, type) } })
|
||||||
@ -388,13 +280,13 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
|
|||||||
return line
|
return line
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {_trans: {link: "链接", width: "宽度", height: "高度"},
|
Volcanos(chat.ONACTION, {
|
||||||
appendLine: function(can, value) {
|
appendLine: function(can, value) {
|
||||||
var ui = can.page.Append(can, can.ui._content, [{type: html.TR, list: [
|
var ui = can.page.Append(can, can.ui._content, [{type: html.TR, list: [
|
||||||
{view: ["line unselectable", html.TD, ++can.max], onclick: function(event) {
|
{view: [[nfs.LINE, "unselectable"], html.TD, ++can.max], onclick: function(event) {
|
||||||
can.onaction.selectLine(can, ui.tr)
|
can.onaction.selectLine(can, ui.tr)
|
||||||
}, ondblclick: function(event) {
|
}, ondblclick: function(event) {
|
||||||
can.onaction.favorLine(event, can, ui.text.innerText)
|
can.onaction["查找"](event, can)
|
||||||
}},
|
}},
|
||||||
{view: [html.TEXT, html.TD, can.onsyntax._parse(can, value)], onclick: function(event) {
|
{view: [html.TEXT, html.TD, can.onsyntax._parse(can, value)], onclick: function(event) {
|
||||||
can.onaction.selectLine(can, ui.tr)
|
can.onaction.selectLine(can, ui.tr)
|
||||||
@ -406,12 +298,11 @@ Volcanos(chat.ONACTION, {_trans: {link: "链接", width: "宽度", height: "高
|
|||||||
]}]); return ui.tr
|
]}]); return ui.tr
|
||||||
},
|
},
|
||||||
selectLine: function(can, line) {
|
selectLine: function(can, line) {
|
||||||
if (!line) { return can.onexport.line(can, can.page.Select(can, can.ui._content, "tr.select")[0]) }
|
if (!line) { return can.onexport.line(can, can.page.SelectOne(can, can.ui._content, "tr.select")) }
|
||||||
can.page.Select(can, can.ui._content, "tr>td.line", function(td, index) { var tr = td.parentNode, n = parseInt(td.innerText)
|
can.page.Select(can, can.ui._content, "tr>td.line", function(td, index) { var tr = td.parentNode, n = parseInt(td.innerText)
|
||||||
if (!can.page.ClassList.set(can, tr, html.SELECT, tr == line || n == line)) { return }
|
if (!can.page.ClassList.set(can, tr, html.SELECT, tr == line || n == line)) { return }
|
||||||
line = tr, can.Status("当前行", can.onexport.position(can, can.Option(nfs.LINE, n)))
|
line = tr, can.Status("当前行", can.onexport.position(can, can.Option(nfs.LINE, n)))
|
||||||
}); if (!can.base.isObject(line)) { return 0 }
|
}); if (!can.base.isObject(line)) { return 0 }
|
||||||
|
|
||||||
can.page.Select(can, line, "td.text", function(item) {
|
can.page.Select(can, line, "td.text", function(item) {
|
||||||
can.current = {
|
can.current = {
|
||||||
window: function() { return parseInt(can.ui._content.offsetHeight/can.current.line.offsetHeight) },
|
window: function() { return parseInt(can.ui._content.offsetHeight/can.current.line.offsetHeight) },
|
||||||
@ -445,39 +336,32 @@ Volcanos(chat.ONACTION, {_trans: {link: "链接", width: "宽度", height: "高
|
|||||||
list.push({zone: "msg", type: typeof value, name: key, text: can.base.isObject(value)? "": (value+"").split(ice.NL)[0],
|
list.push({zone: "msg", type: typeof value, name: key, text: can.base.isObject(value)? "": (value+"").split(ice.NL)[0],
|
||||||
path: "usr/volcanos/", file: "lib/misc.js", line: 1,
|
path: "usr/volcanos/", file: "lib/misc.js", line: 1,
|
||||||
})
|
})
|
||||||
})
|
}), can.page._path = "/lib/page.js"
|
||||||
can.page._path = "/lib/page.js"
|
|
||||||
can.core.Item(can, function(zone, lib) { if (zone.indexOf("_") == 0) { return }
|
can.core.Item(can, function(zone, lib) { if (zone.indexOf("_") == 0) { return }
|
||||||
can.core.Item(lib, function(key, value) { if (!lib.hasOwnProperty(key)) { return }
|
can.core.Item(lib, function(key, value) { if (!lib.hasOwnProperty(key)) { return }
|
||||||
lib._path && list.push({zone: zone, type: typeof value, name: key, text: can.base.isObject(value)? "": (value+"").split(ice.NL)[0],
|
lib._path && list.push({zone: zone, type: typeof value, name: key, text: can.base.isObject(value)? "": (value+"").split(ice.NL)[0],
|
||||||
path: "usr/volcanos/", file: lib._path, line: 1,
|
path: "usr/volcanos/", file: lib._path, line: 1,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
}), can.runAction(can.request(event, {text: can.base.Format(list)}), button)
|
||||||
can.runAction(can.request(event, {text: can.base.Format(list)}), button)
|
|
||||||
},
|
},
|
||||||
sess: function(event, can) { can.onexport.sess(can), can.user.toastSuccess(can) },
|
|
||||||
back: function(can) { can.history.pop(); var last = can.history.pop(); last && can.onimport.tabview(can, last.path, last.file, last.line) },
|
back: function(can) { can.history.pop(); var last = can.history.pop(); last && can.onimport.tabview(can, last.path, last.file, last.line) },
|
||||||
show: function(event, can) {
|
show: function(event, can) {
|
||||||
if (can.base.Ext(can.Option(nfs.FILE)) == nfs.JS) { delete(Volcanos.meta.cache[can.base.Path("/require/", can.Option(nfs.PATH), can.Option(nfs.FILE))]) }
|
if (can.base.Ext(can.Option(nfs.FILE)) == nfs.JS) { delete(Volcanos.meta.cache[can.base.Path("/require/", can.Option(nfs.PATH), can.Option(nfs.FILE))]) }
|
||||||
can.runAction(can.request(event, {_toast: "渲染中..."}), mdb.RENDER, [can.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.profile(can, msg) })
|
can.runAction(can.request(event, {_toast: "渲染中..."}), mdb.RENDER, [can.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.profile(can, msg) })
|
||||||
},
|
},
|
||||||
exec: function(event, can) {
|
exec: function(event, can) {
|
||||||
|
if (can.base.Ext(can.Option(nfs.FILE)) == nfs.JS) { delete(Volcanos.meta.cache[can.base.Path("/require/", can.Option(nfs.PATH), can.Option(nfs.FILE))]) }
|
||||||
can.runAction(can.request(event, {_toast: "执行中..."}), mdb.ENGINE, [can.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.display(can, msg) })
|
can.runAction(can.request(event, {_toast: "执行中..."}), mdb.ENGINE, [can.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.display(can, msg) })
|
||||||
},
|
},
|
||||||
clear: function(event, can) {
|
clear: function(event, can) {
|
||||||
|
if (can.page.Select(can, can._root._target, "div.vimer.find.float", function(item) { return can.page.Remove(can, item) }).length > 0) { return }
|
||||||
if (can.page.Select(can, can._root._target, ".input.float", function(item) { return can.page.Remove(can, item) }).length > 0) { return }
|
if (can.page.Select(can, can._root._target, ".input.float", function(item) { return can.page.Remove(can, item) }).length > 0) { return }
|
||||||
if (can.page.Select(can, can._status, "legend.select", function(item) { return item.click(), item }).length > 0) { return }
|
if (can.page.Select(can, can._status, "legend.select", function(item) { return item.click(), item }).length > 0) { return }
|
||||||
if (can.ui.display.style.display == "") { return can.onmotion.hidden(can, can.ui.display), can.onimport.layout(can) }
|
if (can.ui.display.style.display == "") { return can.onmotion.hidden(can, can.ui.display), can.onimport.layout(can) }
|
||||||
if (can.ui.profile.style.display == "") { return can.onmotion.hidden(can, can.ui.profile), can.onimport.layout(can) }
|
if (can.ui.profile.style.display == "") { return can.onmotion.hidden(can, can.ui.profile), can.onimport.layout(can) }
|
||||||
if (can.page.Select(can, can._root._target, "div.vimer.find.float", function(item) { return can.page.Remove(can, item) }).length > 0) { return }
|
|
||||||
can.onmotion.toggle(can, can.ui.project), can.onimport.layout(can)
|
can.onmotion.toggle(can, can.ui.project), can.onimport.layout(can)
|
||||||
},
|
},
|
||||||
"搜索": function(event, can) {
|
|
||||||
can.user.input(event, can, [mdb.NAME, [ctx.ACTION, nfs.TAGS, cli.MAKE, nfs.GREP]], function(data) {
|
|
||||||
can.ui.search.Update({}, [ctx.ACTION, data.action, data.name])
|
|
||||||
})
|
|
||||||
},
|
|
||||||
"打开": function(event, can) {
|
"打开": function(event, can) {
|
||||||
can.page.style(can, can.user.input(can.request(event, {paths: can.sup.paths.join(ice.FS)}), can, [{name: nfs.FILE, style: {width: can.ui.content.offsetWidth/2}}], function(list) {
|
can.page.style(can, can.user.input(can.request(event, {paths: can.sup.paths.join(ice.FS)}), can, [{name: nfs.FILE, style: {width: can.ui.content.offsetWidth/2}}], function(list) {
|
||||||
var ls = can.core.Split(list[0], ice.DF, ice.DF); switch (ls[0]) {
|
var ls = can.core.Split(list[0], ice.DF, ice.DF); switch (ls[0]) {
|
||||||
@ -489,6 +373,57 @@ Volcanos(chat.ONACTION, {_trans: {link: "链接", width: "宽度", height: "高
|
|||||||
}
|
}
|
||||||
})._target, html.LEFT, can.ui.project.offsetWidth+can.ui.content.offsetWidth/4-34, html.TOP, can.ui.content.offsetHeight/4, html.RIGHT, "")
|
})._target, html.LEFT, can.ui.project.offsetWidth+can.ui.content.offsetWidth/4-34, html.TOP, can.ui.content.offsetHeight/4, html.RIGHT, "")
|
||||||
},
|
},
|
||||||
|
"查找": function(event, can) {
|
||||||
|
var ui = can.page.Append(can, can._output, [{view: "vimer find float", list: [html.ACTION, html.OUTPUT],
|
||||||
|
style: {left: can.ui.project.offsetWidth+can.ui.content.offsetWidth/2, top: can.ui.content.offsetHeight/4}}])
|
||||||
|
can.onmotion.delay(can, function() { can.page.style(can, ui._target, html.LEFT, can.ui.project.offsetWidth+can.ui.content.offsetWidth/2-ui._target.offsetWidth/2) }, 10)
|
||||||
|
can.onmotion.move(can, ui._target)
|
||||||
|
var last = can.onaction._getLineno(can, can.current.line)
|
||||||
|
function find(begin, text) { if (parseInt(text) > 0) { return can.onaction.selectLine(can, parseInt(text)) && meta.close() }
|
||||||
|
for (begin; begin <= can.max; begin++) {
|
||||||
|
if (can.onexport.text(can, can.onaction._getLine(can, begin)).indexOf(text) > -1) {
|
||||||
|
last = begin, can.onaction.selectLine(can, begin)
|
||||||
|
var scroll = can.current.scroll(); if (scroll < 3) { can.current.scroll(scroll-3) } else {
|
||||||
|
var window = can.current.window(); if (scroll > window-3) { can.current.scroll(scroll-window+3) }
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} last = 0, can.user.toast(can, "已经到最后一行")
|
||||||
|
}
|
||||||
|
function complete(target, button) {
|
||||||
|
can.onappend.figure(can, {action: "key", mode: chat.SIMPLE, _enter: function(event) {
|
||||||
|
if (event.ctrlKey) { meta.grep() } else { meta[button](), can.onmotion.delay(can, function() { target.focus() }) }
|
||||||
|
return true
|
||||||
|
}, run: function(event, cmds, cb) {
|
||||||
|
var msg = can.request(event); can.core.List(can.core.Split(can.current.text(), "\t \n{[(,:;=)]}", {detail: true}), function(value) {
|
||||||
|
if (can.base.isObject(value)) { if (value.type == html.SPACE) { return }
|
||||||
|
value.type == lang.STRING && msg.Push(mdb.VALUE, value.left+value.text+value.right), msg.Push(mdb.VALUE, value.text)
|
||||||
|
} else {
|
||||||
|
msg.Push(mdb.VALUE, value)
|
||||||
|
}
|
||||||
|
}), cb(msg)
|
||||||
|
}}, target)
|
||||||
|
}
|
||||||
|
var meta = can.onappend._action(can, [
|
||||||
|
{type: html.TEXT, name: "from", style: {width: 200}, _init: function(target) { from = target, complete(target, "find"), can.onmotion.delay(can, function() { target.focus() }) }},
|
||||||
|
"find", "grep",
|
||||||
|
{type: html.TEXT, name: "to", _init: function(target) { to = target, complete(target, "replace") }},
|
||||||
|
"replace", "close",
|
||||||
|
], ui.action, {_trans: {find: "查找", grep: "搜索", replace: "替换"},
|
||||||
|
find: function() { find(last+1, from.value) },
|
||||||
|
grep: function() { can.onimport.exts(can, "inner/search.js", function(sub) { meta.close(), sub.runAction(event, nfs.GREP, [from.value]) }) },
|
||||||
|
replace: function() { var text = can.current.text(), line = can.onaction._getLineno(can, can.current.line)
|
||||||
|
can.undo.push(function() { can.onaction.selectLine(can, line), can.onaction.modifyLine(can, line, text) })
|
||||||
|
can.current.text(text.replace(from.value, to.value))
|
||||||
|
can.current.text().indexOf(from.value) == -1 && meta.find()
|
||||||
|
}, close: function() { can.page.Remove(can, ui._target) },
|
||||||
|
}); var from, to
|
||||||
|
},
|
||||||
|
"搜索": function(event, can) {
|
||||||
|
can.user.input(event, can, [mdb.NAME, [ctx.ACTION, nfs.TAGS, cli.MAKE, nfs.GREP]], function(data) {
|
||||||
|
can.ui.search.Update({}, [ctx.ACTION, data.action, data.name])
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONEXPORT, {list: ["文件数", "解析器", "文件名", "当前行", "跳转数"],
|
Volcanos(chat.ONEXPORT, {list: ["文件数", "解析器", "文件名", "当前行", "跳转数"],
|
||||||
hash: function(can) { if (!can.isCmdMode()) { return }
|
hash: function(can) { if (!can.isCmdMode()) { return }
|
||||||
@ -498,14 +433,8 @@ Volcanos(chat.ONEXPORT, {list: ["文件数", "解析器", "文件名", "当前
|
|||||||
location.hash = list.join(ice.FS)
|
location.hash = list.join(ice.FS)
|
||||||
},
|
},
|
||||||
keys: function(can, path, file) { return [path||can.Option(nfs.PATH), file||can.Option(nfs.FILE)].join(ice.FS) },
|
keys: function(can, path, file) { return [path||can.Option(nfs.PATH), file||can.Option(nfs.FILE)].join(ice.FS) },
|
||||||
content: function(can) { return can.page.Select(can, can.ui.content, "td.text", function(item) { return item.innerText }).join(ice.NL) },
|
|
||||||
position: function(can, index, total) { total = total||can.max; return (parseInt(index))+ice.PS+parseInt(total)+" = "+parseInt((index)*100/total)+"%" },
|
|
||||||
text: function(can, line) { return can.core.Value(can.page.Select(can, line, "td.text")[0], "innerText") },
|
|
||||||
line: function(can, line) { return parseInt(can.core.Value(can.page.Select(can, line, "td.line")[0], "innerText")) },
|
line: function(can, line) { return parseInt(can.core.Value(can.page.Select(can, line, "td.line")[0], "innerText")) },
|
||||||
sess: function(can) { can.misc.localStorage(can, "web.code.inner.sess", {"plug": can.onexport.plug(can), "exts": can.onexport.exts(can), "tabs": can.onexport.tabs(can)}) },
|
position: function(can, index, total) { total = total||can.max; return (parseInt(index))+ice.PS+parseInt(total)+" = "+parseInt((index)*100/total)+"%" },
|
||||||
tabs: function(can) { return can.core.Item(can.tabview, function(key, msg) { return key+ice.DF+can.Option(nfs.LINE) }) },
|
|
||||||
plug: function(can) { return can.core.Item(can.toolkit) },
|
|
||||||
exts: function(can) { return can.core.Item(can.plugins) },
|
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONENGINE, {
|
Volcanos(chat.ONENGINE, {
|
||||||
listen: shy("监听事件", function(can, key, cb) { arguments.callee.meta[key] = (arguments.callee.meta[key]||[]).concat(cb) }),
|
listen: shy("监听事件", function(can, key, cb) { arguments.callee.meta[key] = (arguments.callee.meta[key]||[]).concat(cb) }),
|
||||||
@ -517,7 +446,6 @@ Volcanos(chat.ONKEYMAP, {
|
|||||||
v: shy("渲染界面", function(event, can) { can.onaction[ice.SHOW](event, can) }),
|
v: shy("渲染界面", function(event, can) { can.onaction[ice.SHOW](event, can) }),
|
||||||
r: shy("执行命令", function(event, can) { can.onaction[ice.EXEC](event, can) }),
|
r: shy("执行命令", function(event, can) { can.onaction[ice.EXEC](event, can) }),
|
||||||
f: shy("打开文件", function(event, can) { can.onaction["打开"](event, can) }),
|
f: shy("打开文件", function(event, can) { can.onaction["打开"](event, can) }),
|
||||||
|
|
||||||
x: shy("关闭标签", function(can) { can._tab._close() }),
|
x: shy("关闭标签", function(can) { can._tab._close() }),
|
||||||
h: shy("打开左边标签", function(can) { var next = can._tab.previousSibling; next && next.click() }),
|
h: shy("打开左边标签", function(can) { var next = can._tab.previousSibling; next && next.click() }),
|
||||||
l: shy("打开右边标签", function(can) { var next = can._tab.nextSibling; next && next.click() }),
|
l: shy("打开右边标签", function(can) { var next = can._tab.nextSibling; next && next.click() }),
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Volcanos(chat.ONPLUGIN, {_init: function(can, _sub, cb) { const SEARCH = "can.code.inner.search"; var history = []
|
Volcanos(chat.ONPLUGIN, {_init: function(can, _sub, cb) { const SEARCH = "can.code.inner.search"; var history = []
|
||||||
function highlight(value) { var sub = can.ui.search
|
function highlight(value) { var sub = can.ui.search
|
||||||
can.page.Select(can, sub._output, "tbody>tr", function(tr) {
|
can.page.Select(can, sub._output, html.TR, function(tr) {
|
||||||
can.page.ClassList.set(can, tr, html.HIDDEN, can.page.Select(can, tr, "td", function(td) { td._text = td._text||td.innerText
|
can.page.ClassList.set(can, tr, html.HIDDEN, can.page.Select(can, tr, html.TD, function(td) { td._text = td._text||td.innerText
|
||||||
if (td.innerText.indexOf(value) > -1) {
|
if (td.innerText.indexOf(value) > -1) {
|
||||||
td.innerHTML = td._text.replaceAll(value, "<span style='background-color:yellow;color:red;'>"+value+"</span>")
|
td.innerHTML = td._text.replaceAll(value, "<span style='background-color:yellow;color:red;'>"+value+"</span>")
|
||||||
return td
|
return td
|
||||||
@ -19,22 +19,18 @@ Volcanos(chat.ONPLUGIN, {_init: function(can, _sub, cb) { const SEARCH = "can.co
|
|||||||
}}
|
}}
|
||||||
}, sub._output), sub.onappend.board(sub, msg.Result()), sub.onappend._status(sub, msg.Option(ice.MSG_STATUS))
|
}, sub._output), sub.onappend.board(sub, msg.Result()), sub.onappend._status(sub, msg.Option(ice.MSG_STATUS))
|
||||||
!sub.page.ClassList.has(sub, sub._legend, html.SELECT) && sub.select(), sub.Focus(), sub.Option("word", word||msg._word||"")
|
!sub.page.ClassList.has(sub, sub._legend, html.SELECT) && sub.select(), sub.Focus(), sub.Option("word", word||msg._word||"")
|
||||||
can.onmotion.delay(can, function() {
|
can.onmotion.delay(can, function() { word && highlight(word) })
|
||||||
word && highlight(word)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
can.onengine.plugin(can, SEARCH, shy("搜索", {}, [
|
can.onengine.plugin(can, SEARCH, shy("搜索", {}, [
|
||||||
{type: "text", name: "main"},
|
"main", {name: "filter", _init: function(target) { target.onkeyup = function(event) { highlight(event.target.value) } }},
|
||||||
{type: "text", name: "filter", _init: function(target) {
|
"grep:button", "history", "last",
|
||||||
target.onkeyup = function(event) { highlight(event.target.value) }
|
], function(can, msg, cmds, cb) { can.misc.runAction(can, msg, cmds, cb, kit.Dict(
|
||||||
}},
|
|
||||||
"grep:button", "make", "history", "last"], function(can, msg, cmds, cb) { can.misc.runAction(can, msg, cmds, cb, kit.Dict(
|
|
||||||
"replace", function(cmds) { can.runAction(msg, nfs.GREP, [cmds[0]], function(msg) { show(msg, cmds[0]) }) },
|
|
||||||
nfs.GREP, function(cmds) { can.runAction(msg, nfs.GREP, [cmds[0]], function(msg) { show(msg, cmds[0]) }) },
|
nfs.GREP, function(cmds) { can.runAction(msg, nfs.GREP, [cmds[0]], function(msg) { show(msg, cmds[0]) }) },
|
||||||
"history", function(cmds) { can.core.List(can.history, function(item) { msg.PushRecord(item) }), show(msg) },
|
"history", function(cmds) { can.core.List(can.history, function(item) { msg.PushRecord(item) }), show(msg) },
|
||||||
"last", function(cmds) { history.pop(), show(history.pop()) },
|
"last", function(cmds) { history.pop(), show(history.pop()) },
|
||||||
)) })), can.onimport.toolkit(can, {index: SEARCH}, function(sub) {
|
)) }))
|
||||||
can.page.style(can, sub._output, html.MIN_WIDTH, 600)
|
can.onimport.toolkit(can, {index: SEARCH}, function(sub) {
|
||||||
can.ui.search = sub, sub._show = show, can.base.isFunc(cb) && cb(sub)
|
can.ui.search = sub, sub._show = show, can.base.isFunc(cb) && cb(sub)
|
||||||
|
can.page.style(can, sub._output, html.MIN_WIDTH, 600)
|
||||||
})
|
})
|
||||||
}})
|
}})
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
Volcanos(chat.ONSYNTAX, {
|
Volcanos(chat.ONSYNTAX, {
|
||||||
makefile: {
|
makefile: {
|
||||||
prefix: {
|
prefix: {"#": code.COMMENT},
|
||||||
"#": code.COMMENT,
|
suffix: {":": code.COMMENT},
|
||||||
},
|
|
||||||
suffix: {
|
|
||||||
":": code.COMMENT,
|
|
||||||
},
|
|
||||||
keyword: {
|
keyword: {
|
||||||
"ifeq": code.KEYWORD,
|
"ifeq": code.KEYWORD,
|
||||||
"ifneq": code.KEYWORD,
|
"ifneq": code.KEYWORD,
|
||||||
@ -28,16 +24,8 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"BUGS": code.KEYWORD,
|
"BUGS": code.KEYWORD,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
vimrc: {
|
|
||||||
link: "vim",
|
|
||||||
},
|
|
||||||
vim: {
|
vim: {
|
||||||
split: {
|
prefix: {"\"": "comment"},
|
||||||
operator: "{[(&.,;!|<>)]}",
|
|
||||||
},
|
|
||||||
prefix: {
|
|
||||||
"\"": "comment",
|
|
||||||
},
|
|
||||||
keyword: {
|
keyword: {
|
||||||
"source": code.KEYWORD,
|
"source": code.KEYWORD,
|
||||||
"finish": code.KEYWORD,
|
"finish": code.KEYWORD,
|
||||||
@ -78,10 +66,7 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"exists": code.FUNCTION,
|
"exists": code.FUNCTION,
|
||||||
"executable": code.FUNCTION,
|
"executable": code.FUNCTION,
|
||||||
},
|
},
|
||||||
},
|
}, vimrc: {link: "vim"},
|
||||||
h: {
|
|
||||||
link: "c",
|
|
||||||
},
|
|
||||||
c: {
|
c: {
|
||||||
prefix: {
|
prefix: {
|
||||||
"//": code.COMMENT,
|
"//": code.COMMENT,
|
||||||
@ -156,19 +141,12 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"1": code.CONSTANT,
|
"1": code.CONSTANT,
|
||||||
"2": code.CONSTANT,
|
"2": code.CONSTANT,
|
||||||
},
|
},
|
||||||
},
|
}, h: {link: "c"},
|
||||||
sh: {
|
sh: {
|
||||||
split: {
|
prefix: {"#": code.COMMENT},
|
||||||
operator: "=()|><;",
|
suffix: {" {": code.COMMENT},
|
||||||
},
|
|
||||||
prefix: {
|
|
||||||
"#": code.COMMENT,
|
|
||||||
},
|
|
||||||
suffix: {
|
|
||||||
" {": code.COMMENT,
|
|
||||||
},
|
|
||||||
regexp: {
|
regexp: {
|
||||||
"[A-Z0-9_] ": code.CONSTANT,
|
"[A-Z0-9_]+": code.CONSTANT,
|
||||||
},
|
},
|
||||||
keyword: {
|
keyword: {
|
||||||
"local": code.KEYWORD,
|
"local": code.KEYWORD,
|
||||||
@ -223,9 +201,7 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
},
|
},
|
||||||
}, configure: {link: "sh"},
|
}, configure: {link: "sh"},
|
||||||
shy: {
|
shy: {
|
||||||
prefix: {
|
prefix: {"#": code.COMMENT},
|
||||||
"#": code.COMMENT,
|
|
||||||
},
|
|
||||||
keyword: {
|
keyword: {
|
||||||
"source": code.KEYWORD,
|
"source": code.KEYWORD,
|
||||||
"return": code.KEYWORD,
|
"return": code.KEYWORD,
|
||||||
@ -253,30 +229,23 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"import": code.KEYWORD,
|
"import": code.KEYWORD,
|
||||||
"from": code.KEYWORD,
|
"from": code.KEYWORD,
|
||||||
"return": code.KEYWORD,
|
"return": code.KEYWORD,
|
||||||
|
|
||||||
"print": code.FUNCTION,
|
"print": code.FUNCTION,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
go: {
|
go: {
|
||||||
split: {
|
prefix: {"//": code.COMMENT},
|
||||||
operator: "{([- :;!.,*])}",
|
|
||||||
},
|
|
||||||
regexp: {
|
regexp: {
|
||||||
"[0-9] ": code.CONSTANT,
|
"[A-Z_0-9]+": code.CONSTANT,
|
||||||
"[A-Z_0-9] ": code.CONSTANT,
|
|
||||||
},
|
|
||||||
prefix: {
|
|
||||||
"//": code.COMMENT,
|
|
||||||
},
|
},
|
||||||
keyword: {
|
keyword: {
|
||||||
"package": code.KEYWORD,
|
"package": code.KEYWORD,
|
||||||
"import": code.KEYWORD,
|
"import": code.KEYWORD,
|
||||||
|
"const": code.KEYWORD,
|
||||||
"type": code.KEYWORD,
|
"type": code.KEYWORD,
|
||||||
"struct": code.KEYWORD,
|
"struct": code.KEYWORD,
|
||||||
"interface": code.KEYWORD,
|
"interface": code.KEYWORD,
|
||||||
"const": code.KEYWORD,
|
|
||||||
"var": code.KEYWORD,
|
|
||||||
"func": code.KEYWORD,
|
"func": code.KEYWORD,
|
||||||
|
"var": code.KEYWORD,
|
||||||
|
|
||||||
"if": code.KEYWORD,
|
"if": code.KEYWORD,
|
||||||
"else": code.KEYWORD,
|
"else": code.KEYWORD,
|
||||||
@ -293,61 +262,35 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"defer": code.KEYWORD,
|
"defer": code.KEYWORD,
|
||||||
"return": code.KEYWORD,
|
"return": code.KEYWORD,
|
||||||
|
|
||||||
"false": code.CONSTANT,
|
|
||||||
"true": code.CONSTANT,
|
|
||||||
"nil": code.CONSTANT,
|
|
||||||
"iota": code.CONSTANT,
|
|
||||||
"-1": code.CONSTANT,
|
|
||||||
"0": code.CONSTANT,
|
|
||||||
"1": code.CONSTANT,
|
|
||||||
"2": code.CONSTANT,
|
|
||||||
"3": code.CONSTANT,
|
|
||||||
|
|
||||||
"int": code.DATATYPE, "int8": code.DATATYPE, "int16": code.DATATYPE, "int32": code.DATATYPE, "int64": code.DATATYPE,
|
"int": code.DATATYPE, "int8": code.DATATYPE, "int16": code.DATATYPE, "int32": code.DATATYPE, "int64": code.DATATYPE,
|
||||||
"uint": code.DATATYPE, "uint8": code.DATATYPE, "uint16": code.DATATYPE, "uint32": code.DATATYPE, "uint64": code.DATATYPE,
|
"uint": code.DATATYPE, "uint8": code.DATATYPE, "uint16": code.DATATYPE, "uint32": code.DATATYPE, "uint64": code.DATATYPE,
|
||||||
"float32": code.DATATYPE, "float64": code.DATATYPE, "complex64": code.DATATYPE, "complex128": code.DATATYPE,
|
"float32": code.DATATYPE, "float64": code.DATATYPE, "complex64": code.DATATYPE, "complex128": code.DATATYPE,
|
||||||
"rune": code.DATATYPE, "string": code.DATATYPE, "byte": code.DATATYPE, "uintptr": code.DATATYPE,
|
"rune": code.DATATYPE, "string": code.DATATYPE, "byte": code.DATATYPE, "uintptr": code.DATATYPE,
|
||||||
"bool": code.DATATYPE, "error": code.DATATYPE, "chan": code.DATATYPE, "map": code.DATATYPE,
|
"bool": code.DATATYPE, "error": code.DATATYPE, "chan": code.DATATYPE, "map": code.DATATYPE,
|
||||||
"Any": code.DATATYPE, "Map": code.DATATYPE, "Maps": code.DATATYPE,
|
|
||||||
"Message": code.DATATYPE,
|
|
||||||
|
|
||||||
"msg": code.FUNCTION, "m": code.FUNCTION,
|
|
||||||
"ice": code.FUNCTION, "kit": code.FUNCTION,
|
|
||||||
"init": code.FUNCTION, "main": code.FUNCTION, "print": code.FUNCTION, "println": code.FUNCTION, "panic": code.FUNCTION, "recover": code.FUNCTION,
|
"init": code.FUNCTION, "main": code.FUNCTION, "print": code.FUNCTION, "println": code.FUNCTION, "panic": code.FUNCTION, "recover": code.FUNCTION,
|
||||||
"new": code.FUNCTION, "make": code.FUNCTION, "len": code.FUNCTION, "cap": code.FUNCTION, "copy": code.FUNCTION, "append": code.FUNCTION, "delete": code.FUNCTION, "close": code.FUNCTION,
|
"new": code.FUNCTION, "make": code.FUNCTION, "len": code.FUNCTION, "cap": code.FUNCTION, "copy": code.FUNCTION, "append": code.FUNCTION, "delete": code.FUNCTION, "close": code.FUNCTION,
|
||||||
"complex": code.FUNCTION, "real": code.FUNCTION, "imag": code.FUNCTION,
|
"complex": code.FUNCTION, "real": code.FUNCTION, "imag": code.FUNCTION,
|
||||||
|
|
||||||
|
"iota": code.CONSTANT, "true": code.CONSTANT, "false": code.CONSTANT, "nil": code.CONSTANT,
|
||||||
|
|
||||||
|
"kit": code.PACKAGE, "ice": code.PACKAGE,
|
||||||
|
"Any": code.DATATYPE, "Map": code.DATATYPE, "Maps": code.DATATYPE, "Message": code.DATATYPE,
|
||||||
|
"m": code.OBJECT, "msg": code.OBJECT,
|
||||||
},
|
},
|
||||||
},
|
}, godoc: {link: "go"},
|
||||||
godoc: {
|
|
||||||
render: {},
|
|
||||||
link: "go",
|
|
||||||
},
|
|
||||||
mod: {
|
mod: {
|
||||||
split: {
|
prefix: {"//": code.COMMENT},
|
||||||
operator: "()",
|
|
||||||
},
|
|
||||||
prefix: {
|
|
||||||
"//": code.COMMENT,
|
|
||||||
},
|
|
||||||
keyword: {
|
keyword: {
|
||||||
"go": code.KEYWORD,
|
"go": code.KEYWORD,
|
||||||
"module": code.KEYWORD,
|
"module": code.KEYWORD,
|
||||||
"require": code.KEYWORD,
|
"require": code.KEYWORD,
|
||||||
"replace": code.KEYWORD,
|
"replace": code.KEYWORD,
|
||||||
"=>": code.KEYWORD,
|
|
||||||
},
|
},
|
||||||
},
|
}, sum: {},
|
||||||
sum: {
|
|
||||||
},
|
|
||||||
js: {
|
js: {
|
||||||
split: {
|
prefix: {"// ": code.COMMENT},
|
||||||
operator: "{[(.,:;!?|&<*>=+/- )]}",
|
|
||||||
},
|
|
||||||
prefix: {
|
|
||||||
"// ": code.COMMENT,
|
|
||||||
},
|
|
||||||
regexp: {
|
regexp: {
|
||||||
// "can.*": code.FUNCTION,
|
|
||||||
"[A-Z_0-9]+": code.CONSTANT,
|
"[A-Z_0-9]+": code.CONSTANT,
|
||||||
},
|
},
|
||||||
keyword: {
|
keyword: {
|
||||||
@ -436,16 +379,13 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"cb": code.FUNCTION,
|
"cb": code.FUNCTION,
|
||||||
"Volcanos": code.FUNCTION,
|
"Volcanos": code.FUNCTION,
|
||||||
},
|
},
|
||||||
},
|
}, json: {},
|
||||||
json: {
|
|
||||||
},
|
|
||||||
css: {
|
css: {
|
||||||
split: {
|
split: {operator: "{[(.,:;&>)]}"},
|
||||||
operator: ".[]()>,{:;}",
|
|
||||||
},
|
|
||||||
regexp: {
|
regexp: {
|
||||||
"[-0-9] px": code.CONSTANT,
|
"[-0-9]+px": code.CONSTANT,
|
||||||
"#[^ ;] ": code.CONSTANT,
|
"[-0-9]+": code.CONSTANT,
|
||||||
|
"#[^ ;]+": code.CONSTANT,
|
||||||
},
|
},
|
||||||
prefix: {
|
prefix: {
|
||||||
"// ": code.COMMENT,
|
"// ": code.COMMENT,
|
||||||
@ -475,6 +415,7 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
|
|
||||||
"hover": code.DATATYPE,
|
"hover": code.DATATYPE,
|
||||||
"focus": code.DATATYPE,
|
"focus": code.DATATYPE,
|
||||||
|
"not": code.DATATYPE,
|
||||||
|
|
||||||
"background-color": code.FUNCTION,
|
"background-color": code.FUNCTION,
|
||||||
"font-family": code.FUNCTION,
|
"font-family": code.FUNCTION,
|
||||||
@ -519,6 +460,11 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"margin-right": code.FUNCTION,
|
"margin-right": code.FUNCTION,
|
||||||
"margin-bottom": code.FUNCTION,
|
"margin-bottom": code.FUNCTION,
|
||||||
"box-shadow": code.FUNCTION,
|
"box-shadow": code.FUNCTION,
|
||||||
|
"outline": code.FUNCTION,
|
||||||
|
"caret-color": code.FUNCTION,
|
||||||
|
|
||||||
|
"calc": code.FUNCTION,
|
||||||
|
"url": code.FUNCTION,
|
||||||
|
|
||||||
"0": code.CONSTANT,
|
"0": code.CONSTANT,
|
||||||
"cyan": code.CONSTANT,
|
"cyan": code.CONSTANT,
|
||||||
@ -534,6 +480,15 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"cadetblue": code.CONSTANT,
|
"cadetblue": code.CONSTANT,
|
||||||
"darkcyan": code.CONSTANT,
|
"darkcyan": code.CONSTANT,
|
||||||
"skyblue": code.CONSTANT,
|
"skyblue": code.CONSTANT,
|
||||||
|
"lightgreen": code.CONSTANT,
|
||||||
|
"teal": code.CONSTANT,
|
||||||
|
"cornflowerblue": code.CONSTANT,
|
||||||
|
"whitesmoke": code.CONSTANT,
|
||||||
|
"lightgray": code.CONSTANT,
|
||||||
|
"royalblue": code.CONSTANT,
|
||||||
|
"lightblue": code.CONSTANT,
|
||||||
|
"darkblue": code.CONSTANT,
|
||||||
|
"aliceblue": code.CONSTANT,
|
||||||
|
|
||||||
"monospace": code.CONSTANT,
|
"monospace": code.CONSTANT,
|
||||||
"hidden": code.CONSTANT,
|
"hidden": code.CONSTANT,
|
||||||
@ -553,13 +508,7 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"fixed": code.CONSTANT,
|
"fixed": code.CONSTANT,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
iml: {
|
|
||||||
render: {},
|
|
||||||
},
|
|
||||||
html: {
|
html: {
|
||||||
split: {
|
|
||||||
operator: "</>=!&;",
|
|
||||||
},
|
|
||||||
keyword: {
|
keyword: {
|
||||||
"DOCTYPE": code.KEYWORD,
|
"DOCTYPE": code.KEYWORD,
|
||||||
"html": code.KEYWORD,
|
"html": code.KEYWORD,
|
||||||
@ -583,8 +532,69 @@ Volcanos(chat.ONSYNTAX, {
|
|||||||
"ul": code.KEYWORD,
|
"ul": code.KEYWORD,
|
||||||
"ol": code.KEYWORD,
|
"ol": code.KEYWORD,
|
||||||
"li": code.KEYWORD,
|
"li": code.KEYWORD,
|
||||||
|
"dl": code.KEYWORD,
|
||||||
|
"dt": code.KEYWORD,
|
||||||
|
"dd": code.KEYWORD,
|
||||||
|
"br": code.KEYWORD,
|
||||||
|
"hr": code.KEYWORD,
|
||||||
|
"blockquote": code.KEYWORD,
|
||||||
|
"q": code.KEYWORD,
|
||||||
|
"cite": code.KEYWORD,
|
||||||
|
"abbr": code.KEYWORD,
|
||||||
|
"address": code.KEYWORD,
|
||||||
|
"sub": code.KEYWORD,
|
||||||
|
"sup": code.KEYWORD,
|
||||||
|
"pre": code.KEYWORD,
|
||||||
|
"code": code.KEYWORD,
|
||||||
|
"var": code.KEYWORD,
|
||||||
|
"kbd": code.KEYWORD,
|
||||||
|
"samp": code.KEYWORD,
|
||||||
|
"time": code.KEYWORD,
|
||||||
|
"header": code.KEYWORD,
|
||||||
|
"nav": code.KEYWORD,
|
||||||
|
"main": code.KEYWORD,
|
||||||
|
"aside": code.KEYWORD,
|
||||||
|
"footer": code.KEYWORD,
|
||||||
|
"article": code.KEYWORD,
|
||||||
|
"section": code.KEYWORD,
|
||||||
|
"span": code.KEYWORD,
|
||||||
|
"div": code.KEYWORD,
|
||||||
|
"img": code.KEYWORD,
|
||||||
|
"video": code.KEYWORD,
|
||||||
|
"audio": code.KEYWORD,
|
||||||
|
"source": code.KEYWORD,
|
||||||
|
"muted": code.FUNCTION,
|
||||||
|
"autoplay": code.FUNCTION,
|
||||||
|
"loop": code.FUNCTION,
|
||||||
|
"controls": code.FUNCTION,
|
||||||
|
"iframe": code.KEYWORD,
|
||||||
|
|
||||||
|
"svg": code.KEYWORD,
|
||||||
|
"rect": code.KEYWORD,
|
||||||
|
"circle": code.KEYWORD,
|
||||||
|
"fill": code.FUNCTION,
|
||||||
|
"x": code.FUNCTION,
|
||||||
|
"y": code.FUNCTION,
|
||||||
|
"r": code.FUNCTION,
|
||||||
|
|
||||||
|
"table": code.KEYWORD,
|
||||||
|
"tr": code.KEYWORD,
|
||||||
|
"th": code.KEYWORD,
|
||||||
|
"td": code.KEYWORD,
|
||||||
|
"colgroup": code.KEYWORD,
|
||||||
|
"col": code.KEYWORD,
|
||||||
|
"thead": code.KEYWORD,
|
||||||
|
"tbody": code.KEYWORD,
|
||||||
|
"tfoot": code.KEYWORD,
|
||||||
|
"colspan": code.FUNCTION,
|
||||||
|
"rowspan": code.FUNCTION,
|
||||||
|
|
||||||
"href": code.FUNCTION,
|
"href": code.FUNCTION,
|
||||||
"rel": code.FUNCTION,
|
"rel": code.FUNCTION,
|
||||||
|
"src": code.FUNCTION,
|
||||||
|
"style": code.FUNCTION,
|
||||||
|
"width": code.FUNCTION,
|
||||||
|
"height": code.FUNCTION,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
zml: {
|
zml: {
|
||||||
|
@ -1,48 +1,14 @@
|
|||||||
fieldset.vimer>div.output input.current {
|
fieldset.vimer>div.output input.current {
|
||||||
background-color:#00000000; color:#00000000; font-size:1em; font-family:monospace;
|
background-color:#00000000; color:#00000000; font-family:monospace;
|
||||||
padding:0; padding-left:12px; border:none; outline:none; margin:0; margin-top:-3px;
|
padding-left:12px; border:none; outline:none; margin-top:-1px; height:22px; position:absolute;
|
||||||
height:22px; position:absolute;
|
|
||||||
}
|
}
|
||||||
fieldset.vimer>div.output input.current.normal { caret-color:gray; }
|
fieldset.vimer>div.output input.current.normal { caret-color:gray; }
|
||||||
fieldset.vimer>div.output input.current.insert { caret-color:yellow; }
|
fieldset.vimer>div.output input.current.insert { caret-color:yellow; }
|
||||||
|
fieldset.vimer>div.output div.complete { overflow:auto; position:absolute; display:none; }
|
||||||
fieldset.vimer>div.output div.complete {
|
fieldset.vimer>div.output div.complete.insert { display:block; }
|
||||||
height:20px; position:absolute; left:32px; margin-top:20px;
|
fieldset.vimer>div.output div.complete div.pre { color:#00000000; margin-left:5px; float:left; }
|
||||||
display:none;
|
fieldset.vimer>div.output div.complete table { background-color:darkblue; }
|
||||||
}
|
fieldset.vimer>div.output div.complete table.content thead { display:none; }
|
||||||
fieldset.vimer>div.output div.complete.insert {
|
|
||||||
display:block;
|
|
||||||
}
|
|
||||||
fieldset.vimer>div.output div.complete div.pre {
|
|
||||||
font-size:1.1rem; color:#f0f8ff00; margin-left:5px; float:left;
|
|
||||||
}
|
|
||||||
fieldset.vimer>div.output div.complete table {
|
|
||||||
background-color:darkblue; max-height:400px; max-width:800px; overflow:auto; display:block; float:left;
|
|
||||||
}
|
|
||||||
body.white fieldset.vimer>div.output div.complete table {
|
|
||||||
background-color:aliceblue; max-height:400px; max-width:800px; overflow:auto; display:block; float:left;
|
|
||||||
}
|
|
||||||
fieldset.vimer>div.output div.complete table.content th {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
fieldset.vimer>div.output div.complete table.content td {
|
|
||||||
font-size:1.1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.simple fieldset.vimer>div.output div.complete div.pre {
|
|
||||||
font-size:1rem;
|
|
||||||
}
|
|
||||||
body.simple fieldset.vimer>div.output div.complete table.content td {
|
|
||||||
font-size:1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.simple fieldset.vimer>div.output input.current {
|
|
||||||
margin-top:1px;
|
|
||||||
}
|
|
||||||
body.white fieldset.vimer>div.output input.current.insert { caret-color:black; }
|
body.white fieldset.vimer>div.output input.current.insert { caret-color:black; }
|
||||||
body.white fieldset.vimer>div.output input.current.normal { caret-color:lightgray; }
|
body.white fieldset.vimer>div.output input.current.normal { caret-color:lightgray; }
|
||||||
|
body.white fieldset.vimer>div.output div.complete table { background-color:aliceblue; }
|
||||||
div.project div.zone.create>div.list div.item { padding:2px; float:left; clear:none; }
|
|
||||||
div.project div.zone.create>div.list div.item input { font-family:monospace; }
|
|
||||||
body.webview div.project div.zone.create>div.list div.item { padding:2px; }
|
|
||||||
div.project div.zone.create>div.action { display:none; }
|
|
||||||
|
@ -182,59 +182,6 @@ Volcanos(chat.ONACTION, {
|
|||||||
},
|
},
|
||||||
favor: function(event, can) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.code.favor", ctx.INDEX) },
|
favor: function(event, can) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.code.favor", ctx.INDEX) },
|
||||||
git: function(event, can) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.code.git.status", ctx.INDEX) },
|
git: function(event, can) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.code.git.status", ctx.INDEX) },
|
||||||
"查找": function(event, can) {
|
|
||||||
var ui = can.page.Append(can, can._output, [{view: "vimer find float", list: [html.ACTION, html.OUTPUT],
|
|
||||||
style: {position: "absolute", left: can.ui.project.offsetWidth+can.ui.content.offsetWidth/2, top: can.base.Max(can.base.Min(can.current.line.offsetTop-can.ui.content.scrollTop, 100), can.ConfHeight()/2)+57+28}}])
|
|
||||||
can.onmotion.delay(can, function() { can.page.style(can, ui._target, html.LEFT, can.ui.project.offsetWidth+can.ui.content.offsetWidth/2-ui._target.offsetWidth/2) }, 10)
|
|
||||||
can.onmotion.move(can, ui._target)
|
|
||||||
|
|
||||||
var last = can.onaction._getLineno(can, can.current.line)
|
|
||||||
function find(begin, text) { if (parseInt(text) > 0) { return can.onaction.selectLine(can, parseInt(text)) && meta.close() }
|
|
||||||
for (begin; begin <= can.max; begin++) {
|
|
||||||
if (can.onexport.text(can, can.onaction._getLine(can, begin)).indexOf(text) > -1) {
|
|
||||||
return last = begin, can.onaction.selectLine(can, begin), can.current.scroll(can.current.scroll()-5)
|
|
||||||
}
|
|
||||||
} last = 0, can.user.toast(can, "已经到最后一行")
|
|
||||||
}
|
|
||||||
function complete(target, button) {
|
|
||||||
can.onappend.figure(can, {action: "key", mode: chat.SIMPLE, _enter: function(event) {
|
|
||||||
if (event.ctrlKey) { meta.grep() } else {
|
|
||||||
meta[button](), can.onmotion.delay(can, function() { target.focus() })
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}, run: function(event, cmds, cb) {
|
|
||||||
var msg = can.request(event); can.core.List(can.core.Split(can.current.text(), "\t \n{[(:=,)]}", {detail: true}), function(value) {
|
|
||||||
if (can.base.isObject(value)) { if (value.type == html.SPACE) { return }
|
|
||||||
value.type == lang.STRING && msg.Push(mdb.VALUE, value.left+value.text+value.right)
|
|
||||||
msg.Push(mdb.VALUE, value.text)
|
|
||||||
} else {
|
|
||||||
msg.Push(mdb.VALUE, value)
|
|
||||||
}
|
|
||||||
}), cb(msg)
|
|
||||||
}}, target)
|
|
||||||
}
|
|
||||||
var from, to
|
|
||||||
var meta = can.onappend._action(can, [
|
|
||||||
{type: html.TEXT, name: "from", style: {width: 200}, _init: function(target) { from = target, complete(target, "find"), can.onmotion.delay(can, function() { target.focus() }) }},
|
|
||||||
"find", "grep",
|
|
||||||
{type: html.TEXT, name: "to", _init: function(target) { to = target, complete(target, "replace") }},
|
|
||||||
"replace",
|
|
||||||
"close",
|
|
||||||
], ui.action, {
|
|
||||||
find: function() { find(last+1, from.value) },
|
|
||||||
grep: function() {
|
|
||||||
can.onimport.exts(can, "inner/search.js", function(sub) { meta.close()
|
|
||||||
sub.runAction(event, nfs.GREP, [from.value])
|
|
||||||
})
|
|
||||||
},
|
|
||||||
replace: function() {
|
|
||||||
var text = can.current.text(), line = can.onaction._getLineno(can, can.current.line)
|
|
||||||
can.undo.push(function() { can.onaction.selectLine(can, line), can.onaction.modifyLine(can, line, text) })
|
|
||||||
can.current.text(text.replace(from.value, to.value))
|
|
||||||
can.current.text().indexOf(from.value) == -1 && meta.find() },
|
|
||||||
close: function() { can.page.Remove(can, ui._target) },
|
|
||||||
})
|
|
||||||
},
|
|
||||||
"收藏": function(event, can) { can.onaction._open(can, location.protocol+"//"+location.host+"/chat/cmd/web.chat.favor") },
|
"收藏": function(event, can) { can.onaction._open(can, location.protocol+"//"+location.host+"/chat/cmd/web.chat.favor") },
|
||||||
"首页": function(event, can) { can.onaction._open(can, location.protocol+"//"+location.host) },
|
"首页": function(event, can) { can.onaction._open(can, location.protocol+"//"+location.host) },
|
||||||
"官网": function(event, can) { can.onaction._open(can, "https://shylinux.com/") },
|
"官网": function(event, can) { can.onaction._open(can, "https://shylinux.com/") },
|
||||||
@ -290,7 +237,7 @@ Volcanos(chat.ONACTION, {
|
|||||||
type = can.base.trimSuffix(type, ice.PT)
|
type = can.base.trimSuffix(type, ice.PT)
|
||||||
|
|
||||||
function update() { target._pre = pre, target._index = -1
|
function update() { target._pre = pre, target._index = -1
|
||||||
can.current.line.appendChild(target), can.page.style(can, target, html.LEFT, can.ui.current.offsetLeft-1, html.MARGIN_TOP, can.ui.current.offsetHeight+4)
|
can.current.line.appendChild(target), can.page.style(can, target, html.LEFT, can.ui.current.offsetLeft-1, html.MARGIN_TOP, can.ui.current.offsetHeight-1)
|
||||||
can.runAction(can.request(event, {text: pre}, can.Option()), code.COMPLETE, [], function(msg) {
|
can.runAction(can.request(event, {text: pre}, can.Option()), code.COMPLETE, [], function(msg) {
|
||||||
can.page.Appends(can, target, [{view: [PRE, html.DIV, pre]}])
|
can.page.Appends(can, target, [{view: [PRE, html.DIV, pre]}])
|
||||||
can.onappend.table(can, msg, function(value, key, index) { return {text: [value, html.TD], onclick: function(event) {
|
can.onappend.table(can, msg, function(value, key, index) { return {text: [value, html.TD], onclick: function(event) {
|
||||||
@ -298,6 +245,7 @@ Volcanos(chat.ONACTION, {
|
|||||||
can.current.text(can.ui.current.value = left+can.ui.current.value.slice(can.ui.current.selectionEnd))
|
can.current.text(can.ui.current.value = left+can.ui.current.value.slice(can.ui.current.selectionEnd))
|
||||||
can.ui.current.focus(), can.ui.content.scrollLeft -= 10000, can.ui.current.setSelectionRange(left.length, left.length)
|
can.ui.current.focus(), can.ui.content.scrollLeft -= 10000, can.ui.current.setSelectionRange(left.length, left.length)
|
||||||
}} }, target)
|
}} }, target)
|
||||||
|
can.page.style(can, target, html.MAX_HEIGHT, can.ui._content.offsetHeight-(can.current.line.offsetTop-can.ui.content.scrollTop)-can.current.line.offsetHeight)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function filter() {
|
function filter() {
|
||||||
@ -520,6 +468,10 @@ Volcanos(chat.ONKEYMAP, {
|
|||||||
},
|
},
|
||||||
}, _engine: {},
|
}, _engine: {},
|
||||||
})
|
})
|
||||||
|
Volcanos(chat.ONEXPORT, {
|
||||||
|
content: function(can) { return can.page.Select(can, can.ui.content, "td.text", function(item) { return item.innerText }).join(ice.NL) },
|
||||||
|
text: function(can, line) { return can.core.Value(can.page.Select(can, line, "td.text")[0], "innerText") },
|
||||||
|
})
|
||||||
Volcanos(chat.ONPLUGIN, {
|
Volcanos(chat.ONPLUGIN, {
|
||||||
"code.vimer.keymap": shy("按键", {}, ["mode", "key", ice.LIST, ice.BACK], function(can, msg, cmds) {
|
"code.vimer.keymap": shy("按键", {}, ["mode", "key", ice.LIST, ice.BACK], function(can, msg, cmds) {
|
||||||
can.core.Item(can.onkeymap._mode, function(mode, value) {
|
can.core.Item(can.onkeymap._mode, function(mode, value) {
|
||||||
|
11
proto.js
11
proto.js
@ -115,6 +115,7 @@ var nfs = {
|
|||||||
HTML: "html", CSS: "css", JS: "js", GO: "go", SH: "sh", CSV: "csv", JSON: "json",
|
HTML: "html", CSS: "css", JS: "js", GO: "go", SH: "sh", CSV: "csv", JSON: "json",
|
||||||
ZML: "zml", IML: "iml", TXT: "txt", PNG: "png", WEBM: "webm",
|
ZML: "zml", IML: "iml", TXT: "txt", PNG: "png", WEBM: "webm",
|
||||||
_CSS: ".css", _JS: ".js",
|
_CSS: ".css", _JS: ".js",
|
||||||
|
REPOS: "repos",
|
||||||
}
|
}
|
||||||
var cli = {
|
var cli = {
|
||||||
PWD: "pwd", SYSTEM: "system", DAEMON: "daemon", ORDER: "order", BUILD: "build",
|
PWD: "pwd", SYSTEM: "system", DAEMON: "daemon", ORDER: "order", BUILD: "build",
|
||||||
@ -130,7 +131,7 @@ var log = {
|
|||||||
var code = {
|
var code = {
|
||||||
FAVOR: "favor", XTERM: "xterm", INNER: "inner", VIMER: "vimer",
|
FAVOR: "favor", XTERM: "xterm", INNER: "inner", VIMER: "vimer",
|
||||||
WEBPACK: "webpack", BINPACK: "binpack", AUTOGEN: "autogen", COMPILE: "compile", PUBLISH: "publish",
|
WEBPACK: "webpack", BINPACK: "binpack", AUTOGEN: "autogen", COMPILE: "compile", PUBLISH: "publish",
|
||||||
COMMENT: "comment", KEYWORD: "keyword", CONSTANT: "constant", DATATYPE: "datatype", FUNCTION: "function",
|
COMMENT: "comment", KEYWORD: "keyword", PACKAGE: "package", DATATYPE: "datatype", FUNCTION: "function", CONSTANT: "constant", STRING: "string", OBJECT: "object",
|
||||||
TEMPLATE: "template", COMPLETE: "complete", NAVIGATE: "navigate",
|
TEMPLATE: "template", COMPLETE: "complete", NAVIGATE: "navigate",
|
||||||
}
|
}
|
||||||
var wiki = {
|
var wiki = {
|
||||||
@ -232,7 +233,7 @@ var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 31, ACTION_MARGIN: 200,
|
|||||||
PAGE: "page", TABS: "tabs", MENU: "menu", NODE: "node",
|
PAGE: "page", TABS: "tabs", MENU: "menu", NODE: "node",
|
||||||
ZONE: "zone", LIST: "list", ITEM: "item", NAME: "name", ICON: "icon",
|
ZONE: "zone", LIST: "list", ITEM: "item", NAME: "name", ICON: "icon",
|
||||||
HEAD: "head", LEFT: "left", MAIN: "main", FOOT: "foot", AUTO: "auto", SHOW: "show", HIDE: "hide",
|
HEAD: "head", LEFT: "left", MAIN: "main", FOOT: "foot", AUTO: "auto", SHOW: "show", HIDE: "hide",
|
||||||
PLUGIN: "plugin", LAYOUT: "layout", CONTENT: "content",
|
PLUGIN: "plugin", LAYOUT: "layout", PROJECT: "project", DISPLAY: "display", PROFILE: "profile", CONTENT: "content",
|
||||||
|
|
||||||
DIV_PAGE: "div.page", DIV_TABS: "div.tabs",
|
DIV_PAGE: "div.page", DIV_TABS: "div.tabs",
|
||||||
DIV_ZONE: "div.zone", DIV_LIST: "div.list", DIV_ITEM: "div.item", DIV_NAME: "div.name",
|
DIV_ZONE: "div.zone", DIV_LIST: "div.list", DIV_ITEM: "div.item", DIV_NAME: "div.name",
|
||||||
@ -251,7 +252,7 @@ function shy(help, meta, list, cb) { var args = arguments, i = 0; function next(
|
|||||||
} else if (i < args.length && (!type || type == typeof args[i])) { return args[i++] }
|
} else if (i < args.length && (!type || type == typeof args[i])) { return args[i++] }
|
||||||
} return cb = typeof args[args.length-1] == lang.FUNCTION? args[args.length-1]: function() {}, cb.help = next(lang.STRING)||"", cb.meta = next(lang.OBJECT)||{}, cb.list = next(lang.ARRAY)||[], cb
|
} return cb = typeof args[args.length-1] == lang.FUNCTION? args[args.length-1]: function() {}, cb.help = next(lang.STRING)||"", cb.meta = next(lang.OBJECT)||{}, cb.list = next(lang.ARRAY)||[], cb
|
||||||
}; var _can_name = "", _can_path = ""
|
}; var _can_name = "", _can_path = ""
|
||||||
var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {}}, function(name, can, libs, cb) {
|
var Volcanos = shy({version: window._version||"", iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {}}, function(name, can, libs, cb) {
|
||||||
var meta = arguments.callee.meta, list = arguments.callee.list; if (typeof name == lang.OBJECT) {
|
var meta = arguments.callee.meta, list = arguments.callee.list; if (typeof name == lang.OBJECT) {
|
||||||
if (name.length > 0) { return Volcanos({panels: [{name: chat.HEADER, pos: html.HIDE, state: [aaa.USERNICK]}, {name: chat.ACTION, pos: html.MAIN, tool: name}]}) }
|
if (name.length > 0) { return Volcanos({panels: [{name: chat.HEADER, pos: html.HIDE, state: [aaa.USERNICK]}, {name: chat.ACTION, pos: html.MAIN, tool: name}]}) }
|
||||||
var Config = name; name = Config.name||ice.CAN, _can_name = "", _can_path = ""
|
var Config = name; name = Config.name||ice.CAN, _can_name = "", _can_path = ""
|
||||||
@ -349,8 +350,8 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {}
|
|||||||
try { if (typeof(window) == lang.OBJECT) { // chrome
|
try { if (typeof(window) == lang.OBJECT) { // chrome
|
||||||
Volcanos.meta.target = document.body, Volcanos.meta._height = window.innerHeight, Volcanos.meta._width = window.innerWidth
|
Volcanos.meta.target = document.body, Volcanos.meta._height = window.innerHeight, Volcanos.meta._width = window.innerWidth
|
||||||
Volcanos.meta._load = function(url, cb) { switch (url.split("?")[0].split(ice.PT).pop().toLowerCase()) {
|
Volcanos.meta._load = function(url, cb) { switch (url.split("?")[0].split(ice.PT).pop().toLowerCase()) {
|
||||||
case nfs.CSS: var item = document.createElement(mdb.LINK); item.rel = "stylesheet", item.href = url, item.onload = cb, document.head.appendChild(item); break
|
case nfs.CSS: var item = document.createElement(mdb.LINK); item.rel = "stylesheet", item.href = url+Volcanos.meta.version, item.onload = cb, document.head.appendChild(item); break
|
||||||
case nfs.JS: var item = document.createElement(nfs.SCRIPT); item.src = url, item.onerror = cb, item.onload = cb, document.body.appendChild(item); break
|
case nfs.JS: var item = document.createElement(nfs.SCRIPT); item.src = url+Volcanos.meta.version, item.onerror = cb, item.onload = cb, document.body.appendChild(item); break
|
||||||
} }
|
} }
|
||||||
Volcanos.meta._init = function(can) {
|
Volcanos.meta._init = function(can) {
|
||||||
var last = can.page.width() < can.page.height(); window.onresize = function(event) {
|
var last = can.page.width() < can.page.height(); window.onresize = function(event) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user