Skip to content

Commit 5656a01

Browse files
committed
Fixed problem with settings per site
1 parent 8274764 commit 5656a01

4 files changed

Lines changed: 42 additions & 16 deletions

File tree

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "Dark Mode",
4-
"version": "2.1.0",
4+
"version": "2.1.1",
55
"description": "Dark Mode, read at night. Bluelight filter for every website. Relax your eyes at night and day.",
66
"default_locale": "en",
77
"icons": {

popup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ var current_domain,
161161
beforerender: function (target) {
162162
var item = (current_domain || '...');
163163

164+
console.log(current_domain);
165+
164166
target.items = ['global', item];
165167

166168
if (satus.storage.get('websites/' + current_domain + '/filters/global') === false) {
@@ -1576,6 +1578,8 @@ satus.storage.import(function (items) {
15761578
variant: 'error'
15771579
};
15781580
} else {
1581+
current_domain = response;
1582+
15791583
skeleton.layers.toolbar = {
15801584
component: 'switch',
15811585
class: 'satus-switch--domain',

satus.css

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ body {
3636
--satus-text-field--background: #e8e8e3;
3737
--satus-text-field--border: #d6d6cd;
3838
--satus-text-field--text: #848471;
39-
--satus-switch-track: #b8b8b8;
39+
--satus-switch-track: #e0e0e0;
4040
--satus-switch-track--active: var(--satus-primary);
4141
--satus-switch-thumb: #fff;
4242
--satus-tabs: #fff;
@@ -471,6 +471,11 @@ body[theme=black] {
471471
width: 20px;
472472
margin: 2px 16px 0 0;
473473
color: var(--satus-primary);
474+
}
475+
476+
.satus-section--card>.satus-span {
477+
display: flex;
478+
align-items: center;
474479
}
475480
/*--------------------------------------------------------------
476481
# SCROLLBAR
@@ -767,12 +772,12 @@ body[theme=black] {
767772
--------------------------------------------------------------*/
768773

769774
.satus-switch>i {
770-
width: 38px;
771-
height: 20px;
775+
width: 32px;
776+
height: 18px;
772777
transition: background-color 150ms;
773-
border-radius: 20px;
778+
border-radius: 18px;
774779
background-color: var(--satus-switch-track);
775-
flex: 0 0 38px;
780+
flex: 0 0 32px;
776781
}
777782

778783
.satus-section--card .satus-switch>i {
@@ -790,8 +795,8 @@ body[theme=black] {
790795

791796
.satus-switch>i::before {
792797
display: block;
793-
width: 16px;
794-
height: 16px;
798+
width: 14px;
799+
height: 14px;
795800
margin: 2px;
796801
content: '';
797802
transition: transform 150ms cubic-bezier(.4, 0, .2, 1);
@@ -801,7 +806,7 @@ body[theme=black] {
801806
}
802807

803808
.satus-switch[data-value='true']>i::before {
804-
transform: translateX(18px);
809+
transform: translateX(14px);
805810
}
806811
/*--------------------------------------------------------------
807812
>>> SLIDER
@@ -1199,7 +1204,7 @@ body[theme=black] {
11991204
padding: 0 12px;
12001205
color: var(--satus-header-text);
12011206
background: var(--satus-header-background);
1202-
box-shadow: 0 1px 2px rgb(47, 41, 34, .16);
1207+
box-shadow: 0 0 3px rgb(0, 0, 0, .1);
12031208
align-items: center;
12041209
justify-content: space-between;
12051210
}
@@ -1213,16 +1218,19 @@ body[theme=black] {
12131218
border-radius: 50%;
12141219
}
12151220

1216-
.satus-header .satus-section--align-start>* {
1221+
.satus-header .satus-section--align-start > * {
12171222
margin-right: 8px;
12181223
}
12191224

12201225
.satus-header .satus-span--title {
1226+
font-size: 15px;
12211227
overflow: hidden;
12221228
white-space: nowrap;
1229+
letter-spacing: .0125em;
12231230
text-overflow: ellipsis;
12241231
flex: 1;
1225-
}
1232+
}
1233+
12261234
/*--------------------------------------------------------------
12271235
>>> ALERT
12281236
--------------------------------------------------------------*/
@@ -1286,7 +1294,6 @@ body[theme=black] {
12861294
box-sizing: border-box;
12871295
width: 100%;
12881296
margin: 0;
1289-
padding: 0;
12901297
padding: 0 8px;
12911298
color: var(--satus-text-field--text, inherit);
12921299
border: none;
@@ -1295,7 +1302,6 @@ body[theme=black] {
12951302
appearance: none;
12961303
font-size: 16px;
12971304
margin: 8px 0;
1298-
padding: 4px 8px;
12991305
border: 1px solid var(--satus-text-field--border);
13001306
border-radius: 4px;
13011307
background-color: var(--satus-text-field--background);

satus.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,13 @@ satus.class = function (element, string) {
146146
# EMPTY
147147
--------------------------------------------------------------*/
148148

149-
satus.empty = function (element) {
149+
satus.empty = function (element, exclude = []) {
150150
for (var i = element.childNodes.length - 1; i > -1; i--) {
151-
element.childNodes[i].remove();
151+
var child = element.childNodes[i];
152+
153+
if (exclude.indexOf(child) === -1) {
154+
child.remove();
155+
}
152156
}
153157
};
154158

@@ -293,6 +297,17 @@ satus.storage.set = function (name, value) {
293297
};
294298

295299

300+
/*--------------------------------------------------------------
301+
# REMOVE
302+
--------------------------------------------------------------*/
303+
304+
satus.storage.remove = function (name) {
305+
delete this.data[name];
306+
307+
chrome.storage.local.remove(name);
308+
};
309+
310+
296311
/*--------------------------------------------------------------
297312
# IMPORT
298313
--------------------------------------------------------------*/
@@ -1347,6 +1362,7 @@ satus.components.slider = function (skeleton) {
13471362
component.values[handle_index] = value;
13481363

13491364
component.storageValue = component.values.length === 1 ? component.values[0] : component.values;
1365+
component.value = component.storageValue;
13501366

13511367
component.storageChange();
13521368
}

0 commit comments

Comments
 (0)