sweetalert-rails 0.3.3 → 0.4.0

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: 9eae9dda8255f329d6152eba9e59264382448519
4
- data.tar.gz: a726a216d9413c2005986b100e51b06c7a2342e8
3
+ metadata.gz: 362b640331014d286a6603db2e48dd50651ea6b6
4
+ data.tar.gz: c087c7c72fdef39b9d26f7700aef3074866b0e03
5
5
  SHA512:
6
- metadata.gz: 0687bae44c3b5e10435cc79a815e500f74d6b9f0a81244621a0280013fddfeaa33e8ebed27ea6ef4dd2a222a8bd65e9de14ee5d11460f1ddd561ba50a9e75153
7
- data.tar.gz: 5d2b45c9ea4ee22bd345a842822f76d3ef39a0415b8860517dda9950c4fe235435cc1be5cc109143866d2900af3830335a20e4306d2258db54f58944885dd6a6
6
+ metadata.gz: fb16b284129c82c97162d2a145bead79d3cb3965ed44cb0f13cf6b01cf1ba4d692aa4304a54543707beca0b61fcb07626712f1e1fff804dec5ead0e918cebb87
7
+ data.tar.gz: 0550f808081e336889335fab36dce0497cbefb532dcb08dfb29c48c3642c4f9d5fd14c06bac04b50a7a48ef8bb7658c9e648efb421ab7d11240f44c47595d1ad
@@ -1,3 +1,3 @@
1
1
  module SweetAlert
2
- VERSION = "0.3.3"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  // SweetAlert
2
2
  // 2014 (c) - Tristan Edwards
3
3
  // github.com/t4t5/sweetalert
