Skip to content

Commit

Permalink
bump version v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhairi committed Aug 2, 2016
1 parent fdcebee commit 14e8e7b
Show file tree
Hide file tree
Showing 19 changed files with 134 additions and 109 deletions.
151 changes: 80 additions & 71 deletions app/assets/javascripts/alertify.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* alertifyjs 1.7.1 http://alertifyjs.com
* alertifyjs 1.8.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
( function ( window ) {
'use strict';

Expand All @@ -23,23 +23,24 @@
* @type {Object}
*/
var defaults = {
modal:true,
autoReset:true,
basic:false,
frameless:false,
movable:true,
moveBounded:false,
resizable:true,
closable:true,
closableByDimmer:true,
frameless:false,
maintainFocus:true, //global default not per instance, applies to all dialogs
maximizable:true,
startMaximized:false,
modal:true,
movable:true,
moveBounded:false,
overflow:true,
padding: true,
pinnable:true,
pinned:true,
padding: true,
overflow:true,
maintainFocus:true,
preventBodyShift:false, //global default not per instance, applies to all dialogs
resizable:true,
startMaximized:false,
transition:'pulse',
autoReset:true,
notifier:{
delay:5,
position:'bottom-right'
Expand Down Expand Up @@ -358,32 +359,32 @@
},
//common class names
classes = {
animationIn: 'ajs-in',
animationOut: 'ajs-out',
base: 'alertify',
prefix: 'ajs-',
basic:'ajs-basic',
capture: 'ajs-capture',
closable:'ajs-closable',
fixed: 'ajs-fixed',
frameless:'ajs-frameless',
hidden: 'ajs-hidden',
maximize: 'ajs-maximize',
maximized: 'ajs-maximized',
maximizable:'ajs-maximizable',
modeless: 'ajs-modeless',
movable: 'ajs-movable',
noSelection: 'ajs-no-selection',
noOverflow: 'ajs-no-overflow',
noPadding:'ajs-no-padding',
modeless: 'ajs-modeless',
movable: 'ajs-movable',
pin:'ajs-pin',
pinnable:'ajs-pinnable',
prefix: 'ajs-',
resizable: 'ajs-resizable',
capture: 'ajs-capture',
fixed: 'ajs-fixed',
closable:'ajs-closable',
maximizable:'ajs-maximizable',
maximize: 'ajs-maximize',
restore: 'ajs-restore',
pinnable:'ajs-pinnable',
unpinned:'ajs-unpinned',
pin:'ajs-pin',
maximized: 'ajs-maximized',
animationIn: 'ajs-in',
animationOut: 'ajs-out',
shake:'ajs-shake',
basic:'ajs-basic',
frameless:'ajs-frameless'
unpinned:'ajs-unpinned',
};

/**
* Helper: initializes the dialog instance
*
Expand All @@ -392,7 +393,7 @@
function initialize(instance){

if(!instance.__internal){

//no need to expose init after this.
delete instance.__init;

Expand All @@ -401,13 +402,13 @@
instance.__settings = copy(instance.settings);
}
//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){
// set tabindex attribute on body element this allows script to give it
// focus after the dialog is closed
document.body.setAttribute( 'tabindex', '0' );
}

//get dialog buttons/focus setup
var setup;
if(typeof instance.setup === 'function'){
Expand Down Expand Up @@ -506,19 +507,18 @@
transitionOutHandler:undefined,
destroy:undefined
};



var elements = {};
//root node
elements.root = document.createElement('div');

elements.root.className = classes.base + ' ' + classes.hidden + ' ';

elements.root.innerHTML = templates.dimmer + templates.modal;

//dimmer
elements.dimmer = elements.root.firstChild;

//dialog
elements.modal = elements.root.lastChild;
elements.modal.innerHTML = templates.dialog;
Expand Down Expand Up @@ -599,32 +599,19 @@
internal.transitionInHandler = delegate(instance, handleTransitionInEvent);
internal.transitionOutHandler = delegate(instance, handleTransitionOutEvent);


//settings
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('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('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('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('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('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('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('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('overflow', setup.options.overflow === undefined ? alertify.defaults.overflow : setup.options.overflow);

for(var opKey in internal.options){
if(setup.options[opKey] !== undefined){
// if found in user options
instance.set(opKey, setup.options[opKey]);
}else if(alertify.defaults.hasOwnProperty(opKey)) {
// else if found in defaults options
instance.set(opKey, alertify.defaults[opKey]);
}else if(opKey === 'title' ) {
// else if title key, use alertify.defaults.glossary
instance.set(opKey, alertify.defaults.glossary[opKey]);
}
}

// allow dom customization
if(typeof instance.build === 'function'){
Expand Down Expand Up @@ -661,14 +648,36 @@
requiresNoOverflow+=1;
}
}
if(requiresNoOverflow === 0){
if(requiresNoOverflow === 0 && document.body.className.indexOf(classes.noOverflow) >= 0){
//last open modal or last maximized one
removeClass(document.body, classes.noOverflow);
preventBodyShift(false);
}else if(requiresNoOverflow > 0 && document.body.className.indexOf(classes.noOverflow) < 0){
//first open modal or first maximized one
preventBodyShift(true);
addClass(document.body, classes.noOverflow);
}
}
var top = '', topScroll = 0;
/**
* Helper: prevents body shift.
*
*/
function preventBodyShift(add){
if(alertify.defaults.preventBodyShift && document.documentElement.scrollHeight > document.documentElement.clientHeight){
if(add ){//&& openDialogs[openDialogs.length-1].elements.dialog.clientHeight <= document.documentElement.clientHeight){
topScroll = scrollY;
top = window.getComputedStyle(document.body).top;
addClass(document.body, classes.fixed);
document.body.style.top = -scrollY + 'px';
} else {
scrollY = topScroll;
document.body.style.top = top;
removeClass(document.body, classes.fixed);
restoreScrollPosition();
}
}
}

/**
* Sets the name of the transition used to show/hide the dialog
Expand Down Expand Up @@ -696,27 +705,27 @@

//make modal
removeClass(instance.elements.root, classes.modeless);

//only if open
if(instance.isOpen()){
unbindModelessEvents(instance);

//in case a pinned modless dialog was made modal while open.
updateAbsPositionFix(instance);

ensureNoOverflow();
}
}else{
//make modelss
addClass(instance.elements.root, classes.modeless);

//only if open
if(instance.isOpen()){
bindModelessEvents(instance);

//in case pin/unpin was called while a modal is open
updateAbsPositionFix(instance);

ensureNoOverflow();
}
}
Expand Down Expand Up @@ -918,7 +927,7 @@
callback.call(instance,key, old, value);
}
result.items.push({'key': key, 'value': value , 'found':true});

}else{
result.items.push({'key': key, 'value': value , 'found':false});
}
Expand All @@ -929,7 +938,7 @@
}
return result;
}


/**
* Triggers a close event.
Expand Down Expand Up @@ -2472,7 +2481,7 @@
// allow custom `onclose` method
dispatchEvent('onclose', this);

//remove from open dialogs
//remove from open dialogs
openDialogs.splice(openDialogs.indexOf(this),1);
this.__internal.isOpen = false;

Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/alertify.min.js
100755 → 100644

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions app/assets/stylesheets/alertify.css
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* alertifyjs 1.7.1 http://alertifyjs.com
* alertifyjs 1.8.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
position: fixed;
z-index: 1981;
Expand Down Expand Up @@ -276,6 +276,14 @@
overflow: hidden !important;
outline: none;
}
.ajs-no-overflow.ajs-fixed {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow-y: scroll!important;
}
.ajs-no-selection,
.ajs-no-selection * {
-webkit-user-select: none;
Expand Down
6 changes: 3 additions & 3 deletions app/assets/stylesheets/alertify.min.css
100755 → 100644

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions app/assets/stylesheets/alertify.rtl.css
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* alertifyjs 1.7.1 http://alertifyjs.com
* alertifyjs 1.8.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
position: fixed;
z-index: 1981;
Expand Down Expand Up @@ -276,6 +276,14 @@
overflow: hidden !important;
outline: none;
}
.ajs-no-overflow.ajs-fixed {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
overflow-y: scroll!important;
}
.ajs-no-selection,
.ajs-no-selection * {
-webkit-user-select: none;
Expand Down
6 changes: 3 additions & 3 deletions app/assets/stylesheets/alertify.rtl.min.css
100755 → 100644

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/assets/stylesheets/alertify/bootstrap.css
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* alertifyjs 1.7.1 http://alertifyjs.com
* alertifyjs 1.8.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
background-color: #000;
opacity: .5;
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/alertify/bootstrap.min.css
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/assets/stylesheets/alertify/bootstrap.rtl.css
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* alertifyjs 1.7.1 http://alertifyjs.com
* alertifyjs 1.8.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dimmer {
background-color: #000;
opacity: .5;
Expand Down
4 changes: 2 additions & 2 deletions app/assets/stylesheets/alertify/bootstrap.rtl.min.css
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/assets/stylesheets/alertify/default.css
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* alertifyjs 1.7.1 http://alertifyjs.com
* alertifyjs 1.8.0 http://alertifyjs.com
* AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.
* Copyright 2016 Mohammad Younes <Mohammad@alertifyjs.com> (http://alertifyjs.com)
* Licensed under MIT <http://opensource.org/licenses/mit-license.php>*/
* Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/
.alertify .ajs-dialog {
background-color: white;
box-shadow: 0px 15px 20px 0px rgba(0, 0, 0, 0.25);
Expand Down
Loading

0 comments on commit 14e8e7b

Please sign in to comment.