This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

[sfLightboxPlugin] Official topic [support/bugs/features request]

Forum to discuss ExtJS and other JS plugins

[sfLightboxPlugin] Official topic [support/bugs/features request]

by COil » Wed Feb 07, 2007 11:46 pm

Just to say i have released a new javascript plugin :

--> http://www.symfony-project.com/trac/wiki/sfLightboxPlugin

It uses the Lightbox2 (http://www.huddletogether.com/projects/lightbox2/) javascript library to display nice popups for images, slide or arbitrary content (with the Modalbox modification by Demental http://demental.info/blog/index.php?post/2007/01/11/75-intro ducing-modalbox)

Feel free to give me your feedback and to report issues.

See you.

COil :P
COil
Faithful Member
 
Posts: 467
Joined: Wed Sep 06, 2006 6:08 pm

Re: [sfLightboxPlugin] New plugin !

by aruban » Thu Feb 08, 2007 1:39 am

i've just saw that on my feed-reader :)~ :-)~ :smile:
I will test it today !
thanks !
aruban
Member
 
Posts: 70
Joined: Mon Oct 16, 2006 2:56 am
Location: yokohama

Re: [sfLightboxPlugin] New plugin !

by aruban » Fri Feb 09, 2007 5:59 am

Ok, so Modal box seams to don't work at all on IE...
It's got some problems with firefox too, on both Mac and windows.
FF problem = loading graphic became invisible, but it rest here, so it's always clickable... when modal box contain form, it's not really cool :D~ :-D~ :grin:

Coil is Modal box made by you (demental is you ?)
aruban
Member
 
Posts: 70
Joined: Mon Oct 16, 2006 2:56 am
Location: yokohama

Re: [sfLightboxPlugin] New plugin !

by COil » Fri Feb 09, 2007 11:31 am

Yes modalbox has several bugs, no it's not me Demental (http://demental.info/blog/index.php?post/2007/01/11/75-intro ducing-modalbox) i just integrated the helper for modalbox, yes you are right, it does not work well under IE. a patch should be released soon

Thanks for the feedback :)~ :-)~ :smile:
COil
Faithful Member
 
Posts: 467
Joined: Wed Sep 06, 2006 6:08 pm

Re: [sfLightboxPlugin] New plugin !

by demental » Fri Feb 09, 2007 12:01 pm

Hi.
Would you test this ? http://demental.info/modalbox/example.htm
Seems ok in IE6 and IE7.
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by nautilebleu » Fri Feb 09, 2007 12:13 pm

But not modal in IE7 nor Opera :?~ :-?~ :???:
all about me
t-shirts
nautilebleu
Faithful Member
 
Posts: 281
Joined: Fri Jun 16, 2006 2:54 pm
Location: Caen, France

Re: [sfLightboxPlugin] New plugin !

by demental » Fri Feb 09, 2007 12:31 pm

Ooops.. posted too fast.
Now it's modal.
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by nautilebleu » Fri Feb 09, 2007 12:39 pm

Ok with IE7 but one least strange behaviour with Opera9.10

If I click out of the modal on the black background, nothing happens, but if I click on the grayed links, the modal closes.

<edit>
And a double-clic closes the modal too with opera
</edit>
all about me
t-shirts
nautilebleu
Faithful Member
 
Posts: 281
Joined: Fri Jun 16, 2006 2:54 pm
Location: Caen, France

Re: [sfLightboxPlugin] New plugin !

by demental » Fri Feb 09, 2007 12:52 pm

Thanks nautilebleu.
I'll try to find a workaround for Opera (not sure I will succeed). I see also some glitches on the loading image for the slow open box.

EDIT : Tried to but for now I didn't manage to get rid of this bug (which affects lightbox too). Anyway I'll add the previous fixes to the symfony plugin now.
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by COil » Fri Feb 09, 2007 5:41 pm

For me it is ok now for modalbox with FF 1.5.0.9 and IE 6.0.2900, i don't have other browsers... :o~ :-o~ :eek: (and too lazy too install another one :lol: )
COil
Faithful Member
 
Posts: 467
Joined: Wed Sep 06, 2006 6:08 pm

Re: [sfLightboxPlugin] New plugin !

by COil » Sat Feb 10, 2007 2:13 am

I made a page with the wiki + a full demo of the 3 snippets... I will kill the first one telling me he can't make the plugin work... :D~ :-D~ :grin:

