Commit b38b0126 authored by Aayush's avatar Aayush

Updated UI for ascii-pd

parent dbf1e272
Pipeline #1639 failed with stage
in 0 seconds
......@@ -279,8 +279,8 @@
"canvas": {
"paste_clipboard_prompt": "Warnung: Sie sind dabei, Pd-Code einzufügen, der außerhalb von Pd erstellt wurde. Möchten Sie fortfahren?",
"ascii_art": {
"submit": "Submit Button",
"submit_tt": "submit ascii_art to parser"
"close": "Close Button",
"close_tt": "close ascii_art text area"
},
"save_dialog": {
"prompt": "Speichern der Änderungen in",
......
......@@ -278,8 +278,8 @@
"canvas": {
"paste_clipboard_prompt": "Warning: you are about to paste Pd code that came from somewhere outside of Pd. Do you want to continue?",
"ascii_art": {
"submit": "Submit Button",
"submit_tt": "submit ascii_art to parser"
"close": "Close Button",
"close_tt": "close ascii_art text area"
},
"save_dialog": {
"prompt": "Do you want to save the changes you made in",
......
......@@ -53,13 +53,13 @@
</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="25">write your ascii art here</textarea>
<br/>
<p id="ascii_art_state">State:partial</p>
<button type="button"
id="canvas_ascii_art_button"
data-i18n="[title]canvas.ascii_art.submit_tt">
<span data-i18n="canvas.ascii_art.submit"></span>
data-i18n="[title]canvas.ascii_art.close_tt">
<span data-i18n="canvas.ascii_art.close"></span>
</div>
<div style="display:none;" id="dropdown_list" class="noselect">
<ol></ol>
......
......@@ -427,10 +427,14 @@ var canvas_events = (function() {
events.find_click(evt);
}
},
check_ascii_art_state: function(evt) {
events.submit_ascii_art(evt);
close_ascii_art: function(evt) {
canvas_events[canvas_events.get_previous_state()]();
var ascii_art = document.getElementById("ascii_art"),
ascii_art_text_area = document.getElementById("ascii_art_text_area");
ascii_art_text_area.value = "write your ascii art here";
ascii_art.style.setProperty("display", "none");
},
submit_ascii_art : function(evt) {
check_ascii_art_state : function(evt) {
var ascii_art = document.getElementById("ascii_art_text_area").value;
var parsed_art = pd_ascii_art.parse_ascii_art(ascii_art);
var ascii_art_state = document.getElementById("ascii_art_state");
......@@ -1048,9 +1052,9 @@ var canvas_events = (function() {
document.querySelector("#canvas_find_button")
.addEventListener("click", events.find_click
);
//submit ascii art to parser
//close ascii art text area
document.querySelector("#canvas_ascii_art_button")
.addEventListener("click", events.submit_ascii_art
.addEventListener("click", events.close_ascii_art
);
// We need to separate these into nw_window events and html5 DOM
// events closing the Window this isn't actually closing the window
......@@ -1611,7 +1615,7 @@ function nw_create_patch_window_menus(gui, w, name) {
ascii_art_text_area.focus();
canvas_events.ascii_art();
} else {
ascii_art_text_area.innerHTML = "write your ascii art here"
ascii_art_text_area.value = "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