Skip to content

Instantly share code, notes, and snippets.

@photofroggy
Created June 9, 2012 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save photofroggy/2902640 to your computer and use it in GitHub Desktop.
Save photofroggy/2902640 to your computer and use it in GitHub Desktop.
tablump rule stuff
this.lumps = {
'&avatar\t': [ 2, function( data ) {
un = data[0];
icon = data[1];
ru = new RegExp('\\$un(\\[([0-9]+)\\])', 'g');
function repl( m, s, i ) {
return un[i].toLowerCase();
}
ico = avfile.replace(ru, repl);
ico = icon == '0' ? dav : ico.replacePArg( '{un}', un.toLowerCase() );
return '<a target="_blank" title=":icon'+un+':" href="http://$1.'+domain+'"><img class="avatar"\
alt=":icon$1:" src="'+avfold+ico+'" height="50" width="50" /></a>';
}],
'&dev\t': [ 2, '{0}<a target="_blank" alt=":dev{1}:" href="http://{1}.'+domain+'/">{1}</a>' ],
'&emote\t': [ 5, '<img alt="{0}" width="{1}" height="{2}" title="{3}" src="'+emfold+'{4}" />' ],
'&link\t': [ 3, '<a target="_blank" href="{0}" title="{2}">{2}</a>' ],
'&acro\t': [ 1, '<acronym title=\"{0}\">' ],
'&abbr\t': [ 1, '<abbr title="{0}">'],
'&thumb\t': [ 8, function( match, id, t, s, u, w, h, b, f ) {
id = data[0]; t = data[1]; s = data[2]; u = data[3]; w = data[4]; h = data[5]; b = data[6]; f = data[7];
return '<a target="_blank" href="http://' + u + '.'+domain+'/art/' + t.replacePArg(' ', '-') + '-' + id + '"><img class="thumb" title="' + t + ' by ' + s + u + ', ' + w + 'x' + h + '" width="'+w+'"\
height="'+h+'" alt=":thumb'+id+':" src="'+thfold+f.replace(/\:/, '/')+'" /></a>';
}
],
// <img class="thumb" title=":stare: by ~Link3Kokiri, 15x15" width="15" height="15" alt=":thumb{0}:" src="http://fc03.deviantart.net/fs70/f/2010/222/1/5/_stare__by_Link3Kokiri.png">
//'&thumb\t': [ [0-9]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)\t", 'g'), '<abbr title="{1}">:thumb{0}:</abbr>'],
'&img\t': [ 3, '<img src="{0}" alt="{1}" title="{2}" />'],
'&iframe\t': [ 3, '<iframe src="{0}" width="{1}" height="{2}" />'],
'&a\t': [ 2, '<a target="_blank" href="{0}" title="{1}">' ],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment