欢迎访问
讨论版列表 - 本站建设 - 主题数: 15 | 文章数: 32 | 管理员: admin

本站建设

版面 | 文摘区 | 马克区

返回
admin
[回复] [修改] [删除] [同主题阅读] [返回版面] 1  
作者: admin, 讨论版: 本站建设, 发表时间: 2013-09-12 14:24:39 PST
标题: 自动纪录做过的题
关键字:

发信人: fabregas4 (喂过猪), 信区: JobHunting
标  题: Re: Homecox OJ BBS上线
发信站: BBS 未名空间站 (Thu Sep 12 09:51:23 2013, 美东)

// ==UserScript==
// @name       homecox oj mark
// @namespace  http://use.i.E.your.homepage/
// @version    0.1
// @description  mark if has dealed
// @match      http://homecox.com/oj/
// @copyright  20130911, fabregas4
// ==/UserScript==

function changhandler(event) {
    if (event.target.checked) {
        localStorage[event.target.name] = true; 
    } else {
        localStorage.removeItem(event.target.name);
    }
}

[].forEach.call(
    document.getElementById('main').getElementsByTagName('li'),
    function(oj) {
        var checkBox = document.createElement('input');
        checkBox.type = 'checkbox'; 
        checkBox.name = oj.getElementsByTagName('a')[0].innerHTML;
        checkBox.checked = localStorage[oj.getElementsByTagName('a')[0].innerHTML]; 
        checkBox.addEventListener('change', changhandler, false); 
        oj.insertBefore(checkBox, null); 
    }
);

浏览器支持的话,可用上边的手动标记
【 在 durbin (The+Best+thing+is+nothing) 的大作中提到: 】
: 强烈建议楼主取消或缩短中文验证码, 太麻烦了!
: 另外, 应该加上做题记录Tracking。 比如对用户已经做过的题, 应该加CheckBox 或
: 用不同颜色显示。 

--

上文来自:http://www.mitbbs.com/article_t1/JobHunting/32527557_0_2.html


--

※ 来源: homecox.com  [来自: 66.]


Reply

Please log in first.