// ==UserScript== // @name Fast-Codeforces // @namespace xcxxcx // @version 0.3.3 // @match *://codeforces.com/* // @match *://codeforc.es/* // @match *://codeforces.ml/* // @description 使您更方便地使用Codeforces // @require https://code.jquery.com/jquery-3.4.1.min.js // @author xcxxcx // @downloadURL none // ==/UserScript== let $=window.$,math=unsafeWindow.MathJax.Hub; String.prototype.frl=function(c){ if(this.indexOf(c)===-1)return this; return this.substr(0,this.indexOf(c)); }; String.prototype.frr=function(c){ if(this.indexOf(c)===-1)return this; return this.substr(this.indexOf(c)+c.length); }; function gets(dir){ if(("fc-"+dir)in localStorage===false||localStorage["fc-"+dir]==="undefined")return void 0; return JSON.parse(localStorage["fc-"+dir]); } function puts(dir,val){ if(val!==void 0)localStorage["fc-"+dir]=JSON.stringify(val); else localStorage["fc-"+dir]="undefined"; } let user=$(".lang-chooser>div:eq(1)>a:eq(0)").html(),user_csrf=$("[name=X-Csrf-Token]").attr("content"); function show_pre(){$("#pageContent,#pre-bar").show();} function hide_pre(){$("#pageContent,#pre-bar").hide();} let menu; function default_set(){for(let i in localStorage)if(i.substr(0,3)==="fc-"&&i!=="fc-using"&&i!=="fc-version")delete localStorage[i];} function add_menu(ele){ $("#fc-setting-menu-add").append(`
  • `+eles[ele].name+`
  • `); $("#fc-setting-menu-"+ele).click(function(){let ID=this.id.substr(16);$(this).parent().remove();menu.splice(menu.indexOf(ID),1);sub_menu(ID);}); } function sub_menu(ele){ $("#fc-setting-menu-sub").append(`
  • `+eles[ele].name+`
  • `); $("#fc-setting-menu-"+ele).click(function(){let ID=this.id.substr(16);$(this).parent().remove();menu.push(ID);add_menu(ID);}); } function set_menu(){ menu=list.slice(); $("#fc-setting-default").before($(`
    目录设置*

    当前目录
    剩余目录

    `)); for(let i=0;i