Skip to content

Commit

Permalink
use shift-click instead of double-click
Browse files Browse the repository at this point in the history
  • Loading branch information
InventivetalentDev committed Feb 22, 2019
1 parent 6c74999 commit 7d81c0e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
37 changes: 21 additions & 16 deletions js/nodeGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,26 +355,31 @@ function init(extraLibraries) {
};
LGraphNode.prototype.onDblClick = function () {
console.log(this);
};
LGraphNode.prototype.onMouseDown = function (e) {
console.log(e);

let className = this.className;
if (!className) {
return;
}
let url;
if (className.startsWith("org.bukkit.")) {
url = "https://hub.spigotmc.org/javadocs/spigot/";
} else if (className.startsWith("java.")) {
url = "https://docs.oracle.com/javase/8/docs/api/";
}
if (!url) {
return;
}
if(e.shiftKey) {
let className = this.className;
if (!className) {
return;
}
let url;
if (className.startsWith("org.bukkit.")) {
url = "https://hub.spigotmc.org/javadocs/spigot/";
} else if (className.startsWith("java.")) {
url = "https://docs.oracle.com/javase/8/docs/api/";
}
if (!url) {
return;
}

url += className.split(".").join("/") + ".html";
url += className.split(".").join("/") + ".html";

/// TODO: link to individual fields/methods/etc.
/// TODO: link to individual fields/methods/etc.

shell.openExternal(url);
shell.openExternal(url);
}
};

LGraphNode.prototype.onDrawBackground = handleDescDrawBackground;
Expand Down
2 changes: 1 addition & 1 deletion js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function handleDescDrawBackground(ctx) {

if (this.mouseOver) {
ctx.fillStyle = "#AAA";
this.descBlockHeight = wrapCanvasText(ctx, (this.desc || this.description) + " [double-click for more]", 0, this.size[1] + 14, this.size[0], 14);
this.descBlockHeight = wrapCanvasText(ctx, (this.desc || this.description) + " [shift-click for more]", 0, this.size[1] + 14, this.size[0], 14);
}
}

Expand Down

0 comments on commit 7d81c0e

Please sign in to comment.