Difference between revisions of "User:Waldir/vector.js"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(test)
Line 1: Line 1:
 
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Js/6tabs-vector.js&action=raw&ctype=text/javascript');
 
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Js/6tabs-vector.js&action=raw&ctype=text/javascript');
 
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Markhurd/hidetopcontrib.js&action=raw&ctype=text/javascript');
 
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Markhurd/hidetopcontrib.js&action=raw&ctype=text/javascript');
 +
 +
// Create portlet link
 +
var portletLink = mw.util.addPortletLink( 'p-namespaces', '#',
 +
        '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( 'It works!' );
 +
});

Revision as of 12:53, 22 November 2012

importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Js/6tabs-vector.js&action=raw&ctype=text/javascript');
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Markhurd/hidetopcontrib.js&action=raw&ctype=text/javascript');

// Create portlet link
var portletLink = mw.util.addPortletLink( 'p-namespaces', '#',
        '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( 'It works!' );
});