Skip to content

Commit

Permalink
[package.json] updated with more correct syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Grovkillen committed Jan 14, 2020
1 parent 94d36a0 commit 31e43ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@
"timestamp": 1578820861737,
"version": "0.0.1",
"author": "Jimmy 'Grovkillen' Westberg <jimmy@grovkillen.com> (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",
Expand All @@ -32,4 +39,4 @@
"GUI",
"Frontend"
]
}
}
13 changes: 4 additions & 9 deletions src/gui_easy_popper_rules.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* GUIEasy Copyright (C) 2019-2020 Jimmy "Grovkillen" Westberg */

guiEasy.popper.rules = function(){
let x = guiEasy.popper.rules;
x.splitSyntax();
Expand Down Expand Up @@ -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();
}
Expand All @@ -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) {
Expand Down

0 comments on commit 31e43ad

Please sign in to comment.