Upgraded Alertify to v1.7.1

This version includes the feature request about invoking the callbacks
for different resize events. It will allows us to adjust the layout of
the dialogs based on its width, just like we've in the panels.
This commit is contained in:
Ashesh Vashi 2016-06-20 11:45:17 +05:30
parent 05e7ee5a05
commit 95c79e3a4c
19 changed files with 154 additions and 151 deletions

View File

@ -7,7 +7,7 @@ QT 4.6.2+ LGPL v2.1/3 http://www.qt.io/
Bootstrap 3.3.4 MIT http://getbootstrap.com/ Bootstrap 3.3.4 MIT http://getbootstrap.com/
jQuery 1.11.1 MIT http://jquery.com/ jQuery 1.11.1 MIT http://jquery.com/
Modernizr 2.6.2 MIT/BSD http://modernizr.com/ Modernizr 2.6.2 MIT/BSD http://modernizr.com/
AlertifyJS 1.7.0 MIT http://alertifyjs.com/ AlertifyJS 1.7.1 MIT http://alertifyjs.com/
CodeMirror 5.14.2 MIT http://codemirror.net/ CodeMirror 5.14.2 MIT http://codemirror.net/
aciTree 4.5.0-rc.7 MIT/GPL http://acoderinsights.ro/en/aciTree-tree-view-with-jQuery aciTree 4.5.0-rc.7 MIT/GPL http://acoderinsights.ro/en/aciTree-tree-view-with-jQuery
contextMenu 2.1.0 MIT https://github.com/swisnl/jQuery-contextMenu contextMenu 2.1.0 MIT https://github.com/swisnl/jQuery-contextMenu

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,5 +1,5 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/

View File

