Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Update keyCode, fixed Merge Into One File.
Browse files Browse the repository at this point in the history
  • Loading branch information
lelinhtinh committed Dec 24, 2020
1 parent fc13a03 commit 303a5ca
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions manga_comic_downloader/manga_comic_downloader.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @namespace https://baivong.github.io
// @description Tải truyện tranh từ các trang chia sẻ ở Việt Nam. Nhấn Alt+Y để tải toàn bộ.
// @description:vi Tải truyện tranh từ các trang chia sẻ ở Việt Nam. Nhấn Alt+Y để tải toàn bộ.
// @version 3.0.0
// @version 3.0.1
// @icon https://i.imgur.com/ICearPQ.png
// @author Zzbaivong
// @license MIT; https://baivong.mit-license.org/license.txt
Expand Down Expand Up @@ -418,19 +418,20 @@ jQuery(function ($) {

dlAll.push(_link);

var color = e.shiftKey ? 'violet' : 'purple';
$(targetLink('[href="' + _link + '"]')).css({
color: 'violet',
color: color,
textDecoration: 'overline',
textShadow: '0 0 1px violet, 0 0 1px violet, 0 0 1px violet',
textShadow: '0 0 1px ' + color + ', 0 0 1px ' + color + ', 0 0 1px ' + color,
});
}
})
.on('keyup', function (e) {
if (e.which === 17 || e.which === 16) {
if (e.key === 'Control' || e.key === 'Shift') {
e.preventDefault();

if (dlAll.length && inCustom) {
if (e.which === 16) inMerge = true;
if (e.key === 'Shift') inMerge = true;
downloadAll();
}
}
Expand Down Expand Up @@ -462,6 +463,7 @@ jQuery(function ($) {
function endZip() {
if (!inMerge) {
zipObj = {};
if (recentZip) URL.revokeObjectURL(recentZip);
recentZip = null;
}

Expand Down Expand Up @@ -782,7 +784,7 @@ jQuery(function ($) {
dlImg(
dlCurrent,
function (response, filename) {
zipObj[filename] = [
zipObj[path + filename] = [
new Uint8Array(response.response),
{
level: 0,
Expand Down Expand Up @@ -1628,7 +1630,7 @@ jQuery(function ($) {
GM_registerMenuCommand('Download All To One File', downloadAllOne);

$doc.on('keydown', function (e) {
if (e.which === 89 && e.altKey) {
if (e.code === 'KeyY' && e.altKey) {
// Alt+Y
e.preventDefault();
e.shiftKey ? downloadAllOne() : downloadAll();
Expand Down

0 comments on commit 303a5ca

Please sign in to comment.