MediaWiki:RailgunModules.min.js

/** * @fileOverview This file defines Railgun modules, it is a package of * additional modules which can be displayed on the Wikia Rail. This file * is automatically loaded by the Railgun client. * * Railgun Wiki:   http://railgunscript.wikia.com/wiki/Railgun_Wiki * Contact Author: http://community.wikia.com/wiki/Message_Wall:Mathmagician * * @author © Jeff Bradford, 2012 * @version 2.2.1 */ console.log("[Railgun]: Loading modules package:",Railgun.Config.modulesJS);(function(d){var c=[];var b=20;var h="It looks like you haven't made any friends yet. To add someone to your friend's list, first visit their profile. An icon will appear in the upper-right corner of this module, click it to add them to your list. You can remove friends the same way.";function f(n,o){var j=encodeURIComponent(n.replace(/ /g,"_"));var y='';var x='';var i='';var l='';var k='';var v=' ';var m=''+n+"";var u=' ';var s='[talk]';var z=' [blog]';var w=' [contrib]';var p=' [count]';var q=' [log</a>]';var r=' [sub</a>]';var t=i+l+y+x+"</a> "+k+v+m+" "+u+s+z+w+p+q+r+"  ";return t}function e(n){var q=n.data.username;var k=n.data.avatarURL;var m=n.data.homewiki;if(c.length===b){return}var j=-1;for(var l=0;l<c.length;l++){if(c[l].username===q){j=l;break}}if(-1!==j){c.splice(j,1)}c.push({username:q,avatarURL:k,homewiki:m});c.sort(function(r,i){if(r.username<i.username){return -1}else{if(r.username==i.username){return 0}else{return 1}}});Railgun.setItem("friends",c);var p=$(f(q,k));p.hover(function{$(this).find(".railgun-friend-td2-span2").css("visibility","visible")},function{$(this).find(".railgun-friend-td2-span2").css("visibility","hidden")});$("#railgun-no-friends-message").remove;$('.railgun-friend-tr[data-user="'+q+'"]').remove;var o=$(".railgun-friend-tr");if(0===o.length){$("#railgun-friend-table").append(p)}else{if(q<o.first.attr("data-user")){$("#railgun-friend-table").prepend(p)}else{if(q>o.last.attr("data-user")){$("#railgun-friend-table").append(p)}else{for(var l=0;l<o.length;l++){if(q<$(o[l]).attr("data-user")){$(o[l]).before(p);break}}}}}$("#railgun-add-friend-icon").css("display","none");$("#railgun-remove-friend-icon").css("display","inline")}function g(l){var n=l.data.username||"";var j=-1;for(var k=0;k<c.length;k++){if(c[k].username===n){j=k;break}}if(-1!==j){c.splice(j,1)}Railgun.setItem("friends",c);$('.railgun-friend-tr[data-user="'+n+'"]').remove;var m=$(".railgun-friend-tr");if(0===$(".railgun-friend-tr").length){$("#railgun-friend-table").append(h)}$("#railgun-remove-friend-icon").css("display","none");$("#railgun-add-friend-icon").css("display","inline")}function a{c=Railgun.getItem("friends")||[];var j=$("#UserProfileMasthead");var q=(0<j.length);var l="";var k="";var s=false;if(q){l=j.find(".masthead-info h1").text;k=j.find(".masthead-avatar img").attr("src")}var r=' ";if(q){n=o+p+n}Railgun.insert("railgun-friend-module",n,"Friend's List");$(".railgun-friend-tr").hover(function{$(this).find(".railgun-friend-td2-span2").css("visibility","visible")},function{$(this).find(".railgun-friend-td2-span2").css("visibility","hidden")});if(q){$("#railgun-add-friend-icon").on("click",{username:l,avatarURL:k,homewiki:wgServer},e);$("#railgun-remove-friend-icon").on("click",{username:l},g)}}Railgun.register("railgun-friend-module","Friend's List",a)});(function{var b=true;function e{var f="";if("function"==typeof window.getSelection){f=window.getSelection.toString}else{if("function"==typeof document.getSelection){f=document.getSelection.toString}else{if("object"==typeof document.selection&&"function"==typeof document.selection.createRange){f=document.selection.createRange.text}}}return f.trim}function a(g,f){return'<button id="'+g+'" class="railgun-quicksearch-button">'+f+" "}function c(h,f,g){$("#"+h).click(function{var i=prompt(f,e);if("string"==typeof i){i=encodeURIComponent(i);if(b){window.open(g+i)}else{window.location.href=g+i}}})}function d{var t=" Highlight some text anywhere on the page and then click one of the search buttons! ";var s=' ";Railgun.insert("railgun-quicksearch-module",m,"Quick² Search");c("railgun-quicksearch-localwiki","Search "+wgSiteName,wgServer+"/wiki/index.php?go=Go&search=");c("railgun-quicksearch-globalwikia","Perform a global Wikia search","http://www.wikia.com/index.php?fulltext=Search&search=");c("railgun-quicksearch-wikipedia","Search Wikipedia, The Free Encyclopedia","http://en.wikipedia.org/wiki/index.php?search=");c("railgun-quicksearch-mediawiki","Search Mediawiki.org","http://www.mediawiki.org/w/index.php?search=");c("railgun-quicksearch-google","Search Google","https://www.google.com/#hl=en&q=");c("railgun-quicksearch-googleimages","Search Google Images","https://www.google.com/search?hl=en&tbm=isch&q=");c("railgun-quicksearch-translate","Translate a word using Google Translator","http://translate.google.com/#auto|en|");c("railgun-quicksearch-youtube","Search for a Youtube video","http://www.youtube.com/results?search_query=");c("railgun-quicksearch-dictionary","Look up a word on Dictionary.com","http://dictionary.reference.com/browse/");c("railgun-quicksearch-amazon","Search for a product on Amazon.com","http://www.amazon.com/s/field-keywords=");c("railgun-quicksearch-w3schools","Look up HTML/CSS/JavaScript specifications at w3schools.com","https://www.google.com/search?sitesearch=www.w3schools.com&as_q=");c("railgun-quicksearch-csstricks","Pick up some new CSS tricks from css-tricks.com","http://css-tricks.com/search-results/?q=")}Railgun.register("railgun-quicksearch-module","Quick² Search",d)});