mirror of
https://shylinux.com/x/volcanos
synced 2025-04-26 01:04:06 +08:00
opt feel
This commit is contained in:
parent
62b943844e
commit
2cc0b2c5c2
8
frame.js
8
frame.js
@ -396,6 +396,12 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
can.page.Modify(can, toggle.profile, can.page.isDisplay(can.ui.profile)? right: left)
|
can.page.Modify(can, toggle.profile, can.page.isDisplay(can.ui.profile)? right: left)
|
||||||
}; return toggle
|
}; return toggle
|
||||||
},
|
},
|
||||||
|
_toggle: function(can, target, prev, next) {
|
||||||
|
return can.page.Append(can, target, [
|
||||||
|
{view: [[html.TOGGLE, mdb.PREV], "", can.page.unicode.prev], onclick: prev||function(event) {}},
|
||||||
|
{view: [[html.TOGGLE, mdb.NEXT], "", can.page.unicode.next], onclick: next||function(event) {}},
|
||||||
|
])
|
||||||
|
},
|
||||||
layout: function(can, list, type, target) { const FLOW = html.FLOW, FLEX = html.FLEX
|
layout: function(can, list, type, target) { const FLOW = html.FLOW, FLEX = html.FLEX
|
||||||
var count = 0, ui = {size: {}}; type = type||FLEX, target = target||can._output
|
var count = 0, ui = {size: {}}; type = type||FLEX, target = target||can._output
|
||||||
function append(target, type, list) { can.page.ClassList.add(can, target, [html.LAYOUT, type]), can.core.List(list, function(item) {
|
function append(target, type, list) { can.page.ClassList.add(can, target, [html.LAYOUT, type]), can.core.List(list, function(item) {
|
||||||
@ -420,7 +426,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
if (can.base.isObject(meta) && meta.layout) { meta.layout(h, width) }
|
if (can.base.isObject(meta) && meta.layout) { meta.layout(h, width) }
|
||||||
can.page.style(can, target, html.WIDTH, width), height -= h
|
can.page.style(can, target, html.WIDTH, width), height -= h
|
||||||
} else {
|
} else {
|
||||||
if (item == html.PROJECT) { var w = 230, h = height } else { var w = calc(item, target.offsetWidth||target.style.width||_width/list.length, _width), h = height }
|
if (item == html.PROJECT) { var w = can.user.isMobile? 120: 230, h = height } else { var w = calc(item, target.offsetWidth||target.style.width||_width/list.length, _width), h = height }
|
||||||
if (can.base.isObject(meta)) { meta.layout(h, w = _width/list.length) }
|
if (can.base.isObject(meta)) { meta.layout(h, w = _width/list.length) }
|
||||||
can.page.style(can, target, html.HEIGHT, h, html.WIDTH, w), width -= w
|
can.page.style(can, target, html.HEIGHT, h, html.WIDTH, w), width -= w
|
||||||
}
|
}
|
||||||
|
@ -270,9 +270,11 @@ div.project div.action div.item.search>span { right:10px; }
|
|||||||
div.content { position:relative; }
|
div.content { position:relative; }
|
||||||
div.content>div.toggle { position:absolute; }
|
div.content>div.toggle { position:absolute; }
|
||||||
div.content>div.toggle:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); cursor:pointer; }
|
div.content>div.toggle:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); cursor:pointer; }
|
||||||
|
div.toggle:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); cursor:pointer; }
|
||||||
div.content>div.toggle.project { top:20%; left:0; height:80px; width:unset; padding-top:25px; transform:scale(1, 3); border:none; }
|
div.content>div.toggle.project { top:20%; left:0; height:80px; width:unset; padding-top:25px; transform:scale(1, 3); border:none; }
|
||||||
div.content>div.toggle.profile { top:20%; right:0; height:80px; padding-top:25px; transform:scale(1, 3); border:none; }
|
div.content>div.toggle.profile { top:20%; right:0; height:80px; padding-top:25px; transform:scale(1, 3); border:none; }
|
||||||
div.content>div.toggle.display { left:20%; bottom:0; width:80px; text-align:center; transform:scale(3, 1); border:none; }
|
div.content>div.toggle.display { left:20%; bottom:0; width:80px; text-align:center; transform:scale(3, 1); border:none; }
|
||||||
|
body.mobile div.project:not(.toggle) { border-right:var(--box-border); width:120px; flex:0 0 120px; }
|
||||||
div.project:not(.toggle) { border-right:var(--box-border); width:230px; flex:0 0 230px; }
|
div.project:not(.toggle) { border-right:var(--box-border); width:230px; flex:0 0 230px; }
|
||||||
div.profile:not(.toggle) { border-left:var(--box-border); width:50%; }
|
div.profile:not(.toggle) { border-left:var(--box-border); width:50%; }
|
||||||
div.display:not(.toggle) { border-top:var(--box-border); }
|
div.display:not(.toggle) { border-top:var(--box-border); }
|
||||||
@ -384,6 +386,7 @@ div.carte div.item:hover { background-color:var(--hover-bg-color); }
|
|||||||
div.carte div.item.danger:hover { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
|
div.carte div.item.danger:hover { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
|
||||||
div.carte div.item.notice:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
div.carte div.item.notice:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||||
/* mobile */
|
/* mobile */
|
||||||
|
body.cmd.mobile { overflow:hidden; }
|
||||||
body.mobile table.content { width:100%; }
|
body.mobile table.content { width:100%; }
|
||||||
body.mobile form.option>div.item { margin:0; }
|
body.mobile form.option>div.item { margin:0; }
|
||||||
body.mobile form.option>div.item.button>input { display:none; }
|
body.mobile form.option>div.item.button>input { display:none; }
|
||||||
|
@ -31,7 +31,9 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
|||||||
},
|
},
|
||||||
onsize: function(can, msg, height, width) { can.Conf({height: can.base.Min(height, 240), width: width}) },
|
onsize: function(can, msg, height, width) { can.Conf({height: can.base.Min(height, 240), width: width}) },
|
||||||
onlogin: function(can, msg) { can.onimport._menu(can, msg), can.onkeymap._build(can)
|
onlogin: function(can, msg) { can.onimport._menu(can, msg), can.onkeymap._build(can)
|
||||||
can._root.River && can.onmotion.delay(can, function() { if (can.Mode()) { return } var gt = can.page.unicode.next, lt = can.page.unicode.prev, river = can._root.River._target
|
can._root.River && can.onmotion.delay(can, function() {
|
||||||
|
if (can.Mode()) { return }
|
||||||
|
var gt = can.page.unicode.next, lt = can.page.unicode.prev, river = can._root.River._target
|
||||||
var target = can.page.Append(can, can._target, [{view: [[html.TOGGLE, chat.PROJECT], "", can.page.isDisplay(river)? lt: gt], onclick: function(event) {
|
var target = can.page.Append(can, can._target, [{view: [[html.TOGGLE, chat.PROJECT], "", can.page.isDisplay(river)? lt: gt], onclick: function(event) {
|
||||||
can.page.Modify(can, target, (can._river_show = can.onmotion.toggle(can, river))? lt: gt), can.onaction.layout(can)
|
can.page.Modify(can, target, (can._river_show = can.onmotion.toggle(can, river))? lt: gt), can.onaction.layout(can)
|
||||||
can.misc.sessionStorage(can, "river:hide", can._river_show? "": ice.TRUE)
|
can.misc.sessionStorage(can, "river:hide", can._river_show? "": ice.TRUE)
|
||||||
|
@ -1,110 +0,0 @@
|
|||||||
fieldset.repos div.output>* {
|
|
||||||
margin:auto;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output table {
|
|
||||||
border: #e2e2e2solid 1px;
|
|
||||||
border-radius:5px;
|
|
||||||
color:#4183c4;
|
|
||||||
margin-top:20px;
|
|
||||||
margin-bottom:20px;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output div.branch {
|
|
||||||
float:left;
|
|
||||||
margin-left:100px;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output div.branch span {
|
|
||||||
border:solid 1px #dddddd;
|
|
||||||
padding:10px;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output div.url span.branch {
|
|
||||||
float:left;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output div.url {
|
|
||||||
margin-top:10px;
|
|
||||||
margin-bottom:60px;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output div.url span {
|
|
||||||
border:solid 1px #dddddd;
|
|
||||||
height:40px;
|
|
||||||
padding:10px;
|
|
||||||
float:right;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output div.url span:first-child {
|
|
||||||
border:solid 1px blue;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output table th {
|
|
||||||
clear:both;
|
|
||||||
background-color:#f9fafb;
|
|
||||||
height:36px;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output table td {
|
|
||||||
border-bottom:solid 1px #e2e2e2;
|
|
||||||
height:36px;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output table td:first-child:before {
|
|
||||||
content: "😀";
|
|
||||||
}
|
|
||||||
|
|
||||||
fieldset.repos div.output div.code {
|
|
||||||
border:solid 1px #e2e2e2;
|
|
||||||
background-color:white;
|
|
||||||
color:black;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.info {
|
|
||||||
width:100%;
|
|
||||||
height:200px;
|
|
||||||
background-color:#414F5C;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.info>span {
|
|
||||||
display:block;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.info>span:first-child {
|
|
||||||
padding:20px;
|
|
||||||
color:white;
|
|
||||||
font-size:20px;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.info {
|
|
||||||
position:relative;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.info div.button:first-child {
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.info div.button {
|
|
||||||
left:30px;
|
|
||||||
position:absolute;
|
|
||||||
bottom:0;
|
|
||||||
display:flex;
|
|
||||||
justify-content: center;
|
|
||||||
height:40px;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.info div.button span {
|
|
||||||
border-top-left-radius: 5px;
|
|
||||||
border-top-right-radius: 5px;
|
|
||||||
float:left;
|
|
||||||
flex:1;
|
|
||||||
text-align:center;
|
|
||||||
display:block;
|
|
||||||
width:120px;
|
|
||||||
margin:auto;
|
|
||||||
padding:10px;
|
|
||||||
height:40px;
|
|
||||||
color:white;
|
|
||||||
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.info div.button span:first-child {
|
|
||||||
background-color:white;
|
|
||||||
color:#2596e6;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.commit {
|
|
||||||
margin-left:100px;
|
|
||||||
display:flex;
|
|
||||||
height:40px;
|
|
||||||
border:solid 1px #e2e2e2;
|
|
||||||
justify-content: center;
|
|
||||||
border-top:none;
|
|
||||||
}
|
|
||||||
fieldset.repos div.output>div.commit>span {
|
|
||||||
flex:1;
|
|
||||||
text-align:center;
|
|
||||||
margin:auto;
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) {
|
|
||||||
can.page.ClassList.add(can, can._fields, "repos")
|
|
||||||
can.page.Append(can, can._output, [{view: "info", list: [{text: "localhost:9020 / golang-story"}, {view: "button", list: [{text: "code"}, {text: "Issues"}, {text: "Pusll Requests"}, {text: "Wiki"}]}]}])
|
|
||||||
can.page.Append(can, can._output, [{view: "commit", list: [{text: "56 次提交"}, {text: "3 个分支"}, {text: "5 个版本"}]}])
|
|
||||||
can.page.Append(can, can._output, [{view: "url", list: [
|
|
||||||
{text: "http://localhost:9020/x/golang-story.git"},
|
|
||||||
{text: "https"}, {text: "ssh"},
|
|
||||||
{text: "分支:master", className: "branch"},
|
|
||||||
]}])
|
|
||||||
var table = can.onappend.table(can, msg)
|
|
||||||
can.onappend.board(can, msg.Option("file"))
|
|
||||||
can.page.Select(can, can._output, "div.code", function(target) {
|
|
||||||
can.page.style(can, target, "background-color", "#f0f0f0")
|
|
||||||
})
|
|
||||||
can.onappend.board(can, msg)
|
|
||||||
can.page.style(can, table, html.WIDTH, can.ConfWidth()-200)
|
|
||||||
can.page.Select(can, can._output, "div.code", function(target) {
|
|
||||||
can.page.style(can, target, html.WIDTH, can.ConfWidth()-200)
|
|
||||||
})
|
|
||||||
can.page.SelectChild(can, can._output, "*", function(target) {
|
|
||||||
can.page.style(can, target, html.WIDTH, can.ConfWidth()-200)
|
|
||||||
can.page.style(can, target, html.MARGIN_LEFT, 100)
|
|
||||||
})
|
|
||||||
}}, [""])
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
|||||||
fieldset.feel>div.output { display:flex; justify-content:center; }
|
body.mobile fieldset.feel>div.output>div.project { overflow-x:hidden; }
|
||||||
fieldset.feel>div.output>div.project { flex:0 0 230px; }
|
fieldset.feel>div.output>div.layout>div.display { position:relative; overflow-y:hidden; }
|
||||||
fieldset.feel>div.output>div.project div.item { white-space:pre; }
|
fieldset.feel>div.output>div.layout>div.display:not(.hide) { height:100px; display:flex; justify-content:center; gap:10px; }
|
||||||
fieldset.feel>div.output>div.project div.item.filter { position:sticky; top:0; }
|
fieldset.feel>div.output>div.layout>div.display:not(:hover)>div.toggle { display:none; }
|
||||||
fieldset.feel>div.output>div.project div.item.filter input { width:100%; }
|
fieldset.feel>div.output>div.layout>div.display>div.toggle { font-size:48px; position:absolute; top:20%; }
|
||||||
fieldset.feel>div.output>div.layout { flex-grow:1; }
|
fieldset.feel>div.output>div.layout>div.display>div.toggle.prev { left:0; }
|
||||||
fieldset.feel>div.output>div.layout>div.content.float { padding:0; position:fixed; left:0; top:0; }
|
fieldset.feel>div.output>div.layout>div.display>div.toggle.next { right:0; }
|
||||||
fieldset.feel>div.output>div.layout>div.content:not(.hide) { display:flex; justify-content:center; }
|
fieldset.feel>div.output>div.layout>div.layout>div.content { text-align:center; overflow-y:hidden; }
|
||||||
fieldset.feel>div.output>div.layout>div.display:not(.hide) { display:flex; justify-content:center; flex-wrap:wrap; max-height:100%; }
|
fieldset.feel>div.output>div.layout>div.layout>div.content:not(:hover)>div.toggle { display:none; }
|
||||||
fieldset.feel>div.output img { margin-bottom:0; }
|
fieldset.feel>div.output>div.layout>div.layout>div.content>div.toggle { font-size:48px; top:40%; height:80px; }
|
||||||
|
fieldset.feel>div.output>div.layout>div.layout>div.content>div.toggle.next { right:0; }
|
||||||
|
fieldset.feel.float>div.output { display:flex; justify-content:center; }
|
||||||
|
@ -1,53 +1,61 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.onmotion.clear(can)
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.ui = can.onappend.layout(can), cb && cb(msg)
|
||||||
can.ui = can.onappend.layout(can, [html.PROJECT, [html.CONTENT, html.DISPLAY]])
|
can.db.hash = can.isCmdMode()? can.misc.SearchHash(can): []
|
||||||
can.dir_root = msg.Option(nfs.DIR_ROOT), can.list = [], can._path = can.request(), cb && cb(msg)
|
can.onmotion.hidden(can, can._action), can.onmotion.toggle(can, can.ui.display, true), can.onimport.layout(can)
|
||||||
|
can.onimport._project(can, msg), can.onimport.page(can, can.db.list, can.db.begin = parseInt(msg.Option(cli.BEGIN)||"0"))
|
||||||
|
},
|
||||||
|
_project: function(can, msg) { can.db.list = [], can.db.dir_root = msg.Option(nfs.DIR_ROOT)
|
||||||
msg.Table(function(item) { item.name = can.base.trimPrefix(item.path, can.Option(nfs.PATH))
|
msg.Table(function(item) { item.name = can.base.trimPrefix(item.path, can.Option(nfs.PATH))
|
||||||
can.base.endWith(item.path, nfs.PS)? can.onimport.item(can, item, function(event) { can.Option(nfs.PATH, item.path) && can.Update(event) }): can.list.push(item)
|
can.base.endWith(item.path, nfs.PS)? can.onimport.item(can, item, function(event) { can.Option(nfs.PATH, item.path) && can.Update(event) }): can.db.list.push(item)
|
||||||
})
|
})
|
||||||
var rate = can.misc.localStorage(can, "web.wiki.feel:rate"); rate && can.Action("speed", rate)
|
var rate = can.misc.localStorage(can, [can.ConfIndex(), "rate"]); rate && can.Action(html.SPEED, rate)
|
||||||
can.core.List(can.list, function(item, index) { var last = can.misc.localStorage(can, can.onexport.key(can, "p", can.onimport._file(can, item.path)))
|
var _target; can.core.List(can.db.list, function(item, index) {
|
||||||
item.nick = (last? last+" ": "")+item.name; var target = can.onimport.item(can, item, function(_event) {
|
var last = can.misc.localStorage(can, [can.ConfIndex(), "p", can.onimport._file(can, item.path)])
|
||||||
var target = _event.target
|
item.nick = (last? last+lex.SP: "")+item.name
|
||||||
can.cb = function(event) { var next = _event.target.nextSibling
|
var target = can.onimport.item(can, item, function(_event) { var target = _event.target
|
||||||
can.misc.localStorage(can, can.onexport.key(can, "last"), item.path)
|
can.ui.cb = function(event) { var next = _event.target.nextSibling
|
||||||
can.video = event.target, can.Status(item), target.innerHTML = parseInt(event.target.currentTime*100/event.target.duration)+"% "+item.name
|
target.innerHTML = parseInt(event.target.currentTime*100/event.target.duration)+"% "+item.name
|
||||||
if (event.type == "ratechange") { can.misc.localStorage(can, "web.wiki.feel:rate", event.target.playbackRate) }
|
can.ui.video = event.target, can.Status(item), can.misc.localStorage(can, [can.ConfIndex(), "last"], item.path)
|
||||||
if (event.type == "ended" && next) { can.onmotion.delay(can, function() { next.click() }, 3000), can.user.toast(can, "3s 后即将播放下一个", "", 3000) }
|
if (event.type == "ratechange") { can.misc.localStorage(can, [can.ConfIndex(), "rate"], event.target.playbackRate) }
|
||||||
|
if (event.type == "ended" && next) { can.onmotion.delay(can, function() { next.click() }, 3000), can.user.toast(can, "3s 后即将播放下一个", "", 3000) }
|
||||||
|
}
|
||||||
|
can.onimport.layout(can), can.onmotion.scrollIntoView(can, target), can.onmotion.clear(can, can.ui.content)
|
||||||
|
var _target = can.onimport.file(can, item.path, item, index, can.ui.content, can.ui.content.offsetHeight, true)
|
||||||
|
_target.focus(), _target.onclick = function() { can.ondetail._init(can, index) }
|
||||||
|
can.isCmdMode() && can.misc.SearchHash(can, item.path)
|
||||||
|
can.onappend._toggle(can, can.ui.content, function() {
|
||||||
|
index == 0? can.user.toast(can, "已经是第一页了"): _event.target.previousSibling.click()
|
||||||
|
}, function() {
|
||||||
|
try { _event.target.nextSibling.click() } catch (e) { can.user.toast(can, "已经是最后一页了") }
|
||||||
|
})
|
||||||
|
var limit = parseInt(can.Action(mdb.LIMIT))
|
||||||
|
if (index < can.db.begin || index >= can.db.begin+limit) {
|
||||||
|
can.onimport.page(can, can.db.list, can.db.begin = index-index%limit)
|
||||||
|
}
|
||||||
|
}, function() {}, can.ui.project); item._target = target, _target = can.db.hash[0] == item.path? target: _target||target
|
||||||
|
if (can.isCmdMode() && item.path == can.misc.localStorage(can, [can.ConfIndex, "last"])) {
|
||||||
|
can.Action(html.HEIGHT, html.HIDE), can.onmotion.hidden(can, can.ui.display)
|
||||||
|
_target = target, can.onmotion.delay(can, function() { can.onaction.full({}, can) })
|
||||||
}
|
}
|
||||||
can.onmotion.clear(can, can.ui.content)
|
}), _target && _target.click()
|
||||||
can.onimport.file(can, item.path, item, index, can.ui.content, can.ConfHeight()-can.onexport.height(can)-1, true).focus()
|
|
||||||
can.onmotion.delay(can, function() { target.scrollIntoView(), can.onimport.layout(can, can.ConfHeight(), can.ConfWidth()) })
|
|
||||||
}, function() {}, can.ui.project);
|
|
||||||
if (can.isCmdMode() && item.path == can.misc.localStorage(can, can.onexport.key(can, "last"))) {
|
|
||||||
can.onmotion.hidden(can, can.ui.display), can.onmotion.hidden(can, can._action), can.Action(html.HEIGHT, "hide")
|
|
||||||
target.click(), can.isCmdMode() && can.onmotion.delay(can, function() { can.onaction.full({}, can) })
|
|
||||||
}
|
|
||||||
})
|
|
||||||
can.onimport.page(can, can.list, can.begin = parseInt(msg.Option(cli.BEGIN)||"0"))
|
|
||||||
},
|
},
|
||||||
_file: function(can, path) { var p = location.href.indexOf(ice.HTTP) == 0? "": "http://localhost:9020"
|
_file: function(can, path) { var p = location.href.indexOf(ice.HTTP) == 0? "": "http://localhost:9020"
|
||||||
return path.indexOf(ice.HTTP) == 0? path: p+can.base.Path(web.SHARE_LOCAL, can.dir_root||"", path)
|
return path.indexOf(ice.HTTP) == 0? path: p+can.base.Path(web.SHARE_LOCAL, can.db.dir_root||"", path)
|
||||||
},
|
},
|
||||||
file: function(can, path, item, index, target, height, auto) { path = can.onimport._file(can, path)
|
file: function(can, path, item, index, target, height, auto) { path = can.onimport._file(can, path)
|
||||||
var cb = can.onfigure[can.base.Ext(path)]||can.onfigure[wiki.IMAGE]; can.Status(nfs.FILE, path)
|
var cb = can.onfigure[can.base.Ext(path)]||can.onfigure[wiki.IMAGE]; can.Status(nfs.FILE, path)
|
||||||
return cb && can.page.Append(can, target||can.ui.display, [cb(can, path, item, index, height, auto)])._target
|
return cb && can.page.Append(can, target||can.ui.display, [cb(can, path, item, index, height, auto)])._target
|
||||||
},
|
},
|
||||||
page: function(can, list, begin, limit) { can.onmotion.clear(can, can.ui.display)
|
page: function(can, list, begin, limit) { can.onmotion.clear(can, can.ui.display)
|
||||||
begin = parseInt(begin||can.begin), limit = parseInt(limit||can.Action(mdb.LIMIT))
|
begin = parseInt(begin||can.db.begin), limit = parseInt(limit||can.Action(mdb.LIMIT))
|
||||||
for (var i = begin; i < begin+limit; i++) { list && list[i] && can.onimport.file(can, list[i].path, list[i], i) }
|
for (var i = begin; i < begin+limit; i++) { list && list[i] && can.onimport.file(can, list[i].path, list[i], i) }
|
||||||
|
can.onappend._toggle(can, can.ui.display, function(event) { can.onaction.prev(event, can) }, function(event) { can.onaction.next(event, can) })
|
||||||
can.Status({begin: begin, limit: limit, total: list.length})
|
can.Status({begin: begin, limit: limit, total: list.length})
|
||||||
},
|
},
|
||||||
layout: function(can, height, width) {
|
layout: function(can) { can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function(height, width) {
|
||||||
can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()-can.ui.project.offsetWidth)
|
can.page.Select(can, can.ui.content, html.VIDEO, function(target) {
|
||||||
can.page.style(can, can.ui.display, html.WIDTH, can.ConfWidth()-can.ui.project.offsetWidth)
|
can.page.style(can, target, html.HEIGHT, height, html.MAX_WIDTH, width)
|
||||||
can.list.length > 0 && can.page.style(can, can.ui.project, html.HEIGHT, can.base.Min(can.ui.display.offsetHeight, can.Action(html.HEIGHT), can.ConfHeight()))
|
|
||||||
can.isCmdMode() && can.page.style(can, can.ui.project, html.HEIGHT, can.ConfHeight())
|
|
||||||
can.isCmdMode() && can.page.Select(can, can.ui.content, html.VIDEO, function(target) {
|
|
||||||
can.page.isDisplay(can.ui.project)?
|
|
||||||
can.page.style(can, target, html.HEIGHT, can.ui.content.offsetHeight, html.MAX_WIDTH, can.ui.content.offsetWidth):
|
|
||||||
can.page.style(can, target, html.HEIGHT, can.page.height(), html.MAX_WIDTH, can.page.width())
|
|
||||||
})
|
})
|
||||||
},
|
}) },
|
||||||
}, [""])
|
}, [""])
|
||||||
Volcanos(chat.ONFIGURE, {
|
Volcanos(chat.ONFIGURE, {
|
||||||
png: function(can, path, item, index, height) { return can.onfigure.image(can, path, item, index, height) },
|
png: function(can, path, item, index, height) { return can.onfigure.image(can, path, item, index, height) },
|
||||||
@ -55,9 +63,9 @@ Volcanos(chat.ONFIGURE, {
|
|||||||
jpeg: function(can, path, item, index, height) { return can.onfigure.image(can, path, item, index, height) },
|
jpeg: function(can, path, item, index, height) { return can.onfigure.image(can, path, item, index, height) },
|
||||||
image: function(can, path, item, index, height) { return {img: path, height: height||can.onexport.height(can),
|
image: function(can, path, item, index, height) { return {img: path, height: height||can.onexport.height(can),
|
||||||
onmouseover: function(event) { can.Status(nfs.FILE, path), can.Status(item) },
|
onmouseover: function(event) { can.Status(nfs.FILE, path), can.Status(item) },
|
||||||
onclick: function(event) { can.ondetail._init(can, index) },
|
onclick: function(event) { item._target.click() },
|
||||||
} },
|
} },
|
||||||
video: function(can, path, item, index, height, auto) { var total = 0, cb = can.cb||function cb(event) { }
|
video: function(can, path, item, index, height, auto) { var total = 0, cb = can.ui.cb||function cb(event) { }
|
||||||
var init, last = can.misc.localStorage(can, can.onexport.key(can, path))||0
|
var init, last = can.misc.localStorage(can, can.onexport.key(can, path))||0
|
||||||
return {type: html.VIDEO, style: {height: height||can.onexport.height(can)},
|
return {type: html.VIDEO, style: {height: height||can.onexport.height(can)},
|
||||||
data: {src: path, controls: "controls", autoplay: auto, playbackRate: parseFloat(can.Action(html.SPEED))},
|
data: {src: path, controls: "controls", autoplay: auto, playbackRate: parseFloat(can.Action(html.SPEED))},
|
||||||
@ -79,29 +87,29 @@ Volcanos(chat.ONFIGURE, {
|
|||||||
webm: function(can, path, item, index, height, auto) { return can.onfigure.video(can, path, item, index, height, auto) },
|
webm: function(can, path, item, index, height, auto) { return can.onfigure.video(can, path, item, index, height, auto) },
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {list: ["full",
|
Volcanos(chat.ONACTION, {list: ["full",
|
||||||
[html.HEIGHT, 100, 200, 400, 600, 800, "max", "hide", ice.AUTO],
|
[html.HEIGHT, 100, 200, 400, 600, 800, "max", html.HIDE, ice.AUTO],
|
||||||
[mdb.LIMIT, 6, 1, 3, 6, 9, 12, 15, 20, 30, 50],
|
[mdb.LIMIT, 6, 1, 3, 6, 9, 12, 15, 20, 30, 50],
|
||||||
[html.SPEED, 1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 5, 10],
|
[html.SPEED, 1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 5, 10],
|
||||||
],
|
],
|
||||||
height: function(event, can, key, value) { can.Action(key, value), can.onimport.page(can, can.list) },
|
height: function(event, can, key, value) { can.Action(key, value), can.onimport.page(can, can.db.list) },
|
||||||
limit: function(event, can, key, value) { can.Action(key, value), can.onimport.page(can, can.list) },
|
limit: function(event, can, key, value) { can.Action(key, value), can.onimport.page(can, can.db.list) },
|
||||||
speed: function(event, can, key, value) { can.Action(key, value), can.onimport.page(can, can.list) },
|
speed: function(event, can, key, value) { can.Action(key, value), can.onimport.page(can, can.db.list) },
|
||||||
prev: function(event, can) { if (can.begin > 0) { can.begin -= parseInt(can.Action(mdb.LIMIT)), can.onimport.page(can, can.list) } else { can.user.toast(can, "已经是第一页了") } },
|
prev: function(event, can) { if (can.db.begin > 0) { can.db.begin -= parseInt(can.Action(mdb.LIMIT)), can.onimport.page(can, can.db.list) } else { can.user.toast(can, "已经是第一页了") } },
|
||||||
next: function(event, can) { if (can.begin + parseInt(can.Action(mdb.LIMIT)) < can.list.length) { can.begin += parseInt(can.Action(mdb.LIMIT)), can.onimport.page(can, can.list) } else { can.user.toast(can, "已经是最后一页了") } },
|
next: function(event, can) { if (can.db.begin + parseInt(can.Action(mdb.LIMIT)) < can.db.list.length) { can.db.begin += parseInt(can.Action(mdb.LIMIT)), can.onimport.page(can, can.db.list) } else { can.user.toast(can, "已经是最后一页了") } },
|
||||||
full: function(event, can) {
|
full: function(event, can) {
|
||||||
var show = can.onmotion.toggle(can, can.ui.project); can.onmotion.toggle(can, can.ui.display), can.onimport.layout(can, can.ConfHeight(), can.ConfWidth())
|
var show = can.onmotion.toggle(can, can.ui.project); can.onmotion.toggle(can, can.ui.display), can.onimport.layout(can, can.ConfHeight(), can.ConfWidth())
|
||||||
can.page.ClassList.set(can, can.ui.content, "float", !show), can.page.Select(can, can.ui.content, "*", function(target) { target.focus()
|
can.page.ClassList.set(can, can.ui.content, html.FLOAT, !show), can.page.Select(can, can.ui.content, "*", function(target) { target.focus()
|
||||||
can.page.style(can, target, html.HEIGHT, can.ConfHeight()+(!show? 2*html.ACTION_HEIGHT: 0)-can.ui.display.offsetHeight)
|
can.page.style(can, target, html.HEIGHT, can.ConfHeight()+(!show? 2*html.ACTION_HEIGHT: 0)-can.ui.display.offsetHeight)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onkeydown: function(event, can) { try {
|
onkeydown: function(event, can) { try {
|
||||||
if (event.target != can.video) {
|
if (event.target != can.ui.video) {
|
||||||
if (event.key == "ArrowLeft") { can.video.currentTime -= 15 }
|
if (event.key == "ArrowLeft") { can.ui.video.currentTime -= 15 }
|
||||||
if (event.key == "ArrowRight") { can.video.currentTime += 15 }
|
if (event.key == "ArrowRight") { can.ui.video.currentTime += 15 }
|
||||||
}
|
}
|
||||||
if (event.key == "Escape") { can.onaction.full(event, can) }
|
if (event.key == "Escape") { can.onaction.full(event, can) }
|
||||||
if (event.key == "ArrowUp") { can.user.toast(can, parseInt((can.video.volume += 0.1)*100)) }
|
if (event.key == "ArrowUp") { can.user.toast(can, parseInt((can.ui.video.volume += 0.1)*100)) }
|
||||||
if (event.key == "ArrowDown") { can.user.toast(can, parseInt((can.video.volume -= 0.1)*100)) }
|
if (event.key == "ArrowDown") { can.user.toast(can, parseInt((can.ui.video.volume -= 0.1)*100)) }
|
||||||
} catch (e) {} },
|
} catch (e) {} },
|
||||||
record0: function(event, can, name, cb) { can.user.input(event, can, [{name: nfs.FILE, value: name}], function(list) { var height = window.innerHeight
|
record0: function(event, can, name, cb) { can.user.input(event, can, [{name: nfs.FILE, value: name}], function(list) { var height = window.innerHeight
|
||||||
navigator.mediaDevices.getDisplayMedia({video: {height: height}}).then(function(stream) {
|
navigator.mediaDevices.getDisplayMedia({video: {height: height}}).then(function(stream) {
|
||||||
@ -124,28 +132,29 @@ Volcanos(chat.ONACTION, {list: ["full",
|
|||||||
recorder.onstop = function() { cb(blobs, nfs.WEBM) }, recorder.start(1)
|
recorder.onstop = function() { cb(blobs, nfs.WEBM) }, recorder.start(1)
|
||||||
}) },
|
}) },
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONDETAIL, {list: ["关闭", "上一个", "下一个", "设置头像", "设置背景", "复制链接", "下载", "删除"], _init: function(can, index) {
|
Volcanos(chat.ONDETAIL, {list: ["关闭", "上一个", "下一个", "设置头像", "设置背景", "复制链接", "下载", "删除"],
|
||||||
|
_init: function(can, index) {
|
||||||
can.onappend._init(can, {type: "story feel play float"}, [], function(sub) { can.sub = sub, sub._legend.onclick = can._legend.onclick
|
can.onappend._init(can, {type: "story feel play float"}, [], function(sub) { can.sub = sub, sub._legend.onclick = can._legend.onclick
|
||||||
can.getActionSize(function(msg, left, top, width, height) { sub.onappend._action(can, can.ondetail.list, sub._action, can.ondetail), sub.onappend._status(sub, ["begin", nfs.FILE])
|
can.getActionSize(function(msg, left, top, width, height) { sub.onappend._action(can, can.ondetail.list, sub._action, can.ondetail), sub.onappend._status(sub, ["begin", nfs.FILE])
|
||||||
sub.page.style(sub, sub._target, {left: left||0, top: top||0}), sub.page.style(sub, sub._output, html.HEIGHT, height-2*html.ACTION_HEIGHT, html.WIDTH, width)
|
sub.page.style(sub, sub._target, {left: left||0, top: top||0}), sub.page.style(sub, sub._output, html.HEIGHT, height-2*html.ACTION_HEIGHT, html.WIDTH, width)
|
||||||
can.order = index, can.show = function(order) { path = can.onimport._file(can, can.list[order].path); var cb = can.onfigure[can.base.Ext(path)]||can.onfigure[wiki.IMAGE]
|
can.order = index, can.show = function(order) { path = can.onimport._file(can, can.db.list[order].path); var cb = can.onfigure[can.base.Ext(path)]||can.onfigure[wiki.IMAGE]
|
||||||
sub.page.Appends(sub, sub._output, [can.base.Copy(cb(can, path, index), {height: "", style: kit.Dict(html.MAX_WIDTH, width, html.MAX_HEIGHT, height-2*html.ACTION_HEIGHT)})])
|
sub.page.Appends(sub, sub._output, [can.base.Copy(cb(can, path, index), {height: "", style: kit.Dict(html.MAX_WIDTH, width, html.MAX_HEIGHT, height-2*html.ACTION_HEIGHT)})])
|
||||||
sub.Status(cli.BEGIN, order+1+nfs.PS+can.list.length), sub.Status(nfs.FILE, path)
|
sub.Status(cli.BEGIN, order+1+nfs.PS+can.db.list.length), sub.Status(nfs.FILE, path)
|
||||||
}, can.show(can.order)
|
}, can.show(can.order)
|
||||||
}), sub.run = function(can, cmds, cb) { can.run(can, cmds, cb, true) }
|
}), sub.run = function(can, cmds, cb) { can.run(can, cmds, cb, true) }
|
||||||
}, can._root._target)
|
}, can._root._target)
|
||||||
},
|
},
|
||||||
"关闭": function(event, can) { can.page.Remove(can, can.sub._target) },
|
"关闭": function(event, can) { can.page.Remove(can, can.sub._target) },
|
||||||
"上一个": function(event, can) { can.order > 0? can.show(--can.order): can.user.toast(can, "已经是第一张啦!") },
|
"上一个": function(event, can) { can.order > 0? can.show(--can.order): can.user.toast(can, "已经是第一张啦!") },
|
||||||
"下一个": function(event, can) { can.order < can.list.length-1? can.show(++can.order): can.user.toast(can, "已经是最后一张啦!") },
|
"下一个": function(event, can) { can.order < can.db.list.length-1? can.show(++can.order): can.user.toast(can, "已经是最后一张啦!") },
|
||||||
"设置头像": function(event, can) { can.setHeader(aaa.AVATAR, can.onimport._file(can, can.list[can.order].path)) },
|
"设置头像": function(event, can) { can.setHeader(aaa.AVATAR, can.onimport._file(can, can.db.list[can.order].path)) },
|
||||||
"设置背景": function(event, can) { can.setHeader(aaa.BACKGROUND, can.onimport._file(can, can.list[can.order].path)) },
|
"设置背景": function(event, can) { can.setHeader(aaa.BACKGROUND, can.onimport._file(can, can.db.list[can.order].path)) },
|
||||||
"复制链接": function(event, can) { can.onmotion.share(event, can, [], [mdb.LINK, can.user.copy(event, can, can.misc.MergeURL(can, {_path: can.onimport._file(can, can.list[can.order].path)}, true)) ]) },
|
"复制链接": function(event, can) { can.onmotion.share(event, can, [], [mdb.LINK, can.user.copy(event, can, can.misc.MergeURL(can, {_path: can.onimport._file(can, can.db.list[can.order].path)}, true)) ]) },
|
||||||
"下载": function(event, can) { can.user.download(can, path = can.onimport._file(can, can.list[can.order].path)) },
|
"下载": function(event, can) { can.user.download(can, path = can.onimport._file(can, can.db.list[can.order].path)) },
|
||||||
"删除": function(event, can) { can.runAction(event, nfs.TRASH, [can.list[can.order].path], function(msg) { can.user.toastSuccess(can, "删除成功") }, true) },
|
"删除": function(event, can) { can.runAction(event, nfs.TRASH, [can.db.list[can.order].path], function(msg) { can.user.toastSuccess(can, "删除成功") }, true) },
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONEXPORT, {list: [cli.BEGIN, mdb.LIMIT, mdb.TOTAL, nfs.FILE, nfs.SIZE, "position"],
|
Volcanos(chat.ONEXPORT, {list: [cli.BEGIN, mdb.LIMIT, mdb.TOTAL, nfs.FILE, nfs.SIZE, "position"],
|
||||||
height: function(can) { var height = can.Action(html.HEIGHT); return parseInt(height == "hide"? 0: height == "max"? can.ConfHeight(): height == ice.AUTO? can.base.Min(can.ConfHeight()/4, 200): height) },
|
height: function(can) { var height = can.Action(html.HEIGHT); return parseInt(height == html.HIDE? 0: height == "max"? can.ConfHeight(): height == ice.AUTO? can.base.Min(can.ConfHeight()/4, 200): height) },
|
||||||
position: function(can, index, total) { total = total || can.max; return parseInt((index+1)*100/total)+"%"+" = "+(parseInt(index)+1)+nfs.PS+parseInt(total) },
|
position: function(can, index, total) { total = total || can.max; return parseInt((index+1)*100/total)+"%"+" = "+(parseInt(index)+1)+nfs.PS+parseInt(total) },
|
||||||
key: function(can) { return [can.Conf(ctx.INDEX)].concat(can.core.List(arguments).slice(1)).join(":") },
|
key: function(can) { return [can.Conf(ctx.INDEX)].concat(can.core.List(arguments).slice(1)).join(":") },
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user