MediaWiki:Group-user.js

/* Any JavaScript here will be loaded for registered users only */

//

$(function { $("#content div.amdiv-text").each(function { var adt = $(this).data("value"); adt = adt.replace(/(.*?)/g,"$1"); adt = adt.replace(/(.*?)/g,"$1"); adt = adt.replace(/\[\[([^\]]*?)\]\]/g,function(match,p1,offset,string) {     if (match.slice(0,7) === "[[File:") {        var split = match.replace(/[\[\]]/g,"").split("|");        var file = split.shift.slice(5);        var md5 = hex_md5(file);        var path = mw.config.get("wgServer")+"/media/"+md5.slice(0,1)+"/"+md5.slice(0,2)+'/'+file;        var imglink = "";        var title = "";        for (s in split) {          if (split[s].slice(0,5) === "link=") imglink = split[s].slice(5);          else if (!split[s].match(/\d+\w+/)) title = split[s];        }        var output = "";        if (imglink !== "") output = '';        output += '';        if (imglink !== "") output += "";        return output;      }      var split = match.replace(/[\[\]]/g,"").split("|"); var output = ''; if (split.length > 1) output += split[1]; else output += split[0]; output += ""; return output; });   adt = adt.replace(/\[([^\]]*?)\]/g,function(match,p1,offset,string) { var split = match.replace(/[\[\]]/g,"").split(" "); var link = split.shift; return ''+split.join(' ')+''; });   $(this).html(adt);    var $tempSpan = $(" ").css({"font-size":"90%","white-space":"nowrap","visibility":"hidden","height":0}).html(adt).appendTo("#bodyContent");    var targetWidth = parseInt($tempSpan.width) + 60;    if (am = adt.match(/<img/)) targetWidth += (am.length * 60);    $tempSpan.remove;    $(this).parent.css({"--target-width":targetWidth + "px","animation-play-state":"running"});    $(this).css("animation-play-state","running");  }); });