--> http://snippets.coilblog.com/plugins/sfLightbox.html
COil
Faithful Member
 
Posts: 467
Joined: Wed Sep 06, 2006 6:08 pm

Re: [sfLightboxPlugin] New plugin !

by aruban » Sat Feb 10, 2007 5:05 am

i've just test the wiki page...
can't test on my apps for now, it's the week end 8-)
so, it's ok for ie7 so.
Just on modal box, the loading image is still clickable after fadeoff effect. :P
aruban
Member
 
Posts: 70
Joined: Mon Oct 16, 2006 2:56 am
Location: yokohama

Re: [sfLightboxPlugin] New plugin !

by Antik » Sat Feb 10, 2007 3:15 pm

Is it possible to change "close icon" throught options?
I need i18n support. :)~ :-)~ :smile:
Antik
Senior Member
 
Posts: 106
Joined: Tue Jul 25, 2006 5:07 pm

Re: [sfLightboxPlugin] New plugin !

by COil » Sat Feb 10, 2007 3:28 pm

Well, it's actually an image... You can change the images to equivalent ones (without labels), there are in the plugin (close.gif, next.gif, prev.gif) you will have to modify the path in the css ans js. Or to have different images depending on the culture, you will have to generate the css classes with images path and in the js you will also have to make some modification to take images as parameters...

It's a good idea of new feature...
COil
Faithful Member
 
Posts: 467
Joined: Wed Sep 06, 2006 6:08 pm

Re: [sfLightboxPlugin] New plugin !

by jamesou » Thu Feb 15, 2007 7:53 pm

Hi!
Thanks a lot for this great plugin!
I'm using it and i've just noticed a tiny problem :
After an Ajax action/update, the modal box doesn't seem to work.
Is it me or a bug ?

Cheers,

James
jamesou
Junior Member
 
Posts: 11
Joined: Mon Nov 13, 2006 5:19 pm

Re: [sfLightboxPlugin] New plugin !

by COil » Fri Feb 16, 2007 11:08 am

A new version should be released next week, we will check the issues
COil
Faithful Member
 
Posts: 467
Joined: Wed Sep 06, 2006 6:08 pm

Re: [sfLightboxPlugin] New plugin !

by jamesou » Fri Feb 16, 2007 12:44 pm

Merci :P
jamesou
Junior Member
 
Posts: 11
Joined: Mon Nov 13, 2006 5:19 pm

Re: [sfLightboxPlugin] New plugin !

by COil » Mon Feb 26, 2007 10:36 am

The new version is released.
COil
Faithful Member
 
Posts: 467
Joined: Wed Sep 06, 2006 6:08 pm

Re: [sfLightboxPlugin] New plugin !

by dawit » Mon Feb 26, 2007 1:49 pm

Hi,

I have a form on the lightbox. I am using ajax to submit the form. Is there anyway of hiding / closing the box once the ajax action is complete? There is a method called end() in the js file,

Code: Select all
end: function() {
  this.disableKeyboardNav();
  Element.hide('lightbox');
  new Effect.Fade('overlay', { duration: 0.2});
  showSelectBoxes();
}


How can I use this with form_remote_tag complete option?

Thanks,
dawit
Junior Member
 
Posts: 23
Joined: Thu Aug 24, 2006 2:12 pm

Re: [sfLightboxPlugin] New plugin !

by demental » Mon Feb 26, 2007 2:04 pm

Hi !
The script creates a modalBox instance with a global scope, called myModalbox. So you just have to call its method 'end()' in your complete callback :

Code: Select all
 'complete'=>'myModalbox.end()'


This works in lightbox too, FYI.
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by dawit » Mon Feb 26, 2007 2:16 pm

Hi,

I tried lightbox.end() and did not know there is a separate class for modalbox. Anyway it works, thank you for your quick reply!
dawit
Junior Member
 
Posts: 23
Joined: Thu Aug 24, 2006 2:12 pm

Re: [sfLightboxPlugin] New plugin !

by demental » Mon Mar 26, 2007 4:13 pm

Hi !
The plugin was just updated. No major enhancements, but at least something cool in the helpers,the options are now parsed so you can write them as scalars. Also some reorganization of the web folder and some preparation for the next release (it will be about culture).
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by dawit » Fri Apr 13, 2007 1:26 pm

Hi,

I am using the modalbox on the website I am making. I am activating the modal box from a link but after performing any ajax action on the page, the modal box does not want to work. If I click on the link it just becomes a normal link and displays the box on its own page (javascript / ajax is not executed).

I have a form that saves values to databases through ajax and after complete I refresh the div including the modalbox link (partial). If I click the link again, it looses all its ajax/javascript and becomes a normal link. What might be the causing this?

Thanks!
dawit
Junior Member
 
Posts: 23
Joined: Thu Aug 24, 2006 2:12 pm

Re: [sfLightboxPlugin] New plugin !

by klnikita » Mon Apr 16, 2007 1:04 pm

i have the same problem than dawit, please help us anyone ! :)~ :-)~ :smile:
klnikita
Junior Member
 
Posts: 8
Joined: Wed Apr 11, 2007 12:41 pm

Re: [sfLightboxPlugin] New plugin !

by demental » Mon Apr 16, 2007 1:28 pm

Hi, sorry for the delay...

Do you have a javascript error when link is clicked ?
Is there a web page I can see to find a solution to this issue ?
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by dawit » Mon Apr 16, 2007 2:36 pm

Hi,

There is no javascript error at all. That is the confusion. Let me explain the scenario a bit. I have an ajax form which updates a div and the div has the modalbox link. After submitting the form, it updates the div to reflect the changes. Now, if I click on the modalbox link, it looses its ajax and becomes a normal link displaying the modalbox on its own page. There are no javascript errors I can see.

Unfortunately, my website is on localhost so you can not test it to see what the problem is. If you need more info let me know.

Regards,
Dawit
dawit
Junior Member
 
Posts: 23
Joined: Thu Aug 24, 2006 2:12 pm

Re: [sfLightboxPlugin] New plugin !

by demental » Mon Apr 16, 2007 2:56 pm

Okay I see,
So this is normal as the modalbox triggers click on links with rel="modalbox" attribute __on page load__

If you want to dynamically add modal links, when your ajax request (and block update) is complete, call the initModalbox() function so that modalbox is inited again, including the newly added link.
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by demental » Mon Apr 16, 2007 3:03 pm

Me again.
This should not work in fact, because it will write once more in the DOM the nodes that modalbox need so you will have some duplicate identifiers in the page.
I'll try to publish a fixed version ASAP and notify here.

Anyway the way to make it work will remain the same : call initModalbox() on the onComplete() event of your ajax request or updater.
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by demental » Mon Apr 16, 2007 3:27 pm

I've published a v1.0.3 plugin on the wiki. You should now be able to pear upgrade your plugin, which should adress this issue (and a config-related bug btw).
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by dawit » Mon Apr 16, 2007 4:19 pm

Hi,

I am not actually creating the link dynamically. The link is in the div to be updated. I only update the div, not the whole page. Here is excerpts of what I have:

generateSuccess.php:

<div id="userinfodiv">
<div class='error'>
<span name="php"><code><span style="color: #000000">
<span style="color: #0000BB"><?php </span><span style="color: #007700">if (</span><span style="color: #0000BB">$sf_request</span><span style="color: #007700">-></span><span style="color: #0000BB">hasErrors</span><span style="color: #007700">()):    echo </span><span style="color: #0000BB">__</span><span style="color: #007700">(</span><span style="color: #DD0000">'The data you entered seems to be incorrect. Please    correct the following errors and resubmit'</span><span style="color: #007700">);     endif </span><span style="color: #0000BB">?></span>
</span>
</code></span>
</div>
<span name="php"><code><span style="color: #000000">
<span style="color: #0000BB"><?php include_partial</span><span style="color: #007700">(</span><span style="color: #DD0000">'cv/userinfoform'</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'user_info' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$user_info</span><span style="color: #007700">, </span><span style="color: #DD0000">'municipialities' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$municipialities</span><span style="color: #007700">,  </span><span style="color: #DD0000">'suburbs' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$suburbs</span><span style="color: #007700">, </span><span style="color: #DD0000">'user_info_m' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$user_info_m</span><span style="color: #007700">, </span><span style="color: #DD0000">'can_accredit_userinfo' </span><span style="color: #007700">=>  </span><span style="color: #0000BB">$can_accredit_userinfo</span><span style="color: #007700">, </span><span style="color: #DD0000">'user_info_a' </span><span style="color: #007700">=> </span><span style="color: #0000BB">$user_info_a</span><span style="color: #007700">)); </span><span style="color: #0000BB">?></span>
</span>
</code></span>
</div>


