Mon 23 Jun 2008
Well i’m thinking once again on Impromptu. My new thoughts are having multiple “states”. This would be completely optional and would not change the way you can use Impromptu in its simplest form. The idea behind States is after submitting the prompt, without closing it may morph into another “State” (different content and buttons ideally using pretty effects). That being said there are a few ways I could go about doing this. I could allow a string or a array/hash for my content argument:
//simple one state
$.prompt('hello world');
//complex multi state
$.prompt(['hello 1', 'hello 2', 'hello 3']);
While this seams nice we still may have different buttons for each state, and this isn’t very flexible as far as that goes. Another option may be to have another function to add extra states, sort of queuing up the prompts..
$.prompt('my state');
$.addPromptState('my state 2',options1);
$.addPromptState('my state 3',options2);
//or pass a hash to name our states
$.addPromptStates({
state1: {...},
state2: {...},
state3: {...}
});
So again I’m just throwing it out there to see if I get any bites. This isn’t set in stone but I think it could be a nice feature to ad some application like effects and feeling to Impromptu. Any one have any thoughts or suggestions?

July 12th, 2008 at 6:41 am
I like your idea of states. I would fit well in a project that I’m doing where we have a text-to-speech engine and we could use the multi-states to display closed captioning or grab user input along the way.
We look forward to seeing your progress.
July 12th, 2008 at 12:06 pm
Thanks for your interest. I hadn’t made much progress toward it since no one had responded or seemed interested. In the coming week I will try to begin development!
July 14th, 2008 at 3:31 am
Great idea! But why not having a seperate callback option for the states? give it an option wich launches the callback for the states instead of the regular callback after clicking a button. the state-callback could react on any kind of selector inside the prompt and the attached function could change content and state…
offtopic: is there a way to use impromptu with the JS Packer? I get an error when using the plugin packed.
July 14th, 2008 at 6:44 am
So like an onStateChange callback that can be assigned to any element within the prompt? I’m not sure on the js packer issue, I will have a look at the code to see if I have left out any semicolons or anything that might screw it up. Thanks for the suggestions!
July 18th, 2008 at 1:16 am
is possible to close the prompt using a callback?
July 19th, 2008 at 1:32 pm
Hey Max, to remove the prompt there are a couple ways
var p = $.prompt(’hello world’);
//remove it quickly
p.remove();
//remove it prettily with hide
p.hide(’slow’,function(){ $(this).remove(); });
or being its within a callback you will might need to do something like this:
jqib.remove();
Hope that helps!
July 23rd, 2008 at 11:53 am
A nice thing would be a function to be executed as soon as the prompt is redered on the screen.
July 23rd, 2008 at 2:21 pm
Hey Filipe,
This feature is already available. It is the loaded function within the options.
July 29th, 2008 at 10:29 pm
how to drag the box? i want to do it.
July 31st, 2008 at 12:07 pm
Well since there are so many plugins available for drag and drop I might just do an example on how to use one of those plugins to do it. Seems like overkill to implement it when you may be including an dragdrop library already..
August 8th, 2008 at 4:24 am
This is great. Trying to use it as a login box. Have a couple of things I’m trying to figure out:
1) How do I post the data entered in the fields somewhere
2) How can I affect the original page the popup was called from (like refreshing the page, for example)
Thanks!
August 18th, 2008 at 1:53 pm
Hi
I’m unable to contact you by mail. Please let me know how to do (you can see my mail)
Thanks
Nicola