sweetalert2 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f3b8a9ea1d6ab0125d8176758db0257cd95f73a1
4
+ data.tar.gz: 434d877265c9724d17e40d44d9fd9e463a68c0b6
5
+ SHA512:
6
+ metadata.gz: 38c525860cefbe627df6c9bf882993858dc5ae0aff6424176a97de6d4d09eb2cfa250546c5b59760b4c6f3a1022136c8533d575ab6b4a6b48c091107b099e09b
7
+ data.tar.gz: f1419612984afb58cab19803ff76ae914ef400721e4ae094f92bc9db560227ee4a29f70f6fe532f8aad2db9d84ac32d328e123c09a290a13cd6550b5afe6bbe2
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in sweetalert2.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Kyle Montag
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Sweetalert2
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'sweetalert2'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install sweetalert2
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/<my-github-username>/sweetalert2/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,2 @@
1
+ require 'sweetalert2/version'
2
+ require 'sweetalert2/engine' if defined? Rails
@@ -0,0 +1,5 @@
1
+ module SweetAlert2
2
+ module Rails
3
+ class Engine < ::Rails::Engine; end
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module SweetAlert2
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'sweetalert2/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "sweetalert2"
8
+ spec.version = SweetAlert2::VERSION
9
+ spec.authors = ["Kyle Montag"]
10
+ spec.email = ["thekylemontag@gmail.com"]
11
+ spec.summary = %q{SweetAlert 2 for Rails projects}
12
+ spec.homepage = "http://www.thekylemontag.com"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+
17
+ spec.add_dependency "railties", ">= 3.1.0"
18
+
19
+ spec.add_development_dependency "bundler", "~> 1.5"
20
+ spec.add_development_dependency "rake"
21
+ end
@@ -0,0 +1 @@
1
+ !function(e,t){"use strict";function n(){function n(t){var n=t||e.event,o=n.keyCode||n.which;if(-1!==[9,13,32,27].indexOf(o)){for(var a=n.target||n.srcElement,r=-1,i=0;i<S.length;i++)if(a===S[i]){r=i;break}9===o?(a=-1===r?x:r===S.length-1?S[0]:S[r+1],L(n),l(a)):(13===o||32===o?a=-1===r?x:void 0:27===o&&p.allowEscapeKey===!0?c():a=void 0,void 0!==a&&A(a,n))}}function u(t){var n=t||e.event,o=n.target||n.srcElement,a=n.relatedTarget,r=C(y,"visible");if(r){var l=-1;if(null!==a){for(var i=0;i<S.length;i++)if(a===S[i]){l=i;break}-1===l&&o.focus()}else f=o}}if(void 0===arguments[0])return e.console.error("sweetAlert expects at least 1 attribute!"),!1;var p=r({},w);switch(typeof arguments[0]){case"string":p.title=arguments[0],p.text=arguments[1]||"",p.type=arguments[2]||"";break;case"object":p.title=arguments[0].title||w.title,p.text=arguments[0].text||w.text,p.html=arguments[0].html||w.html,p.type=arguments[0].type||w.type,p.animation=void 0!==arguments[0].animation?arguments[0].animation:w.animation,p.customClass=arguments[0].customClass||p.customClass,p.allowOutsideClick=arguments[0].allowOutsideClick||w.allowOutsideClick,p.allowEscapeKey=void 0!==arguments[0].allowEscapeKey?arguments[0].allowEscapeKey:w.allowEscapeKey,p.showConfirmButton=void 0!==arguments[0].showConfirmButton?arguments[0].showConfirmButton:w.showConfirmButton,p.showCancelButton=void 0!==arguments[0].showCancelButton?arguments[0].showCancelButton:w.showCancelButton,p.closeOnConfirm=void 0!==arguments[0].closeOnConfirm?arguments[0].closeOnConfirm:w.closeOnConfirm,p.closeOnCancel=void 0!==arguments[0].closeOnCancel?arguments[0].closeOnCancel:w.closeOnCancel,p.timer=parseInt(arguments[0].timer)||w.timer,p.width=parseInt(arguments[0].width)||w.width,p.padding=parseInt(arguments[0].padding)||w.padding,p.confirmButtonText=arguments[0].confirmButtonText||w.confirmButtonText,p.confirmButtonColor=arguments[0].confirmButtonColor||w.confirmButtonColor,p.cancelButtonColor=arguments[0].cancelButtonColor||w.cancelButtonColor,p.cancelButtonText=arguments[0].cancelButtonText||w.cancelButtonText,p.imageUrl=arguments[0].imageUrl||w.imageUrl,p.imageSize=arguments[0].imageSize||w.imageSize,p.callback=arguments[1]||null,e.sweetAlert.callback=e.swal.callback=function(e){"function"==typeof p.callback&&p.callback(e)};break;default:return e.console.error('Unexpected type of argument! Expected "string" or "object", got '+typeof arguments[0]),!1}o(p),s(),i();var y=b();p.timer&&(y.timeout=setTimeout(function(){c(),"function"==typeof p.callback&&p.callback()},p.timer));var g,v=function(t){var n=t||e.event,o=n.target||n.srcElement,r=C(o,"confirm"),l=C(o,"cancel"),i=C(y,"visible");switch(n.type){case"mouseover":case"mouseup":case"focus":r?o.style.backgroundColor=a(p.confirmButtonColor,-.1):l&&(o.style.backgroundColor=a(p.cancelButtonColor,-.1));break;case"mouseout":r?o.style.backgroundColor=p.confirmButtonColor:l&&(o.style.backgroundColor=p.cancelButtonColor);break;case"mousedown":r?o.style.backgroundColor=a(p.confirmButtonColor,-.2):l&&(o.style.backgroundColor=a(p.cancelButtonColor,-.2));break;case"click":if(r&&p.callback&&i)p.callback(!0),p.closeOnConfirm&&c();else if(p.callback&&i){var s=String(p.callback).replace(/\s/g,""),u="function("===s.substring(0,9)&&")"!==s.substring(9,10);u&&p.callback(!1),p.closeOnCancel&&c()}else c()}},k=y.querySelectorAll("button");for(g=0;g<k.length;g++)k[g].onclick=v,k[g].onmouseover=v,k[g].onmouseout=v,k[g].onmousedown=v;m=t.onclick,t.onclick=function(t){var n=t||e.event,o=n.target||n.srcElement;o===h()&&p.allowOutsideClick&&c()};var x=y.querySelector("button.confirm"),B=y.querySelector("button.cancel"),S=y.querySelectorAll("button, input:not([type=hidden]), textarea");for(g=0;g<S.length;g++)S[g].onfocus=v;d=e.onkeydown,e.onkeydown=n,x.onblur=u,B.onblur=u,x.disabled=!1,B.disabled=!1,e.onfocus=function(){e.setTimeout(function(){void 0!==f&&(f.focus(),f=void 0)},0)}}function o(n){var o=b();o.style.width=n.width+"px",o.style.padding=n.padding+"px",o.style.marginLeft=-n.width/2+"px";var a=t.getElementsByTagName("head")[0],r=t.createElement("style");r.type="text/css",r.id=g,r.innerHTML="@media screen and (max-width: "+n.width+"px) {.sweet-alert {max-width: 100%;left: 0 !important;margin-left: 0 !important;}}",a.appendChild(r);var l=o.querySelector("h2"),i=o.querySelector("p"),c=o.querySelector("button.cancel"),s=o.querySelector("button.confirm");if(l.innerHTML=B(n.title).split("\n").join("<br>"),i.innerHTML=B(n.text.split("\n").join("<br>"))||n.html,i.innerHTML&&E(i),n.customClass&&k(o,n.customClass),q(o.querySelectorAll(".icon")),n.type){for(var u=!1,m=0;m<v.length;m++)if(n.type===v[m]){u=!0;break}if(!u)return e.console.error("Unknown alert type: "+n.type),!1;var d=o.querySelector(".icon."+n.type);switch(E(d),n.type){case"success":k(d,"animate"),k(d.querySelector(".tip"),"animate-success-tip"),k(d.querySelector(".long"),"animate-success-long");break;case"error":k(d,"animate-error-icon"),k(d.querySelector(".x-mark"),"animate-x-mark");break;case"warning":k(d,"pulse-warning"),k(d.querySelector(".body"),"pulse-warning-ins"),k(d.querySelector(".dot"),"pulse-warning-ins")}}if(n.imageUrl){var f=o.querySelector(".icon.custom");if(f.style.backgroundImage="url("+n.imageUrl+")",E(f),n.imageSize){var p=n.imageSize.match(/(\d+)x(\d+)/);p?f.setAttribute("style",f.getAttribute("style")+"width:"+p[1]+"px; height:"+p[2]+"px"):e.console.error("Parameter imageSize expects value with format WIDTHxHEIGHT, got "+n.imageSize)}}o.setAttribute("data-has-cancel-button",n.showCancelButton),n.showCancelButton?c.style.display="inline-block":q(c),n.showConfirmButton?s.style.display="inline-block":q(s),n.cancelButtonText&&(c.innerHTML=B(n.cancelButtonText)),n.confirmButtonText&&(s.innerHTML=B(n.confirmButtonText)),s.style.backgroundColor=n.confirmButtonColor,c.style.backgroundColor=n.cancelButtonColor,n.animation===!0?x(o,"no-animation"):k(o,"no-animation")}function a(e,t){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;for(var n="#",o=0;3>o;o++){var a=parseInt(e.substr(2*o,2),16);a=Math.round(Math.min(Math.max(0,a+a*t),255)).toString(16),n+=("00"+a).substr(a.length)}return n}function r(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function l(e){e.focus()}function i(){var e=b();I(h(),10),E(e),k(e,"show-sweet-alert"),x(e,"hide-sweet-alert"),u=t.activeElement,setTimeout(function(){k(e,"visible")},500)}function c(){var n=b();M(h(),5),M(n,5),x(n,"showSweetAlert"),k(n,"hideSweetAlert"),x(n,"visible");var o=n.querySelector(".icon.success");x(o,"animate"),x(o.querySelector(".tip"),"animate-success-tip"),x(o.querySelector(".long"),"animate-success-long");var a=n.querySelector(".icon.error");x(a,"animate-error-icon"),x(a.querySelector(".x-mark"),"animate-x-mark");var r=n.querySelector(".icon.warning");x(r,"pulse-warning"),x(r.querySelector(".body"),"pulse-warning-ins"),x(r.querySelector(".dot"),"pulse-warning-ins"),e.onkeydown=d,t.onclick=m,u&&u.focus(),f=void 0,clearTimeout(n.timeout);var l=t.getElementsByTagName("head")[0],i=t.getElementById(g);l.removeChild(i)}function s(){var e=b();e.style.marginTop=O(b())}var u,m,d,f,p=".sweet-alert",y=".sweet-overlay",g="sweet-alert-mediaquery",v=["error","warning","info","success"],w={title:"",text:"",html:"",type:null,animation:!0,allowOutsideClick:!0,allowEscapeKey:!0,showConfirmButton:!0,showCancelButton:!1,closeOnConfirm:!0,closeOnCancel:!0,confirmButtonText:"OK",confirmButtonColor:"#3085d6",cancelButtonColor:"#aaa",cancelButtonText:"Cancel",imageUrl:null,imageSize:null,timer:null,width:500,padding:20},b=function(){return t.querySelector(p)},h=function(){return t.querySelector(y)},C=function(e,t){return new RegExp(" "+t+" ").test(" "+e.className+" ")},k=function(e,t){C(e,t)||(e.className+=" "+t)},x=function(e,t){var n=" "+e.className.replace(/[\t\r\n]/g," ")+" ";if(C(e,t)){for(;n.indexOf(" "+t+" ")>=0;)n=n.replace(" "+t+" "," ");e.className=n.replace(/^\s+|\s+$/g,"")}},B=function(e){var n=t.createElement("div");return n.appendChild(t.createTextNode(e)),n.innerHTML},S=function(e){e.style.opacity="",e.style.display="block"},E=function(e){if(e&&!e.length)return S(e);for(var t=0;t<e.length;++t)S(e[t])},T=function(e){e.style.opacity="",e.style.display="none"},q=function(e){if(e&&!e.length)return T(e);for(var t=0;t<e.length;++t)T(e[t])},O=function(e){e.style.left="-9999px",e.style.display="block";var t,n=e.clientHeight;return t="undefined"!=typeof getComputedStyle?parseInt(getComputedStyle(e).getPropertyValue("padding"),10):parseInt(e.currentStyle.padding),e.style.left="",e.style.display="none","-"+parseInt(n/2+t)+"px"},I=function(e,t){if(+e.style.opacity<1){t=t||16,e.style.opacity=0,e.style.display="block";var n=+new Date,o=function(){e.style.opacity=+e.style.opacity+(new Date-n)/100,n=+new Date,+e.style.opacity<1&&setTimeout(o,t)};o()}e.style.display="block"},M=function(e,t){t=t||16,e.style.opacity=1;var n=+new Date,o=function(){e.style.opacity=+e.style.opacity-(new Date-n)/100,n=+new Date,+e.style.opacity>0?setTimeout(o,t):e.style.display="none"};o()},A=function(n){if(MouseEvent){var o=new MouseEvent("click",{view:e,bubbles:!1,cancelable:!0});n.dispatchEvent(o)}else if(t.createEvent){var a=t.createEvent("MouseEvents");a.initEvent("click",!1,!1),n.dispatchEvent(a)}else t.createEventObject?n.fireEvent("onclick"):"function"==typeof n.onclick&&n.onclick()},L=function(t){"function"==typeof t.stopPropagation?(t.stopPropagation(),t.preventDefault()):e.event&&e.event.hasOwnProperty("cancelBubble")&&(e.event.cancelBubble=!0)};e.sweetAlertInitialize=function(){var e='<div class="sweet-overlay" tabIndex="-1"></div><div class="sweet-alert" tabIndex="-1"><div class="icon error"><span class="x-mark"><span class="line left"></span><span class="line right"></span></span></div><div class="icon warning"> <span class="body"></span> <span class="dot"></span> </div> <div class="icon info"></div> <div class="icon success"> <span class="line tip"></span> <span class="line long"></span> <div class="placeholder"></div> <div class="fix"></div> </div> <div class="icon custom"></div> <h2>Title</h2><p>Text</p><button class="confirm">OK</button><button class="cancel">Cancel</button></div>',n=t.createElement("div");n.innerHTML=e,t.body.appendChild(n)},e.sweetAlert=e.swal=function(){var e=arguments;if(null!==b())n.apply(this,e);else var t=setInterval(function(){null!==b()&&(clearInterval(t),n.apply(this,e))},100)},e.sweetAlert.closeModal=e.swal.closeModal=function(){c()},e.swal.setDefaults=function(e){if(!e)throw new Error("userParams is required");if("object"!=typeof e)throw new Error("userParams has to be a object");r(w,e)},function(){"complete"===t.readyState||"interactive"===t.readyState&&t.body?e.sweetAlertInitialize():t.addEventListener?t.addEventListener("DOMContentLoaded",function n(){t.removeEventListener("DOMContentLoaded",n,!1),e.sweetAlertInitialize()},!1):t.attachEvent&&t.attachEvent("onreadystatechange",function o(){"complete"===t.readyState&&(t.detachEvent("onreadystatechange",o),e.sweetAlertInitialize())})}()}(window,document);
@@ -0,0 +1,534 @@
1
+ .sweet-overlay {
2
+ background-color: rgba(0, 0, 0, 0.4);
3
+ position: fixed;
4
+ left: 0;
5
+ right: 0;
6
+ top: 0;
7
+ bottom: 0;
8
+ display: none;
9
+ z-index: 1000; }
10
+
11
+ .sweet-alert {
12
+ background-color: #fff;
13
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
14
+ border-radius: 5px;
15
+ box-sizing: border-box;
16
+ text-align: center;
17
+ position: fixed;
18
+ left: 50%;
19
+ top: 50%;
20
+ margin-top: -200px;
21
+ overflow: hidden;
22
+ display: none;
23
+ z-index: 2000; }
24
+ .sweet-alert h2 {
25
+ color: #575757;
26
+ font-size: 30px;
27
+ text-align: center;
28
+ font-weight: 600;
29
+ text-transform: none;
30
+ position: relative;
31
+ margin: 0;
32
+ padding: 0;
33
+ line-height: 60px;
34
+ display: block; }
35
+ .sweet-alert p {
36
+ font-size: 16px;
37
+ text-align: center;
38
+ font-weight: 300;
39
+ position: relative;
40
+ float: none;
41
+ margin: 0;
42
+ padding: 0;
43
+ line-height: normal; }
44
+ .sweet-alert button {
45
+ color: #fff;
46
+ border: 0;
47
+ box-shadow: none;
48
+ font-size: 17px;
49
+ font-weight: 500;
50
+ border-radius: 5px;
51
+ padding: 10px 32px;
52
+ margin: 26px 5px 0;
53
+ cursor: pointer; }
54
+ .sweet-alert button:focus {
55
+ outline: none; }
56
+ .sweet-alert button[disabled] {
57
+ opacity: 0.4; }
58
+ .sweet-alert button::-moz-focus-inner {
59
+ border: 0; }
60
+ .sweet-alert[data-has-cancel-button=false] button {
61
+ box-shadow: none !important; }
62
+ .sweet-alert .icon {
63
+ width: 80px;
64
+ height: 80px;
65
+ border: 4px solid #808080;
66
+ border-radius: 50%;
67
+ margin: 20px auto;
68
+ padding: 0;
69
+ position: relative;
70
+ box-sizing: content-box; }
71
+ .sweet-alert .icon.error {
72
+ border-color: #f27474; }
73
+ .sweet-alert .icon.error .x-mark {
74
+ position: relative;
75
+ display: block; }
76
+ .sweet-alert .icon.error .line {
77
+ position: absolute;
78
+ height: 5px;
79
+ width: 47px;
80
+ background-color: #f27474;
81
+ display: block;
82
+ top: 37px;
83
+ border-radius: 2px; }
84
+ .sweet-alert .icon.error .line.left {
85
+ -webkit-transform: rotate(45deg);
86
+ -ms-transform: rotate(45deg);
87
+ transform: rotate(45deg);
88
+ left: 17px; }
89
+ .sweet-alert .icon.error .line.right {
90
+ -webkit-transform: rotate(-45deg);
91
+ -ms-transform: rotate(-45deg);
92
+ transform: rotate(-45deg);
93
+ right: 16px; }
94
+ .sweet-alert .icon.warning {
95
+ border-color: #f8bb86; }
96
+ .sweet-alert .icon.warning .body {
97
+ position: absolute;
98
+ width: 5px;
99
+ height: 47px;
100
+ left: 50%;
101
+ top: 10px;
102
+ border-radius: 2px;
103
+ margin-left: -2px;
104
+ background-color: #f8bb86; }
105
+ .sweet-alert .icon.warning .dot {
106
+ position: absolute;
107
+ width: 7px;
108
+ height: 7px;
109
+ border-radius: 50%;
110
+ margin-left: -3px;
111
+ left: 50%;
112
+ bottom: 10px;
113
+ background-color: #f8bb86; }
114
+ .sweet-alert .icon.info {
115
+ border-color: #c9dae1; }
116
+ .sweet-alert .icon.info::before {
117
+ content: '';
118
+ position: absolute;
119
+ width: 5px;
120
+ height: 29px;
121
+ left: 50%;
122
+ bottom: 17px;
123
+ border-radius: 2px;
124
+ margin-left: -2px;
125
+ background-color: #c9dae1; }
126
+ .sweet-alert .icon.info::after {
127
+ content: '';
128
+ position: absolute;
129
+ width: 7px;
130
+ height: 7px;
131
+ border-radius: 50%;
132
+ margin-left: -3px;
133
+ top: 19px;
134
+ background-color: #c9dae1; }
135
+ .sweet-alert .icon.success {
136
+ border-color: #a5dc86; }
137
+ .sweet-alert .icon.success::before, .sweet-alert .icon.success::after {
138
+ content: '';
139
+ border-radius: 50%;
140
+ position: absolute;
141
+ width: 60px;
142
+ height: 120px;
143
+ background: #fff;
144
+ -webkit-transform: rotate(45deg);
145
+ -ms-transform: rotate(45deg);
146
+ transform: rotate(45deg); }
147
+ .sweet-alert .icon.success::before {
148
+ border-radius: 120px 0 0 120px;
149
+ top: -7px;
150
+ left: -33px;
151
+ -webkit-transform: rotate(-45deg);
152
+ -ms-transform: rotate(-45deg);
153
+ transform: rotate(-45deg);
154
+ -webkit-transform-origin: 60px 60px;
155
+ -ms-transform-origin: 60px 60px;
156
+ transform-origin: 60px 60px; }
157
+ .sweet-alert .icon.success::after {
158
+ border-radius: 0 120px 120px 0;
159
+ top: -11px;
160
+ left: 30px;
161
+ -webkit-transform: rotate(-45deg);
162
+ -ms-transform: rotate(-45deg);
163
+ transform: rotate(-45deg);
164
+ -webkit-transform-origin: 0 60px;
165
+ -ms-transform-origin: 0 60px;
166
+ transform-origin: 0 60px; }
167
+ .sweet-alert .icon.success .placeholder {
168
+ width: 80px;
169
+ height: 80px;
170
+ border: 4px solid rgba(165, 220, 134, 0.2);
171
+ border-radius: 50%;
172
+ box-sizing: content-box;
173
+ position: absolute;
174
+ left: -4px;
175
+ top: -4px;
176
+ z-index: 2; }
177
+ .sweet-alert .icon.success .fix {
178
+ width: 5px;
179
+ height: 90px;
180
+ background-color: #fff;
181
+ position: absolute;
182
+ left: 28px;
183
+ top: 8px;
184
+ z-index: 1;
185
+ -webkit-transform: rotate(-45deg);
186
+ -ms-transform: rotate(-45deg);
187
+ transform: rotate(-45deg); }
188
+ .sweet-alert .icon.success .line {
189
+ height: 5px;
190
+ background-color: #a5dc86;
191
+ display: block;
192
+ border-radius: 2px;
193
+ position: absolute;
194
+ z-index: 2; }
195
+ .sweet-alert .icon.success .line.tip {
196
+ width: 25px;
197
+ left: 14px;
198
+ top: 46px;
199
+ -webkit-transform: rotate(45deg);
200
+ -ms-transform: rotate(45deg);
201
+ transform: rotate(45deg); }
202
+ .sweet-alert .icon.success .line.long {
203
+ width: 47px;
204
+ right: 8px;
205
+ top: 38px;
206
+ -webkit-transform: rotate(-45deg);
207
+ -ms-transform: rotate(-45deg);
208
+ transform: rotate(-45deg); }
209
+ .sweet-alert .icon.custom {
210
+ background-size: contain;
211
+ border-radius: 0;
212
+ border: 0;
213
+ background-position: center center;
214
+ background-repeat: no-repeat; }
215
+
216
+ @-webkit-keyframes showSweetAlert {
217
+ 0% {
218
+ -webkit-transform: scale(0.7);
219
+ transform: scale(0.7); }
220
+
221
+ 45% {
222
+ -webkit-transform: scale(1.05);
223
+ transform: scale(1.05); }
224
+
225
+ 80% {
226
+ -webkit-transform: scale(0.95);
227
+ transform: scale(0.95); }
228
+
229
+ 100% {
230
+ -webkit-transform: scale(1);
231
+ transform: scale(1); } }
232
+
233
+ @keyframes showSweetAlert {
234
+ 0% {
235
+ -webkit-transform: scale(0.7);
236
+ transform: scale(0.7); }
237
+
238
+ 45% {
239
+ -webkit-transform: scale(1.05);
240
+ transform: scale(1.05); }
241
+
242
+ 80% {
243
+ -webkit-transform: scale(0.95);
244
+ transform: scale(0.95); }
245
+
246
+ 100% {
247
+ -webkit-transform: scale(1);
248
+ transform: scale(1); } }
249
+
250
+ @-webkit-keyframes hideSweetAlert {
251
+ 0% {
252
+ -webkit-transform: scale(1);
253
+ transform: scale(1); }
254
+
255
+ 100% {
256
+ -webkit-transform: scale(0.5);
257
+ transform: scale(0.5); } }
258
+
259
+ @keyframes hideSweetAlert {
260
+ 0% {
261
+ -webkit-transform: scale(1);
262
+ transform: scale(1); }
263
+
264
+ 100% {
265
+ -webkit-transform: scale(0.5);
266
+ transform: scale(0.5); } }
267
+
268
+ .show-sweet-alert {
269
+ -webkit-animation: showSweetAlert 0.3s;
270
+ animation: showSweetAlert 0.3s; }
271
+ .show-sweet-alert.no-animation {
272
+ -webkit-animation: none;
273
+ animation: none; }
274
+
275
+ .hide-sweet-alert {
276
+ -webkit-animation: hideSweetAlert 0.2s;
277
+ animation: hideSweetAlert 0.2s; }
278
+ .hide-sweet-alert.no-animation {
279
+ -webkit-animation: none;
280
+ animation: none; }
281
+
282
+ @-webkit-keyframes animate-success-tip {
283
+ 0% {
284
+ width: 0;
285
+ left: 1px;
286
+ top: 19px; }
287
+
288
+ 54% {
289
+ width: 0;
290
+ left: 1px;
291
+ top: 19px; }
292
+
293
+ 70% {
294
+ width: 50px;
295
+ left: -8px;
296
+ top: 37px; }
297
+
298
+ 84% {
299
+ width: 17px;
300
+ left: 21px;
301
+ top: 48px; }
302
+
303
+ 100% {
304
+ width: 25px;
305
+ left: 14px;
306
+ top: 45px; } }
307
+
308
+ @keyframes animate-success-tip {
309
+ 0% {
310
+ width: 0;
311
+ left: 1px;
312
+ top: 19px; }
313
+
314
+ 54% {
315
+ width: 0;
316
+ left: 1px;
317
+ top: 19px; }
318
+
319
+ 70% {
320
+ width: 50px;
321
+ left: -8px;
322
+ top: 37px; }
323
+
324
+ 84% {
325
+ width: 17px;
326
+ left: 21px;
327
+ top: 48px; }
328
+
329
+ 100% {
330
+ width: 25px;
331
+ left: 14px;
332
+ top: 45px; } }
333
+
334
+ @-webkit-keyframes animate-success-long {
335
+ 0% {
336
+ width: 0;
337
+ right: 46px;
338
+ top: 54px; }
339
+
340
+ 65% {
341
+ width: 0;
342
+ right: 46px;
343
+ top: 54px; }
344
+
345
+ 84% {
346
+ width: 55px;
347
+ right: 0;
348
+ top: 35px; }
349
+
350
+ 100% {
351
+ width: 47px;
352
+ right: 8px;
353
+ top: 38px; } }
354
+
355
+ @keyframes animate-success-long {
356
+ 0% {
357
+ width: 0;
358
+ right: 46px;
359
+ top: 54px; }
360
+
361
+ 65% {
362
+ width: 0;
363
+ right: 46px;
364
+ top: 54px; }
365
+
366
+ 84% {
367
+ width: 55px;
368
+ right: 0;
369
+ top: 35px; }
370
+
371
+ 100% {
372
+ width: 47px;
373
+ right: 8px;
374
+ top: 38px; } }
375
+
376
+ @-webkit-keyframes rotatePlaceholder {
377
+ 0% {
378
+ -webkit-transform: rotate(-45deg);
379
+ transform: rotate(-45deg); }
380
+
381
+ 5% {
382
+ -webkit-transform: rotate(-45deg);
383
+ transform: rotate(-45deg); }
384
+
385
+ 12% {
386
+ -webkit-transform: rotate(-405deg);
387
+ transform: rotate(-405deg); }
388
+
389
+ 100% {
390
+ -webkit-transform: rotate(-405deg);
391
+ transform: rotate(-405deg); } }
392
+
393
+ @keyframes rotatePlaceholder {
394
+ 0% {
395
+ -webkit-transform: rotate(-45deg);
396
+ transform: rotate(-45deg); }
397
+
398
+ 5% {
399
+ -webkit-transform: rotate(-45deg);
400
+ transform: rotate(-45deg); }
401
+
402
+ 12% {
403
+ -webkit-transform: rotate(-405deg);
404
+ transform: rotate(-405deg); }
405
+
406
+ 100% {
407
+ -webkit-transform: rotate(-405deg);
408
+ transform: rotate(-405deg); } }
409
+
410
+ .animate-success-tip {
411
+ -webkit-animation: animate-success-tip 0.75s;
412
+ animation: animate-success-tip 0.75s; }
413
+
414
+ .animate-success-long {
415
+ -webkit-animation: animate-success-long 0.75s;
416
+ animation: animate-success-long 0.75s; }
417
+
418
+ .icon.success.animate::after {
419
+ -webkit-animation: rotatePlaceholder 4.25s ease-in;
420
+ animation: rotatePlaceholder 4.25s ease-in; }
421
+
422
+ @-webkit-keyframes animate-error-icon {
423
+ 0% {
424
+ -webkit-transform: rotateX(100deg);
425
+ transform: rotateX(100deg);
426
+ opacity: 0; }
427
+
428
+ 100% {
429
+ -webkit-transform: rotateX(0deg);
430
+ transform: rotateX(0deg);
431
+ opacity: 1; } }
432
+
433
+ @keyframes animate-error-icon {
434
+ 0% {
435
+ -webkit-transform: rotateX(100deg);
436
+ transform: rotateX(100deg);
437
+ opacity: 0; }
438
+
439
+ 100% {
440
+ -webkit-transform: rotateX(0deg);
441
+ transform: rotateX(0deg);
442
+ opacity: 1; } }
443
+
444
+ .animate-error-icon {
445
+ -webkit-animation: animate-error-icon 0.5s;
446
+ animation: animate-error-icon 0.5s; }
447
+
448
+ @-webkit-keyframes animate-x-mark {
449
+ 0% {
450
+ -webkit-transform: scale(0.4);
451
+ transform: scale(0.4);
452
+ margin-top: 26px;
453
+ opacity: 0; }
454
+
455
+ 50% {
456
+ -webkit-transform: scale(0.4);
457
+ transform: scale(0.4);
458
+ margin-top: 26px;
459
+ opacity: 0; }
460
+
461
+ 80% {
462
+ -webkit-transform: scale(1.15);
463
+ transform: scale(1.15);
464
+ margin-top: -6px; }
465
+
466
+ 100% {
467
+ -webkit-transform: scale(1);
468
+ transform: scale(1);
469
+ margin-top: 0;
470
+ opacity: 1; } }
471
+
472
+ @keyframes animate-x-mark {
473
+ 0% {
474
+ -webkit-transform: scale(0.4);
475
+ transform: scale(0.4);
476
+ margin-top: 26px;
477
+ opacity: 0; }
478
+
479
+ 50% {
480
+ -webkit-transform: scale(0.4);
481
+ transform: scale(0.4);
482
+ margin-top: 26px;
483
+ opacity: 0; }
484
+
485
+ 80% {
486
+ -webkit-transform: scale(1.15);
487
+ transform: scale(1.15);
488
+ margin-top: -6px; }
489
+
490
+ 100% {
491
+ -webkit-transform: scale(1);
492
+ transform: scale(1);
493
+ margin-top: 0;
494
+ opacity: 1; } }
495
+
496
+ .animate-x-mark {
497
+ -webkit-animation: animate-x-mark 0.5s;
498
+ animation: animate-x-mark 0.5s; }
499
+
500
+ @-webkit-keyframes pulse-warning {
501
+ 0% {
502
+ border-color: #f8d486; }
503
+
504
+ 100% {
505
+ border-color: #f8bb86; } }
506
+
507
+ @keyframes pulse-warning {
508
+ 0% {
509
+ border-color: #f8d486; }
510
+
511
+ 100% {
512
+ border-color: #f8bb86; } }
513
+
514
+ .pulse-warning {
515
+ -webkit-animation: pulse-warning 0.75s infinite alternate;
516
+ animation: pulse-warning 0.75s infinite alternate; }
517
+
518
+ @-webkit-keyframes pulse-warning-ins {
519
+ 0% {
520
+ background-color: #f8d486; }
521
+
522
+ 100% {
523
+ background-color: #f8bb86; } }
524
+
525
+ @keyframes pulse-warning-ins {
526
+ 0% {
527
+ background-color: #f8d486; }
528
+
529
+ 100% {
530
+ background-color: #f8bb86; } }
531
+
532
+ .pulse-warning-ins {
533
+ -webkit-animation: pulse-warning-ins 0.75s infinite alternate;
534
+ animation: pulse-warning-ins 0.75s infinite alternate; }
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sweetalert2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Kyle Montag
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.5'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
56
+ email:
57
+ - thekylemontag@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/sweetalert2.rb
68
+ - lib/sweetalert2/engine.rb
69
+ - lib/sweetalert2/version.rb
70
+ - sweetalert2.gemspec
71
+ - vendor/assets/javascripts/sweetalert2.min.js
72
+ - vendor/assets/stylesheets/sweetalert2.css
73
+ homepage: http://www.thekylemontag.com
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.2.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: SweetAlert 2 for Rails projects
97
+ test_files: []