Commit ebd189cb authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

cleanup iemgui dialog form names, replacing dashes with underscores. Fix stray...

cleanup iemgui dialog form names, replacing dashes with underscores. Fix stray bugs in canvas dialog, and clean up css selector names
parent f1578bd8
......@@ -405,19 +405,19 @@ label {
width: 50%;
}
input[name="x-offset"] {
input[name="x_offset"] {
width: 2em;
}
input[name="y-offset"] {
input[name="y_offset"] {
width: 2em;
}
input[name="send-symbol"] {
input[name="send_symbol"] {
width: 8em;
}
input[name="receive-symbol"] {
input[name="receive_symbol"] {
width: 8em;
}
......@@ -425,7 +425,7 @@ input[name="label"] {
width: 8em;
}
input[name="font-size"] {
input[name="font_size"] {
width: 3em;
}
......
......@@ -536,19 +536,19 @@ label {
width: 50%;
}
input[name="x-offset"] {
input[name="x_offset"] {
width: 2em;
}
input[name="y-offset"] {
input[name="y_offset"] {
width: 2em;
}
input[name="send-symbol"] {
input[name="send_symbol"] {
width: 8em;
}
input[name="receive-symbol"] {
input[name="receive_symbol"] {
width: 8em;
}
......@@ -556,7 +556,7 @@ input[name="label"] {
width: 8em;
}
input[name="font-size"] {
input[name="font_size"] {
width: 3em;
}
......
......@@ -393,19 +393,19 @@ label {
width: 50%;
}
input[name="x-offset"] {
input[name="x_offset"] {
width: 2em;
}
input[name="y-offset"] {
input[name="y_offset"] {
width: 2em;
}
input[name="send-symbol"] {
input[name="send_symbol"] {
width: 8em;
}
input[name="receive-symbol"] {
input[name="receive_symbol"] {
width: 8em;
}
......@@ -413,7 +413,7 @@ input[name="label"] {
width: 8em;
}
input[name="font-size"] {
input[name="font_size"] {
width: 3em;
}
......
......@@ -419,19 +419,19 @@ label {
width: 50%;
}
input[name="x-offset"] {
input[name="x_offset"] {
width: 2em;
}
input[name="y-offset"] {
input[name="y_offset"] {
width: 2em;
}
input[name="send-symbol"] {
input[name="send_symbol"] {
width: 8em;
}
input[name="receive-symbol"] {
input[name="receive_symbol"] {
width: 8em;
}
......@@ -439,7 +439,7 @@ input[name="label"] {
width: 8em;
}
input[name="font-size"] {
input[name="font_size"] {
width: 3em;
}
......
......@@ -401,19 +401,19 @@ label {
width: 50%;
}
input[name="x-offset"] {
input[name="x_offset"] {
width: 2em;
}
input[name="y-offset"] {
input[name="y_offset"] {
width: 2em;
}
input[name="send-symbol"] {
input[name="send_symbol"] {
width: 8em;
}
input[name="receive-symbol"] {
input[name="receive_symbol"] {
width: 8em;
}
......@@ -421,7 +421,7 @@ input[name="label"] {
width: 8em;
}
input[name="font-size"] {
input[name="font_size"] {
width: 3em;
}
......
......@@ -400,19 +400,19 @@ label {
width: 50%;
}
input[name="x-offset"] {
input[name="x_offset"] {
width: 2em;
}
input[name="y-offset"] {
input[name="y_offset"] {
width: 2em;
}
input[name="send-symbol"] {
input[name="send_symbol"] {
width: 8em;
}
input[name="receive-symbol"] {
input[name="receive_symbol"] {
width: 8em;
}
......@@ -420,7 +420,7 @@ input[name="label"] {
width: 8em;
}
input[name="font-size"] {
input[name="font_size"] {
width: 3em;
}
......
......@@ -394,19 +394,19 @@ label {
width: 50%;
}
input[name="x-offset"] {
input[name="x_offset"] {
width: 2em;
}
input[name="y-offset"] {
input[name="y_offset"] {
width: 2em;
}
input[name="send-symbol"] {
input[name="send_symbol"] {
width: 8em;
}
input[name="receive-symbol"] {
input[name="receive_symbol"] {
width: 8em;
}
......@@ -414,7 +414,7 @@ input[name="label"] {
width: 8em;
}
input[name="font-size"] {
input[name="font_size"] {
width: 3em;
}
......
......@@ -399,19 +399,19 @@ label {
width: 50%;
}
input[name="x-offset"] {
input[name="x_offset"] {
width: 2em;
}
input[name="y-offset"] {
input[name="y_offset"] {
width: 2em;
}
input[name="send-symbol"] {
input[name="send_symbol"] {
width: 8em;
}
input[name="receive-symbol"] {
input[name="receive_symbol"] {
width: 8em;
}
......@@ -419,7 +419,7 @@ input[name="label"] {
width: 8em;
}
input[name="font-size"] {
input[name="font_size"] {
width: 3em;
}
......
......@@ -139,7 +139,7 @@
<label class="array-name"
data-i18n="[title]canvas.prop.array_name_tt">
<span data-i18n="canvas.prop.array_name"></span>
<input onchange="attr_change(this);"
<input onchange="update_array_attr(this);"
class="array-name"
type="text"
name="array_name"
......@@ -148,7 +148,7 @@
<label class="array-size"
data-i18n="[title]canvas.prop.array_size_tt">
<span data-i18n="canvas.prop.array_size"></span>
<input onchange="attr_change(this);"
<input onchange="update_array_attr(this);"
class="array-size"
type="text"
name="array_size">
......@@ -231,7 +231,7 @@
<div class="array-fill">
<label data-i18n="[title]canvas.prop.array_fill_tt">
<input onchange="attr_change(this);"
<input onchange="update_array_attr(this);"
type="color"
name="array_fill">
<span data-i18n="canvas.prop.array_fill"></span>
......@@ -241,7 +241,7 @@
<div class="array-outline">
<label data-i18n="[title]canvas.prop.array_outline_tt">
<input onchange="attr_change(this);"
<input onchange="update_array_attr(this);"
type="color"
name="array_outline">
<span data-i18n="canvas.prop.array_outline"></span>
......@@ -379,14 +379,28 @@ function array_delete_change(elem) {
array_attr.array_delete = elem.checked;
}
function attr_change(elem) {
// Placeholder for updating gop margins and coords when the dialog window
// is open. Ideally we want to keep a record of all changes so that clicking
// "Cancel" will undo all of the changes made inside the dialog. However this
// is non-trivial with the canvas dialog because of all the state changes
// one can make to an array in the same dialog. For that reason we replace the
// "Cancel" button with one called "Close".
// The function in pdgui to update the form fields when a user drags the
// dimensions and margins is also used for iemguis, which *do* have a "Cancel"
// button. So we just set up a dummy function here to adhere to that interface.
function update_attr(elem) {
// do nothing for now...
}
function update_array_attr(elem) {
var array_index, array_attr, arrays_select, name;
arrays_select = document.getElementById("arrays_select");
array_attr = pd_garray_attrs[arrays_select.value];
name = elem.name;
array_attr[name] = elem.value;
if (elem.name === "array-fill") {
array-fill
// Not sure what this was for...
//array-fill
}
}
......
......@@ -22,14 +22,14 @@
onchange="update_attr(this);">
</td>
</tr>
<tr class="selection-size prop hidden">
<tr class="selection_size prop hidden">
<td>
<label data-i18n="[title]iem.select_size_tt">
<span data-i18n="iem.prop.select_size"></span>
</label>
</td>
<td data-i18n="[title]iem.prop.select_size_tt">
<input type="text" name="selection-size"
<input type="text" name="selection_size"
onchange="update_attr(this);">
</td>
</tr>
......@@ -44,14 +44,14 @@
onchange="update_attr(this);">
</td>
</tr>
<tr class="nonzero-value prop hidden">
<tr class="nonzero_value prop hidden">
<td>
<label data-i18n="[title]iem.prop.nonzero_value_tt">
<span data-i18n="iem.prop.nonzero_value"></span>
</label>
</td>
<td data-i18n="[title]iem.prop.nonzero_value_tt">
<input type="text" name="nonzero-value"
<input type="text" name="nonzero_value"
onchange="update_attr(this);">
</td>
</tr>
......@@ -75,14 +75,14 @@
onchange="update_attr(this);">
</td>
</tr>
<tr class="visible-width prop hidden">
<tr class="visible_width prop hidden">
<td>
<label data-i18n="[title]iem.prop.visible_width_tt">
<span data-i18n="iem.prop.visible_width"></span>
</label>
</td>
<td data-i18n="[title]iem.prop.visible_width_tt">
<input type="text" name="visible-width"
<input type="text" name="visible_width"
onchange="update_attr(this);">
</td>
<td>
......@@ -91,18 +91,18 @@
</label>
</td>
<td data-i18n="[title]iem.prop.visible_height_tt">
<input type="text" name="visible-height"
<input type="text" name="visible_height"
onchange="update_attr(this);">
</td>
</tr>
<tr class="minimum-range prop pair hidden">
<tr class="minimum_range prop pair hidden">
<td>
<label data-i18n="[title]iem.prop.minimum_tt">
<span data-i18n="iem.prop.minimum"></span>
</label>
</td>
<td data-i18n="[title]iem.prop.minimum_tt">
<input type="text" name="minimum-range"
<input type="text" name="minimum_range"
onchange="update_attr(this);">
</td>
<td>
......@@ -110,19 +110,19 @@
<span data-i18n="iem.prop.maximum"></span>
</label>
</td>
<td data-i18n="[title]iem.prop.maximum_tt">
<input type="text" name="maximum-range"
<td data-i18n="[title]iem.prop.max_mum_tt">
<input type="text" name="maximum_range"
onchange="update_attr(this);">
</td>
</tr>
<tr class="flash-interrupt prop hidden">
<tr class="flash_interrupt prop hidden">
<td>
<label data-i18n="[title]iem.prop.flash_interrupt_tt">
<span data-i18n="iem.prop.flash_interrupt"></span>
</label>
</td>
<td data-i18n="[title]iem.prop.flash_interrupt_tt">
<input type="text" name="flash-interrupt"
<input type="text" name="flash_interrupt"
onchange="update_attr(this);">
</td>
<td>
......@@ -131,11 +131,11 @@
</label>
</td>
<td data-i18n="[title]iem.prop.flash_hold_tt">
<input type="text" name="flash-hold"
<input type="text" name="flash_hold"
onchange="update_attr(this);">
</td>
</tr>
<tr class="log-height prop hidden">
<tr class="log_height prop hidden">
<td></td><td></td>
<td>
<label data-i18n="[title]iem.prop.log_height_tt">
......@@ -143,7 +143,7 @@
</label>
</td>
<td>
<input type="text" name="log-height"
<input type="text" name="log_height"
onchange="update_attr(this);">
</td>
</tr>
......@@ -158,27 +158,27 @@
<br>
</div>
<div class="vu-scale prop hidden">
<div class="vu_scale prop hidden">
<label data-i18n="[title]iem.prop.vu_scale_tt">
<span data-i18n="iem.prop.vu_scale"></span>
<input type="checkbox" name="vu-scale" value="on"
<input type="checkbox" name="vu_scale" value="on"
onchange="update_attr(this);">
</label>
<br>
</div>
<div class="log-scaling prop hidden">
<div class="log_scaling prop hidden">
<label data-i18n="[title]iem.prop.log_scale_tt">
<input type="checkbox" name="log-scaling" value="on"
<input type="checkbox" name="log_scaling" value="on"
onchange="update_attr(this);">
<span data-i18n="iem.prop.log_scale"></span>
</label>
<br>
</div>
<div class="steady-on-click prop hidden">
<div class="steady_on_click prop hidden">
<label data-i18n="[title]iem.prop.steady_tt">
<input type="checkbox" name="steady-on-click" value="on"
<input type="checkbox" name="steady_on_click" value="on"
onchange="update_attr(this);">
<span data-i18n="iem.prop.steady"></span>
</label>
......@@ -190,25 +190,25 @@
<legend data-i18n="iem.prop.heading.messages"></legend>
<table>
<tr class="send-symbol prop hidden">
<tr class="send_symbol prop hidden">
<td>
<label data-i18n="[title]iem.prop.send_tt">
<span data-i18n="iem.prop.send"></span>
</label>
</td>
<td data-i18n="[title]iem.prop.send_tt">
<input type="text" name="send-symbol"
<input type="text" name="send_symbol"
onchange="update_attr(this);">
</td>
<td>
<tr class="receive-symbol prop hidden">
<tr class="receive_symbol prop hidden">
<td>
<label data-i18n="[title]iem.prop.receive_tt">
<span data-i18n="iem.prop.receive"></span>
</label>
</td>
<td data-i18n="[title]iem.prop.receive_tt">
<input type="text" name="receive-symbol"
<input type="text" name="receive_symbol"
onchange="update_attr(this);">
</td>
<td>
......@@ -236,7 +236,7 @@
</label>
</td>
<td data-i18n="[title]iem.prop.xoffset_tt">
<input type="text" name="x-offset"
<input type="text" name="x_offset"
onchange="update_attr(this);">
</td>
<td>
......@@ -245,17 +245,17 @@
</label>
</td>
<td data-i18n="[title]iem.prop.yoffset_tt">
<input type="text" name="y-offset"
<input type="text" name="y_offset"
onchange="update_attr(this);">
</td>
</tr>
<tr class="font-style prop hidden">
<tr class="font_style prop hidden">
<td>
<label data-i18n="[title]iem.prop.font_tt">
<span data-i18n="iem.prop.font"></span>
</td>
<td data-i18n="[title]iem.prop.font_tt">
<select name="font-style"
<select name="font_style"
onchange="update_attr(this);">
<option>DejaVu Sans Mono</option>
<option>Helvetica</option>
......@@ -265,7 +265,7 @@
<td colspan="4">
<label data-i18n="[title]iem.prop.fontsize_tt">
<span data-i18n="iem.prop.fontsize"></span>
<input type="text" name="font-size"
<input type="text" name="font_size"
onchange="update_attr(this);">
<label>
</td>
......@@ -276,27 +276,27 @@
<fieldset>
<legend data-i18n="iem.prop.heading.colors"></legend>
<div class="background-color prop hidden">
<div class="background_color prop hidden">
<label data-i18n="[title]iem.prop.bgcolor_tt">
<input type="color" name="background-color"
<input type="color" name="background_color"
onchange="update_attr(this);">
<span data-i18n="iem.prop.bgcolor"></span>
</label>
<br>
</div>
<div class="foreground-color prop hidden">
<div class="foreground_color prop hidden">
<label data-i18n="[title]iem.prop.fgcolor_tt">
<input type="color" name="foreground-color"
<input type="color" name="foreground_color"
onchange="update_attr(this);">
<span data-i18n="iem.prop.fgcolor"></span>
</label>
<br>
</div>
<div class="label-color prop hidden">
<div class="label_color prop hidden">
<label data-i18n="[title]iem.prop.label_color_tt">
<input type="color" name="label-color"
<input type="color" name="label_color"
onchange="update_attr(this);">
<span data-i18n="iem.prop.label_color"></span>
</label>
......@@ -305,9 +305,9 @@
</fieldset>
<div class="prop hidden">
<input type="hidden" name="minimum-size">
<input type="hidden" name="range-schedule">
<input type="hidden" name="hide-frame">
<input type="hidden" name="minimum_size">
<input type="hidden" name="range_schedule">
<input type="hidden" name="hide_frame">
</div>
<div class="submit_buttons">
......@@ -391,15 +391,15 @@ function send_params(attrs, create_undo_point) {
iemgui_clip_fontsize $id
*/
var send_symbol = attrs["send-symbol"],
receive_symbol = attrs["receive-symbol"],
var send_symbol = attrs.send_symbol,
receive_symbol = attrs.receive_symbol,
label = attrs["label"];
send_symbol = pd_symbol_carwash(send_symbol);
receive_symbol = pd_symbol_carwash(receive_symbol);
label = pd_symbol_carwash(label);
var label_x_offset = attrs["x-offset"];
var label_y_offset = attrs["y-offset"];
var label_x_offset = attrs.x_offset;
var label_y_offset = attrs.y_offset;
// make sure the offset boxes have a value
if (!label_x_offset) {
......@@ -412,52 +412,52 @@ function send_params(attrs, create_undo_point) {
var height, width;
var size = attrs["size"];
if (size === undefined) {
size = attrs["selection-size"];