Commit 86d73c3c authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

remove tabs, trailing whitespace

parent 5c516748
...@@ -61,7 +61,7 @@ var canvas_events = (function() { ...@@ -61,7 +61,7 @@ var canvas_events = (function() {
context["addEventListener"](e, events[e], false); context["addEventListener"](e, events[e], false);
} }
} }
}, },
remove_events = function(context, events) { remove_events = function(context, events) {
// convenience routine for removing a bunch of events at once // convenience routine for removing a bunch of events at once
var e; var e;
...@@ -70,7 +70,7 @@ var canvas_events = (function() { ...@@ -70,7 +70,7 @@ var canvas_events = (function() {
context["addEventListener"](e, events[e], false); context["addEventListener"](e, events[e], false);
} }
} }
}, },
find_scalar_draggable = function (elem) { find_scalar_draggable = function (elem) {
var ret = elem; var ret = elem;
while (ret) { while (ret) {
...@@ -324,7 +324,7 @@ var canvas_events = (function() { ...@@ -324,7 +324,7 @@ var canvas_events = (function() {
/*if (evt.which == 2) /*if (evt.which == 2)
{ {
evt.stopPropagation(); evt.stopPropagation();
evt.preventDefault(); evt.preventDefault();
}*/ }*/
if (evt.type === "touchstart") { if (evt.type === "touchstart") {
if (target_is_popup(evt)) { if (target_is_popup(evt)) {
...@@ -664,16 +664,16 @@ var canvas_events = (function() { ...@@ -664,16 +664,16 @@ var canvas_events = (function() {
hscroll_mousemove: function(evt) { hscroll_mousemove: function(evt) {
if (evt.movementX != 0) { if (evt.movementX != 0) {
//console.log("move: " + e.movementX); //console.log("move: " + e.movementX);
var hscroll = document.getElementById("hscroll"); var hscroll = document.getElementById("hscroll");
var svg_elem = document.getElementById("patchsvg"); var svg_elem = document.getElementById("patchsvg");
var min_width = document.body.clientWidth + 3; var min_width = document.body.clientWidth + 3;
var width = svg_elem.getAttribute('width'); var width = svg_elem.getAttribute('width');
var xScrollSize; var xScrollSize;
xScrollSize = hscroll.offsetWidth; xScrollSize = hscroll.offsetWidth;
var xTranslate = evt.movementX * var xTranslate = evt.movementX *
((width - min_width)/(min_width - xScrollSize)) * ((width - min_width)/(min_width - xScrollSize)) *
(evt.movementX > 0 ? 1 : 0.75); (evt.movementX > 0 ? 1 : 0.75);
...@@ -696,16 +696,16 @@ var canvas_events = (function() { ...@@ -696,16 +696,16 @@ var canvas_events = (function() {
vscroll_mousemove: function(evt) { vscroll_mousemove: function(evt) {
if (evt.movementY != 0) { if (evt.movementY != 0) {
//console.log("move: " + e.movementY); //console.log("move: " + e.movementY);
var vscroll = document.getElementById("vscroll"); var vscroll = document.getElementById("vscroll");
var svg_elem = document.getElementById("patchsvg"); var svg_elem = document.getElementById("patchsvg");
var min_height = document.body.clientHeight + 3; var min_height = document.body.clientHeight + 3;
var height = svg_elem.getAttribute('height'); var height = svg_elem.getAttribute('height');
var yScrollSize; var yScrollSize;
yScrollSize = vscroll.offsetHeight; yScrollSize = vscroll.offsetHeight;
var yTranslate = evt.movementY * var yTranslate = evt.movementY *
((height - min_height)/(min_height - yScrollSize)) * ((height - min_height)/(min_height - yScrollSize)) *
(evt.movementY > 0 ? 2 : 1.5); (evt.movementY > 0 ? 2 : 1.5);
...@@ -960,7 +960,7 @@ var canvas_events = (function() { ...@@ -960,7 +960,7 @@ var canvas_events = (function() {
"touchmove": events.iemgui_label_mousemove, "touchmove": events.iemgui_label_mousemove,
"mouseup": events.iemgui_label_mouseup, "mouseup": events.iemgui_label_mouseup,
"touchend": events.iemgui_label_mouseup "touchend": events.iemgui_label_mouseup
}); });
}, },
hscroll_drag: function() { hscroll_drag: function() {
canvas_events.none(); canvas_events.none();
...@@ -982,7 +982,7 @@ var canvas_events = (function() { ...@@ -982,7 +982,7 @@ var canvas_events = (function() {
add_events(document, { add_events(document, {
"mouseup": events.vscroll_mouseup, "mouseup": events.vscroll_mouseup,
"mousemove": events.vscroll_mousemove "mousemove": events.vscroll_mousemove
}); });
}, },
text: function() { text: function() {
canvas_events.none(); canvas_events.none();
...@@ -1001,7 +1001,7 @@ var canvas_events = (function() { ...@@ -1001,7 +1001,7 @@ var canvas_events = (function() {
floating_text: function() { floating_text: function() {
canvas_events.none(); canvas_events.none();
canvas_events.text(); canvas_events.text();
remove_events({ remove_events(document, {
"mousedown": events.text_mousedown, "mousedown": events.text_mousedown,
"mouseup": events.text_mouseup, "mouseup": events.text_mouseup,
"keypress": events.text_keypress, "keypress": events.text_keypress,
...@@ -1017,7 +1017,7 @@ var canvas_events = (function() { ...@@ -1017,7 +1017,7 @@ var canvas_events = (function() {
}, },
dropdown_menu: function() { dropdown_menu: function() {
canvas_events.none(); canvas_events.none();
add_events(document, { add_events(document, {
"mousedown": events.dropdown_menu_mousedown, "mousedown": events.dropdown_menu_mousedown,
"touchstart": events.dropdown_menu_mousedown, "touchstart": events.dropdown_menu_mousedown,
"mouseup": events.dropdown_menu_mouseup, "mouseup": events.dropdown_menu_mouseup,
...@@ -1157,13 +1157,13 @@ var canvas_events = (function() { ...@@ -1157,13 +1157,13 @@ var canvas_events = (function() {
console.log("tried to save something"); console.log("tried to save something");
}, false }, false
); );
// add listener for the scrollbars // add listener for the scrollbars
document.getElementById("hscroll"). document.getElementById("hscroll").
addEventListener("mousedown", canvas_events.hscroll_drag, false); addEventListener("mousedown", canvas_events.hscroll_drag, false);
document.getElementById("vscroll"). document.getElementById("vscroll").
addEventListener("mousedown", canvas_events.vscroll_drag, false); addEventListener("mousedown", canvas_events.vscroll_drag, false);
add_events(document, { add_events(document, {
"contextmenu": function(evt) { "contextmenu": function(evt) {
// Whoa-- huge workaround! Right now we're getting // Whoa-- huge workaround! Right now we're getting
...@@ -1217,7 +1217,7 @@ var canvas_events = (function() { ...@@ -1217,7 +1217,7 @@ var canvas_events = (function() {
if (canvas_events.get_state() === "normal") { if (canvas_events.get_state() === "normal") {
pdgui.pdsend(name, "copy"); pdgui.pdsend(name, "copy");
} }
}, },
"paste": function(evt) { "paste": function(evt) {
// Listen to paste event // Listen to paste event
// XXXTODO: Not sure whether this is even needed any more, // XXXTODO: Not sure whether this is even needed any more,
...@@ -1300,7 +1300,7 @@ var canvas_events = (function() { ...@@ -1300,7 +1300,7 @@ var canvas_events = (function() {
} }
}); });
// Add placeholder text... this all needs to be collected into an // Add placeholder text... this all needs to be collected into an
// add_events function similiar to the one in index.js // add_events function similiar to the one in index.js
document.querySelector("#canvas_find_text").placeholder = document.querySelector("#canvas_find_text").placeholder =
l("canvas.find.placeholder"); l("canvas.find.placeholder");
...@@ -1328,7 +1328,7 @@ var canvas_events = (function() { ...@@ -1328,7 +1328,7 @@ var canvas_events = (function() {
}); });
gui.Window.get().on("focus", function() { gui.Window.get().on("focus", function() {
nw_window_focus_callback(name); nw_window_focus_callback(name);
}); });
gui.Window.get().on("blur", function() { gui.Window.get().on("blur", function() {
nw_window_blur_callback(name); nw_window_blur_callback(name);
}); });
...@@ -1667,11 +1667,11 @@ function nw_create_patch_window_menus(gui, w, name) { ...@@ -1667,11 +1667,11 @@ function nw_create_patch_window_menus(gui, w, name) {
minit(m.edit.paste_clipboard, { minit(m.edit.paste_clipboard, {
enabled: true, enabled: true,
click: function () { click: function () {
var clipboard = nw.Clipboard.get(); var clipboard = nw.Clipboard.get();
var text = clipboard.get('text'); var text = clipboard.get('text');
//pdgui.post("** paste from clipboard: "+text); //pdgui.post("** paste from clipboard: "+text);
canvas_events.paste_from_pd_file(name, text); canvas_events.paste_from_pd_file(name, text);
} }
}); });
minit(m.edit.duplicate, { minit(m.edit.duplicate, {
enabled: true, enabled: true,
...@@ -2175,7 +2175,7 @@ function init_menu_font_size(size) { ...@@ -2175,7 +2175,7 @@ function init_menu_font_size(size) {
case 36: case 36:
m.font.s36.checked = true; m.font.s36.checked = true;
break; break;
} }
} }
// ico@vt.edu 2020-08-24: this is called when the window is finally // ico@vt.edu 2020-08-24: this is called when the window is finally
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment