diff --git a/.gitignore b/.gitignore index 6594807..0e8bb4a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .vscode Capture .eslintrc.json +docs/.DS_Store diff --git a/README.md b/README.md index 8766bb1..4f932c0 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,21 @@ Chrome extension for the website yggtorrent.org ## Installation 1. Clonez le dépôt : `git clone https://github.com/NohamR/BetterYGG` - 2. Ouvrez Chrome et allez à `chrome://extensions/` - 3. Activez le mode développeur - 4. Cliquez sur "Charger l'extension non empaquetée" - 5. Sélectionnez le dossier du dépôt cloné + + +## Configuration importante + +**N'oubliez pas d'entrer votre token YGG dans les options de l'extension !** Rendez-vous dans les options et ajoutez votre token disponible sur [votre compte YGG](https://www.yggtorrent.org/user/account). + + + + + Cette extension conçue pour le site yggtorrent.org permet de télécharger des torrents sans être authentifié. Pour cela rendez vous dans les options de l'extension et introduisez votre token Ygg. Ce token est disponible dans l'onglet mon compte du site. Note: Cette extension utilise désormais yggapi.eu pour le téléchargement des torrents (API non officielle). diff --git a/contentScripts/addTorrent/accessAddTorrent.js b/contentScripts/addTorrent/accessAddTorrent.js index c67a46b..acb4b86 100644 --- a/contentScripts/addTorrent/accessAddTorrent.js +++ b/contentScripts/addTorrent/accessAddTorrent.js @@ -1,3 +1,4 @@ var downloadButton = document.querySelector('a.butt'); -downloadButton.onclick = function () {}; -downloadButton.removeAttribute('onclick'); +if (downloadButton) { + downloadButton.onclick = function() { window.location.href = this.href; }; +} diff --git a/contentScripts/addTorrent/addTorrent.js b/contentScripts/addTorrent/addTorrent.js index cdbc8d5..bb678ae 100644 --- a/contentScripts/addTorrent/addTorrent.js +++ b/contentScripts/addTorrent/addTorrent.js @@ -15,6 +15,7 @@ downloadLine.insertAdjacentElement('afterend', torrentInfo); /* Add third party download button */ var downloadButton = downloadLine.querySelector('a.butt'); +downloadButton.removeAttribute('id'); // remove "download-timer-btn" var flexButton = document.createElement('a'); flexButton.appendChild(document.createTextNode('Télécharger via discord ')); var span = document.createElement('span'); diff --git a/contentScripts/allPages/accessAllPages.js b/contentScripts/allPages/accessAllPages.js index 3c913e6..db2447f 100644 --- a/contentScripts/allPages/accessAllPages.js +++ b/contentScripts/allPages/accessAllPages.js @@ -1,9 +1,13 @@ hideSidebar(); -$(window).on('resize', function () { +window.addEventListener('resize', function () { hideSidebar(); }); function hideSidebar() { - $(window).width() < 1750 ? $('#cat, .back-cat').removeClass('active') : $('#cat, .back-cat').addClass('active'); + if (window.innerWidth < 1750) { + document.querySelectorAll('#cat, .back-cat').forEach(el => el.classList.remove('active')); + } else { + document.querySelectorAll('#cat, .back-cat').forEach(el => el.classList.add('active')); + } } diff --git a/docs/images/dev-mode.png b/docs/images/dev-mode.png new file mode 100644 index 0000000..46e24b5 Binary files /dev/null and b/docs/images/dev-mode.png differ diff --git a/docs/images/options.png b/docs/images/options.png new file mode 100644 index 0000000..013b658 Binary files /dev/null and b/docs/images/options.png differ diff --git a/docs/images/token.png b/docs/images/token.png new file mode 100644 index 0000000..104dad1 Binary files /dev/null and b/docs/images/token.png differ diff --git a/options/options.html b/options/options.html index 4746789..4e13baa 100644 --- a/options/options.html +++ b/options/options.html @@ -1,101 +1,187 @@ - + +
+ +
+