1
|
|
|
/** |
2
|
|
|
* @copyright Copyright (c) 2017 Matthias Held <[email protected]> |
3
|
|
|
* |
4
|
|
|
* @author Matthias Held <[email protected]> |
5
|
|
|
* |
6
|
|
|
* @license GNU AGPL version 3 or any later version |
7
|
|
|
* |
8
|
|
|
* This program is free software: you can redistribute it and/or modify |
9
|
|
|
* it under the terms of the GNU Affero General Public License as |
10
|
|
|
* published by the Free Software Foundation, either version 3 of the |
11
|
|
|
* License, or (at your option) any later version. |
12
|
|
|
* |
13
|
|
|
* This program is distributed in the hope that it will be useful, |
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
|
|
|
* GNU Affero General Public License for more details. |
17
|
|
|
* |
18
|
|
|
* You should have received a copy of the GNU Affero General Public License |
19
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
/* global OC */ |
23
|
|
|
(function() { |
24
|
|
|
|
25
|
|
|
if (!OCA.RansomwareDetection) { |
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* Namespace for the ransomware recovery app |
28
|
|
|
* @namespace OCA.RansomwareDetection |
29
|
|
|
*/ |
30
|
|
|
OCA.RansomwareDetection = {}; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @namespace OCA.RansomwareDetection.App |
35
|
|
|
*/ |
36
|
|
|
OCA.RansomwareDetection.App = { |
37
|
|
|
utils: null, |
38
|
|
|
/** |
39
|
|
|
* File list for the "Ransomware recovery" section |
40
|
|
|
* |
41
|
|
|
* @member {OCA.RansomwareDetection.FileList} |
42
|
|
|
*/ |
43
|
|
|
fileList: null, |
44
|
|
|
/** |
45
|
|
|
* Scan for the "Ransomware recovery" section |
46
|
|
|
* |
47
|
|
|
* @member {OCA.RansomwareDetection.Scan} |
48
|
|
|
*/ |
49
|
|
|
scan: null, |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Initializes the ransomware recovery app |
53
|
|
|
*/ |
54
|
|
|
initialize: function() { |
55
|
|
|
if (typeof OCA.RansomwareDetection.Utils != 'undefined') { |
|
|
|
|
56
|
|
|
this.utils = new OCA.RansomwareDetection.Utils(); |
57
|
|
|
window.Utils = this.utils; |
58
|
|
|
} |
59
|
|
|
if (typeof OCA.RansomwareDetection.FileList != 'undefined') { |
60
|
|
|
this.fileList = new OCA.RansomwareDetection.FileList( |
61
|
|
|
$('#app-content-ransomware-detection-filelist'), {} |
62
|
|
|
); |
63
|
|
|
window.FileList = this.fileList; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
if (typeof OCA.RansomwareDetection.Scan != 'undefined') { |
67
|
|
|
this.scan = new OCA.RansomwareDetection.Scan( |
68
|
|
|
$('#app-content-ransomware-detection-scan'), {} |
69
|
|
|
); |
70
|
|
|
window.Scan = this.scan; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
OC.Plugins.attach('OCA.RansomwareDetection.App', this); |
74
|
|
|
}, |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Destroy the app |
78
|
|
|
*/ |
79
|
|
|
destroy: function() { |
80
|
|
|
if (typeof OCA.RansomwareDetection.Utils != 'undefined') { |
|
|
|
|
81
|
|
|
this.utils.destroy(); |
82
|
|
|
this.utils = null; |
83
|
|
|
} |
84
|
|
|
if (typeof OCA.RansomwareDetection.Scan != 'undefined') { |
85
|
|
|
this.fileList.destroy(); |
86
|
|
|
this.fileList = null; |
87
|
|
|
} |
88
|
|
|
if (typeof OCA.RansomwareDetection.Scan != 'undefined') { |
89
|
|
|
this.scan.destroy(); |
90
|
|
|
this.scan = null; |
91
|
|
|
} |
92
|
|
|
} |
93
|
|
|
} |
94
|
|
|
})(); |
95
|
|
|
|
96
|
|
|
$(document).ready(function() { |
97
|
|
|
_.defer(function() { |
|
|
|
|
98
|
|
|
OCA.RansomwareDetection.App.initialize(); |
|
|
|
|
99
|
|
|
}); |
100
|
|
|
}); |
101
|
|
|
|
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.