MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Add)
No edit summary
Tag: Undo
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
mw.loader.load('//wiki.ekatrafoundation.org/index.php?title=User:Gurwinder/Edittool.js&action=raw&ctype=text/javascript');
// Turn <span class="mw-charinsert">foo</span> into a button that inserts "foo"
// into the edit box:
$( function () {
    $( 'span.mw-charinsert' ).wrap( function () {
        var text = this.title || this.textContent;
        var parts = text.split( '+' );
        if ( text === '+' ) parts = [ text ];
        var front = decodeURIComponent( parts[0] || '' );
        var back  = decodeURIComponent( parts[1] || '' );
        return $( '<button>' ).click( function () {
            insertTags( front, back, '' );
            return false;
        } );
    } );
} );
$( function(){
$( function(){
Line 609: Line 626:
};
};


$.getScript( '//wikisource.org/w/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript' )
$.getScript( '//wiki.ekatrafoundation.org/index.php?title=MediaWiki:Base.js&action=raw&ctype=text/javascript' )
.done( function() {
.done( function() {
importScript('MediaWiki:InterWikiTransclusion.js');
importScript('MediaWiki:InterWikiTransclusion.js');
Line 679: Line 696:
}
}
});
});
if (mw.user.isAnon() === true) { // Check if the user is anonymous
    $(function () {
        $('.ext-wikisource-download-button').hide(); // Hide the button for anonymous users
    });
}

Navigation menu