_useroinfoform:

<span name="php"><code><span style="color: #000000">
<span style="color: #0000BB"><?php  use_helper</span><span style="color: #007700">(</span><span style="color: #DD0000">'Object'</span><span style="color: #007700">, </span><span style="color: #DD0000">'Javascript'</span><span style="color: #007700">, </span><span style="color: #DD0000">'I18N'</span><span style="color: #007700">, </span><span style="color: #DD0000">'Tabs'</span><span style="color: #007700">, </span><span style="color: #DD0000">'Validation'</span><span style="color: #007700">, </span><span style="color: #DD0000">'Lightbox'</span><span style="color: #007700">); echo </span><span style="color: #0000BB">form_remote_tag</span><span style="color: #007700">(array(                  </span><span style="color: #DD0000">'url'      </span><span style="color: #007700">=> </span><span style="color: #DD0000">'cv/updateUserInfo'</span><span style="color: #007700">,                  </span><span style="color: #DD0000">'update'   </span><span style="color: #007700">=> array(</span><span style="color: #DD0000">'failure' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'userinfodiv'</span><span style="color: #007700">, </span><span style="color: #DD0000">'success' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'userinfodiv'</span><span style="color: #007700">),             </span><span style="color: #DD0000">'success' </span><span style="color: #007700">=> </span><span style="color: #DD0000">"showCVTab('faminfo')"</span><span style="color: #007700">,             </span><span style="color: #DD0000">'script'  </span><span style="color: #007700">=> </span><span style="color: #0000BB">true           </span><span style="color: #007700">),             array(                 </span><span style="color: #DD0000">'id' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'userinfo_form'</span><span style="color: #007700">,                 </span><span style="color: #DD0000">'class' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'form'             </span><span style="color: #007700">)         ) </span><span style="color: #0000BB">?></span>
</span>
</code></span>

<div align="right">
<span name="php"><code><span style="color: #000000">
<span style="color: #0000BB"><?php   $link_options </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'title' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'Verify'</span><span style="color: #007700">,</span><span style="color: #DD0000">'class' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'new blocksize_420x160'</span><span style="color: #007700">);            </span><span style="color: #0000BB">$serverPage </span><span style="color: #007700">= </span><span style="color: #DD0000"> "/cv/accreditRequest?section=general_info&id={$user_info - >getId()}&update=userinfodiv"</span><span style="color: #007700">;   echo </span><span style="color: #0000BB">light_modallink</span><span style="color: #007700">(</span><span style="color: #DD0000">'<h3>Verify</h3>'</span><span style="color: #007700">, </span><span style="color: #0000BB">$serverPage</span><span style="color: #007700">, </span><span style="color: #0000BB">$link_options</span><span style="color: #007700">);    </span><span style="color: #0000BB">?></span>
</span>
</code></span>
</div>


After the form action is complete I reload the userinfodiv div (not the whole page) on generateSuccess.php which includes the userinfoform partial (the modalbox link is also in this partial as you can see above).

Where do I put the myModalBox.initModalBox()? I tried it with 'success' => "showCVTab('faminfo'), myModalBox.initModalBox()" and does not want to work. Is there anywhere else I should place this?

Thanks,
Dawit
dawit
Junior Member
 
Posts: 23
Joined: Thu Aug 24, 2006 2:12 pm

Re: [sfLightboxPlugin] New plugin !

by demental » Mon Apr 16, 2007 5:05 pm

dawit wrote:
Where do I put the myModalBox.initModalBox()? I tried it with 'success' => "showCVTab('faminfo'), myModalBox.initModalBox()" and does not want to work. Is there anywhere else I should place this?

Thanks,
Dawit


This should be 'success'=>"showCVTab('faminfo');initModalbox()"
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by dawit » Tue Apr 17, 2007 12:13 pm

Hi demental,

I think the initModalbox() function is attached to the body onload event. Since I am updating only the div containing the partial, the method suggested ('success'=>"showCVTab('faminfo');initModalbox()") did not work. I only managed to make it work after calling initModalbox() inside the partial that updates the div. This means on intial page load it initializes the modal box twice, one when the whole page is loading and the other when rendering the partial. I can't figure out if there is a better way of doing this, so I am keeping it this way for now.

Thank you for your help and great plugin!!
dawit
Junior Member
 
