zebra_dialog
Advanced tools
Comparing version 1.4.1 to 1.5.0
@@ -0,1 +1,8 @@ | ||
## version 1.5 (July 05, 2018) | ||
- fixed bug where inputs in dialog box could never receive focus on mobile devices - see [#14](https://github.com/stefangabos/Zebra_Dialog/issues/14), thanks [Clément](https://github.com/chou666)! | ||
- fixed [#18](https://github.com/stefangabos/Zebra_Dialog/issues/18) where the plugin was not working in IE8 | ||
- custom classes can now be added to buttons; this fixes [#15](https://github.com/stefangabos/Zebra_Dialog/issues/15) | ||
- added version number as a public property - useful to find out the version number even if all you have is the minified source code; see [#13](https://github.com/stefangabos/Zebra_Dialog/issues/13) | ||
## version 1.4.1 (October 13, 2017) | ||
@@ -2,0 +9,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(t){"use strict";t.Zebra_Dialog=function(){var e,s={animation_speed_hide:250,animation_speed_show:0,auto_close:!1,buttons:!0,center_buttons:!1,custom_class:!1,keyboard:!0,max_height:0,message:"",modal:!0,overlay_close:!0,overlay_opacity:".9",position:"center",reposition_speed:500,show_close_button:!0,source:!1,title:"",type:"information",vcenter_short_message:!0,width:0,onClose:null},i=this,o={},a=function(){var e,s,o,a=t(window).width(),r=t(window).height(),g=i.dialog.width(),c=i.dialog.height(),d={left:0,top:0,right:a-g,bottom:r-c,center:(a-g)/2,middle:(r-c)/2};i.dialog_left=void 0,i.dialog_top=void 0,t.isArray(i.settings.position)&&2===i.settings.position.length&&"string"==typeof i.settings.position[0]&&i.settings.position[0].match(/^(left|right|center)[\s0-9\+\-]*$/)&&"string"==typeof i.settings.position[1]&&i.settings.position[1].match(/^(top|bottom|middle)[\s0-9\+\-]*$/)&&(i.settings.position[0]=i.settings.position[0].toLowerCase(),i.settings.position[1]=i.settings.position[1].toLowerCase(),t.each(d,function(t,e){var s,o;for(s=0;s<2;s++)(o=i.settings.position[s].replace(t,e))!==i.settings.position[s]&&(0===s?i.dialog_left=l(o):i.dialog_top=l(o))})),void 0!==i.dialog_left&&void 0!==i.dialog_top||(i.dialog_left=d.center,i.dialog_top=d.middle),i.dialog_top<0&&(i.dialog_top=0),c>r&&i.message.css("height",r-(t(".ZebraDialog_Title",i.dialog)?t(".ZebraDialog_Title",i.dialog).outerHeight():0)-(t(".ZebraDialog_ButtonsOuter",i.dialog)?t(".ZebraDialog_ButtonsOuter",i.dialog).outerHeight():0)-(parseFloat(i.message.css("paddingTop"))||0)-(parseFloat(i.message.css("paddingBottom"))||0)-(parseFloat(i.message.css("borderTopWidth"))||0)-(parseFloat(i.message.css("borderBottomWidth"))||0)),i.settings.vcenter_short_message&&(s=(e=i.message.find("div:first")).height())<(o=i.message.height())&&e.css({"padding-top":(o-s)/2}),"boolean"==typeof arguments[0]&&!1===arguments[0]||0===i.settings.reposition_speed?i.dialog.css({left:i.dialog_left,top:i.dialog_top,visibility:"visible",opacity:0}).animate({opacity:1},i.settings.animation_speed_show):(i.dialog.stop(!0),i.dialog.css("visibility","visible").animate({left:i.dialog_left,top:i.dialog_top},i.settings.reposition_speed)),i.dialog.find("a[class^=ZebraDialog_Button]:first").focus(),i.isIE6&&setTimeout(n,500)},n=function(){var e=t(window).scrollTop(),s=t(window).scrollLeft();i.settings.modal&&i.overlay.css({top:e,left:s}),i.dialog.css({left:i.dialog_left+s,top:i.dialog_top+e})},r=function(){if(!0!==i.settings.buttons&&!t.isArray(i.settings.buttons))return!1;if(!0===i.settings.buttons)switch(i.settings.type){case"question":i.settings.buttons=["Yes","No"];break;default:i.settings.buttons=["Ok"]}return i.settings.buttons},g=function(){switch(i.settings.type){case"confirmation":case"error":case"information":case"question":case"warning":return i.settings.type.charAt(0).toUpperCase()+i.settings.type.slice(1).toLowerCase();default:return!1}},l=function(t){var e=0;for(t=t.replace(/\s/g,"").match(/[+\-]?([0-9\.\s]+)/g)||[];t.length;)e+=parseFloat(t.shift());return e},c={init:function(){this.name=this.searchString(this.dataBrowser)||"",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||""},searchString:function(t){var e,s,i;for(e=0;e<t.length;e++)if(s=t[e].string,i=t[e].prop,this.versionSearchString=t[e].versionSearch||t[e].identity,s){if(-1!==s.indexOf(t[e].subString))return t[e].identity}else if(i)return t[e].identity},searchVersion:function(t){var e=t.indexOf(this.versionSearchString);if(-1!==e)return parseFloat(t.substring(e+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"MSIE",identity:"explorer",versionSearch:"MSIE"}]};return i.settings={},"string"==typeof arguments[0]&&(o.message=arguments[0]),"object"!=typeof arguments[0]&&"object"!=typeof arguments[1]||(o=t.extend(o,"object"==typeof arguments[0]?arguments[0]:arguments[1])),i.init=function(){var l,d,p,u,h,f,_,m,b,v,y,w;if(i.settings=t.extend({},s,o),i.isIE6="explorer"===c.name&&6===c.version||!1,i.settings.modal&&(i.overlay=t("<div>",{class:"ZebraDialogOverlay"}).css({position:i.isIE6?"absolute":"fixed",left:0,top:0,opacity:i.settings.overlay_opacity}),i.settings.overlay_close&&i.overlay.on("click",function(){i.close()}),i.overlay.appendTo("body")),i.dialog=t("<div>",{class:"ZebraDialog"+(i.settings.custom_class?" "+i.settings.custom_class:"")}).css({position:i.isIE6?"absolute":"fixed",left:0,top:0,visibility:"hidden"}),!i.settings.buttons&&i.settings.auto_close&&i.dialog.attr("id","ZebraDialog_"+Math.floor(9999999*Math.random())),y=parseInt(i.settings.width,10),!isNaN(y)&&y===i.settings.width&&y.toString()===i.settings.width.toString()&&y>0&&i.dialog.css({width:i.settings.width}),i.settings.title&&(v=t("<h3>",{class:"ZebraDialog_Title"}).html(i.settings.title).appendTo(i.dialog)),u=r(),d=t("<div>",{class:"ZebraDialog_BodyOuter"+(i.settings.title?"":" ZebraDialog_NoTitle")+(u?"":" ZebraDialog_NoButtons")}).appendTo(i.dialog),i.message=t("<div>",{class:"ZebraDialog_Body"+(!1!==g()?" ZebraDialog_Icon ZebraDialog_"+g():"")}),i.settings.max_height>0&&(i.message.css("max-height",i.settings.max_height),i.isIE6&&i.message.attr("style","height: expression(this.scrollHeight > "+i.settings.max_height+' ? "'+i.settings.max_height+'px" : "85px")')),i.settings.vcenter_short_message?t("<div>").html(i.settings.message).appendTo(i.message):i.message.html(i.settings.message),i.settings.source&&"object"==typeof i.settings.source){h=i.settings.vcenter_short_message?t("div:first",i.message):i.message;for(w in i.settings.source)switch(w){case"ajax":l="string"==typeof i.settings.source[w]?{url:i.settings.source[w]}:i.settings.source[w],b=t("<div>").attr("class","ZebraDialog_Preloader").appendTo(h),l.success=function(t){b.remove(),h.append(t),a(!1)},t.ajax(l);break;case"iframe":_={width:"100%",height:"100%",marginheight:"0",marginwidth:"0",frameborder:"0"},m=t.extend(_,"string"==typeof i.settings.source[w]?{src:i.settings.source[w]}:i.settings.source[w]),h.append(t("<iframe>").attr(m));break;case"inline":h.append(i.settings.source[w])}}return i.message.appendTo(d),u&&(u.reverse(),p=t("<div>",{class:"ZebraDialog_Buttons"}).appendTo(i.dialog),t.each(u,function(e,s){var o=t("<a>",{href:"javascript:void(0)",class:"ZebraDialog_Button_"+e});t.isPlainObject(s)?o.html(s.caption):o.html(s),o.on("click",function(){var t=!0;void 0!==s.callback&&(t=s.callback(i.dialog)),!1!==t&&i.close(void 0!==s.caption?s.caption:s)}),o.appendTo(p)}),p.wrap(t("<div>").addClass("ZebraDialog_ButtonsOuter"+(i.settings.center_buttons?" ZebraDialog_Buttons_Centered":"")))),i.dialog.appendTo("body"),i.settings.show_close_button&&(f=t('<a href="javascript:void(0)" class="ZebraDialog_Close">×</a>').on("click",function(t){t.preventDefault(),i.close()}).appendTo(v||i.message),v&&f.css({right:parseInt(v.css("paddingRight"),10),top:(parseInt(v.css("height"),10)+parseInt(v.css("paddingTop"),10)+parseInt(v.css("paddingBottom"),10)-f.height())/2})),t(window).on("resize.Zebra_Dialog",function(){clearTimeout(e),e=setTimeout(function(){a()},100)}),i.settings.keyboard&&t(document).on("keyup.Zebra_Dialog",function(t){return 27===t.which&&i.close(),!0}),i.isIE6&&t(window).on("scroll.Zebra_Dialog",function(){n()}),!1!==i.settings.auto_close&&(i.dialog.on("click",function(){clearTimeout(i.timeout),i.close()}),i.timeout=setTimeout(i.close,i.settings.auto_close)),a(!1),i},i.close=function(e){t(document).unbind(".Zebra_Dialog"),t(window).unbind(".Zebra_Dialog"),i.overlay&&i.overlay.animate({opacity:0},i.settings.animation_speed_hide,function(){i.overlay.remove()}),i.dialog.animate({top:0,opacity:0},i.settings.animation_speed_hide,function(){i.dialog.remove(),i.settings.onClose&&"function"==typeof i.settings.onClose&&i.settings.onClose(void 0!==e?e:"")})},c.init(),i.init()}}(jQuery); | ||
!function(t){"use strict";t.Zebra_Dialog=function(){this.version="1.5";var e,s={animation_speed_hide:250,animation_speed_show:0,auto_close:!1,buttons:!0,center_buttons:!1,custom_class:!1,keyboard:!0,max_height:0,message:"",modal:!0,overlay_close:!0,overlay_opacity:".9",position:"center",reposition_speed:500,show_close_button:!0,source:!1,title:"",type:"information",vcenter_short_message:!0,width:0,onClose:null},i=this,o={},a=function(){var s,o,a,r=t(window).width(),g=t(window).height(),c=i.dialog.width(),d=i.dialog.height(),p={left:0,top:0,right:r-c,bottom:g-d,center:(r-c)/2,middle:(g-d)/2};i.dialog_left=void 0,i.dialog_top=void 0,t.isArray(i.settings.position)&&2===i.settings.position.length&&"string"==typeof i.settings.position[0]&&i.settings.position[0].match(/^(left|right|center)[\s0-9\+\-]*$/)&&"string"==typeof i.settings.position[1]&&i.settings.position[1].match(/^(top|bottom|middle)[\s0-9\+\-]*$/)&&(i.settings.position[0]=i.settings.position[0].toLowerCase(),i.settings.position[1]=i.settings.position[1].toLowerCase(),t.each(p,function(t,e){var s,o;for(s=0;s<2;s++)(o=i.settings.position[s].replace(t,e))!==i.settings.position[s]&&(0===s?i.dialog_left=l(o):i.dialog_top=l(o))})),void 0!==i.dialog_left&&void 0!==i.dialog_top||(i.dialog_left=p.center,i.dialog_top=p.middle),i.dialog_top<0&&(i.dialog_top=0),d>g&&i.message.css("height",g-(t(".ZebraDialog_Title",i.dialog)?t(".ZebraDialog_Title",i.dialog).outerHeight():0)-(t(".ZebraDialog_ButtonsOuter",i.dialog)?t(".ZebraDialog_ButtonsOuter",i.dialog).outerHeight():0)-(parseFloat(i.message.css("paddingTop"))||0)-(parseFloat(i.message.css("paddingBottom"))||0)-(parseFloat(i.message.css("borderTopWidth"))||0)-(parseFloat(i.message.css("borderBottomWidth"))||0)),i.settings.vcenter_short_message&&(o=(s=i.message.find("div:first")).height())<(a=i.message.height())&&s.css({"padding-top":(a-o)/2}),"boolean"==typeof arguments[0]&&!1===arguments[0]||0===i.settings.reposition_speed?i.dialog.css({left:i.dialog_left,top:i.dialog_top,visibility:"visible",opacity:0}).animate({opacity:"1"},i.settings.animation_speed_show):(i.dialog.stop(!0),i.dialog.css("visibility","visible").animate({left:i.dialog_left,top:i.dialog_top},i.settings.reposition_speed)),void 0===e&&i.dialog.find("a[class^=ZebraDialog_Button]:first").focus(),i.isIE6&&setTimeout(n,500)},n=function(){var e=t(window).scrollTop(),s=t(window).scrollLeft();i.settings.modal&&i.overlay.css({top:e,left:s}),i.dialog.css({left:i.dialog_left+s,top:i.dialog_top+e})},r=function(){if(!0!==i.settings.buttons&&!t.isArray(i.settings.buttons))return!1;if(!0===i.settings.buttons)switch(i.settings.type){case"question":i.settings.buttons=["Yes","No"];break;default:i.settings.buttons=["Ok"]}return i.settings.buttons},g=function(){switch(i.settings.type){case"confirmation":case"error":case"information":case"question":case"warning":return i.settings.type.charAt(0).toUpperCase()+i.settings.type.slice(1).toLowerCase();default:return!1}},l=function(t){var e=0;for(t=t.replace(/\s/g,"").match(/[+\-]?([0-9\.\s]+)/g)||[];t.length;)e+=parseFloat(t.shift());return e},c={init:function(){this.name=this.searchString(this.dataBrowser)||"",this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||""},searchString:function(t){var e,s,i;for(e=0;e<t.length;e++)if(s=t[e].string,i=t[e].prop,this.versionSearchString=t[e].versionSearch||t[e].identity,s){if(-1!==s.indexOf(t[e].subString))return t[e].identity}else if(i)return t[e].identity},searchVersion:function(t){var e=t.indexOf(this.versionSearchString);if(-1!==e)return parseFloat(t.substring(e+this.versionSearchString.length+1))},dataBrowser:[{string:navigator.userAgent,subString:"MSIE",identity:"explorer",versionSearch:"MSIE"}]};return i.settings={},"string"==typeof arguments[0]&&(o.message=arguments[0]),"object"!=typeof arguments[0]&&"object"!=typeof arguments[1]||(o=t.extend(o,"object"==typeof arguments[0]?arguments[0]:arguments[1])),i.init=function(){var l,d,p,u,h,f,m,_,v,b,y,w;if(i.settings=t.extend({},s,o),i.isIE6="explorer"===c.name&&6===c.version||!1,i.settings.modal&&(i.overlay=t("<div>",{class:"ZebraDialogOverlay"}).css({position:i.isIE6?"absolute":"fixed",left:0,top:0,opacity:i.settings.overlay_opacity}),i.settings.overlay_close&&i.overlay.on("click",function(){i.close()}),i.overlay.appendTo("body")),i.dialog=t("<div>",{class:"ZebraDialog"+(i.settings.custom_class?" "+i.settings.custom_class:"")}).css({position:i.isIE6?"absolute":"fixed",left:0,top:0,visibility:"hidden"}),!i.settings.buttons&&i.settings.auto_close&&i.dialog.attr("id","ZebraDialog_"+Math.floor(9999999*Math.random())),y=parseInt(i.settings.width,10),!isNaN(y)&&y===i.settings.width&&y.toString()===i.settings.width.toString()&&y>0&&i.dialog.css({width:i.settings.width}),i.settings.title&&(b=t("<h3>",{class:"ZebraDialog_Title"}).html(i.settings.title).appendTo(i.dialog)),u=r(),d=t("<div>",{class:"ZebraDialog_BodyOuter"+(i.settings.title?"":" ZebraDialog_NoTitle")+(u?"":" ZebraDialog_NoButtons")}).appendTo(i.dialog),i.message=t("<div>",{class:"ZebraDialog_Body"+(!1!==g()?" ZebraDialog_Icon ZebraDialog_"+g():"")}),i.settings.max_height>0&&(i.message.css("max-height",i.settings.max_height),i.isIE6&&i.message.attr("style","height: expression(this.scrollHeight > "+i.settings.max_height+' ? "'+i.settings.max_height+'px" : "85px")')),i.settings.vcenter_short_message?t("<div>").html(i.settings.message).appendTo(i.message):i.message.html(i.settings.message),i.settings.source&&"object"==typeof i.settings.source){h=i.settings.vcenter_short_message?t("div:first",i.message):i.message;for(w in i.settings.source)switch(w){case"ajax":l="string"==typeof i.settings.source[w]?{url:i.settings.source[w]}:i.settings.source[w],v=t("<div>").attr("class","ZebraDialog_Preloader").appendTo(h),l.success=function(t){v.remove(),h.append(t),a(!1)},t.ajax(l);break;case"iframe":m={width:"100%",height:"100%",marginheight:"0",marginwidth:"0",frameborder:"0"},_=t.extend(m,"string"==typeof i.settings.source[w]?{src:i.settings.source[w]}:i.settings.source[w]),h.append(t("<iframe>").attr(_));break;case"inline":h.append(i.settings.source[w])}}return i.message.appendTo(d),u&&(u.reverse(),p=t("<div>",{class:"ZebraDialog_Buttons"}).appendTo(i.dialog),t.each(u,function(e,s){var o=t("<a>",{href:"javascript:void(0)",class:"ZebraDialog_Button_"+e+(void 0!==s.custom_class&&""!==s.custom_class.toString().trim()?" "+s.custom_class:"")});void 0!==s.caption?o.html(s.caption):o.html(s),o.on("click",function(){var t=!0;void 0!==s.callback&&(t=s.callback(i.dialog)),!1!==t&&i.close(void 0!==s.caption?s.caption:s)}),o.appendTo(p)}),p.wrap(t("<div>").addClass("ZebraDialog_ButtonsOuter"+(i.settings.center_buttons?" ZebraDialog_Buttons_Centered":"")))),i.dialog.appendTo("body"),i.settings.show_close_button&&(f=t('<a href="javascript:void(0)" class="ZebraDialog_Close">×</a>').on("click",function(t){t.preventDefault(),i.close()}).appendTo(b||i.message),b&&f.css({right:parseInt(b.css("paddingRight"),10),top:(parseInt(b.css("height"),10)+parseInt(b.css("paddingTop"),10)+parseInt(b.css("paddingBottom"),10)-f.height())/2})),t(window).on("resize.Zebra_Dialog",function(){clearTimeout(e),e=setTimeout(function(){a()},100)}),i.settings.keyboard&&t(document).on("keyup.Zebra_Dialog",function(t){return 27===t.which&&i.close(),!0}),i.isIE6&&t(window).on("scroll.Zebra_Dialog",function(){n()}),!1!==i.settings.auto_close&&(i.dialog.on("click",function(){clearTimeout(i.timeout),i.close()}),i.timeout=setTimeout(i.close,i.settings.auto_close)),a(!1),i},i.close=function(e){t(document).off(".Zebra_Dialog"),t(window).off(".Zebra_Dialog"),i.overlay&&i.overlay.animate({opacity:"0"},i.settings.animation_speed_hide,function(){i.overlay.remove()}),i.dialog.animate({top:"0",opacity:"0"},i.settings.animation_speed_hide,function(){i.dialog.remove(),i.settings.onClose&&"function"==typeof i.settings.onClose&&i.settings.onClose(void 0!==e?e:"")})},c.init(),i.init()}}(jQuery); |
@@ -25,4 +25,4 @@ /** | ||
* @author Stefan Gabos <contact@stefangabos.ro> | ||
* @version 1.4.1 (last revision: October 13, 2017) | ||
* @copyright (c) 2011 - 2017 Stefan Gabos | ||
* @version 1.5 (last revision: July 05, 2018) | ||
* @copyright (c) 2011 - 2018 Stefan Gabos | ||
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LESSER GENERAL PUBLIC LICENSE | ||
@@ -37,2 +37,5 @@ * @package Zebra_Dialog | ||
// so you can tell the version number even if all you have is the minified source | ||
this.version = '1.5'; | ||
// default options | ||
@@ -76,8 +79,17 @@ var defaults = { | ||
// | ||
// You can also attach callback functions to individual buttons | ||
// by using objects in the form of: | ||
// You can also add custom CSS classes and/or attach callback | ||
// functions to individual buttons by using objects in the | ||
// form of: | ||
// | ||
// [ | ||
// {caption: 'My button 1', callback: function() { // code }}, | ||
// {caption: 'My button 2', callback: function() { // code }} | ||
// { | ||
// caption: 'My button 1', | ||
// custom_class: 'foo', | ||
// callback: function() { // code } | ||
// }, | ||
// { | ||
// caption: 'My button 2', | ||
// custom_class: 'bar', | ||
// callback: function() { // code } | ||
// } | ||
// ] | ||
@@ -444,3 +456,5 @@ // | ||
}).animate({'opacity': 1}, plugin.settings.animation_speed_show); | ||
// (notice that we use the opacity's value as string - this is required for working with IE8 | ||
// see https://stackoverflow.com/questions/4987842/jquery-on-ie8-error-object-doesnt-support-this-property-or-method) | ||
}).animate({'opacity': '1'}, plugin.settings.animation_speed_show); | ||
@@ -462,3 +476,7 @@ // if dialog box is to be animated into position | ||
// move the focus to the first of the dialog box's buttons | ||
plugin.dialog.find('a[class^=ZebraDialog_Button]:first').focus(); | ||
// only do it when we initialize the dialog and not also on resizing because otherwise, if there is an | ||
// input in the dialog and the input receives focus on mobile, the virtual keyboard will show up and will | ||
// trigger this method again which would remove the focus and, therefore, the virtual keyboard, making | ||
// it impossible to give focus to the input element | ||
if (undefined === timeout) plugin.dialog.find('a[class^=ZebraDialog_Button]:first').focus(); | ||
@@ -883,3 +901,3 @@ // if the browser is Internet Explorer 6, call the "_emulate_fixed_position" method | ||
'href': 'javascript:void(0)', | ||
'class': 'ZebraDialog_Button_' + index | ||
'class': 'ZebraDialog_Button_' + index + (undefined !== value.custom_class && value.custom_class.toString().trim() !== '' ? ' ' + value.custom_class : '') | ||
@@ -890,3 +908,3 @@ }); | ||
// set the button's caption | ||
if ($.isPlainObject(value)) button.html(value.caption); | ||
if (undefined !== value.caption) button.html(value.caption); | ||
@@ -1030,4 +1048,4 @@ // if button is given as a plain string, set the button's caption accordingly | ||
// remove all event handlers set by the plugin | ||
$(document).unbind('.Zebra_Dialog'); | ||
$(window).unbind('.Zebra_Dialog'); | ||
$(document).off('.Zebra_Dialog'); | ||
$(window).off('.Zebra_Dialog'); | ||
@@ -1038,5 +1056,7 @@ // if an overlay exists | ||
// animate overlay's css properties | ||
// (notice that we use the opacity's value as string - this is required for working with IE8 | ||
// see https://stackoverflow.com/questions/4987842/jquery-on-ie8-error-object-doesnt-support-this-property-or-method) | ||
plugin.overlay.animate({ | ||
opacity: 0 // fade out the overlay | ||
opacity: '0' // fade out the overlay | ||
@@ -1057,6 +1077,8 @@ }, | ||
// animate dialog box's css properties | ||
// (notice that we use the values for the animation's properties as strings; this is required for working with IE8 | ||
// see https://stackoverflow.com/questions/4987842/jquery-on-ie8-error-object-doesnt-support-this-property-or-method) | ||
plugin.dialog.animate({ | ||
top: 0, // move the dialog box to the top | ||
opacity: 0 // fade out the dialog box | ||
top: '0', // move the dialog box to the top | ||
opacity: '0' // fade out the dialog box | ||
@@ -1063,0 +1085,0 @@ }, |
@@ -1,1 +0,1 @@ | ||
:books: [Open the examples](https://stefangabos.github.io/Zebra_Dialog) | ||
:books: [Open the examples](https://stefangabos.github.io/Zebra_Dialog/flat.html) |
@@ -15,3 +15,3 @@ { | ||
"license": "LGPL-3.0", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"keywords": [ | ||
@@ -18,0 +18,0 @@ "jquery-plugin", |
@@ -21,3 +21,3 @@ <img src="https://raw.githubusercontent.com/stefangabos/zebrajs/master/docs/images/logo.png" alt="zebrajs" align="right"> | ||
[![Donate](https://img.shields.io/badge/Be%20kind%20%7C%20Donate%20$3%20with%20-%20PayPal%20-brightgreen.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RKMCMRZB493LY) | ||
[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RKMCMRZB493LY) | ||
@@ -41,4 +41,6 @@ ## Features | ||
Cross browser/device testing done with | ||
## Sponsors | ||
Cross browser/device testing is done with | ||
[![BrowserStack](https://github.com/stefangabos/Zebra_Dialog/raw/master/examples/browserstack.png)](https://www.browserstack.com/) | ||
@@ -54,11 +56,13 @@ | ||
```bash | ||
# the "--save" argument adds the plugin as a dependency in packages.json | ||
npm install zebra_dialog --save | ||
``` | ||
npm install zebra_dialog | ||
``` | ||
Zebra_Dialog is also available as a [Bower package](http://bower.io/). To install it use: | ||
```bash | ||
# the "--save" argument adds the plugin as a dependency in bower.json | ||
bower install zebra_dialog --save | ||
``` | ||
bower install zebra_dialog | ||
``` | ||
@@ -169,8 +173,10 @@ ## How to use | ||
Set to <code>FALSE</code> if you want no buttons.<br><br> | ||
You can also attach callback functions to individual buttons by providing an array of objects like:<br><br> | ||
You can also add custom CSS classes and/or attach callback functions to individual buttons by providing an array of objects like:<br><br> | ||
<code>[{</code><br> | ||
<code> caption: 'My button 1',</code><br> | ||
<code> custom_class: 'foo',</code><br> | ||
<code> callback: function() { // code }</code><br> | ||
<code>},{</code><br> | ||
<code> caption: 'My button 2',</code><br> | ||
<code> custom_class: 'bar',</code><br> | ||
<code> callback: function() { // code }</code><br> | ||
@@ -418,2 +424,2 @@ <code>}]</code><br><br> | ||
See the [demos](http://stefangabos.github.io/Zebra_Dialog/) | ||
See the [demos](http://stefangabos.github.io/Zebra_Dialog/flat.html) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
213986
1376
421