FANDOM


Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Chrome - Windows: Hold the Ctrl key and press the F5 key. OS X: Hold both the ⌘ Cmd and ⇧ Shift keys and press the R key.
  • Safari - Hold down the ⇧ Shift key and click the Reload toolbar button.
  • Firefox - Windows: Hold the Ctrl key, and press F5. OS X: Hold the ⌘ Cmd and ⇧ Shift keys, and then press R.
  • Internet Explorer - Hold the Ctrl key, and press F5 (or click the Refresh button).
/**
 * @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="<p id=\"railgun-no-friends-message\">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='<a href="/wiki/User:'+j+'">';var x='<img src="'+o+'" class="railgun-friend-avatar">';var i='<tr class="railgun-friend-tr" data-user="'+n+'">';var l='<td class="railgun-friend-td1">';var k='<td class="railgun-friend-td2">';var v='<span class="railgun-friend-td2-span1">';var m='<a href="/wiki/User:'+j+'">'+n+"</a>";var u='<span class="railgun-friend-td2-span2">';var s='[<a href="/wiki/User_talk:'+j+'">talk</a>]';var z=' [<a href="/wiki/User_blog:'+j+'">blog</a>]';var w=' [<a href="/wiki/Special:Contributions/'+j+'">contrib</a>]';var p=' [<a href="/wiki/Special:Editcount/'+j+'">count</a>]';var q=' [<a href="/wiki/Special:Log/'+j+'">log</a>]';var r=' [<a href="/wiki/Special:PrefixIndex/User:'+j+'">sub</a>]';var t=i+l+y+x+"</a></td>"+k+v+m+"</span><br />"+u+s+z+w+p+q+r+"</span></td></tr>";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='<table id="railgun-friend-table">';var t="";if(0===c.length){t=h}else{for(var m=0;m<c.length;m++){if(l===c[m].username){s=true}t+=f(c[m].username,c[m].avatarURL)}}var o='<img id="railgun-add-friend-icon" title="Add '+l+' to friend\'s list?" src="https://images.wikia.nocookie.net/__cb20120418234625/mathmagician/images/0/00/Bomb_Omb_30px.png"';var p='<img id="railgun-remove-friend-icon" title="Click to remove '+l+'." src="https://images.wikia.nocookie.net/__cb20120418234525/mathmagician/images/7/79/Star_30px.png"';if(s){o+=' style="display:none;">';p+=">"}else{o+=">";p+=' style="display:none;">'}var n=r+t+"</table>";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+"</button>"}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="<p>Highlight some text anywhere on the page and then click one of the search buttons!</p>";var s='<table id="railgun-quicksearch-table">';var q=a("railgun-quicksearch-localwiki","Local Wiki");var j=a("railgun-quicksearch-globalwikia","Global Wikia");var o=a("railgun-quicksearch-wikipedia","Wikipedia");var r=a("railgun-quicksearch-mediawiki","Mediawiki");var l=a("railgun-quicksearch-google","Google");var k=a("railgun-quicksearch-googleimages","Google Images");var i=a("railgun-quicksearch-translate","Translate");var g=a("railgun-quicksearch-youtube","Youtube");var p=a("railgun-quicksearch-dictionary","Dictionary");var f=a("railgun-quicksearch-amazon","Amazon");var n=a("railgun-quicksearch-w3schools","w3schools");var h=a("railgun-quicksearch-csstricks","CSS Tricks");var m=t+s+"<tr><td>"+q+"</td><td>"+j+"</td></tr><tr><td>"+o+"</td><td>"+r+"</td></tr><tr><td>"+l+"</td><td>"+k+"</td></tr><tr><td>"+i+"</td><td>"+g+"</td></tr><tr><td>"+p+"</td><td>"+f+"</td></tr><tr><td>"+n+"</td><td>"+h+"</td></tr></table>";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)}());