Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
The main server is currently down. We are running on a backup server, so editing and search functionality are temporarily disabled. Please check back in a few hours.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
No edit summary
No edit summary
 
(174 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. importScript('User:Rillke/bigChunkedUpload.js');*/
/* Hide "View form" tab for anonymous users */
 
$(function () {
/* Check For Ad Block
    if (mw.config.get('wgUserName') === null) {
mw.loader.load( 'https://www.gamebrew.org/index.php?title=MediaWiki:Blockadblock.js&action==raw&ctype=text/javascript' );
         $('#ca-formedit, #ca-viewform').remove();
 
(function detectAdblockWithInvalidURL(callback) {
  var flaggedURL = 'https://s.nitropay.com/ads-1285.js';
 
  if (window.fetch) {
    var request = new Request(flaggedURL, {
      method: 'HEAD',
      mode: 'no-cors',
    });
    fetch(request)
      .then(function(response) {
        if (response.status === 404) {
          callback(false);
         }
      })
      .catch(function(error) {
        callback(true);
      });
  } else {
    var http = new XMLHttpRequest();
    http.open('HEAD', flaggedURL, false);
 
    try {
      http.send();
    } catch (err) {
      callback(true);
     }
     }
 
});
    if (http.status === 404) {
      callback(false);
    }
  }
})(function(usingAdblock) {
  if(sessionStorage.getItem('showAlert') != "false"){
    alert("Hello, visitor! It looks like you're using an ad-blocker. Please consider adding Gamebrew.org to your adblock whitelist or please disable your browser's ad-blocker. Our ads support the development and upkeep of the site. Thank you.");
    sessionStorage.setItem('showAlert', "false");
    } 
})*/


/*Banner-Top*/
/*Banner-Top*/
window['nitroAds'].createAd('banner-top-mobile', {
window['nitroAds'].createAd('banner-top-desktop-ipad', {
   "refreshLimit": 10,
   "refreshLimit": 20,
   "refreshTime": 30,
   "refreshTime": 30,
   "renderVisibleOnly": true,
   "renderVisibleOnly": true,
   "refreshVisibleOnly": false,
   "refreshVisibleOnly": true,
   "sizes": [
   "sizes": [
    [
      "728",
      "90"
    ],
    [
      "970",
      "90"
    ],
     [
     [
       "320",
       "320",
Line 56: Line 28:
       "320",
       "320",
       "50"
       "50"
    ],
    [
      "300",
      "250"
    ],
    [
      "336",
      "280"
     ]
     ]
   ],
   ],
   "mediaQuery": "(min-width: 320px) and (max-width: 767px)"
   "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px)",
  "geoDeny": [
    "AU"
  ]
});
});


window['nitroAds'].createAd('banner-top-desktop-ipad', {
window['nitroAds'].createAd('banner-top-mobile', {
   "refreshLimit": 10,
   "refreshLimit": 20,
   "refreshTime": 30,
   "refreshTime": 30,
   "renderVisibleOnly": true,
   "renderVisibleOnly": true,
   "refreshVisibleOnly": false,
   "refreshVisibleOnly": true,
   "sizes": [
   "sizes": [
     [
     [
       "728",
       "300",
       "90"
       "250"
     ],
     ],
     [
     [
       "970",
       "336",
       "90"
       "280"
     ],
     ],
     [
     [
       "970",
       "320",
       "250"
       "50"
     ],
     ],
     [
     [
       "300",
       "320",
       "250"
       "100"
    ],
    [
      "336",
      "280"
     ]
     ]
   ],
   ],
   "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px)"
   "mediaQuery": "(min-width: 320px) and (max-width: 767px)"
});
});


/*Banner-Bottom*/
/*Banner-Bottom*/
window['nitroAds'].createAd('banner-bottom-mobile', {
window['nitroAds'].createAd('banner-bottom-mobile', {
   "refreshLimit": 10,
   "refreshLimit": 20,
   "refreshTime": 30,
   "refreshTime": 30,
   "renderVisibleOnly": true,
   "renderVisibleOnly": true,
   "refreshVisibleOnly": false,
   "refreshVisibleOnly": true,
   "sizes": [
   "sizes": [
     [
     [
       "320",
       "300",
       "100"
       "250"
    ],
    [
      "336",
      "280"
     ],
     ],
     [
     [
Line 115: Line 82:
     ],
     ],
     [
     [
       "300",
       "320",
       "250"
       "100"
    ],
    [
      "336",
      "280"
     ]
     ]
   ],
   ],
Line 127: Line 90:


window['nitroAds'].createAd('banner-bottom-desktop-ipad', {
window['nitroAds'].createAd('banner-bottom-desktop-ipad', {
   "refreshLimit": 10,
   "refreshLimit": 20,
   "refreshTime": 30,
   "refreshTime": 30,
   "renderVisibleOnly": true,
   "renderVisibleOnly": true,
   "refreshVisibleOnly": false,
   "refreshVisibleOnly": true,
   "sizes": [
   "sizes": [
     [
     [
       "728",
       "300",
       "90"
       "250"
     ],
     ],
     [
     [
       "970",
       "336",
       "90"
       "280"
     ],
     ],
     [
     [
       "970",
       "970",
       "250"
       "250"
    ],
    [
      "300",
      "250"
    ],
    [
      "336",
      "280"
     ]
     ]
   ],
   ],
Line 159: Line 114:
/* Ads in Content Script*/
/* Ads in Content Script*/
window['nitroAds'].createAd('mw-content-text', {
window['nitroAds'].createAd('mw-content-text', {
   "refreshLimit": 10,
   "refreshLimit": 20,
   "refreshTime": 30,
   "refreshTime": 30,
   "format": "article",
   "format": "article",
   "pageInterval": 2,
   "pageInterval": 3,
   "sizes": [
   "sizes": [
     [
     [
Line 171: Line 126:
       "336",
       "336",
       "280"
       "280"
    ],
    [
      "320",
      "50"
    ],
    [
      "320",
      "100"
     ]
     ]
   ]
   ],
  "mediaQuery": "(min-width: 320px) and (max-width: 767px)"
});
});


/* Ads in interstitial Script*/
window['nitroAds'].createAd('interstitial', {
  "format": "interstitial",
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px), (min-width: 320px) and (max-width: 767px)"
});


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


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


/* Outstream
window['nitroAds'].createAd('Videoplayer', {
  "refreshLimit": 0,
  "refreshTime": 30,
  "format": "floating"
});
*/
/*Fixed Small Banner Top*/
window['nitroAds'].createAd('small-banner-top', {
  "refreshLimit": 20,
  "refreshTime": 30,
  "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": 20,
  "refreshTime": 30,
  "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": 20,
  "refreshTime": 30,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "300",
      "250"
    ],
    [
      "336",
      "280"
    ],
    [
      "320",
      "50"
    ],
    [
      "320",
      "100"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px), (min-width: 320px) and (max-width: 767px)",
  "geoDeny": [
    "AU"
  ]
});
window['nitroAds'].createAd('Ads-Infobox1', {
  "refreshLimit": 20,
  "refreshTime": 30,
  "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": 20,
  "refreshTime": 30,
  "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": 20,
  "refreshTime": 30,
  "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"
  ]
});
/*AnchorBottom*/
window['nitroAds'].createAd('anchorBottom', {
  "refreshLimit": 20,
  "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": 30,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "300",
      "250"
    ],
    [
      "320",
      "50"
    ],
    [
      "320",
      "100"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 800px) and (max-width: 1024px)"
});


/* Ad Block*/
/* Ad Block*/

Latest revision as of 05:22, 11 July 2025

/* Hide "View form" tab for anonymous users */
$(function () {
    if (mw.config.get('wgUserName') === null) {
        $('#ca-formedit, #ca-viewform').remove();
    }
});

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

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

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

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


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


/* Ads in AnchorText Script*/
window['nitroAds'].createAd('AnchorText-mobile', {
  "refreshLimit": 20,
  "refreshTime": 30,
  "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",
  "video": {
    "float": "always",
    "mobile": "full",
    "initialDelay": 1
  }
});


/* Outstream
window['nitroAds'].createAd('Videoplayer', {
  "refreshLimit": 0,
  "refreshTime": 30,
  "format": "floating"
});
 */


/*Fixed Small Banner Top*/
window['nitroAds'].createAd('small-banner-top', {
  "refreshLimit": 20,
  "refreshTime": 30,
  "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": 20,
  "refreshTime": 30,
  "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": 20,
  "refreshTime": 30,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "300",
      "250"
    ],
    [
      "336",
      "280"
    ],
    [
      "320",
      "50"
    ],
    [
      "320",
      "100"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 768px) and (max-width: 1024px), (min-width: 320px) and (max-width: 767px)",
  "geoDeny": [
    "AU"
  ]
});

window['nitroAds'].createAd('Ads-Infobox1', {
  "refreshLimit": 20,
  "refreshTime": 30,
  "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": 20,
  "refreshTime": 30,
  "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": 20,
  "refreshTime": 30,
  "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"
  ]
});


/*AnchorBottom*/
window['nitroAds'].createAd('anchorBottom', {
  "refreshLimit": 20,
  "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": 30,
  "renderVisibleOnly": true,
  "refreshVisibleOnly": true,
  "sizes": [
    [
      "300",
      "250"
    ],
    [
      "320",
      "50"
    ],
    [
      "320",
      "100"
    ]
  ],
  "mediaQuery": "(min-width: 1025px), (min-width: 800px) and (max-width: 1024px)"
});

/* Ad Block*/

Advertising: