mirror of
https://github.com/alexadam/save-as-ebook.git
synced 2025-09-16 20:29:47 +00:00
super TMP
This commit is contained in:
parent
b168580a47
commit
606ed53f2a
9 changed files with 146 additions and 18 deletions
40
chapter-editor/editor.js
Normal file
40
chapter-editor/editor.js
Normal file
|
@ -0,0 +1,40 @@
|
|||
// var chapterHolder = document.getElementById('chapters');
|
||||
var list = document.getElementById('chapters');
|
||||
var title = localStorage.getItem('title');
|
||||
if (title === null) {
|
||||
title = [];
|
||||
} else {
|
||||
title = JSON.parse(title);
|
||||
}
|
||||
|
||||
for (var i = 0; i < title.length; i++) {
|
||||
var listItem = document.createElement('li');
|
||||
var label = document.createElement('span');
|
||||
label.innerHTML = title[i].title;
|
||||
listItem.appendChild(label);
|
||||
list.appendChild(listItem);
|
||||
}
|
||||
|
||||
|
||||
document.getElementById('closeButton').onclick = function () {
|
||||
chrome.tabs.query({
|
||||
currentWindow: true,
|
||||
active: true
|
||||
// Select active tab of the current window
|
||||
}, function(tab) {
|
||||
chrome.tabs.sendMessage(
|
||||
// Send a message to the content script
|
||||
tab[0].id, { line: 'countparas' }
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
browser.runtime.onMessage.addListener(function(request) {
|
||||
console.log('cccccc', request);
|
||||
|
||||
|
||||
});
|
||||
|
||||
document.getElementById('saveButton').onclick = function () {
|
||||
window.open(window.location, '_self').close();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue