From 225a11132fccc25d5260f1c44e946e3349545e3a Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sat, 14 Feb 2015 00:03:38 +0100 Subject: [PATCH] More LSP updates from Carina. --- Makefile | 2 +- lsp/main.css | 44 ++- lsp/mist.js | 538 ++++++++++++++++++++++++------- lsp/plugins/jquery.qrcode.min.js | 2 + lsp/server.html | 1 + src/embed.js | 2 +- 6 files changed, 461 insertions(+), 128 deletions(-) create mode 100644 lsp/plugins/jquery.qrcode.min.js diff --git a/Makefile b/Makefile index f44ff66b..a702e533 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,7 @@ MistOutJSON: src/output/mist_out.cpp src/output/output.cpp src/output/output_htt $(CXX) $(LDFLAGS) $(CPPFLAGS) $^ $(LDLIBS) -o $@ lspSOURCES=lsp/plugins/md5.js lsp/plugins/cattablesort.js lsp/mist.js -lspSOURCESmin=lsp/plugins/jquery.js lsp/plugins/jquery.flot.min.js lsp/plugins/jquery.flot.time.min.js +lspSOURCESmin=lsp/plugins/jquery.js lsp/plugins/jquery.flot.min.js lsp/plugins/jquery.flot.time.min.js lsp/plugins/jquery.qrcode.min.js lspDATA=lsp/header.html lsp/main.css lsp/footer.html JAVA := $(shell which java 2> /dev/null) diff --git a/lsp/main.css b/lsp/main.css index 65247cae..ba9d7aa3 100644 --- a/lsp/main.css +++ b/lsp/main.css @@ -258,7 +258,6 @@ main > button { } textarea { font-size: 0.8em; - height: 20em; } .unit { color: #777; @@ -401,13 +400,14 @@ table td.vheader { padding: 0.8em 0.2em; border-right: 1px solid #ccc; background-image: linear-gradient(to left, #ddd, #eee); + width: 1.5em; } table td.vheader span { transform: translate( calc(-50% + 0.75em) ) rotate(-90deg); transform-origin: 50% 50%; white-space: nowrap; display: block; - width: 1.5em; + position: absolute; } table td, table th, .flextable .td, .flextable .th { padding: 0.2em 0.8em; @@ -589,6 +589,11 @@ input[type=radio] { border: 1px solid #ccc; padding: 0.5em 1em; } +.legend > .close { + position: absolute; + top: 0.5em; + right: 0.5em; +} .legend-list > label { display: block; } @@ -599,6 +604,10 @@ input[type=radio] { margin: 0 0.5em; box-shadow: 0.1em 0.1em 0.2em rgba(0,0,0,0.2); } +.legend-list .close { + position: absolute; + right: 0.5em; +} #tooltip { position: absolute; display: none; @@ -639,7 +648,36 @@ body:not(.helpme) .input_container .description { body:not(.helpme) .input_container .ih_balloon { display: none; } - +#popup { + position: fixed; + top: 5%; + left: 5%; + bottom: 5%; + right: 5%; + border: 1px solid #b4b4b4; + background-color: #fff; + box-shadow: 0.2em 0.2em 0.5em rgba(0,0,0,0.2); + padding: 0.5em; + z-index: 10; + color: rgba(0,0,0,0.9); +} +#popup > .close { + position: absolute; + top: 0.5em; + right: 0.5em; +} +.qr_container { + display: flex; + flex-flow: column nowrap; + width: 100%; + height: 100%; + text-align: center; + padding: 1em; + box-sizing: border-box; +} +.qr_container .qrcode { + flex-grow: 1; +} @font-face { font-family: FuturaICGLight; diff --git a/lsp/mist.js b/lsp/mist.js index 7f4ea576..4ccdfb1e 100644 --- a/lsp/mist.js +++ b/lsp/mist.js @@ -58,7 +58,26 @@ var UI = { helpme: true } }, - interval: false, + interval: { + clear: function(){ + if (typeof this.opts == 'undefined') { + return; + } + clearInterval(this.opts.id); + delete this.opts; + }, + set: function(callback,delay){ + if (this.opts) { + log('[interval]','Set called on interval, but an interval is already active.'); + } + + this.opts = { + delay: delay, + callback: callback + }; + this.opts.id = setInterval(callback,delay); + } + }, returnTab: ['Overview'], countrylist: {'AF':'Afghanistan','AX':'Åland Islands','AL':'Albania','DZ':'Algeria','AS':'American Samoa','AD':'Andorra', 'AO':'Angola','AI':'Anguilla','AQ':'Antarctica','AG':'Antigua and Barbuda','AR':'Argentina','AM':'Armenia','AW':'Aruba', @@ -131,6 +150,20 @@ var UI = { }, element: $('
').attr('id','tooltip') }, + popup: { + element: null, + show: function(content) { + this.element = $('
').attr('id','popup').append( + $('