From 3fc881257eb9616dc890d8de8b871f346dd12171 Mon Sep 17 00:00:00 2001 From: Prssanna Desai Date: Tue, 17 Jul 2018 19:06:25 +0530 Subject: [PATCH] New toolbars for embed view Bug: T151057 Change-Id: Iadcdacf02800cc90e5ff4193b8fe5b1cecbc2744 --- embed.html | 371 ++++++++++++++---- i18n/en.json | 6 +- i18n/qqq.json | 10 +- style.less | 14 + wikibase/init.js | 9 +- wikibase/queryService/ui/App.js | 64 +-- wikibase/queryService/ui/ResultView.js | 89 ++++- .../ui/resultBrowser/GraphResultBrowser.js | 2 +- .../resultBrowser/helper/FormatterHelper.js | 4 +- 9 files changed, 425 insertions(+), 144 deletions(-) diff --git a/embed.html b/embed.html index 592d0c61..679fee4e 100644 --- a/embed.html +++ b/embed.html @@ -9,6 +9,9 @@ + + + @@ -62,6 +65,10 @@ display: none; } +#query-result { + height: 97vh; +} + .action-bar { height: 30px; width: 100%; @@ -69,27 +76,8 @@ font-size: 18px; } -.link { - position: fixed; - bottom: 3em; - left: 0px; - padding: 0px 2px 0px 2px; - background-color: rgba(255, 255, 255, 0.8); - z-index: 401; /* one above .leaflet-pane */ -} - -.edit { - position: fixed; - bottom: 2em; - left: 0; - font-size: 2em; - z-index: 401; /* one above .leaflet-pane */ - padding: 0.2em; - border-radius: 5px; - background-color: rgba(255,255,255,0.8); -} .popover { - max-width: 80vw; + max-width: 100vw; min-width: 300px; white-space: nowrap; } @@ -104,20 +92,42 @@ } #result-browser-menu { - height: 37vh; - overflow-y: scroll; cursor: pointer; + list-style-type: none; + padding-left: 10px; +} + +.result-browser-item { + padding: 0.5em 0 0.5em 0; +} + +.result-browser { + color: #333; +} + +.result-browser-inactive { + display: none; } .header-toolbar { z-index: 1000; position: fixed; - bottom: 3em; - right: 0; + left: -97px; + top: 26vh; + padding-top: 0.5em; opacity: 0.2; + width: 150px; } .header-toolbar:hover { + transition: 0.4s; opacity: 1; + background: #fff; + border: #ddd 1px solid; + left: 0; +} + +.toolbar-label { + display: none; } .img-grid { @@ -131,11 +141,13 @@ .bootstrap-table { width: 100%; height: auto; + padding: 0 50px; } -.jstree { +#query-result .jstree { width: 100%; height: auto; + padding: 0 50px; } .expand-type { @@ -149,12 +161,112 @@ opacity: 1; } -@media only screen and (max-width: 500px) { - .header-toolbar { - display: none; +#layout-options { + margin-top: 0px; + position: fixed; + z-index: 1001; + opacity: 0.2; + margin: auto; + width: 100%; +} +#layout-options:hover { + opacity: 1; +} + +.layout-button { + border: none; + border-radius: 0; +} + +.toolbar-right { + position: fixed; + right: -97px; + top: 26vh; + z-index: 1000; + padding-top: 0.5em; + opacity: 0.2; + width: 150px; +} +.toolbar-right:hover, .hovered { + transition: 0.4s; + opacity: 1; + background: #fff; + border: #ddd 1px solid; + right: 0; +} + +.toolbar-right-item { + display: block; + width: 100%; + padding: 0.75em 0 0.75em 0; + position: relative; +} +.toolbar-right-item:focus { + outline: none; +} + +.toolbar-right-icon { + position: relative; + left: -15px; +} + +.toolbar-right-label { + position: absolute; +} + +#embed-right-menu { + list-style-type: none; + position: static; + padding-left: 38px; +} + +@media only screen and (max-height: 285px) { + .header-toolbar { + z-index: 1000; + position: fixed; + left: -97px; + top: 20vh; + padding-top: 0.5em; + opacity: 0.2; + width: 150px; + height: 65vh; + overflow-y: scroll; + overflow-x: hidden; } } +@media only screen and (max-height: 382px) { + #embed-right-menu { + list-style-type: none; + overflow-y: scroll; + overflow-x: hidden; + height: 60vh; + position: static; + } +} + +@media only screen and (max-width: 400px) { + .toolbar-right { + display: none; + } + + .header-toolbar { + display: none; + } + + .bootstrap-table { + width: 100%; + height: auto; + padding: 0px; + } + + .jstree { + width: 100%; + height: auto; + padding: 0px; + } + +} @@ -168,35 +280,54 @@ +
-
+ +
+ - - + +
  • + + + +
  • +
    Test result
    Test error
    - +
    Loading... @@ -213,17 +344,73 @@
    - - +
    - + + + + + + + + + + + + + + + + + + + + + + + @@ -241,7 +428,7 @@ - +- @@ -260,10 +447,14 @@ + + + + @@ -286,6 +477,8 @@ + + @@ -297,28 +490,16 @@