From f71f7ad7db2db9ff22fc6bdcfc0848f1caf7cd85 Mon Sep 17 00:00:00 2001 From: C-Lodder Date: Thu, 1 Oct 2015 12:44:18 +0100 Subject: [PATCH 1/2] Added option to hide history --- changelog.php | 3 + .../language/de-DE/de-DE.mod_shoutbox.ini | 1 + .../language/en-GB/en-GB.mod_shoutbox.ini | 1 + .../language/it-IT/it-IT.mod_shoutbox.ini | 1 + .../language/nb-NO/nb-NO.mod_shoutbox.ini | 1 + .../language/nl-NL/nl_NL.mod_shoutbox.ini | 1 + .../language/pl-PL/pl-PL.mod_shoutbox.ini | 1 + mod_shoutbox/media/js/mod_shoutbox.js | 13 +- mod_shoutbox/mod_shoutbox.php | 1 + mod_shoutbox/mod_shoutbox.xml | 4 + mod_shoutbox/tmpl/default.php | 125 ++++++++++-------- 11 files changed, 90 insertions(+), 62 deletions(-) diff --git a/changelog.php b/changelog.php index b654cf3..d8dc7b2 100644 --- a/changelog.php +++ b/changelog.php @@ -14,6 +14,9 @@ - -> Removed ! -> Note +WIP ++ Added option to hide history + Version 6.0.1 # Fixes to smiley dropdown for Bootstrap 3 diff --git a/mod_shoutbox/language/de-DE/de-DE.mod_shoutbox.ini b/mod_shoutbox/language/de-DE/de-DE.mod_shoutbox.ini index 190c284..49ff12b 100644 --- a/mod_shoutbox/language/de-DE/de-DE.mod_shoutbox.ini +++ b/mod_shoutbox/language/de-DE/de-DE.mod_shoutbox.ini @@ -138,5 +138,6 @@ SHOUT_HTML5_NOTIFICATION_LABEL="HTML5 Notifications" SHOUT_HTML5_NOTIFICATION_DESC="Select whether or not you'd like to use HTML5 notifications when a new shout has been posted. Please note this will not work in Internet Explorer, Edge and some mobile browsers." SHOUT_NEW_SHOUT_ALERT="New Shout!" SHOUT_HISTORY="Shoutbox History" +SHOUT_HISTORY_DESC="Select whether or not you'd like to be able to view the shoutbox history" SHOUT_HISTORY_BUTTON="History" SHOUT_HISTORY_LOAD_MORE="Load more" \ No newline at end of file diff --git a/mod_shoutbox/language/en-GB/en-GB.mod_shoutbox.ini b/mod_shoutbox/language/en-GB/en-GB.mod_shoutbox.ini index 4753d1f..4896e8b 100644 --- a/mod_shoutbox/language/en-GB/en-GB.mod_shoutbox.ini +++ b/mod_shoutbox/language/en-GB/en-GB.mod_shoutbox.ini @@ -138,5 +138,6 @@ SHOUT_HTML5_NOTIFICATION_LABEL="HTML5 Notifications" SHOUT_HTML5_NOTIFICATION_DESC="Select whether or not you'd like to use HTML5 notifications when a new shout has been posted. Please note this will not work in Internet Explorer, Edge and some mobile browsers." SHOUT_NEW_SHOUT_ALERT="New Shout!" SHOUT_HISTORY="Shoutbox History" +SHOUT_HISTORY_DESC="Select whether or not you'd like to be able to view the shoutbox history" SHOUT_HISTORY_BUTTON="History" SHOUT_HISTORY_LOAD_MORE="Load more" \ No newline at end of file diff --git a/mod_shoutbox/language/it-IT/it-IT.mod_shoutbox.ini b/mod_shoutbox/language/it-IT/it-IT.mod_shoutbox.ini index bda6894..fa00ac5 100644 --- a/mod_shoutbox/language/it-IT/it-IT.mod_shoutbox.ini +++ b/mod_shoutbox/language/it-IT/it-IT.mod_shoutbox.ini @@ -140,5 +140,6 @@ SHOUT_HTML5_NOTIFICATION_LABEL="HTML5 Notifications" SHOUT_HTML5_NOTIFICATION_DESC="Select whether or not you'd like to use HTML5 notifications when a new shout has been posted. Please note this will not work in Internet Explorer, Edge and some mobile browsers." SHOUT_NEW_SHOUT_ALERT="New Shout!" SHOUT_HISTORY="Shoutbox History" +SHOUT_HISTORY_DESC="Select whether or not you'd like to be able to view the shoutbox history" SHOUT_HISTORY_BUTTON="History" SHOUT_HISTORY_LOAD_MORE="Load more" \ No newline at end of file diff --git a/mod_shoutbox/language/nb-NO/nb-NO.mod_shoutbox.ini b/mod_shoutbox/language/nb-NO/nb-NO.mod_shoutbox.ini index 30336fa..526c4d6 100644 --- a/mod_shoutbox/language/nb-NO/nb-NO.mod_shoutbox.ini +++ b/mod_shoutbox/language/nb-NO/nb-NO.mod_shoutbox.ini @@ -140,5 +140,6 @@ SHOUT_HTML5_NOTIFICATION_LABEL="HTML5 Notifications" SHOUT_HTML5_NOTIFICATION_DESC="Select whether or not you'd like to use HTML5 notifications when a new shout has been posted. Please note this will not work in Internet Explorer, Edge and some mobile browsers." SHOUT_NEW_SHOUT_ALERT="New Shout!" SHOUT_HISTORY="Shoutbox History" +SHOUT_HISTORY_DESC="Select whether or not you'd like to be able to view the shoutbox history" SHOUT_HISTORY_BUTTON="History" SHOUT_HISTORY_LOAD_MORE="Load more" \ No newline at end of file diff --git a/mod_shoutbox/language/nl-NL/nl_NL.mod_shoutbox.ini b/mod_shoutbox/language/nl-NL/nl_NL.mod_shoutbox.ini index e6791a1..ab1f265 100644 --- a/mod_shoutbox/language/nl-NL/nl_NL.mod_shoutbox.ini +++ b/mod_shoutbox/language/nl-NL/nl_NL.mod_shoutbox.ini @@ -139,5 +139,6 @@ SHOUT_HTML5_NOTIFICATION_LABEL="HTML5 Notifications" SHOUT_HTML5_NOTIFICATION_DESC="Select whether or not you'd like to use HTML5 notifications when a new shout has been posted. Please note this will not work in Internet Explorer, Edge and some mobile browsers." SHOUT_NEW_SHOUT_ALERT="New Shout!" SHOUT_HISTORY="Shoutbox History" +SHOUT_HISTORY_DESC="Select whether or not you'd like to be able to view the shoutbox history" SHOUT_HISTORY_BUTTON="History" SHOUT_HISTORY_LOAD_MORE="Load more" \ No newline at end of file diff --git a/mod_shoutbox/language/pl-PL/pl-PL.mod_shoutbox.ini b/mod_shoutbox/language/pl-PL/pl-PL.mod_shoutbox.ini index 701663e..997b583 100644 --- a/mod_shoutbox/language/pl-PL/pl-PL.mod_shoutbox.ini +++ b/mod_shoutbox/language/pl-PL/pl-PL.mod_shoutbox.ini @@ -140,5 +140,6 @@ SHOUT_HTML5_NOTIFICATION_LABEL="HTML5 Notifications" SHOUT_HTML5_NOTIFICATION_DESC="Select whether or not you'd like to use HTML5 notifications when a new shout has been posted. Please note this will not work in Internet Explorer, Edge and some mobile browsers." SHOUT_NEW_SHOUT_ALERT="New Shout!" SHOUT_HISTORY="Shoutbox History" +SHOUT_HISTORY_DESC="Select whether or not you'd like to be able to view the shoutbox history" SHOUT_HISTORY_BUTTON="History" SHOUT_HISTORY_LOAD_MORE="Load more" \ No newline at end of file diff --git a/mod_shoutbox/media/js/mod_shoutbox.js b/mod_shoutbox/media/js/mod_shoutbox.js index a8f6cf9..080fa8c 100644 --- a/mod_shoutbox/media/js/mod_shoutbox.js +++ b/mod_shoutbox/media/js/mod_shoutbox.js @@ -353,7 +353,7 @@ jQuery(document).ready(function($) { /** * Submit a shout */ - JJShoutbox.submitPost = function(name, title, securityType, security, Itemid, instance, ReCaptchaResponse) + JJShoutbox.submitPost = function(name, title, securityType, security, Itemid, instance, ReCaptchaResponse, history) { // Assemble some commonly used vars var textarea = instance.find('#jj_message'), @@ -405,7 +405,7 @@ jQuery(document).ready(function($) { } // Refresh the output - JJShoutbox.getPosts(title, false, false, Itemid, instance, false) + JJShoutbox.getPosts(title, false, false, Itemid, instance, false, history) } else { @@ -445,7 +445,7 @@ jQuery(document).ready(function($) { * Get the latest shouts * Play a sound notification if new shouts are shown */ - JJShoutbox.getPosts = function(title, sound, notifications, Itemid, instance, loggedInUser) + JJShoutbox.getPosts = function(title, sound, notifications, Itemid, instance, loggedInUser, history) { // Get the ID of the last shout var lastID = JJShoutbox.getLastID(instance); @@ -472,7 +472,12 @@ jQuery(document).ready(function($) { { instance.find('#jjshoutboxoutput').empty().prepend($('
')); - var historyButton = '
' + Joomla.JText._('SHOUT_HISTORY_BUTTON') + '
'; + var historyButton = ''; + + if (history == 1) + { + historyButton = '
' + Joomla.JText._('SHOUT_HISTORY_BUTTON') + '
'; + } // Grab the html output and append it to the shoutbox message instance.find('.jj-shout-new').after(response.data.html + historyButton); diff --git a/mod_shoutbox/mod_shoutbox.php b/mod_shoutbox/mod_shoutbox.php index 6a65e3f..6ea9551 100644 --- a/mod_shoutbox/mod_shoutbox.php +++ b/mod_shoutbox/mod_shoutbox.php @@ -48,6 +48,7 @@ $messageLength = $params->get('messagelength', '200'); $refresh = $params->get('refresh', 10) * 1000; $deleteown = $params->get('deleteown', 0); +$history = $params->get('history', 1); $remainingLength = JText::_('SHOUT_REMAINING'); // Assemble the factory variables needed diff --git a/mod_shoutbox/mod_shoutbox.xml b/mod_shoutbox/mod_shoutbox.xml index 574b1e8..f94a6cb 100644 --- a/mod_shoutbox/mod_shoutbox.xml +++ b/mod_shoutbox/mod_shoutbox.xml @@ -109,6 +109,10 @@ + + + +
diff --git a/mod_shoutbox/tmpl/default.php b/mod_shoutbox/tmpl/default.php index 6ef91a8..05e7f73 100644 --- a/mod_shoutbox/tmpl/default.php +++ b/mod_shoutbox/tmpl/default.php @@ -85,12 +85,17 @@ { echo $helper->renderPost($shout); } + } + + if ($history == 1) + { + ?> +
+ +
+ - -
- -
+ ?>
@@ -313,46 +318,15 @@ class="" -