A minimalist jQuery prompt plugin for the 21st Century.
...because prompt()
is ugly and sync.
<script src="path/to/jquery.js"></script>
<script src="path/to/jQuery-prompt21.js"></script>
<script>
var p = $(".popup").prompt21();
$(".show-popup").on("click", function () {
p.getData(function (err, data) {
$(".result").text(JSON.stringify(data, null, 2));
});
});
</script>
Converts a flat object to an unflatten one
- Object
flat
: The flat object that should be converted
- Object Unflatten object
Initializes a new instance of Prompt21.
Example:
var p21 = $(".container").prompt21();
- Object
opt_options
: The options for Prompt21 instance. cancel
(String): The cancel button jQuery selector (default:"button.cancel"
).showEffect
(String): The effect applied to the show function (default:".fadeIn"
).hideEffect
(String): The effect applied to the hide function (default:".fadeOut"
).form
(String): The form jQuery selector (default:"form"
).
- Prompt21 An object containing:
getData
(Function): ThegetData
function. See below.
Shows the popup and calls the callback function when the OK button is clicked.
- Function
callback
: The callback function.
- File an issue in the repository, using the bug tracker, describing the contribution you'd like to make. This will help us to get you started on the right foot.
- Fork the project in your account and create a new branch:
your-great-feature
. - Commit your changes in that branch.
- Open a pull request, and reference the initial issue in the pull request message.
See the LICENSE file.