mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
webui: small main reorganisation
This commit is contained in:
parent
cdddab1f6a
commit
b2b96c097f
@ -17,7 +17,14 @@ function sendPassword(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function Page(content, runst){
|
function Page(menu){
|
||||||
|
this.menu = menu;
|
||||||
|
this.module = (menu.module != undefined) ? menu.module : menu.name;
|
||||||
|
this.path = menu.path != undefined ? menu.path : ("/" + menu.name);
|
||||||
|
|
||||||
|
var runst = menu.runstate;
|
||||||
|
var content = require(module);
|
||||||
|
|
||||||
this.view = function(){
|
this.view = function(){
|
||||||
var runstate = rs("control/runstate");
|
var runstate = rs("control/runstate");
|
||||||
var needpasswd = rs("control/password");
|
var needpasswd = rs("control/password");
|
||||||
@ -85,10 +92,9 @@ module.exports = {
|
|||||||
|
|
||||||
menudef.nodes.map(function(menu){
|
menudef.nodes.map(function(menu){
|
||||||
if (menu.action === undefined) {
|
if (menu.action === undefined) {
|
||||||
var path = menu.path != undefined ? menu.path : ("/" + menu.name);
|
var p = new Page(menu)
|
||||||
var module = menu.module != undefined ? menu.module : menu.name
|
console.log("adding route " + menu.name + " for " + p.path + " with module " + p.module);
|
||||||
console.log("adding route " + menu.name + " for " + path + " with module " + module);
|
maps[p.path] = p;
|
||||||
maps[path] = new Page(require(module), menu.runstate);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m.route.mode = "hash";
|
m.route.mode = "hash";
|
||||||
|
@ -161,7 +161,8 @@ function checkFocus(){
|
|||||||
ctrl.focus();
|
ctrl.focus();
|
||||||
m.initControl = undefined;
|
m.initControl = undefined;
|
||||||
} else {
|
} else {
|
||||||
console.log("focus-control '" + m.initControl + "' not found!")
|
console.log("focus-control '" + m.initControl + "' not found!");
|
||||||
|
m.initControl = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user