Skip to content

Commit ef807d1

Browse files
committed
Updated README.md
1 parent 3d93465 commit ef807d1

File tree

3 files changed

+50
-25
lines changed

3 files changed

+50
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
22
<a href="https://github.com/victor-savinov/history-manager">
3-
<img src="https://github.com/victor-savinov/history-manager/blob/master/assets/icons/128.png">
3+
<img src="https://github.com/victor-savinov/icons/blob/master/history-manager/raised-128.png">
44
</a>
55
</p>
66

satus.css

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@
169169
1.0 Default
170170
---------------------------------------------------------------*/
171171

172+
html, body
173+
{
174+
margin: 0
175+
}
176+
172177
html
173178
{
174179
--satus-theme-primary: #f6b465;
@@ -535,11 +540,6 @@ body[data-appearance='home'] .satus-text--title
535540
margin: 0 0 0 8px;
536541
}
537542

538-
.satus-select__label
539-
{
540-
flex: 1
541-
}
542-
543543
.satus-select__value
544544
{
545545
font-size: 12px;
@@ -664,7 +664,6 @@ body[data-appearance='home'] .satus-text--title
664664
.satus-switch__label
665665
{
666666
padding: 0 16px 0 0;
667-
flex: 1;
668667
}
669668

670669

@@ -1144,8 +1143,6 @@ body[data-appearance='home'] .satus-text--title
11441143
.satus-scrollbar__content
11451144
{
11461145
display: inline-block;
1147-
1148-
min-height: 100%;
11491146
}
11501147

11511148
.satus-scrollbar__thumb
@@ -1286,7 +1283,7 @@ body[data-appearance='home'] .satus-text--title
12861283

12871284
.satus-dialog .satus-button
12881285
{
1289-
justify-content: flex-start
1286+
justify-content: flex-start;
12901287
}
12911288

12921289
/*---------------------------------------------------------------

satus.js

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,24 @@ satus.aes.decrypt = async function(text, password) {
111111
name: 'AES-GCM',
112112
iv: new Uint8Array(iv)
113113
};
114-
115-
return new TextDecoder().decode(await crypto.subtle.decrypt(
116-
algorithm,
117-
await crypto.subtle.importKey(
118-
'raw',
119-
await crypto.subtle.digest('SHA-256', new TextEncoder().encode(password)),
114+
115+
try {
116+
var data = new TextDecoder().decode(await crypto.subtle.decrypt(
120117
algorithm,
121-
false,
122-
['decrypt']
123-
),
124-
new Uint8Array(atob(text.slice(24)).match(/[\s\S]/g).map(ch => ch.charCodeAt(0)))
125-
));
118+
await crypto.subtle.importKey(
119+
'raw',
120+
await crypto.subtle.digest('SHA-256', new TextEncoder().encode(password)),
121+
algorithm,
122+
false,
123+
['decrypt']
124+
),
125+
new Uint8Array(atob(text.slice(24)).match(/[\s\S]/g).map(ch => ch.charCodeAt(0)))
126+
));
127+
} catch (err) {
128+
return false;
129+
}
130+
131+
return data;
126132
};
127133

128134
/*--------------------------------------------------------------
@@ -820,8 +826,8 @@ satus.storage.import = function(name, callback) {
820826
chrome.storage.local.get(function(items) {
821827
satus.storage.data = items;
822828

823-
if (callback) {
824-
callback(items);
829+
if (name) {
830+
name(items);
825831
}
826832
});
827833
} else {
@@ -1967,6 +1973,14 @@ Satus.components.dialog = function(element) {
19671973

19681974
function keydown(event) {
19691975
if (event.keyCode === 27) {
1976+
if (element.clickclose === false) {
1977+
return false;
1978+
}
1979+
1980+
if (typeof element.onclickclose === 'function') {
1981+
element.onclickclose();
1982+
}
1983+
19701984
event.preventDefault();
19711985

19721986
close();
@@ -1992,11 +2006,25 @@ Satus.components.dialog = function(element) {
19922006
}
19932007
}
19942008

1995-
component_scrim.addEventListener('click', close);
1996-
window.addEventListener('keydown', keydown);
2009+
component_scrim.addEventListener('click', function() {
2010+
if (element.clickclose === false) {
2011+
return false;
2012+
}
2013+
2014+
if (typeof element.onclickclose === 'function') {
2015+
element.onclickclose();
2016+
}
2017+
2018+
close();
2019+
});
2020+
window.addEventListener('keydown', function(event) {
2021+
keydown(event);
2022+
});
19972023

19982024
component.appendChild(component_scrim);
19992025
component.appendChild(component_surface);
2026+
2027+
component.close = close;
20002028

20012029
// OPTIONS
20022030

0 commit comments

Comments
 (0)