From 670dba86c4f2c14dd028ffe2857a7b6a11a987a8 Mon Sep 17 00:00:00 2001 From: kasimi Date: Sat, 29 Oct 2016 12:57:32 +0200 Subject: [PATCH 01/40] Calculate message length without HTML entities --- core/mchat.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/mchat.php b/core/mchat.php index 1008def..691e8a5 100644 --- a/core/mchat.php +++ b/core/mchat.php @@ -1491,7 +1491,8 @@ protected function process_message($message) // Must not exceed character limit if ($this->settings->cfg('mchat_max_message_lngth')) { - if (utf8_strlen($message) > $this->settings->cfg('mchat_max_message_lngth')) + $message_without_entities = htmlspecialchars_decode($message, ENT_COMPAT); + if (utf8_strlen($message_without_entities) > $this->settings->cfg('mchat_max_message_lngth')) { throw new http_exception(400, 'MCHAT_MESS_LONG', array($this->settings->cfg('mchat_max_message_lngth'))); } From d264f8d11135100f286af10b21f3a16898f8210e Mon Sep 17 00:00:00 2001 From: kasimi Date: Mon, 31 Oct 2016 23:43:59 +0100 Subject: [PATCH 02/40] Removed redundant custom page explanation --- adm/style/acp_mchat_globalsettings.html | 3 +-- language/en/mchat_acp.php | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/adm/style/acp_mchat_globalsettings.html b/adm/style/acp_mchat_globalsettings.html index 4418b95..d1ee028 100644 --- a/adm/style/acp_mchat_globalsettings.html +++ b/adm/style/acp_mchat_globalsettings.html @@ -40,8 +40,7 @@

{L_WARNING}

-

- {L_MCHAT_CUSTOM_PAGE_EXPLAIN}
+
diff --git a/language/en/mchat_acp.php b/language/en/mchat_acp.php index 9b1db64..a5bc91a 100644 --- a/language/en/mchat_acp.php +++ b/language/en/mchat_acp.php @@ -98,7 +98,6 @@ 'MCHAT_MAX_MESSAGE_LENGTH' => 'Maximum message length', 'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Maximum number of characters allowed per message posted.
You are limited from 0 to 1000. Default is 500. Set to 0 to disable.', 'MCHAT_CUSTOM_PAGE' => 'Enable custom Page', - 'MCHAT_CUSTOM_PAGE_EXPLAIN' => 'Allow the use of the custom page', 'MCHAT_CUSTOM_HEIGHT' => 'Custom page height', 'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the custom page.
You are limited from 50 to 1000. Default is 350.', 'MCHAT_BBCODES_DISALLOWED' => 'Disallowed bbcodes', From 976cd1751a7e1c0fd881cb2774d07fabd96e97d4 Mon Sep 17 00:00:00 2001 From: kasimi Date: Mon, 31 Oct 2016 23:45:34 +0100 Subject: [PATCH 03/40] Minor improvements for ACP language --- language/en/mchat_acp.php | 4 ++-- language/en/permissions_mchat.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/language/en/mchat_acp.php b/language/en/mchat_acp.php index a5bc91a..a1cccdb 100644 --- a/language/en/mchat_acp.php +++ b/language/en/mchat_acp.php @@ -62,7 +62,7 @@ 'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Global user settings', 'MCHAT_VERSION' => 'Version', 'MCHAT_RULES' => 'Rules', - 'MCHAT_RULES_EXPLAIN' => 'Enter the rules of the forum here. HTML code is allowed. You are limited to 255 characters.
This message can be translated: edit the MCHAT_RULES_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.', + 'MCHAT_RULES_EXPLAIN' => 'Enter the rules here. HTML code is allowed. You are limited to 255 characters.
This message can be translated: edit the MCHAT_RULES_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.', 'MCHAT_CONFIG_SAVED' => 'mChat configuration has been updated', 'MCHAT_AVATARS' => 'Display avatars', 'MCHAT_AVATARS_EXPLAIN' => 'If set to yes, resized user avatars will be displayed', @@ -97,7 +97,7 @@ 'MCHAT_EDIT_DELETE_LIMIT_EXPLAIN' => 'Messages older than the specified number of seconds cannot be edited or deleted by the author any more.
Users who have edit/delete permission as well as moderator permission are exempt from this time limit.
Set to 0 to allow unlimited editing and deleting.', 'MCHAT_MAX_MESSAGE_LENGTH' => 'Maximum message length', 'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Maximum number of characters allowed per message posted.
You are limited from 0 to 1000. Default is 500. Set to 0 to disable.', - 'MCHAT_CUSTOM_PAGE' => 'Enable custom Page', + 'MCHAT_CUSTOM_PAGE' => 'Enable custom page', 'MCHAT_CUSTOM_HEIGHT' => 'Custom page height', 'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the custom page.
You are limited from 50 to 1000. Default is 350.', 'MCHAT_BBCODES_DISALLOWED' => 'Disallowed bbcodes', diff --git a/language/en/permissions_mchat.php b/language/en/permissions_mchat.php index 7b5767f..1834312 100644 --- a/language/en/permissions_mchat.php +++ b/language/en/permissions_mchat.php @@ -60,7 +60,7 @@ 'ACL_U_MCHAT_LOCATION' => 'Can customise Location of mChat on the index page', 'ACL_U_MCHAT_MESSAGE_TOP' => 'Can customise Location of new chat messages', 'ACL_U_MCHAT_PAUSE_ON_INPUT' => 'Can customise Pause on input', - 'ACL_U_MCHAT_POSTS' => 'Can customise Display new post', + 'ACL_U_MCHAT_POSTS' => 'Can customise Display new posts', 'ACL_U_MCHAT_RELATIVE_TIME' => 'Can customise Display relative time', 'ACL_U_MCHAT_SOUND' => 'Can customise Play sounds', 'ACL_U_MCHAT_WHOIS_INDEX' => 'Can customise Display who is chatting below the chat', From c02d2051cc7c6942502990d6d67f309ba2fefac6 Mon Sep 17 00:00:00 2001 From: kasimi Date: Mon, 31 Oct 2016 23:45:53 +0100 Subject: [PATCH 04/40] Added template event dmzx_mchat_messages_icons_after --- styles/prosilver/template/mchat_messages_icons.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/styles/prosilver/template/mchat_messages_icons.html b/styles/prosilver/template/mchat_messages_icons.html index 4494512..c17ecbf 100644 --- a/styles/prosilver/template/mchat_messages_icons.html +++ b/styles/prosilver/template/mchat_messages_icons.html @@ -1,4 +1,5 @@ + @@ -23,3 +24,5 @@ + + From aced6b1e59d6faf79d74b02f3daaeedfc5150e70 Mon Sep 17 00:00:00 2001 From: kasimi Date: Mon, 31 Oct 2016 23:46:19 +0100 Subject: [PATCH 05/40] Added CSS class mchat-messages-top to main container --- styles/prosilver/template/mchat_body.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/prosilver/template/mchat_body.html b/styles/prosilver/template/mchat_body.html index b371140..61a720d 100644 --- a/styles/prosilver/template/mchat_body.html +++ b/styles/prosilver/template/mchat_body.html @@ -76,7 +76,7 @@

{L_CONFIRM}

-
+
class="mchat-messages-top">
  • {MCHAT_STATIC_MESS}
  • From 29c0334c2f23976b8c08b950e118e597eb3397c3 Mon Sep 17 00:00:00 2001 From: kasimi Date: Mon, 31 Oct 2016 23:46:45 +0100 Subject: [PATCH 06/40] Fixed resetting input field width when clicking the submit button --- styles/all/template/javascript/mchat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/all/template/javascript/mchat.js b/styles/all/template/javascript/mchat.js index 160a8f2..9ab6983 100644 --- a/styles/all/template/javascript/mchat.js +++ b/styles/all/template/javascript/mchat.js @@ -218,11 +218,11 @@ jQuery(function($) { if (color && inputValue.indexOf('[color=') === -1) { inputValue = '[color=#' + color + '] ' + inputValue + ' [/color]'; } - mChat.cached('input').val('').focus(); + mChat.cached('input').val('').trigger('update.autogrow').focus(); mChat.refresh(inputValue).done(function() { mChat.resetSession(); }).fail(function() { - mChat.cached('input').val(originalInputValue); + mChat.cached('input').val(originalInputValue).trigger('update.autogrow'); }).always(function() { mChat.cached('add').prop('disabled', false); setTimeout(function() { From 97c9ab3ec6641ff1bba786eabb7301a2669bbce9 Mon Sep 17 00:00:00 2001 From: kasimi Date: Tue, 27 Dec 2016 13:08:35 +0100 Subject: [PATCH 07/40] Fixed wrapper height for Modern-silver style --- .../template/event/overall_header_head_append.html | 2 ++ styles/Modern-silver/theme/mchat_custom.css | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 styles/Modern-silver/template/event/overall_header_head_append.html create mode 100644 styles/Modern-silver/theme/mchat_custom.css diff --git a/styles/Modern-silver/template/event/overall_header_head_append.html b/styles/Modern-silver/template/event/overall_header_head_append.html new file mode 100644 index 0000000..22a6a0f --- /dev/null +++ b/styles/Modern-silver/template/event/overall_header_head_append.html @@ -0,0 +1,2 @@ + + diff --git a/styles/Modern-silver/theme/mchat_custom.css b/styles/Modern-silver/theme/mchat_custom.css new file mode 100644 index 0000000..318a316 --- /dev/null +++ b/styles/Modern-silver/theme/mchat_custom.css @@ -0,0 +1,11 @@ +/** + * + * @package phpBB Extension - mChat + * @copyright (c) 2016 kasimi - https://kasimi.net + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 + * + */ + +.mchat-wrapper { + height: 100%; +} From e54155f56c5197d5d70e59e2ada0a039a7e2176d Mon Sep 17 00:00:00 2001 From: kasimi Date: Tue, 27 Dec 2016 13:09:12 +0100 Subject: [PATCH 08/40] Fixed space between sound checkbox and label --- styles/prosilver/theme/mchat.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/styles/prosilver/theme/mchat.css b/styles/prosilver/theme/mchat.css index 1ce8499..f0fd9f8 100644 --- a/styles/prosilver/theme/mchat.css +++ b/styles/prosilver/theme/mchat.css @@ -337,8 +337,13 @@ textarea#mchat-input { content: ''; } -.mchat-footer label { +#mchat-user-sound { + margin: 0; +} + +#mchat-user-sound + label { padding-right: 0; + padding-left: 5px; } #mchat-legend { From 8f7cc10fff1869f3b41247c3d76b48b48ba18fd8 Mon Sep 17 00:00:00 2001 From: kasimi Date: Tue, 27 Dec 2016 13:14:07 +0100 Subject: [PATCH 09/40] Added template events dmzx_mchat_messages_header_before|after and dmzx_mchat_messages_text_before|after --- styles/prosilver/template/mchat_messages.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/styles/prosilver/template/mchat_messages.html b/styles/prosilver/template/mchat_messages.html index 69a9d82..2fa8a06 100644 --- a/styles/prosilver/template/mchat_messages.html +++ b/styles/prosilver/template/mchat_messages.html @@ -12,8 +12,16 @@
    -
    {mchatrow.MCHAT_USERNAME_FULL} • data-mchat-minutes-ago="{mchatrow.MCHAT_MINUTES_AGO}" data-mchat-relative-update="{mchatrow.MCHAT_RELATIVE_UPDATE}">{mchatrow.MCHAT_TIME}
    -
    {mchatrow.MCHAT_MESSAGE}
    +
    + + {mchatrow.MCHAT_USERNAME_FULL} • data-mchat-minutes-ago="{mchatrow.MCHAT_MINUTES_AGO}" data-mchat-relative-update="{mchatrow.MCHAT_RELATIVE_UPDATE}">{mchatrow.MCHAT_TIME} + +
    +
    + + {mchatrow.MCHAT_MESSAGE} + +
    From db399bcdc1ed428fe0816592be794a66a0016d2b Mon Sep 17 00:00:00 2001 From: kasimi Date: Tue, 27 Dec 2016 13:15:01 +0100 Subject: [PATCH 10/40] Only add CSS for mChat container height where necessary --- .../template/event/overall_header_stylesheets_after.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/prosilver/template/event/overall_header_stylesheets_after.html b/styles/prosilver/template/event/overall_header_stylesheets_after.html index dcbe4c7..fc6000b 100644 --- a/styles/prosilver/template/event/overall_header_stylesheets_after.html +++ b/styles/prosilver/template/event/overall_header_stylesheets_after.html @@ -1,4 +1,4 @@ - +