Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

User:Awesome Aasim/rcnotify.js

    From Wikipedia, the free encyclopedia
    <User:Awesome Aasim
    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 theappropriate village pump.
    This codewill be executed when previewing this page.
    Thisuser script seems to have a documentation page atUser:Awesome Aasim/rcnotify.
    Note: After saving, you have to bypass your browser's cache to see the changes.Google Chrome,Firefox,Microsoft Edge andSafari: Hold down the⇧ Shift key and click theReload toolbar button. For details and instructions about other browsers, seeWikipedia:Bypass your cache.
    if(mw.config.get("wgPageName").toLowerCase()=="Special:RecentChanges".toLowerCase()){//sends notifications on every new bad editvarRCNotify={};$.get(mw.config.get("wgScriptPath")+"/api.php",{"action":"query","format":"json","list":"recentchanges","rcnamespace":"0|3","rcprop":"title|timestamp|flags|loginfo|oresscores|parsedcomment|user|ids|tags","rcshow":"oresreview","rctoponly":true,"rclimit":"1","rctype":"edit|new"}).done(function(result){RCNotify.oldedit=result.query.recentchanges[0].revid;if(Notification.permission!=='granted'){Notification.requestPermission();if(Notification.permission!='granted'){mw.notify("RC Notification alert: Please enable notifications on your browser to get notified every time an edit needing review is made.");}}RCNotify.fetch();});RCNotify.notifications=[];RCNotify.revids=[];RCNotify.fetch=function(){$.get(mw.config.get("wgScriptPath")+"/api.php",{"action":"query","format":"json","list":"recentchanges","rcnamespace":"0|3","rcprop":"title|timestamp|flags|loginfo|oresscores|parsedcomment|user|ids|tags","rcshow":"oresreview","rctoponly":true,"rclimit":"1","rctype":"edit|new"}).done(function(result){if(RCNotify.oldedit<result.query.recentchanges[0].revid){RCNotify.oldedit=result.query.recentchanges[0].revid;RCNotify.revids.push(result.query.recentchanges[0].revid);RCNotify.notifications.push(newNotification("New recent change to "+mw.config.get("wgSiteName")+" needs review",{body:result.query.recentchanges[0].user+" made a potentially problematic edit to \""+result.query.recentchanges[0].title+"\". Click to review."}));RCNotify.notifications[RCNotify.notifications.length-1].onclick=function(){console.log(this);varrevindex=RCNotify.notifications.indexOf(this);window.open(location.origin+"/wiki/Special:Diff/"+RCNotify.revids[revindex]);this.close();// focus our tab and close notif};}window.setTimeout(RCNotify.fetch,1000);});};}
    Retrieved from "https://en.wikipedia.org/w/index.php?title=User:Awesome_Aasim/rcnotify.js&oldid=1069151539"

    [8]ページ先頭

    ©2009-2025 Movatter.jp