Uporabnik:TadejM/common.js
Opomba: Da bodo spremembe prišle do veljave, po objavi izpraznite predpomnilnik svojega brskalnika.
- Firefox/Safari: Držite Shift in kliknite Znova naloži (Reload) ali pritisnite Ctrl + Shift + R ali Ctrl + R (⌘ + R v sistemu Mac)
- Internet Explorer/Edge: Držite Ctrl + F5 in kliknite Osveži (Refresh) ali pritisnite Ctrl + F5
- Google Chrome: Pritisnite Ctrl + Shift + R (⌘ + Shift + R v sistemu Mac)
- Opera: Pritisnite Ctrl + F5.
// <nowiki> See [[mw:Manual:Interface/JavaScript]] for info including variables
mw.loader.using( 'mediawiki.util' ).done(function(){
CurNS=mw.config.get('wgCanonicalNamespace'); // Current namespace
CurNSnum=mw.config.get('wgNamespaceNumber'); // Current namespace number
CurPg=mw.config.get('wgPageName'); // Current page name
Action=mw.config.get('wgAction');
Script=mw.config.get('wgScript');
Firefox=navigator.userAgent.match(/(Firefox)/i);
// ======== PREVENT ACCIDENTAL SUBMIT IF ENTER IS HIT IN EDIT SUMMARY ========
$(document).ready(function(){
$('input#wpSummary').keypress(function(e){
if(e.which==13) e.preventDefault();
});
});
mw.util.addPortletLink(
'p-tb',
mw.config.get('wgScript')+'?title=Special:UserLogout&returnto='+mw.config.get('wgPageName'),
'Logout' // text to display in toolbox
);
// ============= MISC ONE-LINERS =============
importScript('en:User:Ohconfucius/dashes.js'); // DASHES
importScript('en:User:Numbermaniac/goToBottom.js');// GO TO BOTTOM
importScript('en:User:Numbermaniac/goToTop.js'); // GO TO TOP
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); // JWB
// ======= ITEMS TO INSTALL ONLY IF NOT ON A MOBILE DEVICE =======
if (!MOBILE)
{
importScript('MediaWiki:Gadget-popups.js'); // POPUPS
importStylesheet('MediaWiki:Gadget-navpop.css');
window.popupStructure='menus';
window.popupHideDelay=0.3;
window.popupFixDabs=true;
window.popupFixRedirs=true;
window.popupRedlinkRemoval=true;
importScript('User:Endo999/GoogleTrans.js'); // GOOGLETRANS
mw.util.addPortletLink('p-tb',"javascript:GT.SCSettings()", "GoogleTrans", "", "GoogleTrans options");
}
// ================== FORCE DESKTOP VIEW ==================
$(document).ready(function() {
if(window.location.origin.includes(".m")){
if(window.location.pathname.includes("/wiki/")){
window.location="https://en.wikipedia.org/w/index.php?title="+window.location.pathname.replace("/wiki/","")+"&mobileaction=toggle_view_desktop";
}
else{
window.location=window.location.href.replace(".m","")+"&mobileaction=toggle_view_desktop";
}
}
});
});
// </nowiki>