Commit ae6564085b50bb14ad81043926f52d403ef0d416

Authored by muyulingshi
1 parent 204ed3ad

最新

  1 +// ==UserScript==
  2 +// @name 站点配置
  3 +// @namespace http://tampermonkey.net/
  4 +// @version 0.1
  5 +// @description try to take over the world!
  6 +// @author You
  7 +// @match http://*/*/admin/modules
  8 +// @grant none
  9 +// ==/UserScript==
  10 +
  11 +(function($) {
  12 + 'use strict';
  13 +
  14 + var MOUDLE_LIST = {
  15 + 0: [
  16 + 'D8 Editor file upload',
  17 + 'Linkit',
  18 + 'Sysu CKEditor'
  19 + ],
  20 + 1: [
  21 + 'Autogrow',
  22 + 'CKEditor Color Button',
  23 + 'CKEditor Font',
  24 + 'Panel Button',
  25 + 'CKEditor Upload Image',
  26 + ],
  27 + 2: [
  28 + 'Sysu User'
  29 + ],
  30 + 3:[
  31 + 'Password Character Length Policy',
  32 + 'Password Character Type Policy',
  33 + 'Password Policy'
  34 + ],
  35 + 4:[
  36 + 'Sysu Password Policy'
  37 + ]
  38 + }
  39 +
  40 + // Your code here...
  41 + function setMoudle(e) {
  42 + e.parents('td').siblings('.checkbox').find('input').click();
  43 + }
  44 + function inspectMoudle(e) {
  45 + return e.parents('td').siblings('.checkbox').find('input').is(':checked');
  46 + }
  47 +
  48 + $.each(MOUDLE_LIST, function(index) {
  49 + var b = false;
  50 +
  51 + $('label').each(function() {
  52 + var self = $(this);
  53 + var text = $(this).text();
  54 +
  55 + $.each(MOUDLE_LIST[index], function(index, arr) {
  56 + if (text == arr && !inspectMoudle(self)) {
  57 + b = true;
  58 + setMoudle(self);
  59 + }
  60 + });
  61 +
  62 + });
  63 + if (b) {
  64 + return false;
  65 + }
  66 +
  67 + });
  68 +})(jQuery);
... ...
No preview for this file type
Please register or login to post a comment