From e479bf2a760dcf1a3338e23ea0db69f89cbb3397 Mon Sep 17 00:00:00 2001 From: Taka Date: Mon, 18 Jul 2022 20:31:41 +1000 Subject: [PATCH] Removed the "Width:" labels from the UI. --- vasl_templates/webapp/static/css/main.css | 2 ++ vasl_templates/webapp/static/main.js | 15 +++++++++--- vasl_templates/webapp/templates/tabs-ob1.html | 12 ++++------ .../webapp/templates/tabs-scenario.html | 23 ++++++++----------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/vasl_templates/webapp/static/css/main.css b/vasl_templates/webapp/static/css/main.css index 781e30e..61d3402 100644 --- a/vasl_templates/webapp/static/css/main.css +++ b/vasl_templates/webapp/static/css/main.css @@ -40,6 +40,8 @@ label { height: 1.25em ; } button.edit-template { height: 30px ; padding: 4px 10px ; } button.edit-template img { height: 18px ; vertical-align: middle ; margin-right: 0.25em ; } +input.snippet-width { width: 3.75em ; } + .ui-dialog-titlebar { padding: 0.2em 0.5em 0.2em 0.5em !important ; } .ui-dialog-titlebar img.flag { height: 0.9em ; margin: -2px 0.25em 0 0 ; } .ui-dialog-titlebar-close { margin-top: -10px !important ; } diff --git a/vasl_templates/webapp/static/main.js b/vasl_templates/webapp/static/main.js index b080798..61e0ed5 100644 --- a/vasl_templates/webapp/static/main.js +++ b/vasl_templates/webapp/static/main.js @@ -31,8 +31,8 @@ var NATIONALITY_SPECIFIC_BUTTONS = { "thh": [ "japanese" ], } ; -GENERATE_SNIPPET_HINT = "Generate an HTML snippet (shift-click to get an image)." ; -EDIT_TEMPLATE_HINT = "Edit the template that will generate this snippet." ; +GENERATE_SNIPPET_HINT = "Generate an HTML snippet" ; +EDIT_TEMPLATE_HINT = "Edit the snippet template" ; // -------------------------------------------------------------------- @@ -391,6 +391,15 @@ $(document).ready( function () { // replace all the "generate" buttons with "generate/edit" button/droplist's $("button.generate").each( function() { init_snippet_button( $(this) ) ; } ) ; + // add a tooltip to the snippet width textbox's + $( "input.param.snippet-width" ).each( function() { + // NOTE: I tried putting a little icon in the textbox background, and placeholder text, but it didn't + // look good (and the whole point of removing the "Width:" labels was to remove visual clutter), + // so we just leave the textbox's blank. Hopefully, the default values in some of them, plus the tooltip, + // will be enough for the user to figure out what's going on. + $(this).attr( "title", "Snippet width" ) ; + } ) ; + // add special options to the COMPASS snippet button menu var $compassMenu = $( "select[data-id='compass']" ) ; var compassDirns = [ "", "right", "left", "down", "up" ] ; @@ -564,7 +573,7 @@ function init_snippet_button( $btn ) // NOTE: We use really short captions so they don't get truncated if the popup menu // is opened near the right-hand edge of the window :-/ "", - "", + "", "", "" ] ; diff --git a/vasl_templates/webapp/templates/tabs-ob1.html b/vasl_templates/webapp/templates/tabs-ob1.html index b66dd40..5a28110 100644 --- a/vasl_templates/webapp/templates/tabs-ob1.html +++ b/vasl_templates/webapp/templates/tabs-ob1.html @@ -69,14 +69,12 @@
- - +
- - +
@@ -99,14 +97,12 @@
- - +
- - +
diff --git a/vasl_templates/webapp/templates/tabs-scenario.html b/vasl_templates/webapp/templates/tabs-scenario.html index 68181d2..8708741 100644 --- a/vasl_templates/webapp/templates/tabs-scenario.html +++ b/vasl_templates/webapp/templates/tabs-scenario.html @@ -6,29 +6,29 @@
- +
- +
- + - Width: +
- +
- +
@@ -69,15 +69,14 @@
- +
- Width: - +
@@ -109,8 +108,7 @@ @@ -128,8 +126,7 @@ - - +