simple_alert 1.0.7 → 1.0.8

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: 87fb90f238a22e2f81448969fc1caef6661aee8c
4
- data.tar.gz: f1c8c61812dd17eba0662ffbbe0846e4018d222f
3
+ metadata.gz: ae9ba8683e6a748388eb3f55500f516d6ee09b2f
4
+ data.tar.gz: 6fd56d67f0f2b6f73c50fbea5b36d106e1886f40
5
5
  SHA512:
6
- metadata.gz: 0b275b2de504a57bbfca23b18f60aedc86614c3240f104f69727a721cb41e1f635703dc18558a25a5e75d317c24a15cfc04f6438a4a96f4eccc87ce537fdfa5b
7
- data.tar.gz: 8528cfe05019af19560ecf9f9a9472ef81187c30db0fc0ae742d7a9ad93c6f7049b453afb3a06a260ab84d28d9d3f3cadd88cf323c13279436f34b2f26d63ed6
6
+ metadata.gz: 0e38434681e642cf32d8b1f920c2f96fc038786a0e9b40cfbf682def060357534e19fc8e00aac8a3f2a071ee769d1e43399faf46a504ce4c2bcc4750bb9fa585
7
+ data.tar.gz: 048eb120e1a0648628bb727e080a31f4668e7a803bbdda35a196d04b84db3fa368fde252d0dd4b3b7649ba844e77fe3aef77e6c2bf0fa0fe7beafa3e93ed1afd
data/CHANGELOG CHANGED
@@ -1,7 +1,9 @@
1
+ v 1.0.8
2
+ - update load dependencies
1
3
  v 1.0.7
2
4
  - using z index
3
5
  v 1.0.6
4
6
  - update to rails 5
5
7
  v 1.0.5
6
8
  - change order, bt confirm first
7
- - add global settings with class for bt confirm and close
9
+ - add global settings with class for bt confirm and close
@@ -1,3 +1,3 @@
1
1
  module SimpleAlert
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
@@ -1,27 +1,32 @@
1
+ var url = window.location.href
2
+ var arr = url.split("/")
3
+ var base = arr[0] + "//" + arr[2]
4
+ var base = base + '<%= Rails.application.config.relative_url ? Rails.application.config.relative_url : "" %>'
1
5
  if(!$().transition ){
2
- var transit = document.createElement('script');
3
- transit.src = './assets/simple_alert/dependences/transit/transit.js';
4
- document.head.appendChild(transit);
6
+ var transit = document.createElement('script');
7
+ transit.src = base + '/assets/dependences/transit/transit.js';
8
+ document.head.appendChild(transit);
5
9
  }
6
10
  if(!"".include){
7
- var transit = document.createElement('script');
8
- transit.src = './assets/simple_alert/dependences/core/string.js';
9
- document.head.appendChild(transit);
11
+ var transit = document.createElement('script');
12
+ transit.src = base + '/assets/dependences/core/string.js';
13
+ document.head.appendChild(transit);
10
14
  }
11
15
  if(typeof ElementQueries == 'undefined'){
12
- var transit = document.createElement('script');
13
- transit.src = './assets/simple_alert/dependences/event_resize/ElementQueries.js';
14
- document.head.appendChild(transit);
16
+ var transit = document.createElement('script');
17
+ transit.src = base + '/assets/dependences/event_resize/ElementQueries.js';
18
+ document.head.appendChild(transit);
15
19
  }
16
20
  if(typeof ResizeSensor == 'undefined'){
17
- var transit = document.createElement('script');
18
- transit.src = './assets/simple_alert/dependences/event_resize/ResizeSensor.js';
19
- document.head.appendChild(transit);
21
+ var transit = document.createElement('script');
22
+ transit.src = base + '/assets/dependences/event_resize/ResizeSensor.js';
23
+ document.head.appendChild(transit);
20
24
  }
21
25
  if(!$().topZIndex){
22
- var transit = document.createElement('script');
23
- transit.src = './assets/simple_alert/dependences/top_z_index/topZIndex.js';
24
- document.head.appendChild(transit);
26
+ var transit = document.createElement('script');
27
+ transit.src = base + '/assets/dependences/top_z_index/topZIndex.js';
28
+ document.head.appendChild(transit);
25
29
  }
30
+
26
31
  (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);
27
32
 
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.0.7
4
+ version: 1.0.8
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-10-14 00:00:00.000000000 Z
11
+ date: 2016-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler