Sat 8 Mar 2008
jQuery Impromptu is ready. I made a few minor fixes mentioned in the comments:
- like adding javascript:; to the iframe
- it now properly returns the correct jquery object
- iframe is now an option
- I added a close button(hence another line of css)

March 10th, 2008 at 2:47 pm
Like to see on-going work on this good plugin, but I don’t know about giving up on version 1.2. I prefer it over 1.4 for two reasons: the prompt loads better and there is no superfluous X in the upper right. (Loads better meaning smoother visually and faster. With 1.4 the middle box of my prompt shifts, whereas before it just appeared in the right place.)
March 11th, 2008 at 7:28 am
Agreed on the 1.2 speed. Unfortunately I had to make some changes due to browser compatibility. I would have loved to leave it the same, but we’ll see what can be done to make the newer version faster. As far as the X, just setting the css for it to display: none; should work.
March 12th, 2008 at 10:39 am
in 1.4 jqifade have zIndex, but jqibox have not
it is not critical, CSS helps to fix it
March 18th, 2008 at 5:22 am
Thanks for plugin - it’s really good.
But I want to submit one bug. This bug was in 1.3 and still is in 1.4 versions (I don’t know about older ones). You can recreate bug in your demo page with Firefox. Just simply click on any Example button and then press TAB button on keyboard. Impromptu prompt will be closed. Instead desired behavior would be if after hitting TAB pointer would jump to input boxes (if they exist) or to buttons. In Internet Explorer everything works OK (you can travel between input boxes and buttons with TAB and/or SHIFT+TAB), but in Firefox there is no such possibility.
I hope you can fix this bug, because in Firefox it is very annoying.
Thanks!
March 19th, 2008 at 7:03 am
You’re right. Some browers it does. Thanks for catching this. I believe it is the key binding for the escape key to close the prompt. If you need to get rid of this bug until I can get the appropriate fix out, just comment out the line:
jqib.keypress(escapeKeyClosePrompt);
near the bottom of the script. Hope that helps, I will get this fixed very soon!
March 19th, 2008 at 1:07 pm
Thanks for plugin, it’s really good!
I only have some problem with focus: i can never have a button focused.
Even in the example page, when you say “To change the default focused button:”, i cannot se any changes.
I am using IE 7
March 21st, 2008 at 7:51 am
I’m not sure if this is an issue with ie, or something I am doing wrong as I cannot get it to function properly either..
March 25th, 2008 at 9:18 am
Don’t know if someone already suggested this, but you can allow the window to be created with a different size just by adding this on your code:
After these declarations:
var jqib = (…)
var jqi = (…)
var jqif = (…)
Just add something like this:
if (o.width != null ) {
jqi.width(o.width);
}
Cheers,
Pedro
March 26th, 2008 at 7:37 am
Hey Pedro,
Thanks for the snippet. Also if you change width on a regular basis you could add it to the ImpromptuDefaults hash and give it a default value. This will set a default, but if you specify it in the $.prompt(’asdfas’,{ width: 500 }); it will override it. then you shouldn’t need the o.width != null.
Otherwise you can use CSS to adjust the width. Hope that helps.
March 26th, 2008 at 1:27 pm
Thank you so much for the workaround regarding the tab key in FireFox. It was driving me nuts that the tab key would close the prompt.
I commented out the line you suggested, and now all is well.
What is strange, however, and I thought worth mentioning is that depending on where the initial focus is, a tab key press does not always close the prompt immediately. Where I’m using it, the prompt has two form inputs and two buttons, and if I click on the “window” of the prompt to give it focus, then press tab, the focus goes to my first input. A second tab and the prompt closes. That threw me off for .. but your suggestion did fix the problem for now.
March 26th, 2008 at 1:43 pm
I’ve found a workaround so that the tab key works as expected AND you can still use the Esc key to close the prompt.
Replace the following:
var escapeKeyClosePrompt = function(e){
if(e.which == 27 || (e.DOM_VK_ESCAPE == 27 && e.which==0)) removePrompt();
};
With:
var escapeKeyClosePrompt = function(e){
var kC = (window.event) ? event.keyCode : e.keyCode; // MSIE or Firefox?
var Esc = (window.event) ? 27 : e.DOM_VK_ESCAPE; // MSIE : Firefox
if(kC==Esc) removePrompt();
};
The replacement snippet is based on a snippet from: http://users.fmg.uva.nl/rgrasman/jscript/2005/07/capturing-escape-esc-key-in-javascript.html
March 26th, 2008 at 2:10 pm
Thanks Ben, Seems to work for me too. I’ll try to put out a newer version with this change tonight!
March 27th, 2008 at 8:47 am
Another simple fix:
var escapeKeyClosePrompt = function(e){
var code = (e.which) ? e.which : e.keyCode;
if(code === 27) {removePrompt();}
};
March 31st, 2008 at 2:55 pm
Hi, great plugin. One minor bug I noticed since v1.2 is now your corner() example (#11) no longer works, at least in FF2/IE7.
Also want to mention that I especially appreciate the time you put into making the examples look good. Some jQuery plugins come with pretty basic css that I think effectively kills off a lot of potential interest in the plugin. jQuery’s DatePicker comes to mind - compare the default examples vs Mootools Calendar. I imagine one small downside to good plugin example css is there are probably an awful lot of sage-themed Impromptu windows out there
So thanks again for the plugin - I use it on the Add Complaint form for CarComplaints.com to double check whether people have selected the proper vehicle. User registration is required to get to that point (adding a vehicle complaint) so here’s a screenshot instead:
http://www.carcomplaints.com/test/impromptu.png
March 31st, 2008 at 3:30 pm
Wick,
Thanks for using the plugin. The issue with that plugin should only be within the example(I forgot to update it with the newer Impromptu version). $.prompt now returns the fade and the prompt, not just the prompt. so you would need to do something like:
$.prompt(”hello”).find(”.jqi”).corner();
I havn’t tested it, but I know I made a change to the returned object and that should be the cause..
April 2nd, 2008 at 4:18 pm
Cool. After I wrote that post, I looked at your code changes since 1.2 & found that “return jqib” change. Thanks also for using logical variable names
One really minor suggestion is consider whenever someone uses the “prefix” parameter (i.e. your jqiCols example), they’d also have to change the jquery code in your corner() example.. using “prefix” changes both the id & class. I don’t think that would be apparent to beginners. Using this selector:
.children(’div:eq(1)’).corner();
..seemed safe. Admittedly not as fast as an ID selector but to be honest I didn’t notice the extra milliseconds ticking by. Must be getting old.
Thanks again for the super plugin. Down with javascript alerts.
April 2nd, 2008 at 11:27 pm
I ran into a problem with IE7 where the box would not show up on the page if you were scrolled down. See this screen shot for an example:
http://dev.epmsonline.com/user/shopper/screenshot-1.jpg
I had to change the following line (Line 29) to include ie7 and it fixed the problem.
var ie6 = (jQuery.browser.msie && jQuery.browser.version
April 3rd, 2008 at 7:04 am
I’ll make a note that fixed a scrolling issue, but it seems to be working for me. Did you by any chance change the css for it that might break the scrolling??(top or position)
April 4th, 2008 at 11:03 am
I don’t think I made any changes to the css that would break it.
Here’s my css if you want to look at it.
http://dev.epmsonline.com/user/jquery/impromptu/examples.css
April 8th, 2008 at 10:12 am
Hey Nathan,
It looks like you are missing position:absolute; on jqifade. Here is my examples file:
http://trentrichardson.com/Impromptu/css/examples.css
Sorry for the delayed response.
April 8th, 2008 at 1:09 pm
Well, that didn’t change anything. Cleared cache, refreshed, etc. to make sure I was using the updated css.
Changing line 29 of the js file to include ie 7 still works, but I’m not sure what the side affects are.
Thanks so much for your help.
April 14th, 2008 at 3:07 am
Hi there,
Thank you for a superb product. I really enjoy Impromptu. I’m using it for a login screen prompt at the moment.
The new ‘escape’ key functionality is something I was hoping for - and it’s great!
Quick question - is it possible to have the ‘Enter’ key click my ‘Login’ button? How would I do that?
Cheers,
EoN
April 14th, 2008 at 10:07 am
EoN,
As of now the Enter key does not auto submit the form. You would essentially copy the escape key functionality in the plugin, so theoretically you might do something like:
$.prompt(’some text’).keypress(function(){
if enter key $(this).find(’my_default_button’).click();
});
Ideally it would be integrated within the plugin, and there is already an option for default button. So you should be able to use assign a special default class to the default button and on enter key find that class and click that button. Again I havn’t tested this, but it would be a great addition to the next version.
May 9th, 2008 at 7:23 pm
I finally figured out what my problem was.
I did not have a DOCTYPE at the top of my page, so IE was rendering in “quirks” mode and thus screwing up the css.
May 16th, 2008 at 9:02 am
Hey!
I have just started to use your script and i have one question: Hot to get the value from ok and cancel buttons? I use impromptu within another function that should returns TRUE or FALSE.
thx for answear me.