User:Kyz/common.js

$("h3:contains('.lha')").each(function {    var archive = $(this).text.trim;    // messy... find the first table.filetable after the h3, select all td.r    // (file size column), go to their previous sibling (file name column)    // then  the last child node, which is the text node with the filename    var filetable = $(this).siblings(".filetable").first.find("td.r").prev.each(function (i, td) { var node = $(td.lastChild), filename = node.text.trim; // wrap all filenames in  tags // - those which have no "." anywhere (instruments, "songplay" code, deliplayers...) // - smp.*, smpl.*, *.ss, *.ssd, *.instr, *.x (samples and instruments) // - *.asm, *.sh (assembly source code and shell scripts) // - *.ogg, *.mp2, *.mp3 (large streaming audio files) if (filename.match(/\./) && !filename.match(/(?:^smpl?\.|\.(?:asm|[Ii]nstr|mp[23]|ogg|sh|ssd?|x)$)/)) { node.wrap(""); }   }); });