[1.2] Adding a linter and reformat all code

This commit is contained in:
vermillion-dev
2019-05-30 23:11:40 +02:00
parent 527500a438
commit 86f26a4660
15 changed files with 404 additions and 404 deletions

View File

@@ -1,22 +1,22 @@
/* Inject scripts don't forget to add them to web_accessible_resources in manifest */
injectScript(chrome.extension.getURL('contentScripts/search/accessSearch.js'), 'head');
function addDlButton(idx, torrentId, yggToken) {
var cell = table.rows[idx].cells[2];
var downloadButton = document.createElement('a')
var downloadIcon = document.createElement('img')
downloadIcon.setAttribute('src', chrome.extension.getURL("img/download.png"));
downloadButton.appendChild(downloadIcon);
downloadButton.setAttribute('href', "https://www2.yggtorrent.ch/rss/download?id=" + torrentId + "&passkey=" + yggToken);
cell.appendChild(downloadButton);
}
/********************************************************************/
chrome.storage.sync.get(['yggToken'], function(value){
if(value.yggToken){
for (var i = 0; i < table.rows.length; i++) {
var torrentId = table.rows[i].cells[2].children[0].getAttribute('target')
addDlButton(i, torrentId, value.yggToken);
}
/* Retrieve credentials from Google Storage*/
chrome.storage.sync.get(['yggToken'], function (value) {
if (value.yggToken) {
/* Add a download button on each torrent line */
var table = document.getElementsByTagName('tbody')[1];
for (var i = 0; i < table.rows.length; i++) {
var torrentId = table.rows[i].cells[2].children[0].getAttribute('target')
var cell = table.rows[i].cells[2];
var downloadButton = document.createElement('a')
var downloadIcon = document.createElement('img')
downloadIcon.setAttribute('src', chrome.extension.getURL("img/download.png"));
downloadButton.appendChild(downloadIcon);
downloadButton.setAttribute('href', "https://www2.yggtorrent.ch/rss/download?id=" + torrentId + "&passkey=" + value.yggToken);
cell.appendChild(downloadButton);
}
});
}
}
});