WJX Auto Fill

停止内卷

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         WJX Auto Fill
// @namespace    http://tampermonkey.net/
// @version      0.8
// @description  停止内卷
// @author       windowpain
// @match        *://*.wjx.cn/vm/*
// @match        *://*.wjx.top/vm/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=wjx.cn
// @grant        none
// @license none
// ==/UserScript==

(function() {
    'use strict';
const sid="23333";
const name="windowpain";
const major="CS";
const tel="13333333333";

function FuckWJX(){
    var list = $('.fieldset[pg="1"]').children();
    // var llen=list.length;
    var success=0;
    list.each((i,e)=>{
        const title=$(e).children('.field-label').children('.topichtml').text();
        if(mapKey(title,e)){success++;}
        else {console.log($(e));$(e).attr('style','border:2px solid red!important');}
    })
    if(success==list.length){
        $('.voteDiv').append('<p class="autofill-failed" style="color:green;font-size:2em">正在提交...</p>');
        $('.submitbtn').click();
    }else{
        $('.voteDiv').append('<p class="autofill-failed" style="color:red;font-size:2em">部分自动填充失败(匹配失败或类型错误)</p>');
    }
}

function mapKey(key,e){
    if($(e).children('.ui-input-text').children('input').length<1) return false;
    if(key.includes("学号")){
        $(e).children('.ui-input-text').children('input').val(sid);
    }
    else if(key==="姓名"){
        $(e).children('.ui-input-text').children('input').val(name);
    }
    else if(key.includes("专业")){
        $(e).children('.ui-input-text').children('input').val(major);
    }
    else if(key.includes("电话")||key.includes("手机")){
        $(e).children('.ui-input-text').children('input').val(tel);
    }
    else return false;
    return true;
}

    // Your code here...
    //setTimeout(function (){
    //   FuckWJX();
    //}, 500);
    $(document).ready(function(){
        $('.vote-header').append('<p class="tip-banner" style="color:#ffb600;text-align:center;font-size:1.5em;font-weight:bold;"><i>*点击任意输入框完成自动填充*</i></p>');
        $('input').on('click',FuckWJX);
    });

})();