Here's a new plugin which could be useful for some projects.
It calls the prompt(), alert() and confirm() of the browser, that's why it can't be have the same look.
For now, there's none ID parameter that can be assigned to each dialogs (especially for confirm & input dialogs), I'm working on it but you can use variables instead.
Version: 1.0 (10th December 2011).
Tried in Internet Explorer 9.0.3 / Opera 11.51 / Chrome 15.0.874 / Safari 5.1.2 (Is Cancel button clicked condition doesn't work since 5.1+) / Firefox 8.0 / Mobile Safari (iOS 4)
Open an alert dialog(message)? Open an alert dialog. OK button
Open an input dialog(message, input by default) ? Open an input dialog. OK & Cancel buttons.
Open a confirm dialog(message) ? Open a confirmation dialog. OK & Cancel buttons.
is OK button clicked ? Return true when the user clicked on OK button in the Confirm dialog.
is Cancel button clicked ? Return true when the user clicked on Cancel button in the Confirm dialog.
is OK button clicked ? Return true when the user clicked on OK button in the Input dialog.
is Cancel button clicked ? Return true when the user clicked on Cancel button in the Input dialog. Doesn't work in Safari 5.1+
is Input is empty ? Return true if the user doesn't input anything in the Input dialog.
getInputText? Return the text that the user wrote in the Input dialog.
TODO List for this plugin.
Let me know your suggestions, requests and corrections (as about language) as well as any bug report.
Nice~ C2 could be a html editor.
For "input dialog":
Might condition:"is OK button clicked" become a cf_trigger condition?
So that it can be trigger once after clicking "OK".
I'll try to do this asap
Develop games in your browser. Powerful, performant & highly capable.
Sorry, I made a mistake again. This plugin can work fine if I put "is OK button clicked" after "input dialog"
+ on start of layout:
[/ul] + is ok botton clicked
- do something
So it does not need to change anything.
How can we use this plug in type for Confirm box and alert boxes with return type.
Sorry but I don't really understand what are you saying...
Hi, I like the plgin. I couldn't get it working with Chrome(21.0.1180.79 m). But it worked just fine in Firefox(14.0.1). Also It would be nice to have custom buttons, and have more than two :)
Hey its not showing up. Try Alert and Confirm dialog box.
Call it after both AJAX complete and fail calls, no show on the dialog boxes?
please provide a capx, the dialog box works correctly here
Your plugin is really cool, it just has a problem.
The "Ok button clicked event" of the confirm dialog remains active on layout change. Let me explain:
* You listen to the "Ok button clicked event"
* Your action sends you to another layout.
* At some moment you go back to the layout where the event got triggered.
* Your action executes again on layout start
Is like if the event stood still active when you go back to the layout where it were triggered.
The solution is to simply make the "Ok button clicked event" a sub-event of the one that made the confirm dialog show up. That way, the event works as espected.
JeyDotC Thank you for the tip about making it a sub-event instead. Worked like a charm since I was just stuck with this same dilemma and wondering how to get around it. Thanks!
Can someone reupload this plugin?
Can someone reupload this plugin?