phpBB image resizer

By Grauw Last update Dec 23, 2005 — Installed 3,017 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 5 posts, 4 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Ed Smilde User

Finally! This is what I need!

 
Grauw Script's Author

Heh, just some fun. Oh goody.

 
Grauw Script's Author

Hi Glodenox,

I added the title change when clicking, but I’m not able to read the rest of your code (between for j=0; j < and > maxWidth). It seems that userscripts.org’s comment system accepts HTML, and breaks miserably when you provide invalid HTML such as yours with unescaped <’s.

I wonder what this means for security... Surely I can make a script this way which catches your login data and sends them to a server of mine?

Ehehehe… \^_^/

 
Glodenox User

I added some more tags by accident because I didn't understand where to put a comment...
I could no longer remove the tags which were placed twice or more :(

However, about the userscript:
I added two extra lines of code (and some lines with closing tags of course):

for (j=0; j<aimg>
// only change things if the width is longer than it may be
if (aImg[j].width > maxWidth) {

and a bit further in the code:
// change title when clicked at image for original size and vice versa
if (event.currentTarget.style.maxWidth == 'none') {
event.currentTarget.style.maxWidth = maxWidth + 'px';
event.currentTarget.title = 'Click for the original size';
} else {
event.currentTarget.style.maxWidth = 'none';
event.currentTarget.title = 'Click for the restricted size';
}

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel