This repository was archived by the owner on Aug 2, 2023. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathdownloads.js
More file actions
85 lines (75 loc) · 3.43 KB
/
Copy pathdownloads.js
File metadata and controls
85 lines (75 loc) · 3.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
function registerListener() {
$(".menuItem").click(function (o) {
return $(this).hasClass("selected") ? (o.preventDefault(), void 0) : ($(".menuItem.selected").removeClass("selected"), $(this).addClass("selected"), $(".tab.activeTab").removeClass("activeTab"), $("#" + $(this).attr("data-tab")).addClass("activeTab"), "multiDownloadsTab" == $(this).attr("data-tab") && initMultiDownloader(), void 0)
})
}
$(document).ready(function () {
try{
if(document.location.hash){
$(".menuItem.selected").removeClass("selected");
$(".tab.activeTab").removeClass("activeTab");
$(document.location.hash+"Menu").addClass("selected");
$("#"+$(document.location.hash+"Menu").attr("data-tab")).addClass("activeTab");
}
} catch(e){
console.log(e);
}
$("#animation").jqxSwitchButton({
theme: "classic",
width: "100",
height: "30",
checked: !localStorage.animation || localStorage.animation==="true"
}), $("#animation").bind("checked", function () {
localStorage.animation = "true";
}), $("#animation").bind("unchecked", function () {
localStorage.animation = "false";
});
void 0 === localStorage.allowGreybar && (localStorage.allowGreybar = "false"), void 0 === localStorage.notiications && (localStorage.notiications = "true");
var o = "true" === localStorage.allowGreybar ? !0 : !1;
$("#downloadBar").jqxSwitchButton({
theme: "classic",
width: "100",
height: "30",
checked: o
}), $("#downloadBar").bind("checked", function () {
localStorage.allowGreybar = "true", chrome.downloads.setShelfEnabled(!0)
}), $("#downloadBar").bind("unchecked", function () {
localStorage.allowGreybar = "false", chrome.downloads.setShelfEnabled(!1)
});
var e = "true" === localStorage.notiications ? !0 : !1;
$("#notification").jqxSwitchButton({
theme: "classic",
width: "100",
height: "30",
checked: e
}), $("#notification").bind("checked", function () {
localStorage.notiications = "true"
}), $("#notification").bind("unchecked", function () {
localStorage.notiications = "false"
})
}), window.onload = function () {
if(localStorage.theme && localStorage.theme=="light"){
$("#light").prop("checked", true);
} else {
$("#dark").prop("checked", true);
localStorage.theme="dark";
}
$("#light").click(function () {
localStorage.theme="light";
chrome.runtime.sendMessage('theme');
});
$("#dark").click(function () {
localStorage.theme="dark";
chrome.runtime.sendMessage('theme');
});
void 0 === localStorage.notificationAction && (localStorage.notificationAction = "open-file"), "open-file" == localStorage.notificationAction ? $("#open-file").prop("checked", !0) : $("#open-folder").prop("checked", !0), $("#open-file").click(function () {
localStorage.notificationAction = "open-file"
}), $("#open-folder").click(function () {
localStorage.notificationAction = "open-folder"
}), registerListener(), "#help" == window.location.hash && $('[data-tab="helpTab"]').trigger("click"), "#settings" == window.location.hash && $('[data-tab="settingsTab"]').trigger("click"), document.getElementById("mShort").onclick = function () {
chrome.tabs.create({
url: "chrome://extensions/configureCommands"
})
}
OpenFileNotWorking();
};