@ -1,11 +1,11 @@
/** /**
* alertifyjs 1.7.0 http://alertifyjs.com * alertifyjs 1.7.1 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications. * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com) * Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/ * Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
( function ( window ) { ( function ( window ) {
'use strict'; 'use strict';
/** /**
* Keys enum * Keys enum
* @type {Object} * @type {Object}
@ -19,7 +19,7 @@
RIGHT: 39 RIGHT: 39
}; };
/** /**
* Default options * Default options
* @type {Object} * @type {Object}
*/ */
var defaults = { var defaults = {
@ -62,7 +62,7 @@
cancel:'ajs-cancel', cancel:'ajs-cancel',
} }
}; };
//holds open dialogs instances //holds open dialogs instances
var openDialogs = []; var openDialogs = [];
@ -71,19 +71,19 @@
* *
* @element {node} The element * @element {node} The element
* @className {string} One or more space-separated classes to be added to the class attribute of the element. * @className {string} One or more space-separated classes to be added to the class attribute of the element.
* *
* @return {undefined} * @return {undefined}
*/ */
function addClass(element,classNames){ function addClass(element,classNames){
element.className += ' ' + classNames; element.className += ' ' + classNames;
} }
/** /**
* [Helper] Removes the specified class(es) from the element. * [Helper] Removes the specified class(es) from the element.
* *
* @element {node} The element * @element {node} The element
* @className {string} One or more space-separated classes to be removed from the class attribute of the element. * @className {string} One or more space-separated classes to be removed from the class attribute of the element.
* *
* @return {undefined} * @return {undefined}
*/ */
function removeClass(element, classNames) { function removeClass(element, classNames) {
@ -153,11 +153,11 @@
} }
return cpy; return cpy;
} }
if(src instanceof Date){ if(src instanceof Date){
return new Date(src.getTime()); return new Date(src.getTime());
} }
if(src instanceof RegExp){ if(src instanceof RegExp){
cpy = new RegExp(src.source); cpy = new RegExp(src.source);
cpy.global = src.global; cpy.global = src.global;
@ -166,7 +166,7 @@
cpy.lastIndex = src.lastIndex; cpy.lastIndex = src.lastIndex;
return cpy; return cpy;
} }
if(typeof src === 'object'){ if(typeof src === 'object'){
cpy = {}; cpy = {};
// copy dialog pototype over definition. // copy dialog pototype over definition.
@ -285,7 +285,7 @@
/** /**
* Creates event handler delegate that sends the instance as last argument. * Creates event handler delegate that sends the instance as last argument.
* *
* @return {Function} a function wrapper which sends the instance as last argument. * @return {Function} a function wrapper which sends the instance as last argument.
*/ */
function delegate(context, method) { function delegate(context, method) {
@ -303,7 +303,7 @@
} }
/** /**
* Helper for creating a dialog close event. * Helper for creating a dialog close event.
* *
* @return {object} * @return {object}
*/ */
function createCloseEvent(index, button) { function createCloseEvent(index, button) {
@ -383,31 +383,31 @@
basic:'ajs-basic', basic:'ajs-basic',
frameless:'ajs-frameless' frameless:'ajs-frameless'
}; };
/** /**
* Helper: initializes the dialog instance * Helper: initializes the dialog instance
* *
* @return {Number} The total count of currently open modals. * @return {Number} The total count of currently open modals.
*/ */
function initialize(instance){ function initialize(instance){
if(!instance.__internal){ if(!instance.__internal){
//no need to expose init after this. //no need to expose init after this.
delete instance.__init; delete instance.__init;
//keep a copy of initial dialog settings //keep a copy of initial dialog settings
if(!instance.__settings){ if(!instance.__settings){
instance.__settings = copy(instance.settings); instance.__settings = copy(instance.settings);
} }
//in case the script was included before body. //in case the script was included before body.
//after first dialog gets initialized, it won't be null anymore! //after first dialog gets initialized, it won't be null anymore!
if(null === reflow){ if(null === reflow){
// set tabindex attribute on body element this allows script to give it // set tabindex attribute on body element this allows script to give it
// focus after the dialog is closed // focus after the dialog is closed
document.body.setAttribute( 'tabindex', '0' ); document.body.setAttribute( 'tabindex', '0' );
} }
//get dialog buttons/focus setup //get dialog buttons/focus setup
var setup; var setup;
if(typeof instance.setup === 'function'){ if(typeof instance.setup === 'function'){
@ -425,7 +425,7 @@
} }
}; };
} }
//initialize hooks object. //initialize hooks object.
if(typeof instance.hooks !== 'object'){ if(typeof instance.hooks !== 'object'){
instance.hooks = {}; instance.hooks = {};
@ -449,7 +449,7 @@
var internal = instance.__internal = { var internal = instance.__internal = {
/** /**
* Flag holding the open state of the dialog * Flag holding the open state of the dialog
* *
* @type {Boolean} * @type {Boolean}
*/ */
isOpen:false, isOpen:false,
@ -506,19 +506,19 @@
transitionOutHandler:undefined, transitionOutHandler:undefined,
destroy:undefined destroy:undefined
}; };
var elements = {}; var elements = {};
//root node //root node
elements.root = document.createElement('div'); elements.root = document.createElement('div');
elements.root.className = classes.base + ' ' + classes.hidden + ' '; elements.root.className = classes.base + ' ' + classes.hidden + ' ';
elements.root.innerHTML = templates.dimmer + templates.modal; elements.root.innerHTML = templates.dimmer + templates.modal;
//dimmer //dimmer
elements.dimmer = elements.root.firstChild; elements.dimmer = elements.root.firstChild;
//dialog //dialog
elements.modal = elements.root.lastChild; elements.modal = elements.root.lastChild;
elements.modal.innerHTML = templates.dialog; elements.modal.innerHTML = templates.dialog;
@ -529,14 +529,14 @@
elements.reset = []; elements.reset = [];
elements.reset.push(elements.dialog.firstChild); elements.reset.push(elements.dialog.firstChild);
elements.reset.push(elements.dialog.lastChild); elements.reset.push(elements.dialog.lastChild);
//commands //commands
elements.commands = {}; elements.commands = {};
elements.commands.container = elements.reset[0].nextSibling; elements.commands.container = elements.reset[0].nextSibling;
elements.commands.pin = elements.commands.container.firstChild; elements.commands.pin = elements.commands.container.firstChild;
elements.commands.maximize = elements.commands.pin.nextSibling; elements.commands.maximize = elements.commands.pin.nextSibling;
elements.commands.close = elements.commands.maximize.nextSibling; elements.commands.close = elements.commands.maximize.nextSibling;
//header //header
elements.header = elements.commands.container.nextSibling; elements.header = elements.commands.container.nextSibling;
@ -548,7 +548,7 @@
//footer //footer
elements.footer = elements.body.nextSibling; elements.footer = elements.body.nextSibling;
elements.footer.innerHTML = templates.buttons.auxiliary + templates.buttons.primary; elements.footer.innerHTML = templates.buttons.auxiliary + templates.buttons.primary;
//resize handle //resize handle
elements.resizeHandle = elements.footer.nextSibling; elements.resizeHandle = elements.footer.nextSibling;
@ -560,10 +560,10 @@
elements.buttonTemplate = elements.buttons.primary.firstChild; elements.buttonTemplate = elements.buttons.primary.firstChild;
//remove button template //remove button template
elements.buttons.primary.removeChild(elements.buttonTemplate); elements.buttons.primary.removeChild(elements.buttonTemplate);
for(var x=0; x < instance.__internal.buttons.length; x+=1) { for(var x=0; x < instance.__internal.buttons.length; x+=1) {
var button = instance.__internal.buttons[x]; var button = instance.__internal.buttons[x];
// add to the list of used keys. // add to the list of used keys.
if(usedKeys.indexOf(button.key) < 0){ if(usedKeys.indexOf(button.key) < 0){
usedKeys.push(button.key); usedKeys.push(button.key);
@ -587,7 +587,7 @@
} }
//make elements pubic //make elements pubic
instance.elements = elements; instance.elements = elements;
//save event handlers delegates //save event handlers delegates
internal.resetHandler = delegate(instance, onReset); internal.resetHandler = delegate(instance, onReset);
internal.beginMoveHandler = delegate(instance, beginMove); internal.beginMoveHandler = delegate(instance, beginMove);
@ -599,39 +599,39 @@
internal.transitionInHandler = delegate(instance, handleTransitionInEvent); internal.transitionInHandler = delegate(instance, handleTransitionInEvent);
internal.transitionOutHandler = delegate(instance, handleTransitionOutEvent); internal.transitionOutHandler = delegate(instance, handleTransitionOutEvent);
//settings //settings
instance.set('title', setup.options.title === undefined ? alertify.defaults.glossary.title : setup.options.title); instance.set('title', setup.options.title === undefined ? alertify.defaults.glossary.title : setup.options.title);
instance.set('modal', setup.options.modal === undefined ? alertify.defaults.modal : setup.options.modal); instance.set('modal', setup.options.modal === undefined ? alertify.defaults.modal : setup.options.modal);
instance.set('basic', setup.options.basic === undefined ? alertify.defaults.basic : setup.options.basic); instance.set('basic', setup.options.basic === undefined ? alertify.defaults.basic : setup.options.basic);
instance.set('frameless', setup.options.frameless === undefined ? alertify.defaults.frameless : setup.options.frameless); instance.set('frameless', setup.options.frameless === undefined ? alertify.defaults.frameless : setup.options.frameless);
instance.set('movable', setup.options.movable === undefined ? alertify.defaults.movable : setup.options.movable); instance.set('movable', setup.options.movable === undefined ? alertify.defaults.movable : setup.options.movable);
instance.set('moveBounded', setup.options.moveBounded === undefined ? alertify.defaults.moveBounded : setup.options.moveBounded); instance.set('moveBounded', setup.options.moveBounded === undefined ? alertify.defaults.moveBounded : setup.options.moveBounded);
instance.set('resizable', setup.options.resizable === undefined ? alertify.defaults.resizable : setup.options.resizable); instance.set('resizable', setup.options.resizable === undefined ? alertify.defaults.resizable : setup.options.resizable);
instance.set('autoReset', setup.options.autoReset === undefined ? alertify.defaults.autoReset : setup.options.autoReset); instance.set('autoReset', setup.options.autoReset === undefined ? alertify.defaults.autoReset : setup.options.autoReset);
instance.set('closable', setup.options.closable === undefined ? alertify.defaults.closable : setup.options.closable); instance.set('closable', setup.options.closable === undefined ? alertify.defaults.closable : setup.options.closable);
instance.set('closableByDimmer', setup.options.closableByDimmer === undefined ? alertify.defaults.closableByDimmer : setup.options.closableByDimmer); instance.set('closableByDimmer', setup.options.closableByDimmer === undefined ? alertify.defaults.closableByDimmer : setup.options.closableByDimmer);
instance.set('maximizable', setup.options.maximizable === undefined ? alertify.defaults.maximizable : setup.options.maximizable); instance.set('maximizable', setup.options.maximizable === undefined ? alertify.defaults.maximizable : setup.options.maximizable);
instance.set('startMaximized', setup.options.startMaximized === undefined ? alertify.defaults.startMaximized : setup.options.startMaximized); instance.set('startMaximized', setup.options.startMaximized === undefined ? alertify.defaults.startMaximized : setup.options.startMaximized);
instance.set('pinnable', setup.options.pinnable === undefined ? alertify.defaults.pinnable : setup.options.pinnable); instance.set('pinnable', setup.options.pinnable === undefined ? alertify.defaults.pinnable : setup.options.pinnable);
instance.set('pinned', setup.options.pinned === undefined ? alertify.defaults.pinned : setup.options.pinned); instance.set('pinned', setup.options.pinned === undefined ? alertify.defaults.pinned : setup.options.pinned);
instance.set('transition', setup.options.transition === undefined ? alertify.defaults.transition : setup.options.transition); instance.set('transition', setup.options.transition === undefined ? alertify.defaults.transition : setup.options.transition);
instance.set('padding', setup.options.padding === undefined ? alertify.defaults.padding : setup.options.padding); instance.set('padding', setup.options.padding === undefined ? alertify.defaults.padding : setup.options.padding);
instance.set('overflow', setup.options.overflow === undefined ? alertify.defaults.overflow : setup.options.overflow); instance.set('overflow', setup.options.overflow === undefined ? alertify.defaults.overflow : setup.options.overflow);
// allow dom customization // allow dom customization
if(typeof instance.build === 'function'){ if(typeof instance.build === 'function'){
instance.build(); instance.build();
} }
} }
//add to the end of the DOM tree. //add to the end of the DOM tree.
document.body.appendChild(instance.elements.root); document.body.appendChild(instance.elements.root);
} }
@ -669,10 +669,10 @@
addClass(document.body, classes.noOverflow); addClass(document.body, classes.noOverflow);
} }
} }
/** /**
* Sets the name of the transition used to show/hide the dialog * Sets the name of the transition used to show/hide the dialog
* *
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
*/ */
@ -683,7 +683,7 @@
addClass(instance.elements.root, classes.prefix + value); addClass(instance.elements.root, classes.prefix + value);
reflow = instance.elements.root.offsetWidth; reflow = instance.elements.root.offsetWidth;
} }
/** /**
* Toggles the dialog display mode * Toggles the dialog display mode
* *
@ -696,34 +696,34 @@
//make modal //make modal
removeClass(instance.elements.root, classes.modeless); removeClass(instance.elements.root, classes.modeless);
//only if open //only if open
if(instance.isOpen()){ if(instance.isOpen()){
unbindModelessEvents(instance); unbindModelessEvents(instance);
//in case a pinned modless dialog was made modal while open. //in case a pinned modless dialog was made modal while open.
updateAbsPositionFix(instance); updateAbsPositionFix(instance);
ensureNoOverflow(); ensureNoOverflow();
} }
}else{ }else{
//make modelss //make modelss
addClass(instance.elements.root, classes.modeless); addClass(instance.elements.root, classes.modeless);
//only if open //only if open
if(instance.isOpen()){ if(instance.isOpen()){
bindModelessEvents(instance); bindModelessEvents(instance);
//in case pin/unpin was called while a modal is open //in case pin/unpin was called while a modal is open
updateAbsPositionFix(instance); updateAbsPositionFix(instance);
ensureNoOverflow(); ensureNoOverflow();
} }
} }
} }
/** /**
* Toggles the dialog basic view mode * Toggles the dialog basic view mode
* *
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
@ -740,7 +740,7 @@
} }
/** /**
* Toggles the dialog frameless view mode * Toggles the dialog frameless view mode
* *
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
@ -755,7 +755,7 @@
removeClass(instance.elements.root, classes.frameless); removeClass(instance.elements.root, classes.frameless);
} }
} }
/** /**
* Helper: Brings the modeless dialog to front, attached to modeless dialogs. * Helper: Brings the modeless dialog to front, attached to modeless dialogs.
* *
@ -765,7 +765,7 @@
* @return {undefined} * @return {undefined}
*/ */
function bringToFront(event, instance){ function bringToFront(event, instance){
// Do not bring to front if preceeded by an open modal // Do not bring to front if preceeded by an open modal
var index = openDialogs.indexOf(instance); var index = openDialogs.indexOf(instance);
for(var x=index+1;x<openDialogs.length;x+=1){ for(var x=index+1;x<openDialogs.length;x+=1){
@ -773,7 +773,7 @@
return; return;
} }
} }
// Bring to front by making it the last child. // Bring to front by making it the last child.
if(document.body.lastChild !== instance.elements.root){ if(document.body.lastChild !== instance.elements.root){
document.body.appendChild(instance.elements.root); document.body.appendChild(instance.elements.root);
@ -782,17 +782,17 @@
openDialogs.push(instance); openDialogs.push(instance);
setFocus(instance); setFocus(instance);
} }
return false; return false;
} }
/** /**
* Helper: reflects dialogs options updates * Helper: reflects dialogs options updates
* *
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* @param {String} option The updated option name. * @param {String} option The updated option name.
* *
* @return {undefined} * @return {undefined}
*/ */
function optionUpdated(instance, option, oldValue, newValue){ function optionUpdated(instance, option, oldValue, newValue){
switch(option){ switch(option){
@ -853,7 +853,7 @@
instance.hooks.onupdate.call(instance, option, oldValue, newValue); instance.hooks.onupdate.call(instance, option, oldValue, newValue);
} }
} }
/** /**
* Helper: reflects dialogs options updates * Helper: reflects dialogs options updates
* *
@ -864,9 +864,9 @@
* @param {Object} value Optional, the value associated with the key (in case it was a string). * @param {Object} value Optional, the value associated with the key (in case it was a string).
* @param {String} option The updated option name. * @param {String} option The updated option name.
* *
* @return {Object} result object * @return {Object} result object
* The result objects has an 'op' property, indicating of this is a SET or GET operation. * The result objects has an 'op' property, indicating of this is a SET or GET operation.
* GET: * GET:
* - found: a flag indicating if the key was found or not. * - found: a flag indicating if the key was found or not.
* - value: the property value. * - value: the property value.
* SET: * SET:
@ -918,7 +918,7 @@
callback.call(instance,key, old, value); callback.call(instance,key, old, value);
} }
result.items.push({'key': key, 'value': value , 'found':true}); result.items.push({'key': key, 'value': value , 'found':true});
}else{ }else{
result.items.push({'key': key, 'value': value , 'found':false}); result.items.push({'key': key, 'value': value , 'found':false});
} }
@ -929,13 +929,13 @@
} }
return result; return result;
} }
/** /**
* Triggers a close event. * Triggers a close event.
* *
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
* @return {undefined} * @return {undefined}
*/ */
function triggerClose(instance) { function triggerClose(instance) {
@ -955,7 +955,7 @@
* *
* @param {Event} event DOM event object. * @param {Event} event DOM event object.
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
* @return {undefined} * @return {undefined}
*/ */
function commandsClickHandler(event, instance) { function commandsClickHandler(event, instance) {
@ -986,7 +986,7 @@
* Helper: pins the modeless dialog. * Helper: pins the modeless dialog.
* *
* @param {Object} instance The dialog instance. * @param {Object} instance The dialog instance.
* *
* @return {undefined} * @return {undefined}
*/ */
function pin(instance) { function pin(instance) {
@ -998,11 +998,11 @@
* Helper: unpins the modeless dialog. * Helper: unpins the modeless dialog.
* *
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
* @return {undefined} * @return {undefined}
*/ */
function unpin(instance) { function unpin(instance) {
//unpin the dialog //unpin the dialog
instance.set('pinned', false); instance.set('pinned', false);
} }
@ -1011,13 +1011,13 @@
* Helper: enlarges the dialog to fill the entire screen. * Helper: enlarges the dialog to fill the entire screen.
* *
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
* @return {undefined} * @return {undefined}
*/ */
function maximize(instance) { function maximize(instance) {
// allow custom `onmaximize` method // allow custom `onmaximize` method
dispatchEvent('onmaximize', instance); dispatchEvent('onmaximize', instance);
//maximize the dialog //maximize the dialog
addClass(instance.elements.root, classes.maximized); addClass(instance.elements.root, classes.maximized);
if (instance.isOpen()) { if (instance.isOpen()) {
ensureNoOverflow(); ensureNoOverflow();
@ -1030,13 +1030,13 @@
* Helper: returns the dialog to its former size. * Helper: returns the dialog to its former size.
* *
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
* @return {undefined} * @return {undefined}
*/ */
function restore(instance) { function restore(instance) {
// allow custom `onrestore` method // allow custom `onrestore` method
dispatchEvent('onrestore', instance); dispatchEvent('onrestore', instance);
//maximize the dialog //maximize the dialog
removeClass(instance.elements.root, classes.maximized); removeClass(instance.elements.root, classes.maximized);
if (instance.isOpen()) { if (instance.isOpen()) {
ensureNoOverflow(); ensureNoOverflow();
@ -1203,7 +1203,7 @@
// flag to cancel keyup event if already handled by click event (pressing Enter on a focusted button). // flag to cancel keyup event if already handled by click event (pressing Enter on a focusted button).
var cancelKeyup = false; var cancelKeyup = false;
/** /**
* Helper: triggers a button callback * Helper: triggers a button callback
* *
* @param {Object} The dilog instance. * @param {Object} The dilog instance.
@ -1233,7 +1233,7 @@
* *
* @param {Event} DOM event object. * @param {Event} DOM event object.
* @param {Object} The dilog instance. * @param {Object} The dilog instance.
* *
* @return {undefined} * @return {undefined}
*/ */
function buttonsClickHandler(event, instance) { function buttonsClickHandler(event, instance) {
@ -1249,7 +1249,7 @@
* *
* @param {Event} DOM event object. * @param {Event} DOM event object.
* @param {Object} The dilog instance. * @param {Object} The dilog instance.
* *
* @return {undefined} * @return {undefined}
*/ */
function keyupHandler(event) { function keyupHandler(event) {
@ -1276,7 +1276,7 @@
* *
* @param {Event} DOM event object. * @param {Event} DOM event object.
* @param {Object} The dilog instance. * @param {Object} The dilog instance.
* *
* @return {undefined} * @return {undefined}
*/ */
function keydownHandler(event) { function keydownHandler(event) {
@ -1346,7 +1346,7 @@
element = focus.element.call(instance); element = focus.element.call(instance);
break; break;
} }
// if no focus element, default to first reset element. // if no focus element, default to first reset element.
if ((typeof element === 'undefined' || element === null) && instance.__internal.buttons.length === 0) { if ((typeof element === 'undefined' || element === null) && instance.__internal.buttons.length === 0) {
element = instance.elements.reset[0]; element = instance.elements.reset[0];
@ -1373,7 +1373,7 @@
*/ */
function onReset(event, instance) { function onReset(event, instance) {
// should work on last modal if triggered from document.body // should work on last modal if triggered from document.body
if (!instance) { if (!instance) {
for (var x = openDialogs.length - 1; x > -1; x -= 1) { for (var x = openDialogs.length - 1; x > -1; x -= 1) {
if (openDialogs[x].isModal()) { if (openDialogs[x].isModal()) {
@ -1419,7 +1419,7 @@
} }
} }
/** /**
* Transition in transitionend event handler. * Transition in transitionend event handler.
* *
* @param {Event} TransitionEnd event object. * @param {Event} TransitionEnd event object.
* @param {Object} The dilog instance. * @param {Object} The dilog instance.
@ -1449,7 +1449,7 @@
} }
/** /**
* Transition out transitionend event handler. * Transition out transitionend event handler.
* *
* @param {Event} TransitionEnd event object. * @param {Event} TransitionEnd event object.
* @param {Object} The dilog instance. * @param {Object} The dilog instance.
@ -1477,7 +1477,7 @@
instance.__internal.activeElement.focus(); instance.__internal.activeElement.focus();
instance.__internal.activeElement = null; instance.__internal.activeElement = null;
} }
//destory the instance //destory the instance
if (typeof instance.__internal.destroy === 'function') { if (typeof instance.__internal.destroy === 'function') {
instance.__internal.destroy.apply(instance); instance.__internal.destroy.apply(instance);
@ -1502,7 +1502,7 @@
* *
* @param {Event} event DOM event object. * @param {Event} event DOM event object.
* @param {Node} element The element being moved. * @param {Node} element The element being moved.
* *
* @return {undefined} * @return {undefined}
*/ */
function moveElement(event, element) { function moveElement(event, element) {
@ -1512,17 +1512,17 @@
if(refreshTop){ if(refreshTop){
top -= document.body.scrollTop; top -= document.body.scrollTop;
} }
element.style.left = left + 'px'; element.style.left = left + 'px';
element.style.top = top + 'px'; element.style.top = top + 'px';
} }
/** /**
* Helper: sets the element top/left coordinates within screen bounds * Helper: sets the element top/left coordinates within screen bounds
* *
* @param {Event} event DOM event object. * @param {Event} event DOM event object.
* @param {Node} element The element being moved. * @param {Node} element The element being moved.
* *
* @return {undefined} * @return {undefined}
*/ */
function moveElementBounded(event, element) { function moveElementBounded(event, element) {
@ -1532,7 +1532,7 @@
if(refreshTop){ if(refreshTop){
top -= document.body.scrollTop; top -= document.body.scrollTop;
} }
element.style.left = Math.min(bounds.maxLeft, Math.max(bounds.minLeft, left)) + 'px'; element.style.left = Math.min(bounds.maxLeft, Math.max(bounds.minLeft, left)) + 'px';
if(refreshTop){ if(refreshTop){
element.style.top = Math.min(bounds.maxTop, Math.max(bounds.minTop, top)) + 'px'; element.style.top = Math.min(bounds.maxTop, Math.max(bounds.minTop, top)) + 'px';
@ -1540,7 +1540,7 @@
element.style.top = Math.max(bounds.minTop, top) + 'px'; element.style.top = Math.max(bounds.minTop, top) + 'px';
} }
} }
/** /**
* Triggers the start of a move event, attached to the header element mouse down event. * Triggers the start of a move event, attached to the header element mouse down event.
@ -1548,7 +1548,7 @@
* *
* @param {Event} event DOM event object. * @param {Event} event DOM event object.
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
* @return {Boolean} false * @return {Boolean} false
*/ */
function beginMove(event, instance) { function beginMove(event, instance) {
@ -1575,7 +1575,7 @@
if (element.style.top) { if (element.style.top) {
top = parseInt(element.style.top, 10); top = parseInt(element.style.top, 10);
} }
offsetX = eventSrc[xProp] - left; offsetX = eventSrc[xProp] - left;
offsetY = eventSrc[yProp] - top; offsetY = eventSrc[yProp] - top;
@ -1584,18 +1584,18 @@
}else if(instance.isPinned()){ }else if(instance.isPinned()){
offsetY -= document.body.scrollTop; offsetY -= document.body.scrollTop;
} }
if(instance.get('moveBounded')){ if(instance.get('moveBounded')){
var current = element, var current = element,
offsetLeft = -left, offsetLeft = -left,
offsetTop = -top; offsetTop = -top;
//calc offset //calc offset
do { do {
offsetLeft += current.offsetLeft; offsetLeft += current.offsetLeft;
offsetTop += current.offsetTop; offsetTop += current.offsetTop;
} while (current = current.offsetParent); } while (current = current.offsetParent);
bounds = { bounds = {
maxLeft : offsetLeft, maxLeft : offsetLeft,
minLeft : -offsetLeft, minLeft : -offsetLeft,
@ -1607,7 +1607,7 @@
bounds = null; bounds = null;
moveDelegate = moveElement; moveDelegate = moveElement;
} }
// allow custom `onmove` method // allow custom `onmove` method
dispatchEvent('onmove', instance); dispatchEvent('onmove', instance);
@ -1624,7 +1624,7 @@
* The actual move handler, attached to document.body mousemove event. * The actual move handler, attached to document.body mousemove event.
* *
* @param {Event} event DOM event object. * @param {Event} event DOM event object.
* *
* @return {undefined} * @return {undefined}
*/ */
function move(event) { function move(event) {
@ -1700,7 +1700,7 @@
} }
/* Controls moving a dialog around */ /* Controls moving a dialog around */
//holde the current instance being resized //holde the current instance being resized
var resizable = null, var resizable = null,
//holds the staring left offset when resize starts. //holds the staring left offset when resize starts.
startingLeft = Number.Nan, startingLeft = Number.Nan,
@ -1718,7 +1718,7 @@
* @param {Event} event DOM mousemove event object. * @param {Event} event DOM mousemove event object.
* @param {Node} element The element being moved. * @param {Node} element The element being moved.
* @param {Boolean} pinned A flag indicating if the element being resized is pinned to the screen. * @param {Boolean} pinned A flag indicating if the element being resized is pinned to the screen.
* *
* @return {undefined} * @return {undefined}
*/ */
function resizeElement(event, element, pageRelative) { function resizeElement(event, element, pageRelative) {
@ -1744,7 +1744,7 @@
// rtl handling // rtl handling
var isRTL = isRightToLeft(); var isRTL = isRightToLeft();
if (isRTL) { if (isRTL) {
// reverse X // reverse X
X = document.body.offsetWidth - X; X = document.body.offsetWidth - X;
// if has a starting left, calculate offsetRight // if has a starting left, calculate offsetRight
if (!isNaN(startingLeft)) { if (!isNaN(startingLeft)) {
@ -1782,7 +1782,7 @@
* *
* @param {Event} event DOM event object. * @param {Event} event DOM event object.
* @param {Object} instance The dilog instance. * @param {Object} instance The dilog instance.
* *
* @return {Boolean} false * @return {Boolean} false
*/ */
function beginResize(event, instance) { function beginResize(event, instance) {
@ -1797,7 +1797,7 @@
if (eventSrc) { if (eventSrc) {
// allow custom `onresize` method // allow custom `onresize` method
dispatchEvent('onresize', instance); dispatchEvent('onresize', instance);
resizable = instance; resizable = instance;
handleOffset = instance.elements.resizeHandle.offsetHeight / 2; handleOffset = instance.elements.resizeHandle.offsetHeight / 2;
var element = instance.elements.dialog; var element = instance.elements.dialog;
@ -1821,7 +1821,7 @@
* The actual resize handler, attached to document.body mousemove event. * The actual resize handler, attached to document.body mousemove event.
* *
* @param {Event} event DOM event object. * @param {Event} event DOM event object.
* *
* @return {undefined} * @return {undefined}
*/ */
function resize(event) { function resize(event) {
@ -2178,12 +2178,12 @@
if(!isNaN(x) && !isNaN(y)){ if(!isNaN(x) && !isNaN(y)){
// allow custom `onmove` method // allow custom `onmove` method
dispatchEvent('onmove', this); dispatchEvent('onmove', this);
var element = this.elements.dialog, var element = this.elements.dialog,
current = element, current = element,
offsetLeft = 0, offsetLeft = 0,
offsetTop = 0; offsetTop = 0;
//subtract existing left,top //subtract existing left,top
if (element.style.left) { if (element.style.left) {
offsetLeft -= parseInt(element.style.left, 10); offsetLeft -= parseInt(element.style.left, 10);
@ -2208,7 +2208,7 @@
element.style.left = left + 'px'; element.style.left = left + 'px';
element.style.top = top + 'px'; element.style.top = top + 'px';
// allow custom `onmoved` method // allow custom `onmoved` method
dispatchEvent('onmoved', this); dispatchEvent('onmoved', this);
} }
@ -2233,10 +2233,10 @@
; ;
if(!isNaN(w) && !isNaN(h) && this.get('resizable') === true){ if(!isNaN(w) && !isNaN(h) && this.get('resizable') === true){
// allow custom `onresize` method // allow custom `onresize` method
dispatchEvent('onresize', this); dispatchEvent('onresize', this);
if(('' + width).match(regex)){ if(('' + width).match(regex)){
w = w / 100 * document.documentElement.clientWidth ; w = w / 100 * document.documentElement.clientWidth ;
} }
@ -2253,14 +2253,14 @@
element.style.minHeight = this.elements.header.offsetHeight + this.elements.footer.offsetHeight + 'px'; element.style.minHeight = this.elements.header.offsetHeight + this.elements.footer.offsetHeight + 'px';
element.style.width = w + 'px'; element.style.width = w + 'px';
element.style.height = h + 'px'; element.style.height = h + 'px';
// allow custom `onresized` method // allow custom `onresized` method
dispatchEvent('onresized', this); dispatchEvent('onresized', this);
} }
return this; return this;
}, },
/** /**
* Gets or Sets dialog settings/options * Gets or Sets dialog settings/options
* *
* @param {String|Object} key A string specifying a propery name or a collection of key/value pairs. * @param {String|Object} key A string specifying a propery name or a collection of key/value pairs.
* @param {Object} value Optional, the value associated with the key (in case it was a string). * @param {Object} value Optional, the value associated with the key (in case it was a string).
@ -2292,14 +2292,14 @@
} }
}, },
/** /**
* [Alias] Sets dialog settings/options * [Alias] Sets dialog settings/options
*/ */
set:function(key, value){ set:function(key, value){
this.setting(key,value); this.setting(key,value);
return this; return this;
}, },
/** /**
* [Alias] Gets dialog settings/options * [Alias] Gets dialog settings/options
*/ */
get:function(key){ get:function(key){
return this.setting(key); return this.setting(key);
@ -2350,7 +2350,7 @@
* @return {Object} the dialog instance. * @return {Object} the dialog instance.
*/ */
show: function (modal, className) { show: function (modal, className) {
// ensure initialization // ensure initialization
initialize(this); initialize(this);
@ -2412,7 +2412,7 @@
//reflow //reflow
reflow = this.elements.root.offsetWidth; reflow = this.elements.root.offsetWidth;
// show dialog // show dialog
removeClass(this.elements.root, classes.hidden); removeClass(this.elements.root, classes.hidden);
@ -2472,7 +2472,7 @@
// allow custom `onclose` method // allow custom `onclose` method
dispatchEvent('onclose', this); dispatchEvent('onclose', this);
//remove from open dialogs //remove from open dialogs
openDialogs.splice(openDialogs.indexOf(this),1); openDialogs.splice(openDialogs.indexOf(this),1);
this.__internal.isOpen = false; this.__internal.isOpen = false;
@ -2526,7 +2526,7 @@
}; };
/** /**
* Helper: initializes the notifier instance * Helper: initializes the notifier instance
* *
*/ */
function initialize(instance) { function initialize(instance) {
@ -2546,7 +2546,7 @@
document.body.appendChild(element); document.body.appendChild(element);
} }
} }
function pushInstance(instance) { function pushInstance(instance) {
instance.__internal.pushed = true; instance.__internal.pushed = true;
openInstances.push(instance); openInstances.push(instance);
@ -2557,7 +2557,7 @@
} }
/** /**
* Helper: update the notifier instance position * Helper: update the notifier instance position
* *
*/ */
function updatePosition(instance) { function updatePosition(instance) {
element.className = classes.base; element.className = classes.base;
@ -2624,10 +2624,10 @@
/* notification DOM element*/ /* notification DOM element*/
element: div, element: div,
/* /*
* Pushes a notification message * Pushes a notification message
* @param {string or DOMElement} content The notification message content * @param {string or DOMElement} content The notification message content
* @param {Number} wait The time (in seconds) to wait before the message is dismissed, a value of 0 means keep open till clicked. * @param {Number} wait The time (in seconds) to wait before the message is dismissed, a value of 0 means keep open till clicked.
* *
*/ */
push: function (_content, _wait) { push: function (_content, _wait) {
if (!this.__internal.pushed) { if (!this.__internal.pushed) {
@ -2674,18 +2674,18 @@
/* /*
* {Function} callback function to be invoked before dismissing the notification message. * {Function} callback function to be invoked before dismissing the notification message.
* Remarks: A return value === 'false' will cancel the dismissal * Remarks: A return value === 'false' will cancel the dismissal
* *
*/ */
ondismiss: function () { }, ondismiss: function () { },
/* /*
* {Function} callback function to be invoked when the message is dismissed. * {Function} callback function to be invoked when the message is dismissed.
* *
*/ */
callback: callback, callback: callback,
/* /*
* Dismisses the notification message * Dismisses the notification message
* @param {Boolean} clicked A flag indicating if the dismissal was caused by a click. * @param {Boolean} clicked A flag indicating if the dismissal was caused by a click.
* *
*/ */
dismiss: function (clicked) { dismiss: function (clicked) {
if (this.__internal.pushed) { if (this.__internal.pushed) {
@ -2712,7 +2712,7 @@
/* /*
* Delays the notification message dismissal * Delays the notification message dismissal
* @param {Number} wait The time (in seconds) to wait before the message is dismissed, a value of 0 means keep open till clicked. * @param {Number} wait The time (in seconds) to wait before the message is dismissed, a value of 0 means keep open till clicked.
* *
*/ */
delay: function (wait) { delay: function (wait) {
clearTimers(this); clearTimers(this);
@ -2726,7 +2726,7 @@
/* /*
* Sets the notification message contents * Sets the notification message contents
* @param {string or DOMElement} content The notification message content * @param {string or DOMElement} content The notification message content
* *
*/ */
setContent: function (content) { setContent: function (content) {
if (typeof content === 'string') { if (typeof content === 'string') {
@ -2740,7 +2740,7 @@
}, },
/* /*
* Dismisses all open notifications except this. * Dismisses all open notifications except this.
* *
*/ */
dismissOthers: function () { dismissOthers: function () {
notifier.dismissAll(this); notifier.dismissAll(this);
@ -2752,7 +2752,7 @@
//notifier api //notifier api
return { return {
/** /**
* Gets or Sets notifier settings. * Gets or Sets notifier settings.
* *
* @param {string} key The setting name * @param {string} key The setting name
* @param {Variant} value The setting value. * @param {Variant} value The setting value.
@ -2781,14 +2781,14 @@
return this; return this;
}, },
/** /**
* [Alias] Sets dialog settings/options * [Alias] Sets dialog settings/options
*/ */
set:function(key,value){ set:function(key,value){
this.setting(key,value); this.setting(key,value);
return this; return this;
}, },
/** /**
* [Alias] Gets dialog settings/options * [Alias] Gets dialog settings/options
*/ */
get:function(key){ get:function(key){
return this.setting(key); return this.setting(key);
@ -2907,12 +2907,12 @@
return { return {
/** /**
* Alertify defaults * Alertify defaults
* *
* @type {Object} * @type {Object}
*/ */
defaults: defaults, defaults: defaults,
/** /**
* Dialogs factory * Dialogs factory
* *
* @param {string} Dialog name. * @param {string} Dialog name.
* @param {Function} A Dialog factory function. * @param {Function} A Dialog factory function.
@ -3005,13 +3005,13 @@
} }
}, },
/** /**
* [Alias] Sets dialog settings/options * [Alias] Sets dialog settings/options
*/ */
set: function(name,key,value){ set: function(name,key,value){
return this.setting(name, key,value); return this.setting(name, key,value);
}, },
/** /**
* [Alias] Gets dialog settings/options * [Alias] Gets dialog settings/options
*/ */
get: function(name, key){ get: function(name, key){
return this.setting(name, key); return this.setting(name, key);
@ -3538,6 +3538,9 @@
closeEvent.cancel = !returnValue; closeEvent.cancel = !returnValue;
} }
} }
if(!closeEvent.cancel){
input.value = this.settings.value;
}
break; break;
} }
} }

File diff suppressed because one or more lines are too long