From 7840af16c98c8cf9fdaf9033a5f0b1439081368f Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes <jon.w.wilkes@gmail.com> Date: Sun, 25 Oct 2015 16:56:15 -0400 Subject: [PATCH] update js files to use post instead of gui_post --- pd/nw/dialog_canvas.html | 28 ++++++++++++++-------------- pd/nw/dialog_font.html | 6 +++--- pd/nw/dialog_gatom.html | 4 ++-- pd/nw/dialog_iemgui.html | 12 ++++++------ pd/nw/dialog_prefs.html | 40 ++++++++++++++++++++-------------------- pd/nw/index.js | 10 +++++----- pd/nw/pd_canvas.js | 30 +++++++++++++++--------------- 7 files changed, 65 insertions(+), 65 deletions(-) diff --git a/pd/nw/dialog_canvas.html b/pd/nw/dialog_canvas.html index cabbf7d40..b57efc320 100644 --- a/pd/nw/dialog_canvas.html +++ b/pd/nw/dialog_canvas.html @@ -316,7 +316,7 @@ function flag_change(elem) { // get value from radio group, checked from checkboxes if (name === "array_style") { value = document.querySelector('input[name="array_style"]:checked').value; - pdgui.gui_post("array style found: " + value); + pdgui.post("array style found: " + value); // Toggle visibility of the fill color button-- only show for bar // graph style (= 3) toggle_fill_color(+value); @@ -324,9 +324,9 @@ function flag_change(elem) { // "+" for casting boolean to number value = +elem.checked; } - //pdgui.gui_post("value is " + value); + //pdgui.post("value is " + value); flag = array_attr.array_flags; - pdgui.gui_post("flag before is " + flag); + pdgui.post("flag before is " + flag); switch (name) { case "array_save": flag &= ~1; // clear the save bit @@ -343,7 +343,7 @@ function flag_change(elem) { break; } array_attr.array_flags = flag; - pdgui.gui_post("array is " + array_attr); + pdgui.post("array is " + array_attr); } function flag2_change(elem) { @@ -355,7 +355,7 @@ function flag2_change(elem) { // "+" for casting boolean to number value = +elem.checked; array_attr[name] = value; - pdgui.gui_post("array is " + array_attr); + pdgui.post("array is " + array_attr); } function array_delete_change(elem) { @@ -373,8 +373,8 @@ function attr_change(elem) { if (elem.name === "array-fill") { array-fill } - pdgui.gui_post("name is " + elem.name); - pdgui.gui_post("value is " + elem.value); + pdgui.post("name is " + elem.name); + pdgui.post("value is " + elem.value); } function array_choose(array_index) { @@ -408,7 +408,7 @@ console.log("namer is " + name); break; default: // name, size, fill, and outline - pdgui.gui_post("name is " + name); + pdgui.post("name is " + name); elem = document.getElementsByName(name)[0]; elem.value = value; break; @@ -419,7 +419,7 @@ console.log("namer is " + name); var arrays_select = document.getElementById("arrays_select"); arrays_select.addEventListener("change", function() { - pdgui.gui_post("changed the thing is " + this.value); + pdgui.post("changed the thing is " + this.value); array_choose(this.value); }); @@ -571,7 +571,7 @@ function apply() { function cancel() { var i, attrs, gfxstub; - pdgui.gui_post("closing the window at this point"); + pdgui.post("closing the window at this point"); //window.close(true); pdgui.pdsend(pd_object_callback, "cancel"); for (i = 0; i < pd_garray_attrs.length; i++) { @@ -633,7 +633,7 @@ function register_canvas_id(gfxstub, attr_objects) { // attr_objects[1...n-1]: array properties for (prop in attr_objects[0]) { if (attr_objects[0].hasOwnProperty(prop)) { - pdgui.gui_post(prop + ": " + attr_objects[0][prop]); + pdgui.post(prop + ": " + attr_objects[0][prop]); } } add_events(gfxstub); @@ -692,7 +692,7 @@ function populate_form(attr_object) { console.log("the thing here is " + prop); prop_group.classList.remove("hidden"); } else { - pdgui.gui_post("Error: couldn't find iemgui prop group for " + + pdgui.post("Error: couldn't find iemgui prop group for " + prop); } if (prop === "display-flags") { @@ -710,12 +710,12 @@ function populate_form(attr_object) { var hex_string = Number(attr_object[prop]).toString(16); var color_string = "#" + (hex_string === "0" ? "000000" : hex_string); - pdgui.gui_post("color is " + color_string); + pdgui.post("color is " + color_string); elem[0].value = color_string; } else if (elem[0].type === "checkbox") { // The attr here is a string, so we need to // force it to number, hence the "+" below - gui_post("found a CHECKED ITEM!!!"); + pdgui.post("found a CHECKED ITEM!!!"); elem[0].checked = +attr_object[prop]; } else { elem[0].value = attr_object[prop]; diff --git a/pd/nw/dialog_font.html b/pd/nw/dialog_font.html index 89d6fa5c4..e05806142 100644 --- a/pd/nw/dialog_font.html +++ b/pd/nw/dialog_font.html @@ -112,12 +112,12 @@ function ok() { } function change_size() { - pdgui.gui_post("changing the size"); + pdgui.post("changing the size"); apply(); } function apply() { - pdgui.gui_post("we're applying font size changes!"); + pdgui.post("we're applying font size changes!"); pdgui.pdsend(canvas, "font", +document.querySelector('input[name="font_size"]:checked').value, current_size, @@ -127,7 +127,7 @@ function apply() { } function cancel() { - pdgui.gui_post("closing the window at this point"); + pdgui.post("closing the window at this point"); //window.close(true); pdgui.pdsend(pd_object_callback, "cancel"); } diff --git a/pd/nw/dialog_gatom.html b/pd/nw/dialog_gatom.html index 2d7314c30..9382d293a 100644 --- a/pd/nw/dialog_gatom.html +++ b/pd/nw/dialog_gatom.html @@ -185,7 +185,7 @@ function gatom_escape(str) { } function apply() { - pdgui.gui_post("we're applying gatom changes!"); + pdgui.post("we're applying gatom changes!"); pdgui.pdsend(pd_object_callback, "param", +document.getElementById("width").value, +document.getElementById("minimum-range").value, @@ -198,7 +198,7 @@ function apply() { } function cancel() { - pdgui.gui_post("closing the window at this point"); + pdgui.post("closing the window at this point"); //window.close(true); pdgui.pdsend(pd_object_callback, "cancel"); } diff --git a/pd/nw/dialog_iemgui.html b/pd/nw/dialog_iemgui.html index f4b151d9f..93a8b9ac4 100644 --- a/pd/nw/dialog_iemgui.html +++ b/pd/nw/dialog_iemgui.html @@ -330,7 +330,7 @@ function strip_problem_chars(arg) { } function apply() { - pdgui.gui_post("we're applying iemgui changes!"); + pdgui.post("we're applying iemgui changes!"); /* Not sure what these are... iemgui_clip_dim $id iemgui_clip_num $id @@ -420,9 +420,9 @@ function apply() { if (log_display === null) { slot5 = +document.getElementsByName("vu-scale")[0].checked; - pdgui.gui_post("slot five is " + slot5); + pdgui.post("slot five is " + slot5); } - pdgui.gui_post("slot five is " + slot5); + pdgui.post("slot five is " + slot5); var init = +document.getElementsByName("init")[0].checked; if (init === "") { init = 0; } @@ -472,7 +472,7 @@ function apply() { } function cancel() { - pdgui.gui_post("closing the window at this point"); + pdgui.post("closing the window at this point"); //window.close(true); pdgui.pdsend(pd_object_callback, "cancel"); } @@ -524,7 +524,7 @@ function populate_form(attr_object) { console.log("the thing here is " + attr); prop_group.classList.remove("hidden"); } else { - pdgui.gui_post("Error: couldn't find iemgui prop group for " + + pdgui.post("Error: couldn't find iemgui prop group for " + attr); } // iemguis use the string 'empty' for null because of @@ -537,7 +537,7 @@ function populate_form(attr_object) { var hex_string = Number(attr_object[attr]).toString(16); var color_string = "#" + (hex_string === "0" ? "000000" : hex_string); - pdgui.gui_post("color is " + color_string); + pdgui.post("color is " + color_string); elem[0].value = color_string; } else if (elem[0].type === "checkbox") { // The attr here is a string, so we need to diff --git a/pd/nw/dialog_prefs.html b/pd/nw/dialog_prefs.html index 5c8801870..34e5a835b 100644 --- a/pd/nw/dialog_prefs.html +++ b/pd/nw/dialog_prefs.html @@ -274,7 +274,7 @@ function ok() { } function display_pref(type) { - pdgui.gui_post("here i am with " + type); + pdgui.post("here i am with " + type); var all, i, this_elem; all = document.getElementsByTagName("fieldset"); this_elem = document.getElementById(type); @@ -301,11 +301,11 @@ function dev_change(elem) { // This would need to change if there could ever be more than // 9 devices index = +(id.slice(-1)) - 1; - pdgui.gui_post("direction is " + direction); + pdgui.post("direction is " + direction); attrs = get_attr("pd-" + direction + type, pd_audio_attrs); attrs[index] = elem.value; - pdgui.gui_post("id is " + elem.id); - pdgui.gui_post("new chan attrs is " + attrs); + pdgui.post("id is " + elem.id); + pdgui.post("new chan attrs is " + attrs); } function attr_change(elem) { @@ -313,8 +313,8 @@ function attr_change(elem) { attr = pd_audio_attrs; id = elem.id; attr[attr.indexOf(id) + 1] = elem.value; - pdgui.gui_post("id is " + elem.id); - pdgui.gui_post("value is " + elem.value); + pdgui.post("id is " + elem.id); + pdgui.post("value is " + elem.value); } function get_input(name) { @@ -348,7 +348,7 @@ function kludge_chans(type, attrs, index) { function apply() { var attrs = pd_audio_attrs; - pdgui.gui_post("we're applying shits!"); + pdgui.post("we're applying shits!"); // Audio dialog pdgui.pdsend( @@ -394,7 +394,7 @@ function apply() { function cancel() { var i, attrs, gfxstub; - pdgui.gui_post("closing the window at this point"); + pdgui.post("closing the window at this point"); window.close(true); //pdgui.pdsend(pd_object_callback, "cancel"); } @@ -414,9 +414,9 @@ function get_attr(name, attrs) { } function populate_apis(elem, apis, current_api) { - pdgui.gui_post("curent api is " + current_api); + pdgui.post("curent api is " + current_api); var i, opt, api_select = elem; - pdgui.gui_post("apis are " + apis); + pdgui.post("apis are " + apis); for (i = 0; i < apis.length; i += 2) { opt = document.createElement("option"); opt.textContent = apis[i]; @@ -429,8 +429,8 @@ function populate_apis(elem, apis, current_api) { function populate_devs(type, attrs) { var devs = get_attr(type === "in" ? "sys-indevs" : "sys-outdevs", attrs); var i, j, opt, elem, chan_elem, chans; - pdgui.gui_post("devs are " + devs); - pdgui.gui_post("type is " + type + 1); + pdgui.post("devs are " + devs); + pdgui.post("type is " + type + 1); chans = get_attr("pd-" + type + "chans", attrs); for (i = 0; i < 4; i++) { elem = document.getElementById(type + (i+1)); @@ -457,8 +457,8 @@ function populate_devs(type, attrs) { function populate_midi_devs(type, attrs) { var devs = get_attr(type === "in" ? "sys-indevs" : "sys-outdevs", attrs); var i, j, opt, elem, chan_elem, chans; - pdgui.gui_post("devs are " + devs); - pdgui.gui_post("type is " + type + 1); + pdgui.post("devs are " + devs); + pdgui.post("type is " + type + 1); chans = get_attr("pd-" + type + "chans", attrs); for (i = 0; i < 4; i++) { elem = document.getElementById(type + (i+1)); @@ -486,8 +486,8 @@ function audio_prefs_callback(attrs) { pd_audio_attrs = attrs; var api_select = document.getElementById("audio_api"); var callback, i, j, elem, devs, opt; - pdgui.gui_post("audio attrs are " + attrs); - pdgui.gui_post("attrs length " + attrs.length); + pdgui.post("audio attrs are " + attrs); + pdgui.post("attrs length " + attrs.length); // We can get this callback multiple times while the dialog // is open. This is because an API change requires a query // for new properties. So we only populate the api options @@ -546,8 +546,8 @@ function set_chans(type, chans_array) { function midi_prefs_callback(attrs) { pd_midi_attrs = attrs; var api_select = document.getElementById("midi_api"); - pdgui.gui_post("midi attrs are " + attrs); - pdgui.gui_post("attrs length " + attrs.length); + pdgui.post("midi attrs are " + attrs); + pdgui.post("attrs length " + attrs.length); if (api_select.getElementsByTagName("option").length < 1) { populate_apis( @@ -612,7 +612,7 @@ function populate_form(attr_array) { console.log("the thing here is " + attr_array[i]); prop_group.classList.remove("hidden"); } else { - pdgui.gui_post("Error: couldn't find iemgui prop group for " + attr_array[i]); + pdgui.post("Error: couldn't find iemgui prop group for " + attr_array[i]); } var elem = document.getElementsByName(attr_array[i]); @@ -620,7 +620,7 @@ function populate_form(attr_array) { if (elem[0].type === "checkbox") { // The attr here is a string, so we need to // force it to number, hence the "+" below - gui_post("found a CHECKED ITEM!!!"); + pdgui.post("found a CHECKED ITEM!!!"); elem[0].checked = +attr_array[i+1]; } else { elem[0].value = attr_array[i+1]; diff --git a/pd/nw/index.js b/pd/nw/index.js index 0482f8e8b..4548018bf 100644 --- a/pd/nw/index.js +++ b/pd/nw/index.js @@ -455,7 +455,7 @@ function nw_create_pd_window_menus () { label: l("menu.zoomin"), click: function () { nw.Window.get().zoomLevel += 1; - pdgui.gui_post("zoom level is " + nw.Window.get().zoomLevel); + pdgui.post("zoom level is " + nw.Window.get().zoomLevel); }, key: "=", modifiers: "ctrl", @@ -466,7 +466,7 @@ function nw_create_pd_window_menus () { label: l("menu.zoomout"), click: function () { nw.Window.get().zoomLevel -= 1; - pdgui.gui_post("zoom level is " + nw.Window.get().zoomLevel); + pdgui.post("zoom level is " + nw.Window.get().zoomLevel); }, key: "-", modifiers: "ctrl", @@ -705,13 +705,13 @@ function nw_create_window(cid, type, width, height, xpos, ypos, menu_flag, x: xpos, y: ypos }); - //pdgui.gui_post("attr_array is " + attr_array); + //pdgui.post("attr_array is " + attr_array); var eval_string = "register_canvas_id(" + JSON.stringify(cid) + ", " + JSON.stringify(attr_array) + ");"; - //pdgui.gui_post("eval string is " + eval_string); + //pdgui.post("eval string is " + eval_string); //if (attr_array !== null) { - // pdgui.gui_post("attr_array is " + attr_array.toString()); + // pdgui.post("attr_array is " + attr_array.toString()); //} new_win.on("loaded", function() { new_win.eval(null, eval_string); diff --git a/pd/nw/pd_canvas.js b/pd/nw/pd_canvas.js index 3c8e5c87a..5e45f1022 100644 --- a/pd/nw/pd_canvas.js +++ b/pd/nw/pd_canvas.js @@ -57,7 +57,7 @@ function canvas_find_blur() { } function canvas_find_focus() { -pdgui.gui_post("flub!"); +pdgui.post("flub!"); var state = canvas_events.get_state(); canvas_events.search(); } @@ -78,7 +78,7 @@ var canvas_events = (function() { }, events = { mousemove: function(evt) { - //pdgui.gui_post("x: " + evt.pageX + " y: " + evt.pageY + + //pdgui.post("x: " + evt.pageX + " y: " + evt.pageY + // " modifier: " + (evt.shiftKey + (evt.ctrlKey << 1))); pdgui.pdsend(name, "motion", (evt.pageX + svg_view.x), @@ -122,7 +122,7 @@ var canvas_events = (function() { //evt.preventDefault(); }, mouseup: function(evt) { - //pdgui.gui_post("mouseup: x: " + + //pdgui.post("mouseup: x: " + // evt.pageX + " y: " + evt.pageY + // " button: " + (evt.button + 1)); pdgui.pdsend(name, "mouseup", @@ -204,7 +204,7 @@ var canvas_events = (function() { pdgui.gui_canvas_sendkey(name, 1, evt, hack); pdgui.set_keymap(key_code, hack); } - //pdgui.gui_post("keydown time: keycode is " + evt.keyCode); + //pdgui.post("keydown time: keycode is " + evt.keyCode); last_keydown = evt.keyCode; //evt.stopPropagation(); //evt.preventDefault(); @@ -224,7 +224,7 @@ var canvas_events = (function() { pdgui.gui_canvas_sendkey(name, 1, evt, evt.charCode); pdgui.set_keymap(last_keydown, evt.charCode); - //pdgui.gui_post("keypress time: charcode is " + evt.charCode); + //pdgui.post("keypress time: charcode is " + evt.charCode); // Don't do things like scrolling on space, arrow keys, etc. //evt.stopPropagation(); evt.preventDefault(); @@ -232,7 +232,7 @@ var canvas_events = (function() { keyup: function(evt) { var my_char_code = pdgui.get_char_code(evt.keyCode); pdgui.gui_canvas_sendkey(name, 0, evt, my_char_code); - //pdgui.gui_post("keyup time: charcode is: " + my_char_code); + //pdgui.post("keyup time: charcode is: " + my_char_code); if (evt.keyCode === 13 && evt.ctrlKey) { pdgui.pdsend(name, "reselect"); } @@ -253,7 +253,7 @@ var canvas_events = (function() { utils.create_obj(); //var fudi_msg = text_to_fudi(textbox().innerText); //pdgui.pdsend(name, "createobj", fudi_msg); - //pdgui.gui_post("formatted content is " + fudi_msg); + //pdgui.post("formatted content is " + fudi_msg); events.mousedown(evt); canvas_events.normal(); } @@ -262,7 +262,7 @@ var canvas_events = (function() { return false; }, text_mouseup: function(evt) { - pdgui.gui_post("mouseup target is " + + pdgui.post("mouseup target is " + evt.target + " and textbox is " + textbox()); //evt.stopPropagation(); //evt.preventDefault(); @@ -289,14 +289,14 @@ var canvas_events = (function() { return false; }, floating_text_click: function(evt) { - //pdgui.gui_post("leaving floating mode"); + //pdgui.post("leaving floating mode"); canvas_events.text(); evt.stopPropagation(); evt.preventDefault(); return false; }, floating_text_keypress: function(evt) { - //pdgui.gui_post("leaving floating mode"); + //pdgui.post("leaving floating mode"); canvas_events.text(); //evt.stopPropagation(); //evt.preventDefault(); @@ -338,12 +338,12 @@ var canvas_events = (function() { create_obj: function() { var fudi_msg = text_to_fudi(textbox().innerText); pdgui.pdsend(name, "createobj", fudi_msg); - //pdgui.gui_post("formatted content is " + fudi_msg); + //pdgui.post("formatted content is " + fudi_msg); }, set_obj: function() { var fudi_msg = text_to_fudi(textbox().innerText); pdgui.pdsend(name, "setobj", fudi_msg); - //pdgui.gui_post("formatted content is " + fudi_msg); + //pdgui.post("formatted content is " + fudi_msg); } } ; @@ -805,7 +805,7 @@ function nw_create_patch_window_menus(name) { var z = nw.Window.get().zoomLevel; if (z < 8) { z++; } nw.Window.get().zoomLevel = z; - pdgui.gui_post("zoom level is " + nw.Window.get().zoomLevel); + pdgui.post("zoom level is " + nw.Window.get().zoomLevel); }, key: "=", modifiers: "ctrl", @@ -818,7 +818,7 @@ function nw_create_patch_window_menus(name) { var z = nw.Window.get().zoomLevel; if (z > -7) { z--; } nw.Window.get().zoomLevel = z; - pdgui.gui_post("zoom level is " + nw.Window.get().zoomLevel); + pdgui.post("zoom level is " + nw.Window.get().zoomLevel); }, key: "-", modifiers: "ctrl", @@ -1181,7 +1181,7 @@ function nw_create_patch_window_menus(name) { var win = nw.Window.get(); var fullscreen = win.isFullscreen; win.isFullscreen = !fullscreen; - pdgui.gui_post("fullscreen is " + fullscreen); + pdgui.post("fullscreen is " + fullscreen); }, key: "f11", //modifiers: "ctrl", -- GitLab