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