User:Emma/common.js: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
(Testing script.)
No edit summary
Line 1: Line 1:
addOnloadHook( function() {
// Create portlet link
addPortletLink ('p-personal','User:' + mw.config.get('wgUserName')+'/Sandbox, 'My sandbox', 'ca-sandbox', 'My personal sandbox', 's');
var portletLink = mw.util.addPortletLink( 'p-cactions', ' ',
        'My new portlet link', 'ca-my-portlet',    'Click here to test the new portlet'
);
// Bind click handler
$(portletLink).click( function( e ) {
        e.preventDefault();
        // doSomeStuff();
        alert( 'htmlspecialchars( trim( $row->user_real_name ) )' );
});
 
mw.loader.using('jquery.tipsy', function () {
$('.username').prepend($('<span>').append(wgUserName))
});
mw.loader.using('jquery.tipsy', function () {
$('.usergroups').prepend($('<span>').append(wgUserName))
});
});

Revision as of 00:23, November 9, 2011

// Create portlet link
var portletLink = mw.util.addPortletLink( 'p-cactions', ' ',
        'My new portlet link', 'ca-my-portlet',    'Click here to test the new portlet'
);
// Bind click handler
$(portletLink).click( function( e ) {
        e.preventDefault();
        // doSomeStuff();
        alert( 'htmlspecialchars( trim( $row->user_real_name ) )' );
});

mw.loader.using('jquery.tipsy', function () {
$('.username').prepend($('<span>').append(wgUserName))
});
mw.loader.using('jquery.tipsy', function () {
$('.usergroups').prepend($('<span>').append(wgUserName))
});