Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Commit

Permalink
Kiosk mode (#58)
Browse files Browse the repository at this point in the history
Add ?kiosk=on to the URL to hide the header in dashboards and the main menu (useful for scenarios where limited navigation is desired).

Amended the web app manifest so adding to home from Chrome goes back to the last dashboard.

Signed-off-by: Yannick Schaus <habpanel@schaus.net>
  • Loading branch information
ghys committed Nov 6, 2016
1 parent 164ce5c commit a925b93
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions web/app/dashboard/dashboard.view.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.module('app')
.controller('DashboardViewCtrl', DashboardViewController);

DashboardViewController.$inject = ['$scope', '$location', '$rootScope', '$timeout', 'dashboard', 'PersistenceService', 'OHService', 'Fullscreen'];
function DashboardViewController($scope, $location, $rootScope, $timeout, dashboard, PersistenceService, OHService, Fullscreen) {
DashboardViewController.$inject = ['$scope', '$location', '$rootScope', '$routeParams', '$timeout', 'dashboard', 'PersistenceService', 'OHService', 'Fullscreen'];
function DashboardViewController($scope, $location, $rootScope, $routeParams, $timeout, dashboard, PersistenceService, OHService, Fullscreen) {
var vm = this;
vm.dashboard = dashboard;

Expand Down Expand Up @@ -43,7 +43,7 @@
OHService.reloadItems();
});
if ($rootScope.settings.no_scrolling) iNoBounce.enable(); else iNoBounce.disable();
//Fullscreen.all();
$rootScope.kioskMode = ($routeParams.kiosk == 'on');
}

vm.refresh = function() {
Expand Down
2 changes: 1 addition & 1 deletion web/app/dashboard/dashboard.view.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="header">
<div class="header" ng-if="!kioskMode">
<a class="btn pull-left" onclick="window.history.back()" title="Go back">
<i class="glyphicon glyphicon-chevron-left"></i>
</a>
Expand Down
6 changes: 4 additions & 2 deletions web/app/menu/menu.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
.controller('MenuCtrl', MenuController)
.controller('DashboardSettingsCtrl', DashboardSettingsCtrl);

MenuController.$inject = ['$rootScope', '$scope', 'dashboards', '$interval', '$location', 'PersistenceService', 'OHService', 'prompt', '$filter', '$uibModal', 'Fullscreen'];
function MenuController($rootScope, $scope, dashboards, $interval, $location, PersistenceService, OHService, prompt, $filter, $modal, Fullscreen) {
MenuController.$inject = ['$rootScope', '$scope', 'dashboards', '$routeParams', '$interval', '$location', 'PersistenceService', 'OHService', 'prompt', '$filter', '$uibModal', 'Fullscreen'];
function MenuController($rootScope, $scope, dashboards, $routeParams, $interval, $location, PersistenceService, OHService, prompt, $filter, $modal, Fullscreen) {
var vm = this;
vm.dashboards = dashboards;
vm.editMode = false;
Expand All @@ -23,6 +23,8 @@
}
$interval(tick, 1000);
if ($rootScope.settings.no_scrolling) iNoBounce.enable(); else iNoBounce.disable();
$rootScope.kioskMode = ($routeParams.kiosk == 'on');

OHService.reloadItems();
}

Expand Down
2 changes: 1 addition & 1 deletion web/app/menu/menu.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="header">
<div class="header" ng-hide="kioskMode">
<a class="btn btn-link pull-right" title="Toggle full screen"
ng-click="vm.goFullscreen()">
<i class="glyphicon glyphicon-resize-full"></i>
Expand Down
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</head>

<body>
<div class="container" ng-view></div>
<div class="container" ng-view ng-style="{ 'padding-top': kioskMode ? 0 : 'auto' }"></div>
</body>

</html>
Expand Down
1 change: 0 additions & 1 deletion web/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "fullscreen",
"background_color": "black"
}

0 comments on commit a925b93

Please sign in to comment.