• Man I’ve been waiting on this kind of functionality for so long!

    The plugin is an awesome initiative but I am having an issue with the Add image-link not working until I reload the page. I’m guessing that this is javascript-related and that the event is bound on page load.

    Looking at the thickbox init function it only binds once on document ready so when more links get added with the thickbox-class they aren’t affected.

    I’ll see what I can do about it.

    http://wordpress.org/extend/plugins/image-widget/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter smurkas

    (@smurkas)

    Ok I did the following to fix this.

    1. Changed the class of the Add image-link to image-widget so thickbox doesn’t touch it on its own.
    2. Add some jQuery event delegation.

    jQuery(document).ready(function() {
    	jQuery("body").click(function(event) {
    		if (jQuery(event.target).is('a.image-widget')) {
    			tb_show("Add an Image", event.target.href, false);
    		}
    	});
    });

    As you can see here, we’re binding an event to the body (ugly I know) and looking for when an a-tag with the image-widget class is clicked. We then call tb_show directly since we know what options we want to pass.

    I’ve tried it out and it seems to work. Let me know if there are any issues or if you don’t have the problem I describe above at all. I’m running WordPress 2.8.4.

    smurkas! this is great! Where did you add the javascript? in the js file?

    Just tried it and it totally works!!!!
    I love it! Thank you! releasing a new version now…

    Hello guys,

    Passing by to say that all my images dissapeared once I hit the automatic update to version 3.0.4, then I headed back to my widgets in order to return those images in place but I’m having a problem…

    The “add an image” link is not taking me nowhere, after clicking nothing is going on…just stays still. I can’t upload images from my CPU like I used to do.

    I’m not sure if the new version inserted a new folder for images in my root that I would have to CHMOD it or something like that?

    Excellent plugin. Everything was running smooth and nice, until the update.

    WP 2.8.4

    Cheers.

    Thanks Sammyed.

    Have you tried adding a new image widget to your sidebar? maybe the old ones have been corrupted in the update.

    Hello Peter,

    Well, I don’t know how to explain this but it’s working now πŸ™‚

    Before the update, I used to have 2 actives “image widgets” at sidebar and 1 “image widget” in my -available widgets menu-.

    After the update, all were gone except for just one available in the menu. Moving that one to side bar, I tried to upload an image using the “Add an Image” link…as I said…nothing happened. Then I posted my problem here, logged out from my WP, and…until now I’m back having 1 active “image widget” at sidebar with no image (the one I was trying to create earlier) and also 1 extra “image widget” in my -available widgets menu-…and I’m pretty sure that this one, was not there when I logged out.

    I don’t know…but it’s working wonderfully! Excellent functionality!

    Thanks and I’m sorry for posting my problem so early…I should have waited a little bit.

    Keep it up!

    Thanks Sammyed!

    I’m thinking that for some reason upgrading is corrupting the widgets. Anyone else reading this: If your widgets stop working after upgrading, remove them and then re-add them.

    Sorry for the inconvenience.

    I run WP 2.8.5 with the Thesis theme 1.6. When I upgraded to the new version of Image-Widget, I received this error:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/mpaolini/public_html/scottgree/wp-content/plugins/image-widget/image-widget.php on line 89

    Any ideas?

    and it was working fine before?

    just to check, what version image widget are we talking about?

    I just received the same fatal error above yesterday after I upgraded Image-Widget. I run WP 2.8.4 & Atahualpa 3.3.3.

    Upon activating the plugin, I received this fatal error:
    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /wp-content/plugins/image-widget/image-widget.php on line 89

    I have tried uninstalling and re-installing the plugin, but no success. I keep getting the same error. Even worse, I cannot install any other image widget plugin because I get errors for all of them.

    Any advice?

    looks like it was a php4 bug. i’ve just done another release to fix. let me know if that works for you.

    BTW, thanks for the reports.

    Oh, and if it does work, can you do me a favor and click the green button on the plugin page?

    http://wordpress.org/extend/plugins/image-widget/

    Thanks!

    Great plugin, but on wpmu the widget is only shown on the main blog, not on the user-Blogs, although I activated the plugin sitewide.

    I would be very grateful for a solution.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘[Plugin: Image Widget] Image button doesn’t work until I reload the page’ is closed to new replies.