站点配置.js
1.34 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
// ==UserScript==
// @name 站点配置
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://*/*/admin/modules
// @grant none
// ==/UserScript==
(function($) {
'use strict';
var MOUDLE_LIST = {
0: [
'D8 Editor file upload',
'Linkit',
'Sysu CKEditor'
],
1: [
'Autogrow',
'CKEditor Color Button',
'CKEditor Font',
'Panel Button',
'CKEditor Upload Image',
],
2: [
'Sysu User'
],
3:[
'Password Character Length Policy',
'Password Character Type Policy',
'Password Policy'
],
4:[
'Sysu Password Policy'
]
}
// Your code here...
function setMoudle(e) {
e.parents('td').siblings('.checkbox').find('input').click();
}
function inspectMoudle(e) {
return e.parents('td').siblings('.checkbox').find('input').is(':checked');
}
$.each(MOUDLE_LIST, function(index) {
var b = false;
$('label').each(function() {
var self = $(this);
var text = $(this).text();
$.each(MOUDLE_LIST[index], function(index, arr) {
if (text == arr && !inspectMoudle(self)) {
b = true;
setMoudle(self);
}
});
});
if (b) {
return false;
}
});
})(jQuery);