Commit 1a69dbb7 authored by Aayush's avatar Aayush

updated UI for ascii_art

parent bd5996e2
Pipeline #1574 failed with stage
in 0 seconds
......@@ -503,11 +503,9 @@ text {
/*text area to get ascii_art input */
#ascii_art {
width: 100%;
height: 70%;
position: fixed;
position: absolute;
top : 0;
right: 0;
right : 0;
}
/* Dialog to ask to save the patch before quitting */
......
......@@ -56,11 +56,10 @@
rows="10" cols="50">
write your ascii art here
</textarea>
<br/>
<button type="button"
id="canvas_ascii_art_button"
data-i18n="[title]canvas.ascii_art.submit_tt">
submit ascii_art
</button>
<span data-i18n="canvas.ascii_art.submit"></span>
</div>
<div style="display:none;" id="dropdown_list" class="noselect">
......
......@@ -428,11 +428,13 @@ var canvas_events = (function() {
}
},
submit_ascii_art : function(evt) {
var art = document.getElementById("ascii_art_text_area").value;
var parsed_art = pd_ascii_art.parse_ascii_art(art);
var ascii_art = document.getElementById("ascii_art_text_area").value;
var parsed_art = pd_ascii_art.parse_ascii_art(ascii_art);
// to check the create pd_message
//document.getElementById("ascii_art_text_area").innerHTML = parsed_art.pd_message;
canvas_events.normal();
canvas_events.paste_from_pd_file(name, parsed_art.pd_message);
canvas_events.none();
},
scalar_draggable_mousemove: function(evt) {
var new_x = evt.pageX,
......@@ -843,7 +845,6 @@ var canvas_events = (function() {
pdgui.post("paste error: clipboard doesn't appear to contain valid Pd code");
return;
}
// clear the buffer
pdgui.pdsend(name, "copyfromexternalbuffer");
pd_message = "";
......@@ -1581,14 +1582,13 @@ 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"),
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", "block");
ascii_art.style.setProperty("display", "inline");
ascii_art_text_area.focus();
} else {
ascii_art.style.setProperty("display", "none");
......
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