Skip to content

Commit

Permalink
v3.120-testing.3
Browse files Browse the repository at this point in the history
  • Loading branch information
adokseo committed Jan 27, 2021
1 parent 9a5a4ba commit d566e14
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ html:not([it-improvedtube-home='list']) .satus-main__container[data-appearance='
{
text-align: center;
pointer-events: none;
line-height: 12px;
}

html:not([it-improvedtube-home='list']) .satus-main__container[data-appearance='home'] .satus-folder:focus,
Expand Down
38 changes: 23 additions & 15 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2981,8 +2981,20 @@ function themeChange(event) {
}
}

satus.storage.import(function() {
for (var key in satus.storage.data) {
satus.storage.import(function(items) {
satus.locale.import(satus.storage.get('language'), function() {
satus.modules.updateStorageKeys(Menu, function() {
if (location.href.indexOf('action=import') !== -1) {
importData();
} else if (location.href.indexOf('action=export') !== -1) {
exportData();
} else {
satus.render(Menu, document.body);
}
});
});

for (var key in satus.storage) {
document.documentElement.setAttribute('it-' + key.replace(/_/g, '-'), items[key]);
}

Expand Down Expand Up @@ -3017,18 +3029,6 @@ satus.storage.import(function() {
if (satus.storage.get('black_theme') === true) {
document.documentElement.setAttribute('theme', 'black');
}

satus.locale.import(satus.storage.get('language'), function() {
satus.modules.updateStorageKeys(Menu, function() {
if (location.href.indexOf('action=import') !== -1) {
importData();
} else if (location.href.indexOf('action=export') !== -1) {
exportData();
} else {
satus.render(Menu, document.body);
}
});
});
});

chrome.storage.onChanged.addListener(function(changes) {
Expand Down Expand Up @@ -3101,7 +3101,15 @@ function importData() {
}

function exportData() {
var blob = new Blob([JSON.stringify(satus.storage.data)], {
var data = {};

for (var key in satus.storage) {
if (typeof satus.storage[key] !== 'function') {
data[key] = satus.storage[key];
}
}

var blob = new Blob([JSON.stringify(data)], {
type: 'application/json;charset=utf-8'
});

Expand Down
2 changes: 1 addition & 1 deletion satus.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ satus.storage.import = function(callback) {
}

if (callback) {
callback();
callback(items);
}
});
};
Expand Down

0 comments on commit d566e14

Please sign in to comment.