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 {
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 */
#save_before_quit {
background-color: #f3f3f3;
......
......@@ -306,7 +306,6 @@ function parse_ascii_art(ascii_art) {
+ objects_connections_map[i].end_point + ";\n";
pd_message = pd_message + str;
}
var parser_data = {pd_message:pd_message,
state:state};
return parser_data;
......
......@@ -431,8 +431,8 @@ var canvas_events = (function() {
var art = document.getElementById("ascii_art_text_area").value;
var parsed_art = pd_ascii_art.parse_ascii_art(art);
// to check the create pd_message
document.getElementById("ascii_art_text_area").innerHTML = parsed_art.pd_message;
canvas_events[canvas_events.get_previous_state()]();
//document.getElementById("ascii_art_text_area").innerHTML = parsed_art.pd_message;
canvas_events.paste_from_pd_file(name, parsed_art.pd_message);
},
scalar_draggable_mousemove: function(evt) {
var new_x = evt.pageX,
......@@ -1581,17 +1581,18 @@ function nw_create_patch_window_menus(gui, w, name) {
minit(m.put.ascii_art, {
enabled: true,
click: function() {
//alert("ascii_art");
var ascii_art = w.document.getElementById("ascii_art"),
ascii_art_text_area = w.document.getElementById("ascii_art_text_area"),
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
instantiate_live_box();
if (state === "none") {
if (display_state === "none") {
canvas_events.none();
ascii_art.style.setProperty("display", "block");
ascii_art_text_area.focus();
canvas_events.none();
} else {
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