Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for scaffoldBB #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% if MCHAT_STATS_INDEX %}
</p>
</section>
<section class="stat-block online-list mchat-stats-index">
<h3 class="border-bottom text-uppercase fs-5 fw-bold"><a class="text-decoration-none" href="{% if U_MCHAT_CUSTOM_PAGE and not MCHAT_INDEX %}{{ U_MCHAT_CUSTOM_PAGE }}{% endif %}#mChat">{{ lang('MCHAT_WHO_IS_CHATTING') }}</a></h3>
<p>{{ MCHAT_USERS_TOTAL }} {{ MCHAT_ONLINE_EXPLAIN }}<br>{{ MCHAT_USERS_LIST }}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% if MCHAT_INDEX and not MCHAT_LOCATION %}
{% INCLUDE '@dmzx_mchat/mchat_body.html' %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% if MCHAT_INDEX and MCHAT_LOCATION %}
{% INCLUDE '@dmzx_mchat/mchat_body.html' %}
{% endif %}
1 change: 1 addition & 0 deletions styles/scaffoldBB/template/event/overall_footer_after.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% INCLUDECSS '@dmzx_mchat/mchat_scaffoldBB.css' %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% if MCHAT_PAGE %}
<p class="footer-row mchat-copyright">
<span>{{ MCHAT_DISPLAY_NAME }} &copy; {{ lang('POST_BY_AUTHOR') }} {{ MCHAT_AUTHOR_HOMEPAGES }}</span>
</p>
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% if U_MCHAT_CUSTOM_PAGE or MCHAT_PAGE %}
{% INCLUDE '@dmzx_mchat/mchat_navlink.html' %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% if MCHAT_PAGE and MCHAT_PAGE != 'archive' %}
<style>
{% if MCHAT_PAGE == 'custom' and MCHAT_CUSTOM_HEIGHT or MCHAT_INDEX_HEIGHT %}
#mchat-messages {
height: {{ MCHAT_PAGE == 'custom' ? MCHAT_CUSTOM_HEIGHT : MCHAT_INDEX_HEIGHT }}px;
}
{% endif %}
{% if MCHAT_MAX_INPUT_HEIGHT %}
#mchat-input {
max-height: {{ MCHAT_MAX_INPUT_HEIGHT }}px;
}
{% endif %}
</style>
{% endif %}
144 changes: 144 additions & 0 deletions styles/scaffoldBB/template/mchat_body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{% if MCHAT_PAGE in ['custom', 'archive'] %}
{% INCLUDE 'overall_header.html' %}
{% endif %}

{% EVENT dmzx_mchat_overall_header_after %}

{% EVENT dmzx_mchat_header_before %}

{% if MCHAT_PAGE == 'custom' %}
<h2 class="fs-5">{{ lang('MCHAT_CUSTOM_PAGE') }}</h2>
{% elseif MCHAT_PAGE == 'archive' %}
<h2 class="fs-5">{{ lang('MCHAT_ARCHIVE_PAGE') }}</h2>
{% endif %}

{% EVENT dmzx_mchat_header_after %}

{% INCLUDE '@dmzx_mchat/mchat_script_data.html' %}

{% if MCHAT_PAGE == 'archive' and (loops.pagination|length or MCHAT_TOTAL_MESSAGES) %}
<div class="action-bar bar-top">
{% EVENT dmzx_mchat_action_bar_top_before %}
<div class="pagination gap-1 align-items-center justify-content-end mb-2 pagination">
{{ MCHAT_TOTAL_MESSAGES }}
{% if loops.pagination|length %}
{% INCLUDE 'pagination.html' %}
{% else %}
&bull; {{ PAGE_NUMBER }}
{% endif %}
</div>
{% EVENT dmzx_mchat_action_bar_top_after %}
</div>
{% endif %}

{% EVENT dmzx_mchat_before %}

{% if MCHAT_IS_COLLAPSIBLE %}
<a class="category{% if S_MCHAT_HIDDEN %} hidden-category{% endif %} mchat-category"></a>
{% endif %}

<div class="bg-gradient bg-primary forabg mb-3 rounded-3 py-1 px-2 forabg mchat-wrapper{% if S_MCHAT_AVATARS %} mchat-avatars{% endif %}">
<a id="mChat" class="position-absolute invisible"></a>
<div class="inner mb-1">
<ul class="list-unstyled mb-0 mchat-header text-white topiclist">
<li class="header">
{% INCLUDE '@dmzx_mchat/mchat_header.html' %}
{% if MCHAT_IS_COLLAPSIBLE %}
<a href="{{ U_MCHAT_COLLAPSE_URL }}"
class="collapse-btn collapse-{{ S_MCHAT_HIDDEN ? 'show' : 'hide' }} mchat-collapse"
data-hidden="{{ S_MCHAT_HIDDEN }}"
data-ajax="phpbb_collapse"
data-overlay="true"
title="{{ lang('MCHAT_COLLAPSE_TITLE') }}"><i class="fa {% if S_MCHAT_HIDDEN %}fa-plus-square{% else %}fa-minus-square{% endif %}"></i></a>
{% endif %}
</li>
</ul>

{% EVENT dmzx_mchat_body_before %}

<div id="mchat-body" class="bg-body overflow-hidden position-relative w-100{% if MCHAT_IS_COLLAPSIBLE %} collapsible{% endif %}">
{% if MCHAT_SOUND_ENABLED %}
<audio id="mchat-sound-add" class="hidden" src="{{ EXT_URL }}sounds/add.mp3" preload="auto"></audio>
<audio id="mchat-sound-edit" class="hidden" src="{{ EXT_URL }}sounds/edit.mp3" preload="auto"></audio>
<audio id="mchat-sound-del" class="hidden" src="{{ EXT_URL }}sounds/del.mp3" preload="auto"></audio>
<audio id="mchat-sound-error" class="hidden" src="{{ EXT_URL }}sounds/error.mp3" preload="auto"></audio>
{% endif %}

<div id="mchat-confirm" class="hidden">
<h3 class="modal-header">{{ lang('CONFIRM') }}</h3>
<div class="mchat-confirm-fields modal-body">
<p></p>
<textarea class="form-control form-control-sm"></textarea>
</div>
<fieldset class="justify-content-center modal-footer submit-buttons">
<input type="button" name="confirm" value="{{ lang('MCHAT_OK') }}" class="button2 btn btn-sm btn-success">&nbsp;
<input type="button" name="cancel" value="{{ lang('CANCEL') }}" class="button2 btn btn-sm btn-danger">
</fieldset>
</div>

{% if MCHAT_STATIC_MESS and MCHAT_PAGE != 'archive' %}
{% EVENT dmzx_mchat_static_container_before %}
<ul class="forums list-unstyled mb-0 mchat-static-container topiclist">
<li class="border-2 border-bottom d-flex gap-2 mchat-static p-1">{{ MCHAT_STATIC_MESS }}</li>
</ul>
{% EVENT dmzx_mchat_static_container_after %}
{% endif %}

<div id="mchat-main" class="{{ MCHAT_MESSAGE_TOP ? 'mchat-messages-top' : 'mchat-messages-bottom' }}">
{% EVENT dmzx_mchat_messages_container_before %}

<ul id="mchat-messages" class="forums mb-0 list-unstyled topiclist overflow-auto">
{% if loops.mchatrow|length %}
{% INCLUDE '@dmzx_mchat/mchat_messages.html' %}
{% elseif not MCHAT_TOTAL_MESSAGES %}
<li class="row gx-0 px-2 mchat-static mchat-no-messages">{{ lang('MCHAT_NOMESSAGE') }}</li>
{% endif %}
</ul>

{% EVENT dmzx_mchat_messages_container_after %}
</div>

{% INCLUDE '@dmzx_mchat/mchat_panel.html' %}
</div>

{% EVENT dmzx_mchat_body_after %}
</div>
</div>

{% EVENT dmzx_mchat_after %}

{% if MCHAT_PAGE == 'archive' and (loops.pagination|length or MCHAT_TOTAL_MESSAGES) %}
<div class="action-bar bottom">
{% EVENT dmzx_mchat_action_bar_bottom_before %}
<div class="pagination gap-1 align-items-center justify-content-end mb-2">
{{ MCHAT_TOTAL_MESSAGES }}
{% if loops.pagination|length %}
{% INCLUDE 'pagination.html' %}
{% else %}
&bull; {{ PAGE_NUMBER }}
{% endif %}
</div>
{% EVENT dmzx_mchat_action_bar_top_after %}
</div>
{% endif %}

{% if MCHAT_PAGE == 'custom' and MCHAT_WHOIS_INDEX %}
<h3 class="fs-5">{{ lang('MCHAT_WHO_IS_CHATTING') }}</h3>
{% INCLUDE '@dmzx_mchat/mchat_whois.html' %}
<div id="mchat-refresh">
<span id="mchat-refresh-explain">{{ lang('MCHAT_WHO_IS_REFRESH_EXPLAIN', MCHAT_WHOIS_REFRESH / 1000) }}</span>
<span id="mchat-refresh-pending" class="hidden">{{ lang('MCHAT_REFRESHING') }}</span>
</div>
{% endif %}

{% if MCHAT_PAGE in ['custom', 'archive'] and LEGEND %}
<div id="mchat-legend">
<em>{{ lang('LEGEND') ~ lang('COLON') }} {{ LEGEND }}</em>
</div>
{% endif %}

{% EVENT dmzx_mchat_overall_footer_before %}

{% if MCHAT_PAGE in ['custom', 'archive'] %}
{% INCLUDE 'overall_footer.html' %}
{% endif %}
9 changes: 9 additions & 0 deletions styles/scaffoldBB/template/mchat_header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<dl class="row-item mb-0">
<dt>
<div class="list-inner">
{% INCLUDE '@dmzx_mchat/mchat_title.html' %}
{% INCLUDE '@dmzx_mchat/mchat_status.html' %}
</div>
</dt>
<dd></dd>
</dl>
30 changes: 30 additions & 0 deletions styles/scaffoldBB/template/mchat_messages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{%- EVENT dmzx_mchat_messages_before -%}

