simple_alert 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 998c66c2c637c531c35ecf4a5f998a5a856d115c
4
- data.tar.gz: 14d2af3159ad46e71e629f63fca93ccb4174a767
3
+ metadata.gz: 319ccaa53ef99638c2b68da0fc99e5b618dfa053
4
+ data.tar.gz: c327a5bfee20bfddc5f9886e2ffa8ff1cba08028
5
5
  SHA512:
6
- metadata.gz: fbe2dd47de85e72bf78ad1a7423758c8684018c14c80a060d5820991670da78f3fc7fe101bbff33e3ed5f30f08f90939c46a39c838db337c9ed70f0b23521082
7
- data.tar.gz: f913c4a10edebca3fc3d710ecd5f50bd0a0b57e444e81cd82e939c4e222a00fa91d268b9b368dc1c0b1ad114548208ce852bb8c80366fe63d1f601fe3718cebf
6
+ metadata.gz: 48b2d230c75b48255e6e29eac8b763f50fbb80eaafdc35a31de0c155935aeceb5c38bc7faba3b95700d058ec77058710a3287790249f7b595d5115e1fd67ce5a
7
+ data.tar.gz: b13bfdb883bd240080526636826eb2f36f8606dec8b10bae87c65fc15a8083e2878265ac89e85e3c43284fdff39729055b558605f139c3facfe8a8a3fb01b94a
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v 1.2.2
2
+ - fix enable scroll
1
3
  v 1.2.1
2
4
  - update method of load dependencies
3
5
  v 1.2.0
@@ -1,3 +1,3 @@
1
1
  module SimpleAlert
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -20,4 +20,4 @@ if(!$().topZIndex){
20
20
  alert("TopZIndex is required \nAdd //= require simple_alert/top_z_index before require simple_alert on your application.js")
21
21
  }
22
22
 
