-
Notifications
You must be signed in to change notification settings - Fork 725
0.3.* API Documentation
- Version: 0.3.11
- License: MIT http://opensource.org/licenses/mit-license.php
Methods
@since 0.0.1
Create an alert dialog box
@param {String} message The message passed from the callee
@param {Function} fn [Optional] Callback function
@param {String} cssClass [Optional] Class(es) to append to dialog box
@return {Object}
alertify.alert("message");
@since 0.0.1
Create a confirm dialog box
@param {String} message The message passed from the callee
@param {Function} fn [Optional] Callback function
@param {String} cssClass [Optional] Class(es) to append to dialog box
@return {Object}
alertify.confirm("message", fn);
@since 0.0.1
Extend the log method to create custom methods
@param {String} type Custom method name
@return {Function}
alertify.custom = alertify.extend( "custom" );
alertify.custom( message ); // same as alertify.log( message, "custom" );
@since 0.0.1
Initialize Alertify and create the 2 main elements.
Initialization will happen automatically on the first use of alert, confirm, prompt or log.
alertify.init();
// or
alertify.alert("message") // also initiates on confirm, prompt or log
@since 0.0.1
Show a new log message box
@param {String} message The message passed from the callee
@param {String} type [Optional] Optional type of log message
@param {Number} wait [Optional] Time (in ms) to wait before auto-hiding
alertify.log("message", type);
@since 0.0.1
Create a prompt dialog box
@param {String} message The message passed from the callee
@param {Function} fn [Optional] Callback function
@param {String} placeholder [Optional] Default value for prompt input field
@param {String} cssClass [Optional] Class(es) to append to dialog box
@return {Object}
alertify.prompt("message", fn, "default input value");
@since 0.2.11
Used to set alertify properties
@param {Object} args Passing parameters
@since 0.0.1
Shorthand for log messages.
alertify.success( message ); // same as alertify.log( message, "success" );
alertify.error( message ); // same as alertify.log( message, "error" );
@since 0.3.8
Attaches alertify.error
to window.onerror
method.
alertify.debug();
Properties
Properties are set using the set
method.
@since 0.0.1
Time in milliseconds for log messages to stay open
alertify.set({ delay : 10000 }); // 10s
@since 0.0.1
Object for "OK" and "Cancel" button labels
alertify.set({ labels : { ok: "OK", cancel: "Cancel" } });
@since 0.3.6
Set which button gets focus by default
// "ok" default
alertify.set({ buttonFocus: "ok" }); // "none", "cancel", "ok"
@since 0.3.1
Reverse the order of the "OK" and "Cancel" button
alertify.set({ buttonReverse: true });