mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
dd846ade9e
commit
0c6afe560d
136
const.js
136
const.js
@ -1,6 +1,6 @@
|
|||||||
var kit = {proto: function(sub, sup) { return sub.__proto__ = sup, sub },
|
var kit = {proto: function(sub, sup) { return sub.__proto__ = sup, sub },
|
||||||
Dict: function() { var res = {}, arg = arguments; for (var i = 0; i < arg.length; i += 2) { var key = arg[i]
|
Dict: function() { var res = {}, arg = arguments; for (var i = 0; i < arg.length; i += 2) { var key = arg[i]
|
||||||
if (typeof key == "object") { i--;
|
if (typeof key == "object") { i--
|
||||||
if (key.length == undefined) {
|
if (key.length == undefined) {
|
||||||
for (var k in key) { res[k] = key[k] }
|
for (var k in key) { res[k] = key[k] }
|
||||||
} else {
|
} else {
|
||||||
@ -10,90 +10,73 @@ var kit = {proto: function(sub, sup) { return sub.__proto__ = sup, sub },
|
|||||||
} return res },
|
} return res },
|
||||||
}
|
}
|
||||||
var ice = {
|
var ice = {
|
||||||
TB: "\t", SP: " ", DF: ":", EQ: "=", AT: "@", PS: "/", PT: ".", FS: ",", QS: "?", NL: "\n", LT: "<", GT: ">",
|
TB: "\t", SP: " ", DF: ":", EQ: "=", AT: "@", QS: "?", PS: "/", PT: ".", FS: ",", NL: "\n", LT: "<", GT: ">",
|
||||||
OK: "ok", TRUE: "true", FALSE: "false", SUCCESS: "success", FAILURE: "failure", PROCESS: "process",
|
OK: "ok", TRUE: "true", FALSE: "false", SUCCESS: "success", FAILURE: "failure", PROCESS: "process",
|
||||||
|
|
||||||
HTTP: "http", HTML: "html",
|
HTTP: "http", HELP: "help",
|
||||||
HOME: "home", MAIN: "main",
|
MAIN: "main", AUTO: "auto",
|
||||||
LIST: "list", BACK: "back",
|
LIST: "list", BACK: "back",
|
||||||
SHOW: "show", HIDE: "hide",
|
|
||||||
VIEW: "view", MODE: "mode",
|
|
||||||
COPY: "copy", HELP: "help",
|
|
||||||
AUTO: "auto", EXEC: "exec",
|
|
||||||
SHIP: "ship",
|
|
||||||
|
|
||||||
DEV: "dev", POD: "pod", CTX: "ctx", CMD: "cmd", ARG: "arg", OPT: "opt",
|
HOME: "home", COPY: "copy",
|
||||||
CAN: "can", MSG: "msg", RUN: "run", RES: "res", ERR: "err",
|
MODE: "mode", EXEC: "exec",
|
||||||
|
|
||||||
|
CAN: "can", POD: "pod", CTX: "ctx", CMD: "cmd", ARG: "arg",
|
||||||
|
|
||||||
|
MSG_FIELDS: "fields", MSG_SESSID: "sessid",
|
||||||
MSG_DETAIL: "detail", MSG_OPTION: "option", MSG_APPEND: "append", MSG_RESULT: "result",
|
MSG_DETAIL: "detail", MSG_OPTION: "option", MSG_APPEND: "append", MSG_RESULT: "result",
|
||||||
MSG_SESSID: "sessid", MSG_FIELDS: "fields",
|
|
||||||
|
|
||||||
MSG_SOURCE: "_source", MSG_TARGET: "_target",
|
|
||||||
MSG_HANDLE: "_handle", MSG_UPLOAD: "_upload",
|
MSG_HANDLE: "_handle", MSG_UPLOAD: "_upload",
|
||||||
|
MSG_SOURCE: "_source", MSG_TARGET: "_target",
|
||||||
MSG_ACTION: "_action", MSG_STATUS: "_status",
|
MSG_ACTION: "_action", MSG_STATUS: "_status",
|
||||||
|
|
||||||
MSG_INDEX: "_index",
|
MSG_INDEX: "_index",
|
||||||
|
MSG_PROCESS: "_process",
|
||||||
MSG_DISPLAY: "_display",
|
MSG_DISPLAY: "_display",
|
||||||
MSG_TOOLKIT: "_toolkit",
|
MSG_TOOLKIT: "_toolkit",
|
||||||
MSG_PROCESS: "_process",
|
PROCESS_REWRITE: "_rewrite",
|
||||||
PROCESS_AGAIN: "_again",
|
PROCESS_AGAIN: "_again",
|
||||||
PROCESS_FIELD: "_field",
|
PROCESS_FIELD: "_field",
|
||||||
PROCESS_REWRITE: "_rewrite",
|
|
||||||
MSG_PREFIX: "_prefix",
|
MSG_PREFIX: "_prefix",
|
||||||
MSG_METHOD: "_method",
|
MSG_METHOD: "_method",
|
||||||
|
|
||||||
MSG_USERNICK: "user.nick", MSG_USERNAME: "user.name", MSG_USERROLE: "user.role", MSG_LANGUAGE: "user.lang",
|
MSG_USERNICK: "user.nick", MSG_USERNAME: "user.name", MSG_USERROLE: "user.role", MSG_LANGUAGE: "user.lang",
|
||||||
MSG_TITLE: "sess.title", MSG_THEME: "sess.theme", MSG_RIVER: "sess.river", MSG_STORM: "sess.storm",
|
MSG_MODE: "sess.mode", MSG_THEME: "sess.theme", MSG_TITLE: "sess.title", MSG_RIVER: "sess.river", MSG_STORM: "sess.storm",
|
||||||
MSG_HEIGHT: "sess.height", MSG_WIDTH: "sess.width", MSG_MODE: "sess.mode", MSG_DAEMON: "sess.daemon",
|
MSG_DAEMON: "sess.daemon", LOG_DISABLE: "log.disable",
|
||||||
LOG_DISABLE: "log.disable",
|
|
||||||
|
|
||||||
ErrWarn: "warn: ", ErrNotLogin: "not login: ", ErrNotRight: "not right: ", ErrNotFound: "not found: ", ErrNotValid: "not valid: ",
|
ErrWarn: "warn: ", ErrNotLogin: "not login: ", ErrNotRight: "not right: ", ErrNotValid: "not valid: ", ErrNotFound: "not found: ",
|
||||||
CAN_PLUGIN: "can._plugin", CAN_DEBUG: "can.debug", LOG_DEBUG: "log.debug",
|
NFS: "nfs", USR: "usr", USR_VOLCANOS: "usr/volcanos/", CAN_PLUGIN: "can._plugin",
|
||||||
NFS: "nfs", USR: "usr", USR_VOLCANOS: "usr/volcanos/",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var ctx = {
|
var ctx = {
|
||||||
CONTEXT: "context", COMMAND: "command", CONFIG: "config", INPUTS: "inputs", FEATURE: "feature",
|
CONTEXT: "context", COMMAND: "command", CONFIG: "config", INPUTS: "inputs", FEATURE: "feature",
|
||||||
INDEX: "index", ARGS: "args", STYLE: "style", DISPLAY: "display", ACTION: "action",
|
INDEX: "index", ARGS: "args", STYLE: "style", DISPLAY: "display", ACTION: "action", RUN: "run",
|
||||||
EXTRA_INDEX: "extra.index", EXTRA_ARGS: "extra.args",
|
EXTRA_INDEX: "extra.index", EXTRA_ARGS: "extra.args",
|
||||||
RUN: "run",
|
|
||||||
}
|
}
|
||||||
var mdb = {
|
var mdb = {FOREACH: "*", RANDOMS: "%",
|
||||||
DICT: "dict", META: "meta", HASH: "hash", LIST: "list",
|
DICT: "dict", META: "meta", HASH: "hash", LIST: "list",
|
||||||
ID: "id", KEY: "key", TIME: "time", ZONE: "zone", TYPE: "type", NAME: "name", TEXT: "text",
|
ID: "id", KEY: "key", TIME: "time", ZONE: "zone", TYPE: "type", NAME: "name", TEXT: "text", DATA: "data", VIEW: "view",
|
||||||
DATA: "data", VIEW: "view", ICON: "icon", ICONS: "icons", LINK: "link", SCAN: "scan", HELP: "help",
|
LINK: "link", SCAN: "scan", HELP: "help", ICON: "icon", ICONS: "icons",
|
||||||
SHORT: "short", FIELD: "field", TOTAL: "total", COUNT: "count", LIMIT: "limit",
|
|
||||||
INDEX: "index", VALUE: "value", EXTRA: "extra", ALIAS: "alias", EXPIRE: "expire",
|
INDEX: "index", VALUE: "value", EXTRA: "extra", ALIAS: "alias", EXPIRE: "expire",
|
||||||
|
SHORT: "short", FIELD: "field", TOTAL: "total", COUNT: "count", LIMIT: "limit",
|
||||||
|
|
||||||
CREATE: "create", REMOVE: "remove", INSERT: "insert", DELETE: "delete", MODIFY: "modify", SELECT: "select",
|
INPUTS: "inputs", CREATE: "create", REMOVE: "remove", INSERT: "insert", DELETE: "delete", MODIFY: "modify", SELECT: "select",
|
||||||
INPUTS: "inputs", PRUNES: "prunes", EXPORT: "export", IMPORT: "import", REVERT: "revert", NORMAL: "normal",
|
PRUNES: "prunes", EXPORT: "export", IMPORT: "import",
|
||||||
SEARCH: "search", ENGINE: "engine", RENDER: "render", PLUGIN: "plugin",
|
SEARCH: "search", ENGINE: "engine", RENDER: "render", PLUGIN: "plugin",
|
||||||
DETAIL: "detail",
|
DETAIL: "detail", NORMAL: "normal", PRUNE: "prune",
|
||||||
PRUNE: "prune",
|
|
||||||
INFO: "info",
|
|
||||||
|
|
||||||
KEYS: "keys",
|
|
||||||
MAIN: "main", PAGE: "page", NEXT: "next", PREV: "prev", LIMIT: "limit", OFFEND: "offend",
|
MAIN: "main", PAGE: "page", NEXT: "next", PREV: "prev", LIMIT: "limit", OFFEND: "offend",
|
||||||
FOREACH: "*", RANDOMS: "%",
|
|
||||||
QS: ice.QS, AT: ice.AT,
|
QS: ice.QS, AT: ice.AT,
|
||||||
EQ: ice.EQ, FS: ice.FS,
|
EQ: ice.EQ, FS: ice.FS,
|
||||||
}
|
}
|
||||||
var web = {CHAT: "chat", STUDIO: "studio",
|
var web = {CHAT: "chat", PORTAL: "portal", STUDIO: "studio",
|
||||||
DREAM: "dream", SPACE: "space", ROUTE: "route", SPIDE: "spide", COUNT: "count", SHARE: "share",
|
SPIDE: "spide", SPACE: "space", ROUTE: "route", DREAM: "dream",
|
||||||
WEBSITE: "website", DRAW: "draw", PLAY: "play", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter", INPUT: "input",
|
SHARE: "share", COUNT: "count",
|
||||||
CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", DOWNLOAD: "download", TOIMAGE: "toimage",
|
|
||||||
CONFIRM: "confirm",
|
|
||||||
THEME: "theme",
|
|
||||||
PORTAL: "portal",
|
|
||||||
SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/",
|
|
||||||
WORKER: "worker", SERVER: "server", GATEWAY: "gateway",
|
WORKER: "worker", SERVER: "server", GATEWAY: "gateway",
|
||||||
OPEN: "open",
|
OPEN: "open", LINK: "link", HTTP: "http", URL: "url", SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/",
|
||||||
|
AT: ice.AT, QS: ice.QS,
|
||||||
|
|
||||||
AT: "@", QS: "?", LINK: "link", HTTP: "http",
|
DRAW: "draw", PLAY: "play", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter",
|
||||||
GET: "GET", PUT: "PUT", POST: "POST", DELETE: "DELETE",
|
CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", DOWNLOAD: "download", TOIMAGE: "toimage", CONFIRM: "confirm",
|
||||||
Accept: "Accept", ContentType: "Content-Type", ContentJSON: "application/json", ContentFORM: "application/x-www-form-urlencoded",
|
|
||||||
IMAGE_PNG: "image/png", VIDEO_WEBM: "video/webm",
|
|
||||||
URL: "url",
|
|
||||||
|
|
||||||
CODE_GIT_SEARCH: "web.code.git.search",
|
CODE_GIT_SEARCH: "web.code.git.search",
|
||||||
CODE_GIT_STATUS: "web.code.git.status",
|
CODE_GIT_STATUS: "web.code.git.status",
|
||||||
@ -113,18 +96,16 @@ var web = {CHAT: "chat", STUDIO: "studio",
|
|||||||
TEAM_PLAN: "web.team.plan",
|
TEAM_PLAN: "web.team.plan",
|
||||||
}
|
}
|
||||||
var aaa = {
|
var aaa = {
|
||||||
SESS: "sess",
|
LOGIN: "login", LOGOUT: "logout",
|
||||||
AUTH: "auth",
|
USER: "user", AUTH: "auth", SESS: "sess",
|
||||||
USER: "user",
|
USERNICK: "usernick", USERNAME: "username", PASSWORD: "password", USERROLE: "userrole",
|
||||||
EMAIL: "email",
|
EMAIL: "email", AVATAR: "avatar", BACKGROUND: "background",
|
||||||
LOGIN: "login", LOGOUT: "logout", INVITE: "invite", TOKEN: "token",
|
|
||||||
USERNICK: "usernick", USERNAME: "username", PASSWORD: "password", USERROLE: "userrole", BACKGROUND: "background", AVATAR: "avatar",
|
|
||||||
LANGUAGE: "language", ENGLISH: "english", CHINESE: "chinese",
|
LANGUAGE: "language", ENGLISH: "english", CHINESE: "chinese",
|
||||||
VOID: "void", TECH: "tech", ROOT: "root",
|
VOID: "void", TECH: "tech", ROOT: "root",
|
||||||
}
|
}
|
||||||
var lex = {
|
var lex = {
|
||||||
SPLIT: "split", PREFIX: "prefix", SUFFIX: "suffix",
|
SPLIT: "split", PARSE: "parse",
|
||||||
PARSE: "parse",
|
PREFIX: "prefix", SUFFIX: "suffix",
|
||||||
TB: ice.TB, SP: ice.SP, NL: ice.NL,
|
TB: ice.TB, SP: ice.SP, NL: ice.NL,
|
||||||
}
|
}
|
||||||
var yac = {
|
var yac = {
|
||||||
@ -138,33 +119,28 @@ var gdb = {
|
|||||||
}
|
}
|
||||||
var tcp = {
|
var tcp = {
|
||||||
HOST: "host", PORT: "port",
|
HOST: "host", PORT: "port",
|
||||||
SERVER: "server",
|
CLIENT: "client", SERVER: "server",
|
||||||
CLIENT: "client",
|
|
||||||
}
|
}
|
||||||
var nfs = {
|
var nfs = {
|
||||||
DIR: "dir", CAT: "cat", DEFS: "defs", PACK: "pack", TRASH: "trash", DIR_ROOT: "dir_root",
|
DIR: "dir", CAT: "cat", DEFS: "defs", PACK: "pack", TRASH: "trash", DIR_ROOT: "dir_root",
|
||||||
COPY: "copy", EDIT: "edit", SAVE: "save", LOAD: "load", FIND: "find", GREP: "grep", TAGS: "tags",
|
COPY: "copy", EDIT: "edit", SAVE: "save", LOAD: "load", FIND: "find", GREP: "grep", TAGS: "tags",
|
||||||
SUBJECT: "subject",
|
SUBJECT: "subject", CONTENT: "content", RECENT: "recent", SCRIPT: "script", SOURCE: "source", TARGET: "target",
|
||||||
CONTENT: "content", RECENT: "recent", SCRIPT: "script", MODULE: "module", SOURCE: "source", TARGET: "target", REPOS: "repos", MASTER: "master",
|
REPOS: "repos", MASTER: "master", MODULE: "module", PUSH: "push", PULL: "pull",
|
||||||
PATH: "path", FILE: "file", LINE: "line", SIZE: "size",
|
PATH: "path", FILE: "file", LINE: "line", SIZE: "size",
|
||||||
PUSH: "push", PULL: "pull",
|
|
||||||
REPLACE: "replace", FROM: "from", TO: "to",
|
REPLACE: "replace", FROM: "from", TO: "to",
|
||||||
SVG: "svg", HTML: "html", CSS: "css", JS: "js", SH: "sh", GO: "go", CSV: "csv", JSON: "json", SHY: "shy",
|
SVG: "svg", HTML: "html", CSS: "css", JS: "js", SH: "sh", GO: "go", CSV: "csv", JSON: "json", SHY: "shy",
|
||||||
TXT: "txt", PNG: "png", WEBM: "webm",
|
TXT: "txt", PNG: "png", WEBM: "webm",
|
||||||
_CSS: ".css", _JS: ".js",
|
_CSS: ".css", _JS: ".js",
|
||||||
PWD: "./", SRC: "src/", USR: "usr/", USR_LOCAL_WORK: "usr/local/work/", SRC_DOCUMENT: "src/document/",
|
PWD: "./", SRC: "src/", USR: "usr/", USR_LOCAL_WORK: "usr/local/work/", SRC_DOCUMENT: "src/document/", SRC_TEMPLATE: "src/template/",
|
||||||
DF: ice.DF, PS: ice.PS, PT: ice.PT,
|
DF: ice.DF, PS: ice.PS, PT: ice.PT,
|
||||||
SRC_TEMPLATE: "src/template/",
|
|
||||||
}
|
}
|
||||||
var cli = {
|
var cli = {
|
||||||
OPENS: "opens", SYSTEM: "system", DAEMON: "daemon", ORDER: "order", BUILD: "build",
|
RUNTIME: "runtime", SYSTEM: "system", DAEMON: "daemon", ORDER: "order", BUILD: "build", OPENS: "opens",
|
||||||
BEGIN: "begin", START: "start", OPEN: "open", CLOSE: "close", STOP: "stop", END: "end", RESTART: "restart",
|
BEGIN: "begin", END: "end", START: "start", RESTART: "restart", STOP: "stop", OPEN: "open", CLOSE: "close",
|
||||||
COLOR: "color", BLACK: "black", WHITE: "white", BLUE: "blue", RED: "red", GRAY: "gray", CYAN: "cyan", GREEN: "green", PURPLE: "purple", YELLOW: "yellow",
|
COLOR: "color", BLACK: "black", WHITE: "white", BLUE: "blue", RED: "red", GRAY: "gray", CYAN: "cyan", GREEN: "green", PURPLE: "purple", YELLOW: "yellow",
|
||||||
MAGENTA: "magenta", SILVER: "silver", ALICEBLUE: "aliceblue", TRANSPARENT: "transparent",
|
MAGENTA: "magenta", SILVER: "silver", ALICEBLUE: "aliceblue", TRANSPARENT: "transparent",
|
||||||
MAKE: "make", EXEC: "exec", DONE: "done", COST: "cost", FROM: "from", CLEAR: "clear",
|
|
||||||
LINUX: "linux", DARWIN: "darwin", WINDOWS: "windows",
|
LINUX: "linux", DARWIN: "darwin", WINDOWS: "windows",
|
||||||
RUN: "run",
|
DONE: "done", COST: "cost", FROM: "from",
|
||||||
RUNTIME: "runtime",
|
|
||||||
PWD: "pwd",
|
PWD: "pwd",
|
||||||
}
|
}
|
||||||
var log = {
|
var log = {
|
||||||
@ -222,16 +198,10 @@ var chat = {
|
|||||||
"local/wiki/feel.js",
|
"local/wiki/feel.js",
|
||||||
"local/wiki/word.js",
|
"local/wiki/word.js",
|
||||||
"local/team/plan.js",
|
"local/team/plan.js",
|
||||||
"local/mall/goods.js",
|
|
||||||
].map(function(p) { return "/plugin/"+p }),
|
].map(function(p) { return "/plugin/"+p }),
|
||||||
PLUGIN_LOCAL: "/plugin/local/",
|
PLUGIN_LOCAL: "/plugin/local/", PLUGIN_STORY: "/plugin/story/", PLUGIN_INPUT: "/plugin/input/",
|
||||||
PLUGIN_STORY: "/plugin/story/",
|
PLUGIN_INPUT_JS: "/plugin/input.js", PLUGIN_TABLE_JS: "/plugin/table.js", PLUGIN_STATE_JS: "/plugin/state.js",
|
||||||
PLUGIN_INPUT: "/plugin/input/",
|
|
||||||
PLUGIN_INPUT_JS: "/plugin/input.js",
|
|
||||||
PLUGIN_TABLE_JS: "/plugin/table.js",
|
|
||||||
PLUGIN_STATE_JS: "/plugin/state.js",
|
|
||||||
FRAME_JS: "/volcanos/frame.js",
|
FRAME_JS: "/volcanos/frame.js",
|
||||||
// ICONS_CSS: "/require/modules/bootstrap-icons/font/bootstrap-icons.min.css", // https://icons.getbootstrap.com/
|
|
||||||
|
|
||||||
ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap",
|
ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap",
|
||||||
ONIMPORT: "onimport", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport",
|
ONIMPORT: "onimport", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport",
|
||||||
@ -258,16 +228,9 @@ var mall = {
|
|||||||
ASSET: "asset", SALARY: "salary",
|
ASSET: "asset", SALARY: "salary",
|
||||||
}
|
}
|
||||||
|
|
||||||
var icon = {
|
|
||||||
SEARCH: "bi bi-search", TERMINAL: "bi bi-terminal",
|
|
||||||
}
|
|
||||||
var http = {
|
var http = {
|
||||||
GET: "GET", PUT: "PUT", POST: "POST", DELETE: "DELETE",
|
GET: "GET", PUT: "PUT", POST: "POST", DELETE: "DELETE",
|
||||||
ContentType: "Content-Type",
|
Accept: "Accept", ContentType: "Content-Type", ApplicationJSON: "application/json", ApplicationFORM: "application/x-www-form-urlencoded",
|
||||||
}
|
|
||||||
var mime = {
|
|
||||||
TextPlain: "text/plain",
|
|
||||||
ApplicationJSON: "application/json",
|
|
||||||
}
|
}
|
||||||
var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 32, ACTION_MARGIN: 200,
|
var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 32, ACTION_MARGIN: 200,
|
||||||
FIELDSET: "fieldset", LEGEND: "legend", OPTION: "option", ACTION: "action", OUTPUT: "output", STATUS: "status",
|
FIELDSET: "fieldset", LEGEND: "legend", OPTION: "option", ACTION: "action", OUTPUT: "output", STATUS: "status",
|
||||||
@ -316,6 +279,11 @@ var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 32, ACTION_MARGIN: 200,
|
|||||||
DIV_ITEM_SELECT: "div.item.select",
|
DIV_ITEM_SELECT: "div.item.select",
|
||||||
DIV_TABS_SELECT: "div.tabs.select",
|
DIV_TABS_SELECT: "div.tabs.select",
|
||||||
DIV_PROFILE: "div.profile", DIV_DISPLAY: "div.display",
|
DIV_PROFILE: "div.profile", DIV_DISPLAY: "div.display",
|
||||||
|
|
||||||
|
IMAGE_PNG: "image/png", VIDEO_WEBM: "video/webm",
|
||||||
|
}
|
||||||
|
var icon = {
|
||||||
|
SEARCH: "bi bi-search", TERMINAL: "bi bi-terminal",
|
||||||
}
|
}
|
||||||
var svg = {
|
var svg = {
|
||||||
GROUP: "group", PID: "pid", GRID: "grid",
|
GROUP: "group", PID: "pid", GRID: "grid",
|
||||||
|
4
frame.js
4
frame.js
@ -40,7 +40,7 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
|||||||
},
|
},
|
||||||
_engine: function(event, can, msg, panel, cmds, cb) { return false },
|
_engine: function(event, can, msg, panel, cmds, cb) { return false },
|
||||||
_plugin: function(event, can, msg, panel, cmds, cb) {
|
_plugin: function(event, can, msg, panel, cmds, cb) {
|
||||||
if (cmds[0] == ctx.ACTION && cmds[1] == ice.RUN) { var p = can.onengine.plugin(can, cmds[2])
|
if (cmds[0] == ctx.ACTION && cmds[1] == ctx.RUN) { var p = can.onengine.plugin(can, cmds[2])
|
||||||
if (p) { return can.core.CallFunc(p, {can: p.can||panel, sub: msg._can, msg: msg, arg: cmds.slice(3), cmds: cmds.slice(3), cb: cb, meta: p.meta}), true }
|
if (p) { return can.core.CallFunc(p, {can: p.can||panel, sub: msg._can, msg: msg, arg: cmds.slice(3), cmds: cmds.slice(3), cb: cb, meta: p.meta}), true }
|
||||||
}
|
}
|
||||||
var p = can.onengine.plugin(can, cmds[0]), n = 1; if (!p) { return false }
|
var p = can.onengine.plugin(can, cmds[0]), n = 1; if (!p) { return false }
|
||||||
@ -443,7 +443,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
var value = can.onengine.plugin(can, meta.index); if (value) { can.onappend._plugin(can, value, meta, function(sub, meta, skip) {
|
var value = can.onengine.plugin(can, meta.index); if (value) { can.onappend._plugin(can, value, meta, function(sub, meta, skip) {
|
||||||
value.meta && value.meta._init && value.meta._init(sub, meta), _cb(sub, meta, skip)
|
value.meta && value.meta._init && value.meta._init(sub, meta), _cb(sub, meta, skip)
|
||||||
}, target, field); return res }
|
}, target, field); return res }
|
||||||
can.runAction(can.request({}, {_method: web.GET, pod: meta.space})._caller(), ctx.COMMAND, [meta.index], function(msg) { msg.Table(function(value) { can.onappend._plugin(can, value, meta, _cb, target, field) })}); return res
|
can.runAction(can.request({}, {_method: http.GET, pod: meta.space})._caller(), ctx.COMMAND, [meta.index], function(msg) { msg.Table(function(value) { can.onappend._plugin(can, value, meta, _cb, target, field) })}); return res
|
||||||
},
|
},
|
||||||
_plugin: function(can, value, meta, cb, target, field) { can.base.Copy(meta, value, true)
|
_plugin: function(can, value, meta, cb, target, field) { can.base.Copy(meta, value, true)
|
||||||
meta.type = meta.type||chat.STORY, meta.name = meta.name||value.meta&&value.meta.name||"", meta.help = meta.help||value.help||"", meta.height = meta.height||can.ConfHeight()-2*html.ACTION_HEIGHT, meta.width = meta.width||can.ConfWidth()
|
meta.type = meta.type||chat.STORY, meta.name = meta.name||value.meta&&value.meta.name||"", meta.help = meta.help||value.help||"", meta.height = meta.height||can.ConfHeight()-2*html.ACTION_HEIGHT, meta.width = meta.width||can.ConfWidth()
|
||||||
|
@ -458,7 +458,7 @@ fieldset.dream>div.output.card>div.item>div.title>img { height:48px; width:48px
|
|||||||
fieldset.dream>div.output.card>div.item>div.title>span { line-height:48px; margin-left:10px; }
|
fieldset.dream>div.output.card>div.item>div.title>span { line-height:48px; margin-left:10px; }
|
||||||
fieldset.inner.float>div.status { display:none; }
|
fieldset.inner.float>div.status { display:none; }
|
||||||
fieldset.trans>div.output>fieldset{ margin:10px; }
|
fieldset.trans>div.output>fieldset{ margin:10px; }
|
||||||
fieldset.trans>form.option>div.item>input { width:240px; }
|
fieldset.trans>form.option>div.item.text>input { width:240px; }
|
||||||
fieldset.inner>form.option input[name=path] { width:80px !important; }
|
fieldset.inner>form.option input[name=path] { width:80px !important; }
|
||||||
fieldset.inner>form.option input[name=file] { width:160px !important; }
|
fieldset.inner>form.option input[name=file] { width:160px !important; }
|
||||||
fieldset.inner>div.output>div.project div.item.modify { background-color:#00800036; }
|
fieldset.inner>div.output>div.project div.item.modify { background-color:#00800036; }
|
||||||
|
@ -45,7 +45,7 @@ Volcanos("core", {
|
|||||||
} return begin > -1 && (s? push({type: code.STRING, text: str.slice(begin), left: s, right: ""}): push(str.slice(begin))), res
|
} return begin > -1 && (s? push({type: code.STRING, text: str.slice(begin), left: s, right: ""}): push(str.slice(begin))), res
|
||||||
},
|
},
|
||||||
SplitInput: function(item, type) { if (typeof item == code.OBJECT) { return item } type = type||html.TEXT; switch (item) {
|
SplitInput: function(item, type) { if (typeof item == code.OBJECT) { return item } type = type||html.TEXT; switch (item) {
|
||||||
case ice.RUN: return {type: html.BUTTON, name: item}
|
case ctx.RUN: return {type: html.BUTTON, name: item}
|
||||||
case ice.LIST: return {type: html.BUTTON, name: item, action: ice.AUTO}
|
case ice.LIST: return {type: html.BUTTON, name: item, action: ice.AUTO}
|
||||||
case ice.BACK: return {type: html.BUTTON, name: item}
|
case ice.BACK: return {type: html.BUTTON, name: item}
|
||||||
case mdb.NAME: return {type: html.TEXT, name: item}
|
case mdb.NAME: return {type: html.TEXT, name: item}
|
||||||
|
20
lib/misc.js
20
lib/misc.js
@ -3,13 +3,13 @@ Volcanos("misc", {
|
|||||||
RunAction: function(event, sub, cmds, meta) { var msg = can.request(event); meta = meta || sub&&sub.onaction || {}
|
RunAction: function(event, sub, cmds, meta) { var msg = can.request(event); meta = meta || sub&&sub.onaction || {}
|
||||||
if (!msg._method) {
|
if (!msg._method) {
|
||||||
if (!cmds || cmds.length == 0 || cmds[0] != ctx.ACTION) {
|
if (!cmds || cmds.length == 0 || cmds[0] != ctx.ACTION) {
|
||||||
msg._method = web.GET
|
msg._method = http.GET
|
||||||
} else if (can.base.isIn(cmds[1], mdb.CREATE, mdb.INSERT)) {
|
} else if (can.base.isIn(cmds[1], mdb.CREATE, mdb.INSERT)) {
|
||||||
msg._method = web.PUT
|
msg._method = http.PUT
|
||||||
} else if (can.base.isIn(cmds[1], mdb.REMOVE, mdb.DELETE)) {
|
} else if (can.base.isIn(cmds[1], mdb.REMOVE, mdb.DELETE)) {
|
||||||
msg._method = web.DELETE
|
msg._method = http.DELETE
|
||||||
} else {
|
} else {
|
||||||
msg._method = web.POST
|
msg._method = http.POST
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION && can.base.isFunc(meta[cmds[1]])) { msg.Option(ice.MSG_HANDLE, ice.TRUE)
|
if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION && can.base.isFunc(meta[cmds[1]])) { msg.Option(ice.MSG_HANDLE, ice.TRUE)
|
||||||
@ -87,18 +87,18 @@ Volcanos("misc", {
|
|||||||
},
|
},
|
||||||
POST: function(can, msg, url, form, cb, cbs) { var xhr = new XMLHttpRequest(), begin = new Date(); msg._xhr = xhr
|
POST: function(can, msg, url, form, cb, cbs) { var xhr = new XMLHttpRequest(), begin = new Date(); msg._xhr = xhr
|
||||||
var data = can.core.ItemForm(form, function(v, i, k) { return k+mdb.EQ+encodeURIComponent(v) }).join("&")
|
var data = can.core.ItemForm(form, function(v, i, k) { return k+mdb.EQ+encodeURIComponent(v) }).join("&")
|
||||||
if (can.base.isIn(msg._method, web.GET, web.DELETE)) { url += (url.indexOf("?") == -1? "?": "&")+data, data = "" }
|
if (can.base.isIn(msg._method, http.GET, http.DELETE)) { url += (url.indexOf("?") == -1? "?": "&")+data, data = "" }
|
||||||
xhr.open(msg._method||web.POST, url), xhr.onreadystatechange = function() { if (xhr.readyState != 4) { return }
|
xhr.open(msg._method||http.POST, url), xhr.onreadystatechange = function() { if (xhr.readyState != 4) { return }
|
||||||
try { var res = JSON.parse(xhr.responseText) } catch (e) { var res = {result: [xhr.responseText]} } msg.Option("_cost", new Date() - begin)
|
try { var res = JSON.parse(xhr.responseText) } catch (e) { var res = {result: [xhr.responseText]} } msg.Option("_cost", new Date() - begin)
|
||||||
if (xhr.status == 200) { return msg.detail || (msg.detail = res.detail), can.base.isFunc(cb) && cb(msg.Copy(res)) }
|
if (xhr.status == 200) { return msg.detail || (msg.detail = res.detail), can.base.isFunc(cb) && cb(msg.Copy(res)) }
|
||||||
can.user.toastFailure(can, xhr.response, url), can.misc.Warn(xhr.status, res, url, form)
|
can.user.toastFailure(can, xhr.response, url), can.misc.Warn(xhr.status, res, url, form)
|
||||||
cbs && cbs(xhr)
|
cbs && cbs(xhr)
|
||||||
}, xhr.setRequestHeader(web.Accept, msg._accept||web.ContentJSON)
|
}, xhr.setRequestHeader(http.Accept, msg._accept||http.ApplicationJSON)
|
||||||
if (msg._upload) { var data = new FormData(); can.core.ItemForm(form, function(v, i, k) { data.append(k, v) })
|
if (msg._upload) { var data = new FormData(); can.core.ItemForm(form, function(v, i, k) { data.append(k, v) })
|
||||||
data.append(ice.MSG_UPLOAD, web.UPLOAD), data.append(web.UPLOAD, msg._upload)
|
data.append(ice.MSG_UPLOAD, web.UPLOAD), data.append(web.UPLOAD, msg._upload)
|
||||||
xhr.upload.onprogress = function(event) { can.base.isFunc(msg._progress) && msg._progress(event, parseInt(event.loaded*100/event.total), event.total, event.loaded) }
|
xhr.upload.onprogress = function(event) { can.base.isFunc(msg._progress) && msg._progress(event, parseInt(event.loaded*100/event.total), event.total, event.loaded) }
|
||||||
} else {
|
} else {
|
||||||
xhr.setRequestHeader(web.ContentType, web.ContentFORM)
|
xhr.setRequestHeader(http.ContentType, http.ApplicationFORM)
|
||||||
} try { xhr.send(data) } catch(e) { can.misc.Warn(e), cbs && cbs(e) }
|
} try { xhr.send(data) } catch(e) { can.misc.Warn(e), cbs && cbs(e) }
|
||||||
},
|
},
|
||||||
WSS: function(can, args, cb, onopen, onclose, onerror, _msg) { if (can.user.isIE) { return }
|
WSS: function(can, args, cb, onopen, onclose, onerror, _msg) { if (can.user.isIE) { return }
|
||||||
@ -149,14 +149,14 @@ Volcanos("misc", {
|
|||||||
},
|
},
|
||||||
MergeURL: function(can, obj, clear) { var path = location.pathname; obj._path && (path = obj._path), delete(obj._path)
|
MergeURL: function(can, obj, clear) { var path = location.pathname; obj._path && (path = obj._path), delete(obj._path)
|
||||||
can.misc.Search(can, log.DEBUG) && (obj.debug = ice.TRUE); var hash = obj._hash||""; delete(obj._hash)
|
can.misc.Search(can, log.DEBUG) && (obj.debug = ice.TRUE); var hash = obj._hash||""; delete(obj._hash)
|
||||||
var args = [web.CHAT]; can.core.List([ice.POD, ice.CMD, web.WEBSITE], function(key) { obj[key] && args.push(key, obj[key]), delete(obj[key]) })
|
var args = [web.CHAT]; can.core.List([ice.POD, ice.CMD], function(key) { obj[key] && args.push(key, obj[key]), delete(obj[key]) })
|
||||||
var _location = location; if (can.user.isExtension) { var _location = new URL(Volcanos.meta.iceberg) }
|
var _location = location; if (can.user.isExtension) { var _location = new URL(Volcanos.meta.iceberg) }
|
||||||
return can.base.MergeURL(_location.origin+(args.length == 1? path: nfs.PS+args.join(nfs.PS))+(clear? "": _location.search), obj)+(hash? "#"+hash: "")
|
return can.base.MergeURL(_location.origin+(args.length == 1? path: nfs.PS+args.join(nfs.PS))+(clear? "": _location.search), obj)+(hash? "#"+hash: "")
|
||||||
},
|
},
|
||||||
ParseURL: function(can, url) { url = url||location.href; var args = can.base.ParseURL(url), _location = new URL(url)
|
ParseURL: function(can, url) { url = url||location.href; var args = can.base.ParseURL(url), _location = new URL(url)
|
||||||
delete(args.link), delete(args.origin), delete(args._origin)
|
delete(args.link), delete(args.origin), delete(args._origin)
|
||||||
var ls = can.core.Split(_location.pathname, nfs.PS); if (ls[0] == chat.SHARE) { args[chat.SHARE] = ls[1] }
|
var ls = can.core.Split(_location.pathname, nfs.PS); if (ls[0] == chat.SHARE) { args[chat.SHARE] = ls[1] }
|
||||||
for (var i = 1; i < ls.length; i += 2) { if (can.base.isIn(ls[i], [ice.POD, ice.CMD, web.WEBSITE])) { args[ls[i]] = ls[i+1] } }
|
for (var i = 1; i < ls.length; i += 2) { if (can.base.isIn(ls[i], [ice.POD, ice.CMD])) { args[ls[i]] = ls[i+1] } }
|
||||||
return args
|
return args
|
||||||
},
|
},
|
||||||
SplitPath: function(can, path) {
|
SplitPath: function(can, path) {
|
||||||
|
@ -337,7 +337,7 @@ Volcanos("page", {
|
|||||||
var canvas = can.page.Create(can, html.CANVAS, {width: size, height: size}), ctx = canvas.getContext("2d")
|
var canvas = can.page.Create(can, html.CANVAS, {width: size, height: size}), ctx = canvas.getContext("2d")
|
||||||
ctx.fillStyle = colors[Math.floor(Math.random()*(colors.length))], ctx.fillRect(margin, margin, size-2*margin, size-2*margin)
|
ctx.fillStyle = colors[Math.floor(Math.random()*(colors.length))], ctx.fillRect(margin, margin, size-2*margin, size-2*margin)
|
||||||
ctx.fillStyle = cli.WHITE, ctx.font = (fonts||can.base.Min(size/text.length-30, 16))+"px Arial", ctx.textAlign = "center", ctx.textBaseline = "middle", ctx.fillText(text, size/2, size/2)
|
ctx.fillStyle = cli.WHITE, ctx.font = (fonts||can.base.Min(size/text.length-30, 16))+"px Arial", ctx.textAlign = "center", ctx.textBaseline = "middle", ctx.fillText(text, size/2, size/2)
|
||||||
return canvas.toDataURL(web.IMAGE_PNG, 1)
|
return canvas.toDataURL(html.IMAGE_PNG, 1)
|
||||||
},
|
},
|
||||||
position: function(event, target) { var p = target.getBoundingClientRect(); return {x: event.clientX - p.x, y: event.clientY - p.y} },
|
position: function(event, target) { var p = target.getBoundingClientRect(); return {x: event.clientX - p.x, y: event.clientY - p.y} },
|
||||||
theme: function(cb) {
|
theme: function(cb) {
|
||||||
@ -353,7 +353,7 @@ Volcanos("page", {
|
|||||||
return action
|
return action
|
||||||
},
|
},
|
||||||
buttonStyle: function(can, name) {
|
buttonStyle: function(can, name) {
|
||||||
return can.base.isIn(name, mdb.CREATE, mdb.INSERT, cli.RESTART, cli.START, cli.BUILD, cli.RUN, web.OPEN, "startall", "clone")? "notice":
|
return can.base.isIn(name, mdb.CREATE, mdb.INSERT, cli.RESTART, cli.START, cli.BUILD, ctx.RUN, web.OPEN, "startall", "clone")? "notice":
|
||||||
can.base.isIn(name, mdb.REMOVE, mdb.DELETE, mdb.PRUNES, mdb.PRUNE, nfs.TRASH, "drop", cli.STOP, "stopall")? "danger": ""
|
can.base.isIn(name, mdb.REMOVE, mdb.DELETE, mdb.PRUNES, mdb.PRUNE, nfs.TRASH, "drop", cli.STOP, "stopall")? "danger": ""
|
||||||
},
|
},
|
||||||
exportValue: function(can, msg) {
|
exportValue: function(can, msg) {
|
||||||
|
45
lib/user.js
45
lib/user.js
@ -202,7 +202,7 @@ Volcanos("user", {
|
|||||||
},
|
},
|
||||||
upload: function(event, can, cb, silent) { var begin = new Date()
|
upload: function(event, can, cb, silent) { var begin = new Date()
|
||||||
var ui = can.page.Append(can, document.body, [{view: [[html.UPLOAD, chat.FLOAT]], list: [
|
var ui = can.page.Append(can, document.body, [{view: [[html.UPLOAD, chat.FLOAT]], list: [
|
||||||
html.ACTION, {view: html.OUTPUT, list: ["progress"]}, {view: html.STATUS, list: [ice.SHOW, cli.COST, nfs.SIZE]},
|
html.ACTION, {view: html.OUTPUT, list: ["progress"]}, {view: html.STATUS, list: [html.SHOW, cli.COST, nfs.SIZE]},
|
||||||
]}]); can.onlayout.figure(event, can, ui._target)
|
]}]); can.onlayout.figure(event, can, ui._target)
|
||||||
var action = can.onappend._action(can, [{type: html.UPLOAD, onchange: function(event) { action.show(event, 0, event.target.files[0].size, 0) }}, {type: html.BUTTON, name: cli.CLOSE}], ui.action, {
|
var action = can.onappend._action(can, [{type: html.UPLOAD, onchange: function(event) { action.show(event, 0, event.target.files[0].size, 0) }}, {type: html.BUTTON, name: cli.CLOSE}], ui.action, {
|
||||||
begin: function(event) { begin = new Date()
|
begin: function(event) { begin = new Date()
|
||||||
@ -225,7 +225,7 @@ Volcanos("user", {
|
|||||||
},
|
},
|
||||||
toimage: function(can, name, target, silent) { var toast = can.user.toastProcess(can, "生成中...")
|
toimage: function(can, name, target, silent) { var toast = can.user.toastProcess(can, "生成中...")
|
||||||
can.require(["/require/modules/html2canvas/dist/html2canvas.min.js"], function() { toast.close()
|
can.require(["/require/modules/html2canvas/dist/html2canvas.min.js"], function() { toast.close()
|
||||||
html2canvas(target||can._target).then(function (canvas) { var url = canvas.toDataURL(web.IMAGE_PNG)
|
html2canvas(target||can._target).then(function (canvas) { var url = canvas.toDataURL(html.IMAGE_PNG)
|
||||||
silent? (can.user.download(can, url, name, nfs.PNG), can.user.toastSuccess(can)): can.user.toastImage(can, name, url)
|
silent? (can.user.download(can, url, name, nfs.PNG), can.user.toastSuccess(can)): can.user.toastImage(can, name, url)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -235,45 +235,22 @@ Volcanos("user", {
|
|||||||
can.user.input(event, can, [{name: mdb.NAME, value: name}], function(list) { can.user.download(can, url, list[0], nfs.PNG) })
|
can.user.input(event, can, [{name: mdb.NAME, value: name}], function(list) { can.user.download(can, url, list[0], nfs.PNG) })
|
||||||
}), resize: html.IMG,
|
}), resize: html.IMG,
|
||||||
}) },
|
}) },
|
||||||
login: function(can, cb, method, sso) { var trans = kit.Dict(aaa.USERNAME, "用户", aaa.PASSWORD, "密码", aaa.LOGIN, "登录")
|
login: function(can, cb, msg) { can.misc.CookieSessid(can, "")
|
||||||
function layout() { can.page.style(can, ui._target, {left: (window.innerWidth-ui._target.offsetWidth)/2, top: window.innerHeight/8}) }
|
function layout() { can.page.style(can, ui._target, {left: (window.innerWidth-ui._target.offsetWidth)/2, top: window.innerHeight/8}) }
|
||||||
function button(list) { return {view: [html.ITEM, html.TR], list: [{type: html.TD}, {type: html.TD, list: can.core.Item(list, function(key, cb) {
|
|
||||||
return {type: html.INPUT, value: can.user.trans(can, key, trans), data: {type: html.BUTTON}, onclick: cb}
|
|
||||||
}) }]} }
|
|
||||||
function input(name, type) { return {view: [html.ITEM, html.TR], list: [
|
|
||||||
{type: html.TD, list: [{text: can.user.trans(can, name, trans)}]},
|
|
||||||
{type: html.TD, list: [{type: html.INPUT, name: name, data: {type: type||html.TEXT}}]},
|
|
||||||
]} }
|
|
||||||
var _sso = can.core.Item(sso, function(key, value) {
|
|
||||||
return value.url && {view: "sso", list: [{img: can.misc.Resource(can, value.icon)}, {text: key}], onclick: function() { can.user.jumps(value.url) }}
|
|
||||||
})
|
|
||||||
can.misc.CookieSessid(can, "")
|
|
||||||
var ui = can.onappend.tabview(can, {
|
var ui = can.onappend.tabview(can, {
|
||||||
"扫码授权": function(target) { var socket = can.misc.WSS(can, {type: aaa.LOGIN}, function(cmd, arg) {
|
"扫码授权": function(target) { var socket = can.misc.WSS(can, {type: aaa.LOGIN}, function(cmd, arg) {
|
||||||
if (cmd == cli.PWD) { var _cmd = " space login "+arg[0]; return can.page.Modify(can, target, arg[2]), can.page.Append(can, target, [
|
if (cmd == cli.PWD) { var _cmd = " space login "+arg[0]; can.onmotion.delay(can, function() { layout() })
|
||||||
{text: "<br/>或命令授权: "}, {text: [_cmd, "", html.ITEM], title: "点击复制,并后台执行此命令,即可登录", style: {cursor: "copy"}, onclick: function() { can.user.copy(event, can, _cmd) }},
|
return can.page.Modify(can, target, arg[2]), can.page.Append(can, target, [
|
||||||
].concat(_sso)), can.onmotion.delay(can, function() { layout() }, 10) }
|
{text: "<br/>或命令授权: "}, {text: [_cmd, "", html.ITEM], title: "点击复制,并后台执行此命令,即可登录", style: {cursor: "copy"}, onclick: function() { can.user.copy(event, can, _cmd) }},
|
||||||
if (cmd == ice.MSG_SESSID) { can.onmotion.delay(can, function() { socket.close() })
|
].concat(msg.Table(function(value) {
|
||||||
|
return {view: "sso", list: [{img: can.misc.Resource(can, value.icon)}, {text: value.name}], onclick: function() { can.user.jumps(value.url) }}
|
||||||
|
})))
|
||||||
|
} else if (cmd == ice.MSG_SESSID) { can.onmotion.delay(can, function() { socket.close() })
|
||||||
if (!can.misc.CookieSessid(can, arg[0])) { can.user.info.sessid = arg[0] }
|
if (!can.misc.CookieSessid(can, arg[0])) { can.user.info.sessid = arg[0] }
|
||||||
return can.page.Remove(can, ui._target), can.base.isFunc(cb) && cb(), cb = null
|
return can.page.Remove(can, ui._target), can.base.isFunc(cb) && cb(), cb = null
|
||||||
}
|
}
|
||||||
}) },
|
}) },
|
||||||
"密码登录": function(target) {
|
}, ["扫码授权"], can.page.Append(can, document.body, [{view: "input login float"}])._target); can.onmotion.delay(can, function() { layout() })
|
||||||
var _ui = can.page.Append(can, target, [input(aaa.USERNAME), input(aaa.PASSWORD, aaa.PASSWORD), button(kit.Dict(aaa.LOGIN, function(event) {
|
|
||||||
can.runAction(event, aaa.LOGIN, [_ui.username.value, _ui.password.value], function(msg) {
|
|
||||||
if (!msg.Option(ice.MSG_USERNAME)) { return can.user.toastFailure(can, "用户或密码错误") }
|
|
||||||
can.page.Remove(can, ui._target), can.base.isFunc(cb) && cb()
|
|
||||||
})
|
|
||||||
}))]); can.page.Append(can, target, _sso)
|
|
||||||
can.misc.WSS(can, {type: aaa.LOGIN}, function(cmd, arg) {
|
|
||||||
if (cmd == ice.MSG_SESSID) {
|
|
||||||
if (!can.misc.CookieSessid(can, arg[0])) { can.user.info.sessid = arg[0] }
|
|
||||||
return can.page.Remove(can, ui._target), can.base.isFunc(cb) && cb()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}, can.base.Obj(method, can.user.isMobile? ["密码登录"]: ["扫码授权"]), can.page.Append(can, document.body, [{view: "input login float"}])._target)
|
|
||||||
can.onmotion.delay(can, function() { layout() })
|
|
||||||
},
|
},
|
||||||
logout: function(can) { can.user.toastConfirm(can, aaa.LOGOUT, "", function() { can.runAction({}, aaa.LOGOUT, [], function(msg) {
|
logout: function(can) { can.user.toastConfirm(can, aaa.LOGOUT, "", function() { can.runAction({}, aaa.LOGOUT, [], function(msg) {
|
||||||
can.misc.CookieSessid(can, ""), can.misc.Search(can, chat.SHARE)? can.misc.Search(can, chat.SHARE, ""): can.user.reload(true)
|
can.misc.CookieSessid(can, ""), can.misc.Search(can, chat.SHARE)? can.misc.Search(can, chat.SHARE, ""): can.user.reload(true)
|
||||||
|
@ -51,7 +51,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
|||||||
if (can.onmotion.cache(can, function(save, load) { save({plugins: can._plugins})
|
if (can.onmotion.cache(can, function(save, load) { save({plugins: can._plugins})
|
||||||
return load(can.core.Keys(can.Conf(chat.RIVER, river), can.Conf(chat.STORM, storm)), function(bak) { can._plugins = bak.plugins })
|
return load(can.core.Keys(can.Conf(chat.RIVER, river), can.Conf(chat.STORM, storm)), function(bak) { can._plugins = bak.plugins })
|
||||||
}, can._output, can._action, can._header_tabs)) { if (msg.Option("refresh") != "true") { return can.onaction.layout(can) } }
|
}, can._output, can._action, can._header_tabs)) { if (msg.Option("refresh") != "true") { return can.onaction.layout(can) } }
|
||||||
can.run(can.request({}, {_method: web.GET}), [river, storm], function(msg) {
|
can.run(can.request({}, {_method: http.GET}), [river, storm], function(msg) {
|
||||||
if (msg.Length() == 0) { return can.user.isLocalFile? can.user.toastFailure(can, "miss data"): can.onengine.signal(can, chat.ONACTION_NOTOOL, can.request({}, {river: river, storm: storm})) }
|
if (msg.Length() == 0) { return can.user.isLocalFile? can.user.toastFailure(can, "miss data"): can.onengine.signal(can, chat.ONACTION_NOTOOL, can.request({}, {river: river, storm: storm})) }
|
||||||
return can.onimport._init(can, msg)
|
return can.onimport._init(can, msg)
|
||||||
})
|
})
|
||||||
@ -192,7 +192,7 @@ Volcanos(chat.ONKEYMAP, {
|
|||||||
toggleLayout: function(can, layout) { can.onaction.layout(can, can.onexport.layout(can) == layout? ice.AUTO: layout) },
|
toggleLayout: function(can, layout) { can.onaction.layout(can, can.onexport.layout(can) == layout? ice.AUTO: layout) },
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONPLUGIN, {_plugin: shy("默认插件", [mdb.NAME, ice.LIST, ice.BACK]),
|
Volcanos(chat.ONPLUGIN, {_plugin: shy("默认插件", [mdb.NAME, ice.LIST, ice.BACK]),
|
||||||
layout: shy("界面布局", {_init: function(can) { can.Option(chat.LAYOUT, can.getAction(chat.LAYOUT)) }}, ["layout:select=auto,tabs,tabview,horizon,vertical,grid,free,flow,page", ice.RUN], function(can, msg, arg) {
|
layout: shy("界面布局", {_init: function(can) { can.Option(chat.LAYOUT, can.getAction(chat.LAYOUT)) }}, ["layout:select=auto,tabs,tabview,horizon,vertical,grid,free,flow,page", ctx.RUN], function(can, msg, arg) {
|
||||||
can.onaction.layout(can, arg[0])
|
can.onaction.layout(can, arg[0])
|
||||||
}),
|
}),
|
||||||
"parse": shy("生成网页", {
|
"parse": shy("生成网页", {
|
||||||
|
@ -17,7 +17,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(NKEY, can.
|
|||||||
_command: function(can, msg, target) { can.onappend.input(can, {type: html.TEXT, icon: icon.TERMINAL, name: ice.CMD, onkeydown: function(event) { can.onkeymap.input(event, can)
|
_command: function(can, msg, target) { can.onappend.input(can, {type: html.TEXT, icon: icon.TERMINAL, name: ice.CMD, onkeydown: function(event) { can.onkeymap.input(event, can)
|
||||||
function close() { can.ui.cli && can.ui.cli.onaction.close() } if (event.key == code.ESCAPE) { return close() } if (event.key != code.ENTER) { return }
|
function close() { can.ui.cli && can.ui.cli.onaction.close() } if (event.key == code.ESCAPE) { return close() } if (event.key != code.ENTER) { return }
|
||||||
close(); switch (event.target.value) {
|
close(); switch (event.target.value) {
|
||||||
case cli.CLEAR:
|
case web.CLEAR:
|
||||||
case cli.CLOSE: break
|
case cli.CLOSE: break
|
||||||
default: var list = can.core.Split(event.target.value, lex.SP)
|
default: var list = can.core.Split(event.target.value, lex.SP)
|
||||||
can.onexport._float(can, "cli", list[0], list.slice(1), function(sub) { can.getActionSize(function(left) { can.page.style(can, sub._target, html.LEFT, left+10, html.RIGHT, "") }) })
|
can.onexport._float(can, "cli", list[0], list.slice(1), function(sub) { can.getActionSize(function(left) { can.page.style(can, sub._target, html.LEFT, left+10, html.RIGHT, "") }) })
|
||||||
@ -31,7 +31,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(NKEY, can.
|
|||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {_init: function(can) {},
|
Volcanos(chat.ONACTION, {_init: function(can) {},
|
||||||
onsize: function(can) { can.ConfHeight(can._target.offsetHeight), can.ConfWidth(can._target.offsetWidth) },
|
onsize: function(can) { can.ConfHeight(can._target.offsetHeight), can.ConfWidth(can._target.offsetWidth) },
|
||||||
onlogin: function(can, msg) { can.run(can.request({}, {_method: web.GET}), [], function(msg) { can.onmotion.clear(can), can.onimport._init(can, msg, can._output) }) },
|
onlogin: function(can, msg) { can.run(can.request({}, {_method: http.GET}), [], function(msg) { can.onmotion.clear(can), can.onimport._init(can, msg, can._output) }) },
|
||||||
ontoast: function(can, msg) { can.core.CallFunc(can.onimport.ntip, {can: can, msg: msg}) },
|
ontoast: function(can, msg) { can.core.CallFunc(can.onimport.ntip, {can: can, msg: msg}) },
|
||||||
onremote: function(can, msg) { can.core.CallFunc(can.onimport.ncmd, {can: can, msg: msg}) },
|
onremote: function(can, msg) { can.core.CallFunc(can.onimport.ncmd, {can: can, msg: msg}) },
|
||||||
onlayout: function(can, layout) { can.onmotion.toggle(can, can._target, !layout || layout == html.TABS) },
|
onlayout: function(can, layout) { can.onmotion.toggle(can, can._target, !layout || layout == html.TABS) },
|
||||||
@ -42,7 +42,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {},
|
|||||||
can.runAction(msg, msg.Option(ctx.ACTION), [msg.Option(ctx.INDEX)], function(_msg) {
|
can.runAction(msg, msg.Option(ctx.ACTION), [msg.Option(ctx.INDEX)], function(_msg) {
|
||||||
_msg.Table(function(item) { item.mode = chat.FLOAT
|
_msg.Table(function(item) { item.mode = chat.FLOAT
|
||||||
can.onappend.plugin(can, item, function(sub) {
|
can.onappend.plugin(can, item, function(sub) {
|
||||||
sub.run = function(event, cmds, cb) { can.run(can.request(event, {_method: http.POST, space: sub.Conf(web.SPACE)}), [ctx.ACTION, msg.Option(ctx.ACTION), ice.RUN].concat(cmds), cb) }
|
sub.run = function(event, cmds, cb) { can.run(can.request(event, {_method: http.POST, space: sub.Conf(web.SPACE)}), [ctx.ACTION, msg.Option(ctx.ACTION), ctx.RUN].concat(cmds), cb) }
|
||||||
can.getActionSize(function(left, top, width, height) { sub.onimport.size(sub, sub.ConfHeight(height/2), sub.ConfWidth(width), true)
|
can.getActionSize(function(left, top, width, height) { sub.onimport.size(sub, sub.ConfHeight(height/2), sub.ConfWidth(width), true)
|
||||||
can.onmotion.move(can, sub._target, {left: left||0, top: (top||0)+height/4})
|
can.onmotion.move(can, sub._target, {left: left||0, top: (top||0)+height/4})
|
||||||
}), sub.onaction.close = function() { can.page.Remove(can, sub._target) }
|
}), sub.onaction.close = function() { can.page.Remove(can, sub._target) }
|
||||||
|
@ -34,7 +34,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
|||||||
language: function(can, language) { can.runAction(event, aaa.LANGUAGE, [language == ice.AUTO? "": language], function(msg) {
|
language: function(can, language) { can.runAction(event, aaa.LANGUAGE, [language == ice.AUTO? "": language], function(msg) {
|
||||||
can.user.toastConfirm(can, can.user.trans(can, "reload page for "+language), aaa.LANGUAGE, function() { can.user.reload(true) })
|
can.user.toastConfirm(can, can.user.trans(can, "reload page for "+language), aaa.LANGUAGE, function() { can.user.reload(true) })
|
||||||
}) },
|
}) },
|
||||||
theme: function(can, theme) { theme && can.runAction({}, web.THEME, [theme])
|
theme: function(can, theme) { theme && can.runAction({}, chat.THEME, [theme])
|
||||||
theme && can.misc.localStorage(can, "can.theme", can._theme = theme == ice.AUTO? "": theme) && can.onengine.signal(can, chat.ONTHEMECHANGE, can.request(event, {theme: theme})), can.user.theme(can, can.onexport.theme(can))
|
theme && can.misc.localStorage(can, "can.theme", can._theme = theme == ice.AUTO? "": theme) && can.onengine.signal(can, chat.ONTHEMECHANGE, can.request(event, {theme: theme})), can.user.theme(can, can.onexport.theme(can))
|
||||||
},
|
},
|
||||||
menu: function(can, cmds, cb, trans) { can.base.isString(cmds) && (cmds = [cmds])
|
menu: function(can, cmds, cb, trans) { can.base.isString(cmds) && (cmds = [cmds])
|
||||||
@ -61,7 +61,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {
|
|||||||
msg.Option(nfs.SCRIPT) && can.require(can.base.Obj(msg.Option(nfs.SCRIPT)), function(can) { can.onaction.source(can, msg) })
|
msg.Option(nfs.SCRIPT) && can.require(can.base.Obj(msg.Option(nfs.SCRIPT)), function(can) { can.onaction.source(can, msg) })
|
||||||
lang(msg, function() { can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN) })
|
lang(msg, function() { can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN) })
|
||||||
}
|
}
|
||||||
can.run(can.request({}, {_method: web.GET}), [], function(msg) {
|
can.run(can.request({}, {_method: http.GET}), [], function(msg) {
|
||||||
lang(msg), can.page.requireModules(can, [msg.Option(mdb.ICONS)])
|
lang(msg), can.page.requireModules(can, [msg.Option(mdb.ICONS)])
|
||||||
can.require(can.core.List(msg["theme.list"], function(item) { return "src/template/web.chat.header/theme/"+item }))
|
can.require(can.core.List(msg["theme.list"], function(item) { return "src/template/web.chat.header/theme/"+item }))
|
||||||
can.onaction._menus[1] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, ".css") }))
|
can.onaction._menus[1] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, ".css") }))
|
||||||
@ -69,7 +69,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {
|
|||||||
if (can.base.beginWith(location.pathname, "/wiki/portal/", "/chat/cmd/web.wiki.portal/", "/chat/cmd/web.chat.oauth.client", "/chat/pod/20230511-golang-story/cmd/web.code.gitea.client")) { return show(msg) }
|
if (can.base.beginWith(location.pathname, "/wiki/portal/", "/chat/cmd/web.wiki.portal/", "/chat/cmd/web.chat.oauth.client", "/chat/pod/20230511-golang-story/cmd/web.code.gitea.client")) { return show(msg) }
|
||||||
if (location.pathname == "/" && can.base.beginWith(msg.Option(ice.MAIN)||"", "/wiki/portal/", "/chat/cmd/web.wiki.portal/")) { return show(msg) }
|
if (location.pathname == "/" && can.base.beginWith(msg.Option(ice.MAIN)||"", "/wiki/portal/", "/chat/cmd/web.wiki.portal/")) { return show(msg) }
|
||||||
if (!can.Conf(aaa.USERNICK, msg.Option(aaa.USERNICK)||msg.Option(ice.MSG_USERNICK)||msg.Option(ice.MSG_USERNAME))) {
|
if (!can.Conf(aaa.USERNICK, msg.Option(aaa.USERNICK)||msg.Option(ice.MSG_USERNICK)||msg.Option(ice.MSG_USERNAME))) {
|
||||||
return can.user.login(can, function() { can.onengine.signal(can, chat.ONMAIN, msg) }, msg.Option(aaa.LOGIN), can.base.Obj(msg.Option(chat.SSO)))
|
return can.user.login(can, function() { can.onengine.signal(can, chat.ONMAIN, msg) }, msg)
|
||||||
} show(msg)
|
} show(msg)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -112,12 +112,12 @@ Volcanos(chat.ONACTION, {_init: function(can) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_params: [log.DEBUG, chat.TITLE],
|
_params: [log.DEBUG, chat.TITLE],
|
||||||
_menus: ["shareuser", [web.THEME], [aaa.LANGUAGE],
|
_menus: ["shareuser", [chat.THEME], [aaa.LANGUAGE],
|
||||||
[nfs.SAVE, aaa.EMAIL, web.TOIMAGE, code.WEBPACK],
|
[nfs.SAVE, aaa.EMAIL, web.TOIMAGE, code.WEBPACK],
|
||||||
[aaa.USER, "setnick", aaa.PASSWORD, cli.CLEAR, aaa.LOGOUT],
|
[aaa.USER, "setnick", aaa.PASSWORD, web.CLEAR, aaa.LOGOUT],
|
||||||
],
|
],
|
||||||
_trans: kit.Dict(
|
_trans: kit.Dict(
|
||||||
"shareuser", "共享用户", web.THEME, "界面主题", aaa.LANGUAGE, "语言地区",
|
"shareuser", "共享用户", chat.THEME, "界面主题", aaa.LANGUAGE, "语言地区",
|
||||||
nfs.SAVE, "保存网页", aaa.EMAIL, "发送邮件", web.TOIMAGE, "生成图片", code.WEBPACK, "打包页面",
|
nfs.SAVE, "保存网页", aaa.EMAIL, "发送邮件", web.TOIMAGE, "生成图片", code.WEBPACK, "打包页面",
|
||||||
aaa.USER, "用户信息", "setnick", "设置昵称", aaa.PASSWORD, "修改密码", web.CLEAR, "清除背景", aaa.LOGOUT, "退出登录",
|
aaa.USER, "用户信息", "setnick", "设置昵称", aaa.PASSWORD, "修改密码", web.CLEAR, "清除背景", aaa.LOGOUT, "退出登录",
|
||||||
|
|
||||||
@ -169,11 +169,11 @@ Volcanos(chat.ONPLUGIN, {
|
|||||||
}),
|
}),
|
||||||
avatar: shy("用户头像", function(can, sub, cb) { can.page.Append(can, sub._output, [{img: can.user.info.avatar, style: kit.Dict(html.MAX_HEIGHT, sub.ConfHeight(), html.MAX_WIDTH, sub.ConfWidth())}]) }),
|
avatar: shy("用户头像", function(can, sub, cb) { can.page.Append(can, sub._output, [{img: can.user.info.avatar, style: kit.Dict(html.MAX_HEIGHT, sub.ConfHeight(), html.MAX_WIDTH, sub.ConfWidth())}]) }),
|
||||||
background: shy("背景图片", function(can, sub, cb) { can.page.Append(can, sub._output, [{img: can.user.info.background, style: kit.Dict(html.MAX_HEIGHT, sub.ConfHeight(), html.MAX_WIDTH, sub.ConfWidth())}]) }),
|
background: shy("背景图片", function(can, sub, cb) { can.page.Append(can, sub._output, [{img: can.user.info.background, style: kit.Dict(html.MAX_HEIGHT, sub.ConfHeight(), html.MAX_WIDTH, sub.ConfWidth())}]) }),
|
||||||
language: shy("语言地区", {_init: function(can) { can.Option(aaa.LANGUAGE, can.user.info.language||ice.AUTO) }}, ["language:select=auto,zh,en", ice.RUN], function(can, msg, arg) { can.onimport.language(can, arg[0]) }),
|
language: shy("语言地区", {_init: function(can) { can.Option(aaa.LANGUAGE, can.user.info.language||ice.AUTO) }}, ["language:select=auto,zh,en", ctx.RUN], function(can, msg, arg) { can.onimport.language(can, arg[0]) }),
|
||||||
title: shy("网页标题", [chat.TITLE], function(can, msg, arg) { msg.Echo(can.user.title(arg[0])) }),
|
title: shy("网页标题", [chat.TITLE], function(can, msg, arg) { msg.Echo(can.user.title(arg[0])) }),
|
||||||
theme: shy("界面主题", {_init: function(can) { can.Option(chat.THEME, can.getHeader(chat.THEME)) },
|
theme: shy("界面主题", {_init: function(can) { can.Option(chat.THEME, can.getHeader(chat.THEME)) },
|
||||||
save: function(can, sup) { can.user.downloads(can, sup._themes[can.Option(web.THEME)], can.Option(web.THEME), nfs.CSS) },
|
save: function(can, sup) { can.user.downloads(can, sup._themes[can.Option(chat.THEME)], can.Option(chat.THEME), nfs.CSS) },
|
||||||
}, ["theme:select=auto,dark,light,print,white,black", ice.RUN, nfs.SAVE], function(can, msg, arg) {
|
}, ["theme:select=auto,dark,light,print,white,black", ctx.RUN, nfs.SAVE], function(can, msg, arg) {
|
||||||
if (arg[0] == ice.AUTO) { arg[0] = "", can._theme = "" } can.misc.localStorage(can, "can.theme", arg[0]), can.onimport.theme(can, arg[0])
|
if (arg[0] == ice.AUTO) { arg[0] = "", can._theme = "" } can.misc.localStorage(can, "can.theme", arg[0]), can.onimport.theme(can, arg[0])
|
||||||
}),
|
}),
|
||||||
logout: shy("退出登录", kit.Dict(aaa.LOGOUT, shy("退出", function(can) { can.user.logout(can._root.Header) })), [aaa.LOGOUT]),
|
logout: shy("退出登录", kit.Dict(aaa.LOGOUT, shy("退出", function(can) { can.user.logout(can._root.Header) })), [aaa.LOGOUT]),
|
||||||
|
@ -18,7 +18,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.onimport._main(can, msg
|
|||||||
_menu: function(can, msg) { can.user.isMobile || can.user.mod.isPod || can.onappend._action(can, can.onaction.list, can._action) },
|
_menu: function(can, msg) { can.user.isMobile || can.user.mod.isPod || can.onappend._action(can, can.onaction.list, can._action) },
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: function(can) { can.onmotion.hidden(can) },
|
Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: function(can) { can.onmotion.hidden(can) },
|
||||||
onlogin: function(can, msg) { can.run(can.request({}, {_method: web.GET}), [], function(msg) { if (msg.Option(ice.MSG_RIVER)) { return can.page.Remove(can, can._target) }
|
onlogin: function(can, msg) { can.run(can.request({}, {_method: http.GET}), [], function(msg) { if (msg.Option(ice.MSG_RIVER)) { return can.page.Remove(can, can._target) }
|
||||||
can.onimport._init(can, msg); if (can.user.isMobile || can.user.isExtension) { return can.page.ClassList.add(can, can._target, ice.AUTO) }
|
can.onimport._init(can, msg); if (can.user.isMobile || can.user.isExtension) { return can.page.ClassList.add(can, can._target, ice.AUTO) }
|
||||||
can.onmotion.toggle(can, can._target, true), can.onlayout._init(can)
|
can.onmotion.toggle(can, can._target, true), can.onlayout._init(can)
|
||||||
}) },
|
}) },
|
||||||
|
@ -20,7 +20,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.onmotion.clear(can, can
|
|||||||
can.ui.done = function() { can.base.isFunc(cb) && cb(can.onexport.select(can)), can.onmotion.hidden(can) }, can.db = {}, can._plugins = [], can.onimport._input(can, msg, cmds, fields)
|
can.ui.done = function() { can.base.isFunc(cb) && cb(can.onexport.select(can)), can.onmotion.hidden(can) }, can.db = {}, can._plugins = [], can.onimport._input(can, msg, cmds, fields)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {_init: function(can) { can.onmotion.hidden(can) }, list: [cli.CLOSE, cli.CLEAR, cli.DONE],
|
Volcanos(chat.ONACTION, {_init: function(can) { can.onmotion.hidden(can) }, list: [cli.CLOSE, web.CLEAR, cli.DONE],
|
||||||
onsize: function(can, msg, height, width) { can.onimport._size(can), can.core.List(can._plugins, function(sub) { sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth(), true) }) },
|
onsize: function(can, msg, height, width) { can.onimport._size(can), can.core.List(can._plugins, function(sub) { sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth(), true) }) },
|
||||||
onlogin: function(can, msg) { can.ui = can.page.Append(can, can._output, [chat.CONTENT, {view: [[chat.DISPLAY, chat.CONTENT], html.TABLE]}, chat.PROFILE])
|
onlogin: function(can, msg) { can.ui = can.page.Append(can, can._output, [chat.CONTENT, {view: [[chat.DISPLAY, chat.CONTENT], html.TABLE]}, chat.PROFILE])
|
||||||
can.onappend._action(can, (can.Conf(html.ACTION)||can.onaction.list).concat({type: html.TEXT, name: html.FILTER, _init: function(target) { can.ui.filter = target }, onkeydown: function(event) {
|
can.onappend._action(can, (can.Conf(html.ACTION)||can.onaction.list).concat({type: html.TEXT, name: html.FILTER, _init: function(target) { can.ui.filter = target }, onkeydown: function(event) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Volcanos(chat.ONACTION, {
|
Volcanos(chat.ONACTION, {
|
||||||
run: function(event, can) { can.run(can.request(event, {_method: web.POST})) }, refresh: function(event, can) { can.run(can.request(event, {_method: web.GET})) },
|
run: function(event, can) { can.run(can.request(event, {_method: http.POST})) }, refresh: function(event, can) { can.run(can.request(event, {_method: http.GET})) },
|
||||||
list: function(event, can) { can.sup.isSimpleMode() || can.run(can.request(event, {_method: web.GET})) }, back: function(event, can) { can.sup.onimport._back(can.sup) },
|
list: function(event, can) { can.sup.isSimpleMode() || can.run(can.request(event, {_method: http.GET})) }, back: function(event, can) { can.sup.onimport._back(can.sup) },
|
||||||
onclick: function(event, can) { can.Conf(mdb.TYPE) == html.BUTTON && can.run(event, [ctx.ACTION, can.Conf(mdb.NAME)].concat(can.sup.Input())), can.onkeymap.prevent(event) },
|
onclick: function(event, can) { can.Conf(mdb.TYPE) == html.BUTTON && can.run(event, [ctx.ACTION, can.Conf(mdb.NAME)].concat(can.sup.Input())), can.onkeymap.prevent(event) },
|
||||||
onchange: function(event, can) { can.Conf(mdb.TYPE) == html.SELECT && can.run(event) },
|
onchange: function(event, can) { can.Conf(mdb.TYPE) == html.SELECT && can.run(event) },
|
||||||
onkeydown: function(event, can) { can.onkeymap.input(event, can, event.target); if (can.Conf(mdb.TYPE) == html.TEXTAREA && !event.ctrlKey) { return }
|
onkeydown: function(event, can) { can.onkeymap.input(event, can, event.target); if (can.Conf(mdb.TYPE) == html.TEXTAREA && !event.ctrlKey) { return }
|
||||||
|
@ -10,7 +10,7 @@ Volcanos(chat.ONFIGURE, {keyboard: {
|
|||||||
function hold() { can.page.ClassList.add(can, div, "hold") }
|
function hold() { can.page.ClassList.add(can, div, "hold") }
|
||||||
var div = can.page.Append(can, can._output, [{view: item.type+lex.SP+item.name+(item.name.indexOf(lex.NL)>-1? " double": item.name.length>1? " special": ""), list: [{text: [item.name]}], onclick: function(event) {
|
var div = can.page.Append(can, can._output, [{view: item.type+lex.SP+item.name+(item.name.indexOf(lex.NL)>-1? " double": item.name.length>1? " special": ""), list: [{text: [item.name]}], onclick: function(event) {
|
||||||
switch (item.name) {
|
switch (item.name) {
|
||||||
case cli.CLEAR: target.value = "", target.focus(); break
|
case web.CLEAR: target.value = "", target.focus(); break
|
||||||
case cli.CLOSE: can.close(); break
|
case cli.CLOSE: can.close(); break
|
||||||
case code.ESC: can.close(); break
|
case code.ESC: can.close(); break
|
||||||
case code.CTRL: can._ctrl = !can._ctrl, hold(); break
|
case code.CTRL: can._ctrl = !can._ctrl, hold(); break
|
||||||
|
@ -112,7 +112,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.ui = can.on
|
|||||||
myInfoWindow.prototype.createDOM = function() {
|
myInfoWindow.prototype.createDOM = function() {
|
||||||
var meta = this.meta, ui = can.onappend.field(can, chat.FLOAT, {}, can._output)
|
var meta = this.meta, ui = can.onappend.field(can, chat.FLOAT, {}, can._output)
|
||||||
can.onappend.plugin(can, meta, function(sub) {
|
can.onappend.plugin(can, meta, function(sub) {
|
||||||
sub.run = function(event, cmds, cb) { can.runAction(can.request(event), ice.RUN, [meta.index].concat(cmds), cb) }
|
sub.run = function(event, cmds, cb) { can.runAction(can.request(event), ctx.RUN, [meta.index].concat(cmds), cb) }
|
||||||
sub.onaction.close = function(event) { can.misc.Event(event, can, function(msg) {
|
sub.onaction.close = function(event) { can.misc.Event(event, can, function(msg) {
|
||||||
can.onmotion.hidden(can, sub._target)
|
can.onmotion.hidden(can, sub._target)
|
||||||
}) }
|
}) }
|
||||||
|
@ -26,7 +26,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) {
|
|||||||
Volcanos(chat.ONFIGURE, {
|
Volcanos(chat.ONFIGURE, {
|
||||||
source: function(can, target, zone, path) {
|
source: function(can, target, zone, path) {
|
||||||
var args = can.base.getValid(can.misc.SearchHash(can), [can.Option(nfs.PATH), can.Option(nfs.FILE)])
|
var args = can.base.getValid(can.misc.SearchHash(can), [can.Option(nfs.PATH), can.Option(nfs.FILE)])
|
||||||
function show(target, zone, path) { can.run(can.request({}, {_method: web.GET, dir_root: path, dir_deep: true}), [nfs.PWD], function(msg) {
|
function show(target, zone, path) { can.run(can.request({}, {_method: http.GET, dir_root: path, dir_deep: true}), [nfs.PWD], function(msg) {
|
||||||
zone._icon(kit.Dict(
|
zone._icon(kit.Dict(
|
||||||
web.REFRESH, function(event) { show(target, zone, path) },
|
web.REFRESH, function(event) { show(target, zone, path) },
|
||||||
mdb.CREATE, function(event, button) { can.onaction.module(event, can, nfs.MODULE) },
|
mdb.CREATE, function(event, button) { can.onaction.module(event, can, nfs.MODULE) },
|
||||||
|
@ -65,13 +65,13 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireModules
|
|||||||
can.onexport.term(can, term) }) },
|
can.onexport.term(can, term) }) },
|
||||||
_input: function(can, term, data) {
|
_input: function(can, term, data) {
|
||||||
if (data == "\u0013") { can._delay = true
|
if (data == "\u0013") { can._delay = true
|
||||||
can.onmotion.delay(can, function() { can._delay && can.runAction(can.request({}, term._item), web.INPUT, [btoa(data)], function(msg) {
|
can.onmotion.delay(can, function() { can._delay && can.runAction(can.request({}, term._item), html.INPUT, [btoa(data)], function(msg) {
|
||||||
if (msg.IsErr()) { can.misc.Warn(msg.Result()) }
|
if (msg.IsErr()) { can.misc.Warn(msg.Result()) }
|
||||||
}) })
|
}) })
|
||||||
} else {
|
} else {
|
||||||
if (can._delay) { can._delay = false; var msg = can.request({}, {_handle: ice.TRUE}, term._item)
|
if (can._delay) { can._delay = false; var msg = can.request({}, {_handle: ice.TRUE}, term._item)
|
||||||
can._keylist = can.onkeymap._parse({key: data, _msg: msg}, can, mdb.NORMAL, can._keylist||[], term); return
|
can._keylist = can.onkeymap._parse({key: data, _msg: msg}, can, mdb.NORMAL, can._keylist||[], term); return
|
||||||
} can._output = term._output, can.runAction(can.request({}, {rows: term.rows, cols: term.cols}, term._item), web.INPUT, [btoa(data)], function(msg) {
|
} can._output = term._output, can.runAction(can.request({}, {rows: term.rows, cols: term.cols}, term._item), html.INPUT, [btoa(data)], function(msg) {
|
||||||
if (msg.IsErr()) { can.misc.Warn(msg.Result()) }
|
if (msg.IsErr()) { can.misc.Warn(msg.Result()) }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
ondrop: function(event) { can.onkeymap.prevent(event), can.drop(event, event.target, time) },
|
ondrop: function(event) { can.onkeymap.prevent(event), can.drop(event, event.target, time) },
|
||||||
ondragover: function(event) { can.onkeymap.prevent(event), can.page.Select(can, can.ui.content, html.TD, function(td) { can.page.ClassList.set(can, td, "over", td == event.target) }) },
|
ondragover: function(event) { can.onkeymap.prevent(event), can.page.Select(can, can.ui.content, html.TD, function(td) { can.page.ClassList.set(can, td, "over", td == event.target) }) },
|
||||||
list: can.core.List(list, function(task) { return can.base.isString(task)? {text: [task, html.DIV, "date"]}:
|
list: can.core.List(list, function(task) { return can.base.isString(task)? {text: [task, html.DIV, "date"]}:
|
||||||
{text: [can.core.CallFunc([can.onexport, can.Action(ice.VIEW)||mdb.TEXT], [can, task])||task.name, html.DIV, can.onexport.style(can, task)],
|
{text: [can.core.CallFunc([can.onexport, can.Action(html.VIEW)||mdb.TEXT], [can, task])||task.name, html.DIV, can.onexport.style(can, task)],
|
||||||
ondragstart: function(event) { var target = event.target; can.drop = function(event, td, time) { td.append(target)
|
ondragstart: function(event) { var target = event.target; can.drop = function(event, td, time) { td.append(target)
|
||||||
can.onaction.modifyTask(event, can, task, team.BEGIN_TIME, time+task.begin_time.slice(time.length), task.begin_time)
|
can.onaction.modifyTask(event, can, task, team.BEGIN_TIME, time+task.begin_time.slice(time.length), task.begin_time)
|
||||||
} }, draggable: time != undefined, title: can.onexport.title(can, task), _init: function(target) {
|
} }, draggable: time != undefined, title: can.onexport.title(can, task), _init: function(target) {
|
||||||
@ -46,7 +46,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
}, can.ui.display)) { return }
|
}, can.ui.display)) { return }
|
||||||
task[ctx.EXTRA_INDEX] && can.onappend.plugin(can, {space: task.space, index: task[ctx.EXTRA_INDEX], args: task[ctx.EXTRA_ARGS], height: can.ConfHeight()/2-2*html.ACTION_HEIGHT}, function(sub, meta) {
|
task[ctx.EXTRA_INDEX] && can.onappend.plugin(can, {space: task.space, index: task[ctx.EXTRA_INDEX], args: task[ctx.EXTRA_ARGS], height: can.ConfHeight()/2-2*html.ACTION_HEIGHT}, function(sub, meta) {
|
||||||
sub.run = function(event, cmds, cb) { can.request(event, kit.Dict(team.TASK_POD, task.space, team.TASK_ZONE, task.zone, team.TASK_ID, task.id))
|
sub.run = function(event, cmds, cb) { can.request(event, kit.Dict(team.TASK_POD, task.space, team.TASK_ZONE, task.zone, team.TASK_ID, task.id))
|
||||||
can.page.style(can, sub._output, html.MAX_HEIGHT, ""), can.runAction(event, ice.RUN, [task[mdb.ZONE], task[mdb.ID]].concat(cmds), cb)
|
can.page.style(can, sub._output, html.MAX_HEIGHT, ""), can.runAction(event, ctx.RUN, [task[mdb.ZONE], task[mdb.ID]].concat(cmds), cb)
|
||||||
}
|
}
|
||||||
can._plugin_display = sub
|
can._plugin_display = sub
|
||||||
sub.onaction.close = function() { can.onmotion.toggle(can, can.ui.display), can.onimport.layout(can) }
|
sub.onaction.close = function() { can.onmotion.toggle(can, can.ui.display), can.onimport.layout(can) }
|
||||||
|
@ -16,7 +16,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
var _cb = can.core.Value(figure, [svg.DATA, key]); if (can.base.isFunc(_cb)) { return _cb(can, value, key, target) }
|
var _cb = can.core.Value(figure, [svg.DATA, key]); if (can.base.isFunc(_cb)) { return _cb(can, value, key, target) }
|
||||||
if (value == ice.AUTO) { return target.removeAttribute(key) }
|
if (value == ice.AUTO) { return target.removeAttribute(key) }
|
||||||
if (key == html.INNER) { return value != undefined && (target.innerHTML = value), target.innerHTML }
|
if (key == html.INNER) { return value != undefined && (target.innerHTML = value), target.innerHTML }
|
||||||
if (key == ice.SHIP) { return value != undefined && target.setAttribute(key, JSON.stringify(value)), can.base.Obj(target.getAttribute(key), []) }
|
if (key == svg.SHIP) { return value != undefined && target.setAttribute(key, JSON.stringify(value)), can.base.Obj(target.getAttribute(key), []) }
|
||||||
try {
|
try {
|
||||||
return value != undefined && target.setAttribute(key, value), target.getAttribute(key) || can.core.Value(target[key], "baseVal.value") || can.core.Value(target[key], "baseVal") || undefined
|
return value != undefined && target.setAttribute(key, value), target.getAttribute(key) || can.core.Value(target[key], "baseVal.value") || can.core.Value(target[key], "baseVal") || undefined
|
||||||
} catch(e) { }
|
} catch(e) { }
|
||||||
@ -77,7 +77,7 @@ Volcanos(chat.ONACTION, {list: [[svg.GRID, 10, 1, 2, 3, 4, 5, 10, 20],
|
|||||||
[svg.FONT_SIZE, svg.FONT_SIZE, 12, 16, 18, 24, 32], [svg.STROKE_WIDTH, svg.STROKE_WIDTH, 1, 2, 3, 4, 5],
|
[svg.FONT_SIZE, svg.FONT_SIZE, 12, 16, 18, 24, 32], [svg.STROKE_WIDTH, svg.STROKE_WIDTH, 1, 2, 3, 4, 5],
|
||||||
[svg.STROKE, svg.STROKE, cli.RED, cli.YELLOW, cli.GREEN, cli.CYAN, cli.BLUE, cli.PURPLE, cli.BLACK, cli.WHITE],
|
[svg.STROKE, svg.STROKE, cli.RED, cli.YELLOW, cli.GREEN, cli.CYAN, cli.BLUE, cli.PURPLE, cli.BLACK, cli.WHITE],
|
||||||
[svg.FILL, svg.FILL, cli.RED, cli.YELLOW, cli.GREEN, cli.CYAN, cli.BLUE, cli.PURPLE, cli.BLACK, cli.WHITE, cli.TRANSPARENT],
|
[svg.FILL, svg.FILL, cli.RED, cli.YELLOW, cli.GREEN, cli.CYAN, cli.BLUE, cli.PURPLE, cli.BLACK, cli.WHITE, cli.TRANSPARENT],
|
||||||
[svg.GO, ice.AUTO, ice.RUN, ice.AUTO, "manual"], [ice.MODE, web.DRAW, web.RESIZE],
|
[svg.GO, ice.AUTO, ctx.RUN, ice.AUTO, "manual"], [ice.MODE, web.DRAW, web.RESIZE],
|
||||||
[svg.SHAPE, svg.RECT, svg.TEXT, svg.RECT, svg.LINE, svg.BLOCK, svg.CIRCLE, svg.ELLIPSE],
|
[svg.SHAPE, svg.RECT, svg.TEXT, svg.RECT, svg.LINE, svg.BLOCK, svg.CIRCLE, svg.ELLIPSE],
|
||||||
], _change: function(can, key, value) {
|
], _change: function(can, key, value) {
|
||||||
value == "" && (value = key), can.Action(key, value)
|
value == "" && (value = key), can.Action(key, value)
|
||||||
@ -92,7 +92,7 @@ Volcanos(chat.ONACTION, {list: [[svg.GRID, 10, 1, 2, 3, 4, 5, 10, 20],
|
|||||||
mode: function(event, can, key, value) { can.Action(key, value) },
|
mode: function(event, can, key, value) { can.Action(key, value) },
|
||||||
shape: function(event, can, key, value) { can.Action(key, value) },
|
shape: function(event, can, key, value) { can.Action(key, value) },
|
||||||
|
|
||||||
menu_list: [ice.HIDE, ice.SHOW, mdb.CREATE, web.CLEAR, mdb.REMOVE],
|
menu_list: [html.HIDE, html.SHOW, mdb.CREATE, web.CLEAR, mdb.REMOVE],
|
||||||
hide: function(event, can) { can.onmotion.hide(can, {interval: 100, length: 10}, null, can.group) },
|
hide: function(event, can) { can.onmotion.hide(can, {interval: 100, length: 10}, null, can.group) },
|
||||||
show: function(event, can) { can.onmotion.show(can, {interval: 10, length: 1}, null, can.group) },
|
show: function(event, can) { can.onmotion.show(can, {interval: 10, length: 1}, null, can.group) },
|
||||||
create: function(event, can) { can.user.input(event, can, [svg.GROUP], function(list) { can.onimport.group(can, list[0]) }) },
|
create: function(event, can) { can.user.input(event, can, [svg.GROUP], function(list) { can.onimport.group(can, list[0]) }) },
|
||||||
@ -100,14 +100,14 @@ Volcanos(chat.ONACTION, {list: [[svg.GRID, 10, 1, 2, 3, 4, 5, 10, 20],
|
|||||||
remove: function(event, can) { can.group == can.svg || can.page.Remove(can, can.group) },
|
remove: function(event, can) { can.group == can.svg || can.page.Remove(can, can.group) },
|
||||||
|
|
||||||
save: function(event, can, button) { can.runAction(can.request(event, {text: can.onexport.content(can, can.svg)}), button, [can.Option(nfs.PATH)]) },
|
save: function(event, can, button) { can.runAction(can.request(event, {text: can.onexport.content(can, can.svg)}), button, [can.Option(nfs.PATH)]) },
|
||||||
edit: function(event, can) { can.Action(svg.GO, can.Action(svg.GO) == ice.RUN? ice.AUTO: ice.RUN) },
|
edit: function(event, can) { can.Action(svg.GO, can.Action(svg.GO) == ctx.RUN? ice.AUTO: ctx.RUN) },
|
||||||
|
|
||||||
_mode: {
|
_mode: {
|
||||||
draw: function(event, can, points) { var shape = can.Action(svg.SHAPE), figure = can.onfigure[shape]
|
draw: function(event, can, points) { var shape = can.Action(svg.SHAPE), figure = can.onfigure[shape]
|
||||||
figure.grid && figure.grid(event, can, points); if (figure.data.points && figure.data.points != points.length) { return }
|
figure.grid && figure.grid(event, can, points); if (figure.data.points && figure.data.points != points.length) { return }
|
||||||
var data = figure.draw && figure.draw(event, can, points, {}), target = data && can.onimport.block(can, figure.data.name||shape, data, can.group)
|
var data = figure.draw && figure.draw(event, can, points, {}), target = data && can.onimport.block(can, figure.data.name||shape, data, can.group)
|
||||||
if (event.type == html.CLICK) { can.points = []; if (target) { var pid = can.onexport._pid(can, target)
|
if (event.type == html.CLICK) { can.points = []; if (target) { var pid = can.onexport._pid(can, target)
|
||||||
can.core.List(points, function(p, i) { p.target && p.target.Value(ice.SHIP, p.target.Value(ice.SHIP).concat([{pid: pid, which: i+1, anchor: p.anchor}])) })
|
can.core.List(points, function(p, i) { p.target && p.target.Value(svg.SHIP, p.target.Value(svg.SHIP).concat([{pid: pid, which: i+1, anchor: p.anchor}])) })
|
||||||
return
|
return
|
||||||
} } return target
|
} } return target
|
||||||
},
|
},
|
||||||
@ -115,7 +115,7 @@ Volcanos(chat.ONACTION, {list: [[svg.GRID, 10, 1, 2, 3, 4, 5, 10, 20],
|
|||||||
if (event.type == html.CLICK) { if (points.length > 1) { return can.points = [], delete(can.current) }
|
if (event.type == html.CLICK) { if (points.length > 1) { return can.points = [], delete(can.current) }
|
||||||
return can.current = {target: target, begin: can.core.List([target], function(target) { if (can.page.tagis(target, svg.G)) { return }
|
return can.current = {target: target, begin: can.core.List([target], function(target) { if (can.page.tagis(target, svg.G)) { return }
|
||||||
return {target: target, height: target.Val(html.HEIGHT), width: target.Val(html.WIDTH), x: target.Val(svg.X), y: target.Val(svg.Y),
|
return {target: target, height: target.Val(html.HEIGHT), width: target.Val(html.WIDTH), x: target.Val(svg.X), y: target.Val(svg.Y),
|
||||||
ship: can.core.List(target.Value(ice.SHIP), function(ship) { return ship.pid && (ship.target = can.ondetail._select(can, ship.pid)) && ship })
|
ship: can.core.List(target.Value(svg.SHIP), function(ship) { return ship.pid && (ship.target = can.ondetail._select(can, ship.pid)) && ship })
|
||||||
}
|
}
|
||||||
}), pos: can.onexport.cursor(event, can, target)}
|
}), pos: can.onexport.cursor(event, can, target)}
|
||||||
}
|
}
|
||||||
@ -141,12 +141,12 @@ Volcanos(chat.ONACTION, {list: [[svg.GRID, 10, 1, 2, 3, 4, 5, 10, 20],
|
|||||||
},
|
},
|
||||||
onmouseover: function(event, can) { can.onexport._show(can, event.target) },
|
onmouseover: function(event, can) { can.onexport._show(can, event.target) },
|
||||||
onmousemove: function(event, can) { var point = can.onexport._point(event, can)
|
onmousemove: function(event, can) { var point = can.onexport._point(event, can)
|
||||||
if (can.Action(svg.GO) == ice.RUN) { return can.page.style(can, can.svg, "cursor", "pointer") } can.onexport.cursor(event, can, event.target)
|
if (can.Action(svg.GO) == ctx.RUN) { return can.page.style(can, can.svg, "cursor", "pointer") } can.onexport.cursor(event, can, event.target)
|
||||||
if (can.Action(svg.GO) == ice.AUTO) { can.onaction._auto(can, event.target) }
|
if (can.Action(svg.GO) == ice.AUTO) { can.onaction._auto(can, event.target) }
|
||||||
can.onaction._figure(event, can, can.points.concat(point))
|
can.onaction._figure(event, can, can.points.concat(point))
|
||||||
},
|
},
|
||||||
onclick: function(event, can) { var point = can.onexport._point(event, can)
|
onclick: function(event, can) { var point = can.onexport._point(event, can)
|
||||||
if (can.Action(svg.GO) == ice.RUN) { return can.ondetail._select(can, event.target.Value(svg.PID)) }
|
if (can.Action(svg.GO) == ctx.RUN) { return can.ondetail._select(can, event.target.Value(svg.PID)) }
|
||||||
can.onaction._figure(event, can, can.points = can.points.concat(point))
|
can.onaction._figure(event, can, can.points = can.points.concat(point))
|
||||||
},
|
},
|
||||||
ondblclick: function(event, can) { can.ondetail.label(event, can) },
|
ondblclick: function(event, can) { can.ondetail.label(event, can) },
|
||||||
@ -186,11 +186,11 @@ Volcanos(chat.ONDETAIL, {list: [cli.START, ice.COPY, html.LABEL, "toimage", mdb.
|
|||||||
},
|
},
|
||||||
toimage: function(event, can) { can.user.toimage(can, can.Option(nfs.PATH).split(nfs.PS).pop().split(nfs.PT)[0], can.svg) },
|
toimage: function(event, can) { can.user.toimage(can, can.Option(nfs.PATH).split(nfs.PS).pop().split(nfs.PT)[0], can.svg) },
|
||||||
remove: function(event, can) { if (target == can.svg) { return } var target = event.target
|
remove: function(event, can) { if (target == can.svg) { return } var target = event.target
|
||||||
can.core.List(target.Value(ice.SHIP), function(item) { can.ondetail._select(can, item.pid, function(target) { can.page.Remove(can, target) }) })
|
can.core.List(target.Value(svg.SHIP), function(item) { can.ondetail._select(can, item.pid, function(target) { can.page.Remove(can, target) }) })
|
||||||
can.ondetail._select(can, target.Value(mdb.TEXT), function(target) { can.page.Remove(can, target) }), can.page.Remove(can, target)
|
can.ondetail._select(can, target.Value(mdb.TEXT), function(target) { can.page.Remove(can, target) }), can.page.Remove(can, target)
|
||||||
},
|
},
|
||||||
_move: function(can, target, list) {
|
_move: function(can, target, list) {
|
||||||
can.core.List(list||target.Value(ice.SHIP), function(ship) { var p = can.onexport.anchor(target, ship.anchor, {}); ship.target = can.ondetail._select(can, ship.pid)
|
can.core.List(list||target.Value(svg.SHIP), function(ship) { var p = can.onexport.anchor(target, ship.anchor, {}); ship.target = can.ondetail._select(can, ship.pid)
|
||||||
if (ship.which == 1) { ship.target.Val(svg.X1, p.x), ship.target.Val(svg.Y1, p.y) } else if (ship.which == 2) { ship.target.Val(svg.X2, p.x), ship.target.Val(svg.Y2, p.y) }
|
if (ship.which == 1) { ship.target.Val(svg.X1, p.x), ship.target.Val(svg.Y1, p.y) } else if (ship.which == 2) { ship.target.Val(svg.X2, p.x), ship.target.Val(svg.Y2, p.y) }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -328,7 +328,7 @@ Volcanos(chat.ONKEYMAP, {
|
|||||||
_mode: {
|
_mode: {
|
||||||
normal: {
|
normal: {
|
||||||
Escape: function(event, can) { can._undo && can._undo(), can.points = [] },
|
Escape: function(event, can) { can._undo && can._undo(), can.points = [] },
|
||||||
gr: function(event, can) { can.Action(svg.GO, ice.RUN) },
|
gr: function(event, can) { can.Action(svg.GO, ctx.RUN) },
|
||||||
ga: function(event, can) { can.Action(svg.GO, ice.AUTO) },
|
ga: function(event, can) { can.Action(svg.GO, ice.AUTO) },
|
||||||
gm: function(event, can) { can.Action(svg.GO, "manual") },
|
gm: function(event, can) { can.Action(svg.GO, "manual") },
|
||||||
|
|
||||||
|
@ -120,10 +120,10 @@ Volcanos(chat.ONDETAIL, {list: ["删除"],
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
next: function(sub) { sub.page.Select(sub, sub.ui.content, sub.core.Keys(html.DIV_PAGE, ice.SHOW), function(page) {
|
next: function(sub) { sub.page.Select(sub, sub.ui.content, sub.core.Keys(html.DIV_PAGE, html.SHOW), function(page) {
|
||||||
page.nextSibling? sub.sup.ondetail.show(sub, page.nextSibling): sub.user.toast(sub.sup, cli.END)
|
page.nextSibling? sub.sup.ondetail.show(sub, page.nextSibling): sub.user.toast(sub.sup, cli.END)
|
||||||
}) },
|
}) },
|
||||||
prev: function(sub) { sub.page.Select(sub, sub.ui.content, sub.core.Keys(html.DIV_PAGE, ice.SHOW), function(page) {
|
prev: function(sub) { sub.page.Select(sub, sub.ui.content, sub.core.Keys(html.DIV_PAGE, html.SHOW), function(page) {
|
||||||
page.previousSibling? sub.sup.ondetail.show(sub, page.previousSibling): sub.user.toast(sub.sup, cli.END)
|
page.previousSibling? sub.sup.ondetail.show(sub, page.previousSibling): sub.user.toast(sub.sup, cli.END)
|
||||||
}) },
|
}) },
|
||||||
flash: function(sub) { sub.core.Next(sub.page.Select(sub, sub.ui.content, html.DIV_PAGE), function(page, next) {
|
flash: function(sub) { sub.core.Next(sub.page.Select(sub, sub.ui.content, html.DIV_PAGE), function(page, next) {
|
||||||
|
@ -15,7 +15,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) {
|
msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) {
|
||||||
can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300)
|
can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300)
|
||||||
sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX)
|
sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX)
|
||||||
can.run(event, (!index || index == can._index || index.indexOf("can.") == 0? msg[ice.MSG_PREFIX]||[]: [ice.RUN, index]).concat(cmds), cb, true)
|
can.run(event, (!index || index == can._index || index.indexOf("can.") == 0? msg[ice.MSG_PREFIX]||[]: [ctx.RUN, index]).concat(cmds), cb, true)
|
||||||
}, can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, true), cb && cb(sub)
|
}, can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, true), cb && cb(sub)
|
||||||
}) })
|
}) })
|
||||||
},
|
},
|
||||||
@ -124,10 +124,10 @@ Volcanos(chat.ONACTION, {list: [
|
|||||||
},
|
},
|
||||||
|
|
||||||
"打包页面": function(event, can) { can.onengine.signal(can, "onwebpack", can.request(event)) },
|
"打包页面": function(event, can) { can.onengine.signal(can, "onwebpack", can.request(event)) },
|
||||||
"查看文档": function(event, can) { can.request(event).Option(ctx.ACTION, ice.HELP), can.onengine.signal(can, "ondebugs", can.request(event, {action: ice.HELP, index: can.Conf(ctx.INDEX)})) },
|
"查看文档": function(event, can) { can.requests(event, {action: ice.HELP}), can.onengine.signal(can, "ondebugs", can.requestPodCmd(event)) },
|
||||||
"查看脚本": function(event, can) { can.request(event).Option(ctx.ACTION, nfs.SCRIPT), can.onengine.signal(can, "ondebugs", can.request(event, {action: nfs.SCRIPT, index: can.Conf(ctx.INDEX)})) },
|
"查看脚本": function(event, can) { can.requests(event, {action: nfs.SCRIPT}), can.onengine.signal(can, "ondebugs", can.requestPodCmd(event)) },
|
||||||
"查看源码": function(event, can) { can.request(event).Option(ctx.ACTION, nfs.SOURCE), can.onengine.signal(can, "ondebugs", can.requestPodCmd(event)) },
|
"查看源码": function(event, can) { can.requests(event, {action: nfs.SOURCE}), can.onengine.signal(can, "ondebugs", can.requestPodCmd(event)) },
|
||||||
"查看配置": function(event, can) { can.request(event).Option(ctx.ACTION, ctx.CONFIG), can.onengine.signal(can, "ondebugs", can.requestPodCmd(event)) },
|
"查看配置": function(event, can) { can.requests(event, {action: ctx.CONFIG}), can.onengine.signal(can, "ondebugs", can.requestPodCmd(event)) },
|
||||||
"查看日志": function(event, can) { var sub = can.sub; sub.onimport.tool(sub, ["can.debug"], function(sub) { sub.select() }) },
|
"查看日志": function(event, can) { var sub = can.sub; sub.onimport.tool(sub, ["can.debug"], function(sub) { sub.select() }) },
|
||||||
"删除工具": function(event, can) { can.onaction._close(event, can) },
|
"删除工具": function(event, can) { can.onaction._close(event, can) },
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ Volcanos(chat.ONACTION, {list: [
|
|||||||
}
|
}
|
||||||
}) },
|
}) },
|
||||||
record2: function(event, can) { can.onaction.record0(event, can, "shot", function(stream, cb) {
|
record2: function(event, can) { can.onaction.record0(event, can, "shot", function(stream, cb) {
|
||||||
var recorder = new MediaRecorder(stream, {mimeType: web.VIDEO_WEBM}), blobs = []; recorder.ondataavailable = function(res) { blobs.push(res.data) }
|
var recorder = new MediaRecorder(stream, {mimeType: html.VIDEO_WEBM}), blobs = []; recorder.ondataavailable = function(res) { blobs.push(res.data) }
|
||||||
recorder.onstop = function() { cb(blobs, nfs.WEBM) }, recorder.start(1)
|
recorder.onstop = function() { cb(blobs, nfs.WEBM) }, recorder.start(1)
|
||||||
}) },
|
}) },
|
||||||
})
|
})
|
||||||
|
@ -18,10 +18,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireDraw(ca
|
|||||||
_color: function(can, tree) { return tree.meta.color || (tree.list == 0? cli.PURPLE: cli.YELLOW) },
|
_color: function(can, tree) { return tree.meta.color || (tree.list == 0? cli.PURPLE: cli.YELLOW) },
|
||||||
layout: function(can) { can.page.ClassList.has(can, can._fields, html.FLOAT) || can.page.style(can, can._output, html.MAX_HEIGHT, "")
|
layout: function(can) { can.page.ClassList.has(can, can._fields, html.FLOAT) || can.page.style(can, can._output, html.MAX_HEIGHT, "")
|
||||||
can.svg && can.svg.Val(svg.FONT_SIZE, can.size = parseInt(can.Action(html.SIZE)||24)), can.margin = parseInt(can.Action(html.MARGIN)||10)
|
can.svg && can.svg.Val(svg.FONT_SIZE, can.size = parseInt(can.Action(html.SIZE)||24)), can.margin = parseInt(can.Action(html.MARGIN)||10)
|
||||||
can._tree && can._tree[can.dir_root] && can.core.CallFunc(can.onaction[can.Action(ice.VIEW)||"横向"], [event, can, can.Action(ice.VIEW)])
|
can._tree && can._tree[can.dir_root] && can.core.CallFunc(can.onaction[can.Action(html.VIEW)||"横向"], [event, can, can.Action(html.VIEW)])
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {list: [[ice.VIEW, "横向", "纵向"], [html.SIZE, 24, 32, 48], [html.MARGIN, 10, 30, 50]],
|
Volcanos(chat.ONACTION, {list: [[html.VIEW, "横向", "纵向"], [html.SIZE, 24, 32, 48], [html.MARGIN, 10, 30, 50]],
|
||||||
size: function(event, can) { can.onimport.layout(can) }, margin: function(event, can) { can.onimport.layout(can) },
|
size: function(event, can) { can.onimport.layout(can) }, margin: function(event, can) { can.onimport.layout(can) },
|
||||||
"横向": function(event, can, button) { can.onimport._height(can, can._tree[can.dir_root]), can.onmotion.clear(can, can.svg)
|
"横向": function(event, can, button) { can.onimport._height(can, can._tree[can.dir_root]), can.onmotion.clear(can, can.svg)
|
||||||
can.svg.Val(html.HEIGHT, can._tree[can.dir_root].height*(can.size+can.margin)+2*can.margin), can.svg.Value(svg.TEXT_ANCHOR, "start")
|
can.svg.Val(html.HEIGHT, can._tree[can.dir_root].height*(can.size+can.margin)+2*can.margin), can.svg.Value(svg.TEXT_ANCHOR, "start")
|
||||||
@ -55,7 +55,7 @@ Volcanos(chat.ONACTION, {list: [[ice.VIEW, "横向", "纵向"], [html.SIZE, 24,
|
|||||||
})
|
})
|
||||||
Volcanos(chat.ONDETAIL, {
|
Volcanos(chat.ONDETAIL, {
|
||||||
onclick: function(event, can, tree) {
|
onclick: function(event, can, tree) {
|
||||||
if (tree.list.length > 0 || tree.name.endsWith(can.Conf(lex.SPLIT))) { return tree.hide = !tree.hide, can.onaction[can.Action(ice.VIEW)||"横向"](event, can) }
|
if (tree.list.length > 0 || tree.name.endsWith(can.Conf(lex.SPLIT))) { return tree.hide = !tree.hide, can.onaction[can.Action(html.VIEW)||"横向"](event, can) }
|
||||||
for (var node = tree; node; node = node.last) { can.request(event, node.meta) }
|
for (var node = tree; node; node = node.last) { can.request(event, node.meta) }
|
||||||
can.run(can.request(event, can.Option()), can.base.Obj(can.Conf(lex.PREFIX), []).concat(can.Conf(ctx.ACTION)||[], [tree.file||"", tree.name]), function(msg) {
|
can.run(can.request(event, can.Option()), can.base.Obj(can.Conf(lex.PREFIX), []).concat(can.Conf(ctx.ACTION)||[], [tree.file||"", tree.name]), function(msg) {
|
||||||
if (msg.Length() == 0) { return can.onappend._float(can, web.CODE_INNER, [can._msg.Option(nfs.DIR_ROOT), tree.file, tree.line]) }
|
if (msg.Length() == 0) { return can.onappend._float(can, web.CODE_INNER, [can._msg.Option(nfs.DIR_ROOT), tree.file, tree.line]) }
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) {
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) {
|
||||||
can.page.requireDraw(can, function() { can.base.isFunc(cb) && cb(msg)
|
can.page.requireDraw(can, function() { can.base.isFunc(cb) && cb(msg)
|
||||||
can.Conf(ice.VIEW) && can.Action(ice.VIEW, can.Conf(ice.VIEW)), can.onmotion.toggle(can, can._option, !can.user.isMobile || !can.isFullMode())
|
can.Conf(html.VIEW) && can.Action(html.VIEW, can.Conf(html.VIEW)), can.onmotion.toggle(can, can._option, !can.user.isMobile || !can.isFullMode())
|
||||||
can.db.data = msg.Table(), can.onimport.layout(can)
|
can.db.data = msg.Table(), can.onimport.layout(can)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -23,11 +23,11 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) {
|
|||||||
can.page.style(can, can._output, html.MAX_HEIGHT, "")
|
can.page.style(can, can._output, html.MAX_HEIGHT, "")
|
||||||
return {height: height, width: width, margin: margin, step: step}
|
return {height: height, width: width, margin: margin, step: step}
|
||||||
},
|
},
|
||||||
layout: function(can) { can.db.data && can.core.CallFunc(can.onaction[can.Action(ice.VIEW)], [{}, can]) },
|
layout: function(can) { can.db.data && can.core.CallFunc(can.onaction[can.Action(html.VIEW)], [{}, can]) },
|
||||||
// transform: function(can, target) { target.Value("transform", "scale(1, -1)") },
|
// transform: function(can, target) { target.Value("transform", "scale(1, -1)") },
|
||||||
transform: function(can, target) { target.Value("transform", "translate(0, "+parseInt(can.ConfHeight())+") scale(1, -1)") },
|
transform: function(can, target) { target.Value("transform", "translate(0, "+parseInt(can.ConfHeight())+") scale(1, -1)") },
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {list: [[ice.VIEW, "趋势图", "柱状图", "折线图", "数据源"],
|
Volcanos(chat.ONACTION, {list: [[html.VIEW, "趋势图", "柱状图", "折线图", "数据源"],
|
||||||
[html.HEIGHT, html.HEIGHT, 100, 200, 400, 600, 800], [html.MARGIN, html.MARGIN, 10, 20, 50, 100], [html.SPEED, html.SPEED, 10, 20, 50, 100],
|
[html.HEIGHT, html.HEIGHT, 100, 200, 400, 600, 800], [html.MARGIN, html.MARGIN, 10, 20, 50, 100], [html.SPEED, html.SPEED, 10, 20, 50, 100],
|
||||||
],
|
],
|
||||||
"趋势图": function(event, can) { var args = can.onimport._layout(can)
|
"趋势图": function(event, can) { var args = can.onimport._layout(can)
|
||||||
|
31
proto.js
31
proto.js
@ -4,17 +4,14 @@ function shy(help, meta, list, cb) { var arg = arguments, i = 0; function next(t
|
|||||||
} else if (i < arg.length && (!type || type == typeof arg[i])) { return arg[i++] }
|
} else if (i < arg.length && (!type || type == typeof arg[i])) { return arg[i++] }
|
||||||
} return cb = typeof arg[arg.length-1] == code.FUNCTION? arg[arg.length-1]: function() {}, cb.help = next(code.STRING)||"", cb.meta = next(code.OBJECT)||{}, cb.list = next(code.ARRAY)||[], cb
|
} return cb = typeof arg[arg.length-1] == code.FUNCTION? arg[arg.length-1]: function() {}, cb.help = next(code.STRING)||"", cb.meta = next(code.OBJECT)||{}, cb.list = next(code.ARRAY)||[], cb
|
||||||
}; var _can_name = "", _can_path = ""
|
}; var _can_name = "", _can_path = ""
|
||||||
var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS,
|
var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS, _cache: {}, cache: {}, pack: {}, args: {}}, function(name, can, libs, cb) {
|
||||||
_cache: {}, cache: {}, pack: {}, args: {}}, function(name, can, libs, cb) {
|
|
||||||
var meta = arguments.callee.meta, list = arguments.callee.list; if (typeof name == code.OBJECT) {
|
var meta = arguments.callee.meta, list = arguments.callee.list; if (typeof name == code.OBJECT) {
|
||||||
if (name.length > 0) { return Volcanos({panels: [{name: chat.HEADER, style: html.HIDE, state: [mdb.TIME, aaa.USERNICK]}, {name: chat.ACTION, style: html.MAIN, tool: name}, {name: chat.FOOTER, style: html.HIDE}]}) }
|
if (name.length > 0) { return Volcanos({panels: [{name: chat.HEADER, style: html.HIDE, state: [mdb.TIME, aaa.USERNICK]}, {name: chat.ACTION, style: html.MAIN, tool: name}, {name: chat.FOOTER, style: html.HIDE}]}) }
|
||||||
var Config = name; name = Config.name||ice.CAN, _can_name = ""
|
var Config = name; name = Config.name||ice.CAN, _can_name = ""
|
||||||
meta.iceberg = Config.iceberg||meta.iceberg, meta.volcano = Config.volcano||meta.volcano
|
meta.iceberg = Config.iceberg||meta.iceberg, meta.volcano = Config.volcano||meta.volcano
|
||||||
meta.libs = (Config.libs||chat.libs).concat(Config.list), panels = Config.panels||chat.panel_list, delete(Config.panels)
|
meta.libs = (Config.libs||chat.libs).concat(Config.list), panels = Config.panels||chat.panel_list, delete(Config.panels)
|
||||||
libs = [], panels.forEach(function(p) { p && (libs = libs.concat(p.list = p.list||["/panel/"+p.name+nfs._JS, "/panel/"+p.name+nfs._CSS])) }), libs = libs.concat(Config.plugins||chat.plugin_list)
|
libs = [], panels.forEach(function(p) { p && (libs = libs.concat(p.list = p.list||["/panel/"+p.name+nfs._JS, "/panel/"+p.name+nfs._CSS])) }), libs = libs.concat(Config.plugins||chat.plugin_list)
|
||||||
cb = can||function(can) { can.require([can.frame], function() {
|
cb = can||function(can) { can.require([can.frame], function() { can.onengine._init(can, can.Conf(Config), panels, Config._init||meta._init, can._target) }, function(can, key, sub) { can[key] = sub }) }
|
||||||
can.onengine._init(can, can.Conf(Config), panels, Config._init||meta._init, can._target)
|
|
||||||
}, function(can, key, sub) { can[key] = sub }) }
|
|
||||||
can = Config, can._follow = name, can._target = Config.target||meta.target, can._height = Config.height||meta._height, can._width = Config.width||meta._width
|
can = Config, can._follow = name, can._target = Config.target||meta.target, can._height = Config.height||meta._height, can._width = Config.width||meta._width
|
||||||
}
|
}
|
||||||
can = kit.proto(can||{}, kit.proto({_name: name, _path: _can_name, _load: function(name, cbs) { var cache = meta.cache[name]||[]
|
can = kit.proto(can||{}, kit.proto({_name: name, _path: _can_name, _load: function(name, cbs) { var cache = meta.cache[name]||[]
|
||||||
@ -28,7 +25,7 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS,
|
|||||||
require: function(libs, cb, cbs) {
|
require: function(libs, cb, cbs) {
|
||||||
if (!libs || libs.length == 0) {
|
if (!libs || libs.length == 0) {
|
||||||
if (navigator.userAgent == "nodejs") { return typeof cb == code.FUNCTION && cb(can) }
|
if (navigator.userAgent == "nodejs") { return typeof cb == code.FUNCTION && cb(can) }
|
||||||
return typeof cb == code.FUNCTION && setTimeout(function() { cb(can) }, 10)
|
return typeof cb == code.FUNCTION && setTimeout(function() { cb(can) }, 30)
|
||||||
}
|
}
|
||||||
if (libs[0] == undefined) { return can.require(libs.slice(1), cb, cbs) }
|
if (libs[0] == undefined) { return can.require(libs.slice(1), cb, cbs) }
|
||||||
if (libs[0] == "") { libs[0] = can._path.replace(nfs._JS, nfs._CSS) }
|
if (libs[0] == "") { libs[0] = can._path.replace(nfs._JS, nfs._CSS) }
|
||||||
@ -43,14 +40,6 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS,
|
|||||||
if (name.indexOf("/require/") == 0 && meta.iceberg) { name = meta.iceberg+name }
|
if (name.indexOf("/require/") == 0 && meta.iceberg) { name = meta.iceberg+name }
|
||||||
meta.cache[name]? next(): meta._load(name, next)
|
meta.cache[name]? next(): meta._load(name, next)
|
||||||
},
|
},
|
||||||
requestPodCmd: function(event) { return can.request(event, {space: can.ConfSpace(), index: can.ConfIndex()}) },
|
|
||||||
requests: function(event) { event = event||{}, event = event._event||event
|
|
||||||
var msg = event._msg||can.misc.Message(event, can); event._msg = msg
|
|
||||||
function set(key, value) { msg.Option(key, value) }
|
|
||||||
can.core.List(arguments, function(item, index) { if (!item || index == 0) { return }
|
|
||||||
can.base.isFunc(item.Option)? can.core.List(item.Option(), function(key) { set(key, item.Option(key)) }): can.core.Item(can.base.isFunc(item)? item(): item, set)
|
|
||||||
}); return msg
|
|
||||||
},
|
|
||||||
request: function(event) { event = event||{}, event = event._event||event
|
request: function(event) { event = event||{}, event = event._event||event
|
||||||
var msg = event._msg||can.misc.Message(event, can); event._msg = msg
|
var msg = event._msg||can.misc.Message(event, can); event._msg = msg
|
||||||
function set(key, value) { if (key == "_method") { return msg._method = value }
|
function set(key, value) { if (key == "_method") { return msg._method = value }
|
||||||
@ -63,6 +52,10 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS,
|
|||||||
})
|
})
|
||||||
return msg
|
return msg
|
||||||
},
|
},
|
||||||
|
requests: function(event) { var msg = can.request(event); function set(key, value) { msg.Option(key, value) }
|
||||||
|
can.core.List(arguments, function(item, index) { if (!item || index == 0) { return } can.core.Item(item, set) }); return msg
|
||||||
|
},
|
||||||
|
requestPodCmd: function(event) { return can.request(event, {space: can.ConfSpace(), index: can.ConfIndex()}) },
|
||||||
requestAction: function(event, button) { return can.request(event, {action: button, _toast: ice.PROCESS+" "+button}) },
|
requestAction: function(event, button) { return can.request(event, {action: button, _toast: ice.PROCESS+" "+button}) },
|
||||||
runActionInputs: function(event, cmds, cb) { var msg = can.request(event), meta = can.Conf()
|
runActionInputs: function(event, cmds, cb) { var msg = can.request(event), meta = can.Conf()
|
||||||
if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION && meta.feature[cmds[1]]) { var msg = can.request(event, {action: cmds[1]})
|
if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION && meta.feature[cmds[1]]) { var msg = can.request(event, {action: cmds[1]})
|
||||||
@ -71,7 +64,7 @@ var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS,
|
|||||||
} can.runAction(event, cmds[1], cmds.slice(2), cb, true)
|
} can.runAction(event, cmds[1], cmds.slice(2), cb, true)
|
||||||
},
|
},
|
||||||
runActionCommand: function(event, index, args, cb) { can.request(event)._caller()
|
runActionCommand: function(event, index, args, cb) { can.request(event)._caller()
|
||||||
can.runAction(event, ice.RUN, [index].concat(args), cb, true)
|
can.runAction(event, ctx.RUN, [index].concat(args), cb, true)
|
||||||
},
|
},
|
||||||
runAction: function(event, action, args, cb, silent) {
|
runAction: function(event, action, args, cb, silent) {
|
||||||
can.request(event, {_handle: ice.TRUE}, can.Option())._caller()
|
can.request(event, {_handle: ice.TRUE}, can.Option())._caller()
|
||||||
@ -125,10 +118,10 @@ try { if (typeof(window) == code.OBJECT) { var meta = Volcanos.meta
|
|||||||
meta.version = window._version, window.outerWidth-window.innerWidth > 100 && (meta.version = "", debug = false)
|
meta.version = window._version, window.outerWidth-window.innerWidth > 100 && (meta.version = "", debug = false)
|
||||||
}
|
}
|
||||||
meta._load = function(url, cb) {
|
meta._load = function(url, cb) {
|
||||||
if (meta.version) { url += (url.indexOf("?") == -1? "?": "&")+meta.version.slice(1) }
|
if (meta.version) { url += (url.indexOf(web.QS) == -1? web.QS: "&")+meta.version.slice(1) }
|
||||||
if (meta._cache[url]) { return meta._cache[url].push(cb) } else { meta._cache[url] = [cb] }
|
if (meta._cache[url]) { return meta._cache[url].push(cb) } else { meta._cache[url] = [cb] }
|
||||||
function _cb() { meta._cache[url].forEach(function(cb) { cb() }), delete(meta._cache[url]) }
|
function _cb() { meta._cache[url].forEach(function(cb) { cb() }), delete(meta._cache[url]) }
|
||||||
switch (url.split(ice.QS)[0].split(nfs.PT).pop().toLowerCase()) {
|
switch (url.split(web.QS)[0].split(nfs.PT).pop().toLowerCase()) {
|
||||||
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url, item.rel = "stylesheet", item.onload = _cb, document.head.appendChild(item); break
|
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url, item.rel = "stylesheet", item.onload = _cb, document.head.appendChild(item); break
|
||||||
default: var item = document.createElement(nfs.SCRIPT); item.src = url, item.onerror = _cb, item.onload = _cb, document.body.appendChild(item)
|
default: var item = document.createElement(nfs.SCRIPT); item.src = url, item.onerror = _cb, item.onload = _cb, document.body.appendChild(item)
|
||||||
}
|
}
|
||||||
@ -139,10 +132,10 @@ try { if (typeof(window) == code.OBJECT) { var meta = Volcanos.meta
|
|||||||
if (can.user.isMobile && last === can.page.width() < can.page.height()) { return } last = can.page.width() < can.page.height()
|
if (can.user.isMobile && last === can.page.width() < can.page.height()) { return } last = can.page.width() < can.page.height()
|
||||||
can.onmotion.delayOnce(can, function() { can.onengine.signal(can, chat.ONRESIZE, can.request(event, kit.Dict(html.HEIGHT, window.innerHeight, html.WIDTH, window.innerWidth))) }, 100, can._delay_resize = can._delay_resize||[])
|
can.onmotion.delayOnce(can, function() { can.onengine.signal(can, chat.ONRESIZE, can.request(event, kit.Dict(html.HEIGHT, window.innerHeight, html.WIDTH, window.innerWidth))) }, 100, can._delay_resize = can._delay_resize||[])
|
||||||
}) }
|
}) }
|
||||||
window.onbeforeunload = function() { can.onengine.signal(can, chat.ONUNLOAD) }
|
|
||||||
window.onerror = function(message, source, lineno, colno, error) { debug? alert([message].concat(can.misc._stacks(0, error)).join(lex.NL)): can.misc.Error(message, lex.NL+[source, lineno, colno].join(ice.DF), error) }
|
window.onerror = function(message, source, lineno, colno, error) { debug? alert([message].concat(can.misc._stacks(0, error)).join(lex.NL)): can.misc.Error(message, lex.NL+[source, lineno, colno].join(ice.DF), error) }
|
||||||
window.onmousemove = function(event) { window._mousemove && (window._mousemove.onmousemove(event)) }
|
window.onmousemove = function(event) { window._mousemove && (window._mousemove.onmousemove(event)) }
|
||||||
window.onmouseup = function(event) { window._mousemove && (window._mousemove.onmouseup(event)) }
|
window.onmouseup = function(event) { window._mousemove && (window._mousemove.onmouseup(event)) }
|
||||||
|
window.onbeforeunload = function() { can.onengine.signal(can, chat.ONUNLOAD) }
|
||||||
}
|
}
|
||||||
} else { // nodejs
|
} else { // nodejs
|
||||||
global.document = {}, global.location = {}, global.window = {}, global.navigator = {userAgent: "nodejs"}
|
global.document = {}, global.location = {}, global.window = {}, global.navigator = {userAgent: "nodejs"}
|
||||||
@ -151,6 +144,6 @@ try { if (typeof(window) == code.OBJECT) { var meta = Volcanos.meta
|
|||||||
global.lex = lex, global.yac = yac, global.ssh = ssh, global.gdb = gdb
|
global.lex = lex, global.yac = yac, global.ssh = ssh, global.gdb = gdb
|
||||||
global.tcp = tcp, global.nfs = nfs, global.cli = cli, global.log = log
|
global.tcp = tcp, global.nfs = nfs, global.cli = cli, global.log = log
|
||||||
global.code = code, global.wiki = wiki, global.chat = chat, global.team = team, global.mall = mall
|
global.code = code, global.wiki = wiki, global.chat = chat, global.team = team, global.mall = mall
|
||||||
global.html = html, global.svg = svg
|
global.http = http, global.html = html, global.icon = icon, global.svg = svg
|
||||||
global.shy = shy, global.Volcanos = Volcanos
|
global.shy = shy, global.Volcanos = Volcanos
|
||||||
} } catch (e) { console.log(e) }
|
} } catch (e) { console.log(e) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user