User:Eeekster/monobook.js

// User:Henrik/live-edit-counter importScript('User:Henrik/js/live-edit-counter.js');

// importScript('User:AzaToth/twinkle.js');

// importScript('User:AzaToth/twinkle.js');

importScript('User:TheDJ/Gadget-HotCat.js');

// importScript('User:Ioeth/friendly.js');

/**** afd helper ****/ importScript('User:Jnothman/afd_helper/script.js');

/* This is to keep track of who is using this extension: User:Jnothman/afd_helper/script.js */

// adapted from TinEye gadget for Commons // To use, add this to your user skin preferences file (probably User:YourUsername/monobook.js): // // importScript('User:Twp/tineye.js'); $( function { if ((mw.config.get('wgNamespaceNumber') != 6) || (mw.config.get('wgAction') != "view") || !document.getElementById('file')) return; var links = document.getElementById('file').getElementsByTagName('a'); if (!links.length) return; var imageurl = links[links.length-1].href; //imageboxes adds links _before_, so we get the last link if (document.getElementById('file').getElementsByTagName('img')[0].width <= 300) {  imageurl = document.getElementById('file').getElementsByTagName('img')[0].src; //Image smaller than 300px width } else { //Get thumb url   imageurl = imageurl.replace("/en/",      "/en/thumb/");   imageurl = imageurl.replace("/commons/", "/commons/thumb/");   n = imageurl.lastIndexOf('/') + 1;   imageurl = imageurl + "/300px-" + imageurl.substring(n);  } mw.util.addPortletLink('p-cactions', 'http://tineye.com/search?url=' + encodeURIComponent(imageurl), 'Tineye', 'ca-tineye'); });

/* Sysop decrier/detector (rights group displayer), version [0.2.0a] Originally from http://en.wikipedia.org/wiki/User:Splarka/sysopdectector.js Notes: Options: var showUserGroupSettings = { 'IP':true, 'unregistered':true, 'registered':true, 'groups': true, 'editcount':true, 'regdate':true, 'blocked':true }; if((mw.config.get('wgNamespaceNumber') == 2 || mw.config.get('wgNamespaceNumber') == 3) && mw.config.get('wgTitle').indexOf('/') == -1 && (mw.config.get('wgAction') != 'edit' || mw.config.get('wgAction') != 'submit')) addOnloadHook(showUserGroups) function showUserGroups { var url = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/api.php?action=query&format=json&callback=showUserGroupsCB&maxage=3600&smaxage=3600&usprop=blockinfo|groups|editcount|registration&list=users&ususers=' + encodeURIComponent(mw.config.get('wgTitle')); mw.loader.load(url); } function showUserGroupsCB(obj) { var show = window.showUserGroupSettings || false; if(!obj['query'] || !obj['query']['users']) return var user = obj['query']['users']; if(user.length == 0) return user = user[0]; var someHeading = document.getElementsByTagName('h1')[0] || document.getElementsByTagName('h2')[0] if(!someHeading) return var span = document.createElement('span'); var title = 'User:' + user['name'] + ' '; var text = ' '; if(user['invalid'] == '') { if(show && show.IP) text += '[IP] ' else title += '[invalid or IP username] ' } else if(user['missing'] == '') { if(show && show.unregistered) text += '[doesn\'t exist] ' else title += '[not a registered name] ' } else { if(show && show.registered) text += '[exists] ' else title += '[username registered] ' if(user['groups']) { if(show && show.groups || !show) text += '[' + user['groups'] + '] ' else title += '[' + user['groups'] + '] ' }   if(user['editcount']) { if(show && show.editcount) text += '[' + user['editcount'] + ' edits] ' else title += '[' + user['editcount'] + ' edits] ' }   if(user['registration']) { if(show && show.regdate) text += '[created: ' + user['registration'].split('T')[0] + '] ' else title += '[created: ' + user['registration'] + '] ' }   if(user['blockedby']) { if(show && show.blocked) text += '[blocked] ' else text += '[currently blocked] ' } }  span.setAttribute('class','detected-userrights'); span.appendChild(document.createTextNode(text)); someHeading.appendChild(span); someHeading.setAttribute('title',title); someHeading.className += ' detected-userrights-heading'; }
 * Fixed this up to use the new API fun stuffs.
 * Shows all groups now
 * nstab-user isn't available in all skins, all skins have at least one h1 or h2 I believe.
 * heading given class="detected-userrights-heading" and text in span class="detected-userrights"
 * Now supports an option system.
 * By setting a datalet true it shows in the header instead of the title.
 * Note, all are assumed false if omitted. All but 'groups' are assumed false if undefined.