sinatra-hexacta 1.5.3 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sinatra/public/js/app.js +20 -59
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d436b67b99f2e22625502a87ab2b868f0d22553ca1dc733ff7bbcbe51afc018a
4
- data.tar.gz: bf9b4ea91736f8b2d3ae1c9cb1400d3cbb3cc53b6516a12352d306b82f866a15
3
+ metadata.gz: 4a9dc56be12a60357e82d8279807d2553afc0ad376e430bcfbdf18efc49b74ca
4
+ data.tar.gz: 2bb9c311849b822ccbc6f36a92c3d989bf36a8a851df97793d01e91d7cafab67
5
5
  SHA512:
6
- metadata.gz: c53eac3ff50f3851fbb4d5e7165f39bd8db517e517b92c47225ecaac7f382f26ffaa3789adc2c0b6e500f2209154b8b97fe253168f983e654b1dc636a20f9a30
7
- data.tar.gz: 0be9f14b04525f8e5ff56b2894941f1f48e81a3b6b1c2e050f63599a6351f9ecd472a2bce0b867407a792a15e0d2dfd36f78010afa5e2a7bc254a28196e623f6
6
+ metadata.gz: 2d2d8812917f8d26437c9b461b7fe59ae7685922075e2cb29be86d7f3b684c5894c563162a86d915898d97075e861956acc9af8b43a3d17c1a240f401789dec0
7
+ data.tar.gz: c99a0226bf62c3b1408e4936197b3570e39ea5596a4b53b1fc3184fb519ce4a02397bc52c89eba104d1fabfc090158fe608ba46df5da479095a0e0dbecc05ee8
@@ -25,6 +25,23 @@ $(document).ready(function(){
25
25
 
26
26
  function update_html_elements() {
27
27
 
28
+ $("form.async").submit(function(e){
29
+ e.preventDefault();
30
+ var datastring = $(this).serialize();
31
+ var url = $(this).attr('action');
32
+ $(this).closest('.modal').modal('hide');
33
+ $('body').append('<div aria-labelledby="loading" class="modal bounceIn animated" id="loading-modal" role="dialog" tabindex="-1" data-backdrop="static" data-keyboard="false"><div class="modal-dialog modal-sm" style="width:150px !Important;"><div class="modal-content"><div class="modal-body p-20 text-center"><div class="preloader pl-lg"><svg class="pl-circular" viewBox="25 25 50 50"><circle class="plc-path" cx="50" cy="50" r="20"></circle></svg></div></div><div class="modal-footer" style="text-align: center !Important;"><div class="btn btn-link waves-effect c-gray">Espere...</div></div></div></div></div>');
34
+ $('#loading-modal').modal('show');
35
+ $.ajax({
36
+ type: "POST",
37
+ url: url,
38
+ data: datastring,
39
+ success: function(data) {
40
+ location.reload();
41
+ }
42
+ });
43
+ });
44
+
28
45
  // Fix modal inside other components
29
46
  $('.modal').appendTo("body");
30
47
 
@@ -538,76 +555,20 @@ $( document ).ajaxStop(function() {
538
555
  stop_load();
539
556
  });
540
557
 
541
- function rm(url) {
542
- disableButtons();
543
- if (confirm('¿Estás seguro que deseas realizar esta operación?')) {
544
- $.ajax({
545
- url: url,
546
- type: 'DELETE',
547
- done: function(result) {
548
- location.reload();
549
- },
550
- success: function(result) {
551
- location.reload();
552
- },
553
- error: function(error) {
554
- alert("Ha ocurrido un error, intentalo nuevamente!");
555
- enableButtons();
556
- }
557
- });
558
- } else {
559
- enableButtons();
560
- }
561
- }
562
-
563
558
 
564
559
  function rm_object(object,id) {
565
- disableButtons();
560
+ $(".modal").modal('hide');
561
+ $('body').append('<div aria-labelledby="loading" class="modal bounceIn animated" id="loading-modal" role="dialog" tabindex="-1" data-backdrop="static" data-keyboard="false"><div class="modal-dialog modal-sm" style="width:150px !Important;"><div class="modal-content"><div class="modal-body p-20 text-center"><div class="preloader pl-lg"><svg class="pl-circular" viewBox="25 25 50 50"><circle class="plc-path" cx="50" cy="50" r="20"></circle></svg></div></div><div class="modal-footer" style="text-align: center !Important;"><div class="btn btn-link waves-effect c-gray">Espere...</div></div></div></div></div>');
562
+ $('#loading-modal').modal('show');
566
563
  $.ajax({
567
564
  url: '/' + object + '/' + id,
568
565
  type: 'DELETE',
569
- data: {},
570
566
  success: function(result) {
571
567
  location.reload();
572
568
  }
573
569
  });
574
570
  }
575
571
 
576
- function post(url) {
577
- disableButtons();
578
- if (confirm('¿Estás seguro que deseas realizar esta operación?')) {
579
- $.ajax({
580
- url: url,
581
- type: 'POST',
582
- done: function(result) {
583
- location.reload();
584
- },
585
- success: function(result) {
586
- location.reload();
587
- },
588
- error: function(error) {
589
- alert("Ha ocurrido un error, intentalo nuevamente!");
590
- enableButtons();
591
- }
592
- });
593
- } else {
594
- enableButtons();
595
- }
596
- }
597
-
598
- function disableButtons() {
599
- $(".btn").each(function() {
600
- $(this).data("temp",$(this).val());
601
- $(this).attr("disabled",true);
602
- });
603
- return true
604
- }
605
- function enableButtons() {
606
- $(".btn").each(function() {
607
- $(this).attr("disabled",false);
608
- });
609
- return true
610
- }
611
572
  (function( $ ){
612
573
  $.fn.disableSelect = function() {
613
574
  $(this).prop("disabled", true);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-hexacta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger