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

[Feature] Screen Saver #287

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d1be00d
Initial Commit of Dashboard Slideshow Feature
Jan 26, 2018
7f34a33
Initial work on settings
Jan 27, 2018
4565bf1
More development on settings page
Jan 28, 2018
4f83079
Formatted using Visual Studio Code
Jan 28, 2018
d1b46fa
Handle dashboard_control_item state change
Jan 28, 2018
5c8cd18
Added help text
Jan 28, 2018
96b6fd6
Fixes Back/Cancel text/logic
Jan 28, 2018
8599f48
Made dashboards draggable and sortable
Jan 28, 2018
ed6250b
Added logic to exclude dashboards
Jan 28, 2018
e39bb72
Changed going to settings to reload on Cancel->OK confirmation
Jan 28, 2018
dcc2928
Added code to check if a dashboard exists before switching to it.
Jan 29, 2018
c5c42f7
Broadcast ($rootScope.$broadcast) when configuration changed/loaded
Jan 29, 2018
1ed6535
Monitor config changes/loaded
Jan 29, 2018
d3af3c1
More user friendly error messages
Jan 29, 2018
ec175c9
Fixed admin.pot for header
Jan 29, 2018
a6da9bd
Tweaked styles
Jan 29, 2018
093a0fa
Fixed remainder of edits
Jan 29, 2018
3ab5985
Modified admin.pot and settings.html for text translations
Jan 29, 2018
b00dd43
Made _config a private member
Jan 29, 2018
7cbeb0e
More validation rules
Jan 29, 2018
38d7825
Fixed race condition on settings
Jan 29, 2018
55ac5c6
Remove db on onStop when db does not exist,
Jan 29, 2018
94bae22
Downgraded to ES5 from ES6
Feb 2, 2018
8c200b0
Ignore .bowerrc
Feb 2, 2018
cae1f9e
Removed ngAnimate
Feb 2, 2018
2c73218
const to var
Feb 2, 2018
61954cc
Style/Layout Changes
Feb 4, 2018
bda984c
Finalized scss
Feb 4, 2018
a728553
Added condition to show screensaver button on header
Feb 16, 2018
a3cfbef
More ES5 changes.
Feb 16, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ bower_components
.sass-cache
nbproject
coverage
.bowerrc
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Kuba Wolanin <hi@kubawolanin.com> (@kubawolanin)
Sam Turner <sam@digi.ltd.uk> (@digiltd)
Ingo Sigmund <ingo.sigmund@web.de> (@isigmund)
Andreas Gebauer <an.ge.ber.81@gmail.com> (@andreasgebauer)
Lucky Mallari <luckymallari@gmail.com> (@luckymallari)
2 changes: 1 addition & 1 deletion doc/habpanel.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Apart from the storage configuration discussed above, the settings screen contai
| Additional stylesheet | Reference the relative URL of an additional CSS file which will be included and can be used to override the styles defined by the theme. For additional information on how you can customize HABPanel's styles, go to: [HABPanel Development & Advanced Features: Start Here!](https://community.openhab.org/t/habpanel-development-advanced-features-start-here/30755/1)
| Drawer heading image | Reference the URL of an image (expected width: 265 pixels) which will replace the header in the side drawer
| Hide the drawer's footer | Check to remove the bottom black part of the side drawer containing the date & time
| Hide toolbar buttons (speak/refresh/fullscreen) | Check those boxes to hide the corresponding button in the default dashboard header top-right corner
| Hide toolbar buttons (screensaver/speak/refresh/fullscreen) | Check those boxes to hide the corresponding button in the default dashboard header top-right corner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the docs could use a new paragraph for the new settings screen :)

| Show a clock in the header | If checked, a clock will be displayed in the main menu and the dashboards
| Header clock format (shown if "Show a clock in the header" is checked) | Use an [AngularJS' date filter format string](https://docs.angularjs.org/api/ng/filter/date) to customize the clock format in the header. The default is `HH:mm`
| Prevent scrolling (when not editing) | When enabled, it is impossible to scroll the dashboard on a tablet (and it prevents the "elastic" bouncing effect on iOS/Safari)
Expand Down
17 changes: 16 additions & 1 deletion web/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
'ngFileSaver',
'snap',
'tmh.dynamicLocale',
'pascalprecht.translate'
'pascalprecht.translate',
'as.sortable'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still confident we can implement a sortable using just gridster and avoid a new dependency, I'll have a look ;)

])
.config(['$routeProvider', 'localStorageServiceProvider', 'tmhDynamicLocaleProvider', '$translateProvider', '$translatePartialLoaderProvider', function($routeProvider, localStorageServiceProvider, tmhDynamicLocaleProvider, $translateProvider, $translatePartialLoaderProvider) {
localStorageServiceProvider.setStorageType('localStorage');
Expand Down Expand Up @@ -180,6 +181,20 @@
}]
}
})
.when('/settings/screensaver', {
templateUrl: 'app/settings/settings.screensaver.html',
controller: 'ScreensaverSettingsCtrl',
resolve: {
dashboards: ['PersistenceService', '$q', function (persistenceService, $q) {
var dashboards = persistenceService.getDashboards(true);
if (persistenceService.isEditingLocked()) return $q.reject("Editing is locked");
return dashboards;
}],
translations: ['TranslationService', function (TranslationService) {
return TranslationService.enterPart('admin');
}]
}
})
.otherwise({
redirectTo: '/'
});
Expand Down
13 changes: 11 additions & 2 deletions web/app/dashboard/dashboard.view.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
.module('app')
.controller('DashboardViewCtrl', DashboardViewController);

