mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-14 19:29:50 +00:00
move default styles
This commit is contained in:
parent
9e3ed840fd
commit
ad1abc5f61
2 changed files with 14 additions and 11 deletions
|
@ -32,7 +32,18 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
|
|||
if (request.type === 'get styles') {
|
||||
chrome.storage.local.get('styles', function (data) {
|
||||
if (!data || !data.styles) {
|
||||
sendResponse({styles: []});
|
||||
// TODO move defaultStyles in a different file/location ?
|
||||
var defaultStyles = [
|
||||
{
|
||||
title: 'reddit',
|
||||
url: 'reddit.com',
|
||||
style: `.class: {
|
||||
display: none;
|
||||
}
|
||||
`
|
||||
}
|
||||
];
|
||||
sendResponse({styles: defaultStyles});
|
||||
} else {
|
||||
sendResponse({styles: data.styles});
|
||||
}
|
||||
|
|
|
@ -8,15 +8,7 @@ if (tmp) {
|
|||
}
|
||||
|
||||
var allPagesRef = null;
|
||||
var allStyles = [{
|
||||
title: 'reddit',
|
||||
url: 'reddit.com',
|
||||
style: `
|
||||
.class: {
|
||||
display: none;
|
||||
}
|
||||
`
|
||||
}];
|
||||
var allStyles = [];
|
||||
var currentStyle = null;
|
||||
var currentStyleIndex = -1;
|
||||
|
||||
|
@ -177,7 +169,7 @@ function showEditor() {
|
|||
|
||||
function createStyleList(allStylesTmp) {
|
||||
if (allStylesTmp && allStylesTmp.length > 0) {
|
||||
allStyles = allStyles.slice(0, 0).concat(allStylesTmp);
|
||||
allStyles = allStyles.concat(allStylesTmp);
|
||||
}
|
||||
|
||||
while (existingStyles.hasChildNodes() && existingStyles.childElementCount > 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue