From be5a313372fbafa13f8f45357b9ee3a84d18b10f Mon Sep 17 00:00:00 2001 From: "john.j.camilleri" Date: Fri, 11 Jan 2013 12:45:24 +0000 Subject: [PATCH] Syntax editor: add tooltips to buttons --- src/www/syntax-editor/editor.js | 7 +++++++ src/www/syntax-editor/editor_menu.js | 8 +++++++- src/www/syntax-editor/editor_online.js | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/www/syntax-editor/editor.js b/src/www/syntax-editor/editor.js index a8d280db5..0f4ab4d4d 100644 --- a/src/www/syntax-editor/editor.js +++ b/src/www/syntax-editor/editor.js @@ -47,6 +47,10 @@ function Editor(gm,opts) { lin: div_id("linearisations") }; + this.ui.clear_button.title = "Clear current node and all its children"; + this.ui.wrap_button.title = "Wrap the current node with a new function"; + this.ui.unwrap_button.title = "Replace parent of current node with current node (if possible)"; + appendChildren(this.container, [ t.ui.menubar, t.ui.tree, @@ -492,6 +496,9 @@ Editor.prototype.update_linearisation=function(){ var btn = button(langname, function(){ bind(t.options.lin_action,t)(lin,lang); }); + if (t.options.lin_action_tooltip) { + btn.title = t.options.lin_action_tooltip; + } var c1 = th(btn); var c2 = td(text(lin)); var row = tr([c1,c2]); diff --git a/src/www/syntax-editor/editor_menu.js b/src/www/syntax-editor/editor_menu.js index 2b9ee8d59..ea20710a4 100644 --- a/src/www/syntax-editor/editor_menu.js +++ b/src/www/syntax-editor/editor_menu.js @@ -54,6 +54,12 @@ function EditorMenu(editor,opts) { toggleHidden(element("debug")); }) }; + this.ui.to_toggle.title = "Select languages to linearise to (use Ctrl/Shift to select multiple)"; + this.ui.random_button.title = "Insert a randomly generated tree at the current node"; + this.ui.import.toggle.title = "Import an abstract syntax tree from a string (replaces current tree)"; + this.ui.export_button.title = "Get the string representation of the abstract syntax tree"; + this.ui.debug_toggle.title = "Toggle the debug console"; + if (t.options.show_grammar_menu) { appendChildren(t.container, [text(" Grammar: "), t.ui.grammar_menu]); t.ui.grammar_menu.onchange = function(){ @@ -62,7 +68,7 @@ function EditorMenu(editor,opts) { } } if (t.options.show_startcat_menu) { - appendChildren(t.container, [text(" Startcat: "), t.ui.startcat_menu]); + appendChildren(t.container, [text(" Start Category: "), t.ui.startcat_menu]); t.ui.startcat_menu.onchange = function(){ var startcat = t.ui.startcat_menu.value; t.gm.change_startcat(startcat); diff --git a/src/www/syntax-editor/editor_online.js b/src/www/syntax-editor/editor_online.js index 2fe6f7a43..3067346b7 100644 --- a/src/www/syntax-editor/editor_online.js +++ b/src/www/syntax-editor/editor_online.js @@ -22,6 +22,7 @@ var gm_options = { } } if(window.Minibar) // Minibar loaded? + editor_options.lin_action_tooltip="Load sentence in Minibar"; editor_options.lin_action=function(s,langFrom) { var editor=this; var minibar_options = {