User:PerfektesChaos/js/listPageOptions/r.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | This user script seems to have a documentation page at User:PerfektesChaos/js/listPageOptions/r. |
/// User:PerfektesChaos/js/listPageOptions/r.js
/// 2014-01-02 PerfektesChaos@de.wikipedia
/// Fingerprint:#0#631E2FA1#
/// @license GPL [//www.mediawiki.org/w/COPYING](+GFDL,LGPL,CC-BY-SA)
///<nowiki>
(function(mw,$){
"use strict";
var vsn=3.3,POpt="listPageOptions";
if(typeof mw.libs[POpt]!=="object"||!mw.libs[POpt]){
mw.libs[POpt]={};}
mw.libs[POpt].type=POpt;
POpt=mw.libs[POpt];
if(!POpt.loaded){
POpt.vsn=vsn;
POpt.config={};
POpt.disguise={};
POpt.doc="[[w:en:User:PerfektesChaos/js/"+POpt.type+"]]";
POpt.group={"sign":POpt.type+"_groupPg","show":"groupie","soft":"enhanced"};
POpt.multi={"sign":POpt.type+"_multiPg","show":"multiple","soft":"extended"};
POpt.picked={"sign":POpt.type+"_visitedPg","show":"visited","soft":"visited"};
POpt.reduce={};
POpt.storage={};
POpt.unwatch={};
POpt.values={};
POpt.texts={
"groupie":{"en":"Group by pages","de":"Seitenbezogene\xA0Gruppierung"},"multiple":{"en":"Multiple entries","de":"Mehrere\xA0Einträge"},"hide":{"en":"Hide","de":"ausblenden"},"options":{"en":"Options and notices","de":"Anzeigeoptionen"},"show":{"en":"Show","de":"einblenden"},"toggleOff":{"en":"off","de":"aus"},"toggleOn":{"en":"on","de":"ein"},"unwatch":{"en":"+ [Unwatch]","de":"+\xA0Nicht-Beobachten"},"unwatch?":{"en":"Add link for [unwatch] to every entry","de":"Link zu 'Nicht beobachten' bei jedem Eintrag"},"visited":{"en":"Visited\xA0Pages","de":"Besuchte\xA0Seiten:"},"watchPgRE":{"en":"^\\s*([1-9][0-9,]*[^.\n]+[.\n])(.|\n)*$","de":"^\\s*([1-9][0-9.]*[^.\n]+[.\n])(.|\n)*$"},"wlnoteRE":{"en":"as of(.+,.+)\\.","de":"Stand:(.+,.+)Uhr\\.","de-at":"Stand:(.+,.+)Uhr\\.","de-ch":"Stand:(.+,.+)Uhr\\.","de-formal":"Stand:(.+,.+)Uhr\\."},"^show":{"en":"List-Page-Options","de":"List-Page-Options"},"^suffix":{"en":"– equip watchlist and recent changes with Options","de":"– Beobachtungsliste und Letzte Änderungen mit Optionen ausstatten"},"^support":{"en":"/wiki/User:PerfektesChaos/js/listPageOptions","de":"/wiki/User:PerfektesChaos/js/listPageOptions"},"^^lean-show":
{"en":"Compress option block","de":"Komprimierter Optionsblock"},"^^learnt-show":
{"en":"Enable hiding of visited changes on watchlist","de":"Möglichkeit zum Verbergen besuchter Änderungen auf der Beobachtungsliste"},"^^learnt-null":
{"en":"not enabled","de":"keine Möglichkeit"},"^^learnt-false":
{"en":"additional link; preset: show all","de":"Zusatz-Link; Vorgabe: alle anzeigen"},"^^learnt-true":
{"en":"additional link; preset: hide visited","de":"Zusatz-Link; Vorgabe: besuchte ausblenden"},"^^leyo-show":
{"en":"Enable hiding of last-edit-your-own on watchlist","de":"Möglichkeit zum Verbergen eigener letzter Beiträge auf der Beobachtungsliste"},"^^link-show":
{"en":"Button to access this option page","de":"Schaltknopf, um auf diese Optionsseite zu kommen"},"^^lower-show":
{"en":"Additional buttons: hide and show option block","de":"Zusätzliche Knöpfe: Ein- und Ausblenden des Optionsblocks"},"^^lower-null":
{"en":"no additional button","de":"kein zusätzlicher Knopf"},"^^lower-false":
{"en":"button for hiding","de":"Knopf zum Ausblenden"},"^^lower-true":
{"en":"hide: button for showing","de":"Ausblenden; Knopf zum Einblenden"},"^^luxury-show":
{"en":"Additional checkboxes for hide and show","de":"Zusätzliche Checkboxen zum Ein- und Ausblenden"},"^^self":{"en":"Mark own edit","de":"Eigene Bearbeitung markieren"}
};
POpt.trans={
"de":"de","de-at":"de","de-ch":"de","de-formal":"de","als":"de","bar":"de","dsb":"de","frr":"de","gsw":"de","hsb":"de","ksh":"de","lb":"de","nds":"de","pdc":"de","pdt":"de","pfl":"de","sli":"de","stq":"de","vmf":"de"
};
POpt.sep="<span> | </span>";
POpt.spooling="/media/wikipedia/commons/d/de/Ajax-loader.gif";}
POpt.config.fetch=function(){
var s,scope=" lean learnt leyo link lower luxury self ",vals=mw.libs.preferencesGadgetOptions.fetch(POpt.type);
for(s in vals){
if(scope.indexOf(" "+s+" ")>0){
POpt[s]=vals[s];}}
};
POpt.config.fire=function(){
var r;
this.supply="preferencesGadgetOptions";
r="ext.gadget."+this.supply;
if(!mw.loader.getState(r)){
mw.loader.implement(r,["//en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/"+this.supply+"/r.js&action=raw&ctype=text/javascript&maxage=604802&*"],{},{});}
return r;
};
POpt.config.form=function(){
var dialog={script:POpt.type,show:POpt.feature("^show"),support:POpt.feature("^support"),suffix:POpt.feature("^suffix"),opts:[{signature:"lean",type:"checkbox",show:POpt.feature("^^lean-show"),val:false
},{signature:"learnt",type:"radio",show:POpt.feature("^^learnt-show"),poly:[{val:null,show:POpt.feature("^^learnt-null")},{val:false,show:POpt.feature("^^learnt-false")},{val:true,show:POpt.feature("^^learnt-true")}
]},{signature:"leyo",type:"checkbox",show:POpt.feature("^^leyo-show"),val:false
},{signature:"lower",type:"radio",show:POpt.feature("^^lower-show"),val:null,poly:[{val:null,show:POpt.feature("^^lower-null")},{val:false,show:POpt.feature("^^lower-false")},{val:true,show:POpt.feature("^^lower-true")}
]},{signature:"luxury",type:"checkbox",show:POpt.feature("^^luxury-show"),val:false
},{signature:"self",type:"text",show:POpt.feature("^^self"),val:false
},{signature:"link",type:"checkbox",show:POpt.feature("^^link-show"),val:false
}
]};
mw.libs.preferencesGadgetOptions.form(dialog);
};
POpt.disguise.fetch=function(){
var e,i,low,staff,story,stuff,$e,$li,$trs,$user,leap=false,learn=false,$list=mw.util.$content.find("table.mw-enhanced-rc"),n=$list.length,seen="mw-changeslist-line-not-watched";
POpt.picked.leap=false;
this.got=[];
this.list=(n===0);
if(this.list){
$e=mw.util.$content.find("#resultListSort");
if($e.length){
$e=$e.find("ol");
}else{
$e=mw.util.$content.find("UL.special");}
if($e.length){
$list=$e.children("li");
n=$list.length;
for(i=0;i<n;i++){
$li=$list.eq(i);
if(POpt.picked.learn){
learn=$li.hasClass(seen);
if(learn){
POpt.picked.leap=true;
}else{
leap=true;}}
$e=$li.children("a").eq(0);
stuff=$e.attr("href");
stuff=$li.find("A.mw-changeslist-title").attr("href");
$user=$li.find("A.mw-userlink");
if($user.length){
staff=$user.attr("href");
}else{
staff=false;}
low=($li.children(".minoredit").length>0);
if(POpt.letal){
story=false;}
this.got.push([$li,stuff,staff,low,learn,story]);}
if(POpt.mode===1&&POpt.self){
story=".mw-changeslist-separator";
$e=$("<span />");
$e.css("font-weight","bold");
$e.text(POpt.self);
for(i=0;i<n;i++){
e=this.got[i];
staff=e[2];
if(staff){
if(this.reLeyo.test(staff)){
e[0].find(story).after($e.clone());}}}}}
}else{
staff=false;
for(i=0;i<n;i++){
$li=$list.eq(i);
if(POpt.picked.learn){
learn=$li.hasClass(seen);
if(learn){
POpt.picked.leap=true;
}else{
leap=true;}}
$trs=$li.children("tbody").children("tr");
stuff=$trs.find("SPAN.mw-title").children("a").attr("href");
$e=$trs.find("A.mw-userlink");
staff=false;
switch($e.length){
case 0:
break;
case 1:
staff=$e.attr("href");
break;
default:
$e=$trs.find(".changedby").children("A.mw-userlink");
if($e.length===1){
staff=$e.attr("href");
}else if(this.reLeyo){
$e=$trs.eq(1).find("A.mw-userlink");
staff=$e.attr("href");}}
if(this.reLeyo&&staff){
if(this.reLeyo.test(staff)){
$li.remove();
$li=false;}}
if($li){
low=($trs.children(".minoredit").length>0);
this.got.push([$li,stuff,staff,low,learn,story]);}}}
POpt.picked.leap=(POpt.picked.leap&&leap);
};
POpt.disguise.filter=function(alter,abandon,account,ant){
var i,l,n,q,rep,reu,s,r=false;
if(alter||abandon||account||(POpt.picked.learn&&POpt.picked.leap)){
if(!this.got){
this.fetch();}
n=this.got.length;
if(n){
if(alter||!this.list){
rep="/wiki/";
if(alter){
if(!this.special){
q=mw.config.get("wgFormattedNamespaces");
if(q){
rep=q[-1];}
this.special=rep+":";}
rep=this.special;}
}else{
rep="/w(iki/|/index\\.php\\?title=)";}
if(abandon){
s=POpt.format(abandon);
}else{
s="";}
rep=new RegExp(rep+s);
reu=this.format(account);
r=true;
for(i=0;i<n;i++){
q=this.got[i];
if(q){
l=false;
if(rep.test(q[1])){
l=alter;
if(reu){
l=reu.test(q[2]);}
if(l&&ant){
l=q[3];}}
if(l){
q[0].remove();
this.got[i]=false;
}else{
r=false;}}}}}
return r;
};
POpt.disguise.fire=function(){
var i,k,n,q;
if(POpt.leyo||POpt.self){
this.fresh();}
if($.isArray(POpt.hide)){
n=POpt.hide.length;
for(i=0;i<n;i++){
q=POpt.hide[i];
if($.isArray(q)){
k=q[2];
if(!k||k===POpt.mode){
if(this.filter(q[0],q[1],q[3],q[4])){
break;}}}}}
};
POpt.disguise.format=function(account){
var r;
if(account){
r=new RegExp("/w(iki/|/index.php?title=)[^:]+:"+POpt.format(account));
}else{
r=false;}
return r;
};
POpt.disguise.fresh=function(){
this.reLeyo=this.format(mw.config.get("wgUserName"));
this.fetch();
};
POpt.group.find=function(assigned){
var $grab,less=false;
if(assigned){
less=(assigned==="1");
}else{
$grab=mw.util.$content.find(".mw-enhanced-rc");
if($grab.length){
less=true;
}else if(!this.leaves){
if(mw.user.options.get("usenewrc")){
less=true;}}}
POpt.values.ctl2url[this.sign].val=(less?"1":"0");
};
POpt.multi.find=function(assigned){
var less=false;
if(assigned){
less=(assigned==="1");
}else{
if(mw.user.options.get("extendwatchlist")){
less=true;}}
POpt.values.ctl2url[this.sign].val=(less?"1":"0");
};
POpt.picked.feature=function(){
return POpt.feature((this.learning?"hide":"show"));
};
POpt.picked.fire=function(){
var i,q,n=POpt.disguise.got.length,s=(this.learning&&this.leap?"none":"block");
for(i=0;i<n;i++){
q=POpt.disguise.got[i];
if(q[4]){
q[0].css("display",s);}}
if(!this.$toggle){
this.$toggle=POpt.values.$form.find("#"+this.sign);}
POpt.storage.flush("learnt",this.learning);
this.learning=!this.learning;
this.$toggle.text(this.feature());
};
POpt.picked.furnish=function(){
var s;
if(POpt.values.$form){
s=POpt.storage.find("learnt");
if(s){
this.learning=(s==="true");
}else{
this.learning=POpt.learnt;
POpt.storage.flush("learnt",this.learning);}
s=POpt.feature(this.show);
if(this.leap){
s="<span>"+s+" <a href='"+POpt.script+".picked.fire()' id='"+this.sign+"'>"+this.feature()+"</a></span>";
}else{
s="<span style='color:#B0B0B0'>"+s+" ./.</span>";
if(POpt.mode===2){
this.learning=false;}}
s=POpt.sep+s;
if(POpt.mode===2&&!POpt.lean){
s=s+"<hr />";}
POpt.values.$POpt.append($(s));
this.fire();}
};
POpt.reduce.facility=function(){
this.$box.attr("style",null);
this.$resuscitate.attr("style","display:none");
this.lower=false;
POpt.storage.flush("lower",this.lower);
};
POpt.reduce.fade=function(){
this.$resuscitate.attr("style","margin-top: 10px;");
this.$box.attr("style","display:none");
this.lower=true;
POpt.storage.flush("lower",this.lower);
};
POpt.reduce.furnish=function(){
var btnR,got,re,$btn,$div,$span,s=POpt.storage.find("lower");
if(s){
this.lower=(s==="true");
}else{
this.lower=POpt.lower;
POpt.storage.flush("lower",this.lower);}
s=(POpt.mode===1?"#mw-watchlist-options":".rcoptions");
this.$box=mw.util.$content.find(s);
if(this.$box.length){
btnR={"float":(POpt.ltr?"right":"left ")};
btnR[(POpt.ltr?"margin-left":"margin-right")]="8px";
btnR[(POpt.ltr?"margin-right":"margin-0")]="0";
this.$resuscitate=$("<div />");
this.$resuscitate.attr("id",POpt.type+"_resuscitate");
this.$resuscitate.css("margin-top","10px");
if(POpt.mode===1){
s=this.$box.text();
if(s){
re=new RegExp(POpt.feature("wlnoteRE",true));
got=re.exec(s);
if(got){
$span=$("<span />");
$span.text(got[1]);
this.$resuscitate.append($span);}}}
if(!POpt.$options){
POpt.$options=this.$box.find("legend");}
if(POpt.link&&POpt.prego){
$btn=POpt.prego.$button();
$btn.attr("id",POpt.type+"_optPage");
$btn.css(btnR);
$btn.css("margin-top","20px");
POpt.$options.after($btn);
$div=$("<div />");
$div.css("clear","right");
POpt.$options.after($div);}
$btn=$("<button />");
$btn.attr({"id":POpt.type+"_optShow","type":"button"});
$btn.click(function(){POpt.reduce.facility();});
$btn.css((POpt.ltr?"margin-left":"margin-right"),"10px");
$btn.text(POpt.feature("options"));
this.$resuscitate.append($btn);
this.$box.before(this.$resuscitate);
$btn=$("<button />");
$btn.attr({"id":POpt.type+"_optHide","type":"button"});
$btn.click(function(){POpt.reduce.fade();});
$btn.css(btnR);
$span=$("<span />");
$span.css({"color":"#FF0000","font-weight":"bold"});
$span.text("X");
$btn.append($span);
POpt.$options.after($btn);
if(this.lower){
this.fade();
}else{
this.facility();}}
};
POpt.storage.find=function(access){
var i,j,r=false,s="~"+access+"_";
if(!this.stored){
if(window.sessionStorage){
this.stored=window.sessionStorage.getItem(POpt.type);}
if(!this.stored){
this.stored="~";}}
i=this.stored.indexOf(s);
if(i>=0){
j=this.stored.indexOf("~",i+2);
if(j>0){
r=this.stored.substring(i+s.length,j);}}
return r;
};
POpt.storage.flush=function(access,assign){
var i,j,s="~"+access+"_";
if(!this.stored){
this.stored="~";}
i=this.stored.indexOf(s);
s=s+assign;
if(i<0){
this.stored=s+this.stored;
}else{
j=this.stored.indexOf("~",i+2);
if(j<0){
this.stored=s+"~";
}else{
this.stored=this.stored.substr(0,i)+s+this.stored.substr(j);}}
if(window.sessionStorage){
window.sessionStorage.setItem(POpt.type,this.stored);}
};
POpt.unwatch.factory=function(){
var s,$e=$(this);
if(POpt.unwatch.less){
$e=$e.parent();
}else{
s=$e.attr("class");
if(s){
if(s.indexOf("mw-changeslist-line-")<0){
$e=false;}
}else{
$e=false;}}
if($e){
$e.find("a").each(POpt.unwatch.feed);}
return true;
};
POpt.unwatch.fault=function(arrived){
var q,$d=mw.util.$content.find(".curid"+q);
if($d.length){
$d.empty();
$d.append($("<span style='border: solid 2px #FF0000; color: #FF0000; margin-left: 5px;'><strong>ERROR</strong></span>"));}
mw.log({loud:true},"."+POpt.type+".unwatch.fault()",2,arrived);
};
POpt.unwatch.feed=function(){
var g,id,loop=true,$e=$(this),s=$e.attr("href");
if(s&&s.indexOf("&action=history")>0){
g=/[?&]title=([^&]+)(&.+)*&curid=([0-9]+)(&.+)?$/.exec(s);
if(g){
s="\""+g[1].replace(/\"/g, "%22" )
.replace(/\'/g, "%27" ) + "\"";
id=g[3];
s="<span> | </span><span class='curid"+id+"'><a href='"+POpt.script+".unwatch.fire("+id+","+s+",true);void(0);'>"+POpt.unwatch.flag(false)+"</a></span>";
$e.after($(s));
loop=false;}}
return loop;
};
POpt.unwatch.fiat=function(){
mw.util.addPortletLink("p-tb",POpt.script+".unwatch.furnish();void(0);",POpt.feature("unwatch"),"t-unwatch",POpt.feature("unwatch?"),"w",null);
};
POpt.unwatch.fine=function($apply){
$apply.children("img").remove();
$apply.each(POpt.unwatch.fix);
};
POpt.unwatch.fire=function(access,assign,action){
var d,q,promise,$e=mw.util.$content.find(".curid"+access),$i;
if($e.length){
q=new mw.Api();
if(action){
promise=q.unwatch(assign);
}else{
promise=q.watch(assign);}
d="<img src='"+POpt.spooling+"' height='16' alt='Ajax' />";
$i=$(d);
$e.children("a").attr("style","display:none");
$e.append($i);
promise.done(function(){POpt.unwatch.fine($e);}).fail(this.fault);}
};
POpt.unwatch.fix=function(){
var s,leave,$e=$(this),$a=$e.children("a");
if($a.length){
$a.attr("style","display:inline");
s=$a.attr("href");
$a.empty();
leave=(s.indexOf("true);void(0);")>0);
if(leave){
s=s.replace(/true\);void\(0\);/,"false);void(0);");
}else{
s=s.replace(/false\);void\(0\);/,"true);void(0);");}
$a.attr("href",s);
s="<strong>"+POpt.unwatch.flag(leave)+"</strong>";
$a.append($(s));}
};
POpt.unwatch.flag=function(again){
return("["+(again?"///":"—")+"]");
};
POpt.unwatch.furnish=function(){
var seek,$list=mw.util.$content.find("#mw-content-text");
if($list.length){
this.less=POpt.values.ctl2url[POpt.group.sign].val;
this.less=(this.less==="0"?false:this.less);
seek=(this.less?".mw-title":"li");
$list.find(seek).each(this.factory);}
$(window.document).find("#t-unwatch").remove();
};
POpt.values.factory=function(){
var s,r="";
for(s in this.ctl2url){
r=r+this.fiat(s);}
return r;
};
POpt.values.fiat=function(access){
var par=this.ctl2url[access],r="",s=access;
if(par){
if(par.val!==undefined){
if(par.url){
s=par.url;}
if(par.type==="checkbox"){
if(typeof par.val!=="string"){
par.val=(par.val?"1":"0");}}
r="&"+s+"="+par.val;}}
return r;
};
POpt.values.find=function(around,adapt){
var s,$input;
this.first();
this.$wrap=mw.util.$content.find(around);
if(this.$wrap.length){
this.$form=mw.util.$content.find(adapt);
if(this.$form.length){
$input=this.$form.find("input");
$input.each(this.found);}
if(POpt.lean){
this.$wrap.append($(POpt.sep));
s="<span";
}else{
s="<div";}
this.$POpt=$(s+" id='"+POpt.type+"_extra' />");
this.$wrap.append(this.$POpt);
}else{
this.$form=false;
this.$wrap=false;
this.$POpt=false;}
};
POpt.values.first=function(){
if(!this.ctl2url){
this.ctl2url={"associated":{type:"checkbox"},"days":{name:"days",type:false},"hideAnons":{type:"checkbox"},"hideBots":{type:"checkbox"},"hideLiu":{type:"checkbox"},"hideMinor":{type:"checkbox"},"hideOwn":{type:"checkbox"},"hideReviewed":{type:"checkbox"},"hideWikibase":{type:"checkbox"},"nsinvert":{type:"checkbox",url:"invert"},"namespace":{type:"select"}
};
this.ctl2url[POpt.group.sign]={type:"checkbox",url:POpt.group.soft};
this.ctl2url[POpt.multi.sign]={type:"checkbox",url:POpt.multi.soft};
if(POpt.mode===2){
this.ctl2url.from={type:false};
this.ctl2url.limit={type:false};
this.ctl2url.tagfilter={type:"text"};}}
};
POpt.values.fix=function(access){
if(!this.$hrefs&&this.$wrap){
this.$hrefs=this.$wrap.find("a");}
if(typeof this.$hrefs!=="boolean"){
this.current=this.ctl2url[access];
if(!this.current.url){
this.current.url=access;}
this.$hrefs.each(this.fixing);}
};
POpt.values.fixing=function(at,access){
var got,par,swap,$e;
if(at<0){
$e=access;
}else{
$e=$(access);}
swap=$e.attr("href");
if(!POpt.values.script){
POpt.values.script=mw.config.get("wgScript");}
if(swap.indexOf(POpt.values.script)<0){
swap=false;}
if(swap){
par=POpt.values.current;
if(par.val!==undefined){
if(!par.reURL){
par.reURL="([?&]"+par.url+"=)(?:[^&]*)(&?.+)?$";
par.reURL=new RegExp(par.reURL);}
if(par.type==="checkbox"){
if(typeof par.val!=="string"){
par.val=(par.val?"1":"0");}}
got=par.reURL.exec(swap);
if(got){
swap=swap.replace(par.reURL,"$1"+par.val+"$2");
}else{
swap=swap+"&"+par.url+"="+par.val;}
$e.attr("href",swap);}}
return true;
};
POpt.values.flat=function(){
var $e=this.$wrap.find("br, hr"),$sep=$("<span> | </span>");
$e.before($sep.clone());
$e.remove();
this.$wrap.find("p, form, ul").css("display","inline");
};
POpt.values.flip=function(access){
var s,$e,par=this.ctl2url[access];
if(par){
if(!par.$ctl){
par.$ctl=this.$form.find("#"+access);}
if(par.$ctl&&par.$ctl.length){
if(par.type==="checkbox"){
s=par.$ctl.attr("value");
if(s){
s=(s==="0"?"1":"0");
}else{
s=(par.$ctl.prop("checked")?"1":"0");}
par.$ctl.val(s);
if(s==="0"){
par.$ctl.removeAttr("checked");}
if(POpt.mode===1){
switch(access){
case POpt.group.sign:
POpt.flip(s,"1",POpt.multi);
break;
case POpt.multi.sign:
POpt.flip(s,"0",POpt.group);
break;}}
}else{
s=par.$ctl.val();}
par.val=s;
$e=this.$form.find("#hidden_"+access);
if($e.length){
$e.val(s);}
this.fix(access);}}
};
POpt.values.found=function(){
var par,sign,$input=$(this);
if($input.attr("type")==="hidden"){
sign=$input.attr("name");
par=POpt.values.ctl2url[sign];
if(par){
par.val=$input.val();}}
return true;
};
POpt.values.furnish=function(access){
var s,par=this.ctl2url[access];
if(par){
if(!par.$ctl){
if(this.$form){
par.$ctl=this.$form.find("#"+access);}}
if(par.$ctl){
if(par.type==="checkbox"){
s=(par.$ctl.prop("checked")?"1":"0");
}else{
s=par.$ctl.val();}
par.val=s;
s=POpt.slip+".values.flip('"+access+"');";
par.$ctl.attr("onchange",s);}}
};
POpt.facilitate=function(){
var i,last,par,sign,src,$e,bools=["hideMinor","hideBots","hideAnons","hideLiu","hideOwn","hideReviewed"
],j=(this.mode===1?8:9),n=j+bools.length,k=0,$set=POpt.values.$wrap.find("a");
for(i=j;i<n;i++){
sign=bools[k];
par=POpt.values.ctl2url[sign];
last=par.val;
src="<input type='checkbox' id='"+sign+"'"+(last?" checked":"")+" onchange='"+POpt.slip+".values.flip(\""+sign+"\")'"+" />";
par.$ctl=$(src);
par.$ctl.val((last?"1":"0"));
$e=$set.eq(i);
$e.attr("id","link_"+sign);
$e.before($(src));
src="<input type='hidden' id='hidden_"+sign+"' name='"+sign+"' value='"+(last?"1'":"0'")+" />";
$e=$(src);
$e.val((last?"1":"0"));
POpt.values.$form.append($e);
k++;}
};
POpt.factory=function(assign,ahead){
var less,shift,sub,show="";
if(this.values.$form){
if(!this.values.script){
this.values.script=mw.config.get("wgScript");}
less=this.values.ctl2url[assign.sign].val;
if(less==="0"){
less=false;}
shift=this.values.script+"?title=Special:"+this.special+this.values.factory();
sub="&"+assign.soft+"=";
shift=shift.replace(new RegExp(sub+"?[01]"),sub+(less?"0":"1"));
if(this.mode===1){
if(shift.indexOf("&extended=0")>0){
shift=shift.replace(/&enhanced=1/,"&enhanced=0");}
if(shift.indexOf("&enhanced=1")>0){
if(shift.indexOf("&extended=")>0){
shift=shift.replace(/&extended=0/,"&extended=1");
}else{
shift=shift+"&extended=1";}}
if(!this.lean&&ahead){
show="<hr />";
}else if(!ahead){
show=this.sep;}}
show=show+"<input type='checkbox' id='"+assign.sign+"' name='"+assign.soft+"' value='"+(less?"1'":"0'")+(less?" checked":"")+" onchange='"+this.slip+".values.flip(\""+assign.sign+"\")'"+" />"+"<label>"+this.feature(assign.show)+" ("+"<a href='"+shift+"'>"+this.feature((less?"toggleOff":"toggleOn"))+"</a>)"+"</label>";
this.values.$POpt.prepend($(show));}
};
POpt.feature=function(apply,appoint){
var e,r;
if(!this.slang){
this.slang=mw.config.get("wgUserLanguage").toLowerCase();}
e=this.texts[apply];
if(e){
if(appoint){
r=e[this.slang];
}else{
if(!this.slangs){
this.slangs=this.trans[this.slang];
if(!this.slangs){
this.slangs="en";}}
r=e[this.slangs];
if(!r){
r=e.en;
if(!r){
r="???"+apply+"???";}}}
}else{
r="***"+apply+"***";}
return r;
};
POpt.fiat=function(){
var sep,story,suite,$grab;
mw.util.$content.find(".mw-changeslist-legend").hide();
POpt.ltr=($(window.document).find("html").attr("dir")!=="rtl");
switch(POpt.mode){
case 1:
sep=".mw-changeslist-separator";
$grab=mw.util.$content.find(sep);
POpt.group.leaves=($grab.length>0);
if(POpt.group.leaves){
POpt.unwatch.fiat();}
story="#mw-watchlist-options";
suite="#mw-watchlist-form";
POpt.flat();
break;
case 2:
POpt.group.leaves=true;
story=".rcoptions";
suite="form";
break;}
POpt.values.find(story,suite);
if(POpt.luxury){
POpt.facilitate();}
POpt.values.furnish("associated");
POpt.values.furnish("nsinvert");
POpt.values.furnish("namespace");
POpt.picked.learn=(typeof POpt.learnt==="boolean");
if(POpt.hide||POpt.picked.learn||POpt.letal||POpt.leyo||POpt.self){
POpt.disguise.fire();}
if(POpt.picked.learn&&POpt.mode===1){
POpt.picked.furnish();}
if(typeof POpt.lower==="boolean"){
POpt.reduce.furnish();}
POpt.furnish(POpt.group,false);
if(POpt.mode===1){
POpt.furnish(POpt.multi,true);
if(POpt.values.$wrap&&POpt.values.$score){
if(!POpt.$options){
POpt.$options=POpt.values.$wrap.find("legend");}
POpt.$options.after(POpt.values.$score);}}
if(POpt.lean){
POpt.values.flat();}
};
POpt.fire=function(){
var pages={"Gadgets":-1,"Watchlist":1,"Recentchanges":2};
this.special=mw.config.get("wgCanonicalSpecialPageName");
this.mode=pages[this.special];
if(this.mode){
mw.loader.using(["user","user.options","mediawiki.api","mediawiki.api.watch","mediawiki.user","mediawiki.util",this.config.fire()],this.first);}
};
POpt.first=function(){
if(!mw.user.isAnon()){
POpt.prego=mw.libs[POpt.config.supply];}
POpt.slip="mw.libs."+POpt.type;
POpt.script="javascript:"+POpt.slip;
if(POpt.mode>0){
if(POpt.prego){
POpt.config.fetch();}
$(window.document).ready(POpt.fiat);
}else if(POpt.prego){
POpt.config.form();}
};
POpt.flat=function(){
var re,s,$e=mw.util.$content.find("#mw-content-text");
if($e.length){
$e=$e.children("p");
if($e.length){
re=new RegExp(POpt.feature("watchPgRE",false));
s=$e.text().replace(re,"$1");
if(s){
$e.remove();
POpt.values.$score=$("<span>"+s+" | </span>");}}}
};
POpt.flip=function(alter,allow,assign){
var co,s;
if(alter===allow){
s=assign.sign;
co=this.values.ctl2url[s];
if(co){
if(co.val!==allow){
if(!co.$ctl){
if(this.values.$form){
co.$ctl=this.values.$form.find("#"+s);}}
if(co.$ctl){
co.$ctl.click();}}}}
};
POpt.format=function(access){
var i,k,n,s,r=access;
if(r){
if(access.indexOf("%")<0){
n=access.length;
r="";
for(i=n-1;i>=0;i--){
k=access.charCodeAt(i);
s=String.fromCharCode(k);
if(k>127){
s=encodeURI(s);}
r=s+r;}
s=mw.util.wikiUrlencode(r);
}else{
if(!this.sp2_){
this.sp2_=new RegExp(" ","g");}
r=r.replace(this.sp2_,"_");}}
return r;
};
POpt.furnish=function(assign,ahead){
var set=mw.util.getParamValue(assign.soft);
assign.find(set);
POpt.values.fix(assign.sign);
this.factory(assign,ahead);
};
if(!POpt.loaded){
POpt.loaded=true;
if(mw.config.get("wgNamespaceNumber")===-1){
POpt.fire();}
mw.loader.state("ext.gadget."+POpt.type,"ready");}
}(window.mediaWiki,window.jQuery));
/// EOF</nowiki>listPageOptions/r.js