Hello,
I'm relatively hopeless with JavaScript writing, and I'm trying to resize the default tumblr avatar image on a notes page. Currently there is no way to include a large avatar in your notes, so I'm trying to use a basic regular expression to replace the dynamically generated URL.
A user's avatar is generated into something like this on all notes:
"http://28.media.tumblr.com/avatar_1d3b686efcf0_16.png"
...which are 16x16 pixel reductions of a main avatar. But the system has up to 128px .pngs that can be displayed. I want to write some JavaScript that looks for every _16.png
and changes it to _64.png
.
Here is my crappy script
var value = "_16.png";
var newValue = value.replace( new RegExp( "/_16.png/g"), "_64.png" );
document.write( newValue );
Here's the page to see the results:
http://nutnics.tumblr.com/post/1311264016
Does anybody know if tumblr is overriding this script? or if I'm writing it wrong?
--Solved
Now I realize I didn't account for calls to reload the page for additional comments. Example on this page http://nutnics.tumblr.com/post/1256847757
The avatars that come after that are not effected by the initial javascript. The code that loads the comments is not editable, I can load the code in here but it very bloated stuff. For sanity's sake I can post it verbatim on my own site here: http://nutnics.com/tumblr/morenotes.html
Any ideas?