Commit bd5996e2 authored by Aayush's avatar Aayush

made changes in ascii_art UI

parent 14c82955
Pipeline #1573 failed with stage
in 0 seconds
...@@ -501,6 +501,15 @@ text { ...@@ -501,6 +501,15 @@ text {
left: 0; left: 0;
} }
/*text area to get ascii_art input */
#ascii_art {
width: 100%;
height: 70%;
position: fixed;
top : 0;
right: 0;
}
/* Dialog to ask to save the patch before quitting */ /* Dialog to ask to save the patch before quitting */
#save_before_quit { #save_before_quit {
background-color: #f3f3f3; background-color: #f3f3f3;
......
...@@ -306,7 +306,6 @@ function parse_ascii_art(ascii_art) { ...@@ -306,7 +306,6 @@ function parse_ascii_art(ascii_art) {
+ objects_connections_map[i].end_point + ";\n"; + objects_connections_map[i].end_point + ";\n";
pd_message = pd_message + str; pd_message = pd_message + str;
} }
var parser_data = {pd_message:pd_message, var parser_data = {pd_message:pd_message,
state:state}; state:state};
return parser_data; return parser_data;
......
...@@ -431,8 +431,8 @@ var canvas_events = (function() { ...@@ -431,8 +431,8 @@ var canvas_events = (function() {
var art = document.getElementById("ascii_art_text_area").value; var art = document.getElementById("ascii_art_text_area").value;
var parsed_art = pd_ascii_art.parse_ascii_art(art); var parsed_art = pd_ascii_art.parse_ascii_art(art);
// 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[canvas_events.get_previous_state()](); canvas_events.paste_from_pd_file(name, parsed_art.pd_message);
}, },
scalar_draggable_mousemove: function(evt) { scalar_draggable_mousemove: function(evt) {
var new_x = evt.pageX, var new_x = evt.pageX,
...@@ -1581,17 +1581,18 @@ function nw_create_patch_window_menus(gui, w, name) { ...@@ -1581,17 +1581,18 @@ function nw_create_patch_window_menus(gui, w, name) {
minit(m.put.ascii_art, { minit(m.put.ascii_art, {
enabled: true, enabled: true,
click: function() { click: function() {
//alert("ascii_art");
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");
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 (state === "none") { if (display_state === "none") {
canvas_events.none();
ascii_art.style.setProperty("display", "block"); ascii_art.style.setProperty("display", "block");
ascii_art_text_area.focus(); ascii_art_text_area.focus();
canvas_events.none();
} else { } else {
ascii_art.style.setProperty("display", "none"); 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