Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.view = function(){
var runstate = rs("control/runstate");
var needpasswd = rs("control/password");
//console.log("runstate: " + (runstate === undefined ? runstate : runstate.runstate));
if(runstate === undefined){
return m("h2", "waiting_server ... ");
} else if (runstate.runstate == null){
// try clean reboot ...
rs.clearCache();
rs("control/runstate"); //reboot detector
console.log("i'm down");
return m("h2", "server down");
} else if (needpasswd != undefined && needpasswd.want_password === true){
m.initControl = "txtpasswd";
return m("div",[
m("h2","password required"),
m("h3",needpasswd.key_name),
m("input",{
id: "txtpasswd",
type:"password",
onchange:m.withAttr("value", setPasswd),
onkeydown: function(event){
if (event.keyCode == 13){
setPasswd(this.value);
sendPassword(needpasswd);
}
}
}),
m("br"),
m("input[type=button][value=send password]",{
function checkFocus(){
if (m.initControl != undefined) {
var ctrl = document.getElementById(m.initControl);
if (ctrl!= null) {
ctrl.focus();
m.initControl = undefined;
} else {
console.log("focus-control '" + m.initControl + "' not found!");
m.initControl = undefined;
}
}
}
function load_ui(){
var m = require("mithril");
var ui = require("main");
var main = document.getElementById("main");
ui.init(main);
if (m.initControl != undefined) {
m.initControl.focus();
}
}
function checkFocus(){
if (m.initControl != undefined) {
var ctrl = document.getElementById(m.initControl);
if (ctrl!= null) {
ctrl.focus();
m.initControl = undefined;
} else {
console.log("focus-control '" + m.initControl + "' not found!");
m.initControl = undefined;
}
}
}
function checkFocus(){
if (m.initControl != undefined) {
var ctrl = document.getElementById(m.initControl);
if (ctrl!= null) {
ctrl.focus();
m.initControl = undefined;
} else {
console.log("focus-control '" + m.initControl + "' not found!");
m.initControl = undefined;
}
}
}
function load_ui(){
var m = require("mithril");
var ui = require("main");
var main = document.getElementById("main");
ui.init(main);
if (m.initControl != undefined) {
m.initControl.focus();
}
}
module.exports = {view: function(){
m.initControl = "txtname";
return m("div",
m("h2","create identity"),
m("hr"),
m("h3","name"),
m("input", {
type: "text",
id: "txtname",
/*
onkeydown: function(event){
if (event.keyCode == 13){
setPasswd(this.value);
sendPassword(needpasswd);
}
}
*/
}),
view: function(){
var profile = m.route.param("id");
var state = m.route.param("state");
var profname = m.route.param("name");
var hidden = m.route.param("hidden");
if (state == "wait"){
return m("div","waiting ...");
} if (state == "newid"){
m.initControl = "txtnewname";
return m("div",[
m("h2","create login - Step 2 / 2: create location"),
m("h3","- for new profile "),
m("hr"),
m("h2","PGP-profile name:"),
m("input",{
id: "txtnewname",
type:"text",
onchange:m.withAttr("value", setNewName),
onkeydown: function(event){
if (event.keyCode == 13){
document.getElementById("txtpasswd").focus();
}
},
}),
m("h2","enter password:"),
function step1(){
m.initControl = "txtInput";
return [
m("h3","step 1 / 5: paste retroshare-links:"),
m("textarea[id=txtInput]", {
style: {
height:"100%",
},
onkeydown: function(event){
if (event.keyCode == 13){
parseDownloads();
}
}
}),
m("div.btn2", {
style:{
textAlign:"center",
},