DashboardViewController.$inject = ['$scope', '$location', '$rootScope', '$routeParams', '$timeout', 'dashboard', 'PersistenceService', 'OHService', 'Fullscreen', 'snapRemote', 'SpeechService', 'TranslationService'];
function DashboardViewController($scope, $location, $rootScope, $routeParams, $timeout, dashboard, PersistenceService, OHService, Fullscreen, snapRemote, SpeechService, TranslationService) {
DashboardViewController.$inject = ['$scope', '$location', '$rootScope', '$routeParams', '$timeout', 'dashboard', 'PersistenceService', 'OHService', 'Fullscreen', 'snapRemote', 'SpeechService', 'TranslationService', 'ScreensaverService'];
function DashboardViewController($scope, $location, $rootScope, $routeParams, $timeout, dashboard, PersistenceService, OHService, Fullscreen, snapRemote, SpeechService, TranslationService, ScreensaverService) {
var vm = this;
vm.dashboard = dashboard;
vm.speakTooltip = TranslationService.translate('dashboard.toolbar.speak', 'Speak');
vm.refreshTooltip = TranslationService.translate('dashboard.toolbar.refresh', 'Refresh');
vm.fullscreenTooltip = TranslationService.translate('dashboard.toolbar.fullscreen', 'Fullscreen');
vm.screensaverToolTip = TranslationService.translate('dashboard.toolbar.screensaver', 'Screensaver');

vm.gridsterOptions = {
margins: (vm.dashboard.widget_margin) ?
Expand Down Expand Up @@ -73,6 +74,14 @@
$location.url("/edit/" + dashboard.id);
};

vm.startScreensaver = function() {
ScreensaverService.start(true);
}
vm.isScreensaverEnabled = function() {
return ScreensaverService.isEnabled;
}

vm.isScreensaverRunning = ScreensaverService.isRunning;

// Speech recognition
vm.isListening = false;
Expand Down
6 changes: 4 additions & 2 deletions web/app/dashboard/dashboard.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<a class="btn pull-left" title="Menu" snap-toggle="left">
<i class="glyphicon glyphicon-menu-hamburger"></i>
</a>

<a class="btn pull-right" ng-click="vm.goFullscreen()" title="{{vm.fullscreenTooltip}}" ng-if="!settings.hide_fullscreen_button && !vm.dashboard.header.use_custom_widget">
<i class="glyphicon glyphicon-resize-full"></i>
</a>
Expand All @@ -15,6 +14,9 @@
title="{{vm.speakTooltip}}">
<i class="glyphicon" ng-class="vm.isListening ? 'glyphicon-stop' : 'glyphicon-comment'"></i>
</a>
<a class="btn pull-right" ng-if="vm.isScreensaverEnabled()" ng-click="vm.startScreensaver()" title="{{vm.startscreensaverToolTip}}" ng-if="!settings.hide_screensaver_button && !vm.dashboard.header.use_custom_widget">
<i class="glyphicon glyphicon-play" ng-class="{'text-success':vm.isScreensaverRunning()}"></i>
</a>
<h2 class="dashboard-title" ng-if="!vm.dashboard.header.use_custom_widget">
<small class="header-clock" ng-if="settings.show_header_clock"><ds-widget-clock show-digital digital-format="settings.header_clock_format || 'shortTime'"></ds-widget-clock></small>
<span>{{vm.dashboard.name}}
Expand All @@ -40,7 +42,7 @@ <h2 class="dashboard-title" ng-if="!vm.dashboard.header.use_custom_widget">
tooltip-placement="top">
<i class="glyphicon" ng-class="vm.isListening ? 'glyphicon-stop' : 'glyphicon-comment'"></i>
</a>
<div class="scrollable" ng-show="vm.ready" gridster="vm.gridsterOptions">
<div class="scrollable widget-container" ng-show="vm.ready" gridster="vm.gridsterOptions">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New class? Is this needed?

<ul>
<li gridster-item="widget" ng-repeat="widget in vm.dashboard.widgets">
<div class="box" ng-style="{'font-size': vm.dashboard.font_scale ? vm.dashboard.font_scale + '%' : undefined }">
Expand Down
Loading