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