4
- ;(function(window, document) {
4
+ ;(function(window, document, undefined) {
5
5
 
6
6
  var modalClass = '.sweet-alert',
7
7
  overlayClass = '.sweet-overlay',
@@ -19,7 +19,11 @@
19
19
  cancelButtonText: 'Cancel',
20
20
  imageUrl: null,
21
21
  imageSize: null,
22
- timer: null
22
+ timer: null,
23
+ customClass: '',
24
+ html: false,
25
+ animation: true,
26
+ allowEscapeKey: true
23
27
  };
24
28
 
25
29
 
@@ -97,7 +101,7 @@
97
101
  padding;
98
102
  if (typeof getComputedStyle !== "undefined") { /* IE 8 */
99
103
  padding = parseInt(getComputedStyle(elem).getPropertyValue('padding'), 10);
100
- } else{
104
+ } else {
101
105
  padding = parseInt(elem.currentStyle.padding);
102
106
  }
103
107
 
@@ -177,6 +181,7 @@
177
181
  previousWindowKeyDown,
178
182
  lastFocusedButton;
179
183
 
184
+
180
185
  /*
181
186
  * Add modal + overlay to DOM
182
187
  */
@@ -187,10 +192,13 @@
187
192
 
188
193
  sweetWrap.innerHTML = sweetHTML;
189
194
 
190
- // For readability: check sweet-alert.html
191
- document.body.appendChild(sweetWrap);
195
+ // Append elements to body
196
+ while(sweetWrap.firstChild) {
197
+ document.body.appendChild(sweetWrap.firstChild);
198
+ }
192
199
  };
193
200
 
201
+
194
202
  /*
195
203
  * Global sweetAlert function
196
204
  */
@@ -199,23 +207,42 @@
199
207
  // Copy arguments to the local args variable
200
208
  var args = arguments;
201
209
  if (getModal() !== null) {
202
- // If getModal returns values then continue
203
- modalDependant.apply(this, args);
210
+ // If getModal returns values then continue
211
+ modalDependant.apply(this, args);
204
212
  } else {
205
- // If getModal returns null i.e. no matches, then set up a interval event to check the return value until it is not null
206
- var modalCheckInterval = setInterval(function() {
207
- if (getModal() !== null) {
208
- clearInterval(modalCheckInterval);
209
- modalDependant.apply(this, args);
210
- }
213
+ // If getModal returns null i.e. no matches, then set up a interval event to check the return value until it is not null
214
+ var modalCheckInterval = setInterval(function() {
215
+ if (getModal() !== null) {
216
+ clearInterval(modalCheckInterval);
217
+ modalDependant.apply(this, args);
218
+ }
211
219
  }, 100);
212
220
  }
213
221
  };
214
222
 
215
223
  function modalDependant() {
216
224
 
225
+ var customizations = arguments[0];
226
+
227
+ /*
228
+ * Use argument if defined or default value from params object otherwise.
229
+ * Supports the case where a default value is boolean true and should be
230
+ * overridden by a corresponding explicit argument which is boolean false.
231
+ */
232
+ function argumentOrDefault(key) {
233
+ var args = customizations;
234
+
235
+ if (typeof args[key] !== 'undefined') {
236
+ console.log(key + " is " + args[key]);
237
+ return args[key];
238
+ } else {
239
+ console.log(key + " is " + defaultParams[key]);
240
+ return defaultParams[key];
241
+ }
242
+ }
243
+
217
244
  if (arguments[0] === undefined) {
218
- window.console.error('sweetAlert expects at least 1 attribute!');
245
+ window.console.error('SweetAlert expects at least 1 attribute!');
219
246
  return false;
220
247
  }
221
248
 
@@ -223,6 +250,7 @@
223
250
 
224
251
  switch (typeof arguments[0]) {
225
252
 
253
+ // Ex: swal("Hello", "Just testing", "info");
226
254
  case 'string':
227
255
  params.title = arguments[0];
228
256
  params.text = arguments[1] || '';
@@ -230,31 +258,43 @@
230
258
 
231
259
  break;
232
260
 
261
+ // Ex: swal({title:"Hello", text: "Just testing", type: "info"});
233
262
  case 'object':
234
263
  if (arguments[0].title === undefined) {
235
264
  window.console.error('Missing "title" argument!');
236
265
  return false;
237
266
  }
238
267
 
239
- params.title = arguments[0].title;
240
- params.text = arguments[0].text || defaultParams.text;
241
- params.type = arguments[0].type || defaultParams.type;
242
- params.customClass = arguments[0].customClass || params.customClass;
243
- params.allowOutsideClick = arguments[0].allowOutsideClick || defaultParams.allowOutsideClick;
244
- params.showCancelButton = arguments[0].showCancelButton !== undefined ? arguments[0].showCancelButton : defaultParams.showCancelButton;
245
- params.closeOnConfirm = arguments[0].closeOnConfirm !== undefined ? arguments[0].closeOnConfirm : defaultParams.closeOnConfirm;
246
- params.closeOnCancel = arguments[0].closeOnCancel !== undefined ? arguments[0].closeOnCancel : defaultParams.closeOnCancel;
247
- params.timer = arguments[0].timer || defaultParams.timer;
268
+ params.title = arguments[0].title;
269
+
270
+ var availableCustoms = [
271
+ 'text',
272
+ 'type',
273
+ 'customClass',
274
+ 'allowOutsideClick',
275
+ 'showCancelButton',
276
+ 'closeOnConfirm',
277
+ 'closeOnCancel',
278
+ 'timer',
279
+ 'confirmButtonColor',
280
+ 'cancelButtonText',
281
+ 'imageUrl',
282
+ 'imageSize',
283
+ 'html',
284
+ 'animation',
285
+ 'allowEscapeKey'];
286
+
287
+ availableCustoms.forEach(function(customName) {
288
+ params[customName] = argumentOrDefault(customName);
289
+ });
248
290
 
249
291
  // Show "Confirm" instead of "OK" if cancel button is visible
250
- params.confirmButtonText = (defaultParams.showCancelButton) ? 'Confirm' : defaultParams.confirmButtonText;
251
- params.confirmButtonText = arguments[0].confirmButtonText || defaultParams.confirmButtonText;
252
- params.confirmButtonColor = arguments[0].confirmButtonColor || defaultParams.confirmButtonColor;
253
- params.cancelButtonText = arguments[0].cancelButtonText || defaultParams.cancelButtonText;
254
- params.imageUrl = arguments[0].imageUrl || defaultParams.imageUrl;
255
- params.imageSize = arguments[0].imageSize || defaultParams.imageSize;
256
- params.doneFunction = arguments[1] || null;
292
+ params.confirmButtonText = (params.showCancelButton) ? 'Confirm' : defaultParams.confirmButtonText;
293
+ params.confirmButtonText = argumentOrDefault('confirmButtonText');
257
294
 
295
+ // Function to call when clicking on cancel/OK
296
+ params.doneFunction = arguments[1] || null;
297
+
258
298
  break;
259
299
 
260
300
  default:
@@ -275,7 +315,7 @@
275
315
  var onButtonEvent = function(event) {
276
316
  var e = event || window.event;
277
317
  var target = e.target || e.srcElement,
278
- targetedConfirm = (target.className === 'confirm'),
318
+ targetedConfirm = (target.className.indexOf("confirm") !== -1),
279
319
  modalIsVisible = hasClass(modal, 'visible'),
280
320
  doneFunctionExists = (params.doneFunction && modal.getAttribute('data-has-done-function') === 'true');
281
321
 
@@ -316,7 +356,7 @@
316
356
  params.doneFunction(true);
317
357
 
318
358
  if (params.closeOnConfirm) {
319
- closeModal();
359
+ window.sweetAlert.close();
320
360
  }
321
361
  } else if (doneFunctionExists && modalIsVisible) { // Clicked "cancel"
322
362
 
@@ -329,10 +369,10 @@
329
369
  }
330
370
 
331
371
  if (params.closeOnCancel) {
332
- closeModal();
372
+ window.sweetAlert.close();
333
373
  }
334
374
  } else {
335
- closeModal();
375
+ window.sweetAlert.close();
336
376
  }
337
377
 
338
378
  break;
@@ -361,7 +401,7 @@
361
401
  outsideClickIsAllowed = modal.getAttribute('data-allow-ouside-click') === 'true';
362
402
 
363
403
  if (!clickedOnModal && !clickedOnModalChild && modalIsVisible && outsideClickIsAllowed) {
364
- closeModal();
404
+ window.sweetAlert.close();
365
405
  }
366
406
  };
367
407
 
@@ -418,8 +458,7 @@
418
458
  // Do nothing - let the browser handle it.
419
459
  $targetElement = undefined;
420
460
  }
421
- } else if (keyCode === 27 && !($cancelButton.hidden || $cancelButton.style.display === 'none')) {
422
- // ESC to cancel only if there's a cancel button displayed (like the alert() window).
461
+ } else if (keyCode === 27 && params.allowEscapeKey === true) {
423
462
  $targetElement = $cancelButton;
424
463
  } else {
425
464
  // Fallback - let the browser handle it.
@@ -433,6 +472,7 @@
433
472
  }
434
473
 
435
474
  previousWindowKeyDown = window.onkeydown;
475
+
436
476
  window.onkeydown = handleKeyDown;
437
477
 
438
478
  function handleOnBlur(event) {
@@ -480,11 +520,12 @@
480
520
  };
481
521
  }
482
522
 
483
- /**
523
+
524
+ /*
484
525
  * Set default params for each popup
485
526
  * @param {Object} userParams
486
527
  */
487
- window.swal.setDefaults = function(userParams) {
528
+ window.sweetAlert.setDefaults = window.swal.setDefaults = function(userParams) {
488
529
  if (!userParams) {
489
530
  throw new Error('userParams is required');
490
531
  }
@@ -495,6 +536,7 @@
495
536
  extend(defaultParams, userParams);
496
537
  };
497
538
 
539
+
498
540
  /*
499
541
  * Set type, text and actions on modal
500
542
  */
@@ -508,10 +550,11 @@
508
550
  $confirmBtn = modal.querySelector('button.confirm');
509
551
 
510
552
  // Title
511
- $title.innerHTML = escapeHtml(params.title).split("\n").join("<br>");
553
+ $title.innerHTML = (params.html) ? params.title : escapeHtml(params.title).split("\n").join("<br>");
512
554
 
513
555
  // Text
514
- $text.innerHTML = escapeHtml(params.text || '').split("\n").join("<br>");
556
+ $text.innerHTML = (params.html) ? params.text : escapeHtml(params.text || '').split("\n").join("<br>");
557
+
515
558
  if (params.text) {
516
559
  show($text);
517
560
  }
@@ -519,6 +562,12 @@
519
562
  //Custom Class
520
563
  if (params.customClass) {
521
564
  addClass(modal, params.customClass);
565
+ modal.setAttribute('data-custom-class', params.customClass);
566
+ } else {
567
+ // Find previously set classes and remove them
568
+ var customClass = modal.getAttribute('data-custom-class');
569
+ removeClass(modal, customClass);
570
+ modal.setAttribute('data-custom-class', "");
522
571
  }
523
572
 
524
573
  // Icon
@@ -616,6 +665,13 @@
616
665
  var hasDoneFunction = (params.doneFunction) ? true : false;
617
666
  modal.setAttribute('data-has-done-function', hasDoneFunction);
618
667
 
668
+ // Prevent modal from animating
669
+ if (!params.animation){
670
+ modal.setAttribute('data-animation', 'none');
671
+ } else{
672
+ modal.setAttribute('data-animation', 'pop');
673
+ }
674
+
619
675
  // Close timer
620
676
  modal.setAttribute('data-timer', params.timer);
621
677
  }
