thin_man 0.18.8 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/thin_man.js +47 -12
- data/lib/thin_man/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22cee53a7335296016234e29f4cabb9c6fb82772
|
4
|
+
data.tar.gz: b542a31e952e980e53c5c4cc9ca4774a531c814b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 946774208ed521efd504380c900531eb4967c0f50c84e7c5ce1653c9f563c88dcf41813b6c643eb37315737a390b3d03bbfe6aa9526518154e9f61c47f01ae17
|
7
|
+
data.tar.gz: 3072557e1b96b03bedc190349b385c97cf85b0e34e48482b12ba48bfc7dee351094cda135a4b09f6bac4c1d59007353cd7a93430b2dcd547c2bf22c1537ec3d6
|
@@ -63,18 +63,20 @@ var initThinMan = function(){
|
|
63
63
|
}),
|
64
64
|
AjaxSubmission: Class.extend({
|
65
65
|
init: function(jq_obj,params){
|
66
|
-
this.jq_obj = jq_obj
|
67
|
-
this.params = params
|
66
|
+
this.jq_obj = jq_obj
|
67
|
+
this.params = params
|
68
68
|
if(!this.params){ this.params = {}}
|
69
69
|
// Bail out if this is a no-mouse-click ajax element and we were mouse clicked
|
70
70
|
if(this.wasMouseClicked() && this.noMouseClick()){
|
71
|
-
return false
|
72
|
-
}
|
73
|
-
this.getTrigger()
|
74
|
-
this.getTarget()
|
75
|
-
this.getErrorTarget()
|
76
|
-
this.progress_color = jq_obj.data('progress-color')
|
77
|
-
this.progress_target = $(jq_obj.data('progress-target'))
|
71
|
+
return false
|
72
|
+
}
|
73
|
+
this.getTrigger()
|
74
|
+
this.getTarget()
|
75
|
+
this.getErrorTarget()
|
76
|
+
this.progress_color = jq_obj.data('progress-color')
|
77
|
+
this.progress_target = $(jq_obj.data('progress-target'))
|
78
|
+
this.$mask_target = $(jq_obj.data('mask-target'))
|
79
|
+
this.$mask_message = jq_obj.data('mask-message')
|
78
80
|
this.custom_progress = typeof(jq_obj.data('custom-progress')) != 'undefined';
|
79
81
|
this.scroll_to = jq_obj.data('scroll-to')
|
80
82
|
this.watchers = []
|
@@ -82,8 +84,8 @@ var initThinMan = function(){
|
|
82
84
|
this.progress_target = this.trigger
|
83
85
|
this.trigger_is_progress_target = true
|
84
86
|
}
|
85
|
-
this.insert_method = this.getInsertMethod()
|
86
|
-
var ajax_submission = this
|
87
|
+
this.insert_method = this.getInsertMethod()
|
88
|
+
var ajax_submission = this
|
87
89
|
this.ajax_options = {
|
88
90
|
url: ajax_submission.getAjaxUrl(),
|
89
91
|
type: ajax_submission.getAjaxType(),
|
@@ -276,6 +278,9 @@ var initThinMan = function(){
|
|
276
278
|
} else if(!this.trigger_is_progress_target){
|
277
279
|
this.progress_target.remove();
|
278
280
|
}
|
281
|
+
if(this.$mask_target){
|
282
|
+
this.mask.remove();
|
283
|
+
}
|
279
284
|
try{
|
280
285
|
var response_data = JSON.parse(jqXHR.responseText)
|
281
286
|
} catch(err) {
|
@@ -307,6 +312,9 @@ var initThinMan = function(){
|
|
307
312
|
if(!this.custom_progress){
|
308
313
|
this.progress_indicator = new thin_man.AjaxProgress(this.progress_target,this.target,this.progress_color);
|
309
314
|
}
|
315
|
+
if(this.$mask_target){
|
316
|
+
this.mask = new thin_man.AjaxMask(this.$mask_target,this.$mask_message)
|
317
|
+
}
|
310
318
|
},
|
311
319
|
ajaxError: function( jqXHR ) {
|
312
320
|
debug_logger.log('thin_man.AjaxSubmission.ajaxError jqXHR:')
|
@@ -405,7 +413,7 @@ var initThinMan = function(){
|
|
405
413
|
var progress_color = 'black';
|
406
414
|
}
|
407
415
|
this.progress_container = $('#ajax_progress_container').clone();
|
408
|
-
uuid = new UUID;
|
416
|
+
var uuid = new UUID;
|
409
417
|
this.progress_container.prop('id', 'thin_man_ajax_progress_' + uuid.value);
|
410
418
|
this.progress_target.append(this.progress_container);
|
411
419
|
var css = {display: 'block', visibility: 'visible','color': progress_color, 'z-index': 1000000}
|
@@ -420,6 +428,33 @@ var initThinMan = function(){
|
|
420
428
|
this.progress_container.remove();
|
421
429
|
}
|
422
430
|
}),
|
431
|
+
AjaxMask: Class.extend({
|
432
|
+
init: function($mask_target,mask_message){
|
433
|
+
var uuid = new UUID;
|
434
|
+
this.$mask_target = $mask_target
|
435
|
+
this.$mask = $('#thin_man_mask').clone()
|
436
|
+
this.$mask.prop('id','thin_man_mask' + uuid.value)
|
437
|
+
if(typeof mask_message != 'undefined'){
|
438
|
+
var $message = this.$mask.find('[data-thin-man-mask-message]')
|
439
|
+
$message.html(mask_message)
|
440
|
+
}
|
441
|
+
var height = this.$mask_target.outerHeight()
|
442
|
+
var width = this.$mask_target.outerWidth()
|
443
|
+
var radius = this.$mask_target.css('border-radius')
|
444
|
+
this.$mask.css({'height': height, 'width': width, 'left': 0, 'top':0, 'border-radius':radius})
|
445
|
+
this.$mask.css({'position': 'absolute', 'z-index': 10000})
|
446
|
+
|
447
|
+
this.$mask_target.append(this.$mask)
|
448
|
+
this.$mask.on('click', function(e){
|
449
|
+
e.preventDefault();
|
450
|
+
return false;
|
451
|
+
})
|
452
|
+
this.$mask.show()
|
453
|
+
},
|
454
|
+
remove: function(){
|
455
|
+
this.$mask.remove()
|
456
|
+
}
|
457
|
+
}),
|
423
458
|
AjaxFlash: Class.extend({
|
424
459
|
init: function(type,message,elem,duration){
|
425
460
|
this.flash_container = $('[data-thin-man-flash-template]').clone();
|
data/lib/thin_man/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thin_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut, Adam Bialek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.6.11
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: A Rails library that makes web apps lively while keeping all the logic on
|