sinatra-hexacta 1.6.4 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 35a5abe8c678f588839389b8b76c45c6849c90678054e5c9ee6d725bdaea6bb4
         | 
| 4 | 
            +
              data.tar.gz: 9bb209941df45a2f736cf559c85e6bb8c695bf5e9a0da54008020b1d42b741ac
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 3d53304326eeb461dc0f7276461b80241a06fbbc84468250b1bd65e2cea9a2f37f805414a5d6b3492576e69fda15548eeb84c9c2ec475b4886df8bb3f8b12eb2
         | 
| 7 | 
            +
              data.tar.gz: 332e75bb6823fe6c40a50aeb3b89f5e42d3f15ad60a953b71a4abb08fdacfd9f81c5d8d209f217d4ac94660b2ecbc75e8f93040bb54c544b05759b83e8ec6dd1
         | 
| @@ -30,16 +30,14 @@ function update_html_elements() { | |
| 30 30 | 
             
                  var datastring = $(this).serialize();
         | 
| 31 31 | 
             
                  var url = $(this).attr('action');
         | 
| 32 32 | 
             
                  $(this).closest('.modal').modal('hide');
         | 
| 33 | 
            -
                   | 
| 34 | 
            -
                  $('#loading-modal').modal('show');
         | 
| 33 | 
            +
                  start_load();
         | 
| 35 34 | 
             
                  $.ajax({
         | 
| 36 35 |  | 
| 37 36 | 
             
                    type: "POST",
         | 
| 38 37 | 
             
                    url: url,
         | 
| 39 38 | 
             
                    data: datastring,
         | 
| 40 39 | 
             
                    success: function(data) {
         | 
| 41 | 
            -
                       | 
| 42 | 
            -
                      $('#loading-modal').remove();
         | 
| 40 | 
            +
                      stop_load();
         | 
| 43 41 | 
             
                      $('body').append('<div aria-labelledby="ok" class="modal bounceIn animated" id="ok-modal" role="dialog" tabindex="-1"><div class="modal-dialog modal-sm" style="width:150px !Important;"><div class="modal-content"><div class="modal-body p-20 text-center"><i class="zmdi zmdi-hc-3x zmdi-check-circle c-green"></i></div><div class="modal-footer" style="text-align: center !Important;"><div class="btn btn-link waves-effect c-gray">¡Listo!</div></div></div></div></div>');
         | 
| 44 42 | 
             
                      $('#ok-modal').modal('show');
         | 
| 45 43 | 
             
                      setTimeout(function () {
         | 
| @@ -47,8 +45,7 @@ function update_html_elements() { | |
| 47 45 | 
             
                      }, 1000)
         | 
| 48 46 | 
             
                    },
         | 
| 49 47 | 
             
                    error: function(error) {
         | 
| 50 | 
            -
                       | 
| 51 | 
            -
                      $('#loading-modal').remove();
         | 
| 48 | 
            +
                      stop_load();
         | 
| 52 49 | 
             
                      if ($('#error-modal')[0]) {
         | 
| 53 50 | 
             
                        $('#error-modal').remove();
         | 
| 54 51 | 
             
                      }
         | 
| @@ -552,37 +549,25 @@ if (elementToObserve != null) { | |
| 552 549 |  | 
| 553 550 |  | 
| 554 551 | 
             
            function start_load() {
         | 
| 555 | 
            -
              if (!$("# | 
| 556 | 
            -
                $( | 
| 552 | 
            +
              if (!$("#loading-modal")[0]) {
         | 
| 553 | 
            +
                $('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>');
         | 
| 554 | 
            +
                $('#loading-modal').modal('show');
         | 
| 557 555 | 
             
              }
         | 
| 558 556 | 
             
            }
         | 
| 559 557 |  | 
| 560 558 | 
             
            function stop_load() {
         | 
| 561 | 
            -
              $( | 
| 559 | 
            +
              $('#loading-modal').modal('hide');
         | 
| 560 | 
            +
              $('#loading-modal').remove();
         | 
| 562 561 | 
             
            }
         | 
| 563 562 |  | 
| 564 | 
            -
             | 
| 565 | 
            -
            $( document ).ajaxSend(function( event, jqxhr, settings )  {
         | 
| 566 | 
            -
              if (!settings.url.includes(".json")) {
         | 
| 567 | 
            -
                start_load();
         | 
| 568 | 
            -
              }
         | 
| 569 | 
            -
            });
         | 
| 570 | 
            -
             | 
| 571 | 
            -
            $( document ).ajaxStop(function() {
         | 
| 572 | 
            -
              stop_load();
         | 
| 573 | 
            -
            });
         | 
| 574 | 
            -
             | 
| 575 | 
            -
             | 
| 576 563 | 
             
            function rm_object(object,id) {
         | 
| 577 564 | 
             
              $(".modal").modal('hide');
         | 
| 578 | 
            -
               | 
| 579 | 
            -
              $('#loading-modal').modal('show');
         | 
| 565 | 
            +
              start_load();
         | 
| 580 566 | 
             
              $.ajax({
         | 
| 581 567 | 
             
                url: '/' + object + '/' + id,
         | 
| 582 568 | 
             
                type: 'DELETE',
         | 
| 583 569 | 
             
                success: function(data) {
         | 
| 584 | 
            -
                   | 
| 585 | 
            -
                  $('#loading-modal').remove();
         | 
| 570 | 
            +
                  stop_load();
         | 
| 586 571 | 
             
                  $('body').append('<div aria-labelledby="ok" class="modal bounceIn animated" id="ok-modal" role="dialog" tabindex="-1"><div class="modal-dialog modal-sm" style="width:150px !Important;"><div class="modal-content"><div class="modal-body p-20 text-center"><i class="zmdi zmdi-hc-3x zmdi-check-circle c-green"></i></div><div class="modal-footer" style="text-align: center !Important;"><div class="btn btn-link waves-effect c-gray">¡Listo!</div></div></div></div></div>');
         | 
| 587 572 | 
             
                  $('#ok-modal').modal('show');
         | 
| 588 573 | 
             
                  setTimeout(function () {
         | 
| @@ -590,8 +575,7 @@ function rm_object(object,id) { | |
| 590 575 | 
             
                  }, 1000)
         | 
| 591 576 | 
             
                },
         | 
| 592 577 | 
             
                error: function(data) {
         | 
| 593 | 
            -
                   | 
| 594 | 
            -
                  $('#loading-modal').remove();
         | 
| 578 | 
            +
                  stop_load();
         | 
| 595 579 | 
             
                  $('body').append('<div aria-labelledby="error" class="modal bounceIn animated" id="error-modal" role="dialog" tabindex="-1"><div class="modal-dialog modal-sm" style="width:150px !Important;"><div class="modal-content"><div class="modal-body p-20 text-center"><i class="zmdi zmdi-hc-3x zmdi-alert-polygon c-red"></i></div><div class="modal-footer" style="text-align: center !Important;"><div class="btn btn-link waves-effect c-gray">Oops...</div></div></div></div></div>');
         | 
| 596 580 | 
             
                  $('#error-modal').modal('show');
         | 
| 597 581 | 
             
                }
         | 
| @@ -1,15 +1,41 @@ | |
| 1 1 | 
             
            class View {
         | 
| 2 2 |  | 
| 3 | 
            -
              static get(url, | 
| 4 | 
            -
                 | 
| 3 | 
            +
              static get(url,data,destination,callback = function() {}){
         | 
| 4 | 
            +
                start_load();
         | 
| 5 5 | 
             
                $.ajax({
         | 
| 6 6 | 
             
                    url: url,
         | 
| 7 7 | 
             
                    type: 'GET',
         | 
| 8 | 
            -
                    data:  | 
| 8 | 
            +
                    data: data,
         | 
| 9 9 | 
             
                }).done(function(result) {
         | 
| 10 | 
            +
                  stop_load();
         | 
| 10 11 | 
             
                  $(destination).html(result);
         | 
| 12 | 
            +
                  update_html_elements();
         | 
| 13 | 
            +
                  callback();
         | 
| 11 14 | 
             
                }).error(function(result) {
         | 
| 15 | 
            +
                  stop_load();
         | 
| 12 16 | 
             
                  $(destination).html('<div class="lv-item p-20 bgm-red m-b-5 animated fadeIn"><div class="media"><div class="pull-left"><i class="zmdi zmdi-hc-3x zmdi-alert-octagon c-white"></i></div><div class="media-body"><div class="lv-title c-white">Algo salió mal</div><small class="lv-small c-white">Los administradores acaban de ser informados de este error, ni bien tengan una solución se te notificará. Disculpá las molestias.</small></div></div></div>');
         | 
| 13 17 | 
             
                });
         | 
| 14 18 | 
             
              }
         | 
| 15 | 
            -
             | 
| 19 | 
            +
             | 
| 20 | 
            +
              static append(url,data,destination,callback = function() {}){
         | 
| 21 | 
            +
                start_load();
         | 
| 22 | 
            +
                $.ajax({
         | 
| 23 | 
            +
                    url: url,
         | 
| 24 | 
            +
                    type: 'GET',
         | 
| 25 | 
            +
                    data: data,
         | 
| 26 | 
            +
                }).done(function(result) {
         | 
| 27 | 
            +
                  stop_load();
         | 
| 28 | 
            +
                  $(destination).append(result);
         | 
| 29 | 
            +
                  update_html_elements();
         | 
| 30 | 
            +
                  callback();
         | 
| 31 | 
            +
                }).error(function(error) {
         | 
| 32 | 
            +
                  stop_load();
         | 
| 33 | 
            +
                  if ($('#error-modal')[0]) {
         | 
| 34 | 
            +
                    $('#error-modal').remove();
         | 
| 35 | 
            +
                  }
         | 
| 36 | 
            +
                  $('body').append('<div aria-labelledby="error" class="modal bounceIn animated" id="error-modal" role="dialog" tabindex="-1"><div class="modal-dialog modal-sm" style="min-width:150px !Important;"><div class="modal-content"><div class="modal-body p-20 text-center"><i class="zmdi zmdi-hc-3x zmdi-alert-polygon c-red"></i></div><div class="modal-footer" style="text-align: center !Important;"><div class="f-900 c-gray">' + error.responseText + '</div></div></div></div></div>');
         | 
| 37 | 
            +
                  $('#error-modal').modal('show');
         | 
| 38 | 
            +
                });
         | 
| 39 | 
            +
              }
         | 
| 40 | 
            +
            }
         | 
| 41 | 
            +
             | 
| @@ -8,6 +8,7 @@ script src="/sinatra-hexacta/vendors/chartist/chartist-plugin-legend.js" | |
| 8 8 | 
             
            script src="/sinatra-hexacta/js/app.js?ver=#{settings.version}" type='text/javascript'
         | 
| 9 9 | 
             
            script src="/sinatra-hexacta/js/finder.js?ver=#{settings.version}" type='text/javascript'
         | 
| 10 10 | 
             
            script src="/sinatra-hexacta/js/process.js?ver=#{settings.version}" type='text/javascript'
         | 
| 11 | 
            +
            script src="/sinatra-hexacta/js/view.js?ver=#{settings.version}" type='text/javascript'
         | 
| 11 12 |  | 
| 12 13 | 
             
            javascript:
         | 
| 13 14 | 
             
              const storeScroll = () => {
         |