User:OrenBochman/Scripts/personaltoolbar.js

// OREN BOCHMAN'S PERSONAL TOOLBAR // Contains links to the most important pages and some custom accelerators // Feel free to use it if you like. // Still in development.

//todo: //linkify each template. //create insert action. //log action.

/* Oren's good tags tool */ mediaWiki.loader.using(['jquery.ui'],function{

// Add tool for tagging stuff in popups var link = mw.util.addPortletLink('p-tb',                       // portletId                                    '#',                           // href                                    'Hot Tags Atrribution',        // text                                    't-HotTagAtrib',               // [id]                                    'Insert atribution Tags',      // [tooltip]                                    'T',                           // access key                                    '#t-print'  );

//portlet's click handler

$(link).click(function(event){     event.preventDefault;      // doSomeStuff;      //alert(',,,,,,');      //$(' ').text(',,,,,,').dialog;

var templateType = 'attribution'; var templates   =  [ mw.html.element(                              'a',                     //tag                              {                        //atrributes                                 href     :'javascript:void(0)',                                 onclick  :'alert("bang!");'                              },                              ''  // text                           ), ,                          ,                           ,                           ,                           ,                            ];

renderAttribDialog(templates,templateType);

});

function renderAttribDialog(templates,                                templateType){

templateType = typeof a !== 'undefined' ? a : 'attribution'; //check templateType is defined or set it default value templates = typeof templates !== 'undefined' ? templates : [,,,,,,'']; var $dialog = $( ' ' ) .html(			' Welcome, ' + mw.user.getName +			'! The following inline '+templateType+' tags are available: ' +			templates.join( ' ' ) + ''		) .dialog({			autoOpen: true,			title: 'Hello there!',			width: '70%',			modal: true		}); } });

/* Reflinks */ // Add WP:Reflinks launcher in the toolbox on left $(function { mw.util.addPortletLink( "p-tb",    // toolbox portlet "http://toolserver.org/~dispenser/cgi-bin/webreflinks.py?page=" + wgPageName + "&citeweb=on&overwrite=simple&limit=20", "Reflinks" // link label )});

/* Pending AfC submissions */ // Add CAT:PEND in the toolbox on left $(function { mw.util.addPortletLink( "p-tb",    // toolbox portlet "http://en.wikipedia.org/wiki/CAT:PEND", "AFC" // link label )});

/* AfD */ // Add WP:AFD in the toolbox on the left $(function { mw.util.addPortletLink( "p-tb",    // toolbox portlet "http://en.wikipedia.org/wiki/WP:AFD", "AFD" // link label )});

/* User login */ // Add Special:Userlogin in the toolbox on the left $(function { mw.util.addPortletLink( "p-tb",    // toolbox portlet "http://en.wikipedia.org/wiki/Special:UserLogin", "Switch user" // link label )});

/* Tester Tool */ // Add Project:Yoga in the toolbox on left $(function { mw.util.addPortletLink( "p-tb",    // toolbox portlet "http://en.wikipedia.org/wiki/Project:Yoga", "Yoga" // link label )});