Greasy Fork

Greasy Fork is available in English.

博了个思(博思)

安信工博思平台一键刷课,解除右键限制、鼠标时间限制。

当前为 2017-11-27 提交的版本,查看 最新版本

// ==UserScript==
// @name         博了个思(博思)
// @namespace    hibosi
// @version      1.30
// @description  安信工博思平台一键刷课,解除右键限制、鼠标时间限制。
// @author       iBelieve
// @match        http://aiit.iflysse.com/Pages/Student/WorkLearn.aspx*
// @grant        none
// ==/UserScript==


(function(){
    'use strict';

    var skipBtn=function(){
        $(".progress_btn").hide();
        var $nextBtn=$("#nextWork");
        $nextBtn.show();
        $nextBtn.removeAttr("disabled");
        $nextBtn.removeClass("disable");
        $nextBtn.css('background','green');
        $nextBtn.html("已跳过");
    };

    var Xplayerstop=function() {
        var ckobj=CKobject.getObjectById('ckplayer_a1');
        if(ckobj==null) return;
        var a =ckobj.getStatus();
        var time = a.totalTime;
        var myVideoID = $("#pageID").data("myvideoid");
        var contextID = $("#nowid").val();
        console.log("当前视频ID:"+myVideoID+",总时间:"+time);
        $.ajax({
            type: "POST",
            dataType: "json",
            url: "../../Handler/VideoHandler.ashx",
            data: { action: "1", VideoID: myVideoID, Time: time, WorkcontextID: contextID },
            success: function (msg) {
                if (msg=="") {
                    return;
                }
                if (msg == "true" || msg == true) {
                    clearInterval(UpdateFun);
                    skipBtn();
                    return;
                }
                count = 0;
                CKobject.getObjectById('ckplayer_a1').videoSeek(msg - 1);
            },
            error: function () {
            }
        });
    };

    var $progress=$("#progress");
    setInterval(function(){
        if($progress.css('display')=='none'){
            monitor_count=0;
            var $nextWork=$("#nextWork");
            if($nextWork.hasClass("disable")||$nextWork.css('display')=='none'){
                if($("#workType").val() == "2"){ //视频模式
                    Xplayerstop();
                } else {
                    skipBtn();
                }
            }
        }
    },1000);

    //解除右键复制限制
    $('[oncontextmenu]').each(function(){
        var $el=$(this);
        if($el.attr('oncontextmenu').indexOf('return false')>=0){
            $el.removeAttr('oncontextmenu');

        }
    });

    $('[onselectstart]').each(function(){
        var $el=$(this);
        if($el.attr('onselectstart').indexOf('return false')>=0){
            $el.removeAttr('onselectstart');

        }
    });

    $('[onpaste]').each(function(){
        var $el=$(this);
        if($el.attr('onpaste').indexOf('return false')>=0){
            $el.removeAttr('onpaste');

        }
    });

})();