23
- (function(){this.SimpleAlert={bt_close_class:"",bt_confirm_class:""};this.ba=function(){var bt_close,bt_confirm,center,close_btn_bind,close_modal,disableScroll,enableScroll,gen_message,gen_modal,gen_title,generate_random_id,h,index,keys,modal,open_modal,preventDefault,preventDefaultForScrollKeys,process_hash,resize_btns,shadow,show_shadow;index=$.topZIndex();keys={37:1,38:1,39:1,40:1};preventDefault=function(e){e=e||window.event;if(e.preventDefault){e.preventDefault()}e.returnValue=false};preventDefaultForScrollKeys=function(e){if(keys[e.keyCode]){preventDefault(e);return false}};disableScroll=function(){if(window.addEventListener){window.addEventListener("DOMMouseScroll",preventDefault,false)}window.onwheel=preventDefault;window.onmousewheel=document.onmousewheel=preventDefault;window.ontouchmove=preventDefault;document.onkeydown=preventDefaultForScrollKeys};enableScroll=function(){if(window.removeEventListener){window.removeEventListener("DOMMouseScroll",preventDefault,false)}window.onmousewheel=document.onmousewheel=null;window.onwheel=null;window.ontouchmove=null;document.onkeydown=null};generate_random_id=function(){var rr;rr=(Math.random()+"").substring(2);while($("#shadow_"+rr).size()>0){rr=(Math.random()+"").substring(2)}return rr};process_hash=function(params){var hash,r;if(params[0].constructor===Object){hash=params[0]}else{hash={};switch(params.length){case 1:hash["message"]=params[0];break;case 2:hash["title"]=params[0];hash["message"]=params[1]}}r={};r["title"]=hash["title"]!==void 0?hash["title"]:false;r["message"]=hash["message"]!==void 0?hash["message"]:false;r["showConfirmBtn"]=hash["showConfirmBtn"]!==void 0?true:hash["onConfirm"]!==void 0||(hash["confirmClass"]!==void 0||hash["confirmText"]!==void 0)?true:false;r["showCloseBtn"]=hash["showCloseBtn"]!==void 0?true:false;r["confirmText"]=hash["confirmText"]!==void 0?hash["confirmText"]:"Confirm";r["confirmClass"]=hash["confirmClass"]!==void 0?hash["confirmClass"]:SimpleAlert.bt_confirm_class;r["closeText"]=hash["closeText"]!==void 0?hash["closeText"]:"Close";r["closeClass"]=hash["closeClass"]!==void 0?hash["closeClass"]:SimpleAlert.bt_close_class;r["onConfirm"]=hash["onConfirm"]!==void 0?hash["onConfirm"]:false;r["onClose"]=hash["onClose"]!==void 0?hash["onClose"]:false;r["message"]=hash["message"]!==void 0?hash["message"]:"";r["openTime"]=hash["time"]!==void 0?hash["time"]:hash["openTime"]!==void 0?hash["openTime"]:250;r["closeTime"]=hash["time"]!==void 0?hash["time"]:hash["closeTime"]!==void 0?hash["closeTime"]:250;r["effectShow"]=hash["effectShow"]!==void 0?hash["effectShow"]:hash["effect"]?hash["effect"]:"easeInOutBack";r["effectHide"]=hash["effectHide"]!==void 0?hash["effectHide"]:hash["effect"]?hash["effect"]:"easeInBack";r["closeOnClickShadow"]=hash["closeOnClickShadow"]!==void 0?hash["closeOnClickShadow"]:false;r["autoClose"]=hash["autoClose"]!==void 0?hash["autoClose"]:false;r["id"]=hash["id"]?hash["id"]:generate_random_id();r["modal"]="#modal_"+r["id"];r["shadow"]="#shadow_"+r["id"];r["bt_close"]="#bt_close_"+r["id"];r["div_bt_close"]="#div_bt_close_"+r["id"];r["bt_confirm"]="#bt_confirm_"+r["id"];r["div_bt_confirm"]="#div_bt_confirm_"+r["id"];return r};h=process_hash(arguments);center=function(){$(h["modal"]).css("marginLeft",$(h["modal"]).width()/2*-1+"px");$(h["modal"]).css("marginTop",$(h["modal"]).height()/2*-1+"px");$(h["modal"]).css("top","50%");return $(h["modal"]).css("left","50%")};show_shadow=function(){$(h["shadow"]).css("zIndex",index+1);$(h["shadow"]).animate({opacity:"0.4"},h["openTime"],function(){return disableScroll()});if(h["autoClose"]){return setTimeout(function(){if(h["autoClose"]){return close_modal()}},h["autoClose"]*1e3)}};open_modal=function(){$(h["modal"]).css("zIndex",index+2);$(h["modal"]).transition({scale:0},0);return $(h["modal"]).transition({scale:1},h["openTime"],h["effectShow"])};close_btn_bind=function(){$(h["bt_close"]).click(function(){return close_modal()});if(h["closeOnClickShadow"]){return $(h["shadow"]).click(function(){return close_modal()})}};resize_btns=function(){var close,confirm,err,error;try{close=$(h["bt_close"]).outerWidth();confirm=$(h["bt_confirm"]).outerWidth();if(close>confirm){return $(h["bt_confirm"]).css("width",close)}else{return $(h["bt_close"]).css("width",confirm)}}catch(error){err=error}};gen_modal=function(){return'<div id="'+h["modal"].substring(1)+'" class="ba_modal" ><div class="ba_modal_content" >'};gen_message=function(){if(h["message"]){return'<div class="ba_modal_message" >'+h["message"]+"</div>"}else{return""}};gen_title=function(){if(h["title"]){return'<div class="ba_modal_title">'+h["title"]+"</div>"}else{return""}};shadow=function(){return'<div id="'+h["shadow"].substring(1)+'" class="ba_shadow"></div>'};close_modal=function(confirm){if(confirm==null){confirm=false}h["autoClose"]=false;if(h["onClose"]&&!confirm){h["onClose"]()}$(h["modal"]).transition({scale:0,opacity:0},h["closeTime"],h["effectHide"],function(){return $(this).remove()});return $(h["shadow"]).transition({opacity:0},h["closeTime"],function(){$(this).remove();if(!(h["onClose"]+"").include("ba")||!(h["onConfirm"]+"").include("ba")){return enableScroll()}})};bt_confirm=function(){if(h["showConfirmBtn"]){return'<div id="'+h["div_bt_confirm"].substring(1)+'" class="ba_modal_bt">\n <input type="button" id="'+h["bt_confirm"].substring(1)+'" '+(h["confirmClass"]?' class="'+h["confirmClass"]+'" ':"")+('value="'+h["confirmText"]+'"></input>\n\n</div>')}else{return""}};bt_close=function(){return'<div id="'+h["div_bt_close"].substring(1)+'" class="ba_modal_bt">\n <input type="button" id="'+h["bt_close"].substring(1)+'" '+(h["closeClass"]?' class="'+h["closeClass"]+'" ':"")+('value="'+h["closeText"]+'"></input>\n</div>')};modal=gen_modal();modal+=gen_title();modal+=gen_message();modal+='<div class="ba_list_bt" >';modal+=bt_confirm();modal+=bt_close();modal+="</div>";modal+="</div></div>";$("body").append(shadow());$("body").append(modal);disableScroll();resize_btns();show_shadow();open_modal();close_btn_bind();if(h["showConfirmBtn"]){$(h["bt_confirm"]).click(function(){close_modal(true);if(h["onConfirm"]){return h["onConfirm"]()}})}else{$(h["div_bt_close"]).css("width","100%")}center();return $(window).resize(function(){return center()})}}).call(this);
23
+ (function(){this.SimpleAlert={bt_close_class:"",bt_confirm_class:""};this.ba=function(){var bt_close,bt_confirm,center,close_btn_bind,close_modal,disableScroll,enableScroll,gen_message,gen_modal,gen_title,generate_random_id,h,index,keys,modal,open_modal,preventDefault,preventDefaultForScrollKeys,process_hash,resize_btns,shadow,show_shadow;index=$.topZIndex();keys={37:1,38:1,39:1,40:1};preventDefault=function(e){e=e||window.event;if(e.preventDefault){e.preventDefault()}e.returnValue=false};preventDefaultForScrollKeys=function(e){if(keys[e.keyCode]){preventDefault(e);return false}};disableScroll=function(){if(window.addEventListener){window.addEventListener("DOMMouseScroll",preventDefault,false)}window.onwheel=preventDefault;window.onmousewheel=document.onmousewheel=preventDefault;window.ontouchmove=preventDefault;document.onkeydown=preventDefaultForScrollKeys};enableScroll=function(){if(window.removeEventListener){window.removeEventListener("DOMMouseScroll",preventDefault,false)}window.onmousewheel=document.onmousewheel=null;window.onwheel=null;window.ontouchmove=null;document.onkeydown=null};generate_random_id=function(){var rr;rr=(Math.random()+"").substring(2);while($("#shadow_"+rr).size()>0){rr=(Math.random()+"").substring(2)}return rr};process_hash=function(params){var hash,r;if(params[0].constructor===Object){hash=params[0]}else{hash={};switch(params.length){case 1:hash["message"]=params[0];break;case 2:hash["title"]=params[0];hash["message"]=params[1]}}r={};r["title"]=hash["title"]!==void 0?hash["title"]:false;r["message"]=hash["message"]!==void 0?hash["message"]:false;r["showConfirmBtn"]=hash["showConfirmBtn"]!==void 0?true:hash["onConfirm"]!==void 0||(hash["confirmClass"]!==void 0||hash["confirmText"]!==void 0)?true:false;r["showCloseBtn"]=hash["showCloseBtn"]!==void 0?true:false;r["confirmText"]=hash["confirmText"]!==void 0?hash["confirmText"]:"Confirm";r["confirmClass"]=hash["confirmClass"]!==void 0?hash["confirmClass"]:SimpleAlert.bt_confirm_class;r["closeText"]=hash["closeText"]!==void 0?hash["closeText"]:"Close";r["closeClass"]=hash["closeClass"]!==void 0?hash["closeClass"]:SimpleAlert.bt_close_class;r["onConfirm"]=hash["onConfirm"]!==void 0?hash["onConfirm"]:false;r["onClose"]=hash["onClose"]!==void 0?hash["onClose"]:false;r["message"]=hash["message"]!==void 0?hash["message"]:"";r["openTime"]=hash["time"]!==void 0?hash["time"]:hash["openTime"]!==void 0?hash["openTime"]:250;r["closeTime"]=hash["time"]!==void 0?hash["time"]:hash["closeTime"]!==void 0?hash["closeTime"]:250;r["effectShow"]=hash["effectShow"]!==void 0?hash["effectShow"]:hash["effect"]?hash["effect"]:"easeInOutBack";r["effectHide"]=hash["effectHide"]!==void 0?hash["effectHide"]:hash["effect"]?hash["effect"]:"easeInBack";r["closeOnClickShadow"]=hash["closeOnClickShadow"]!==void 0?hash["closeOnClickShadow"]:false;r["autoClose"]=hash["autoClose"]!==void 0?hash["autoClose"]:false;r["id"]=hash["id"]?hash["id"]:generate_random_id();r["modal"]="#modal_"+r["id"];r["shadow"]="#shadow_"+r["id"];r["bt_close"]="#bt_close_"+r["id"];r["div_bt_close"]="#div_bt_close_"+r["id"];r["bt_confirm"]="#bt_confirm_"+r["id"];r["div_bt_confirm"]="#div_bt_confirm_"+r["id"];return r};h=process_hash(arguments);center=function(){$(h["modal"]).css("marginLeft",$(h["modal"]).width()/2*-1+"px");$(h["modal"]).css("marginTop",$(h["modal"]).height()/2*-1+"px");$(h["modal"]).css("top","50%");return $(h["modal"]).css("left","50%")};show_shadow=function(){$(h["shadow"]).css("zIndex",index+1);$(h["shadow"]).animate({opacity:"0.4"},h["openTime"],function(){return disableScroll()});if(h["autoClose"]){return setTimeout(function(){if(h["autoClose"]){return close_modal()}},h["autoClose"]*1e3)}};open_modal=function(){$(h["modal"]).css("zIndex",index+2);$(h["modal"]).transition({scale:0},0);return $(h["modal"]).transition({scale:1},h["openTime"],h["effectShow"])};close_btn_bind=function(){$(h["bt_close"]).click(function(){return close_modal()});if(h["closeOnClickShadow"]){return $(h["shadow"]).click(function(){return close_modal()})}};resize_btns=function(){var close,confirm,err,error;try{close=$(h["bt_close"]).outerWidth();confirm=$(h["bt_confirm"]).outerWidth();if(close>confirm){return $(h["bt_confirm"]).css("width",close)}else{return $(h["bt_close"]).css("width",confirm)}}catch(error){err=error}};gen_modal=function(){return'<div id="'+h["modal"].substring(1)+'" class="ba_modal" ><div class="ba_modal_content" >'};gen_message=function(){if(h["message"]){return'<div class="ba_modal_message" >'+h["message"]+"</div>"}else{return""}};gen_title=function(){if(h["title"]){return'<div class="ba_modal_title">'+h["title"]+"</div>"}else{return""}};shadow=function(){return'<div id="'+h["shadow"].substring(1)+'" class="ba_shadow"></div>'};close_modal=function(confirm){if(confirm==null){confirm=false}h["autoClose"]=false;if(h["onClose"]&&!confirm){h["onClose"]()}$(h["modal"]).transition({scale:0,opacity:0},h["closeTime"],h["effectHide"],function(){return $(this).remove()});$(h["shadow"]).transition({opacity:0},h["closeTime"],function(){return $(this).remove()});return enableScroll()};bt_confirm=function(){if(h["showConfirmBtn"]){return'<div id="'+h["div_bt_confirm"].substring(1)+'" class="ba_modal_bt">\n <input type="button" id="'+h["bt_confirm"].substring(1)+'" '+(h["confirmClass"]?' class="'+h["confirmClass"]+'" ':"")+('value="'+h["confirmText"]+'"></input>\n\n</div>')}else{return""}};bt_close=function(){return'<div id="'+h["div_bt_close"].substring(1)+'" class="ba_modal_bt">\n <input type="button" id="'+h["bt_close"].substring(1)+'" '+(h["closeClass"]?' class="'+h["closeClass"]+'" ':"")+('value="'+h["closeText"]+'"></input>\n</div>')};modal=gen_modal();modal+=gen_title();modal+=gen_message();modal+='<div class="ba_list_bt" >';modal+=bt_confirm();modal+=bt_close();modal+="</div>";modal+="</div></div>";$("body").append(shadow());$("body").append(modal);disableScroll();resize_btns();show_shadow();open_modal();close_btn_bind();if(h["showConfirmBtn"]){$(h["bt_confirm"]).click(function(){close_modal(true);if(h["onConfirm"]){return h["onConfirm"]()}})}else{$(h["div_bt_close"]).css("width","100%")}center();return $(window).resize(function(){return center()})}}).call(this);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_alert
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Feitosa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-03 00:00:00.000000000 Z
11
+ date: 2017-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler