auto update alert in footer
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
class BaseCtrl {
|
class BaseCtrl {
|
||||||
constructor(syncManager, dbManager, analyticsManager) {
|
constructor($rootScope, $scope, syncManager, dbManager, analyticsManager) {
|
||||||
dbManager.openDatabase(null, function(){
|
dbManager.openDatabase(null, function(){
|
||||||
// new database, delete syncToken so that items can be refetched entirely from server
|
// new database, delete syncToken so that items can be refetched entirely from server
|
||||||
syncManager.clearSyncToken();
|
syncManager.clearSyncToken();
|
||||||
syncManager.sync();
|
syncManager.sync();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$scope.onUpdateAvailable = function(version) {
|
||||||
|
$rootScope.$broadcast('new-update-available', version);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
angular.module('app.frontend')
|
angular.module('app.frontend')
|
||||||
.directive("header", function(authManager){
|
.directive("footer", function(authManager){
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
scope: {},
|
scope: {},
|
||||||
templateUrl: 'frontend/header.html',
|
templateUrl: 'frontend/footer.html',
|
||||||
replace: true,
|
replace: true,
|
||||||
controller: 'HeaderCtrl',
|
controller: 'FooterCtrl',
|
||||||
controllerAs: 'ctrl',
|
controllerAs: 'ctrl',
|
||||||
bindToController: true,
|
bindToController: true,
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ angular.module('app.frontend')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.controller('HeaderCtrl', function (authManager, modelManager, $timeout, dbManager, syncManager) {
|
.controller('FooterCtrl', function ($rootScope, authManager, modelManager, $timeout, dbManager, syncManager) {
|
||||||
|
|
||||||
this.user = authManager.user;
|
this.user = authManager.user;
|
||||||
|
|
||||||
@@ -78,4 +78,20 @@ angular.module('app.frontend')
|
|||||||
this.syncUpdated = function() {
|
this.syncUpdated = function() {
|
||||||
this.lastSyncDate = new Date();
|
this.lastSyncDate = new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$rootScope.$on("new-update-available", function(version){
|
||||||
|
$timeout(function(){
|
||||||
|
// timeout calls apply() which is needed
|
||||||
|
this.onNewUpdateAvailable();
|
||||||
|
}.bind(this))
|
||||||
|
}.bind(this))
|
||||||
|
|
||||||
|
this.onNewUpdateAvailable = function() {
|
||||||
|
this.newUpdateAvailable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.clickedNewUpdateAnnouncement = function() {
|
||||||
|
this.newUpdateAvailable = false;
|
||||||
|
alert("A new update is ready to install. Updates address performance and security issues, as well as bug fixes and feature enhancements. Simply quit Standard Notes and re-open it for the update to be applied.")
|
||||||
|
}
|
||||||
});
|
});
|
||||||
@@ -18,8 +18,8 @@ h2 {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
background-color: #d8d7d9;
|
background-color: #d8d7d9;
|
||||||
height: $header-height;
|
height: $footer-height;
|
||||||
max-height: $header-height;
|
max-height: $footer-height;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
color: $dark-gray;
|
color: $dark-gray;
|
||||||
@@ -84,13 +84,13 @@ p {
|
|||||||
background-color: $bg-color;
|
background-color: $bg-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
$header-height: 25px;
|
$footer-height: 25px;
|
||||||
|
|
||||||
$section-header-height: 70px;
|
$section-header-height: 70px;
|
||||||
|
|
||||||
.app {
|
.app {
|
||||||
// height: 100%;
|
// height: 100%;
|
||||||
height: calc(100% - #{$header-height});
|
height: calc(100% - #{$footer-height});
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
@@ -115,7 +115,7 @@ $section-header-height: 70px;
|
|||||||
.section {
|
.section {
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
max-height: calc(100vh - #{$header-height});
|
max-height: calc(100vh - #{$footer-height});
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
|
|
||||||
.scrollable {
|
.scrollable {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.scrollable {
|
.scrollable {
|
||||||
height: calc(100vh - (#{$notes-title-bar-height} + #{$header-height}));
|
height: calc(100vh - (#{$notes-title-bar-height} + #{$footer-height}));
|
||||||
}
|
}
|
||||||
|
|
||||||
.infinite-scroll {
|
.infinite-scroll {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.scrollable {
|
.scrollable {
|
||||||
height: calc(100vh - (#{$tags-title-bar-height} + #{$header-height}));
|
height: calc(100vh - (#{$tags-title-bar-height} + #{$footer-height}));
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ $dark-gray: #2e2e2e;
|
|||||||
@import "app/standard";
|
@import "app/standard";
|
||||||
@import "app/main";
|
@import "app/main";
|
||||||
@import "app/ui";
|
@import "app/ui";
|
||||||
@import "app/header";
|
@import "app/footer";
|
||||||
@import "app/tags";
|
@import "app/tags";
|
||||||
@import "app/notes";
|
@import "app/notes";
|
||||||
@import "app/editor";
|
@import "app/editor";
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
|
|
||||||
.pull-right
|
.pull-right
|
||||||
|
|
||||||
|
.footer-bar-link{"ng-if" => "ctrl.newUpdateAvailable", "ng-click" => "ctrl.clickedNewUpdateAnnouncement()"}
|
||||||
|
%span.blue.normal New update downloaded. Installs on app restart.
|
||||||
|
|
||||||
.footer-bar-link{"style" => "margin-right: 5px;"}
|
.footer-bar-link{"style" => "margin-right: 5px;"}
|
||||||
%div{"ng-if" => "ctrl.lastSyncDate", "style" => "float: left; font-weight: normal; margin-right: 8px;"}
|
%div{"ng-if" => "ctrl.lastSyncDate", "style" => "float: left; font-weight: normal; margin-right: 8px;"}
|
||||||
%span{"ng-if" => "!ctrl.isRefreshing"}
|
%span{"ng-if" => "!ctrl.isRefreshing"}
|
||||||
@@ -7,4 +7,4 @@
|
|||||||
|
|
||||||
%editor-section{"note" => "selectedNote", "remove" => "deleteNote", "save" => "saveNote", "update-tags" => "updateTagsForNote"}
|
%editor-section{"note" => "selectedNote", "remove" => "deleteNote", "save" => "saveNote", "update-tags" => "updateTagsForNote"}
|
||||||
|
|
||||||
%header
|
%footer
|
||||||
|
|||||||
Reference in New Issue
Block a user