Difference between revisions of "MediaWiki:Common.js"

Jump to: navigation, search

Difference between revisions of "MediaWiki:Common.js"

(Replaced content with "Any JavaScript here will be loaded for all users on every page load.: ")
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
 +
 +
jQuery.fn.visible = function() {
 +
    return this.css('visibility', 'visible');
 +
};
 +
 +
jQuery.fn.invisible = function() {
 +
    return this.css('visibility', 'hidden');
 +
};
 +
 +
jQuery.fn.visibilityToggle = function() {
 +
    return this.css('visibility', function(i, visibility) {
 +
        return (visibility == 'visible') ? 'hidden' : 'visible';
 +
    });
 +
};

Revision as of 18:49, 19 November 2015

/* Any JavaScript here will be loaded for all users on every page load. */

jQuery.fn.visible = function() {
    return this.css('visibility', 'visible');
};

jQuery.fn.invisible = function() {
    return this.css('visibility', 'hidden');
};

jQuery.fn.visibilityToggle = function() {
    return this.css('visibility', function(i, visibility) {
        return (visibility == 'visible') ? 'hidden' : 'visible';
    });
};