Formatting (bloody ide not doing qml)

This commit is contained in:
Fluffy Jenkins 2020-01-16 19:44:34 +00:00
parent 1e47165303
commit 6bed25ee27
2 changed files with 17 additions and 18 deletions

View file

@ -188,7 +188,6 @@ function go2(msg) {
domainsList.forEach(function (domain) { domainsList.forEach(function (domain) {
if (domain["Domain Name"].toLowerCase().indexOf(msg.toLowerCase()) !== -1 && !dest) { if (domain["Domain Name"].toLowerCase().indexOf(msg.toLowerCase()) !== -1 && !dest) {
dest = {"name": domain["Domain Name"], "url": domain["Visit"]}; dest = {"name": domain["Domain Name"], "url": domain["Visit"]};
} }
}); });
return dest; return dest;
@ -217,7 +216,7 @@ function processChat(cmd) {
if (msg.indexOf("/") === 0) { if (msg.indexOf("/") === 0) {
msg = msg.substring(1); msg = msg.substring(1);
var commandList = msg.split(" "); var commandList = msg.split(" ");
var tempList = commandList.join(";'#[]").split(";'#[]"); var tempList = commandList.concat();
tempList.shift(); tempList.shift();
var restOfMsg = tempList.join(" "); var restOfMsg = tempList.join(" ");

View file

@ -30,19 +30,19 @@ Rectangle {
} catch(e){ } catch(e){
// //
} }
if(!data.failed){ if (!data.failed) {
if(data.cmd){ if (data.cmd) {
JSConsole.executeCommand(data.msg); JSConsole.executeCommand(data.msg);
} }
console.log(data.visible); console.log(data.visible);
if(data.visible){ if (data.visible) {
thing.visible = true; thing.visible = true;
textArea.focus = true; textArea.focus = true;
} else if(!data.visible){ } else if (!data.visible) {
thing.visible = false; thing.visible = false;
textArea.focus = false; textArea.focus = false;
} }
if(data.history){ if (data.history) {
history = data.history; history = data.history;
} }
} }
@ -69,36 +69,36 @@ Rectangle {
clip: false clip: false
font.pointSize: 20 font.pointSize: 20
function _onEnterPressed(event){ function _onEnterPressed(event) {
sendMessage(JSON.stringify({type:"MSG",message:text,event:event})); sendMessage(JSON.stringify({type:"MSG", message:text, event:event}));
history.unshift(text); history.unshift(text);
text = ""; text = "";
hist = -1; hist = -1;
} }
function upPressed(event){ function upPressed(event) {
hist++; hist++;
if(hist > history.length-1){ if (hist > history.length-1) {
hist = history.length-1; hist = history.length-1;
} }
text = history[hist]; text = history[hist];
} }
function downPressed(event){ function downPressed(event) {
hist--; hist--;
if(hist<-1){ if (hist < -1) {
hist = -1; hist = -1;
} }
if(hist===-1){ if (hist === -1) {
text = ""; text = "";
} else{ } else{
text = history[hist]; text = history[hist];
} }
} }
Keys.onReturnPressed: { _onEnterPressed(event) } Keys.onReturnPressed: { _onEnterPressed(event); }
Keys.onEnterPressed: { _onEnterPressed(event) } Keys.onEnterPressed: { _onEnterPressed(event); }
Keys.onUpPressed: { upPressed(event) } Keys.onUpPressed: { upPressed(event); }
Keys.onDownPressed: { downPressed(event) } Keys.onDownPressed: { downPressed(event); }
} }
MouseArea { MouseArea {