MediaWiki:App local.js

function addAjaxDisplayLink{$("table.ajax").each(function(a){var e=$(this).attr("id","ajaxTable"+a),t=$(' ').appendTo(e.find("th").first),i=e.find("td").first,n=!0;if(e.find(".nojs-message").remove,i.parent.show,i.hasClass("showLinkHere")){var l=i.html,r=l.replace(/\[link\](.*?)\[\/link\]/,'$1');r!=l&&(i.html(r),n=!1)}n&&t.html('[show data]'),e.find(".ajax-load-link").parent.andSelf.filter("a").click(function(a){var n=e.data("ajax-source-page"),l="http://"+currentWikiDomain+".gamepedia.com/index.php?";a.preventDefault,i.text("Please wait while the content is being loaded..."),$.get(l+$.param({action:"render",title:n}),function(a){if(a){var e=/(href=\"\/\/.*?com\/)/g;a=a.replace(e,'href = "file:///'),i.html(a),i.find(".ajaxHide").remove;var n=!0;$("hide").click(function{n=!n,n?i.show:i.hide,$(this).text(n?"hide":"show"),console.log("UpdateView")}).appendTo(t)}}).error(function{i.text("Unable to load table; the source article for it might not exist.")})})})}$(addAjaxDisplayLink);