مستخدم:Sakiv/RTRC.js
المظهر
يمكن توفير توثيق لسكربت المستخدم هذا في الصفحة : مستخدم:Sakiv/RTRC. |
ملاحظة: بعد الحفظ، قد يلزمك إفراغ الكاش لرؤية التغييرات.
mw.loader.getState("ext.gadget.rtrc")?mw.loader.load("ext.gadget.rtrc"):mw.loader.implement("ext.gadget.rtrc",function(e,t){!function(e,t){"use strict";function r(e){return 10>e?"0"+e:""+e}function a(e){var t=e.getDate();return t===j?"":(j=t,'<div class="mw-rtrc-heading"><div><strong>'+e.getDate()+" "+N[e.getMonth()]+"</strong></div></div>")}function i(e){var r,i,n,s,o,l,c,d;return r=e.newlen-e.oldlen,i=void 0!==e.unpatrolled,n=void 0!==e.anon,s=" ",o=[],"new"===e.type&&(s+='<span class="newpage">N</span>'),("edit"===e.type||"new"===e.type)&&ee&&i&&(s+='<span class="unpatrolled">!</span>'),e.oldlen>0&&0===e.newlen&&o.push("mw-rtrc-item-alert"),d=a(q.newDateFromISO(e.timestamp)),d+='<div class="mw-rtrc-item '+o.join(" ")+'" data-diff="'+e.revid+'" data-rcid="'+e.rcid+'" user="'+e.user+'">',l="edit"===e.type?'<a class="rcitemlink diff" href="'+t.util.wikiScript()+"?diff="+e.revid+"&oldid="+e.old_revid+"&rcid="+e.rcid+'">'+t.message("diff").escaped()+"</a>":"new"===e.type?'<a class="rcitemlink newPage">new</a>':t.message("diff").escaped(),d+="<div first>("+l+") "+s+" "+q.getClocktimeFromApi(e.timestamp)+' <a class="page" href="'+t.util.getUrl(e.title)+"?rcid="+e.rcid+'" target="_blank">'+e.title+'</a></div><div user> <small>· <a href="'+t.util.getUrl("User talk:"+e.user)+'" target="_blank">'+t.message("talkpagelinktext").escaped()+'</a> · <a href="'+t.util.getUrl("Special:Contributions/"+e.user)+'" target="_blank">'+t.message("contribslink").escaped()+'</a> </small>· <a class="mw-userlink" href="'+t.util.getUrl((t.util.isIPv4Address(e.user)||t.util.isIPv6Address(e.user)?"Special:Contributions/":"User:")+e.user)+'" target="_blank">'+e.user+'</a></div><div comment> <span class="comment">'+e.parsedcomment+"</span></div>",r>0?(c=r>399?"strong":"span",d+='<div class="mw-rtrc-meta"><'+c+' class="mw-plusminus mw-plusminus-pos">(+'+r.toLocaleString()+")</"+c+"></div>"):0===r?d+='<div class="mw-rtrc-meta"><span class="mw-plusminus mw-plusminus-null">(0)</span></div>':(c=-399>r?"strong":"span",d+='<div class="mw-rtrc-meta"><'+c+' class="mw-plusminus mw-plusminus-neg">('+r.toLocaleString()+")</"+c+"></div>"),d+="</div>"}function n(e,t){var r=!1;return e.app.massPatrol&&!e.rc.user&&(e.app.massPatrol=!1,r=!0,"quiet"!==t&&alert(z("masspatrol-requires-userfilter"))),e.app.massPatrol&&!e.app.autoDiff&&(e.app.autoDiff=!0,r=!0),e.app.massPatrol&&!e.rc.unpatrolled&&(e.rc.unpatrolled=!0,r=!0),!r}function s(t){var r=e(F.find(".mw-rtrc-settings")[0].elements).filter(":input");t.rc&&e.each(t.rc,function(e,t){var a=r.filter(function(){return this.name===e}),i=a[0];if(i)switch(e){case"limit":i.value=t;break;case"namespace":void 0===t?a.find("option").eq(0).prop("selected",!0):a.val(t);break;case"user":case"start":case"end":case"tag":i.value=t||"";break;case"hideliu":case"hidebots":case"unpatrolled":case"typeEdit":case"typeNew":i.checked=t;break;case"dir":i.value===t&&(i.checked=!0)}}),t.app&&e.each(t.app,function(t,a){var i=r.filter(function(){return this.name===t}),n=i[0];if(n||(n=document.getElementById("rc-options-"+t),i=e(n)),n)switch(t){case"cvnDB":case"ores":case"massPatrol":case"autoDiff":n.checked=a;break;case"refresh":n.value=a}})}function o(){var t=e(F.find(".mw-rtrc-settings")[0].elements).filter(":input");ne=e.extend(!0,{},ae),t.each(function(e,t){var r=t.name;switch(r){case"limit":ne.rc[r]=+t.value;break;case"namespace":ne.rc[r]=t.value.length?+t.value:void 0;break;case"user":case"start":case"end":case"tag":ne.rc[r]=t.value||void 0;break;case"hideliu":case"hidebots":case"unpatrolled":case"typeEdit":case"typeNew":ne.rc[r]=t.checked;break;case"dir":t.checked&&(ne.rc[r]=t.value);break;case"cvnDB":case"ores":case"massPatrol":case"autoDiff":ne.app[r]=t.checked;break;case"refresh":ne.app[r]=+t.value}}),n(ne)||s(ne)}function l(){var r=new t.Uri(t.util.getUrl(B.wgPageName)),a={};return e.each(ne.rc,function(e,t){ae.rc[e]!==t&&(a.rc||(a.rc={}),a.rc[e]=t)}),e.each(ne.app,function(e,t){"massPatrol"!==e&&ae.app[e]!==t&&(a.app||(a.app={}),a.app[e]=t)}),a=JSON.stringify(a),r.extend({opt:"{}"===a?"":a}),""+r}function c(){return e("#rc-options-pause").prop("checked",!1),O&&O.abort(),clearTimeout(S),h()}function d(e){e[0].scrollIntoView({block:"start",behavior:"smooth"})}function p(e){e[0].scrollIntoViewIfNeeded?e[0].scrollIntoViewIfNeeded({block:"start",behavior:"smooth"}):e[0].scrollIntoView({block:"start",behavior:"smooth"})}function m(){var r,a,i,o,l=new t.Uri;if(l.query.opt)try{o=JSON.parse(l.query.opt)}catch(c){}if(o){for(r in o)for(a in o[r])i=ie[a],i&&!o[r].hasOwnProperty(i)&&(o[r][i]=o[r][a],delete o[r][a]);o.app&&delete o.app.massPatrol}o=e.extend(!0,{},ae,o),n(o,"quiet"),s(o),ne=o}function u(e){var t,r=["flags","timestamp","user","title","parsedcomment","sizes","ids"],a=[],i=[];return ee&&r.push("patrolled"),e.hideliu&&a.push("anon"),e.hidebots&&a.push("!bot"),e.unpatrolled&&a.push("!patrolled"),e.typeEdit&&i.push("edit"),e.typeNew&&i.push("new"),i.length||(i=["edit","new"]),t={rcdir:e.dir,rclimit:e.limit,rcshow:a.join("|"),rcprop:r.join("|"),rctype:i.join("|")},"older"===e.dir?(void 0!==e.end&&(t.rcstart=e.end),void 0!==e.start&&(t.rcend=e.start)):"newer"===e.dir&&(void 0!==e.start&&(t.rcstart=e.start),void 0!==e.end&&(t.rcend=e.end)),void 0!==e.namespace&&(t.rcnamespace=e.namespace),void 0!==e.user&&(t.rcuser=e.user),void 0!==e.tag&&(t.rctag=e.tag),t}function f(t){t.filter(".mw-rtrc-item").each(function(){var t=e(this),r=+t.data("rcid");-1!==e.inArray(r,re)?t.addClass("mw-rtrc-item-skipped"):G.patrolled.hasOwnProperty(r)?t.addClass("mw-rtrc-item-patrolled"):r===L&&t.addClass("mw-rtrc-item-current")})}function g(t){var r,a,i;return W?(a=e.map(t.filter(".mw-rtrc-item"),function(t){return e(t).attr("data-diff")}),a.length?(i=e.grep(a,function(e){return!G.ores.hasOwnProperty(e)}),r=i.length?e.ajax({url:V,data:{models:W,revids:i.join("|")},timeout:1e4,dataType:e.support.cors?"json":"jsonp",cache:!0}).then(function(t){var r;return t&&(r=Object.keys?Object.keys(t).length:i.length,y(r),e.each(t,function(e,t){t&&!t.error&&t[W]&&!t[W].error&&(G.ores[e]=t[W].probability["true"])})),G.ores}):e.Deferred().resolve(G.ores),r.then(function(r){e.each(a,function(a,i){var n,s=r[i];!s||.45>=s||(n=z("ores-damaging-probability",(100*s).toFixed(0)+"%"),t.filter('.mw-rtrc-item[data-diff="'+ +i+'"]').addClass("mw-rtrc-item-alert mw-rtrc-item-alert-rev").find(".mw-rtrc-meta").prepend(e("<span>").addClass("mw-rtrc-revscore").attr("title",n)))})})):e.Deferred().resolve()):e.Deferred().resolve()}function w(t){var r,a=[];return t.filter(".mw-rtrc-item").each(function(){var t=e(this).attr("user");t&&-1===e.inArray(t,a)&&!G.cvn.hasOwnProperty(t)&&a.push(t)}),r=a.length?e.ajax({url:K,data:{users:a.join("|")},timeout:2e3,dataType:e.support.cors?"json":"jsonp",cache:!0}).then(function(t){return t.users&&(y(t.users.length),e.each(t.users,function(e,t){G.cvn[e]=t})),G.cvn}):e.Deferred().resolve(G.cvn),r.then(function(r){e.each(r,function(r,a){var i;"blacklist"===a.type&&(i="",i+=a.comment?z("cvn-reason")+": "+a.comment+". ":z("cvn-reason")+": "+z("cvn-reason-empty"),i+=a.adder?z("cvn-adder")+": "+a.adder:z("cvn-adder")+": "+z("cvn-adder-empty"),t.filter(".mw-rtrc-item").filter(function(){return e(this).attr("user")===r}).addClass("mw-rtrc-item-alert mw-rtrc-item-alert-user").find(".mw-userlink").attr("title",i))})})}function b(e){H.removeClass("placeholder"),M.find(".mw-rtrc-feed-update").html(I("lastupdate-rc",(new Date).toLocaleString()).escaped()+' | <a href="'+t.html.escape(l())+'">'+I("permalink").escaped()+"</a>"),e.rawHtml!==U&&(U=e.rawHtml,f(e.$feedContent),M.find(".mw-rtrc-feed-content").empty().append(e.$feedContent))}function h(){return O&&O.abort(),e("#krRTRC_loader").show(),O=e.ajax({url:E,dataType:"json",data:e.extend(u(ne.rc),{format:"json",action:"query",list:"recentchanges"})}),O.always(function(){O=null}).then(null,function(t,r){var a="<h3>Downloading recent changes failed</h3>";return"abort"===r?e.Deferred().reject():(b({$feedContent:e(a),rawHtml:a}),e.Deferred().resolve())}).then(function(r){var a,n,s,o="";return r.error?"rcpermissiondenied"===r.error.code?o+='<h3>Downloading recent changes failed</h3><p>Please untick the "Unpatrolled only"-checkbox or request the Patroller-right.</a>':(s=e.client.profile(),o+='<h3>Downloading recent changes failed</h3><p>Please check the settings above and try again. If you believe this is a bug, please <strong><a href="https://github.com/Krinkle/mw-gadget-rtrc/issues/new?body='+encodeURIComponent("\n\n\n----\npackage: mw-gadget-rtrc "+$+t.format("\nbrowser: $1 $2 ($3)",s.name,s.version,s.platform))+'" target="_blank">let me know</a></strong>.'):(a=r.query.recentchanges,a.length?e.each(a,function(e,t){o+=i(t)}):o+="<strong><em>"+I("nomatches").escaped()+"</em></strong>",j=void 0),n=e(e.parseHTML(o)),e.when(ne.app.cvnDB&&w(n),W&&ne.app.ores&&g(n)).then(null,function(){return e.Deferred().resolve()}).then(function(){b({$feedContent:n,rawHtml:o})})}).then(function(){Y.prop("disabled",!1).css("opacity","1.0"),S=setTimeout(h,1e3*ne.app.refresh),e("#krRTRC_loader").hide()})}function v(){var e=M.find(".mw-rtrc-item:not(.mw-rtrc-item-current, .mw-rtrc-item-patrolled, .mw-rtrc-item-skipped)");e.eq(0).find("a.rcitemlink").click()}function k(t){t===!0&&(A?e(".patrollink a").click():v())}function x(){var r,a,i,n=t.config.get("wgFormattedNamespaces");r="<option value>"+t.message("namespacesall").escaped()+"</option>",r+='<option value="0">'+t.message("blanknamespace").escaped()+"</option>";for(i in n)i>0&&(r+='<option value="'+i+'">'+n[i]+"</option>");for(a="<option value selected>"+I("select-placeholder-none").escaped()+"</option>",i=0;i<te.length;i++)a+='<option value="'+t.html.escape(te[i])+'">'+t.html.escape(te[i])+"</option>";F=e(e.parseHTML('<div class="mw-rtrc-wrapper"><div class="mw-rtrc-head">'+I("title").escaped()+" <small>("+$+')</small><div class="mw-rtrc-head-links">'+(t.user.isAnon()?"":'<a target="_blank" href="'+t.util.getUrl("Special:Log",{type:"patrol",user:t.user.getName(),subtype:"patrol"})+'">'+I("سجل خفري").escaped()+"</a>")+'<a id="mw-rtrc-toggleHelp">'+I("help").escaped()+'</a></div></div><form id="krRTRC_RCOptions" class="mw-rtrc-settings mw-rtrc-nohelp make-switch"><fieldset><div class="panel-group"><div class="panel"><label class="head">'+I("المرشح").escaped()+'</label><div class="sub-panel"><label><input type="checkbox" name="hideliu" /> '+I("filter-hideliu").escaped()+'</label><br /><label><input type="checkbox" name="hidebots" /> '+I("filter-hidebots").escaped()+'</label></div><div class="sub-panel"><label><input type="checkbox" name="unpatrolled" /> '+I("filter-unpatrolled").escaped()+"</label><br /><label>"+I("userfilter").escaped()+'<span section="Userfilter" class="helpicon"></span>: <input type="search" size="16" name="user" /></label></div></div><div class="panel"><label class="head">'+I("النوع").escaped()+'</label><div class="sub-panel"><label><input type="checkbox" name="typeEdit" checked /> '+I("نوع التعديل").escaped()+'</label><br /><label><input type="checkbox" name="typeNew" checked /> '+I("نوع الجديد").escaped()+'</label></div></div><div class="panel"><label class="head">'+t.message("namespaces").escaped()+' <br /><select class="mw-rtrc-setting-select" name="namespace">'+r+'</select></label></div><div class="panel"><label class="head">'+I("صيغة-الوقت").escaped()+'<span section="Timeframe" class="helpicon"></span></label><div class="sub-panel" style="text-align: right;"><label>'+I("التوقيت-من").escaped()+': <input type="text" size="16" placeholder="YYYYMMDDHHIISS" name="start" /></label><br /><label>'+I("التوقيت-حتى").escaped()+': <input type="text" size="16" placeholder="YYYYMMDDHHIISS" name="end" /></label></div></div><div class="panel"><label class="head">'+I("order").escaped()+' <br /><span section="Order" class="helpicon"></span></label><div class="sub-panel"><label><input type="radio" name="dir" value="newer" /> '+I("asc").escaped()+'</label><br /><label><input type="radio" name="dir" value="older" checked /> '+I("desc").escaped()+'</label></div></div><div class="panel"><label for="mw-rtrc-settings-refresh" class="head">'+I("reload-interval").escaped()+'<br /><span section="Reload_Interval" class="helpicon"></span></label><input type="number" value="3" min="0" max="99" size="2" id="mw-rtrc-settings-refresh" name="refresh" /></div><div class="panel panel-last"><input class="button" type="button" id="RCOptions_submit" value="'+I("طَبِّق").escaped()+'" /></div></div><div class="panel-group panel-group-mini"><div class="panel"><label for="mw-rtrc-settings-limit" class="head">'+I("نهاية").escaped()+'</label> <select id="mw-rtrc-settings-limit" name="limit"><option value="10">10</option><option value="25" selected>25</option><option value="50">50</option><option value="75">75</option><option value="100">100</option><option value="250">250</option><option value="500">500</option></select></div><div class="panel"><label class="head">'+I("وسم").escaped()+' <select class="mw-rtrc-setting-select" name="tag">'+a+'</select></label></div><div class="panel"><label class="head">CVN Scores<span section="CVN_Scores" class="helpicon"></span><input type="checkbox" class="switch" name="cvnDB" /></label></div>'+(W?'<div class="panel"><label class="head">ORES Scores<span section="ORES_Scores" class="helpicon"></span><input type="checkbox" class="switch" name="ores" /></label></div>':"")+'<div class="panel"><label class="head">'+I("المراجعة الكاملة").escaped()+'<span section="MassPatrol" class="helpicon"></span><input type="checkbox" class="switch" name="massPatrol" /></label></div><div class="panel"><label class="head">'+I("مقارنة أوتوماتيكية").escaped()+'<span section="AutoDiff" class="helpicon"></span><input type="checkbox" class="switch" name="autoDiff" /></label></div><div class="panel"><label class="head">'+I("توقف").escaped()+'<input class="switch" type="checkbox" id="rc-options-pause" /></label></div></div></fieldset></form><a name="krRTRC_DiffTop" /><div class="mw-rtrc-diff mw-rtrc-diff-closed" id="krRTRC_DiffFrame"></div><div class="mw-rtrc-body placeholder"><div class="mw-rtrc-feed"><div class="mw-rtrc-feed-update"></div><div class="mw-rtrc-feed-content"></div></div><img src="'+Q+'" id="krRTRC_loader" style="display: none;" /><div class="mw-rtrc-legend">'+I("legend").escaped()+': <div class="mw-rtrc-item mw-rtrc-item-patrolled">'+t.message("markedaspatrolled").escaped()+'</div>, <div class="mw-rtrc-item mw-rtrc-item-current">'+I("تعديل_حالي").escaped()+'</div>, <div class="mw-rtrc-item mw-rtrc-item-skipped">'+I("تعديل_تالي").escaped()+'</div></div></div><div style="clear: both;"></div><div class="mw-rtrc-foot"><div class="plainlinks" style="text-align: right;">Real-Time Recent Changes by <a href="//meta.wikimedia.org/wiki/User:Krinkle">Krinkle</a> | <a href="'+J+'">'+I("documentation").escaped()+'</a> | <a href="https://github.com/Krinkle/mw-gadget-rtrc/releases">'+I("changelog").escaped()+'</a> | <a href="https://github.com/Krinkle/mw-gadget-rtrc/issues">Feedback</a> | <a href="http://krinkle.mit-license.org">License</a></div></div></div>')),F.find("input.switch").after('<div class="switched"></div>'),F.find("#krRTRC_DiffFrame").on("click","table.diff a",function(){var t=e(this);t.is('[href^="http://"], [href^="https://"], [href^="//"]')&&t.attr("target","_blank")}),e("#content").empty().append(F),oe(function(){e("html").addClass("mw-rtrc-ready")}),H=F.find(".mw-rtrc-body"),M=H.find(".mw-rtrc-feed")}function y(e){Z+=e||1,Z>1e3&&(G.patrolled={},G.ores={},G.cvn={})}function C(){var r=new t.Api;Y=e("#RCOptions_submit"),Y.click(function(){return Y.prop("disabled",!0).css("opacity","0.5"),o(),c().then(function(){k(ne.app.massPatrol)}),!1}),F.on("click","#diffClose",function(){e("#krRTRC_DiffFrame").addClass("mw-rtrc-diff-closed"),A=L=!1}),M.on("click","a.diff",function(r){var a=e(this).closest(".mw-rtrc-item").addClass("mw-rtrc-item-current"),i=a.find(".page").text(),n=e(this).attr("href"),s=e("#krRTRC_DiffFrame");M.find(".mw-rtrc-item-current").not(a).removeClass("mw-rtrc-item-current"),A=+a.data("diff"),L=+a.data("rcid"),s.addClass("mw-rtrc-diff-loading").removeClass("mw-rtrc-diff-newpage mw-rtrc-diff-closed"),e.ajax({url:t.util.wikiScript(),dataType:"html",data:{action:"render",diff:A,diffonly:"1",uselang:B.wgUserLanguage}}).fail(function(e){s.append(e.responseText||"Loading diff failed.").removeClass("mw-rtrc-diff-loading")}).done(function(r){var a,o;a=-1!==e.inArray(L,re)?'<span class="tab"><a id="diffUnskip">'+I("unskip").escaped()+"</a></span>":'<span class="tab"><a id="diffSkip">'+I("skip").escaped()+"</a></span>",s.html(r).prepend("<h3>"+t.html.escape(i)+'</h3><div class="mw-rtrc-diff-tools"><span class="tab"><a id="diffClose">'+I("close").escaped()+'</a></span><span class="tab"><a href="'+n+'" target="_blank" id="diffNewWindow">Open in Wiki</a></span>'+(ee?"<span class=\"tab\"><a onclick=\"(function(){ if($('.patrollink a').length){ $('.patrollink a').click(); } else { $('#diffSkip').click(); } })();\">[mark]</a></span>":"")+'<span class="tab"><a id="diffNext">'+t.message("next").escaped()+" »</a></span>"+a+"</div>").removeClass("mw-rtrc-diff-loading"),ne.app.massPatrol?s.find(".patrollink a").click():(o=s.find("table.diff"),o.length&&t.hook("wikipage.diff").fire(o.eq(0)),p(s))}),r.preventDefault()}),M.on("click","a.newPage",function(r){var a=e(this).closest(".mw-rtrc-item").addClass("mw-rtrc-item-current"),i=a.find(".page").text(),n=a.find(".page").attr("href"),s=e("#krRTRC_DiffFrame");M.find(".mw-rtrc-item-current").not(a).removeClass("mw-rtrc-item-current"),L=+a.data("rcid"),s.addClass("mw-rtrc-diff-loading mw-rtrc-diff-newpage").removeClass("mw-rtrc-diff-closed"),e.ajax({url:n,dataType:"html",data:{action:"render",uselang:B.wgUserLanguage}}).fail(function(e){s.append(e.responseText||"Loading diff failed.").removeClass("mw-rtrc-diff-loading")}).done(function(r){var a;a=-1!==e.inArray(L,re)?'<span class="tab"><a id="diffUnskip">'+I("unskip").escaped()+"</a></span>":'<span class="tab"><a id="diffSkip">'+I("skip").escaped()+"</a></span>",s.html(r).prepend("<h3>"+i+'</h3><div class="mw-rtrc-diff-tools"><span class="tab"><a id="diffClose">X</a></span><span class="tab"><a href="'+n+'" target="_blank" id="diffNewWindow">Open in Wiki</a></span><span class="tab"><a onclick="$(\'.patrollink a\').click()">[mark]</a></span><span class="tab"><a id="diffNext">'+t.message("next").escaped()+" »</a></span>"+a+"</div>").removeClass("mw-rtrc-diff-loading"),ne.app.massPatrol&&s.find(".patrollink a").click()}),r.preventDefault()}),F.on("click",".patrollink",function(){var a=e(this);return a.find("a").text(t.msg("markaspatrolleddiff")+"..."),r.postWithToken("patrol",{action:"patrol",rcid:L}).done(function(r){return!r||r.error?(a.empty().append(e('<span style="color: red;"></span>').text(t.msg("markedaspatrollederror"))),void t.log("Patrol error:",r)):(a.empty().append(e('<span style="color: green;"></span>').text(t.msg("markedaspatrolled"))),M.find('.mw-rtrc-item[data-rcid="'+L+'"]').addClass("mw-rtrc-item-patrolled"),y(),G.patrolled[L]=!0,void(ne.app.autoDiff&&v()))}).fail(function(){a.empty().append(e('<span style="color: red;"></span>').text(t.msg("markedaspatrollederror")))}),!1}),F.on("click","#diffNext",function(){v()}),F.on("click","#diffSkip",function(){M.find('.mw-rtrc-item[data-rcid="'+L+'"]').addClass("mw-rtrc-item-skipped"),re.push(L),v()}),F.on("click","#diffUnskip",function(){M.find('.mw-rtrc-item[data-rcid="'+L+'"]').removeClass("mw-rtrc-item-skipped"),re.splice(re.indexOf(L),1)}),e("#mw-rtrc-toggleHelp").click(function(t){t.preventDefault(),e("#krRTRC_RCOptions").toggleClass("mw-rtrc-nohelp mw-rtrc-help")}),e(".mw-rtrc-settings .helpicon").attr("title",z("helpicon-tooltip")).click(function(t){t.preventDefault(),window.open(J+"#"+e(this).attr("section"),"_blank")}),F.on("click",".mw-rollback-link a",function(){e(".patrollink a").click()}),e("#rc-options-pause").click(function(){return this.checked?void clearTimeout(S):void c()})}function D(){e("#content").empty().append(e("<p>").addClass("errorbox").text("This program requires functionality not supported in this browser."))}function R(t){e("#content").empty().append(e("<p>").addClass("errorbox").text(t||"An unexpected error occurred."))}function T(){var r=[];return r.push(t.loader.using("mediawiki.user").then(function(){return t.user.getRights().then(function(t){-1!==e.inArray("patrol",t)&&(ee=!0)})})),r.push(t.loader.using("mediawiki.api.messages").then(function(){return(new t.Api).loadMessages(["blanknamespace","contributions","contribslink","diff","markaspatrolleddiff","markedaspatrolled","markedaspatrollederror","namespaces","namespacesall","next","talkpagelinktext"])})),r.push(e.ajax({url:E,dataType:"json",data:{format:"json",action:"query",list:"tags",tgprop:"displayname"}}).then(function(t){var r=t.query&&t.query.tags;r&&(te=e.map(r,function(e){return e.name}))})),r.push(e.ajax({url:E,dataType:"json",data:{format:"json",action:"query",meta:"siteinfo"}}).then(function(e){P=e.query&&e.query.general.timeoffset||0})),e.when.apply(null,r)}function _(){var r,a,i,n,s;return document.title="RTRC: "+B.wgDBname,e(function(){e("#p-namespaces ul").find("li.selected").removeClass("جديد").find("a").text("RTRC")}),(i=!!Date.parse)?(e(".vector-animateLayout").removeClass("vector-animateLayout"),e("html").addClass("mw-rtrc-available"),se&&(e("html").addClass("mw-rtrc-sidebar-toggleable"),e(function(){e("body").append(e("<div>").addClass("mw-rtrc-sidebar-cover"),n=e("<div>").addClass("mw-rtrc-navtoggle").on("click",function(){e("html").toggleClass("mw-rtrc-sidebar-on").removeClass("mw-rtrc-sidebar-peak")}).hover(function(){e("html").addClass("mw-rtrc-sidebar-peak")},function(){e("html").removeClass("mw-rtrc-sidebar-peak")}))})),r=t.loader.using(["json","jquery.client","mediawiki.action.history.diff","mediawiki.jqueryMsg","mediawiki.Uri","mediawiki.user","mediawiki.util","mediawiki.api","mediawiki.api.messages"]),t.libs.getIntuition||(t.libs.getIntuition=e.ajax({url:X,dataType:"script",cache:!0,timeout:7e3})),s=e.ajax({url:V,dataType:e.support.cors?"json":"jsonp",cache:!0,timeout:2e3}).then(function(e){e&&e.models&&(e.models.damaging?W="damaging":e.models.reverted&&(W="reverted"))},function(){return e.Deferred().resolve()}),a=t.libs.getIntuition.then(function(){return t.libs.intuition.load("rtrc")}).then(function(){I=e.proxy(t.libs.intuition.message,null,"rtrc"),z=e.proxy(t.libs.intuition.msg,null,"rtrc")},function(){return t.messages.set("intuition-i18n-gone","$1"),I=function(e){return t.message("intuition-i18n-gone",e)},z=function(e){return e},e.Deferred().resolve()}),void e.when(T(),r,a,s,e.ready).fail(R).done(function(){n&&n.attr("title",z("navtoggle-tooltip")),N=z("months").split(","),x(),m(),c(),d(F),C()})):void e(D)}var P,S,j,N,U,O,q,I,z,A,L,F,H,M,Y,$="v1.2.0",B=t.config.get(["skin","wgAction","wgCanonicalSpecialPageName","wgPageName","wgServer","wgTitle","wgUserLanguage","wgDBname","wgScriptPath"]),E=B.wgScriptPath+"/api.php",K="//cvn.wmflabs.org/api.php",V="//ores.wikimedia.org/scores/"+B.wgDBname+"/",W=!1,X="//tools.wmflabs.org/intuition/load.php?env=mw",J="//meta.wikimedia.org/wiki/User:Krinkle/Tools/Real-Time_Recent_Changes?uselang="+B.wgUserLanguage,Q="//upload.wikimedia.org/wikipedia/commons/d/de/Ajax-loader.gif",G={patrolled:{},cvn:{},ores:{}},Z=0,ee=!1,te=[],re=[],ae={rc:{start:void 0,end:void 0,dir:"older",namespace:void 0,user:void 0,tag:void 0,hideliu:!1,hidebots:!0,unpatrolled:!1,limit:25,typeEdit:!0,typeNew:!0},app:{refresh:5,cvnDB:!1,ores:!1,massPatrol:!1,autoDiff:!1}},ie={showAnonOnly:"hideliu",showUnpatrolledOnly:"unpatrolled"},ne=e(!0,{},ae),se="vector"===B.skin,oe=window.requestAnimationFrame||setTimeout;q={newDateFromISO:function(e){return new Date(Date.parse(e))},applyUserOffset:function(e){var r,a=t.user.options.get("timecorrection");return a?(r=a.split("|"),a="System"===r[0]?P:+r[1]):a=P,e.setTime(e.getTime()+60*a*1e3),e},getClocktimeFromApi:function(e){var t=q.applyUserOffset(q.newDateFromISO(e));return r(t.getUTCHours())+":"+r(t.getUTCMinutes())}},e(function(){e("#t-rtrc").length||t.loader.using("mediawiki.util",function(){t.util.addPortletLink("p-tb",t.util.getUrl("Special:BlankPage/RTRC"),"RTRC","t-rtrc","Monitor and patrol recent changes in real-time",null,"#t-specialpages")})}),("Krinkle/RTRC"===B.wgTitle&&"view"===B.wgAction||"Blankpage"===B.wgCanonicalSpecialPageName&&"RTRC"===B.wgTitle.split("/",2)[1])&&_()}(t,mediaWiki)},{css:[".mw-rtrc-available #siteNotice,.mw-rtrc-available .firstHeading,.mw-rtrc-available #bodyContent{visibility:hidden}.mw-rtrc-available #ca-talk,.mw-rtrc-available #p-views,.mw-rtrc-available #p-cactions,.mw-rtrc-available #footer,.mw-rtrc-available #contentSub,.mw-rtrc-available #catlinks,.mw-rtrc-available .mw-revdelundel-link{display:none} .mw-rtrc-wrapper{position:relative;background:rgb(247,246,248);border-top:30px solid #343434;padding:0 1em;font-size:13px;line-height:1.4;color:#343434;opacity:0;-webkit-transition:opacity 250ms ease-out 255ms;transition:opacity 250ms ease-out 255ms}.mw-rtrc-ready .mw-rtrc-wrapper{opacity:1}.mw-rtrc-legend .mw-rtrc-item{display:inline-block;padding:0 0.6em}.mw-rtrc-available #content{background:rgb(247,246,248);padding:0}.mw-rtrc-head{position:absolute;top:-30px;left:20%;right:10%;line-height:30px;text-align:center;color:#ccc}.mw-rtrc-foot{position:fixed;left:0;bottom:0;right:0;background:rgba(255,255,255,0.7);padding:6px 15px 6px 15px;border-top:1px solid #a1cef5;text-align:center;color:#343434;-webkit-transition:all 250ms ease-out;-webkit-transition-property:opacity,background;transition:all 250ms ease-out;transition-property:opacity,background}.mw-rtrc-foot:hover{background:rgba(255,255,255,1)} .mw-rtrc-sidebar-toggleable #mw-panel,.mw-rtrc-sidebar-toggleable #left-navigation,.mw-rtrc-sidebar-toggleable #content,.mw-rtrc-sidebar-toggleable .mw-rtrc-sidebar-cover,.mw-rtrc-navtoggle{-webkit-transition:visibility 0s linear 300ms,-webkit-transform 275ms ease-out,opacity 275ms ease-out;transition:visibility 0s linear 300ms,transform 275ms ease-out,opacity 275ms ease-out} .mw-rtrc-sidebar-peak #mw-panel,.mw-rtrc-sidebar-on #mw-panel,.mw-rtrc-sidebar-peak #left-navigation,.mw-rtrc-sidebar-on #left-navigation,.mw-rtrc-sidebar-peak #content,.mw-rtrc-sidebar-on #content,.mw-rtrc-sidebar-peak .mw-rtrc-sidebar-cover,.mw-rtrc-sidebar-on .mw-rtrc-sidebar-cover,.mw-rtrc-sidebar-peak .mw-rtrc-navtoggle,.mw-rtrc-sidebar-on .mw-rtrc-navtoggle{-webkit-transition:visibility 0s linear 0s,-webkit-transform 275ms ease-out,opacity 275ms ease-out;transition:visibility 0s linear 0s,transform 275ms ease-out,opacity 275ms ease-out} .mw-rtrc-sidebar-toggleable #mw-panel{background-color:#f6f6f6;top:0; padding-top:0; width:11em; border-right:1px solid #a7d7f9; min-height:100%;z-index:1; box-shadow:rgba(0,0,0,0.5) 0 0 25px;visibility:hidden;pointer-events:none;-webkit-transform:translate(-12em,0);transform:translate(-12em,0)}.mw-rtrc-sidebar-toggleable #p-logo{position:static; margin-bottom:1em; }.mw-rtrc-sidebar-toggleable #left-navigation{margin-left:1em}.mw-rtrc-sidebar-toggleable #content{margin-left:0;border-left:0}.mw-rtrc-sidebar-toggleable .mw-rtrc-sidebar-cover{position:absolute;left:0;right:0;top:0;bottom:0;background:#000;opacity:0;visibility:hidden}.mw-rtrc-navtoggle{position:absolute;left:1.5em;top:10px;border:0 solid #aaa;border-width:0 0 0 5px;width:10px;height:15px;cursor:pointer;-webkit-transform:translate(0,0);transform:translate(0,0)}.mw-rtrc-navtoggle:after{content:\" \";width:0;height:0;position:absolute;pointer-events:none;border:5px solid transparent;border-left-color:#333;top:50%;margin-top:-5px;margin-left:5px}.mw-rtrc-sidebar-peak .mw-rtrc-navtoggle{-webkit-transform:scale(1.5);transform:scale(1.5)}.mw-rtrc-sidebar-peak .mw-rtrc-sidebar-cover{visibility:visible;opacity:0.1}.mw-rtrc-sidebar-peak #mw-panel{z-index:1;visibility:visible;-webkit-transform:translate(-11em,0);transform:translate(-11em,0)}.mw-rtrc-sidebar-on .mw-rtrc-navtoggle{border-color:#fff;-webkit-transform:scaleX(-1) translate(-12em,0);transform:scaleX(-1) translate(-12em,0)}.mw-rtrc-sidebar-on #mw-panel{z-index:1;visibility:visible;-webkit-transform:translate(0,0);transform:translate(0,0);pointer-events:auto}.mw-rtrc-sidebar-on #p-personal{z-index:0; }.mw-rtrc-sidebar-on .mw-rtrc-sidebar-cover{visibility:visible;opacity:0.5} .mw-rtrc-head-links{float:right}.mw-rtrc-head-links a{display:inline-block;padding:0 0.6em;color:#ccc}.mw-rtrc-head-links a:hover{color:#fff;text-decoration:none;background:#555}.mw-rtrc-wrapper .button:active{position:relative;top:1px}.mw-rtrc-wrapper select{ vertical-align:baseline}.mw-rtrc-wrapper .helpicon{display:inline-block;margin-left:0.3em;vertical-align:middle;width:18px;height:18px;background:url(//upload.wikimedia.org/wikipedia/commons/5/51/Question-helpbutton.png) no-repeat}.mw-rtrc-nohelp .helpicon{display:none}.mw-rtrc-wrapper .button:hover,.mw-rtrc-wrapper .helpicon:hover{cursor:pointer}.mw-rtrc-head-links a:first-letter,.mw-rtrc-diff-tools .tab:first-letter{text-transform:uppercase} .mw-rtrc-settings{margin:0 auto;min-width:1000px;text-align:center}.mw-rtrc-settings fieldset{display:inline-block;background:#fff;border-bottom-left-radius:11px;border-bottom-right-radius:11px;box-shadow:rgba(200,200,200,1) 0 5px 15px;text-align:left; margin:0;padding:0;border:0}.mw-rtrc-setting-select{max-width:80px}.mw-rtrc-settings .panel-group{display:table}.mw-rtrc-settings .panel-group:first-child{border-bottom:1px solid #ddd}.mw-rtrc-settings .panel{display:table-cell;width:1px; vertical-align:top;border-right:1px solid #ddd;padding:3px 5px;white-space:nowrap;text-align:center}.mw-rtrc-settings .sub-panel{display:inline-block;vertical-align:top;text-align:left;padding:0 5px;border-right:1px solid #ddd}.mw-rtrc-settings .sub-panel:first-of-type{padding-left:0}.mw-rtrc-settings .sub-panel:last-of-type{border-right:0;padding-right:0}.mw-rtrc-settings .panel .head{display:block;font-weight:bold}.mw-rtrc-settings .panel-group-mini .head{display:inline-block}.mw-rtrc-settings .button{padding:6px 12px;border-width:1px;border-style:solid;border-radius:4px;font-weight:bold;font-size:14px;line-height:1.42;color:#fff;background-color:#357ebd;border-color:#3071a9}.mw-rtrc-settings .button-small{padding:3px 6px;font-size:11px;line-height:1.5;border-radius:3px}.mw-rtrc-settings .button:hover{background-color:#428bca;border-color:#428bca;cursor:pointer}.mw-rtrc-settings .button:active{box-shadow:inset 0 4px 6px rgba(0,0,0,0.250)}.mw-rtrc-settings .button-green{background-color:#4cae4c;border-color:#449d44}.mw-rtrc-settings .button-green:hover{background-color:#5cb85c;border-color:#5cb85c}.mw-rtrc-settings .button-red{background-color:#d43f3a;border-color:#c9302c}.mw-rtrc-settings .button-red:hover{background-color:#d9534f;border-color:#d9534f}.mw-rtrc-settings .button[disabled]:hover{cursor:default} .mw-rtrc-diff{position:relative;width:97%;margin:20px auto 15px auto;padding:0 1em;overflow:hidden;background:#fff;border-radius:11px;box-shadow:rgba(200,200,200,1) 0 5px 15px;-webkit-transform:scaleY(1);transform:scaleY(1);max-height:1000px;-webkit-transform-origin:top;transform-origin:top; -webkit-transition:-webkit-transform 300ms ease-out 200ms,max-height 500ms ease-in;transition:transform 300ms ease-out 200ms,max-height 500ms ease-in}.mw-rtrc-diff-closed{max-height:0;-webkit-transform:scaleY(0);transform:scaleY(0); -webkit-transition:-webkit-transform 300ms ease-in,max-height 300ms ease-out;transition:transform 300ms ease-in,max-height 300ms ease-out}.mw-rtrc-diff-newpage{max-height:400px}.mw-rtrc-diff-loading{opacity:0.4;pointer-events:none}.mw-rtrc-diff h3{margin:0 1em 0.5em 0;border-bottom:1px solid rgb(247,246,248);font-size:21px;font-weight:normal;white-space:nowrap;overflow:hidden}.mw-rtrc-diff table.diff{margin:0;width:100%}.mw-rtrc-diff-tools{position:absolute;top:0;right:2em;width:80%}.mw-rtrc-diff-tools .tab{float:right;display:block;font-weight:bold;margin-left:3px;padding:3px 10px;background-color:rgb(247,246,248);border-bottom-left-radius:11px;border-bottom-right-radius:11px}.mw-rtrc-diff-tools .tab a:hover{cursor:pointer} .mw-rtrc-body{position:relative;width:100%;margin:20px auto 70px auto}.mw-rtrc-body.placeholder{width:100%;height:600px;background:transparent url(//upload.wikimedia.org/wikipedia/commons/9/9d/RTRC_Placeholder.png) top center no-repeat}.mw-rtrc-body.placeholder > *{display:none}.mw-rtrc-feed{position:relative;padding:2em 0;background:#fff;font-size:14px;border-top-left-radius:11px;border-top-right-radius:11px;box-shadow:rgba(200,200,200,1) 0 5px 15px}.mw-rtrc-feed-update{position:absolute;top:0.5em;left:10%;width:80%;font-size:smaller;text-align:center}#krRTRC_loader{position:absolute;top:0;right:0}.mw-rtrc-feed-content{margin:0 0 -1.5em 0;width:100%}.mw-rtrc-item,.mw-rtrc-heading{padding:0 5px;white-space:nowrap;border:1px solid transparent}.mw-rtrc-item:nth-child(odd),.mw-rtrc-heading:nth-child(odd){background:#f3f3f3}.mw-rtrc-item.mw-rtrc-item-alert{background:#ffd5d5}.mw-rtrc-item.mw-rtrc-item-skipped{background:#d6d9e9}.mw-rtrc-item.mw-rtrc-item-patrolled{background:#d9e9d6}.mw-rtrc-item.mw-rtrc-item-current{background:#ffce7b;border:1px solid orange}.mw-rtrc-item-alert-rev .mw-rtrc-revscore{cursor:help}.mw-rtrc-item-alert-user .mw-userlink,.mw-rtrc-item-alert-rev .mw-rtrc-revscore{background:url(//upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Nuvola_apps_important.svg/18px-Nuvola_apps_important.svg.png) 0 50% no-repeat;padding-left:20px}@media (min-resolution:2dppx),(min-resolution:192dpi){.mw-rtrc-item-alert-user .mw-userlink,.mw-rtrc-item-alert-rev .mw-rtrc-revscore{background-image:url(//upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Nuvola_apps_important.svg/36px-Nuvola_apps_important.svg.png);background-size:18px}} .mw-rtrc-item div{display:inline-block;overflow:hidden;padding:3px 0;vertical-align:middle}.mw-rtrc-item div[first]{width:40% }.mw-rtrc-item div[user]{width:24% }.mw-rtrc-item div[comment]{width:30% }.mw-rtrc-item .mw-rtrc-meta{width:6%;text-align:right}.mw-rtrc-meta .mw-plusminus{font-size:smaller}.mw-rtrc-legend{margin:5px auto;padding:5px 13px;background:#fff;border-bottom-left-radius:11px;border-bottom-right-radius:11px;box-shadow:rgba(200,200,200,1) 0 5px 15px} .mw-rtrc-available table.diff td{white-space:-moz-pre-wrap;white-space:pre-wrap} .mw-rtrc-settings .switch{position:absolute;opacity:0}.mw-rtrc-settings .switch + div{display:inline-block;vertical-align:middle;margin:0 .5em;width:3em;height:1em;overflow:hidden;background:#fff;background-image:-webkit-linear-gradient(rgba(0,0,0,.1),transparent),-webkit-linear-gradient(0,#357ebd 50%,transparent 50%);background-image:linear-gradient(rgba(0,0,0,.1),transparent),linear-gradient(90deg,#357ebd 50%,transparent 50%);background-size:200% 100%;background-position:100% 0;background-origin:border-box;background-clip:border-box;border:1px solid rgba(0,0,0,.3);border-radius:999px;box-shadow:0 .1em .1em rgba(0,0,0,.2) inset,0 .45em 0 .1em rgba(0,0,0,.05) inset;font-size:150%;text-align:left;transition-duration:.4s;transition-property:padding,width,background-position,text-indent}.mw-rtrc-settings .switch:checked + div{padding-left:2em;width:1em;background-position:0 0}.mw-rtrc-settings .switch + div:before{content:'On';float:left;margin:-.1em;width:1.65em;height:1.65em;background:#fff;background-image:-webkit-linear-gradient(rgba(0,0,0,.2),transparent);background-image:linear-gradient(rgba(0,0,0,.2),transparent);border:1px solid rgba(0,0,0,.35);border-radius:inherit;box-shadow:0 .1em .1em .1em hsla(0,0%,100%,.8) inset,0 0 .5em rgba(0,0,0,.3);color:white;text-shadow:0 -1px 1px rgba(0,0,0,.3);text-indent:-2.5em}.mw-rtrc-settings .switch:active + div:before{background-color:#eee}.mw-rtrc-settings .switch:focus + div{box-shadow:0 .1em .1em rgba(0,0,0,.2) inset,0 .45em 0 .1em rgba(0,0,0,.05) inset,0 0 .4em 1px rgba(255,0,0,.5)}.mw-rtrc-settings .switch + div:before,.mw-rtrc-settings .switch + div:after{font:bold 60%/1.9 sans-serif;text-transform:uppercase}.mw-rtrc-settings .switch + div:after{content:'Off';text-align:left;float:left;text-indent:.5em;color:rgba(0,0,0,.45);text-shadow:none}"]
});