{%- for mchatrow in loops.mchatrow -%}
<li id="mchat-message-{{ mchatrow.MCHAT_MESSAGE_ID }}" class="border-2 border-bottom d-flex gap-2 mchat-message p-1 {% if mchatrow.MCHAT_IS_NOTIFICATION %} mchat-notification-message{% endif %}" data-mchat-id="{{ mchatrow.MCHAT_MESSAGE_ID }}" data-mchat-user-id="{{ mchatrow.MCHAT_USER_ID }}" data-mchat-username="{{ mchatrow.MCHAT_USERNAME | striptags }}"{% if mchatrow.MCHAT_USERNAME_COLOR %} data-mchat-usercolor="{{ mchatrow.MCHAT_USERNAME_COLOR }}"{% endif %} data-mchat-message="{{ mchatrow.MCHAT_MESSAGE_EDIT }}" data-mchat-message-time="{{ mchatrow.MCHAT_MESSAGE_TIME }}"{% if MCHAT_EDIT_DELETE_LIMIT and not MCHAT_EDIT_DELETE_IGNORE and (mchatrow.MCHAT_ALLOW_EDIT or mchatrow.MCHAT_ALLOW_DEL) %} data-mchat-edit-delete-limit="1"{% endif %} {% EVENT dmzx_mchat_message_attributes %}>
{% if S_MCHAT_AVATARS %}
<div class="align-items-center d-flex justify-content-center mchat-avatar flex-shrink-0">
{% if mchatrow.U_VIEWPROFILE %}<a href="{{ mchatrow.U_VIEWPROFILE }}" title="{{ lang('READ_PROFILE') }}">{% endif %}
{% if mchatrow.MCHAT_USER_AVATAR %}{{ mchatrow.MCHAT_USER_AVATAR }}{% else %}<img src="{{ STYLE_PATH }}/theme/images/no_avatar.gif" class="mchat-avatar" alt="{{ lang('READ_PROFILE') }}">{% endif %}
{% if mchatrow.U_VIEWPROFILE %}</a>{% endif %}
</div>
{% endif %}
<div class="flex-grow-1 mchat-message-wrapper">
{% INCLUDE '@dmzx_mchat/mchat_messages_icons.html' %}
<div class="clearfix">
<div class="mchat-message-header float-start">
{% EVENT dmzx_mchat_messages_header_before %}
{{ mchatrow.MCHAT_USERNAME_FULL }} &bull; <span class="mchat-time" title="{{ mchatrow.MCHAT_DATETIME }}"{% if mchatrow.MCHAT_MINUTES_AGO != -1 %} data-mchat-minutes-ago="{{ mchatrow.MCHAT_MINUTES_AGO }}" data-mchat-relative-update="{{ mchatrow.MCHAT_RELATIVE_UPDATE }}"{% endif %}>{{ mchatrow.MCHAT_TIME }}</span>
{% EVENT dmzx_mchat_messages_header_after %}
</div>
</div>
<div class="mchat-text text-break text-wrap">
{% EVENT dmzx_mchat_messages_text_before %}
{{ mchatrow.MCHAT_MESSAGE }}
{% EVENT dmzx_mchat_messages_text_after %}
</div>
</div>
</li>
{%- endfor -%}

{%- EVENT dmzx_mchat_messages_after -%}
28 changes: 28 additions & 0 deletions styles/scaffoldBB/template/mchat_messages_icons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{% EVENT dmzx_mchat_messages_icons_before %}

