Merge remote-tracking branch 'origin/frontend' into develop
|
|
@ -46,6 +46,18 @@
|
|||
"COMPLETE": "Completion",
|
||||
"SYNCING": "Syncing blockchain",
|
||||
"LOADING": "Loading blockchain data"
|
||||
},
|
||||
"UPDATE": {
|
||||
"STANDARD": "Update available",
|
||||
"STANDARD_TOOLTIP": "<span class=\"standard-update\">Get new update.</span><br><span>Update is recommended!</span>",
|
||||
"IMPORTANT": "Update available",
|
||||
"IMPORTANT_HINT": "Important update!",
|
||||
"IMPORTANT_TOOLTIP": "<span class=\"important-update\">Get new update.</span><br><span>Important update!</span>",
|
||||
"CRITICAL": "Update available",
|
||||
"CRITICAL_HINT": "Critical update!",
|
||||
"CRITICAL_TOOLTIP": "<span class=\"critical-update\">Critical update available.</span><i class=\"icon\"></i><span>Update strongly recommended!</span>",
|
||||
"TIME": "System time differs from network",
|
||||
"TIME_TOOLTIP": "<span class=\"wrong-time\">Wrong system time!</span><br><span>Check and repair your system time.</span>"
|
||||
}
|
||||
},
|
||||
"MAIN": {
|
||||
|
|
|
|||
10
src/gui/qt-daemon/html/assets/icons/time.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M16.7,18.5L10,12.9V4h4v7.1l5.3,4.4L16.7,18.5z
|
||||
"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 540 B |
9
src/gui/qt-daemon/html/assets/icons/update-alert.svg
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M50,0C22.4,0,0,22.4,0,50s22.4,50,50,50s50-22.4,50-50S77.6,0,50,0z M54,70h-8v-8h8V70z M54,58h-8V30h8V58z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 538 B |
12
src/gui/qt-daemon/html/assets/icons/update.svg
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M24,11L23,0l-3.1,3.1C17.8,1.2,15.1,0,12,0C6.1,0,1.1,4.3,0.2,10h4.1c0.9-3.4,4-6,7.7-6c2,0,3.7,0.7,5.1,1.9
|
||||
L14,9L24,11z"/>
|
||||
<path class="st0" d="M0,13l1,11l3.1-3.1C6.2,22.8,8.9,24,12,24c5.9,0,10.9-4.3,11.8-10h-4.1c-0.9,3.4-4,6-7.7,6
|
||||
c-2,0-3.7-0.7-5.1-1.9L10,15L0,13z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 696 B |
|
|
@ -375,9 +375,9 @@ input[type='checkbox'].style-checkbox {
|
|||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: -2rem;
|
||||
left: calc(50% - 1rem);
|
||||
border-width: 1rem;
|
||||
bottom: -1rem;
|
||||
left: calc(50% - 0.5rem);
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
|
|
@ -394,11 +394,11 @@ input[type='checkbox'].style-checkbox {
|
|||
position: absolute;
|
||||
bottom: -1rem;
|
||||
left: 0.7rem;
|
||||
border-width: 1rem 1rem 0 0;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: themed(tooltipBackgroundColor) transparent transparent transparent;
|
||||
border-color: themed(tooltipBackgroundColor) transparent transparent themed(tooltipBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -426,9 +426,9 @@ input[type='checkbox'].style-checkbox {
|
|||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -2rem;
|
||||
left: calc(50% - 1rem);
|
||||
border-width: 1rem;
|
||||
top: -1rem;
|
||||
left: calc(50% - 0.5rem);
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
|
|
@ -477,13 +477,13 @@ input[type='checkbox'].style-checkbox {
|
|||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
top: calc(50% - 0.5rem);
|
||||
right: -1rem;
|
||||
border-width: 1rem 1rem 0 0;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: themed(tooltipBackgroundColor) transparent transparent transparent;
|
||||
border-color: transparent transparent transparent themed(tooltipBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -494,13 +494,13 @@ input[type='checkbox'].style-checkbox {
|
|||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
top: calc(50% - 0.5rem);
|
||||
left: -1rem;
|
||||
border-width: 1rem 0 0 1rem;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: themed(tooltipBackgroundColor) transparent transparent transparent;
|
||||
border-color: transparent themed(tooltipBackgroundColor) transparent transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -589,6 +589,162 @@ input[type='checkbox'].style-checkbox {
|
|||
}
|
||||
}
|
||||
|
||||
.update-tooltip {
|
||||
padding: 1.5rem;
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(tooltipBackgroundColor);
|
||||
box-shadow: themed(tooltipShadow);
|
||||
color: themed(mainTextColor);
|
||||
}
|
||||
|
||||
&.important {
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(tooltipImportantBackgroundColor);
|
||||
color: themed(accountMainTextColor);
|
||||
}
|
||||
|
||||
&.ng-tooltip-left-bottom {
|
||||
|
||||
&:after {
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent transparent themed(tooltipImportantBackgroundColor) themed(tooltipImportantBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ng-tooltip-right-bottom {
|
||||
|
||||
&:before {
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent themed(tooltipImportantBackgroundColor) themed(tooltipImportantBackgroundColor) transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.critical {
|
||||
padding: 2.5rem;
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(tooltipCriticalBackgroundColor);
|
||||
color: themed(accountMainTextColor);
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&.ng-tooltip-left-bottom {
|
||||
|
||||
&:after {
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent transparent themed(tooltipCriticalBackgroundColor) themed(tooltipCriticalBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ng-tooltip-right-bottom {
|
||||
|
||||
&:before {
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent themed(tooltipCriticalBackgroundColor) themed(tooltipCriticalBackgroundColor) transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
font-size: 1.3rem;
|
||||
line-height: 1.8rem;
|
||||
white-space: pre-wrap;
|
||||
|
||||
.standard-update {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2.7rem;
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.important-update {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2.7rem;
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(tooltipImportantTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.critical-update {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2.7rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wrong-time {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2.7rem;
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(tooltipImportantTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin: 1.5rem 0;
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(tooltipCriticalTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ng-tooltip-left-bottom {
|
||||
margin-left: -1.5rem;
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0.6rem;
|
||||
right: -1rem;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent transparent themed(tooltipBackgroundColor) themed(tooltipBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ng-tooltip-right-bottom {
|
||||
margin-left: 1.5rem;
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0.6rem;
|
||||
left: -1rem;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent themed(tooltipBackgroundColor) themed(tooltipBackgroundColor) transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ngx-contextmenu {
|
||||
|
||||
.dropdown-menu {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ $themes: (
|
|||
optionalTextColor: #556576,
|
||||
blueTextColor: #4db1ff,
|
||||
greenTextColor: #5cda9d,
|
||||
orangeTextColor: #ff6f00,
|
||||
redTextColor: #ff5252,
|
||||
blueButtonBackgroundColor: #4db1ff,
|
||||
blueButtonHoverColor: #82d7ff,
|
||||
|
|
@ -46,6 +47,10 @@ $themes: (
|
|||
chartOptionsBackgroundColor: #2b3644,
|
||||
chartOptionsHoverColor: #556576,
|
||||
tooltipBackgroundColor: #42505f,
|
||||
tooltipImportantTextColor: #ff6f00,
|
||||
tooltipImportantBackgroundColor: #5f2b11,
|
||||
tooltipCriticalTextColor: #ff5252,
|
||||
tooltipCriticalBackgroundColor: #5f1d1d,
|
||||
tooltipShadow: 0 0 1rem rgba(0, 0, 0, 0.5),
|
||||
modalBackground: url(~src/assets/images/background-dark.png),
|
||||
closeButtonColor: #556576
|
||||
|
|
@ -62,6 +67,7 @@ $themes: (
|
|||
optionalTextColor: #565c62,
|
||||
blueTextColor: #42a5f5,
|
||||
greenTextColor: #47cf8d,
|
||||
orangeTextColor: #ff6f00,
|
||||
redTextColor: #ff5252,
|
||||
blueButtonBackgroundColor: #42a5f5,
|
||||
blueButtonHoverColor: #86d6ff,
|
||||
|
|
@ -97,6 +103,10 @@ $themes: (
|
|||
chartOptionsBackgroundColor: #292d31,
|
||||
chartOptionsHoverColor: #515960,
|
||||
tooltipBackgroundColor: #3e464c,
|
||||
tooltipImportantTextColor: #ff6f00,
|
||||
tooltipImportantBackgroundColor: #55240d,
|
||||
tooltipCriticalTextColor: #ff5252,
|
||||
tooltipCriticalBackgroundColor: #4c1919,
|
||||
tooltipShadow: 0 0 1rem rgba(0, 0, 0, 0.5),
|
||||
modalBackground: url(~src/assets/images/background-gray.png),
|
||||
closeButtonColor: #515960
|
||||
|
|
@ -113,6 +123,7 @@ $themes: (
|
|||
optionalTextColor: #a0a5ab,
|
||||
blueTextColor: #2c95f1,
|
||||
greenTextColor: #46c172,
|
||||
orangeTextColor: #ff6f00,
|
||||
redTextColor: #ff5252,
|
||||
blueButtonBackgroundColor: #2c95f1,
|
||||
blueButtonHoverColor: #5cb3ff,
|
||||
|
|
@ -148,6 +159,10 @@ $themes: (
|
|||
chartOptionsBackgroundColor: #e0e0e0,
|
||||
chartOptionsHoverColor: #ffffff,
|
||||
tooltipBackgroundColor: #ffffff,
|
||||
tooltipImportantTextColor: #ffffff,
|
||||
tooltipImportantBackgroundColor: #ef6c00,
|
||||
tooltipCriticalTextColor: #ffffff,
|
||||
tooltipCriticalBackgroundColor: #e53935,
|
||||
tooltipShadow: 0 0 1rem rgba(120, 120, 120, 0.5),
|
||||
modalBackground: url(~src/assets/images/background-white.png),
|
||||
closeButtonColor: #43454b
|
||||
|
|
|
|||
|
|
@ -202,31 +202,93 @@ app-sidebar {
|
|||
background-color: themed(onlineColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.progress-bar-container {
|
||||
.progress-bar-container {
|
||||
|
||||
.syncing {
|
||||
.syncing {
|
||||
|
||||
.progress-bar {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarBackgroundColor);
|
||||
}
|
||||
|
||||
.fill {
|
||||
.progress-bar {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarFullBackgroundColor);
|
||||
background-color: themed(progressBarBackgroundColor);
|
||||
}
|
||||
|
||||
.fill {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarFullBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
.loading {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarFullBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.update-container {
|
||||
|
||||
.standard {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarFullBackgroundColor);
|
||||
color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.important {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(orangeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.critical {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(redTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(orangeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
||||
&.standard {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.important {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(orangeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.critical {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(redTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.time {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(orangeTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -649,7 +649,7 @@ module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
var core = module.exports = { version: '2.6.2' };
|
||||
var core = module.exports = { version: '2.6.1' };
|
||||
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
|
||||
|
||||
|
||||
|
|
@ -1807,7 +1807,7 @@ var store = global[SHARED] || (global[SHARED] = {});
|
|||
})('versions', []).push({
|
||||
version: core.version,
|
||||
mode: __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") ? 'pure' : 'global',
|
||||
copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
|
||||
copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -2364,6 +2364,7 @@ $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
|
|||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
var Zone$1 = (function (global) {
|
||||
var FUNCTION = 'function';
|
||||
var performance = global['performance'];
|
||||
function mark(name) {
|
||||
performance && performance['mark'] && performance['mark'](name);
|
||||
|
|
@ -2372,26 +2373,12 @@ var Zone$1 = (function (global) {
|
|||
performance && performance['measure'] && performance['measure'](name, label);
|
||||
}
|
||||
mark('Zone');
|
||||
var checkDuplicate = global[('__zone_symbol__forceDuplicateZoneCheck')] === true;
|
||||
if (global['Zone']) {
|
||||
// if global['Zone'] already exists (maybe zone.js was already loaded or
|
||||
// some other lib also registered a global object named Zone), we may need
|
||||
// to throw an error, but sometimes user may not want this error.
|
||||
// For example,
|
||||
// we have two web pages, page1 includes zone.js, page2 doesn't.
|
||||
// and the 1st time user load page1 and page2, everything work fine,
|
||||
// but when user load page2 again, error occurs because global['Zone'] already exists.
|
||||
// so we add a flag to let user choose whether to throw this error or not.
|
||||
// By default, if existing Zone is from zone.js, we will not throw the error.
|
||||
if (checkDuplicate || typeof global['Zone'].__symbol__ !== 'function') {
|
||||
throw new Error('Zone already loaded.');
|
||||
}
|
||||
else {
|
||||
return global['Zone'];
|
||||
}
|
||||
throw new Error('Zone already loaded.');
|
||||
}
|
||||
var Zone = /** @class */ (function () {
|
||||
function Zone(parent, zoneSpec) {
|
||||
this._properties = null;
|
||||
this._parent = parent;
|
||||
this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '<root>';
|
||||
this._properties = zoneSpec && zoneSpec.properties || {};
|
||||
|
|
@ -2434,9 +2421,7 @@ var Zone$1 = (function (global) {
|
|||
});
|
||||
Zone.__load_patch = function (name, fn) {
|
||||
if (patches.hasOwnProperty(name)) {
|
||||
if (checkDuplicate) {
|
||||
throw Error('Already loaded patch: ' + name);
|
||||
}
|
||||
throw Error('Already loaded patch: ' + name);
|
||||
}
|
||||
else if (!global['__Zone_disable_' + name]) {
|
||||
var perfName = 'Zone:' + name;
|
||||
|
|
@ -2480,7 +2465,7 @@ var Zone$1 = (function (global) {
|
|||
return this._zoneDelegate.fork(this, zoneSpec);
|
||||
};
|
||||
Zone.prototype.wrap = function (callback, source) {
|
||||
if (typeof callback !== 'function') {
|
||||
if (typeof callback !== FUNCTION) {
|
||||
throw new Error('Expecting function got: ' + callback);
|
||||
}
|
||||
var _callback = this._zoneDelegate.intercept(this, callback, source);
|
||||
|
|
@ -2490,6 +2475,9 @@ var Zone$1 = (function (global) {
|
|||
};
|
||||
};
|
||||
Zone.prototype.run = function (callback, applyThis, applyArgs, source) {
|
||||
if (applyThis === void 0) { applyThis = undefined; }
|
||||
if (applyArgs === void 0) { applyArgs = null; }
|
||||
if (source === void 0) { source = null; }
|
||||
_currentZoneFrame = { parent: _currentZoneFrame, zone: this };
|
||||
try {
|
||||
return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);
|
||||
|
|
@ -2500,6 +2488,8 @@ var Zone$1 = (function (global) {
|
|||
};
|
||||
Zone.prototype.runGuarded = function (callback, applyThis, applyArgs, source) {
|
||||
if (applyThis === void 0) { applyThis = null; }
|
||||
if (applyArgs === void 0) { applyArgs = null; }
|
||||
if (source === void 0) { source = null; }
|
||||
_currentZoneFrame = { parent: _currentZoneFrame, zone: this };
|
||||
try {
|
||||
try {
|
||||
|
|
@ -2523,7 +2513,10 @@ var Zone$1 = (function (global) {
|
|||
// https://github.com/angular/zone.js/issues/778, sometimes eventTask
|
||||
// will run in notScheduled(canceled) state, we should not try to
|
||||
// run such kind of task but just return
|
||||
if (task.state === notScheduled && (task.type === eventTask || task.type === macroTask)) {
|
||||
// we have to define an variable here, if not
|
||||
// typescript compiler will complain below
|
||||
var isNotScheduled = task.state === notScheduled;
|
||||
if (isNotScheduled && task.type === eventTask) {
|
||||
return;
|
||||
}
|
||||
var reEntryGuard = task.state != running;
|
||||
|
|
@ -2534,7 +2527,7 @@ var Zone$1 = (function (global) {
|
|||
_currentZoneFrame = { parent: _currentZoneFrame, zone: this };
|
||||
try {
|
||||
if (task.type == macroTask && task.data && !task.data.isPeriodic) {
|
||||
task.cancelFn = undefined;
|
||||
task.cancelFn = null;
|
||||
}
|
||||
try {
|
||||
return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs);
|
||||
|
|
@ -2570,7 +2563,8 @@ var Zone$1 = (function (global) {
|
|||
var newZone = this;
|
||||
while (newZone) {
|
||||
if (newZone === task.zone) {
|
||||
throw Error("can not reschedule task to " + this.name + " which is descendants of the original zone " + task.zone.name);
|
||||
throw Error("can not reschedule task to " + this
|
||||
.name + " which is descendants of the original zone " + task.zone.name);
|
||||
}
|
||||
newZone = newZone.parent;
|
||||
}
|
||||
|
|
@ -2600,7 +2594,7 @@ var Zone$1 = (function (global) {
|
|||
return task;
|
||||
};
|
||||
Zone.prototype.scheduleMicroTask = function (source, callback, data, customSchedule) {
|
||||
return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, undefined));
|
||||
return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, null));
|
||||
};
|
||||
Zone.prototype.scheduleMacroTask = function (source, callback, data, customSchedule, customCancel) {
|
||||
return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));
|
||||
|
|
@ -2641,14 +2635,16 @@ var Zone$1 = (function (global) {
|
|||
}());
|
||||
var DELEGATE_ZS = {
|
||||
name: '',
|
||||
onHasTask: function (delegate, _, target, hasTaskState) { return delegate.hasTask(target, hasTaskState); },
|
||||
onHasTask: function (delegate, _, target, hasTaskState) {
|
||||
return delegate.hasTask(target, hasTaskState);
|
||||
},
|
||||
onScheduleTask: function (delegate, _, target, task) {
|
||||
return delegate.scheduleTask(target, task);
|
||||
},
|
||||
onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) {
|
||||
return delegate.invokeTask(target, task, applyThis, applyArgs);
|
||||
},
|
||||
onCancelTask: function (delegate, _, target, task) { return delegate.cancelTask(target, task); }
|
||||
onInvokeTask: function (delegate, _, target, task, applyThis, applyArgs) { return delegate.invokeTask(target, task, applyThis, applyArgs); },
|
||||
onCancelTask: function (delegate, _, target, task) {
|
||||
return delegate.cancelTask(target, task);
|
||||
}
|
||||
};
|
||||
var ZoneDelegate = /** @class */ (function () {
|
||||
function ZoneDelegate(zone, parentDelegate, zoneSpec) {
|
||||
|
|
@ -2676,8 +2672,8 @@ var Zone$1 = (function (global) {
|
|||
zoneSpec && (zoneSpec.onHandleError ? this.zone : parentDelegate.zone);
|
||||
this._scheduleTaskZS =
|
||||
zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);
|
||||
this._scheduleTaskDlgt = zoneSpec &&
|
||||
(zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);
|
||||
this._scheduleTaskDlgt =
|
||||
zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);
|
||||
this._scheduleTaskCurrZone =
|
||||
zoneSpec && (zoneSpec.onScheduleTask ? this.zone : parentDelegate.zone);
|
||||
this._invokeTaskZS =
|
||||
|
|
@ -2732,7 +2728,8 @@ var Zone$1 = (function (global) {
|
|||
callback;
|
||||
};
|
||||
ZoneDelegate.prototype.invoke = function (targetZone, callback, applyThis, applyArgs, source) {
|
||||
return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :
|
||||
return this._invokeZS ?
|
||||
this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) :
|
||||
callback.apply(applyThis, applyArgs);
|
||||
};
|
||||
ZoneDelegate.prototype.handleError = function (targetZone, error) {
|
||||
|
|
@ -2764,7 +2761,8 @@ var Zone$1 = (function (global) {
|
|||
return returnTask;
|
||||
};
|
||||
ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) {
|
||||
return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :
|
||||
return this._invokeTaskZS ?
|
||||
this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) :
|
||||
task.callback.apply(applyThis, applyArgs);
|
||||
};
|
||||
ZoneDelegate.prototype.cancelTask = function (targetZone, task) {
|
||||
|
|
@ -2784,7 +2782,7 @@ var Zone$1 = (function (global) {
|
|||
// hasTask should not throw error so other ZoneDelegate
|
||||
// can still trigger hasTask callback
|
||||
try {
|
||||
this._hasTaskZS &&
|
||||
return this._hasTaskZS &&
|
||||
this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);
|
||||
}
|
||||
catch (err) {
|
||||
|
|
@ -2874,12 +2872,14 @@ var Zone$1 = (function (global) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
throw new Error(this.type + " '" + this.source + "': can not transition to '" + toState + "', expecting state '" + fromState1 + "'" + (fromState2 ? ' or \'' + fromState2 + '\'' : '') + ", was '" + this._state + "'.");
|
||||
throw new Error(this.type + " '" + this.source + "': can not transition to '" + toState + "', expecting state '" + fromState1 + "'" + (fromState2 ?
|
||||
' or \'' + fromState2 + '\'' :
|
||||
'') + ", was '" + this._state + "'.");
|
||||
}
|
||||
};
|
||||
ZoneTask.prototype.toString = function () {
|
||||
if (this.data && typeof this.data.handleId !== 'undefined') {
|
||||
return this.data.handleId.toString();
|
||||
return this.data.handleId;
|
||||
}
|
||||
else {
|
||||
return Object.prototype.toString.call(this);
|
||||
|
|
@ -2920,13 +2920,7 @@ var Zone$1 = (function (global) {
|
|||
}
|
||||
}
|
||||
if (nativeMicroTaskQueuePromise) {
|
||||
var nativeThen = nativeMicroTaskQueuePromise[symbolThen];
|
||||
if (!nativeThen) {
|
||||
// native Promise is not patchable, we need to use `then` directly
|
||||
// issue 1078
|
||||
nativeThen = nativeMicroTaskQueuePromise['then'];
|
||||
}
|
||||
nativeThen.call(nativeMicroTaskQueuePromise, drainMicroTaskQueue);
|
||||
nativeMicroTaskQueuePromise[symbolThen](drainMicroTaskQueue);
|
||||
}
|
||||
else {
|
||||
global[symbolSetTimeout](drainMicroTaskQueue, 0);
|
||||
|
|
@ -2973,13 +2967,12 @@ var Zone$1 = (function (global) {
|
|||
patchEventTarget: function () { return []; },
|
||||
patchOnProperties: noop,
|
||||
patchMethod: function () { return noop; },
|
||||
bindArguments: function () { return []; },
|
||||
patchThen: function () { return noop; },
|
||||
bindArguments: function () { return null; },
|
||||
setNativePromise: function (NativePromise) {
|
||||
// sometimes NativePromise.resolve static function
|
||||
// is not ready yet, (such as core-js/es6.promise)
|
||||
// so we need to check here.
|
||||
if (NativePromise && typeof NativePromise.resolve === 'function') {
|
||||
if (NativePromise && typeof NativePromise.resolve === FUNCTION) {
|
||||
nativeMicroTaskQueuePromise = NativePromise.resolve(0);
|
||||
}
|
||||
},
|
||||
|
|
@ -2995,16 +2988,6 @@ var Zone$1 = (function (global) {
|
|||
return global['Zone'] = Zone;
|
||||
})(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global);
|
||||
|
||||
var __values = (undefined && undefined.__values) || function (o) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
|
||||
if (m) return m.call(o);
|
||||
return {
|
||||
next: function () {
|
||||
if (o && i >= o.length) o = void 0;
|
||||
return { value: o && o[i++], done: !o };
|
||||
}
|
||||
};
|
||||
};
|
||||
Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
||||
var ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
||||
var ObjectDefineProperty = Object.defineProperty;
|
||||
|
|
@ -3147,7 +3130,7 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
var queue = promise[symbolValue];
|
||||
promise[symbolValue] = value;
|
||||
if (promise[symbolFinally] === symbolFinally) {
|
||||
// the promise is generated by Promise.prototype.finally
|
||||
// the promise is generated by Promise.prototype.finally
|
||||
if (state === RESOLVED) {
|
||||
// the state is resolved, should ignore the value
|
||||
// and use parent promise value
|
||||
|
|
@ -3231,9 +3214,7 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
chainPromise[symbolParentPromiseState] = promiseState;
|
||||
}
|
||||
// should not pass value to finally callback
|
||||
var value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ?
|
||||
[] :
|
||||
[parentPromiseValue]);
|
||||
var value = zone.run(delegate, undefined, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ? [] : [parentPromiseValue]);
|
||||
resolvePromise(chainPromise, true, value);
|
||||
}
|
||||
catch (error) {
|
||||
|
|
@ -3268,7 +3249,6 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
return resolvePromise(new this(null), REJECTED, error);
|
||||
};
|
||||
ZoneAwarePromise.race = function (values) {
|
||||
var e_1, _a;
|
||||
var resolve;
|
||||
var reject;
|
||||
var promise = new this(function (res, rej) {
|
||||
|
|
@ -3281,70 +3261,40 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
function onReject(error) {
|
||||
promise && (promise = false || reject(error));
|
||||
}
|
||||
try {
|
||||
for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
|
||||
var value = values_1_1.value;
|
||||
if (!isThenable(value)) {
|
||||
value = this.resolve(value);
|
||||
}
|
||||
value.then(onResolve, onReject);
|
||||
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {
|
||||
var value = values_1[_i];
|
||||
if (!isThenable(value)) {
|
||||
value = this.resolve(value);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
value.then(onResolve, onReject);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
ZoneAwarePromise.all = function (values) {
|
||||
var e_2, _a;
|
||||
var resolve;
|
||||
var reject;
|
||||
var promise = new this(function (res, rej) {
|
||||
resolve = res;
|
||||
reject = rej;
|
||||
});
|
||||
// Start at 2 to prevent prematurely resolving if .then is called immediately.
|
||||
var unresolvedCount = 2;
|
||||
var valueIndex = 0;
|
||||
var count = 0;
|
||||
var resolvedValues = [];
|
||||
var _loop_2 = function (value) {
|
||||
for (var _i = 0, values_2 = values; _i < values_2.length; _i++) {
|
||||
var value = values_2[_i];
|
||||
if (!isThenable(value)) {
|
||||
value = this_1.resolve(value);
|
||||
value = this.resolve(value);
|
||||
}
|
||||
var curValueIndex = valueIndex;
|
||||
value.then(function (value) {
|
||||
resolvedValues[curValueIndex] = value;
|
||||
unresolvedCount--;
|
||||
if (unresolvedCount === 0) {
|
||||
value.then((function (index) { return function (value) {
|
||||
resolvedValues[index] = value;
|
||||
count--;
|
||||
if (!count) {
|
||||
resolve(resolvedValues);
|
||||
}
|
||||
}, reject);
|
||||
unresolvedCount++;
|
||||
valueIndex++;
|
||||
};
|
||||
var this_1 = this;
|
||||
try {
|
||||
for (var values_2 = __values(values), values_2_1 = values_2.next(); !values_2_1.done; values_2_1 = values_2.next()) {
|
||||
var value = values_2_1.value;
|
||||
_loop_2(value);
|
||||
}
|
||||
}; })(count), reject);
|
||||
count++;
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (values_2_1 && !values_2_1.done && (_a = values_2.return)) _a.call(values_2);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
// Make the unresolvedCount zero-based again.
|
||||
unresolvedCount -= 2;
|
||||
if (unresolvedCount === 0) {
|
||||
if (!count)
|
||||
resolve(resolvedValues);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) {
|
||||
|
|
@ -3440,112 +3390,31 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
|
|||
};
|
||||
Ctor[symbolThenPatched] = true;
|
||||
}
|
||||
api.patchThen = patchThen;
|
||||
function zoneify(fn) {
|
||||
return function () {
|
||||
var resultPromise = fn.apply(this, arguments);
|
||||
if (resultPromise instanceof ZoneAwarePromise) {
|
||||
return resultPromise;
|
||||
}
|
||||
var ctor = resultPromise.constructor;
|
||||
if (!ctor[symbolThenPatched]) {
|
||||
patchThen(ctor);
|
||||
}
|
||||
return resultPromise;
|
||||
};
|
||||
}
|
||||
if (NativePromise) {
|
||||
patchThen(NativePromise);
|
||||
var fetch_1 = global['fetch'];
|
||||
if (typeof fetch_1 == 'function') {
|
||||
global['fetch'] = zoneify(fetch_1);
|
||||
}
|
||||
}
|
||||
// This is not part of public API, but it is useful for tests, so we expose it.
|
||||
Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors;
|
||||
return ZoneAwarePromise;
|
||||
});
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
Zone.__load_patch('fetch', function (global, Zone, api) {
|
||||
var fetch = global['fetch'];
|
||||
var ZoneAwarePromise = global.Promise;
|
||||
var symbolThenPatched = api.symbol('thenPatched');
|
||||
var fetchTaskScheduling = api.symbol('fetchTaskScheduling');
|
||||
var fetchTaskAborting = api.symbol('fetchTaskAborting');
|
||||
if (typeof fetch !== 'function') {
|
||||
return;
|
||||
}
|
||||
var OriginalAbortController = global['AbortController'];
|
||||
var supportAbort = typeof OriginalAbortController === 'function';
|
||||
var abortNative = null;
|
||||
if (supportAbort) {
|
||||
global['AbortController'] = function () {
|
||||
var abortController = new OriginalAbortController();
|
||||
var signal = abortController.signal;
|
||||
signal.abortController = abortController;
|
||||
return abortController;
|
||||
};
|
||||
abortNative = api.patchMethod(OriginalAbortController.prototype, 'abort', function (delegate) { return function (self, args) {
|
||||
if (self.task) {
|
||||
return self.task.zone.cancelTask(self.task);
|
||||
}
|
||||
return delegate.apply(self, args);
|
||||
}; });
|
||||
}
|
||||
var placeholder = function () { };
|
||||
global['fetch'] = function () {
|
||||
var _this = this;
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var options = args.length > 1 ? args[1] : null;
|
||||
var signal = options && options.signal;
|
||||
return new Promise(function (res, rej) {
|
||||
var task = Zone.current.scheduleMacroTask('fetch', placeholder, args, function () {
|
||||
var fetchPromise;
|
||||
var zone = Zone.current;
|
||||
try {
|
||||
zone[fetchTaskScheduling] = true;
|
||||
fetchPromise = fetch.apply(_this, args);
|
||||
}
|
||||
catch (error) {
|
||||
rej(error);
|
||||
return;
|
||||
}
|
||||
finally {
|
||||
zone[fetchTaskScheduling] = false;
|
||||
}
|
||||
if (!(fetchPromise instanceof ZoneAwarePromise)) {
|
||||
var ctor = fetchPromise.constructor;
|
||||
if (!ctor[symbolThenPatched]) {
|
||||
api.patchThen(ctor);
|
||||
}
|
||||
}
|
||||
fetchPromise.then(function (resource) {
|
||||
if (task.state !== 'notScheduled') {
|
||||
task.invoke();
|
||||
}
|
||||
res(resource);
|
||||
}, function (error) {
|
||||
if (task.state !== 'notScheduled') {
|
||||
task.invoke();
|
||||
}
|
||||
rej(error);
|
||||
});
|
||||
}, function () {
|
||||
if (!supportAbort) {
|
||||
rej('No AbortController supported, can not cancel fetch');
|
||||
return;
|
||||
}
|
||||
if (signal && signal.abortController && !signal.aborted &&
|
||||
typeof signal.abortController.abort === 'function' && abortNative) {
|
||||
try {
|
||||
Zone.current[fetchTaskAborting] = true;
|
||||
abortNative.call(signal.abortController);
|
||||
}
|
||||
finally {
|
||||
Zone.current[fetchTaskAborting] = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
rej('cancel fetch need a AbortController.signal');
|
||||
}
|
||||
});
|
||||
if (signal && signal.abortController) {
|
||||
signal.abortController.task = task;
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
|
|
@ -3661,23 +3530,9 @@ var wrapFn = function (event) {
|
|||
}
|
||||
var target = this || event.target || _global;
|
||||
var listener = target[eventNameSymbol];
|
||||
var result;
|
||||
if (isBrowser && target === internalWindow && event.type === 'error') {
|
||||
// window.onerror have different signiture
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onerror#window.onerror
|
||||
// and onerror callback will prevent default when callback return true
|
||||
var errorEvent = event;
|
||||
result = listener &&
|
||||
listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);
|
||||
if (result === true) {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = listener && listener.apply(this, arguments);
|
||||
if (result != undefined && !result) {
|
||||
event.preventDefault();
|
||||
}
|
||||
var result = listener && listener.apply(this, arguments);
|
||||
if (result != undefined && !result) {
|
||||
event.preventDefault();
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
|
@ -3695,10 +3550,6 @@ function patchProperty(obj, prop, prototype) {
|
|||
if (!desc || !desc.configurable) {
|
||||
return;
|
||||
}
|
||||
var onPropPatchedSymbol = zoneSymbol('on' + prop + 'patched');
|
||||
if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {
|
||||
return;
|
||||
}
|
||||
// A property descriptor cannot have getter/setter and be writable
|
||||
// deleting the writable and value properties avoids this error:
|
||||
//
|
||||
|
|
@ -3776,7 +3627,6 @@ function patchProperty(obj, prop, prototype) {
|
|||
return null;
|
||||
};
|
||||
ObjectDefineProperty(obj, prop, desc);
|
||||
obj[onPropPatchedSymbol] = true;
|
||||
}
|
||||
function patchOnProperties(obj, properties, prototype) {
|
||||
if (properties) {
|
||||
|
|
@ -3867,31 +3717,6 @@ function patchClass(className) {
|
|||
}
|
||||
}
|
||||
}
|
||||
function copySymbolProperties(src, dest) {
|
||||
if (typeof Object.getOwnPropertySymbols !== 'function') {
|
||||
return;
|
||||
}
|
||||
var symbols = Object.getOwnPropertySymbols(src);
|
||||
symbols.forEach(function (symbol) {
|
||||
var desc = Object.getOwnPropertyDescriptor(src, symbol);
|
||||
Object.defineProperty(dest, symbol, {
|
||||
get: function () {
|
||||
return src[symbol];
|
||||
},
|
||||
set: function (value) {
|
||||
if (desc && (!desc.writable || typeof desc.set !== 'function')) {
|
||||
// if src[symbol] is not writable or not have a setter, just return
|
||||
return;
|
||||
}
|
||||
src[symbol] = value;
|
||||
},
|
||||
enumerable: desc ? desc.enumerable : true,
|
||||
configurable: desc ? desc.configurable : true
|
||||
});
|
||||
});
|
||||
}
|
||||
var shouldCopySymbolProperties = false;
|
||||
|
||||
function patchMethod(target, name, patchFn) {
|
||||
var proto = target;
|
||||
while (proto && !proto.hasOwnProperty(name)) {
|
||||
|
|
@ -3902,7 +3727,7 @@ function patchMethod(target, name, patchFn) {
|
|||
proto = target;
|
||||
}
|
||||
var delegateName = zoneSymbol(name);
|
||||
var delegate = null;
|
||||
var delegate;
|
||||
if (proto && !(delegate = proto[delegateName])) {
|
||||
delegate = proto[delegateName] = proto[name];
|
||||
// check whether proto[name] is writable
|
||||
|
|
@ -3914,9 +3739,6 @@ function patchMethod(target, name, patchFn) {
|
|||
return patchDelegate_1(this, arguments);
|
||||
};
|
||||
attachOriginToPatched(proto[name], delegate);
|
||||
if (shouldCopySymbolProperties) {
|
||||
copySymbolProperties(delegate, proto[name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return delegate;
|
||||
|
|
@ -3935,7 +3757,7 @@ function patchMacroTask(obj, funcName, metaCreator) {
|
|||
setNative = patchMethod(obj, funcName, function (delegate) { return function (self, args) {
|
||||
var meta = metaCreator(self, args);
|
||||
if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === 'function') {
|
||||
return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);
|
||||
return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask, null);
|
||||
}
|
||||
else {
|
||||
// cause an error by calling it directly.
|
||||
|
|
@ -3949,17 +3771,6 @@ function attachOriginToPatched(patched, original) {
|
|||
}
|
||||
var isDetectedIEOrEdge = false;
|
||||
var ieOrEdge = false;
|
||||
function isIE() {
|
||||
try {
|
||||
var ua = internalWindow.navigator.userAgent;
|
||||
if (ua.indexOf('MSIE ') !== -1 || ua.indexOf('Trident/') !== -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function isIEOrEdge() {
|
||||
if (isDetectedIEOrEdge) {
|
||||
return ieOrEdge;
|
||||
|
|
@ -4041,21 +3852,6 @@ Zone.__load_patch('toString', function (global) {
|
|||
* @fileoverview
|
||||
* @suppress {missingRequire}
|
||||
*/
|
||||
var passiveSupported = false;
|
||||
if (typeof window !== 'undefined') {
|
||||
try {
|
||||
var options = Object.defineProperty({}, 'passive', {
|
||||
get: function () {
|
||||
passiveSupported = true;
|
||||
}
|
||||
});
|
||||
window.addEventListener('test', options, options);
|
||||
window.removeEventListener('test', options, options);
|
||||
}
|
||||
catch (err) {
|
||||
passiveSupported = false;
|
||||
}
|
||||
}
|
||||
// an identifier to tell ZoneTask do not create a new invoke closure
|
||||
var OPTIMIZED_ZONE_EVENT_TASK_DATA = {
|
||||
useG: true
|
||||
|
|
@ -4191,7 +3987,6 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
if (proto[zoneSymbolAddEventListener]) {
|
||||
return false;
|
||||
}
|
||||
var eventNameToString = patchOptions && patchOptions.eventNameToString;
|
||||
// a shared global taskData to pass data for scheduleEventTask
|
||||
// so we do not need to create a new object just for pass some data
|
||||
var taskData = {};
|
||||
|
|
@ -4207,24 +4002,12 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
nativePrependEventListener = proto[zoneSymbol(patchOptions.prepend)] =
|
||||
proto[patchOptions.prepend];
|
||||
}
|
||||
function checkIsPassive(task) {
|
||||
if (!passiveSupported && typeof taskData.options !== 'boolean' &&
|
||||
typeof taskData.options !== 'undefined' && taskData.options !== null) {
|
||||
// options is a non-null non-undefined object
|
||||
// passive is not supported
|
||||
// don't pass options as object
|
||||
// just pass capture as a boolean
|
||||
task.options = !!taskData.options.capture;
|
||||
taskData.options = task.options;
|
||||
}
|
||||
}
|
||||
var customScheduleGlobal = function (task) {
|
||||
var customScheduleGlobal = function () {
|
||||
// if there is already a task for the eventName + capture,
|
||||
// just return, because we use the shared globalZoneAwareCallback here.
|
||||
if (taskData.isExisting) {
|
||||
return;
|
||||
}
|
||||
checkIsPassive(task);
|
||||
return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);
|
||||
};
|
||||
var customCancelGlobal = function (task) {
|
||||
|
|
@ -4265,7 +4048,6 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);
|
||||
};
|
||||
var customScheduleNonGlobal = function (task) {
|
||||
checkIsPassive(task);
|
||||
return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);
|
||||
};
|
||||
var customSchedulePrepend = function (task) {
|
||||
|
|
@ -4288,15 +4070,10 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
if (prepend === void 0) { prepend = false; }
|
||||
return function () {
|
||||
var target = this || _global;
|
||||
var eventName = arguments[0];
|
||||
var delegate = arguments[1];
|
||||
if (!delegate) {
|
||||
return nativeListener.apply(this, arguments);
|
||||
}
|
||||
if (isNode && eventName === 'uncaughtException') {
|
||||
// don't patch uncaughtException of nodejs to prevent endless loop
|
||||
return nativeListener.apply(this, arguments);
|
||||
}
|
||||
// don't create the bind delegate function for handleEvent
|
||||
// case here to improve addEventListener performance
|
||||
// we will create the bind delegate when invoke
|
||||
|
|
@ -4310,6 +4087,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {
|
||||
return;
|
||||
}
|
||||
var eventName = arguments[0];
|
||||
var options = arguments[2];
|
||||
if (blackListedEvents) {
|
||||
// check black list
|
||||
|
|
@ -4339,8 +4117,8 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
var symbolEventName;
|
||||
if (!symbolEventNames) {
|
||||
// the code is duplicate, but I just want to get some better performance
|
||||
var falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;
|
||||
var trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;
|
||||
var falseEventName = eventName + FALSE_STR;
|
||||
var trueEventName = eventName + TRUE_STR;
|
||||
var symbol = ZONE_SYMBOL_PREFIX + falseEventName;
|
||||
var symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;
|
||||
zoneSymbolEventNames$1[eventName] = {};
|
||||
|
|
@ -4375,8 +4153,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
source = targetSource[eventName];
|
||||
}
|
||||
if (!source) {
|
||||
source = constructorName + addSource +
|
||||
(eventNameToString ? eventNameToString(eventName) : eventName);
|
||||
source = constructorName + addSource + eventName;
|
||||
}
|
||||
// do not create a new object as task.data to pass those things
|
||||
// just use the global shared one
|
||||
|
|
@ -4391,7 +4168,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
taskData.capture = capture;
|
||||
taskData.eventName = eventName;
|
||||
taskData.isExisting = isExisting;
|
||||
var data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : undefined;
|
||||
var data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : null;
|
||||
// keep taskData into data to allow onScheduleEventTask to access the task information
|
||||
if (data) {
|
||||
data.taskData = taskData;
|
||||
|
|
@ -4409,11 +4186,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
if (once) {
|
||||
options.once = true;
|
||||
}
|
||||
if (!(!passiveSupported && typeof task.options === 'boolean')) {
|
||||
// if not support passive, and we pass an option object
|
||||
// to addEventListener, we should save the options to task
|
||||
task.options = options;
|
||||
}
|
||||
task.options = options;
|
||||
task.target = target;
|
||||
task.capture = capture;
|
||||
task.eventName = eventName;
|
||||
|
|
@ -4498,7 +4271,7 @@ function patchEventTarget(_global, apis, patchOptions) {
|
|||
var target = this || _global;
|
||||
var eventName = arguments[0];
|
||||
var listeners = [];
|
||||
var tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);
|
||||
var tasks = findEventTasks(target, eventName);
|
||||
for (var i = 0; i < tasks.length; i++) {
|
||||
var task = tasks[i];
|
||||
var delegate = task.originalDelegate ? task.originalDelegate : task.callback;
|
||||
|
|
@ -4654,9 +4427,9 @@ function patchTimer(window, setName, cancelName, nameSuffix) {
|
|||
patchMethod(window, setName, function (delegate) { return function (self, args) {
|
||||
if (typeof args[0] === 'function') {
|
||||
var options = {
|
||||
handleId: null,
|
||||
isPeriodic: nameSuffix === 'Interval',
|
||||
delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 :
|
||||
undefined,
|
||||
delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 : null,
|
||||
args: args
|
||||
};
|
||||
var task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);
|
||||
|
|
@ -4771,7 +4544,7 @@ function propertyPatch() {
|
|||
};
|
||||
Object.getOwnPropertyDescriptor = function (obj, prop) {
|
||||
var desc = _getOwnPropertyDescriptor(obj, prop);
|
||||
if (desc && isUnconfigurable(obj, prop)) {
|
||||
if (isUnconfigurable(obj, prop)) {
|
||||
desc.configurable = false;
|
||||
}
|
||||
return desc;
|
||||
|
|
@ -4999,10 +4772,10 @@ var globalEventHandlersEventNames = [
|
|||
'wheel'
|
||||
];
|
||||
var documentEventNames = [
|
||||
'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'freeze', 'fullscreenchange',
|
||||
'afterscriptexecute', 'beforescriptexecute', 'DOMContentLoaded', 'fullscreenchange',
|
||||
'mozfullscreenchange', 'webkitfullscreenchange', 'msfullscreenchange', 'fullscreenerror',
|
||||
'mozfullscreenerror', 'webkitfullscreenerror', 'msfullscreenerror', 'readystatechange',
|
||||
'visibilitychange', 'resume'
|
||||
'visibilitychange'
|
||||
];
|
||||
var windowEventNames = [
|
||||
'absolutedeviceorientation',
|
||||
|
|
@ -5114,7 +4887,7 @@ var websocketEventNames = ['close', 'error', 'open', 'message'];
|
|||
var workerEventNames = ['error', 'message'];
|
||||
var eventNames = globalEventHandlersEventNames.concat(webglEventNames, formEventNames, detailEventNames, documentEventNames, windowEventNames, htmlElementEventNames, ieElementEventNames);
|
||||
function filterProperties(target, onProperties, ignoreProperties) {
|
||||
if (!ignoreProperties || ignoreProperties.length === 0) {
|
||||
if (!ignoreProperties) {
|
||||
return onProperties;
|
||||
}
|
||||
var tip = ignoreProperties.filter(function (ip) { return ip.target === target; });
|
||||
|
|
@ -5139,14 +4912,13 @@ function propertyDescriptorPatch(api, _global) {
|
|||
}
|
||||
var supportsWebSocket = typeof WebSocket !== 'undefined';
|
||||
if (canPatchViaPropertyDescriptor()) {
|
||||
var ignoreProperties = _global['__Zone_ignore_on_properties'];
|
||||
var ignoreProperties = _global.__Zone_ignore_on_properties;
|
||||
// for browsers that we can patch the descriptor: Chrome & Firefox
|
||||
if (isBrowser) {
|
||||
var internalWindow = window;
|
||||
var ignoreErrorProperties = isIE ? [{ target: internalWindow, ignoreProperties: ['error'] }] : [];
|
||||
// in IE/Edge, onProp not exist in window object, but in WindowPrototype
|
||||
// so we need to pass WindowPrototype to check onProp exist or not
|
||||
patchFilteredProperties(internalWindow, eventNames.concat(['messageerror']), ignoreProperties ? ignoreProperties.concat(ignoreErrorProperties) : ignoreProperties, ObjectGetPrototypeOf(internalWindow));
|
||||
patchFilteredProperties(internalWindow, eventNames.concat(['messageerror']), ignoreProperties, ObjectGetPrototypeOf(internalWindow));
|
||||
patchFilteredProperties(Document.prototype, eventNames, ignoreProperties);
|
||||
if (typeof internalWindow['SVGElement'] !== 'undefined') {
|
||||
patchFilteredProperties(internalWindow['SVGElement'].prototype, eventNames, ignoreProperties);
|
||||
|
|
@ -5168,9 +4940,9 @@ function propertyDescriptorPatch(api, _global) {
|
|||
}
|
||||
}
|
||||
patchFilteredProperties(XMLHttpRequest.prototype, XMLHttpRequestEventNames, ignoreProperties);
|
||||
var XMLHttpRequestEventTarget_1 = _global['XMLHttpRequestEventTarget'];
|
||||
if (XMLHttpRequestEventTarget_1) {
|
||||
patchFilteredProperties(XMLHttpRequestEventTarget_1 && XMLHttpRequestEventTarget_1.prototype, XMLHttpRequestEventNames, ignoreProperties);
|
||||
var XMLHttpRequestEventTarget = _global['XMLHttpRequestEventTarget'];
|
||||
if (XMLHttpRequestEventTarget) {
|
||||
patchFilteredProperties(XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype, XMLHttpRequestEventNames, ignoreProperties);
|
||||
}
|
||||
if (typeof IDBIndex !== 'undefined') {
|
||||
patchFilteredProperties(IDBIndex.prototype, IDBIndexEventNames, ignoreProperties);
|
||||
|
|
@ -5385,16 +5157,16 @@ function patchEvent(global, api) {
|
|||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
function patchCallbacks(target, targetName, method, callbacks) {
|
||||
var symbol = Zone.__symbol__(method);
|
||||
if (target[symbol]) {
|
||||
function registerElementPatch(_global) {
|
||||
if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) {
|
||||
return;
|
||||
}
|
||||
var nativeDelegate = target[symbol] = target[method];
|
||||
target[method] = function (name, opts, options) {
|
||||
var _registerElement = document.registerElement;
|
||||
var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
|
||||
document.registerElement = function (name, opts) {
|
||||
if (opts && opts.prototype) {
|
||||
callbacks.forEach(function (callback) {
|
||||
var source = targetName + "." + method + "::" + callback;
|
||||
var source = 'Document.registerElement::' + callback;
|
||||
var prototype = opts.prototype;
|
||||
if (prototype.hasOwnProperty(callback)) {
|
||||
var descriptor = ObjectGetOwnPropertyDescriptor(prototype, callback);
|
||||
|
|
@ -5411,23 +5183,9 @@ function patchCallbacks(target, targetName, method, callbacks) {
|
|||
}
|
||||
});
|
||||
}
|
||||
return nativeDelegate.call(target, name, opts, options);
|
||||
return _registerElement.call(document, name, opts);
|
||||
};
|
||||
attachOriginToPatched(target[method], nativeDelegate);
|
||||
}
|
||||
function registerElementPatch(_global) {
|
||||
if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) {
|
||||
return;
|
||||
}
|
||||
var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
|
||||
patchCallbacks(document, 'Document', 'registerElement', callbacks);
|
||||
}
|
||||
function patchCustomElements(_global) {
|
||||
if ((!isBrowser && !isMix) || !('customElements' in _global)) {
|
||||
return;
|
||||
}
|
||||
var callbacks = ['connectedCallback', 'disconnectedCallback', 'adoptedCallback', 'attributeChangedCallback'];
|
||||
patchCallbacks(_global.customElements, 'customElements', 'define', callbacks);
|
||||
attachOriginToPatched(document.registerElement, _registerElement);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -5490,10 +5248,7 @@ Zone.__load_patch('EventTarget', function (global, Zone, api) {
|
|||
Zone.__load_patch('on_property', function (global, Zone, api) {
|
||||
propertyDescriptorPatch(api, global);
|
||||
propertyPatch();
|
||||
});
|
||||
Zone.__load_patch('customElements', function (global, Zone, api) {
|
||||
registerElementPatch(global);
|
||||
patchCustomElements(global);
|
||||
});
|
||||
Zone.__load_patch('canvas', function (global) {
|
||||
var HTMLCanvasElement = global['HTMLCanvasElement'];
|
||||
|
|
@ -5512,7 +5267,6 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
var XHR_LISTENER = zoneSymbol('xhrListener');
|
||||
var XHR_SCHEDULED = zoneSymbol('xhrScheduled');
|
||||
var XHR_URL = zoneSymbol('xhrURL');
|
||||
var XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol('xhrErrorBeforeScheduled');
|
||||
function patchXHR(window) {
|
||||
var XMLHttpRequestPrototype = XMLHttpRequest.prototype;
|
||||
function findPendingTask(target) {
|
||||
|
|
@ -5521,9 +5275,9 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
var oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];
|
||||
var oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];
|
||||
if (!oriAddListener) {
|
||||
var XMLHttpRequestEventTarget_1 = window['XMLHttpRequestEventTarget'];
|
||||
if (XMLHttpRequestEventTarget_1) {
|
||||
var XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget_1.prototype;
|
||||
var XMLHttpRequestEventTarget = window['XMLHttpRequestEventTarget'];
|
||||
if (XMLHttpRequestEventTarget) {
|
||||
var XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;
|
||||
oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];
|
||||
oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];
|
||||
}
|
||||
|
|
@ -5531,10 +5285,9 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
var READY_STATE_CHANGE = 'readystatechange';
|
||||
var SCHEDULED = 'scheduled';
|
||||
function scheduleTask(task) {
|
||||
XMLHttpRequest[XHR_SCHEDULED] = false;
|
||||
var data = task.data;
|
||||
var target = data.target;
|
||||
target[XHR_SCHEDULED] = false;
|
||||
target[XHR_ERROR_BEFORE_SCHEDULED] = false;
|
||||
// remove existing event listener
|
||||
var listener = target[XHR_LISTENER];
|
||||
if (!oriAddListener) {
|
||||
|
|
@ -5548,35 +5301,8 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
if (target.readyState === target.DONE) {
|
||||
// sometimes on some browsers XMLHttpRequest will fire onreadystatechange with
|
||||
// readyState=4 multiple times, so we need to check task state here
|
||||
if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {
|
||||
// check whether the xhr has registered onload listener
|
||||
// if that is the case, the task should invoke after all
|
||||
// onload listeners finish.
|
||||
var loadTasks = target['__zone_symbol__loadfalse'];
|
||||
if (loadTasks && loadTasks.length > 0) {
|
||||
var oriInvoke_1 = task.invoke;
|
||||
task.invoke = function () {
|
||||
// need to load the tasks again, because in other
|
||||
// load listener, they may remove themselves
|
||||
var loadTasks = target['__zone_symbol__loadfalse'];
|
||||
for (var i = 0; i < loadTasks.length; i++) {
|
||||
if (loadTasks[i] === task) {
|
||||
loadTasks.splice(i, 1);
|
||||
}
|
||||
}
|
||||
if (!data.aborted && task.state === SCHEDULED) {
|
||||
oriInvoke_1.call(task);
|
||||
}
|
||||
};
|
||||
loadTasks.push(task);
|
||||
}
|
||||
else {
|
||||
task.invoke();
|
||||
}
|
||||
}
|
||||
else if (!data.aborted && target[XHR_SCHEDULED] === false) {
|
||||
// error occurs when xhr.send()
|
||||
target[XHR_ERROR_BEFORE_SCHEDULED] = true;
|
||||
if (!data.aborted && XMLHttpRequest[XHR_SCHEDULED] && task.state === SCHEDULED) {
|
||||
task.invoke();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -5586,7 +5312,7 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
target[XHR_TASK] = task;
|
||||
}
|
||||
sendNative.apply(target, data.args);
|
||||
target[XHR_SCHEDULED] = true;
|
||||
XMLHttpRequest[XHR_SCHEDULED] = true;
|
||||
return task;
|
||||
}
|
||||
function placeholderCallback() { }
|
||||
|
|
@ -5603,32 +5329,24 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
return openNative.apply(self, args);
|
||||
}; });
|
||||
var XMLHTTPREQUEST_SOURCE = 'XMLHttpRequest.send';
|
||||
var fetchTaskAborting = zoneSymbol('fetchTaskAborting');
|
||||
var fetchTaskScheduling = zoneSymbol('fetchTaskScheduling');
|
||||
var sendNative = patchMethod(XMLHttpRequestPrototype, 'send', function () { return function (self, args) {
|
||||
if (Zone.current[fetchTaskScheduling] === true) {
|
||||
// a fetch is scheduling, so we are using xhr to polyfill fetch
|
||||
// and because we already schedule macroTask for fetch, we should
|
||||
// not schedule a macroTask for xhr again
|
||||
return sendNative.apply(self, args);
|
||||
}
|
||||
if (self[XHR_SYNC]) {
|
||||
// if the XHR is sync there is no task to schedule, just execute the code.
|
||||
return sendNative.apply(self, args);
|
||||
}
|
||||
else {
|
||||
var options = { target: self, url: self[XHR_URL], isPeriodic: false, args: args, aborted: false };
|
||||
var task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);
|
||||
if (self && self[XHR_ERROR_BEFORE_SCHEDULED] === true && !options.aborted &&
|
||||
task.state === SCHEDULED) {
|
||||
// xhr request throw error when send
|
||||
// we should invoke task instead of leaving a scheduled
|
||||
// pending macroTask
|
||||
task.invoke();
|
||||
}
|
||||
var options = {
|
||||
target: self,
|
||||
url: self[XHR_URL],
|
||||
isPeriodic: false,
|
||||
delay: null,
|
||||
args: args,
|
||||
aborted: false
|
||||
};
|
||||
return scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);
|
||||
}
|
||||
}; });
|
||||
var abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', function () { return function (self, args) {
|
||||
var abortNative = patchMethod(XMLHttpRequestPrototype, 'abort', function () { return function (self) {
|
||||
var task = findPendingTask(self);
|
||||
if (task && typeof task.type == 'string') {
|
||||
// If the XHR has already completed, do nothing.
|
||||
|
|
@ -5640,10 +5358,6 @@ Zone.__load_patch('XHR', function (global, Zone) {
|
|||
}
|
||||
task.zone.cancelTask(task);
|
||||
}
|
||||
else if (Zone.current[fetchTaskAborting] === true) {
|
||||
// the abort is called from fetch polyfill, we need to call native abort of XHR.
|
||||
return abortNative.apply(self, args);
|
||||
}
|
||||
// Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no
|
||||
// task
|
||||
// to cancel. Do nothing.
|
||||
|
|
@ -5783,8 +5497,8 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
__webpack_require__(/*! D:\zano_zano\src\gui\qt-daemon\html_source\src\polyfills.ts */"./src/polyfills.ts");
|
||||
module.exports = __webpack_require__(/*! D:\zano_zano\src\gui\qt-daemon\html_source\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
|
||||
__webpack_require__(/*! D:\Projects\Zano\src\gui\qt-daemon\html_source\src\polyfills.ts */"./src/polyfills.ts");
|
||||
module.exports = __webpack_require__(/*! D:\Projects\Zano\src\gui\qt-daemon\html_source\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
|
||||
|
||||
|
||||
/***/ })
|
||||
|
|
|
|||
10
src/gui/qt-daemon/html/time.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M16.7,18.5L10,12.9V4h4v7.1l5.3,4.4L16.7,18.5z
|
||||
"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 540 B |
9
src/gui/qt-daemon/html/update-alert.svg
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M50,0C22.4,0,0,22.4,0,50s22.4,50,50,50s50-22.4,50-50S77.6,0,50,0z M54,70h-8v-8h8V70z M54,58h-8V30h8V58z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 538 B |
12
src/gui/qt-daemon/html/update.svg
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M24,11L23,0l-3.1,3.1C17.8,1.2,15.1,0,12,0C6.1,0,1.1,4.3,0.2,10h4.1c0.9-3.4,4-6,7.7-6c2,0,3.7,0.7,5.1,1.9
|
||||
L14,9L24,11z"/>
|
||||
<path class="st0" d="M0,13l1,11l3.1-3.1C6.2,22.8,8.9,24,12,24c5.9,0,10.9-4.3,11.8-10h-4.1c-0.9,3.4-4,6-7.7,6
|
||||
c-2,0-3.7-0.7-5.1-1.9L10,15L0,13z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 696 B |
|
|
@ -93682,22 +93682,6 @@ var NotIdle = /** @class */ (function (_super) {
|
|||
|
||||
//# sourceMappingURL=/home/travis/build/harunurhan/idlejs/src/not-idle.js.map
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/isarray/index.js":
|
||||
/*!***************************************!*\
|
||||
!*** ./node_modules/isarray/index.js ***!
|
||||
\***************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
var toString = {}.toString;
|
||||
|
||||
module.exports = Array.isArray || function (arr) {
|
||||
return toString.call(arr) == '[object Array]';
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/json-bignumber/node_modules/bignumber.js/bignumber.js":
|
||||
|
|
@ -98870,13 +98854,9 @@ exports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {
|
|||
|
||||
var Buffer = __webpack_require__(/*! ../utils/buffer */ "./node_modules/qrcode/lib/utils/typedarray-buffer.js")
|
||||
|
||||
if(Buffer.alloc) {
|
||||
var EXP_TABLE = Buffer.alloc(512)
|
||||
var LOG_TABLE = Buffer.alloc(256)
|
||||
} else {
|
||||
var EXP_TABLE = new Buffer(512)
|
||||
var LOG_TABLE = new Buffer(256)
|
||||
}
|
||||
var EXP_TABLE = new Buffer(512)
|
||||
var LOG_TABLE = new Buffer(256)
|
||||
|
||||
/**
|
||||
* Precompute the log and anti-log tables for faster computation later
|
||||
*
|
||||
|
|
@ -99586,7 +99566,7 @@ var Version = __webpack_require__(/*! ./version */ "./node_modules/qrcode/lib/co
|
|||
var FormatInfo = __webpack_require__(/*! ./format-info */ "./node_modules/qrcode/lib/core/format-info.js")
|
||||
var Mode = __webpack_require__(/*! ./mode */ "./node_modules/qrcode/lib/core/mode.js")
|
||||
var Segments = __webpack_require__(/*! ./segments */ "./node_modules/qrcode/lib/core/segments.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/qrcode/node_modules/isarray/index.js")
|
||||
|
||||
/**
|
||||
* QRCode for JavaScript
|
||||
|
|
@ -100634,7 +100614,7 @@ var ECCode = __webpack_require__(/*! ./error-correction-code */ "./node_modules/
|
|||
var ECLevel = __webpack_require__(/*! ./error-correction-level */ "./node_modules/qrcode/lib/core/error-correction-level.js")
|
||||
var Mode = __webpack_require__(/*! ./mode */ "./node_modules/qrcode/lib/core/mode.js")
|
||||
var VersionCheck = __webpack_require__(/*! ./version-check */ "./node_modules/qrcode/lib/core/version-check.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/qrcode/node_modules/isarray/index.js")
|
||||
|
||||
// Generator polynomial used to encode version information
|
||||
var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)
|
||||
|
|
@ -101084,7 +101064,7 @@ exports.qrToImageData = function qrToImageData (imgData, qr, opts) {
|
|||
|
||||
|
||||
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
|
||||
var isArray = __webpack_require__(/*! isarray */ "./node_modules/qrcode/node_modules/isarray/index.js")
|
||||
|
||||
function typedArraySupport () {
|
||||
// Can typed array instances be augmented?
|
||||
|
|
@ -101589,6 +101569,22 @@ Buffer.isBuffer = function isBuffer (b) {
|
|||
module.exports = Buffer
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/qrcode/node_modules/isarray/index.js":
|
||||
/*!***********************************************************!*\
|
||||
!*** ./node_modules/qrcode/node_modules/isarray/index.js ***!
|
||||
\***********************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
var toString = {}.toString;
|
||||
|
||||
module.exports = Array.isArray || function (arr) {
|
||||
return toString.call(arr) == '[object Array]';
|
||||
};
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/rxjs/_esm5/index.js":
|
||||
|
|
|
|||
|
|
@ -176,13 +176,29 @@ export class TooltipDirective implements OnDestroy {
|
|||
}
|
||||
break;
|
||||
case 'left':
|
||||
this.renderer.setStyle(this.tooltip, 'left', hostPos.left - this.tooltip.getBoundingClientRect().width + 'px');
|
||||
this.renderer.setStyle(this.tooltip, 'top', hostPos.top + (hostPos.bottom - hostPos.top) / 2 - this.tooltip.getBoundingClientRect().height / 2 + 'px');
|
||||
break;
|
||||
case 'left-top':
|
||||
this.renderer.setStyle(this.tooltip, 'top', hostPos.top + 'px');
|
||||
this.renderer.setStyle(this.tooltip, 'left', hostPos.left - this.tooltip.getBoundingClientRect().width + 'px');
|
||||
break;
|
||||
case 'left-bottom':
|
||||
this.renderer.setStyle(this.tooltip, 'left', hostPos.left - this.tooltip.getBoundingClientRect().width + 'px');
|
||||
this.renderer.setStyle(this.tooltip, 'top', hostPos.bottom - this.tooltip.getBoundingClientRect().height + 'px');
|
||||
break;
|
||||
case 'right':
|
||||
this.renderer.setStyle(this.tooltip, 'left', hostPos.right + 'px');
|
||||
this.renderer.setStyle(this.tooltip, 'top', hostPos.top + (hostPos.bottom - hostPos.top) / 2 - this.tooltip.getBoundingClientRect().height / 2 + 'px');
|
||||
break;
|
||||
case 'right-top':
|
||||
this.renderer.setStyle(this.tooltip, 'top', hostPos.top + 'px');
|
||||
this.renderer.setStyle(this.tooltip, 'left', hostPos.right + 'px');
|
||||
break;
|
||||
case 'right-bottom':
|
||||
this.renderer.setStyle(this.tooltip, 'left', hostPos.right + 'px');
|
||||
this.renderer.setStyle(this.tooltip, 'top', hostPos.bottom - this.tooltip.getBoundingClientRect().height + 'px');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,10 @@ export class VariablesService {
|
|||
public defaultCurrency = 'ZANO';
|
||||
public opening_wallet: Wallet;
|
||||
public exp_med_ts = 0;
|
||||
public ts_diff = 0;
|
||||
public height_app = 0;
|
||||
public last_build_available = '';
|
||||
public last_build_displaymode = 0;
|
||||
public daemon_state = 3;
|
||||
public sync = {
|
||||
progress_value: 0,
|
||||
|
|
@ -75,6 +77,7 @@ export class VariablesService {
|
|||
setExpMedTs(timestamp: number) {
|
||||
if (timestamp !== this.exp_med_ts) {
|
||||
this.exp_med_ts = timestamp;
|
||||
this.ts_diff = Math.abs(new Date().getTime() - (timestamp * 1000));
|
||||
this.getExpMedTsEvent.next(timestamp);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
|||
// this.variablesService.exp_med_ts = data['expiration_median_timestamp'] + 600 + 1;
|
||||
this.variablesService.setExpMedTs(data['expiration_median_timestamp'] + 600 + 1);
|
||||
this.variablesService.last_build_available = data.last_build_available;
|
||||
this.variablesService.last_build_displaymode = data.last_build_displaymode;
|
||||
this.variablesService.setHeightApp(data.height);
|
||||
|
||||
this.ngZone.run(() => {
|
||||
|
|
|
|||
|
|
@ -71,14 +71,44 @@
|
|||
<span class="online" *ngIf="variablesService.daemon_state === 5">
|
||||
{{ 'SIDEBAR.SYNCHRONIZATION.COMPLETE' | translate }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="progress-bar-container">
|
||||
<div class="syncing" *ngIf="variablesService.daemon_state === 1">
|
||||
<div class="progress-bar">
|
||||
<div class="fill" [style.width]="variablesService.sync.progress_value + '%'"></div>
|
||||
<div class="progress-bar-container" *ngIf="variablesService.daemon_state === 1 || variablesService.daemon_state === 3">
|
||||
<div class="syncing" *ngIf="variablesService.daemon_state === 1">
|
||||
<div class="progress-bar">
|
||||
<div class="fill" [style.width]="variablesService.sync.progress_value + '%'"></div>
|
||||
</div>
|
||||
<div class="progress-percent">{{ variablesService.sync.progress_value_text }}%</div>
|
||||
</div>
|
||||
<div class="progress-percent">{{ variablesService.sync.progress_value_text }}%</div>
|
||||
<div class="loading" *ngIf="variablesService.daemon_state === 3"></div>
|
||||
</div>
|
||||
<div class="loading" *ngIf="variablesService.daemon_state === 3"></div>
|
||||
</div>
|
||||
<div class="update-container" *ngIf="(variablesService.daemon_state === 0 || variablesService.daemon_state === 2) && [2, 3, 4].indexOf(variablesService.last_build_displaymode) !== -1">
|
||||
<ng-container *ngIf="variablesService.last_build_displaymode === 2">
|
||||
<div class="update-text standard">
|
||||
<span [style.cursor]="'pointer'" (click)="getUpdate()">{{ 'SIDEBAR.UPDATE.STANDARD' | translate }}</span>
|
||||
</div>
|
||||
<i class="icon update standard" tooltip="{{ 'SIDEBAR.UPDATE.STANDARD_TOOLTIP' | translate }}" placement="right-bottom" tooltipClass="update-tooltip" [delay]="500"></i>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="variablesService.last_build_displaymode === 3">
|
||||
<div class="update-text important">
|
||||
<span [style.cursor]="'pointer'" (click)="getUpdate()">{{ 'SIDEBAR.UPDATE.IMPORTANT' | translate }}</span>
|
||||
<br>
|
||||
<span style="font-size: 1rem">{{ 'SIDEBAR.UPDATE.IMPORTANT_HINT' | translate }}</span>
|
||||
</div>
|
||||
<i class="icon update important" tooltip="{{ 'SIDEBAR.UPDATE.IMPORTANT_TOOLTIP' | translate }}" placement="right-bottom" tooltipClass="update-tooltip important" [delay]="500"></i>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="variablesService.last_build_displaymode === 4">
|
||||
<div class="update-text critical">
|
||||
<span [style.cursor]="'pointer'" (click)="getUpdate()">{{ 'SIDEBAR.UPDATE.CRITICAL' | translate }}</span>
|
||||
<br>
|
||||
<span style="font-size: 1rem">{{ 'SIDEBAR.UPDATE.IMPORTANT_HINT' | translate }}</span>
|
||||
</div>
|
||||
<i class="icon update critical" tooltip="{{ 'SIDEBAR.UPDATE.CRITICAL_TOOLTIP' | translate }}" placement="right-bottom" tooltipClass="update-tooltip critical" [delay]="500"></i>
|
||||
</ng-container>
|
||||
</div>
|
||||
<div class="update-container" *ngIf="variablesService.daemon_state === 2 && variablesService.ts_diff > (10 * 60 * 1000)">
|
||||
<div class="update-text time">
|
||||
<span>{{ 'SIDEBAR.UPDATE.TIME' | translate }}</span>
|
||||
</div>
|
||||
<i class="icon time" tooltip="{{ 'SIDEBAR.UPDATE.TIME_TOOLTIP' | translate }}" placement="right-bottom" tooltipClass="update-tooltip important" [delay]="500"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
flex: 0 0 25rem;
|
||||
padding: 0 3rem 3rem;
|
||||
padding: 0 3rem;
|
||||
max-width: 25rem;
|
||||
}
|
||||
|
||||
|
|
@ -216,14 +216,16 @@
|
|||
}
|
||||
|
||||
.sidebar-synchronization-status {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
flex: 0 0 4rem;
|
||||
flex: 0 0 7rem;
|
||||
font-size: 1.3rem;
|
||||
|
||||
.status-container {
|
||||
position: relative;
|
||||
flex-grow: 1;
|
||||
text-align: left;
|
||||
|
||||
.offline, .online {
|
||||
position: relative;
|
||||
|
|
@ -245,61 +247,94 @@
|
|||
.syncing, .loading {
|
||||
line-height: 4rem;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-bar-container {
|
||||
position: absolute;
|
||||
bottom: -0.7rem;
|
||||
left: 0;
|
||||
height: 0.7rem;
|
||||
width: 100%;
|
||||
.progress-bar-container {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 0.7rem;
|
||||
width: 100%;
|
||||
|
||||
.syncing {
|
||||
display: flex;
|
||||
.syncing {
|
||||
display: flex;
|
||||
|
||||
.progress-bar {
|
||||
flex: 1 0 auto;
|
||||
.progress-bar {
|
||||
flex: 1 0 auto;
|
||||
|
||||
.fill {
|
||||
height: 100%;
|
||||
.fill {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-percent {
|
||||
flex: 0 0 auto;
|
||||
font-size: 1.3rem;
|
||||
line-height: 0.7rem;
|
||||
padding-left: 0.7rem;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-percent {
|
||||
flex: 0 0 auto;
|
||||
font-size: 1.3rem;
|
||||
line-height: 0.7rem;
|
||||
padding-left: 0.7rem;
|
||||
.loading {
|
||||
animation: move 5s linear infinite;
|
||||
background-image:
|
||||
-webkit-gradient(
|
||||
linear, 0 0, 100% 100%,
|
||||
color-stop(.125, rgba(0, 0, 0, .15)), color-stop(.125, transparent),
|
||||
color-stop(.250, transparent), color-stop(.250, rgba(0, 0, 0, .10)),
|
||||
color-stop(.375, rgba(0, 0, 0, .10)), color-stop(.375, transparent),
|
||||
color-stop(.500, transparent), color-stop(.500, rgba(0, 0, 0, .15)),
|
||||
color-stop(.625, rgba(0, 0, 0, .15)), color-stop(.625, transparent),
|
||||
color-stop(.750, transparent), color-stop(.750, rgba(0, 0, 0, .10)),
|
||||
color-stop(.875, rgba(0, 0, 0, .10)), color-stop(.875, transparent),
|
||||
to(transparent)
|
||||
),
|
||||
-webkit-gradient(
|
||||
linear, 0 100%, 100% 0,
|
||||
color-stop(.125, rgba(0, 0, 0, .30)), color-stop(.125, transparent),
|
||||
color-stop(.250, transparent), color-stop(.250, rgba(0, 0, 0, .25)),
|
||||
color-stop(.375, rgba(0, 0, 0, .25)), color-stop(.375, transparent),
|
||||
color-stop(.500, transparent), color-stop(.500, rgba(0, 0, 0, .30)),
|
||||
color-stop(.625, rgba(0, 0, 0, .30)), color-stop(.625, transparent),
|
||||
color-stop(.750, transparent), color-stop(.750, rgba(0, 0, 0, .25)),
|
||||
color-stop(.875, rgba(0, 0, 0, .25)), color-stop(.875, transparent),
|
||||
to(transparent)
|
||||
);
|
||||
background-size: 7rem 7rem;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.update-container {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
margin-left: 1rem;
|
||||
text-align: right;
|
||||
|
||||
.update-text {
|
||||
flex: 1 1 auto;
|
||||
font-size: 1.2rem;
|
||||
line-height: 1.8rem;
|
||||
text-align: left;
|
||||
|
||||
&.time {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
animation: move 5s linear infinite;
|
||||
background-image:
|
||||
-webkit-gradient(
|
||||
linear, 0 0, 100% 100%,
|
||||
color-stop(.125, rgba(0, 0, 0, .15)), color-stop(.125, transparent),
|
||||
color-stop(.250, transparent), color-stop(.250, rgba(0, 0, 0, .10)),
|
||||
color-stop(.375, rgba(0, 0, 0, .10)), color-stop(.375, transparent),
|
||||
color-stop(.500, transparent), color-stop(.500, rgba(0, 0, 0, .15)),
|
||||
color-stop(.625, rgba(0, 0, 0, .15)), color-stop(.625, transparent),
|
||||
color-stop(.750, transparent), color-stop(.750, rgba(0, 0, 0, .10)),
|
||||
color-stop(.875, rgba(0, 0, 0, .10)), color-stop(.875, transparent),
|
||||
to(transparent)
|
||||
),
|
||||
-webkit-gradient(
|
||||
linear, 0 100%, 100% 0,
|
||||
color-stop(.125, rgba(0, 0, 0, .30)), color-stop(.125, transparent),
|
||||
color-stop(.250, transparent), color-stop(.250, rgba(0, 0, 0, .25)),
|
||||
color-stop(.375, rgba(0, 0, 0, .25)), color-stop(.375, transparent),
|
||||
color-stop(.500, transparent), color-stop(.500, rgba(0, 0, 0, .30)),
|
||||
color-stop(.625, rgba(0, 0, 0, .30)), color-stop(.625, transparent),
|
||||
color-stop(.750, transparent), color-stop(.750, rgba(0, 0, 0, .25)),
|
||||
color-stop(.875, rgba(0, 0, 0, .25)), color-stop(.875, transparent),
|
||||
to(transparent)
|
||||
);
|
||||
background-size: 7rem 7rem;
|
||||
height: 100%;
|
||||
.icon {
|
||||
flex: 1 0 auto;
|
||||
margin: 0.3rem 0 0 0.6rem;
|
||||
width: 1.2rem;
|
||||
height: 1.2rem;
|
||||
|
||||
&.update {
|
||||
mask: url(../../assets/icons/update.svg) no-repeat center;
|
||||
}
|
||||
|
||||
&.time {
|
||||
mask: url(../../assets/icons/time.svg) no-repeat center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {Component, NgZone, OnInit, OnDestroy} from '@angular/core';
|
||||
import {ActivatedRoute, NavigationStart, Router} from '@angular/router';
|
||||
import {VariablesService} from '../_helpers/services/variables.service';
|
||||
import {BackendService} from '../_helpers/services/backend.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-sidebar',
|
||||
|
|
@ -16,6 +17,7 @@ export class SidebarComponent implements OnInit, OnDestroy {
|
|||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
public variablesService: VariablesService,
|
||||
private backend: BackendService,
|
||||
private ngZone: NgZone
|
||||
) {}
|
||||
|
||||
|
|
@ -47,6 +49,10 @@ export class SidebarComponent implements OnInit, OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
getUpdate() {
|
||||
this.backend.openUrlInBrowser('docs.zano.org/docs/zano-wallet');
|
||||
}
|
||||
|
||||
logOut() {
|
||||
this.variablesService.stopCountdown();
|
||||
this.variablesService.appLogin = false;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,18 @@
|
|||
"COMPLETE": "Completion",
|
||||
"SYNCING": "Syncing blockchain",
|
||||
"LOADING": "Loading blockchain data"
|
||||
},
|
||||
"UPDATE": {
|
||||
"STANDARD": "Update available",
|
||||
"STANDARD_TOOLTIP": "<span class=\"standard-update\">Get new update.</span><br><span>Update is recommended!</span>",
|
||||
"IMPORTANT": "Update available",
|
||||
"IMPORTANT_HINT": "Important update!",
|
||||
"IMPORTANT_TOOLTIP": "<span class=\"important-update\">Get new update.</span><br><span>Important update!</span>",
|
||||
"CRITICAL": "Update available",
|
||||
"CRITICAL_HINT": "Critical update!",
|
||||
"CRITICAL_TOOLTIP": "<span class=\"critical-update\">Critical update available.</span><i class=\"icon\"></i><span>Update strongly recommended!</span>",
|
||||
"TIME": "System time differs from network",
|
||||
"TIME_TOOLTIP": "<span class=\"wrong-time\">Wrong system time!</span><br><span>Check and repair your system time.</span>"
|
||||
}
|
||||
},
|
||||
"MAIN": {
|
||||
|
|
|
|||
10
src/gui/qt-daemon/html_source/src/assets/icons/time.svg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M12,0C5.4,0,0,5.4,0,12s5.4,12,12,12s12-5.4,12-12S18.6,0,12,0z M16.7,18.5L10,12.9V4h4v7.1l5.3,4.4L16.7,18.5z
|
||||
"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 540 B |
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 100 100" style="enable-background:new 0 0 100 100;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M50,0C22.4,0,0,22.4,0,50s22.4,50,50,50s50-22.4,50-50S77.6,0,50,0z M54,70h-8v-8h8V70z M54,58h-8V30h8V58z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 538 B |
12
src/gui/qt-daemon/html_source/src/assets/icons/update.svg
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#FFFFFF;}
|
||||
</style>
|
||||
<path class="st0" d="M24,11L23,0l-3.1,3.1C17.8,1.2,15.1,0,12,0C6.1,0,1.1,4.3,0.2,10h4.1c0.9-3.4,4-6,7.7-6c2,0,3.7,0.7,5.1,1.9
|
||||
L14,9L24,11z"/>
|
||||
<path class="st0" d="M0,13l1,11l3.1-3.1C6.2,22.8,8.9,24,12,24c5.9,0,10.9-4.3,11.8-10h-4.1c-0.9,3.4-4,6-7.7,6
|
||||
c-2,0-3.7-0.7-5.1-1.9L10,15L0,13z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 696 B |
|
|
@ -375,9 +375,9 @@ input[type='checkbox'].style-checkbox {
|
|||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: -2rem;
|
||||
left: calc(50% - 1rem);
|
||||
border-width: 1rem;
|
||||
bottom: -1rem;
|
||||
left: calc(50% - 0.5rem);
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
|
|
@ -394,11 +394,11 @@ input[type='checkbox'].style-checkbox {
|
|||
position: absolute;
|
||||
bottom: -1rem;
|
||||
left: 0.7rem;
|
||||
border-width: 1rem 1rem 0 0;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: themed(tooltipBackgroundColor) transparent transparent transparent;
|
||||
border-color: themed(tooltipBackgroundColor) transparent transparent themed(tooltipBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -426,9 +426,9 @@ input[type='checkbox'].style-checkbox {
|
|||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: -2rem;
|
||||
left: calc(50% - 1rem);
|
||||
border-width: 1rem;
|
||||
top: -1rem;
|
||||
left: calc(50% - 0.5rem);
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
|
|
@ -477,13 +477,13 @@ input[type='checkbox'].style-checkbox {
|
|||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
top: calc(50% - 0.5rem);
|
||||
right: -1rem;
|
||||
border-width: 1rem 1rem 0 0;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: themed(tooltipBackgroundColor) transparent transparent transparent;
|
||||
border-color: transparent transparent transparent themed(tooltipBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -494,13 +494,13 @@ input[type='checkbox'].style-checkbox {
|
|||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
top: calc(50% - 0.5rem);
|
||||
left: -1rem;
|
||||
border-width: 1rem 0 0 1rem;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: themed(tooltipBackgroundColor) transparent transparent transparent;
|
||||
border-color: transparent themed(tooltipBackgroundColor) transparent transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -589,6 +589,162 @@ input[type='checkbox'].style-checkbox {
|
|||
}
|
||||
}
|
||||
|
||||
.update-tooltip {
|
||||
padding: 1.5rem;
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(tooltipBackgroundColor);
|
||||
box-shadow: themed(tooltipShadow);
|
||||
color: themed(mainTextColor);
|
||||
}
|
||||
|
||||
&.important {
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(tooltipImportantBackgroundColor);
|
||||
color: themed(accountMainTextColor);
|
||||
}
|
||||
|
||||
&.ng-tooltip-left-bottom {
|
||||
|
||||
&:after {
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent transparent themed(tooltipImportantBackgroundColor) themed(tooltipImportantBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ng-tooltip-right-bottom {
|
||||
|
||||
&:before {
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent themed(tooltipImportantBackgroundColor) themed(tooltipImportantBackgroundColor) transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.critical {
|
||||
padding: 2.5rem;
|
||||
|
||||
@include themify($themes) {
|
||||
background: themed(tooltipCriticalBackgroundColor);
|
||||
color: themed(accountMainTextColor);
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&.ng-tooltip-left-bottom {
|
||||
|
||||
&:after {
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent transparent themed(tooltipCriticalBackgroundColor) themed(tooltipCriticalBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ng-tooltip-right-bottom {
|
||||
|
||||
&:before {
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent themed(tooltipCriticalBackgroundColor) themed(tooltipCriticalBackgroundColor) transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
font-size: 1.3rem;
|
||||
line-height: 1.8rem;
|
||||
white-space: pre-wrap;
|
||||
|
||||
.standard-update {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2.7rem;
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.important-update {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2.7rem;
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(tooltipImportantTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.critical-update {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2.7rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wrong-time {
|
||||
font-size: 1.5rem;
|
||||
line-height: 2.7rem;
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(tooltipImportantTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin: 1.5rem 0;
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(tooltipCriticalTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ng-tooltip-left-bottom {
|
||||
margin-left: -1.5rem;
|
||||
|
||||
&:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0.6rem;
|
||||
right: -1rem;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent transparent themed(tooltipBackgroundColor) themed(tooltipBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.ng-tooltip-right-bottom {
|
||||
margin-left: 1.5rem;
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0.6rem;
|
||||
left: -1rem;
|
||||
border-width: 0.5rem;
|
||||
border-style: solid;
|
||||
|
||||
@include themify($themes) {
|
||||
border-color: transparent themed(tooltipBackgroundColor) themed(tooltipBackgroundColor) transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ngx-contextmenu {
|
||||
|
||||
.dropdown-menu {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ $themes: (
|
|||
optionalTextColor: #556576,
|
||||
blueTextColor: #4db1ff,
|
||||
greenTextColor: #5cda9d,
|
||||
orangeTextColor: #ff6f00,
|
||||
redTextColor: #ff5252,
|
||||
blueButtonBackgroundColor: #4db1ff,
|
||||
blueButtonHoverColor: #82d7ff,
|
||||
|
|
@ -46,6 +47,10 @@ $themes: (
|
|||
chartOptionsBackgroundColor: #2b3644,
|
||||
chartOptionsHoverColor: #556576,
|
||||
tooltipBackgroundColor: #42505f,
|
||||
tooltipImportantTextColor: #ff6f00,
|
||||
tooltipImportantBackgroundColor: #5f2b11,
|
||||
tooltipCriticalTextColor: #ff5252,
|
||||
tooltipCriticalBackgroundColor: #5f1d1d,
|
||||
tooltipShadow: 0 0 1rem rgba(0, 0, 0, 0.5),
|
||||
modalBackground: url(~src/assets/images/background-dark.png),
|
||||
closeButtonColor: #556576
|
||||
|
|
@ -62,6 +67,7 @@ $themes: (
|
|||
optionalTextColor: #565c62,
|
||||
blueTextColor: #42a5f5,
|
||||
greenTextColor: #47cf8d,
|
||||
orangeTextColor: #ff6f00,
|
||||
redTextColor: #ff5252,
|
||||
blueButtonBackgroundColor: #42a5f5,
|
||||
blueButtonHoverColor: #86d6ff,
|
||||
|
|
@ -97,6 +103,10 @@ $themes: (
|
|||
chartOptionsBackgroundColor: #292d31,
|
||||
chartOptionsHoverColor: #515960,
|
||||
tooltipBackgroundColor: #3e464c,
|
||||
tooltipImportantTextColor: #ff6f00,
|
||||
tooltipImportantBackgroundColor: #55240d,
|
||||
tooltipCriticalTextColor: #ff5252,
|
||||
tooltipCriticalBackgroundColor: #4c1919,
|
||||
tooltipShadow: 0 0 1rem rgba(0, 0, 0, 0.5),
|
||||
modalBackground: url(~src/assets/images/background-gray.png),
|
||||
closeButtonColor: #515960
|
||||
|
|
@ -113,6 +123,7 @@ $themes: (
|
|||
optionalTextColor: #a0a5ab,
|
||||
blueTextColor: #2c95f1,
|
||||
greenTextColor: #46c172,
|
||||
orangeTextColor: #ff6f00,
|
||||
redTextColor: #ff5252,
|
||||
blueButtonBackgroundColor: #2c95f1,
|
||||
blueButtonHoverColor: #5cb3ff,
|
||||
|
|
@ -148,6 +159,10 @@ $themes: (
|
|||
chartOptionsBackgroundColor: #e0e0e0,
|
||||
chartOptionsHoverColor: #ffffff,
|
||||
tooltipBackgroundColor: #ffffff,
|
||||
tooltipImportantTextColor: #ffffff,
|
||||
tooltipImportantBackgroundColor: #ef6c00,
|
||||
tooltipCriticalTextColor: #ffffff,
|
||||
tooltipCriticalBackgroundColor: #e53935,
|
||||
tooltipShadow: 0 0 1rem rgba(120, 120, 120, 0.5),
|
||||
modalBackground: url(~src/assets/images/background-white.png),
|
||||
closeButtonColor: #43454b
|
||||
|
|
|
|||
|
|
@ -202,31 +202,93 @@ app-sidebar {
|
|||
background-color: themed(onlineColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.progress-bar-container {
|
||||
.progress-bar-container {
|
||||
|
||||
.syncing {
|
||||
.syncing {
|
||||
|
||||
.progress-bar {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarBackgroundColor);
|
||||
}
|
||||
|
||||
.fill {
|
||||
.progress-bar {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarFullBackgroundColor);
|
||||
background-color: themed(progressBarBackgroundColor);
|
||||
}
|
||||
|
||||
.fill {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarFullBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
.loading {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarFullBackgroundColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.update-container {
|
||||
|
||||
.standard {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(progressBarFullBackgroundColor);
|
||||
color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.important {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(orangeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.critical {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(redTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
|
||||
@include themify($themes) {
|
||||
color: themed(orangeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
|
||||
&.standard {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(blueTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.important {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(orangeTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.critical {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(redTextColor);
|
||||
}
|
||||
}
|
||||
|
||||
&.time {
|
||||
|
||||
@include themify($themes) {
|
||||
background-color: themed(orangeTextColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,3 +80,13 @@ body {
|
|||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.update-tooltip {
|
||||
|
||||
.tooltip-inner {
|
||||
|
||||
.icon {
|
||||
mask: url(assets/icons/update-alert.svg) no-repeat center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||