faxuan_course 增加提示版

auto complete faxuan course

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         faxuan_course 增加提示版
// @namespace    http://tampermonkey.net/
// @version      0.11
// @description  auto complete faxuan course
// @author       fangzister/yofx
// @match        http://xf.faxuan.net/sps/courseware/t/courseware_1_t.html*
// @grant        none
// ==/UserScript==
//给大佬的脚本加个说明,简单加了个引导提示
//必须是进到第二级的学习页面才可以,具体为,课件目录--具体章节(第几章节)--点击继续学习 新跳转的那个目录才可以运行脚本
//然后点击一次 退出学习,脚本开始运行~
//填加了一个开始运行的提示。。
(function() {
    'use strict';
    function message1(){
        alert("脚本已执行,但当前页面错误!请点击继续学习!课件详情页面刷新网页!");
    };

    function message2(){
        alert("已激活功能");
    };
    var Title
    Title= document.title;//网页标题

    switch(Title){
        case("课程"):
            message1();
            break;
        case("课件详情"):
            window.addEventListener('load',function(){
                //添加时间监听
                message2();
                var a = document.getElementById('exitCourse');
                console.log(a);
                a.href = 'javascript:;';

                a.onclick = function(){
                    clearTimeout(sps.onlineTimeTask);
                    message2();
                    let m = parseInt(Math.random() * 10) + 10;
                    let s = parseInt(Math.random() * 10) + 10;
                    let t = '00:' + m + ':' + s;
                    let u = document.getElementById('ware_time_num');
                    u.innerHTML = t;
                    this.onclick = function(){
                        sps.exitSt('ware_time_num');
                    };
                };
                var yy = setTimeout(function(){sps.prompthide('prompt2');clearTimeout(yy);},300);
            });
            break;


    };


})();