{% if not S_IS_BOT %}
{% DEFINE MCHAT_ALLOW_MENTION = MCHAT_ALLOW_USE and not mchatrow.MCHAT_IS_POSTER and MCHAT_PAGE != 'archive' %}
{% DEFINE MCHAT_ALLOW_QUOTE = MCHAT_ALLOW_USE and S_BBCODE_ALLOWED and MCHAT_ALLOW_QUOTE and MCHAT_PAGE != 'archive' %}
{% DEFINE MCHAT_ALLOW_LIKE = MCHAT_ALLOW_USE and S_BBCODE_ALLOWED and MCHAT_ALLOW_LIKE and MCHAT_PAGE != 'archive' and not mchatrow.MCHAT_IS_POSTER %}
{% DEFINE MCHAT_ALLOW_PM = MCHAT_ALLOW_PM and mchatrow.MCHAT_PM and mchatrow.U_VIEWPROFILE %}
{% DEFINE MCHAT_ALLOW_IP = MCHAT_ALLOW_IP and TRUE %}
{% DEFINE MCHAT_ALLOW_PERMISSIONS = MCHAT_ALLOW_PERMISSIONS and TRUE %}
{% DEFINE MCHAT_ALLOW_EDIT = mchatrow.MCHAT_ALLOW_EDIT and not mchatrow.MCHAT_IS_NOTIFICATION %}
{% DEFINE MCHAT_ALLOW_DEL = mchatrow.MCHAT_ALLOW_DEL %}
{% if definition.MCHAT_ALLOW_MENTION or definition.MCHAT_ALLOW_QUOTE or definition.MCHAT_ALLOW_LIKE or definition.MCHAT_ALLOW_PM or MCHAT_ALLOW_IP or MCHAT_ALLOW_PERMISSIONS or definition.MCHAT_ALLOW_EDIT or definition.MCHAT_ALLOW_DEL or definition.MCHAT_ADD_CUSTOM_BUTTON %}
<ul class="gap-3 gx-0 list-unstyled float-end mchat-buttons px-2 py-1 row row-cols-auto">
{% EVENT dmzx_mchat_messages_icons_add_before %}
{% if definition.MCHAT_ALLOW_MENTION %}<li><a href="#" title="{{ lang('MCHAT_RESPOND') }}" data-mchat-action="mention"><i class="fa fa-at"><span class="visually-hidden">{{ lang('MCHAT_RESPOND') }}</span></i></a></li>{% endif %}
{% if definition.MCHAT_ALLOW_QUOTE %}<li><a href="#" title="{{ lang('REPLY_WITH_QUOTE') }}" data-mchat-action="quote"><i class="fa fa-quote-left"><span class="visually-hidden">{{ lang('REPLY_WITH_QUOTE') }}</span></i></a></li>{% endif %}
{% if definition.MCHAT_ALLOW_LIKE %}<li><a href="#" title="{{ lang('MCHAT_LIKE') }}" data-mchat-action="like"><i class="fa fa-thumbs-o-up"><span class="visually-hidden">{{ lang('MCHAT_LIKE') }}</span></i></a></li>{% endif %}
{% if definition.MCHAT_ALLOW_PM %}<li><a href="{{ mchatrow.MCHAT_PM }}" title="{{ lang('MCHAT_SEND_PM') }}"><i class="fa fa-envelope-o"><span class="visually-hidden">{{ lang('MCHAT_SEND_PM') }}</span></i></a></li>{% endif %}
{% if definition.MCHAT_ALLOW_IP %}<li><a href="{{ mchatrow.MCHAT_U_IP }}" title="{{ mchatrow.MCHAT_WHOIS_USER }}" data-mchat-action="ip"><i class="fa fa-wifi"><span class="visually-hidden">{{ mchatrow.MCHAT_WHOIS_USER }}</span></i></a></li>{% endif %}
{% if definition.MCHAT_ALLOW_PERMISSIONS %}<li><a href="{{ mchatrow.MCHAT_U_PERMISSIONS }}" title="{{ lang('MCHAT_PERMISSIONS') }}"><i class="fa fa-exclamation-triangle"><span class="visually-hidden">{{ lang('MCHAT_PERMISSIONS') }}</span></i></a></li>{% endif %}
{% if definition.MCHAT_ALLOW_EDIT %}<li><a href="#" title="{{ lang('MCHAT_EDIT') }}" data-mchat-action="edit"><i class="fa fa-pencil"><span class="visually-hidden">{{ lang('MCHAT_EDIT') }}</span></i></a></li>{% endif %}
{% if definition.MCHAT_ALLOW_DEL %}<li><a href="#" title="{{ lang('DELETE') }}" data-mchat-action="del"><i class="fa fa-trash-o"><span class="visually-hidden">{{ lang('DELETE') }}</span></i></a></li>{% endif %}
{% EVENT dmzx_mchat_messages_icons_add_after %}
</ul>
{% endif %}
{% endif %}

{% EVENT dmzx_mchat_messages_icons_after %}
65 changes: 65 additions & 0 deletions styles/scaffoldBB/template/mchat_navlink.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{% DEFINE MCHAT_NAVLINK_DISPLAY = U_MCHAT_CUSTOM_PAGE or U_MCHAT_ARCHIVE or U_MCHAT_RULES or MCHAT_SOUND_ENABLED or (MCHAT_ALLOW_USE and MCHAT_MAX_INPUT_HEIGHT) %}

{% EVENT dmzx_mchat_nav_container_before %}

