From 09b458af68449ba973c37b44456ea36ca9f6c29b Mon Sep 17 00:00:00 2001 From: Keir Nellyer Date: Thu, 11 Aug 2016 11:30:10 +0100 Subject: [PATCH] Mega-hack to remove unwanted whitespace (allowing the page to render correctly) --- Plugins/Mineplex.ReportSite/js/main.js | 17 +++++++++ Plugins/Mineplex.ReportSite/view.php | 49 ++++++++++++++------------ 2 files changed, 44 insertions(+), 22 deletions(-) create mode 100644 Plugins/Mineplex.ReportSite/js/main.js diff --git a/Plugins/Mineplex.ReportSite/js/main.js b/Plugins/Mineplex.ReportSite/js/main.js new file mode 100644 index 000000000..de5005901 --- /dev/null +++ b/Plugins/Mineplex.ReportSite/js/main.js @@ -0,0 +1,17 @@ +$(document).ready(function() { + /** + * Remove leading and trailing whitespace in username span + */ + $('#log').find("> .log-line > .remove-whitespace > span").filter(function() { + return $(this).text() === ': '; + }).prev().each(function() { + $(this).text($(this).text().trim()); + }); + + /** + * Remove newlines and whitespace in tags with the '.remove-whitespace' class. + */ + $('.remove-whitespace').contents().filter(function() { + return this.nodeType = Node.TEXT_NODE && /\S/.test(this.nodeValue) === false; + }).remove(); +}); diff --git a/Plugins/Mineplex.ReportSite/view.php b/Plugins/Mineplex.ReportSite/view.php index 562168f58..6b8abb69e 100644 --- a/Plugins/Mineplex.ReportSite/view.php +++ b/Plugins/Mineplex.ReportSite/view.php @@ -376,9 +376,7 @@ - - @@ -461,29 +459,31 @@ $typeId = $message->getType(); $typeDisplayName = Message::$TYPE_DISPLAY_NAMES[$typeId]; $isPM = $typeId == Message::TYPE_PM; + ?> - if($isPM): ?> - - - - - - + + + + + + + + - - getSender()->getUsername() ?> + + getSender()->getUsername() ?> + + +  -> getRecipients()[0]->getUsername() ?> + + + : + + getMessage() ?> + +
+
- - -  -> getRecipients()[0]->getUsername() ?> - - - : - getMessage() ?> - - -
- @@ -550,6 +550,11 @@ + + + + + close();