Commit 665861c1 authored by Aayush's avatar Aayush

Updated UI for ascii_art->pd_diagram

parent 1a69dbb7
Pipeline #1613 failed with stage
in 0 seconds
...@@ -53,9 +53,7 @@ ...@@ -53,9 +53,7 @@
</div> </div>
<div id="ascii_art" style="display:none;"> <div id="ascii_art" style="display:none;">
<textarea id="ascii_art_text_area" <textarea id="ascii_art_text_area"
rows="10" cols="50"> rows="10" cols="50">write your ascii art here</textarea>
write your ascii art here
</textarea>
<br/> <br/>
<button type="button" <button type="button"
id="canvas_ascii_art_button" id="canvas_ascii_art_button"
......
...@@ -433,8 +433,9 @@ var canvas_events = (function() { ...@@ -433,8 +433,9 @@ var canvas_events = (function() {
// to check the create pd_message // to check the create pd_message
//document.getElementById("ascii_art_text_area").innerHTML = parsed_art.pd_message; //document.getElementById("ascii_art_text_area").innerHTML = parsed_art.pd_message;
canvas_events.normal(); canvas_events.normal();
pdgui.pdsend(name, "cut");
canvas_events.paste_from_pd_file(name, parsed_art.pd_message); canvas_events.paste_from_pd_file(name, parsed_art.pd_message);
canvas_events.none(); canvas_events.ascii_art();
}, },
scalar_draggable_mousemove: function(evt) { scalar_draggable_mousemove: function(evt) {
var new_x = evt.pageX, var new_x = evt.pageX,
...@@ -780,6 +781,12 @@ var canvas_events = (function() { ...@@ -780,6 +781,12 @@ var canvas_events = (function() {
document.addEventListener("keydown", events.find_keydown, false); document.addEventListener("keydown", events.find_keydown, false);
state = "search"; state = "search";
}, },
ascii_art: function() {
set_edit_menu_modals(false);
canvas_events.none();
//document.addEventListener("keydown", events.find_keydown, false);
state = "ascii_art";
},
register: function(n) { register: function(n) {
name = n; name = n;
}, },
...@@ -1583,14 +1590,16 @@ function nw_create_patch_window_menus(gui, w, name) { ...@@ -1583,14 +1590,16 @@ function nw_create_patch_window_menus(gui, w, name) {
enabled: true, enabled: true,
click: function() { click: function() {
var ascii_art = w.document.getElementById("ascii_art"), var ascii_art = w.document.getElementById("ascii_art"),
ascii_art_text_area = w.document.getElementById("ascii_art_text_area"),
display_state = ascii_art.style.getPropertyValue("display"); display_state = ascii_art.style.getPropertyValue("display");
// if there's a box being edited, try to instantiate it in Pd // if there's a box being edited, try to instantiate it in Pd
instantiate_live_box(); instantiate_live_box();
if (display_state === "none") { if (display_state === "none") {
canvas_events.none();
ascii_art.style.setProperty("display", "inline"); ascii_art.style.setProperty("display", "inline");
ascii_art_text_area.focus(); ascii_art_text_area.focus();
canvas_events.ascii_art();
} else { } else {
ascii_art_text_area.innerHTML = "write your ascii art here"
ascii_art.style.setProperty("display", "none"); ascii_art.style.setProperty("display", "none");
canvas_events[canvas_events.get_previous_state()](); canvas_events[canvas_events.get_previous_state()]();
} }
......
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