{% if definition.MCHAT_NAVLINK_DISPLAY %}
<li class="mchat-nav nav-item dropdown" data-select-match="mchat">
<a href="#" class="nav-link dropdown-toggle px-1 py-0 text-body" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false"><i class="icon fa fa-weixin fa-fw" aria-hidden="true"></i><span class="mchat-nav-link">{{ MCHAT_TITLE }}</span></a>
<div class="mchat-nav-container dropdown-menu" >
<ul class="mchat-nav-menu list-unstyled" role="menu">
<li><hr class="dropdown-divider"></li>
{% EVENT dmzx_mchat_nav_items_before %}
{% if U_MCHAT_CUSTOM_PAGE %}
<li class="mchat-nav-custom-page">
<a class="dropdown-item text-body" href="{{ U_MCHAT_CUSTOM_PAGE }}" title="{{ lang('MCHAT_NAVBAR_CUSTOM_PAGE') }}" role="menuitem">
<i class="icon fa fa-weixin fa-fw" aria-hidden="true"></i><span>{{ lang('MCHAT_NAVBAR_CUSTOM_PAGE') }}</span>
</a>
</li>
{% endif %}
{% EVENT dmzx_mchat_nav_items_custom_page_after %}
{% if U_MCHAT_ARCHIVE %}
<li class="mchat-nav-archive">
<a class="dropdown-item text-body" href="{{ U_MCHAT_ARCHIVE }}" title="{{ lang('MCHAT_NAVBAR_ARCHIVE') }}" role="menuitem">
<i class="icon fa fa-history fa-fw" aria-hidden="true"></i><span>{{ lang('MCHAT_NAVBAR_ARCHIVE') }}</span>
</a>
</li>
{% endif %}
{% EVENT dmzx_mchat_nav_items_archive_after %}
{% if U_MCHAT_RULES %}
<li class="mchat-nav-rules">
<a class="dropdown-item text-body" href="{{ U_MCHAT_RULES }}" title="{{ lang('MCHAT_NAVBAR_RULES') }}" role="menuitem" data-mchat-action="rules">
<i class="icon fa fa-exclamation fa-fw" aria-hidden="true"></i><span>{{ lang('MCHAT_NAVBAR_RULES') }}</span>
</a>
</li>
{% endif %}
{% EVENT dmzx_mchat_nav_items_rules_after %}
{% if MCHAT_PAGE %}
{% EVENT dmzx_mchat_nav_items_sound_before %}
{% if MCHAT_SOUND_ENABLED %}
<li id="mchat-sound" class="mchat-nav-item-enabled" data-mchat-action="toggle_sound">
<a class="dropdown-item text-body" href="#" title="{{ lang('MCHAT_USESOUND') }}" role="menuitem">
<span class="mchat-nav-item-enabled"><i class="icon fa fa-volume-up fa-fw" aria-hidden="true"></i>{{ lang('MCHAT_SOUND_ON') }}</span>
<span class="mchat-nav-item-disabled"><i class="icon fa fa-volume-off fa-fw" aria-hidden="true"></i>{{ lang('MCHAT_SOUND_OFF') }}</span>
</a>
</li>
{% endif %}
{% EVENT dmzx_mchat_nav_items_sound_after %}
{% if MCHAT_ALLOW_USE and MCHAT_MAX_INPUT_HEIGHT %}
<li id="mchat-enter" class="mchat-nav-item-enabled" data-mchat-action="toggle_enter">
<a class="dropdown-item text-body" href="#" title="{{ lang('MCHAT_ENTER') }}" role="menuitem">
<span class="mchat-nav-item-enabled"><i class="icon fa fa-chevron-right fa-fw" aria-hidden="true"></i>{{ lang('MCHAT_ENTER_SUBMIT') }}</span>
<span class="mchat-nav-item-disabled"><i class="icon fa fa-chevron-down fa-fw" aria-hidden="true"></i>{{ lang('MCHAT_ENTER_LINEBREAK') }}</span>
</a>
</li>
{% endif %}
{% EVENT dmzx_mchat_nav_items_enter_after %}
{% endif %}
{% EVENT dmzx_mchat_nav_items_after %}
<li><hr class="dropdown-divider"></li>
</ul>
</div>
</li>

{% endif %}

{% EVENT dmzx_mchat_nav_container_after %}
Loading