利用者:Jkr2255/作業中2
表示
(function($){
var protectedLinks={};
var params;
var addProtected=function(lists){
}
var callBackFunc=function(data){
var ps,i,t; if(!data || !data.query ||!(ps=data.query.pages))return; for(i in ps){ t=ps[i].title; if(ps[i].protection==[])continue; protectedLinks[t]=ps[i].protection; } if(data["query-continue"]){ params.gplcontinue=data["query-continue"].links.gplcontinue; $.getJSON(mw.util.wikiScript('api') + '?format=json',params,callBackFunc); }else{ addProtected(protectedLinks); }
}
$(function(){
if(mw.config.get("wgNamespaceNumber")==0)return; var pagename=mw.config.get("wgPageName");
params={action: 'query', generator: "links", gpllimit: "500", titles: pagename, prop: 'info', inprop: "protection"}; $.getJSON(mw.util.wikiScript('api') + '?format=json',params,callBackFunc);
}); })(jQuery);