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

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
(test)
(retry)
Line 2: Line 2:
 
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
+
addOnloadHook(function () {
var portletLink = mw.util.addPortletLink( 'p-namespaces', '#',
+
  if(wgCanonicalSpecialPageName == 'Contributions')
        'My new portlet link', 'ca-my-portlet', 'Click here to test the new portlet'
+
    addPortletLink('p-cactions', 'javascript:alert("it works!")', 'show/hide top', 'ca-hidetop',
);
+
                    "Show/hide pages for which you're the top contributor", '');
// Bind click handler
 
$( portletLink ).click( function ( e ) {
 
        e.preventDefault();
 
        // doSomeStuff();
 
        alert( 'It works!' );
 
 
});
 
});

Revision as of 12:54, 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');

addOnloadHook(function () {
   if(wgCanonicalSpecialPageName == 'Contributions')
     addPortletLink('p-cactions', 'javascript:alert("it works!")', 'show/hide top', 'ca-hidetop',
                    "Show/hide pages for which you're the top contributor", '');
});