From 31e43ad6498c5c304d70af1c486add595e5b1ab6 Mon Sep 17 00:00:00 2001 From: Grovkillen Date: Tue, 14 Jan 2020 06:33:49 +0100 Subject: [PATCH] [package.json] updated with more correct syntax --- package.json | 15 +++++++++++---- src/gui_easy_popper_rules.js | 13 ++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 3c27683..712c3ac 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,19 @@ "timestamp": 1578820861737, "version": "0.0.1", "author": "Jimmy 'Grovkillen' Westberg (https://grovkillen.com)", - "license": "GPL-3.0-or-later", "description": "Front End for ESP Easy", - "bin": { + "main": { "index.html.gz": "build/main/0.0.nightly.1/" }, - "repository": "github:letscontrolit/GUIEasy", + "repository": { + "type": "git", + "url": "git+https://github.com/letscontrolit/GUIEasy.git" + }, + "license": "SEE LICENSE IN LICENSE.md", + "bugs": { + "url": "https://github.com/letscontrolit/GUIEasy/issues" + }, + "homepage": "https://github.com/letscontrolit/GUIEasy#readme" "devDependencies": { "grunt": "^1.0.4", "grunt-contrib-uglify-es": "^3.3.0", @@ -32,4 +39,4 @@ "GUI", "Frontend" ] -} \ No newline at end of file +} diff --git a/src/gui_easy_popper_rules.js b/src/gui_easy_popper_rules.js index 146b307..f55e24c 100644 --- a/src/gui_easy_popper_rules.js +++ b/src/gui_easy_popper_rules.js @@ -1,4 +1,5 @@ /* GUIEasy Copyright (C) 2019-2020 Jimmy "Grovkillen" Westberg */ + guiEasy.popper.rules = function(){ let x = guiEasy.popper.rules; x.splitSyntax(); @@ -463,19 +464,15 @@ guiEasy.popper.rules.focus = function (event) { } }; -guiEasy.popper.rules.selection = function (state = "up") { - if (state.type === "mouseup") { - state = "up"; - } +guiEasy.popper.rules.selection = function () { let x = guiEasy.popper.rules.syntax.selectionElement; let y = guiEasy.popper.rules.syntax.editorElement; x.innerHTML = (x.innerHTML).replace(/editor-caret/g, ""); x.innerHTML = (x.innerHTML).replace(/end-of-line-caret/g, ""); let caretElement = document.getElementById("select-" + y.selectionStart); - if (state === "up" && y.selectionEnd - y.selectionStart === 0) { + if (y.selectionEnd - y.selectionStart === 0) { if (caretElement !== null) { caretElement.classList.add("editor-caret"); - x.position.col = -1; x.position.col = Array.from(caretElement.parentNode.children).indexOf(caretElement); x.position.colStamp = Date.now(); } @@ -485,12 +482,10 @@ guiEasy.popper.rules.selection = function (state = "up") { x.position.colStamp = Date.now(); } } - let test = Date.now() - x.position.rowStamp; - if (state === "up" && test > 100 && caretElement !== null) { + if (caretElement !== null) { x.position.row = parseInt((caretElement.parentElement.id).replace("row-", "")); x.position.rowStamp = Date.now(); } - console.log(x.position); }; guiEasy.popper.rules.input.specialKeys = function (event) {