Posts: 23
Joined: Thu Aug 24, 2006 2:12 pm

Re: [sfLightboxPlugin] New plugin !

by demental » Tue Apr 17, 2007 6:13 pm

Happy to know you found a workaround.

I think it does not work inside the 'success' event because there is some time between the moment the innerHTML of your div is updated and the new DOM elements are accessible via JS. I'm not an expert though so this needs a confirmation.
I guess you could make a pause (pause function is included in the lightbox.js) to let javascript take the time to know about these new DOM elements.
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by infect » Sun Apr 22, 2007 12:08 am

Hey guys, thanks for the great plugin.

As of this posting, the lightbox js has been updated to version 2.03.1:

http://www.huddletogether.com/projects/lightbox2/

The latest version adds support for showing and hiding flash objects underneath the lightbox window. It's also quite easy to add this into demental's excellent modalbox js file by adding the "hideFlash()" and "showFlash()" calls in start and end:

Code: Select all
...

start: function(imageLink) {   
   hideSelectBoxes();
   hideFlash();

...

end: function() {
   this.disableKeyboardNav();
   Element.hide('lightbox');
   new Effect.Fade('overlay', { duration: overlayDuration});
   showSelectBoxes();
   showFlash();
}

...


... hope that helps anyone dealing with the same issue. I'm sure this will be incorporated into a future release, but it was nice to know it was easy to implement.
Mark Quezada
MirthLab
infect
Member
 
Posts: 98
Joined: Thu Jan 12, 2006 4:50 pm

Re: [sfLightboxPlugin] New plugin !

by COil » Tue Apr 24, 2007 12:24 pm

Damn i've just released a 1.0.4 version with a small bug fix, i guess this will be part of the next release, so this modification should only modify the js file ?
COil
Faithful Member
 
Posts: 467
Joined: Wed Sep 06, 2006 6:08 pm

Re: [sfLightboxPlugin] New plugin !

by cosmicxdust » Thu May 10, 2007 3:48 pm

Thank you for a great plugin.

Everything works fine. However, I could not use it with IE 6.0. An unhandled win32 exception occurred and forced me to close IE.

I also try http://www.huddletogether.com/projects/lightbox2/#example, but I had the same error.

It is Lightbox2 or my IE' error? How to solve it?

Thanks in advanced.
cosmicxdust
Member
 
Posts: 39
Joined: Tue Nov 14, 2006 9:11 am

Re: [sfLightboxPlugin] New plugin !

by demental » Fri May 11, 2007 3:38 pm

Hi
No doubt that your browser is guilty in your case as this should work without any problem on IE6.
Maybe you can upgrade your version to the latest 6.0 (if possible), maybe this could fix it.
Have you tried it on another computer running IE6 ?
or do you have an url to test it ?
demental
Member
 
Posts: 34
Joined: Thu Apr 20, 2006 11:11 pm
Location: tarn

Re: [sfLightboxPlugin] New plugin !

by cosmicxdust » Sat May 12, 2007 6:58 am

demental wrote: Hi
No doubt that your browser is guilty in your case as this should work without any problem on IE6.
Maybe you can upgrade your version to the latest 6.0 (if possible), maybe this could fix it.
Have you tried it on another computer running IE6 ?
or do you have an url to test it ?


Thank you, demental!

I may find the solution. In Tools->Internet Options->Advanced, I unchecked option "Enable third-party browser extensions". It means I disabled Broswer Helper Object.

I have tested it at http://www.huddletogether.com/projects/lightbox2/#example, and it works.

I do not know how it is. If a user does not disable this option, he or she could not use Lightbox.

I have one more question. How could we format the layout when display images. If I put all picture array in light_slideshow, I will get pictures the display continuously.

Thank you.
cosmicxdust
Member
 
Posts: 39
Joined: Tue Nov 14, 2006 9:11 am

Re: [sfLightboxPlugin] New plugin !

by cosmicxdust » Thu May 17, 2007 6:43 pm

Any help!
cosmicxdust
Member
 
Posts: 39
Joined: Tue Nov 14, 2006 9:11 am

Re: [sfLightboxPlugin] New plugin !

by COil » Mon Jul 02, 2007 10:49 am

You cna do it by applying a style on a div that would contain the images ?
COil
Faithful Member
 
Posts: 467
Joined: Wed Sep 06, 2006 6:08 pm