MediaWiki:Gadget-ppIndicators.js

var editLevel = mw.config.get('wgRestrictionEdit'); if(editLevel !== ""){ if ($.inArray('sysop', editLevel) >= 0){ editLevel = "full"; }   else if ($.inArray('autoconfirmed', editLevel) >= 0){ editLevel = "semi"; } } else { editLevel = "none"; } var moveLevel = mw.config.get('wgRestrictionMove'); if(moveLevel !== ""){ if ($.inArray('sysop', moveLevel) >= 0){ moveLevel = "full"; }   else if ($.inArray('autoconfirmed', moveLevel) >= 0){ moveLevel = "semi"; } } else { moveLevel = "none"; }alert(editLevel+"/"+moveLevel); if(editLevel === "full" && moveLevel === "full"){ $('li#pt-userpage').before('Full protection enabled'); } else if (editLevel === "full" && moveLevel === "semi"){ $('li#pt-userpage').before('Full/Semi protection enabled'); } else if (editLevel === "full" && moveLevel === "none"){ $('li#pt-userpage').before('Full edit protection enabled'); } else if (editLevel === "semi" && moveLevel === "full"){ $('li#pt-userpage').before('Semi/Full protection enabled'); } else if (editLevel === "semi" && moveLevel === "semi"){ $('li#pt-userpage').before('Semi protection enabled'); } else if (editLevel === "semi" && moveLevel === "none"){ $('li#pt-userpage').before('Semi edit protection enabled'); } else if (editLevel === "none" && moveLevel === "full"){ $('li#pt-userpage').before('Full move protection enabled'); } else if (editLevel === "none" && moveLevel === "semi"){ $('li#pt-userpage').before('Semi move protection enabled'); } else { /* Do nothing because there is no protection */ }