sinatra-hexacta 1.6.3 → 1.7.3
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: dc107478ca07acf14ac42fe83c84514cc09d2e86a1526005f6d22db7d1d3ac51
|
4
|
+
data.tar.gz: 67fd0bb1d758f908c3379c4f29788213597b9d0f9ab6cf6ab839afe9961b6b58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 866c5ad0b4a8e13dc2a2cb65f97589813ea885a021704fd6c80e8d76ad58f93b235e7e1fc6ac5e92d38d217e5571e0678520023b13f4418982633fbf6f9a737f
|
7
|
+
data.tar.gz: 85ac915c63faa7f36a4d5e117fbc440370ffd1772c9cf002628d123de0e0fd9ba65868681a955d32195347b196bdcd108ff6625153d7aefd815b32f2a1a1040d
|
@@ -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,10 @@ function update_html_elements() {
|
|
47
45
|
}, 1000)
|
48
46
|
},
|
49
47
|
error: function(error) {
|
50
|
-
|
51
|
-
$('#
|
48
|
+
stop_load();
|
49
|
+
if ($('#error-modal')[0]) {
|
50
|
+
$('#error-modal').remove();
|
51
|
+
}
|
52
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="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>');
|
53
53
|
$('#error-modal').modal('show');
|
54
54
|
}
|
@@ -549,37 +549,25 @@ if (elementToObserve != null) {
|
|
549
549
|
|
550
550
|
|
551
551
|
function start_load() {
|
552
|
-
if (!$("#
|
553
|
-
$(
|
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');
|
554
555
|
}
|
555
556
|
}
|
556
557
|
|
557
558
|
function stop_load() {
|
558
|
-
$(
|
559
|
+
$('#loading-modal').modal('hide');
|
560
|
+
$('#loading-modal').remove();
|
559
561
|
}
|
560
562
|
|
561
|
-
|
562
|
-
$( document ).ajaxSend(function( event, jqxhr, settings ) {
|
563
|
-
if (!settings.url.includes(".json")) {
|
564
|
-
start_load();
|
565
|
-
}
|
566
|
-
});
|
567
|
-
|
568
|
-
$( document ).ajaxStop(function() {
|
569
|
-
stop_load();
|
570
|
-
});
|
571
|
-
|
572
|
-
|
573
563
|
function rm_object(object,id) {
|
574
564
|
$(".modal").modal('hide');
|
575
|
-
|
576
|
-
$('#loading-modal').modal('show');
|
565
|
+
start_load();
|
577
566
|
$.ajax({
|
578
567
|
url: '/' + object + '/' + id,
|
579
568
|
type: 'DELETE',
|
580
569
|
success: function(data) {
|
581
|
-
|
582
|
-
$('#loading-modal').remove();
|
570
|
+
stop_load();
|
583
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>');
|
584
572
|
$('#ok-modal').modal('show');
|
585
573
|
setTimeout(function () {
|
@@ -587,8 +575,7 @@ function rm_object(object,id) {
|
|
587
575
|
}, 1000)
|
588
576
|
},
|
589
577
|
error: function(data) {
|
590
|
-
|
591
|
-
$('#loading-modal').remove();
|
578
|
+
stop_load();
|
592
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>');
|
593
580
|
$('#error-modal').modal('show');
|
594
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 = () => {
|