summaryrefslogtreecommitdiff
path: root/src/www/syntax-editor/editor_online.js
diff options
context:
space:
mode:
authorjohn.j.camilleri <john.j.camilleri@chalmers.se>2012-11-23 08:25:00 +0000
committerjohn.j.camilleri <john.j.camilleri@chalmers.se>2012-11-23 08:25:00 +0000
commitee2f0a748737dc6e4a1723a9c73e91b73621a645 (patch)
tree9a5f334d3d9d610c33140b733a159db61529368a /src/www/syntax-editor/editor_online.js
parent4e00ddea08cfc3ed0349324af9ed2816932056c2 (diff)
Syntax editor: return to editor after having switched to minibar
Diffstat (limited to 'src/www/syntax-editor/editor_online.js')
-rw-r--r--src/www/syntax-editor/editor_online.js43
1 files changed, 30 insertions, 13 deletions
diff --git a/src/www/syntax-editor/editor_online.js b/src/www/syntax-editor/editor_online.js
index feeb09efb..9edcf2947 100644
--- a/src/www/syntax-editor/editor_online.js
+++ b/src/www/syntax-editor/editor_online.js
@@ -20,21 +20,38 @@ var editor_options = {
}
if(window.Minibar) // Minibar loaded?
editor_options.lin_action=function(s,langFrom) {
- editor.shutdown();
- var minibar_options = {
- target: "editor",
- show_abstract: true,
- show_trees: true,
- show_grouped_translations: false,
- show_brackets: true,
- word_replacements: true,
- initial_grammar: editor.menu.ui.grammar_menu.value, // hmm
- initial: {
+ var editor=this;
+ var minibar_options = {
+ target: "minibar",
+ show_abstract: true,
+ show_trees: true,
+ show_grouped_translations: false,
+ show_brackets: true,
+ word_replacements: true,
+ initial_grammar: editor.menu.ui.grammar_menu.value, // hmm
+ initial: {
from: langFrom,
input: s.split(" ") // is it that easy?
- }
- }
- editor.minibar=new Minibar(server,minibar_options);
+ },
+ // get us back to the editor!
+ abstract_action: function(tree) {
+ var minibar=this;
+ // how to get hold of new minibar?
+ var editor_options = {
+ target: "editor",
+ initial: {
+ grammar: editor.minibar.grammar_menu.value, // hmm
+ startcat: editor.minibar.input.startcat_menu.value, // hmm
+ abstr: tree
+ }
+ }
+ minibar.hide();
+ minibar.editor.show();
+ }
+ }
+ editor.hide();
+ editor.minibar=new Minibar(server,minibar_options);
+ editor.minibar.editor = editor; // :S
}
if(/^\?\/tmp\//.test(location.search)) {
var args=decodeURIComponent(location.search.substr(1)).split(" ")