diff --git a/README.md b/README.md index 09496a6..a5f4cb6 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ represented in the table below. | URL Parameter | Default | Description | |---|---|---| +| `compact` | `false` | Hides interface controls when set to `true`. | | `host` | `http://hostname` | The host name of the server. | | `port` | `57772` | The port of the server. | | `webAppName` | `EntityBrowser` | Caché web application name. | diff --git a/package.json b/package.json index bd9cd22..f550f92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iknow-entity-browser", - "version": "0.9.7", + "version": "0.9.8", "description": "Visualizer for iKnow entities", "main": "gulpfile.babel.js", "scripts": { diff --git a/src/static/fonts/iknowentitybrowsericons.eot b/src/static/fonts/iknowentitybrowsericons.eot index 33b60bf..8bbf517 100644 Binary files a/src/static/fonts/iknowentitybrowsericons.eot and b/src/static/fonts/iknowentitybrowsericons.eot differ diff --git a/src/static/fonts/iknowentitybrowsericons.svg b/src/static/fonts/iknowentitybrowsericons.svg index 7bb9054..b645fbc 100644 --- a/src/static/fonts/iknowentitybrowsericons.svg +++ b/src/static/fonts/iknowentitybrowsericons.svg @@ -33,4 +33,6 @@ + + diff --git a/src/static/fonts/iknowentitybrowsericons.ttf b/src/static/fonts/iknowentitybrowsericons.ttf index 66d0624..6408ce9 100644 Binary files a/src/static/fonts/iknowentitybrowsericons.ttf and b/src/static/fonts/iknowentitybrowsericons.ttf differ diff --git a/src/static/fonts/iknowentitybrowsericons.woff b/src/static/fonts/iknowentitybrowsericons.woff index 3a6a69c..111f80c 100644 Binary files a/src/static/fonts/iknowentitybrowsericons.woff and b/src/static/fonts/iknowentitybrowsericons.woff differ diff --git a/src/static/index.html b/src/static/index.html index 5f293e0..5d3656b 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -33,7 +33,16 @@ -
+
+
+
+
+ Show all controls +
+
+
+
+
@@ -48,8 +57,15 @@
+
+
+
+ Collapse to compact view +
+
+
-
+
diff --git a/src/static/js/settings/index.js b/src/static/js/settings/index.js index 60d99c4..9ea3d85 100644 --- a/src/static/js/settings/index.js +++ b/src/static/js/settings/index.js @@ -3,7 +3,8 @@ import * as graph from "../graph"; import * as sourceSettings from "./sourceSettings"; import * as tabularViewSettings from "./tabularViewSettings"; import * as storage from "../storage"; -import { getChanges, applyChanges, init as initValues, applyFixedClasses } from "./values"; +import { getChanges, getOption, applyChanges, init as initValues, applyFixedClasses, setOption + } from "./values"; import { makeAutosizable } from "../utils"; function toggleSettings (uiStateModel) { @@ -40,4 +41,30 @@ export function init () { location.reload(); }); + updateCompactView(); + +} + +function updateCompactView () { + + let compact = !!getOption("compact"); + + function toggle (element, flag = true) { + element.style.opacity = flag ? 1 : 0; + element.style.pointerEvents = flag ? "all" : "none"; + } + + toggle(document.getElementById("rightTopIcons"), !compact); + toggle(document.getElementById("rightTopExpandButton"), compact); + toggle(document.getElementById("toolbarIcons"), !compact); + + document.getElementById("expandViewButton").addEventListener("click", () => { + setOption("compact", false); + updateCompactView(); + }); + document.getElementById("collapseCompactViewButton").addEventListener("click", () => { + setOption("compact", true); + updateCompactView(); + }); + } \ No newline at end of file diff --git a/src/static/js/settings/values.js b/src/static/js/settings/values.js index a575876..55b481c 100644 --- a/src/static/js/settings/values.js +++ b/src/static/js/settings/values.js @@ -5,6 +5,7 @@ import * as url from "../url"; const STORAGE_KEY = "settings"; const settingsTypes = { + compact: Boolean, host: String, port: Number, webAppName: String, @@ -16,7 +17,9 @@ const settingsTypes = { tabularShowHiddenNodes: Boolean }; -const settings = { // assign defaults here +// defaults are assigned here +const settings = { + compact: false, host: "", port: 57772, webAppName: "EntityBrowser", diff --git a/src/static/scss/icons.scss b/src/static/scss/icons.scss index af53261..c6e0706 100644 --- a/src/static/scss/icons.scss +++ b/src/static/scss/icons.scss @@ -118,3 +118,9 @@ .icon-question:before { content: "\7a"; } +.icon-expand:before { + content: "\41"; +} +.icon-collapse:before { + content: "\42"; +} diff --git a/src/static/scss/interface.scss b/src/static/scss/interface.scss index 8f4ee44..c642f1c 100644 --- a/src/static/scss/interface.scss +++ b/src/static/scss/interface.scss @@ -17,7 +17,7 @@ } -#rightTopIcons { +.rightTopIcons { position: absolute; left: -35px; @@ -33,7 +33,7 @@ } -#table.active #rightTopIcons { +#table.active .rightTopIcons { top: 6px; }