User:Prahlad balaji/vector.js

This is an old revision of this page, as edited by Prahlad balaji (talk | contribs) at 15:08, 25 November 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// Wikipedia:Tools/Navigation popups //
importScript('MediaWiki:Gadget-popups.js');
importStylesheet('MediaWiki:Gadget-navpop.css');

importScript('User:Anomie/previewtemplatelastmod.js'); // Linkback: [[User:Anomie/previewtemplatelastmod.js]]
window.popupStructure = 'menus';
window.popupAdminLinks = true;

// initialize the array - only do this once
window.extraPopupFilters = [];

// define the function
function popupFilterHtmlTable (wikiText) {
	if (/<table/i.test(wikiText)) return '&lt;table&gt;';
	else return '';
}

// add the function for the array (you can repeat this for lots of functions)
extraPopupFilters.push(popupFilterHtmlTable);

// Normally features are enabled
var toFix = true;

// In special pages, histories and previews disable them
if ( mw.config.get( 'wgCanonicalNamespace' ) === 'Special' ||
    $.inArray( mw.util.getParamValue( 'action' ), [ 'history', 'submit' ] ) !== -1)
{
	toFix = false;
}
//
window.popupRedlinkRemoval = toFix;
window.popupFixRedirs = toFix;
window.popupFixDabs = toFix;

importScript('User:TheDJ/qui.js');