//META{"name":"messageHide"}*//

var messageHide = function () {};

messageHide.prototype.start = function () {
	$(document).on("mouseover.rpr", function(e) {
		var contents = $('.chat>.content .messages .message-group .markup');
		var message = $('<span>contents</span>')
		var hideBtn = '<span class="hide" style="cursor:pointer;color:rgba(255,255,255,.8) !important;position:relative;top:-1px;margin-left:10px;text-transform:uppercase;font-size:9px;padding:2px 5px;box-sizing:border-box;background:rgba(0,0,0,0.4)">Hide</span>';
		var unhideBtn = '<span class="unhide" style="cursor:pointer;color:rgba(255,255,255,.8) !important;position:relative;top:-1px;margin-left:10px;text-transform:uppercase;font-size:9px;padding:2px 5px;box-sizing:border-box;background:rgba(0,0,0,0.4)">Unhide</span>';
		contents.on('mouseover', function() {
			if($(this).find('.hide').length == 0) {
				$(this).append(hideBtn);
				$('.hide').on('click', function() {
					$(this).parent().toggle();
				});
			}
		});
		contents.on('mouseleave', function() {
			if($(this).find('.hide').length == 1) {
				$('.hide').empty().remove();
				$('.unhide').empty().remove();
			}
		});
	});
	console.log('~messageHide initiated~');
};

messageHide.prototype.load = function () {};

messageHide.prototype.unload = function () {
	$(document).off("mouseover.rpr");
};

messageHide.prototype.stop = function () {
	$(document).off("mouseover.rpr");
};

messageHide.prototype.onMessage = function () {
};

messageHide.prototype.onSwitch = function () {
};

messageHide.prototype.getSettingsPanel = function () {
	return  '<label>Unhide All?: </label>' +
		'<button onclick="$(\'contents\').show();">Yes</button>';
};

messageHide.prototype.getName = function () {
    return "Hide Messages";
};

messageHide.prototype.getDescription = function () {
    return "Hide messages with the click of a button";
};

messageHide.prototype.getVersion = function () {
    return "1.0";
};

messageHide.prototype.getAuthor = function () {
    return "llcoll";
};

@@ -162,37 +162,21 @@
 var 
-contents = $('.chat%3E.content 
+allChat = $('
 .mes
@@ -199,16 +199,8 @@
 roup
- .markup
 ');%0A
@@ -209,310 +209,79 @@
 var 
-message = $('%3Cspan%3Econtents%3C/span%3E')%0A%09%09var hideBtn = '%3Cspan class=%22hide%22 style=%22cursor:pointer;color:rgba(255,255,255,.8) !important;position:relative;top:-1px;margin-left:10px;text-transform:uppercase;font-size:9px;padding:2px 5px;box-sizing:border-box;background:rgba(0,0,0,0.4)%22%3EHide%3C/span%3E'
+contents = $('.chat%3E.content .messages .message-group .markup')
 ;%0A%09%09var 
 unhi
@@ -276,18 +276,16 @@
 ;%0A%09%09var 
-un
 hideBtn 
@@ -300,22 +300,21 @@
  class=%22
-un
 hide
+r
 %22 style=
@@ -410,10 +410,9 @@
 eft:
-10
+5
 px;t
@@ -449,9 +449,10 @@
 ize:
-9
+10
 px;p
@@ -458,17 +458,17 @@
 padding:
-2
+3
 px 5px;b
@@ -516,22 +516,21 @@
 0,0.4)%22%3E
-Unh
+H
 ide
+r
 %3C/span%3E'
@@ -588,32 +588,33 @@
 his).find('.hide
+r
 ').length == 0) 
@@ -611,24 +611,126 @@
 gth == 0) %7B%0A
+%09%09%09%09if($(this).find('span').length == 0) %7B%0A%09%09%09%09%09$(this).wrapInner('%3Cspan class=%22txt%22%3E%3C/span%3E');%0A%09%09%09%09%7D%0A
 %09%09%09%09$(this).
@@ -758,16 +758,17 @@
 $('.hide
+r
 ').on('c
@@ -804,15 +804,27 @@
 is).
-parent(
+siblings('span.txt'
 ).to
@@ -879,36 +879,91 @@
 eave', function(
+e
 ) %7B%0A
+%09%09%09if($(this,'span.txt').css('display') != 'none') %7B%0A%09
 %09%09%09if($(this).fi
@@ -971,16 +971,17 @@
 d('.hide
+r
 ').lengt
@@ -986,24 +986,25 @@
 gth == 1) %7B%0A
+%09
 %09%09%09%09$('.hide
@@ -999,25 +999,31 @@
 %09%09%09%09$('.hide
-'
+r',this
 ).empty().re
@@ -1038,38 +1038,9 @@
 %09%09%09%09
-$('.unhide').empty().remove();
+%7D
 %0A%09%09%09
@@ -1479,100 +1479,12 @@
 urn 
- '%3Clabel%3EUnhide All?: %3C/label%3E' +%0A%09%09'%3Cbutton onclick=%22$(%5C'contents%5C').show();%22%3EYes%3C/button%3E'
+null
 ;%0A%7D;

Update messageHide.plugin.js