From 6bed25ee27c8fb5a111df5a5804ef3bcf48bffbf Mon Sep 17 00:00:00 2001 From: Fluffy Jenkins Date: Thu, 16 Jan 2020 19:44:34 +0000 Subject: [PATCH] Formatting (bloody ide not doing qml) --- scripts/communityModules/chat/FloofChat.js | 3 +- scripts/communityModules/chat/FloofChat.qml | 32 ++++++++++----------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/scripts/communityModules/chat/FloofChat.js b/scripts/communityModules/chat/FloofChat.js index 7859d95090..2e9a08f241 100644 --- a/scripts/communityModules/chat/FloofChat.js +++ b/scripts/communityModules/chat/FloofChat.js @@ -188,7 +188,6 @@ function go2(msg) { domainsList.forEach(function (domain) { if (domain["Domain Name"].toLowerCase().indexOf(msg.toLowerCase()) !== -1 && !dest) { dest = {"name": domain["Domain Name"], "url": domain["Visit"]}; - } }); return dest; @@ -217,7 +216,7 @@ function processChat(cmd) { if (msg.indexOf("/") === 0) { msg = msg.substring(1); var commandList = msg.split(" "); - var tempList = commandList.join(";'#[]").split(";'#[]"); + var tempList = commandList.concat(); tempList.shift(); var restOfMsg = tempList.join(" "); diff --git a/scripts/communityModules/chat/FloofChat.qml b/scripts/communityModules/chat/FloofChat.qml index cfc0b43abc..8d96bf7e42 100644 --- a/scripts/communityModules/chat/FloofChat.qml +++ b/scripts/communityModules/chat/FloofChat.qml @@ -30,19 +30,19 @@ Rectangle { } catch(e){ // } - if(!data.failed){ - if(data.cmd){ + if (!data.failed) { + if (data.cmd) { JSConsole.executeCommand(data.msg); } console.log(data.visible); - if(data.visible){ + if (data.visible) { thing.visible = true; textArea.focus = true; - } else if(!data.visible){ + } else if (!data.visible) { thing.visible = false; textArea.focus = false; } - if(data.history){ + if (data.history) { history = data.history; } } @@ -69,36 +69,36 @@ Rectangle { clip: false font.pointSize: 20 - function _onEnterPressed(event){ - sendMessage(JSON.stringify({type:"MSG",message:text,event:event})); + function _onEnterPressed(event) { + sendMessage(JSON.stringify({type:"MSG", message:text, event:event})); history.unshift(text); text = ""; hist = -1; } - function upPressed(event){ + function upPressed(event) { hist++; - if(hist > history.length-1){ + if (hist > history.length-1) { hist = history.length-1; } text = history[hist]; } - function downPressed(event){ + function downPressed(event) { hist--; - if(hist<-1){ + if (hist < -1) { hist = -1; } - if(hist===-1){ + if (hist === -1) { text = ""; } else{ text = history[hist]; } } - Keys.onReturnPressed: { _onEnterPressed(event) } - Keys.onEnterPressed: { _onEnterPressed(event) } - Keys.onUpPressed: { upPressed(event) } - Keys.onDownPressed: { downPressed(event) } + Keys.onReturnPressed: { _onEnterPressed(event); } + Keys.onEnterPressed: { _onEnterPressed(event); } + Keys.onUpPressed: { upPressed(event); } + Keys.onDownPressed: { downPressed(event); } } MouseArea {