mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-21 18:59:32 -06:00
gfse: better integration of the minibar
The minibar is now displayed inside the editor, intead of on a separate page. This makes the context clearer and makes it more obiovous how to return to the editor.
This commit is contained in:
@@ -92,3 +92,9 @@ li { margin-top: 0.5ex; margin-bottom: 0.5ex; }
|
||||
#sharing h1, #sharing .footer { display: none; }
|
||||
|
||||
div.compiler_output .back_to_editor { display: none; }
|
||||
|
||||
div#minibar {
|
||||
border: 1px solid black;
|
||||
padding: 5px;
|
||||
background: #ccc url("../minibar/brushed-metal.png");
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ function draw_grammar(g) {
|
||||
function draw_namebar(g,files) {
|
||||
return div_class("namebar",
|
||||
[table([tr([td(draw_name(g)),
|
||||
td_right([minibar_button(g),
|
||||
td_right([minibar_button(g,files),
|
||||
compile_button(g),
|
||||
draw_plainbutton(g,files),
|
||||
draw_closebutton(g)])])])])
|
||||
@@ -203,10 +203,33 @@ function compile_button(g) {
|
||||
return b;
|
||||
}
|
||||
|
||||
function minibar_button(g) {
|
||||
function minibar_button(g,files) {
|
||||
var b2;
|
||||
function show_editor() { edit_grammar(g); }
|
||||
function goto_minibar(res) {
|
||||
show_compile_error(res);
|
||||
if(res.errorcode=="OK") location.href=res.minibar_url;
|
||||
if(res.errorcode=="OK") {
|
||||
//location.href=res.minibar_url;
|
||||
files.innerHTML="";
|
||||
files.appendChild(div_id("minibar"));
|
||||
var online_options={grammars_url: local.get("dir")+"/",
|
||||
grammar_list: [g.basename+".pgf"]}
|
||||
var pgf_server=pgf_online(online_options)
|
||||
var minibar_options= {
|
||||
show_abstract: true,
|
||||
show_trees: true,
|
||||
show_grouped_translations: false,
|
||||
default_source_language: "Eng",
|
||||
try_google: true
|
||||
}
|
||||
var minibar=new Minibar(pgf_server,minibar_options);
|
||||
b.style.display="none";
|
||||
if(b2) b2.style.display="";
|
||||
else {
|
||||
b2=button("Show editor",show_editor);
|
||||
insertAfter(b2,b);
|
||||
}
|
||||
}
|
||||
}
|
||||
var b=button("Minibar",function(){upload(g,goto_minibar);});
|
||||
b.title="Upload the grammar and test it in the minibar";
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<title>GF online editor for simple multilingual grammars</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="editor.css" title="Cloud">
|
||||
<link rel="stylesheet" type="text/css" href="../minibar/minibar.css">
|
||||
<link rel="alternate stylesheet" type="text/css" href="molto.css" title="MOLTO">
|
||||
|
||||
<link rel=author href="http://www.cse.chalmers.se/~hallgren/" title="Thomas Hallgren">
|
||||
@@ -32,7 +33,7 @@ This page does not work without JavaScript.
|
||||
<hr>
|
||||
<div class=modtime><small>
|
||||
HTML
|
||||
<!-- hhmts start --> Last modified: Fri Feb 10 17:47:16 CET 2012 <!-- hhmts end -->
|
||||
<!-- hhmts start --> Last modified: Mon Feb 13 18:05:45 CET 2012 <!-- hhmts end -->
|
||||
</small></div>
|
||||
<a href="about.html">About</a>
|
||||
<pre id=debug></pre>
|
||||
@@ -44,5 +45,10 @@ HTML
|
||||
<script type="text/javascript" src="editor.js"></script>
|
||||
<script type="text/javascript" src="cloud2.js"></script>
|
||||
<script type="text/javascript" src="sort.js"></script>
|
||||
<script type="text/JavaScript" src="../minibar/minibar.js"></script>
|
||||
<script type="text/JavaScript" src="../minibar/minibar_input.js"></script>
|
||||
<script type="text/JavaScript" src="../minibar/minibar_translations.js"></script>
|
||||
<script type="text/JavaScript" src="../minibar/minibar_support.js"></script>
|
||||
<script type="text/JavaScript" src="../minibar/pgf_online.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
body {
|
||||
body.minibar {
|
||||
background: #ccc url("brushed-metal.png");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
<title>Minibar</title>
|
||||
<link rel=stylesheet type="text/css" href="minibar.css">
|
||||
|
||||
<link rel=author href="http://www.cse.chalmers.se/~hallgren/" title="Thomas Hallgren">
|
||||
|
||||
<meta name = "viewport" content = "width = device-width">
|
||||
<meta charset="UTF-8">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<body class=minibar>
|
||||
<h2>Minibar online</h2>
|
||||
<div id=minibar></div>
|
||||
|
||||
@@ -23,11 +25,9 @@
|
||||
& <a href="http://www.grammaticalframework.org:41296/translate/">Translator</a>]
|
||||
</small>
|
||||
<small class=modtime>
|
||||
HTML <!-- hhmts start --> Last modified: Mon Aug 8 18:04:22 CEST 2011 <!-- hhmts end -->
|
||||
HTML <!-- hhmts start --> Last modified: Mon Feb 13 18:07:42 CET 2012 <!-- hhmts end -->
|
||||
</small>
|
||||
<address>
|
||||
<a href="http://www.cse.chalmers.se/~hallgren/">TH</a>
|
||||
<img src="http://www.altocumulus.org/~hallgren/online.cgi?icon" alt=""></address>
|
||||
|
||||
<script type="text/JavaScript" src="support.js"></script>
|
||||
<script type="text/JavaScript" src="minibar.js"></script>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* --- Translations object -------------------------------------------------- */
|
||||
|
||||
var tree_icon="tree-btn.png";
|
||||
var alignment_icon="align-btn.png";
|
||||
var tree_icon="../minibar/tree-btn.png";
|
||||
var alignment_icon="../minibar/align-btn.png";
|
||||
|
||||
function Translations(server,opts) {
|
||||
this.server=server;
|
||||
|
||||
Reference in New Issue
Block a user