From df6a6597916882068ddf6e41bafbaca94794762f Mon Sep 17 00:00:00 2001 From: xulongbiao <1151051851@qq.com> Date: Thu, 17 Feb 2022 14:31:01 +0800 Subject: [PATCH 1/5] announcement dev --- src/js/app.js | 7 +- .../core/directives/navbar/navbar.tpl.html | 127 +++++----- .../directives/top-header/top-header.tpl.html | 135 +++++----- .../notifications/notifications.service.js | 42 +++- .../configs/setup-sate/setup-state.config.js | 8 + .../announcement/announcement.tpl.html | 15 ++ .../controllers/loggedout/loggedout.tpl.html | 27 +- .../setup/controllers/login/login.tpl.html | 158 ++++++------ .../landing-page/landing-page.tpl.html | 219 ++++++++-------- .../settings.profile.tpl.html | 4 +- .../wallet-summary/wallet-summary.tpl.html | 214 +++++++++------- .../wallet/controllers/wallet/wallet.ctrl.js | 2 +- .../wallet-app-store-buttons.tpl.html | 15 +- .../stylesheets/bootstrap/_jumbotron.scss | 80 +++--- .../docs/static/less/bootstrap/jumbotron.less | 2 +- src/sass/theme/reset.scss | 233 +++++++++++++----- 16 files changed, 754 insertions(+), 534 deletions(-) create mode 100644 src/js/modules/setup/controllers/announcement/announcement.tpl.html 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..92e36ce1 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,88 @@
-
- +
- - diff --git a/src/js/modules/core/services/notifications/notifications.service.js b/src/js/modules/core/services/notifications/notifications.service.js index 373dbac1..35d5aaa2 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,50 @@ function isChrome() { return navigator.userAgent.match(/Chrome\/\d+/) !== null; + } + function announcementPromit(){ + if(!localStorage.getItem('date')){ + localStorage.setItem('date',Date.now()) + } + if(Date.now() - localStorage.getItem('date') >= 4*1000*60*60){ + 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{ + 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) + }) + },Date.now() - localStorage.getItem('date')) + } + + } 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..44c1e693 --- /dev/null +++ b/src/js/modules/setup/controllers/announcement/announcement.tpl.html @@ -0,0 +1,15 @@ +
+ +
+
+
{{'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 @@
-