mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-28 05:52:51 -06:00
minibar/syntax editor integration improvements
Work in progress on preserving the start category and selected target languages when switching between the minibar and the syntax editor.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
<!-- Common -->
|
||||
<script type="text/javascript" src="../js/grammar_manager.js"></script>
|
||||
<script type="text/javascript" src="../js/support.js"></script>
|
||||
<script type="text/JavaScript" src="../js/localstorage.js"></script>
|
||||
<script type="text/javascript" src="../js/pgf_online.js"></script>
|
||||
|
||||
<!-- Editor -->
|
||||
|
||||
@@ -77,12 +77,7 @@ function EditorMenu(editor,opts) {
|
||||
if (t.options.show_to_menu) {
|
||||
appendChildren(t.container, [text(" To: "), t.ui.to_toggle, t.ui.to_menu]);
|
||||
t.ui.to_menu.onchange = function(){
|
||||
var languages = new Array();
|
||||
for (i in t.ui.to_menu.options) {
|
||||
var opt = t.ui.to_menu.options[i];
|
||||
if (opt.selected)
|
||||
languages.push(opt.value);
|
||||
}
|
||||
var languages = multiMenuSelections(t.ui.to_menu)
|
||||
t.gm.change_languages(languages);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,11 @@ if(window.Minibar) // Minibar loaded?
|
||||
initial_grammar: editor.menu.ui.grammar_menu.value, // hmm
|
||||
initial: {
|
||||
from: langFrom,
|
||||
input: s.split(" ") // is it that easy?
|
||||
input: s.split(" "), // is it that easy?
|
||||
startcat: editor.menu.ui.startcat_menu.value // hmm
|
||||
},
|
||||
initial_toLangs: multiMenuSelections(editor.menu.ui.to_menu), // hmm
|
||||
|
||||
// get us back to the editor!
|
||||
abstract_action: function(tree) {
|
||||
var opts = {
|
||||
|
||||
Reference in New Issue
Block a user