diff --git a/assets/icons/fonts/icon.ttf b/assets/icons/fonts/icon.ttf deleted file mode 100644 index cd41d4d..0000000 Binary files a/assets/icons/fonts/icon.ttf and /dev/null differ diff --git a/assets/icons/fonts/icon.woff b/assets/icons/fonts/icon.woff deleted file mode 100644 index 03e7240..0000000 Binary files a/assets/icons/fonts/icon.woff and /dev/null differ diff --git a/assets/icons/fonts/icon.woff2 b/assets/icons/fonts/icon.woff2 deleted file mode 100644 index 6237616..0000000 Binary files a/assets/icons/fonts/icon.woff2 and /dev/null differ diff --git a/assets/icons/fonts/meshviewer.ttf b/assets/icons/fonts/meshviewer.ttf new file mode 100644 index 0000000..96878e6 Binary files /dev/null and b/assets/icons/fonts/meshviewer.ttf differ diff --git a/assets/icons/fonts/meshviewer.woff b/assets/icons/fonts/meshviewer.woff new file mode 100644 index 0000000..9f3e44c Binary files /dev/null and b/assets/icons/fonts/meshviewer.woff differ diff --git a/assets/icons/fonts/meshviewer.woff2 b/assets/icons/fonts/meshviewer.woff2 new file mode 100644 index 0000000..d8f937d Binary files /dev/null and b/assets/icons/fonts/meshviewer.woff2 differ diff --git a/assets/icons/icon.scss b/assets/icons/icon.scss index a3ec26b..212f775 100644 --- a/assets/icons/icon.scss +++ b/assets/icons/icon.scss @@ -7,9 +7,9 @@ $cache-breaker: unique-id(); font-family: 'ionicons'; font-style: normal; font-weight: normal; - src: url('fonts/icon.woff2?rel=#{$cache-breaker}') format('woff2'), - url('fonts/icon.woff?rel=#{$cache-breaker}') format('woff'), - url('fonts/icon.ttf?rel=#{$cache-breaker}') format('truetype'); + src: url('fonts/meshviewer.woff2?rel=#{$cache-breaker}') format('woff2'), + url('fonts/meshviewer.woff?rel=#{$cache-breaker}') format('woff'), + url('fonts/meshviewer.ttf?rel=#{$cache-breaker}') format('truetype'); } [class^='ion-'], @@ -49,3 +49,5 @@ $cache-breaker: unique-id(); @include icon('arrow-resize', '\f264'); @include icon('arrow-left-c', '\f108'); @include icon('arrow-right-c', '\f10b'); +@include icon('full-enter', '\e901'); +@include icon('full-exit', '\e900'); diff --git a/config.default.js b/config.default.js index e34d567..cb4a61b 100644 --- a/config.default.js +++ b/config.default.js @@ -6,6 +6,8 @@ module.exports = function () { 'nodeZoom': 18, 'labelZoom': 13, 'clientZoom': 15, + 'fullscreen': true, + 'fullscreenFrame': true, 'nodeAttr': [ // value can be a node attribute (1 depth) or a a function in utils/node with prefix show { diff --git a/lib/gui.js b/lib/gui.js index 19c2a2c..f4b7d4a 100644 --- a/lib/gui.js +++ b/lib/gui.js @@ -1,10 +1,10 @@ define(['d3-interpolate', 'map', 'sidebar', 'tabs', 'container', 'legend', 'linklist', 'nodelist', 'simplenodelist', 'infobox/main', 'proportions', 'forcegraph', 'title', 'about', 'datadistributor', - 'filters/filtergui', 'filters/hostname'], + 'filters/filtergui', 'filters/hostname', 'helper'], function (d3Interpolate, Map, Sidebar, Tabs, Container, Legend, Linklist, Nodelist, SimpleNodelist, Infobox, Proportions, ForceGraph, - Title, About, DataDistributor, FilterGUI, HostnameFilter) { + Title, About, DataDistributor, FilterGUI, HostnameFilter, helper) { 'use strict'; return function (language) { @@ -77,6 +77,17 @@ function (d3Interpolate, Map, Sidebar, Tabs, Container, Legend, Linklist, buttons.appendChild(buttonToggle); + if (config.fullscreen || config.fullscreenFrame && window.frameElement) { + var buttonFullscreen = document.createElement('button'); + buttonFullscreen.classList.add('ion-full-enter'); + buttonFullscreen.setAttribute('aria-label', _.t('button.fullscreen')); + buttonFullscreen.onclick = function onclick() { + helper.fullscreen(buttonFullscreen); + }; + + buttons.appendChild(buttonFullscreen); + } + var title = new Title(); var header = new Container('header'); diff --git a/lib/utils/helper.js b/lib/utils/helper.js index 6371721..fd698b9 100644 --- a/lib/utils/helper.js +++ b/lib/utils/helper.js @@ -176,5 +176,23 @@ define({ } } ctx.fill(); + }, + fullscreen: function fullscreen(btn) { + if (!document.fullscreenElement) { + var fel = document.firstElementChild; + var func = fel.requestFullscreen + || fel.webkitRequestFullScreen + || fel.msRequestFullscreen; + func.call(fel); + btn.classList.add('ion-full-exit'); + } else { + func = document.exitFullscreen + || document.webkitexitFullscreen + || document.msexitFullscreen; + if (func) { + func.call(document); + btn.classList.add('ion-full-enter'); + } + } } }); diff --git a/locale/de.json b/locale/de.json index de06b9e..7a69241 100644 --- a/locale/de.json +++ b/locale/de.json @@ -59,7 +59,8 @@ "button": { "switchView": "Ansicht wechseln", "location": "Koordinaten wählen", - "tracking": "Lokalisierung" + "tracking": "Lokalisierung", + "fullscreen": "Vollbildmodus wechseln" }, "momentjs": { "calendar": { diff --git a/locale/en.json b/locale/en.json index ecaf07b..23f438d 100644 --- a/locale/en.json +++ b/locale/en.json @@ -59,7 +59,8 @@ "button": { "switchView": "Switch view", "location": "Pick coordinates", - "tracking": "Localisation" + "tracking": "Localisation", + "fullscreen": "Toggle fullscreen" }, "momentjs": { "calendar": {