sinatra-hexacta 1.5.2 → 1.6.2

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
  SHA256:
3
- metadata.gz: 9022f7049e4774dce30d68e3a8340231e18ed4cbd9ae6d38da5ad30e6818d0a1
4
- data.tar.gz: d1346db432f17de20e624c3462f0d71a3e640df3e493cf3d82fdc21c970648a1
3
+ metadata.gz: 426f83f4059ea172556ab6f353a970b55ce582fcdc7ed193aaf53f0beb3c91c4
4
+ data.tar.gz: 425d0637eb8ca6038df97f4cd5bf72e02c2308f21789429d18572d9f8006d34b
5
5
  SHA512:
6
- metadata.gz: 3520c88236dc263cbd8fe20bc4c48a0243496979218f7b719a216869cbb90d624f9aeb3419b2af517a9dda712e072d6a190e29eeea34ff58fdf803b3924dfcbd
7
- data.tar.gz: 8de7a7397d298e1142cc5fdd639c0604cdae926dd2dae4acb1880d38ec44954c3022d5bc7b4cde76b8b8149f280bb20d23a3dae2cf56e9fe422954825c956153
6
+ metadata.gz: 3e9518882b42c117cfd46163a91b7e45a74ff88590d776f00a7e09df7890c56810798b5c1a5216d5ae4d7c5d66a0ea4f3e560e511ecae6d17136fa104cc5193f
7
+ data.tar.gz: 8c55127e4507fee024d7c0ce178d91021d1087e00e5826aaab74aa065b99599f67bd3dbcac0bb1e818c5adcc9a14ff8597811bd9afe14bfcd4bd9c59a07832b9
@@ -82,7 +82,7 @@ module Sinatra
82
82
  if logged_in?(request, session)
83
83
  url = CAS_CLIENT.logout_url()
84
84
  session.clear
85
- str = request.referer
85
+ str = request.referer || ''
86
86
  comeback = "=" + (str.include?("?")? str.slice(0..(str.index('?')-1)) : str) #Hack mal!
87
87
  redirect url + (url.include?("?service")? "" : "?service") + comeback
88
88
  end
@@ -25,6 +25,36 @@ $(document).ready(function(){
25
25
 
26
26
  function update_html_elements() {
27
27
 
28
+ $("form.async").unbind("submit").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
+
37
+ type: "POST",
38
+ url: url,
39
+ data: datastring,
40
+ success: function(data) {
41
+ $('#loading-modal').modal('hide');
42
+ $('#loading-modal').remove();
43
+ $('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
+ $('#ok-modal').modal('show');
45
+ setTimeout(function () {
46
+ location.reload();
47
+ }, 1000)
48
+ },
49
+ error: function(data) {
50
+ $('#loading-modal').modal('hide');
51
+ $('#loading-modal').remove();
52
+ $('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>');
53
+ $('#error-modal').modal('show');
54
+ }
55
+ });
56
+ });
57
+
28
58
  // Fix modal inside other components
29
59
  $('.modal').appendTo("body");
30
60
 
@@ -538,76 +568,32 @@ $( document ).ajaxStop(function() {
538
568
  stop_load();
539
569
  });
540
570
 
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
571
 
564
572
  function rm_object(object,id) {
565
- disableButtons();
573
+ $(".modal").modal('hide');
574
+ $('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>');
575
+ $('#loading-modal').modal('show');
566
576
  $.ajax({
567
577
  url: '/' + object + '/' + id,
568
578
  type: 'DELETE',
569
- data: {},
570
- success: function(result) {
571
- location.reload();
579
+ success: function(data) {
580
+ $('#loading-modal').modal('hide');
581
+ $('#loading-modal').remove();
582
+ $('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>');
583
+ $('#ok-modal').modal('show');
584
+ setTimeout(function () {
585
+ location.reload();
586
+ }, 1000)
587
+ },
588
+ error: function(data) {
589
+ $('#loading-modal').modal('hide');
590
+ $('#loading-modal').remove();
591
+ $('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>');
592
+ $('#error-modal').modal('show');
572
593
  }
573
594
  });
574
595
  }
575
596
 
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
597
  (function( $ ){
612
598
  $.fn.disableSelect = function() {
613
599
  $(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.2
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger