mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
minibar & cloud service: minor style changes
Also include the GF logo on the cloud service start page.
This commit is contained in:
15
WebSetup.hs
15
WebSetup.hs
@@ -10,10 +10,9 @@ import Distribution.Simple.LocalBuildInfo(datadir,buildDir,absoluteInstallDirs)
|
||||
{-
|
||||
To test the GF web services, the minibar and the grammar editor, use
|
||||
"cabal install" (or "runhaskell Setup.hs install") to install gf as usual.
|
||||
Then start the server with the command "gf -server" and
|
||||
open http://localhost:41296/minibar/minibar.html in your web browser
|
||||
(Firefox, Safari, Opera or Chrome). The example grammars listed below will
|
||||
be available in the minibar.
|
||||
Then start the server with the command "gf -server" and open
|
||||
http://localhost:41296/ in your web browser (Firefox, Safari, Opera or
|
||||
Chrome). The example grammars listed below will be available in the minibar.
|
||||
-}
|
||||
|
||||
example_grammars = -- :: [(pgf, tmp, src)]
|
||||
@@ -45,9 +44,11 @@ setupWeb gf args dest pkg lbi =
|
||||
do putStrLn "setupWeb"
|
||||
mapM_ (createDirectoryIfMissing True) [grammars_dir,cloud_dir]
|
||||
mapM_ build_pgf example_grammars
|
||||
copyGFLogo
|
||||
where
|
||||
grammars_dir = www_dir </> "grammars"
|
||||
cloud_dir = www_dir </> "tmp" -- hmm
|
||||
logo_dir = www_dir </> "Logos"
|
||||
www_dir = datadir (absoluteInstallDirs pkg lbi dest) </> "www"
|
||||
gfo_dir = buildDir lbi </> "gfo"
|
||||
|
||||
@@ -64,6 +65,12 @@ setupWeb gf args dest pkg lbi =
|
||||
-- " --output-dir="++grammars_dir++ -- has no effect?!
|
||||
" "++src
|
||||
|
||||
gf_logo = "gf0.png"
|
||||
|
||||
copyGFLogo =
|
||||
do createDirectoryIfMissing True logo_dir
|
||||
copyFile ("doc"</>"Logos"</>gf_logo) (logo_dir</>gf_logo)
|
||||
|
||||
execute command =
|
||||
do putStrLn command
|
||||
e <- system command
|
||||
|
||||
@@ -4,6 +4,7 @@ h1,h2,h3,h4,small { font-family: sans-serif;}
|
||||
h1,h2,h3,h4 { color: #303030; text-shadow: rgba(0,0,0,0.25) 3px 3px 5px; }
|
||||
|
||||
h1:first-child, h2:first-child { margin-top: 0; margin-bottom: 1ex; }
|
||||
h1 img { float: right; border: 0; max-width: 50%; }
|
||||
|
||||
#editor {
|
||||
/* This allows the div to grow wider than the window if necessary to
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="gfse/editor.css" title="Cloud">
|
||||
<meta name = "viewport" content = "width = device-width">
|
||||
|
||||
<h1>GF Cloud Service</h1>
|
||||
<h1><a href="http://www.grammaticalframework.org/"><img src="Logos/gf0.png" alt=""></a>GF Cloud Service</h1>
|
||||
|
||||
<h2>Available Web Applications</h2>
|
||||
|
||||
|
||||
@@ -5,8 +5,12 @@ body.minibar {
|
||||
h1, h2, h3, small, th { font-family: sans-serif; }
|
||||
h1, h2, h3 { color: #303030; text-shadow: rgba(0,0,0,0.25) 3px 3px 5px; }
|
||||
|
||||
h1:first-child, h2:first-child { margin-top: 0; margin-bottom: 1ex; }
|
||||
|
||||
th, td { vertical-align: baseline; text-align: left; }
|
||||
|
||||
div.menubar { font-family: sans-serif; font-size: small; }
|
||||
|
||||
div#surface {
|
||||
min-height: 3ex;
|
||||
margin: 5px;
|
||||
@@ -67,10 +71,13 @@ div.brackets {
|
||||
span.brackets {
|
||||
background: #ddd;
|
||||
display: inline-block;
|
||||
border: 1px solid black;
|
||||
padding: 3px;
|
||||
border-color: black;
|
||||
border-style: solid;
|
||||
border-width: 0 0 1px 0;
|
||||
/*border: 1px solid black;*/
|
||||
padding: 2px 3px;
|
||||
}
|
||||
|
||||
div.brackets .token {
|
||||
padding: 0.5ex
|
||||
padding: 0 0.5ex;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ function Minibar(server,opts) {
|
||||
|
||||
/* --- Creating user interface elements --------------------------------- */
|
||||
|
||||
this.menubar=empty("div");
|
||||
this.menubar=div_class("menubar");
|
||||
this.extra=div_id("extra");
|
||||
|
||||
this.minibar=element(this.options.target);
|
||||
@@ -94,7 +94,7 @@ Minibar.prototype.show_grammarlist=function(dir,grammar_names,dir_count) {
|
||||
function pick_first_grammar() {
|
||||
if(t.timeout) clearTimeout(t.timeout),t.timeout=null;
|
||||
if(t.grammar_menu.length>1 && !t.grammar_menu.parentElement) {
|
||||
t.grammar_menu.onchange=bind(pick,t);
|
||||
t.grammar_menu.onchange=pick;
|
||||
insertFirst(t.menubar,button("i",bind(t.show_grammarinfo,t)))
|
||||
insertFirst(t.menubar,t.grammar_menu);
|
||||
insertFirst(t.menubar,text("Grammar: "));
|
||||
|
||||
Reference in New Issue
Block a user