From 9d47b83e076dafdb3d75ac7213dfc0ba993f1899 Mon Sep 17 00:00:00 2001 From: hallgren Date: Thu, 19 Apr 2012 15:34:56 +0000 Subject: [PATCH] minibar & cloud service: minor style changes Also include the GF logo on the cloud service start page. --- WebSetup.hs | 15 +++++++++++---- src/www/gfse/editor.css | 1 + src/www/index.html | 2 +- src/www/minibar/minibar.css | 13 ++++++++++--- src/www/minibar/minibar.js | 4 ++-- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/WebSetup.hs b/WebSetup.hs index eb75b090e..23a41fe22 100644 --- a/WebSetup.hs +++ b/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_dirgf_logo) + execute command = do putStrLn command e <- system command diff --git a/src/www/gfse/editor.css b/src/www/gfse/editor.css index b2347cb44..ff5554175 100644 --- a/src/www/gfse/editor.css +++ b/src/www/gfse/editor.css @@ -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 diff --git a/src/www/index.html b/src/www/index.html index 440235e1f..499f4be37 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -7,7 +7,7 @@ -

GF Cloud Service

+

GF Cloud Service

Available Web Applications

diff --git a/src/www/minibar/minibar.css b/src/www/minibar/minibar.css index d68784d51..cbfc04638 100644 --- a/src/www/minibar/minibar.css +++ b/src/www/minibar/minibar.css @@ -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; } diff --git a/src/www/minibar/minibar.js b/src/www/minibar/minibar.js index 466886865..10a469b6b 100644 --- a/src/www/minibar/minibar.js +++ b/src/www/minibar/minibar.js @@ -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: "));