Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js

MediaWiki interface page
Revision as of 20:31, 6 Mayıs 2023 by HydeWing (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. importScript('User:Rillke/bigChunkedUpload.js');*/

/* Check For Ad Block*/
/*mw.loader.load( 'https://www.gamebrew.org/index.php?title=MediaWiki:Blockadblock.js&action==raw&ctype=text/javascript' );*/


/*Disable Scrolling*/
var keys = {37: 1, 38: 1, 39: 1, 40: 1};

function preventDefault(e) {
  e.preventDefault();
}

function preventDefaultForScrollKeys(e) {
  if (keys[e.keyCode]) {
    preventDefault(e);
    return false;
  }
}

var supportsPassive = false;
try {
  window.addEventListener("test", null, Object.defineProperty({}, 'passive', {
    get: function () { supportsPassive = true; } 
  }));
} catch(e) {}

var wheelOpt = supportsPassive ? { passive: false } : false;
var wheelEvent = 'onwheel' in document.createElement('div') ? 'wheel' : 'mousewheel';

function disableScroll() {
  window.addEventListener('DOMMouseScroll', preventDefault, false);
  window.addEventListener(wheelEvent, preventDefault, wheelOpt);
  window.addEventListener('touchmove', preventDefault, wheelOpt);
  window.addEventListener('keydown', preventDefaultForScrollKeys, false);
}

function enableScroll() {
  window.removeEventListener('DOMMouseScroll', preventDefault, false);
  window.removeEventListener(wheelEvent, preventDefault, wheelOpt); 
  window.removeEventListener('touchmove', preventDefault, wheelOpt);
  window.removeEventListener('keydown', preventDefaultForScrollKeys, false);
}

disableScroll();
setTimeout(enableScroll, 2000);

/*Banner-Top*/
window['nitroAds'].createAd('banner-top-desktop-ipad', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "250"
    ],
    [
      "970",
      "250"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px)",
  "geoDeny": [
    "AU"
  ]
});

window['nitroAds'].createAd('banner-top-mobile', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "250"
    ],
    [
      "336",
      "280"
    ]
  ],
  "mediaQuery": "(min-width: 320px) and (max-width: 767px)"
});

/*Banner-Bottom*/
window['nitroAds'].createAd('banner-bottom-mobile', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "250"
    ],
    [
      "336",
      "280"
    ]
  ],
  "mediaQuery": "(min-width: 320px) and (max-width: 767px)"
});

window['nitroAds'].createAd('banner-bottom-desktop-ipad', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "250"
    ],
    [
      "970",
      "250"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px)"
});


/* Ads in Content Script*/
window['nitroAds'].createAd('mw-content-text', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "format": "article",
  "pageInterval": 3,
  "sizes": [
    [
      "320",
      "250"
    ],
    [
      "336",
      "280"
    ]
  ],
  "mediaQuery": "(min-width: 320px) and (max-width: 767px)"
});


/* Ads in AnchorText Script*/
window['nitroAds'].createAd('AnchorText-mobile', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "format": "anchor",
  "anchor": "top",
  "anchorPersistClose": false,
  "mediaQuery": "(min-width: 320px) and (max-width: 767px)"
});

/* Video Script - Desktop and Ipad Only*/
window['nitroAds'].createAd('Videoplayer', {
  "format": "video-nc",
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px)",
  "video": {
    "float": "always",
    "mobile": "compact",
    "initialDelay": 1
  }
});

/*Outstream - Desktop and Ipad Only
window['nitroAds'].createAd('outstream-video', {
  "refreshLimit": 20,
  "refreshTime": 30,
  "format": "floating",
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px)"
});
*/

/*Fixed Small Banner Top*/
window['nitroAds'].createAd('small-banner-top', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "50"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px)"
});

/*Sidebar-Sticky*/
window['nitroAds'].createAd('sidebar-sticky', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "160",
      "600"
    ]
  ],
  "mediaQuery": "(min-width: 1200px), (min-width: 1200px) and (max-width: 1200px)"
});

/*Ads-Infobox*/
window['nitroAds'].createAd('Ads-Infobox', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "250"
    ],
    [
      "336",
      "280"
    ]
  ]
});

window['nitroAds'].createAd('Ads-Infobox1', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "50"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px), (min-width: 320px) and (max-width: 767px)",
  "geoDeny": [
    "AU"
  ]
});

window['nitroAds'].createAd('Ads-Infobox3', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "50"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px), (min-width: 320px) and (max-width: 767px)"
});


/* Large Mobile Banner*/
window['nitroAds'].createAd('largemobilebanner', {
  "refreshLimit": 10,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "50"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px), (min-width: 320px) and (max-width: 767px)"
});


/*AnchorBottom*/
window['nitroAds'].createAd('anchorBottom', {
  "refreshLimit": 10,
  "refreshTime": 30,
  "format": "anchor",
  "anchor": "bottom",
  "anchorPersistClose": false,
  "mediaQuery": "(min-width: 1025px), (min-width: 1000px) and (max-width: 1024px)"
});

/*Ads-InfoboxTop
window['nitroAds'].createAd('Ads-InfoboxTop', {
  "refreshLimit": 20,
  "refreshTime": 45,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "320",
      "250"
    ],
    [
      "336",
      "280"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 1000px) and (max-width: 1024px)"
});*/

/* Ad Block*/

Advertising: