diff --git a/src/js/app.js b/src/js/app.js index 308450f4..f5cfc1ce 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -39,12 +39,10 @@ angular.module("blocktrail.wallet").config(function() { }); angular.module("blocktrail.wallet").run( - function($rootScope, $state, $log, $interval, $timeout, $locale, $translate, CONFIG, amMoment, blocktrailLocalisation, sdkService) { + function($rootScope, $state, $log, $interval, $timeout, $locale, $translate, CONFIG, amMoment, blocktrailLocalisation, sdkService,NotificationsService) { var bodyStateClasses = []; var networkClassType = ""; - $rootScope.sdkReadOnlySdkData = sdkService.getReadOnlySdkData(); - $rootScope.CONFIG = CONFIG || {}; $rootScope.$state = $state; $rootScope.appVersion = CONFIG.VERSION || CONFIG.VERSION_REV; @@ -65,8 +63,9 @@ angular.module("blocktrail.wallet").run( amMoment.changeLocale(momentLocale); $translate.use(language); + NotificationsService.announcementPromit() }; - + $rootScope.$watch("sdkReadOnlySdkData.networkType", function(newValue) { var network = CONFIG.NETWORKS[newValue].NETWORK; if (network.substr(0, 1) === "t" || network.substr(0, 1) === "r") { diff --git a/src/js/modules/core/directives/navbar/navbar.tpl.html b/src/js/modules/core/directives/navbar/navbar.tpl.html index cd13267b..1167ed57 100644 --- a/src/js/modules/core/directives/navbar/navbar.tpl.html +++ b/src/js/modules/core/directives/navbar/navbar.tpl.html @@ -1,68 +1,75 @@ - - diff --git a/src/js/modules/core/directives/top-header/top-header.tpl.html b/src/js/modules/core/directives/top-header/top-header.tpl.html index 9f23fd5c..fbc0bc6c 100644 --- a/src/js/modules/core/directives/top-header/top-header.tpl.html +++ b/src/js/modules/core/directives/top-header/top-header.tpl.html @@ -1,63 +1,86 @@
-
- +
- - diff --git a/src/js/modules/core/services/notifications/notifications.service.js b/src/js/modules/core/services/notifications/notifications.service.js index 373dbac1..3f5714b1 100644 --- a/src/js/modules/core/services/notifications/notifications.service.js +++ b/src/js/modules/core/services/notifications/notifications.service.js @@ -4,7 +4,7 @@ angular.module('blocktrail.core') .factory('NotificationsService', NotificationsService); - function NotificationsService(CONFIG, dialogService, settingsService, $translate, $log) { + function NotificationsService(CONFIG, dialogService, settingsService, $translate, $log,$sce) { var settingsData = settingsService.getReadOnlySettingsData(); @@ -78,12 +78,57 @@ function isChrome() { return navigator.userAgent.match(/Chrome\/\d+/) !== null; + } + function announcementPromit(timer){ + var currentDate = Date.now() + if(!localStorage.getItem('date')){ + localStorage.setItem('date',currentDate) + } + + if((currentDate - localStorage.getItem('date') >= 4*1000*60*60) || currentDate===Number(localStorage.getItem('date'))){ + console.log(4*1000*60*60 - currentDate + localStorage.getItem('date'),2222) + dialogService.alert( + { + title: $translate.instant('WALL_ANNOUNCEMENT_DIALOG'), + bodyHtml: $sce.trustAsHtml($translate.instant('WALL_ANNOUNCEMENT_INFO')+''+$translate.instant('WALL_ANNOUNCEMENT_VIEW')+''), + ok: $translate.instant('OK') + } + ).result.then(function(){ + localStorage.setItem('date',Date.now()) + setTimeout(function(){ + announcementPromit() + },4*1000*60*60) + }) + } + else{ + console.log(4*1000*60*60 -(Date.now() - localStorage.getItem('date')),1111) + clearTimeout(localStorage.getItem('timer')) + const timer=setTimeout(function(){ + + dialogService.alert( + { + title: $translate.instant('WALL_ANNOUNCEMENT_DIALOG'), + bodyHtml: $sce.trustAsHtml($translate.instant('WALL_ANNOUNCEMENT_INFO')+''+$translate.instant('WALL_ANNOUNCEMENT_VIEW')+''), + ok: $translate.instant('OK') + } + ).result.then(function(){ + localStorage.setItem('date',Date.now()) + setTimeout(function(){ + announcementPromit() + },4*1000*60*60) + }) + }, 4*1000*60*60 -(currentDate - localStorage.getItem('date'))) + localStorage.setItem('timer',timer) + } + + } return { checkAndPromptSimplex: checkAndPromptSimplex, checkAndPromptBitcoinURIHandler: checkAndPromptBitcoinURIHandler, - promptBitcoinURIHandler: promptBitcoinURIHandler + promptBitcoinURIHandler: promptBitcoinURIHandler, + announcementPromit:announcementPromit }; } diff --git a/src/js/modules/setup/configs/setup-sate/setup-state.config.js b/src/js/modules/setup/configs/setup-sate/setup-state.config.js index 705c5b18..cc1512ef 100644 --- a/src/js/modules/setup/configs/setup-sate/setup-state.config.js +++ b/src/js/modules/setup/configs/setup-sate/setup-state.config.js @@ -34,6 +34,14 @@ preferredLanguage: preferredLanguage } }) + .state("app.announcement", { + url: "/announcement", + cache: false, + templateUrl: "js/modules/setup/controllers/announcement/announcement.tpl.html", + resolve: { + preferredLanguage: preferredLanguage + } + }) .state("app.setup", { url: "/setup", abstract: true, diff --git a/src/js/modules/setup/controllers/announcement/announcement.tpl.html b/src/js/modules/setup/controllers/announcement/announcement.tpl.html new file mode 100644 index 00000000..3699bacd --- /dev/null +++ b/src/js/modules/setup/controllers/announcement/announcement.tpl.html @@ -0,0 +1,16 @@ +
+ +
+
+
{{'WALL_ANNOUNCEMENT_TITLE' | translate }}
+
{{'WALL_ANNOUNCEMENT_DATE' | translate }}
+
{{'WALL_ANNOUNCEMENT_BEGIN' | translate }}
+

+
{{'WALL_ANNOUNCEMENT_END' | translate }}
+ +
+
+
+ + +
diff --git a/src/js/modules/setup/controllers/loggedout/loggedout.tpl.html b/src/js/modules/setup/controllers/loggedout/loggedout.tpl.html index 6fad3c06..8ee204df 100644 --- a/src/js/modules/setup/controllers/loggedout/loggedout.tpl.html +++ b/src/js/modules/setup/controllers/loggedout/loggedout.tpl.html @@ -1,24 +1,15 @@
- + -
-
-
-

{{'LOGGED_OUT_CONFIRMATION_TITLE' | translate }}

-
+
+
+
+

{{'LOGGED_OUT_CONFIRMATION_TITLE' | translate }}

+
-

{{'LOGGED_OUT_CONFIRMATION_TEXT' | translate }}

- -
+
+
-
+
- diff --git a/src/js/modules/setup/controllers/login/login.tpl.html b/src/js/modules/setup/controllers/login/login.tpl.html index d1888851..fc7251b5 100644 --- a/src/js/modules/setup/controllers/login/login.tpl.html +++ b/src/js/modules/setup/controllers/login/login.tpl.html @@ -1,80 +1,96 @@ -
-
- -
- {{ error | translate }} -
- {{ errorDetailed }} -
-
- - -
+
+ +
+ {{ error | translate }} +
{{ errorDetailed }}
+
- + +
+ - -
- -
- - -
-
{{ 'MSG_MISSING_PASSWORD' | translate }}
-
-
+ +
+ +
+ + +
+
+ {{ 'MSG_MISSING_PASSWORD' | translate }} +
+
+
- -
-
- -
-
+ +
+
+ +
+
-
- -
+
+ +
- -
- -
- -
+ +
+ +
+ +
-
- + diff --git a/src/js/modules/setup/directives/landing-page/landing-page.tpl.html b/src/js/modules/setup/directives/landing-page/landing-page.tpl.html index b824ddf3..bfd2f585 100644 --- a/src/js/modules/setup/directives/landing-page/landing-page.tpl.html +++ b/src/js/modules/setup/directives/landing-page/landing-page.tpl.html @@ -1,132 +1,119 @@
-