Greasy Fork

Greasy Fork is available in English.

重庆继续教育选修小节自动播放

只支持选修小节自动播放

当前为 2020-05-10 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         重庆继续教育选修小节自动播放
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  只支持选修小节自动播放
// @author       moxiaoying
// @match        http://chinaredstar.21tb.com/els/html/index.parser.do*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
//     var org_text = $('.cl-catalog-playing').text();
    var url = 'http://chinaredstar.21tb.com/els/html/index.parser.do?host=&vbox_server=http://chinaredstar.21tb.com/els/html/index.parser.do?id=NEW_COURSE_CENTER&sourceType=WIDGET&current_app_id=8a80810f5ab29060015ad1906d0b3811#!%2Fels%2Fhtml%2FcourseCenter%2FcourseCenter.loadStudyTask.do'
    var data = 'scoId=' + info.scoId +'&courseId=' + info.courseId + '&firstLoad=true&location=2348.1&elsSign=elnSessionId.5fdbc05182394b04be959d211d6d419d&current_app_id='
    $.ajax({
        url: url,
        data: data,
        async: false,
        type: 'post',
        dataType: 'json',
        success: function(data){
            console.log(parseInt(data.minStudyTime));
            setTimeout(function(){
               window.location.reload();
            },1000*60*parseInt(data.minStudyTime));
        },
        error: function(d){
            setInterval(function(){
                //         var now_text = $('.cl-catalog-playing').text();
                var min_time = parseInt($('#minStudyTime').text());
                var studied_time =  parseInt($('#studiedTime').text());
                if(min_time-studied_time<=1){
                    window.location.reload();
                }
                console.log('studied_time:'+studied_time+'min_time:'+min_time);
            }, 1000*60);
        }
    });
    // Your code here...
})();