(starting new thread, as the exhibitionist one doesn't entirely encompass this topic;-)
I went ahead and hacked a little javascript to draw clickable image boxes. To see it (it is completely invisible to everyone by default, except for a template that adds a new category to the image description page), look at [[Template:Imagebox]] and follow the instructions.
To view the only example of this (my own picture, as I didn't want to vandalize someone else's;-) look at [1]. It marks the bee in a semi-transparent box with a red border, with the name of the category it links to ("Bee") written on it. If you click on the box, you go to that category.
Notes: * This is just a demo. If you want it for real, gimme feedback! * This is the very first halfway working version. There's no show/hide toggle, no "box drawing" function, nothing. * Almost everything about this can be changed. * No, I won't do circles or ellipses ;-) * For me, it didn't work so well together with my other commons javascripts ;-) If you have problems and use other javascript, surround the other JS /* like this */ for testing purposes.
Cheers, Magnus
[1] http://commons.wikimedia.org/wiki/Image:Valeriana_officinalis_2007-06-02_%28...
This doesn't seem to work for me at all. I don't see any box and clicking on the image only brings up the big image as normal. I did a force-reload, but nothing.
On 7/2/07, Magnus Manske magnusmanske@googlemail.com wrote:
(starting new thread, as the exhibitionist one doesn't entirely encompass this topic;-)
I went ahead and hacked a little javascript to draw clickable image boxes. To see it (it is completely invisible to everyone by default, except for a template that adds a new category to the image description page), look at [[Template:Imagebox]] and follow the instructions.
To view the only example of this (my own picture, as I didn't want to vandalize someone else's;-) look at [1]. It marks the bee in a semi-transparent box with a red border, with the name of the category it links to ("Bee") written on it. If you click on the box, you go to that category.
Notes:
- This is just a demo. If you want it for real, gimme feedback!
- This is the very first halfway working version. There's no show/hide
toggle, no "box drawing" function, nothing.
- Almost everything about this can be changed.
- No, I won't do circles or ellipses ;-)
- For me, it didn't work so well together with my other commons
javascripts ;-) If you have problems and use other javascript, surround the other JS /* like this */ for testing purposes.
Cheers, Magnus
[1] http://commons.wikimedia.org/wiki/Image:Valeriana_officinalis_2007-06-02_%28...
Commons-l mailing list Commons-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/commons-l
On 7/3/07, Howard Cheng howard@howcheng.com wrote:
This doesn't seem to work for me at all. I don't see any box and clicking on the image only brings up the big image as normal. I did a force-reload, but nothing.
Bad me, I wrote "monobook.css" instead of "monobook.js" on the template page! Sorry about that. Put it in your "monobook.js", and it will work.
Magnus
Hi!
Put it in your "monobook.js", and it will work.
uncaught exception: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "http://commons.wikimedia.org/w/index.php?title=MediaWiki:ImageBoxes.js&a... Line: 84"]
in Mozilla/5.0 (Windows; U; Windows NT 6.0; cs; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
-- [[cs:User:Mormegil | Petr Kadlec]]
On 03/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
On 7/3/07, Howard Cheng howard@howcheng.com wrote:
This doesn't seem to work for me at all. I don't see any box and clicking on the image only brings up the big image as normal. I did a force-reload, but nothing.
Bad me, I wrote "monobook.css" instead of "monobook.js" on the template page! Sorry about that. Put it in your "monobook.js", and it will work.
Nothing at all for me in Firefox, I'm afraid, despite much trying and purging and reloading...
On 7/3/07, Andrew Gray shimgray@gmail.com wrote:
On 03/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
On 7/3/07, Howard Cheng howard@howcheng.com wrote:
This doesn't seem to work for me at all. I don't see any box and clicking on the image only brings up the big image as normal. I did a force-reload, but nothing.
Bad me, I wrote "monobook.css" instead of "monobook.js" on the template page! Sorry about that. Put it in your "monobook.js", and it will work.
Nothing at all for me in Firefox, I'm afraid, despite much trying and purging and reloading...
Really strange... Works for me (Windows XP, Firefox 2.0.0.4).
Maybe it helps if you copy my monobook.js page: http://commons.wikimedia.org/wiki/User:Magnus_Manske/monobook.js
I get the box fine, no javascript errors at all, on both commons and my test site.
Maybe I have to make a screenshot? ;-)
Magnus
On 7/3/07, Magnus Manske magnusmanske@googlemail.com wrote:
On 7/3/07, Andrew Gray shimgray@gmail.com wrote:
On 03/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
On 7/3/07, Howard Cheng howard@howcheng.com wrote:
This doesn't seem to work for me at all. I don't see any box and clicking on the image only brings up the big image as normal. I did a force-reload, but nothing.
Bad me, I wrote "monobook.css" instead of "monobook.js" on the template page! Sorry about that. Put it in your "monobook.js", and it will work.
Nothing at all for me in Firefox, I'm afraid, despite much trying and purging and reloading...
Really strange... Works for me (Windows XP, Firefox 2.0.0.4).
Maybe it helps if you copy my monobook.js page: http://commons.wikimedia.org/wiki/User:Magnus_Manske/monobook.js
I get the box fine, no javascript errors at all, on both commons and my test site.
Maybe I have to make a screenshot? ;-)
Also works fine in Internet Exploder 7, surprisingly.
Magnus
On 03/07/07, Magnus Manske magnusmanske@googlemail.com wrote:
Nothing at all for me in Firefox, I'm afraid, despite much trying and purging and reloading...
Really strange... Works for me (Windows XP, Firefox 2.0.0.4).
Half an hour later, something magic happened and it's up and running :-)
VICTORY! :-)
My javascript toy now shows a link "Add a box" below the image. Click on it, then on the upper left corner of the new-box-to-be in the image, then on the lower right corner. Enter a category name to link to, and you get a ready-to-copy-and-paste template. Just put it in the image description, and voila, new box.
Also, you can now turn existing boxes on and off via a link. A box will become fully transparent when you hover over it with the mouse cursor.
There is no "delete box" function - just edit the description page to remove the appropriate template.
Note: Adding boxes doesn't seem to work in Internet explorer. Probably a minor bug, will fix tomorrow.
Magnus
Magnus Manske wrote:
VICTORY! :-)
My javascript toy now shows a link "Add a box" below the image. Click on it, then on the upper left corner of the new-box-to-be in the image, then on the lower right corner. Enter a category name to link to, and you get a ready-to-copy-and-paste template. Just put it in the image description, and voila, new box.
Also, you can now turn existing boxes on and off via a link. A box will become fully transparent when you hover over it with the mouse cursor.
There is no "delete box" function - just edit the description page to remove the appropriate template.
Note: Adding boxes doesn't seem to work in Internet explorer. Probably a minor bug, will fix tomorrow.
Magnus
I'd prefer from upper left to down right. Note that the text to copy uses template {{Image box}} instead of {{imagebox}}
On 7/3/07, Platonides Platonides@gmail.com wrote:
Magnus Manske wrote:
VICTORY! :-)
My javascript toy now shows a link "Add a box" below the image. Click on it, then on the upper left corner of the new-box-to-be in the image, then on the lower right corner. Enter a category name to link to, and you get a ready-to-copy-and-paste template. Just put it in the image description, and voila, new box.
Also, you can now turn existing boxes on and off via a link. A box will become fully transparent when you hover over it with the mouse cursor.
There is no "delete box" function - just edit the description page to remove the appropriate template.
Note: Adding boxes doesn't seem to work in Internet explorer. Probably a minor bug, will fix tomorrow.
Magnus
I'd prefer from upper left to down right.
??? That's what it does, and what I wrote.
Or do you mean literally to replace the word "lower" with "down"?
Note that the text to copy uses template {{Image box}} instead of {{imagebox}}
Oops, fixed.
Magnus