mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-29 10:19:21 +08:00
mix branch 'master'
This commit is contained in:
commit
2477780d67
@ -120,6 +120,8 @@ var Index = &ctx.Context{Name: "chat", Help: "会议中心",
|
|||||||
return
|
return
|
||||||
case "rename":
|
case "rename":
|
||||||
m.Cmd("aaa.auth", "username", m.Option("username"), "data", "nickname", arg[1])
|
m.Cmd("aaa.auth", "username", m.Option("username"), "data", "nickname", arg[1])
|
||||||
|
|
||||||
|
case "weixin":
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -642,6 +642,14 @@ var page = Page({check: true,
|
|||||||
})
|
})
|
||||||
page.river.Pane.Show(), page.pane = page.action, page.plugin = kit.Selector(page.action, "fieldset")[0]
|
page.river.Pane.Show(), page.pane = page.action, page.plugin = kit.Selector(page.action, "fieldset")[0]
|
||||||
page.action.Pane.Layout(ctx.Search("layout")? ctx.Search("layout"): kit.device.isMobile? "办公": "工作")
|
page.action.Pane.Layout(ctx.Search("layout")? ctx.Search("layout"): kit.device.isMobile? "办公": "工作")
|
||||||
page.socket = page.WSS()
|
|
||||||
|
function conn() {
|
||||||
|
page.socket = page.WSS(null, function() {
|
||||||
|
page.socket.close()
|
||||||
|
}, function() {
|
||||||
|
setTimeout(conn, 1000)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
conn()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -204,7 +204,7 @@ ctx = context = {
|
|||||||
xhr.setRequestHeader("Accept", "application/json")
|
xhr.setRequestHeader("Accept", "application/json")
|
||||||
xhr.send(args.join("&"))
|
xhr.send(args.join("&"))
|
||||||
},
|
},
|
||||||
WSS: function(cb) {
|
WSS: function(cb, onerror, onclose) {
|
||||||
var s = new WebSocket(location.protocol.replace("http", "ws")+"//"+location.host+"/wss")
|
var s = new WebSocket(location.protocol.replace("http", "ws")+"//"+location.host+"/wss")
|
||||||
s.onopen = function(event) {
|
s.onopen = function(event) {
|
||||||
kit.Log(event)
|
kit.Log(event)
|
||||||
@ -225,9 +225,11 @@ ctx = context = {
|
|||||||
}
|
}
|
||||||
s.onerror = function(event) {
|
s.onerror = function(event) {
|
||||||
kit.Log(event)
|
kit.Log(event)
|
||||||
|
typeof onerror == "function" && onerror(event)
|
||||||
}
|
}
|
||||||
s.onclose = function(event) {
|
s.onclose = function(event) {
|
||||||
kit.Log(event)
|
kit.Log(event)
|
||||||
|
typeof onclose == "function" && onclose(event)
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
},
|
},
|
||||||
|
@ -142,10 +142,10 @@ function Page(page) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (page.check) {
|
if (page.check) {
|
||||||
false && kit.device.isWeiXin? page.login.Pane.Run(["weixin"], function(msg) {
|
kit.device.isWeiXin? page.login.Pane.Run(["weixin"], function(msg) {
|
||||||
page.Include([
|
page.Include([
|
||||||
"https://res.wx.qq.com/open/js/jweixin-1.4.0.js",
|
"https://res.wx.qq.com/open/js/jweixin-1.4.0.js",
|
||||||
"/static/librarys/weixin.js",
|
// "/static/librarys/weixin.js",
|
||||||
], function(event) {
|
], function(event) {
|
||||||
wx.error(function(res){})
|
wx.error(function(res){})
|
||||||
wx.ready(function(){
|
wx.ready(function(){
|
||||||
@ -437,7 +437,7 @@ function Page(page) {
|
|||||||
}
|
}
|
||||||
return typeof page[args[0]] == "function" && kit._call(page[args[0]], args.slice(1))
|
return typeof page[args[0]] == "function" && kit._call(page[args[0]], args.slice(1))
|
||||||
},
|
},
|
||||||
WSS: function(cb) {
|
WSS: function(cb, onerror, onclose) {
|
||||||
return ctx.WSS(cb || (function(m) {
|
return ctx.WSS(cb || (function(m) {
|
||||||
if (m.detail) {
|
if (m.detail) {
|
||||||
page.action.Pane.Core(event, m, ["_cmd", m.detail], function(msg) {
|
page.action.Pane.Core(event, m, ["_cmd", m.detail], function(msg) {
|
||||||
@ -446,7 +446,7 @@ function Page(page) {
|
|||||||
} else {
|
} else {
|
||||||
page.ontoast(m.result.join(""))
|
page.ontoast(m.result.join(""))
|
||||||
}
|
}
|
||||||
}))
|
}), onerror, onclose)
|
||||||
},
|
},
|
||||||
|
|
||||||
initToast: function() {},
|
initToast: function() {},
|
||||||
@ -464,6 +464,10 @@ function Page(page) {
|
|||||||
})
|
})
|
||||||
}]}, {type: "br"},
|
}]}, {type: "br"},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if (kit.device.isWeiXin) {
|
||||||
|
kit.AppendChild(output, [])
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
Login: function(username, password, cb) {
|
Login: function(username, password, cb) {
|
||||||
field.Pane.Run([username, password], function(msg) {cb(msg.result && msg.result[0] || "")})
|
field.Pane.Run([username, password], function(msg) {cb(msg.result && msg.result[0] || "")})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user