thin_man 0.20.1 → 0.20.2
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 +88 -80
- data/lib/thin_man/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52e184615861b2ef734e6f3e3d97f122fc62eb17f74e01ca9d869a09f7b7914f
|
4
|
+
data.tar.gz: 2a47b56140ad773e52e62459c938917b65ae272e8934dfd574d743d74b013cb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 865d49734a4be126b76f89fd084b8d4426a22d0c9e77fe310ea3dd77b5a51a0de323d80d34df21d2d506019ef079b01922daddbab27aae9fa5b0ccb7d2789701
|
7
|
+
data.tar.gz: 9c0928c58713ab0f29d31f66f59b0c3c143966ca1e070072a4df1f0a245f5f836b90f3e6d6f6c848fd321b9eee066ec7d8b4551d028b52f9d0b4a900ffa2116b
|
@@ -485,90 +485,98 @@ var initThinMan = function() {
|
|
485
485
|
}
|
486
486
|
}),
|
487
487
|
AjaxMask: Class.extend({
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
}
|
497
|
-
var height = this.$mask_target.outerHeight()
|
498
|
-
var width = this.$mask_target.outerWidth()
|
499
|
-
var radius = this.$mask_target.css('border-radius')
|
500
|
-
this.$mask.css({ 'height': height, 'width': width, 'left': 0, 'top': 0, 'border-radius': radius })
|
501
|
-
this.$mask.css({ 'position': 'absolute', 'z-index': 10000 })
|
502
|
-
|
503
|
-
this.$mask_target.append(this.$mask)
|
504
|
-
this.$mask.on('click mousedown mousemove', function(e) {
|
505
|
-
e.preventDefault();
|
506
|
-
return false;
|
507
|
-
})
|
508
|
-
this.$mask.show()
|
509
|
-
},
|
510
|
-
remove: function() {
|
511
|
-
this.$mask.remove()
|
488
|
+
init: function($mask_target, mask_message) {
|
489
|
+
var uuid = new UUID;
|
490
|
+
this.$mask_target = $mask_target
|
491
|
+
this.$mask = $('#thin_man_mask').clone()
|
492
|
+
this.$mask.prop('id', 'thin_man_mask' + uuid.value)
|
493
|
+
if (typeof mask_message != 'undefined') {
|
494
|
+
var $message = this.$mask.find('[data-thin-man-mask-message]')
|
495
|
+
$message.html(mask_message)
|
512
496
|
}
|
497
|
+
var height = this.$mask_target.outerHeight()
|
498
|
+
var width = this.$mask_target.outerWidth()
|
499
|
+
var radius = this.$mask_target.css('border-radius')
|
500
|
+
this.$mask.css({ 'height': height, 'width': width, 'left': 0, 'top': 0, 'border-radius': radius })
|
501
|
+
this.$mask.css({ 'position': 'absolute', 'z-index': 10000 })
|
502
|
+
|
503
|
+
this.$mask_target.append(this.$mask)
|
504
|
+
this.$mask.on('click mousedown mousemove', function(e) {
|
505
|
+
e.preventDefault();
|
506
|
+
return false;
|
507
|
+
})
|
508
|
+
this.$mask.show()
|
509
|
+
},
|
510
|
+
remove: function() {
|
511
|
+
this.$mask.remove()
|
512
|
+
}
|
513
513
|
}),
|
514
514
|
AjaxFlash: Class.extend({
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
},
|
546
|
-
reposition: function(elem) {
|
547
|
-
var this_window = {
|
548
|
-
top: $(window).scrollTop(),
|
549
|
-
left: $(window).scrollLeft(),
|
550
|
-
height: $(window).outerHeight(),
|
551
|
-
width: $(window).outerWidth()
|
552
|
-
};
|
553
|
-
var this_flash = {
|
554
|
-
height: this.flash_container.outerHeight(),
|
555
|
-
width: this.flash_container.outerWidth()
|
556
|
-
}
|
557
|
-
this_window.vert_middle = (this_window.top + (this_window.height / 2));
|
558
|
-
this_window.horiz_middle = (this_window.left + (this_window.width / 2));
|
559
|
-
this_flash.half_height = (this_flash.height / 2);
|
560
|
-
this_flash.half_width = (this_flash.width / 2);
|
561
|
-
var new_top = this_window.vert_middle - this_flash.half_height;
|
562
|
-
var new_left = this_window.horiz_middle - this_flash.half_width;
|
563
|
-
this.flash_container.css({ left: new_left, top: new_top, visibility: 'visible' });
|
564
|
-
var ajax_flash = this;
|
565
|
-
if (this.fade) {
|
566
|
-
setTimeout(function() { ajax_flash.fadeOut() }, 1618);
|
567
|
-
}
|
568
|
-
},
|
569
|
-
fadeOut: function() {
|
570
|
-
this.flash_container.fadeOut('slow');
|
515
|
+
init: function(type, message, elem, duration) {
|
516
|
+
this.flash_container = $('[data-thin-man-flash-template]').clone();
|
517
|
+
this.flash_container.removeAttr('data-thin-man-flash-template');
|
518
|
+
this.flash_container.attr('data-thin-man-flash-container', true);
|
519
|
+
$('body').append(this.flash_container);
|
520
|
+
this.flash_container.css({ position: 'absolute', visibility: 'hidden' });
|
521
|
+
this.alert_type = type;
|
522
|
+
this.elem = elem;
|
523
|
+
var alert_class = 'alert-' + type;
|
524
|
+
this.flash_container.addClass(alert_class);
|
525
|
+
this.flash_content = this.flash_container.find('[data-thin-man-flash-content]');
|
526
|
+
this.flash_content.html(message);
|
527
|
+
this.flash_container.show();
|
528
|
+
this.setFadeBehavior(duration);
|
529
|
+
this.reposition(elem);
|
530
|
+
this.bindDismisser();
|
531
|
+
},
|
532
|
+
setFadeBehavior: function(duration) {
|
533
|
+
if (duration) {
|
534
|
+
if ('persist' == duration) {
|
535
|
+
this.fade = false
|
536
|
+
} else {
|
537
|
+
this.fade = true
|
538
|
+
}
|
539
|
+
} else { //default behavior if persist duration is not sent back with message
|
540
|
+
if ('error' == this.alert_type || 'warning' == this.alert_type || 'info' == this.alert_type) {
|
541
|
+
this.fade = false;
|
542
|
+
} else {
|
543
|
+
this.fade = true;
|
544
|
+
}
|
571
545
|
}
|
546
|
+
},
|
547
|
+
reposition: function(elem) {
|
548
|
+
var this_window = {
|
549
|
+
top: $(window).scrollTop(),
|
550
|
+
left: $(window).scrollLeft(),
|
551
|
+
height: $(window).outerHeight(),
|
552
|
+
width: $(window).outerWidth()
|
553
|
+
};
|
554
|
+
var this_flash = {
|
555
|
+
height: this.flash_container.outerHeight(),
|
556
|
+
width: this.flash_container.outerWidth()
|
557
|
+
}
|
558
|
+
this_window.vert_middle = (this_window.top + (this_window.height / 2));
|
559
|
+
this_window.horiz_middle = (this_window.left + (this_window.width / 2));
|
560
|
+
this_flash.half_height = (this_flash.height / 2);
|
561
|
+
this_flash.half_width = (this_flash.width / 2);
|
562
|
+
var new_top = this_window.vert_middle - this_flash.half_height;
|
563
|
+
var new_left = this_window.horiz_middle - this_flash.half_width;
|
564
|
+
this.flash_container.css({ left: new_left, top: new_top, visibility: 'visible' });
|
565
|
+
var ajax_flash = this;
|
566
|
+
if (this.fade) {
|
567
|
+
setTimeout(function() { ajax_flash.fadeOut() }, 1618);
|
568
|
+
}
|
569
|
+
},
|
570
|
+
fadeOut: function() {
|
571
|
+
this.flash_container.fadeOut('slow');
|
572
|
+
},
|
573
|
+
bindDismisser: function() {
|
574
|
+
this.$dismisser = this.flash_container.find('[data-dismiss]')
|
575
|
+
var ajax_flash = this
|
576
|
+
this.$dismisser.on('click', function(){
|
577
|
+
ajax_flash.flash_container.remove()
|
578
|
+
})
|
579
|
+
}
|
572
580
|
}),
|
573
581
|
AjaxSorter: Class.extend({
|
574
582
|
init: function($sort_container) {
|
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.20.
|
4
|
+
version: 0.20.2
|
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: 2018-10-
|
11
|
+
date: 2018-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|