1
|
|
|
// jshint esversion: 8 |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
$(document).on('drop', function(...) {...}); |
5
|
|
|
Prevent drop redirect |
6
|
|
|
parameters |
7
|
|
|
event (object) |
8
|
|
|
*/ |
9
|
|
|
$(document).on('drop', function(event) { |
10
|
|
|
ipcRenderer.send('app:debug', "Preventing drag and drop redirect"); |
|
|
|
|
11
|
|
|
event.preventDefault(); |
12
|
|
|
|
13
|
|
|
return false; |
14
|
|
|
}); |
15
|
|
|
|
16
|
|
|
/* |
17
|
|
|
$(document).on('dragover', function(...) {...}); |
18
|
|
|
Prevent drag over redirect |
19
|
|
|
parameters |
20
|
|
|
event (object) |
21
|
|
|
*/ |
22
|
|
|
$(document).on('dragover', function(event) { |
23
|
|
|
event.preventDefault(); |
24
|
|
|
|
25
|
|
|
return false; |
26
|
|
|
}); |
27
|
|
|
|
28
|
|
|
/* |
29
|
|
|
$('#navButtonDevtools').click(function() {...}); |
30
|
|
|
On click: Button toggle developer tools |
31
|
|
|
*/ |
32
|
|
|
$('#navButtonDevtools').click(function() { |
33
|
|
|
remote.getCurrentWindow().toggleDevTools(); |
|
|
|
|
34
|
|
|
ipcRenderer.send('app:debug', "#navButtonDevtools was clicked"); |
|
|
|
|
35
|
|
|
|
36
|
|
|
return; |
|
|
|
|
37
|
|
|
}); |
38
|
|
|
|
39
|
|
|
/* |
40
|
|
|
$('section.tabs ul li').click(function() {...}); |
41
|
|
|
On click: Toggle between tabs |
42
|
|
|
*/ |
43
|
|
|
$('section.tabs ul li').click(function() { |
44
|
|
|
var tabName = $(this).attr('data-tab'); |
45
|
|
|
|
46
|
|
|
if (tabName != '#') { |
47
|
|
|
$('section.tabs ul li').removeClass('is-active'); |
48
|
|
|
$('div.container .tab-content').removeClass('current'); |
49
|
|
|
|
50
|
|
|
$(this).addClass('is-active'); |
51
|
|
|
$("#" + tabName).addClass('current'); |
52
|
|
|
} |
53
|
|
|
ipcRenderer.send('app:debug', "#section.tabs switched to data tab, {0}".format(tabName)); |
|
|
|
|
54
|
|
|
|
55
|
|
|
return; |
|
|
|
|
56
|
|
|
}); |
57
|
|
|
|
58
|
|
|
/* |
59
|
|
|
$('.delete').click(function() {...}); |
60
|
|
|
On click: Delete open notifications |
61
|
|
|
*/ |
62
|
|
|
$('.delete').click(function() { |
63
|
|
|
ipcRenderer.send('app:debug', ".delete (notifications) was clicked"); |
|
|
|
|
64
|
|
|
var notificationId = $(this).attr('data-notif'); |
65
|
|
|
|
66
|
|
|
$('#' + notificationId).addClass('is-hidden'); |
67
|
|
|
|
68
|
|
|
return; |
|
|
|
|
69
|
|
|
}); |
70
|
|
|
|
71
|
|
|
/* |
72
|
|
|
$(document).keyup(function(...) {...}); |
73
|
|
|
On keyup: Assign [ESC] key to close messages or modals |
74
|
|
|
*/ |
75
|
|
|
$(document).keyup(function(event) { |
76
|
|
|
if (event.keyCode === 27) { |
77
|
|
|
ipcRenderer.send('app:debug', "Hotkey, Used [ESC] key, {0}".format(event.keyCode)); |
|
|
|
|
78
|
|
|
switch (true) { |
79
|
|
|
|
80
|
|
|
// Single whois tab is active |
81
|
|
|
case ($('#navButtonSw').hasClass('is-active')): |
82
|
|
|
ipcRenderer.send('app:debug', "Hotkey, Single whois tab is active"); |
83
|
|
|
switch (true) { |
84
|
|
|
case ($('#swDomainCopied').hasClass('is-active')): |
85
|
|
|
$('#swDomainCopiedClose').click(); |
86
|
|
|
break; |
87
|
|
|
|
88
|
|
|
// Single whois, Dialog is open |
89
|
|
|
case ($('#swMessageWhois').hasClass('is-active')): |
90
|
|
|
$('#swMessageWhoisClose').click(); |
91
|
|
|
break; |
92
|
|
|
|
93
|
|
|
// Single whois, Information table not hidden |
94
|
|
|
case (!$('#swTableWhoisinfo').hasClass('is-hidden')): |
95
|
|
|
$('#swTableWhoisinfo').addClass('is-hidden'); |
96
|
|
|
break; |
97
|
|
|
|
98
|
|
|
// Single whois, Notification not hidden |
99
|
|
|
case (!$('.notification:not(.is-hidden)').hasClass('is-hidden')): |
100
|
|
|
$('.notification:not(.is-hidden)').addClass('is-hidden'); |
101
|
|
|
break; |
102
|
|
|
} |
103
|
|
|
break; |
104
|
|
|
|
105
|
|
|
// Bulk whois tab is active |
106
|
|
|
case ($('#navButtonBw').hasClass('is-active')): |
107
|
|
|
ipcRenderer.send('app:debug', "Hotkey, Bulk whois tab is active"); |
108
|
|
|
switch (true) { |
109
|
|
|
// Bulk whois, is Stop dialog open |
110
|
|
|
case ($('#bwProcessingModalStop').hasClass('is-active')): |
111
|
|
|
$('#bwProcessingModalStopButtonContinue').click(); |
112
|
|
|
break; |
113
|
|
|
} |
114
|
|
|
break; |
115
|
|
|
} |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
return; |
|
|
|
|
119
|
|
|
}); |
120
|
|
|
|
121
|
|
|
/* |
122
|
|
|
$('#navButtonExtendedmenu').click(function() {...}); |
123
|
|
|
Button/Toggle special menu items |
124
|
|
|
*/ |
125
|
|
|
$('#navButtonExtendedmenu').click(function() { |
126
|
|
|
ipcRenderer.send('app:debug', "#navButtonExtendedmenu was clicked"); |
|
|
|
|
127
|
|
|
$('#navButtonExtendedmenu').toggleClass('is-active'); |
128
|
|
|
$('.is-specialmenu').toggleClass('is-hidden'); |
129
|
|
|
|
130
|
|
|
return; |
|
|
|
|
131
|
|
|
}); |
132
|
|
|
|
133
|
|
|
/* |
134
|
|
|
$('#navButtonMinimize').click(function() {...}); |
135
|
|
|
On click: Minimize window button |
136
|
|
|
*/ |
137
|
|
|
$('#navButtonMinimize').click(function() { |
138
|
|
|
ipcRenderer.send('app:debug', "#navButtonMinimize was clicked"); |
|
|
|
|
139
|
|
|
remote.getCurrentWindow().minimize(); |
|
|
|
|
140
|
|
|
|
141
|
|
|
return; |
|
|
|
|
142
|
|
|
}); |
143
|
|
|
|
144
|
|
|
/* |
145
|
|
|
$('#navButtonExit').click(function() {...}); |
146
|
|
|
On click: Close main window button |
147
|
|
|
*/ |
148
|
|
|
$('#navButtonExit').click(function() { |
149
|
|
|
ipcRenderer.send('app:debug', "#navButtonExit was clicked"); |
|
|
|
|
150
|
|
|
remote.getCurrentWindow().close(); |
|
|
|
|
151
|
|
|
|
152
|
|
|
return; |
|
|
|
|
153
|
|
|
}); |
154
|
|
|
|
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.