User:GhostInTheMachine/common.js
//// SD0001 speed-loader
// Enable caching for resource loads, see [[User:SD0001/Making_user_scripts_load_faster]], @revision 8
if(!/\bnocache=\b/.test(location.href)){let e=mw.config.values,t="text/javascript",o="text/css",n=(n,r,i)=>(n=n.replace(/special:mypage/i,"User:"+e.wgUserName),$.get("https://"+r+"/w/api.php?titles="+n+"&origin=*&format=json&formatversion=2&uselang=content&maxage=86400&smaxage=86400&action=query&prop=revisions|info&rvprop=content&rvlimit=1&inprop=protection").then((e=>{let a=e.query.pages[0];if(!a.missing){if(2!==a.ns&&8!==a.ns&&!a.protection.find((e=>"edit"===e.type&&"sysop"===e.level)))return $.Deferred().reject('Refused to load "'+n+'"@'+r+": unprotected page");let e=a.revisions[0].content;if(i&&i!==t||"javascript"!==a.contentmodel){if(i!==o||"css"!==a.contentmodel)return $.Deferred().reject('Refused to load "'+n+'"@'+r+": content type mismatch");mw.loader.addStyleTag(e)}else{let t=document.createElement("script");t.innerHTML=e,document.head.appendChild(t)}}}))),r=e.wgServerName,i=e=>{let t=/^(?:(?:https:)?\/\/(.*))?\/w\/index.php/.exec(e),o=/\btitle=([^=?&]*)/.exec(e);return t&&o&&/\baction=raw\b/.test(e)&&/\bctype=/.test(e)?[o[1],t[1]||r]:null};window.importScript=e=>{n(encodeURIComponent(e),r,t)},window.importStyleSheet=e=>{n(encodeURIComponent(e),r,o)};let a=mw.loader.load;mw.loader.load=function(e,t){let o=i(e);o?n(o[0],o[1],t):a.apply(mw.loader,[...arguments])};let l=mw.loader.getScript;mw.loader.getScript=function(e){let o=i(e);return o?n(o[0],o[1],t):l.apply(mw.loader,[...arguments])}}
//// CONFIG before load
window.hotcat_use_category_links = true; // HotCat
window.LiveClockTimeZone = 'Europe/London'; // clock/purge gadget
// Comments in Local Time gadget tone down the output
window.LocalComments = { dateDifference: false, dropDays: 2, dropMonths: 1, twentyFourHours: true };
// User:SD0001/W-Ping add other intervals. "-1 day" acts as "now"
window.WPing_Quick_Durations = ["-1 day", "1 day", "2 days", "3 days", "5 days", "1 week", "2 weeks", "3 weeks", "1 month"];
//// load external CSS (most of my user script have their own CSS included)
[
"User:Anomie/linkclassifier.css"
].forEach(function(s){
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=' + s + '&action=raw&ctype=text/css', 'text/css' );
});
//// load user scripts
var where = "|" + mw.config.get("wgWikiID").replaceAll('wiki', '') + "|";
[
"|en|-----|-------|----| User:Ahecht/Scripts/pageswap.js",
"|en|-----|commons|meta| User:Anomie/linkclassifier.js",
"|en|-----|-------|----| User:BrandonXLF/HotDefaultSort.js",
"|en|-----|-------|----| User:DemonDays64/Scripts/Dumb_quotes.js",
"|en|-----|-------|----| User:Enterprisey/userinfo.js",
"|en|-----|-------|----| User:Evad37/ToDoLister.js", // needs ext.gadget.libExtraUtil
"|en|-----|-------|----| User:MPGuy2824/MoveToDraft.js",
"|en|media|commons|meta| User:Nardog/CatChangesViewer.js",
"|en|-----|-------|----| User:Nux/CategorySortKeys.js",
"|en|media|commons|meta| User:PerfektesChaos/js/lintHint/r.js",
"|en|media|commons|meta| User:PrimeHunter/Source_links.js",
"|en|-----|-------|----| User:RedWarn/.js",
"|en|media|commons|meta| User:SD0001/shortdescs-in-category.js",
"|en|-----|-------|----| User:SD0001/StubSorter.js",
"|en|-----|commons|----| User:SD0001/W-Ping.js",
"|en|-----|-------|----| User:Taavi/Aligner.js",
"|en|-----|-------|----| User:Uglemat/RefMan.js",
"|en|-----|-------|----| User:Zackmann08/AddCheckForUnknownParameters.js",
"|en|-----|-------|----| Wikipedia:AutoEd/complete.js",
"|**|*****|-------|****| User:GhostInTheMachine/CommentsInLocalTime.js", // clone of [[User:Gary/comments_in_local_time.js]] — now use the standard gadget
"|**|media|-------|meta| User:GhostInTheMachine/FoldSections.js", // no value on commons
"|en|-----|commons|meta| User:GhostInTheMachine/GraphicReplyLink.js", // MediaWiki uses the Other Thing
"|en|media|commons|meta| User:GhostInTheMachine/LastEditor.js",
"|en|media|commons|meta| User:GhostInTheMachine/NoEditSummary.js",
"|en|-----|-------|----| User:GhostInTheMachine/SD-display-helper.js", // not needed outside en
"|en|-----|-------|----| User:GhostInTheMachine/SDlinkBuilder.js", // not needed outside en
"|en|-----|-------|----| User:GhostInTheMachine/SDsummary.js", // not needed outside en
"|en|media|commons|meta| User:GhostInTheMachine/SortWhatLinksHere.js",
"|**|-----|-------|----| User:GhostInTheMachine/TalkHelper2.js", // needs User:BrandonXLF/FloatSide.css + ext.gadget.CommentsInLocalTime
"|en|-----|-------|----| User:GhostInTheMachine/TalkHelper3.js", // v3 uses the standard CommentsInLocalTime gadget (FloatSide.css now in UI.js)
"|en|media|commons|meta| User:GhostInTheMachine/UI.js",
"|en|media|commons|meta| User:GhostInTheMachine/WatchlistTidy.js"
].forEach(function(s){
var w = s.split(' ');
if(w[0].includes(where)){
mw.loader.load( 'https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=' + w[1] );
}
});
//// CONFIG after load
var todo_subpage = "TODO"; // Evad37/ToDoLister
var autoEdClick = false; // AutoEd -- just make the changes
var autoEdClick = true; // AutoEd -- immediately show the diffs
var autoEdLinkName = "AutoEd"; // AutoEd -- set the menu name
//// END
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.