@@ -690,12 +746,17 @@
690
746
 
691
747
  if (timer !== "null" && timer !== "") {
692
748
  modal.timeout = setTimeout(function() {
693
- closeModal();
749
+ window.sweetAlert.close();
694
750
  }, timer);
695
751
  }
696
752
  }
697
753
 
698
- function closeModal() {
754
+
755
+ /*
756
+ * Close sweetAlert modal programatically
757
+ */
758
+
759
+ window.sweetAlert.close = window.swal.close = function() {
699
760
  var modal = getModal();
700
761
  fadeOut(getOverlay(), 5);
701
762
  fadeOut(modal, 5);
@@ -729,7 +790,7 @@
729
790
  }
730
791
  lastFocusedButton = undefined;
731
792
  clearTimeout(modal.timeout);
732
- }
793
+ };
733
794
 
734
795
 
735
796
  /*
@@ -753,14 +814,14 @@
753
814
  window.sweetAlertInitialize();
754
815
  } else {
755
816
  if (document.addEventListener) {
756
- document.addEventListener('DOMContentLoaded', function factorial() {
757
- document.removeEventListener('DOMContentLoaded', arguments.callee, false);
817
+ document.addEventListener('DOMContentLoaded', function handler() {
818
+ document.removeEventListener('DOMContentLoaded', handler, false);
758
819
  window.sweetAlertInitialize();
759
820
  }, false);
760
821
  } else if (document.attachEvent) {
761
- document.attachEvent('onreadystatechange', function() {
822
+ document.attachEvent('onreadystatechange', function handler() {
762
823
  if (document.readyState === 'complete') {
763
- document.detachEvent('onreadystatechange', arguments.callee);
824
+ document.detachEvent('onreadystatechange', handler);
764
825
  window.sweetAlertInitialize();
765
826
  }
766
827
  });
@@ -1,4 +1,3 @@
1
- @import url(//fonts.googleapis.com/css?family=Open+Sans:400,600,700,300);
2
1
  .sweet-overlay {
3
2
  background-color: rgba(0, 0, 0, 0.4);
4
3
  position: fixed;
@@ -7,11 +6,11 @@
7
6
  top: 0;
8
7
  bottom: 0;
9
8
  display: none;
10
- z-index: 1000; }
9
+ z-index: 10000; }
11
10
 
12
11
  .sweet-alert {
13
12
  background-color: white;
14
- font-family: 'Open Sans', sans-serif;
13
+ font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
15
14
  width: 478px;
16
15
  padding: 17px;
17
16
  border-radius: 5px;
@@ -23,7 +22,7 @@
23
22
  margin-top: -200px;
24
23
  overflow: hidden;
25
24
  display: none;
26
- z-index: 2000; }
25
+ z-index: 99999; }
27
26
  @media all and (max-width: 540px) {
28
27
  .sweet-alert {
29
28
  width: auto;
@@ -234,238 +233,206 @@
234
233
  0% {
235
234
  transform: scale(0.7);
236
235
  -webkit-transform: scale(0.7); }
236
+
237
237
  45% {
238
238
  transform: scale(1.05);
239
239
  -webkit-transform: scale(1.05); }
240
+
240
241
  80% {
241
242
  transform: scale(0.95);
242
243
  -webkit-tranform: scale(0.95); }
244
+
243
245
  100% {
244
246
  transform: scale(1);
245
247
  -webkit-transform: scale(1); } }
246
- @-moz-keyframes showSweetAlert {
247
- 0% {
248
- transform: scale(0.7);
249
- -webkit-transform: scale(0.7); }
250
- 45% {
251
- transform: scale(1.05);
252
- -webkit-transform: scale(1.05); }
253
- 80% {
254
- transform: scale(0.95);
255
- -webkit-tranform: scale(0.95); }
256
- 100% {
257
- transform: scale(1);
258
- -webkit-transform: scale(1); } }
248
+
259
249
  @keyframes showSweetAlert {
260
250
  0% {
261
251
  transform: scale(0.7);
262
252
  -webkit-transform: scale(0.7); }
253
+
263
254
  45% {
264
255
  transform: scale(1.05);
265
256
  -webkit-transform: scale(1.05); }
257
+
266
258
  80% {
267
259
  transform: scale(0.95);
268
260
  -webkit-tranform: scale(0.95); }
261
+
269
262
  100% {
270
263
  transform: scale(1);
271
264
  -webkit-transform: scale(1); } }
265
+
272
266
  @-webkit-keyframes hideSweetAlert {
273
267
  0% {
274
268
  transform: scale(1);
275
269
  -webkit-transform: scale(1); }
270
+
276
271
  100% {
277
272
  transform: scale(0.5);
278
273
  -webkit-transform: scale(0.5); } }
279
- @-moz-keyframes hideSweetAlert {
280
- 0% {
281
- transform: scale(1);
282
- -webkit-transform: scale(1); }
283
- 100% {
284
- transform: scale(0.5);
285
- -webkit-transform: scale(0.5); } }
274
+
286
275
  @keyframes hideSweetAlert {
287
276
  0% {
288
277
  transform: scale(1);
289
278
  -webkit-transform: scale(1); }
279
+
290
280
  100% {
291
281
  transform: scale(0.5);
292
282
  -webkit-transform: scale(0.5); } }
283
+
293
284
  .showSweetAlert {
294
285
  -webkit-animation: showSweetAlert 0.3s;
295
- -moz-animation: showSweetAlert 0.3s;
296
286
  animation: showSweetAlert 0.3s; }
287
+ .showSweetAlert[data-animation=none] {
288
+ -webkit-animation: none;
289
+ animation: none; }
297
290
 
298
291
  .hideSweetAlert {
299
292
  -webkit-animation: hideSweetAlert 0.2s;
300
- -moz-animation: hideSweetAlert 0.2s;
301
293
  animation: hideSweetAlert 0.2s; }
294
+ .hideSweetAlert[data-animation=none] {
295
+ -webkit-animation: none;
296
+ animation: none; }
302
297
 
303
298
  @-webkit-keyframes animateSuccessTip {
304
299
  0% {
305
300
  width: 0;
306
301
  left: 1px;
307
302
  top: 19px; }
303
+
308
304
  54% {
309
305
  width: 0;
310
306
  left: 1px;
311
307
  top: 19px; }
308
+
312
309
  70% {
313
310
  width: 50px;
314
311
  left: -8px;
315
312
  top: 37px; }
313
+
316
314
  84% {
317
315
  width: 17px;
318
316
  left: 21px;
319
317
  top: 48px; }
318
+
320
319
  100% {
321
320
  width: 25px;
322
321
  left: 14px;
323
322
  top: 45px; } }
324
- @-moz-keyframes animateSuccessTip {
325
- 0% {
326
- width: 0;
327
- left: 1px;
328
- top: 19px; }
329
- 54% {
330
- width: 0;
331
- left: 1px;
332
- top: 19px; }
333
- 70% {
334
- width: 50px;
335
- left: -8px;
336
- top: 37px; }
337
- 84% {
338
- width: 17px;
339
- left: 21px;
340
- top: 48px; }
341
- 100% {
342
- width: 25px;
343
- left: 14px;
344
- top: 45px; } }
323
+
345
324
  @keyframes animateSuccessTip {
346
325
  0% {
347
326
  width: 0;
348
327
  left: 1px;
349
328
  top: 19px; }
329
+
350
330
  54% {
351
331
  width: 0;
352
332
  left: 1px;
353
333
  top: 19px; }
334
+
354
335
  70% {
355
336
  width: 50px;
356
337
  left: -8px;
357
338
  top: 37px; }
339
+
358
340
  84% {
359
341
  width: 17px;
360
342
  left: 21px;
361
343
  top: 48px; }
344
+
362
345
  100% {
363
346
  width: 25px;
364
347
  left: 14px;
365
348
  top: 45px; } }
349
+
366
350
  @-webkit-keyframes animateSuccessLong {
367
351
  0% {
368
352
  width: 0;
369
353
  right: 46px;
370
354
  top: 54px; }
355
+
371
356
  65% {
372
357
  width: 0;
373
358
  right: 46px;
374
359
  top: 54px; }
360
+
375
361
  84% {
376
362
  width: 55px;
377
363
  right: 0px;
378
364
  top: 35px; }
365
+
379
366
  100% {
380
367
  width: 47px;
381
368
  right: 8px;
382
369
  top: 38px; } }
383
- @-moz-keyframes animateSuccessLong {
384
- 0% {
385
- width: 0;
386
- right: 46px;
387
- top: 54px; }
388
- 65% {
389
- width: 0;
390
- right: 46px;
391
- top: 54px; }
392
- 84% {
393
- width: 55px;
394
- right: 0px;
395
- top: 35px; }
396
- 100% {
397
- width: 47px;
398
- right: 8px;
399
- top: 38px; } }
370
+
400
371
  @keyframes animateSuccessLong {
401
372
  0% {
402
373
  width: 0;
403
374
  right: 46px;
404
375
  top: 54px; }
376
+
405
377
  65% {
406
378
  width: 0;
407
379
  right: 46px;
408
380
  top: 54px; }
381
+
409
382
  84% {
410
383
  width: 55px;
411
384
  right: 0px;
412
385
  top: 35px; }
386
+
413
387
  100% {
414
388
  width: 47px;
415
389
  right: 8px;
416
390
  top: 38px; } }
391
+
417
392
  @-webkit-keyframes rotatePlaceholder {
418
393
  0% {
419
394
  transform: rotate(-45deg);
420
395
  -webkit-transform: rotate(-45deg); }
396
+
421
397
  5% {
422
398
  transform: rotate(-45deg);
423
399
  -webkit-transform: rotate(-45deg); }
400
+
424
401
  12% {
425
402
  transform: rotate(-405deg);
426
403
  -webkit-transform: rotate(-405deg); }
404
+
427
405
  100% {
428
406
  transform: rotate(-405deg);
429
407
  -webkit-transform: rotate(-405deg); } }
430
- @-moz-keyframes rotatePlaceholder {
431
- 0% {
432
- transform: rotate(-45deg);
433
- -webkit-transform: rotate(-45deg); }
434
- 5% {
435
- transform: rotate(-45deg);
436
- -webkit-transform: rotate(-45deg); }
437
- 12% {
438
- transform: rotate(-405deg);
439
- -webkit-transform: rotate(-405deg); }
440
- 100% {
441
- transform: rotate(-405deg);
442
- -webkit-transform: rotate(-405deg); } }
408
+
443
409
  @keyframes rotatePlaceholder {
444
410
  0% {
445
411
  transform: rotate(-45deg);
446
412
  -webkit-transform: rotate(-45deg); }
413
+
447
414
  5% {
448
415
  transform: rotate(-45deg);
449
416
  -webkit-transform: rotate(-45deg); }
417
+
450
418
  12% {
451
419
  transform: rotate(-405deg);
452
420
  -webkit-transform: rotate(-405deg); }
421
+
453
422
  100% {
454
423
  transform: rotate(-405deg);
455
424
  -webkit-transform: rotate(-405deg); } }
425
+
456
426
  .animateSuccessTip {
457
427
  -webkit-animation: animateSuccessTip 0.75s;
458
- -moz-animation: animateSuccessTip 0.75s;
459
428
  animation: animateSuccessTip 0.75s; }
460
429
 
461
430
  .animateSuccessLong {
462
431
  -webkit-animation: animateSuccessLong 0.75s;
463
- -moz-animation: animateSuccessLong 0.75s;
464
432
  animation: animateSuccessLong 0.75s; }
465
433
 
466
434
  .icon.success.animate::after {
467
435
  -webkit-animation: rotatePlaceholder 4.25s ease-in;
468
- -moz-animation: rotatePlaceholder 4.25s ease-in;
469
436
  animation: rotatePlaceholder 4.25s ease-in; }
470
437
 
471
438
  @-webkit-keyframes animateErrorIcon {
@@ -473,31 +440,25 @@
473
440
  transform: rotateX(100deg);
474
441
  -webkit-transform: rotateX(100deg);
475
442
  opacity: 0; }
443
+
476
444
  100% {
477
445
  transform: rotateX(0deg);
478
446
  -webkit-transform: rotateX(0deg);
479
447
  opacity: 1; } }
480
- @-moz-keyframes animateErrorIcon {
481
- 0% {
482
- transform: rotateX(100deg);
483
- -webkit-transform: rotateX(100deg);
484
- opacity: 0; }
485
- 100% {
486
- transform: rotateX(0deg);
487
- -webkit-transform: rotateX(0deg);
488
- opacity: 1; } }
448
+
489
449
  @keyframes animateErrorIcon {
490
450
  0% {
491
451
  transform: rotateX(100deg);
492
452
  -webkit-transform: rotateX(100deg);
493
453
  opacity: 0; }
454
+
494
455
  100% {
495
456
  transform: rotateX(0deg);
496
457
  -webkit-transform: rotateX(0deg);
497
458
  opacity: 1; } }
459
+
498
460
  .animateErrorIcon {
499
461
  -webkit-animation: animateErrorIcon 0.5s;
500
- -moz-animation: animateErrorIcon 0.5s;
501
462
  animation: animateErrorIcon 0.5s; }
502
463
 
503
464
  @-webkit-keyframes animateXMark {
@@ -506,101 +467,84 @@
506
467
  -webkit-transform: scale(0.4);
507
468
  margin-top: 26px;
508
469
  opacity: 0; }
470
+
509
471
  50% {
510
472
  transform: scale(0.4);
511
473
  -webkit-transform: scale(0.4);
512
474
  margin-top: 26px;
513
475
  opacity: 0; }
476
+
514
477
  80% {
515
478
  transform: scale(1.15);
516
479
  -webkit-transform: scale(1.15);
517
480
  margin-top: -6px; }
481
+
518
482
  100% {
519
483
  transform: scale(1);
520
484
  -webkit-transform: scale(1);
521
485
  margin-top: 0;
522
486
  opacity: 1; } }
523
- @-moz-keyframes animateXMark {
524
- 0% {
525
- transform: scale(0.4);
526
- -webkit-transform: scale(0.4);
527
- margin-top: 26px;
528
- opacity: 0; }
529
- 50% {
530
- transform: scale(0.4);
531
- -webkit-transform: scale(0.4);
532
- margin-top: 26px;
533
- opacity: 0; }
534
- 80% {
535
- transform: scale(1.15);
536
- -webkit-transform: scale(1.15);
537
- margin-top: -6px; }
538
- 100% {
539
- transform: scale(1);
540
- -webkit-transform: scale(1);
541
- margin-top: 0;
542
- opacity: 1; } }
487
+
543
488
  @keyframes animateXMark {
544
489
  0% {
545
490
  transform: scale(0.4);
546
491
  -webkit-transform: scale(0.4);
547
492
  margin-top: 26px;
548
493
  opacity: 0; }
494
+
549
495
  50% {
550
496
  transform: scale(0.4);
551
497
  -webkit-transform: scale(0.4);
552
498
  margin-top: 26px;
553
499
  opacity: 0; }
500
+
554
501
  80% {
555
502
  transform: scale(1.15);
556
503
  -webkit-transform: scale(1.15);
557
504
  margin-top: -6px; }
505
+
558
506
  100% {
559
507
  transform: scale(1);
560
508
  -webkit-transform: scale(1);
561
509
  margin-top: 0;
562
510
  opacity: 1; } }
511
+
563
512
  .animateXMark {
564
513
  -webkit-animation: animateXMark 0.5s;
565
- -moz-animation: animateXMark 0.5s;
566
514
  animation: animateXMark 0.5s; }
567
515
 
568
516
  @-webkit-keyframes pulseWarning {
569
517
  0% {
570
518
  border-color: #F8D486; }
519
+
571
520
  100% {
572
521
  border-color: #F8BB86; } }
573
- @-moz-keyframes pulseWarning {
574
- 0% {
575
- border-color: #F8D486; }
576
- 100% {
577
- border-color: #F8BB86; } }
522
+
578
523
  @keyframes pulseWarning {
579
524
  0% {
580
525
  border-color: #F8D486; }
526
+
581
527
  100% {
582
528
  border-color: #F8BB86; } }
529
+
583
530
  .pulseWarning {
584
531
  -webkit-animation: pulseWarning 0.75s infinite alternate;
585
- -moz-animation: pulseWarning 0.75s infinite alternate;
586
532
  animation: pulseWarning 0.75s infinite alternate; }
587
533
 
588
534
  @-webkit-keyframes pulseWarningIns {
589
535
  0% {
590
536
  background-color: #F8D486; }
537
+
591
538
  100% {
592
539
  background-color: #F8BB86; } }
593
- @-moz-keyframes pulseWarningIns {
594
- 0% {
595
- background-color: #F8D486; }
596
- 100% {
597
- background-color: #F8BB86; } }
540
+
598
541
  @keyframes pulseWarningIns {
599
542
  0% {
600
543
  background-color: #F8D486; }
544
+
601
545
  100% {
602
546
  background-color: #F8BB86; } }
547
+
603
548
  .pulseWarningIns {
604
549
  -webkit-animation: pulseWarningIns 0.75s infinite alternate;
605
- -moz-animation: pulseWarningIns 0.75s infinite alternate;
606
550
  animation: pulseWarningIns 0.75s infinite alternate; }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sweetalert-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rustam Sharshenov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2015-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties