Improved template code for mChat messages
This commit is contained in:
@@ -347,9 +347,8 @@ class render_helper
|
|||||||
'MCHAT_ALLOW_DEL' => $mchat_del,
|
'MCHAT_ALLOW_DEL' => $mchat_del,
|
||||||
'MCHAT_USER_AVATAR' => $mchat_avatar,
|
'MCHAT_USER_AVATAR' => $mchat_avatar,
|
||||||
'U_VIEWPROFILE' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
'U_VIEWPROFILE' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
||||||
'U_USER_IDS' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id']) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
'MCHAT_IS_POSTER' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id']) ? true : false,
|
||||||
'BOT_USER_ID' => $row['user_id'] != '1',
|
'MCHAT_PM' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id'] && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_'))) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
||||||
'U_USER_ID' => ($row['user_id'] != ANONYMOUS && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && $this->user->data['user_id'] != $row['user_id'] && $row['user_id'] != '1' && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_'))) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
|
||||||
'MCHAT_MESSAGE_EDIT' => $message_edit,
|
'MCHAT_MESSAGE_EDIT' => $message_edit,
|
||||||
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
||||||
'MCHAT_USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
'MCHAT_USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
||||||
@@ -432,7 +431,7 @@ class render_helper
|
|||||||
$rows = array_reverse($rows);
|
$rows = array_reverse($rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($rows as $row)
|
foreach($rows as $row_num => $row)
|
||||||
{
|
{
|
||||||
// auth check
|
// auth check
|
||||||
if ($row['forum_id'] != 0 && !$this->auth->acl_get('f_read', $row['forum_id']))
|
if ($row['forum_id'] != 0 && !$this->auth->acl_get('f_read', $row['forum_id']))
|
||||||
@@ -471,9 +470,8 @@ class render_helper
|
|||||||
'MCHAT_ALLOW_DEL' => $mchat_del,
|
'MCHAT_ALLOW_DEL' => $mchat_del,
|
||||||
'MCHAT_USER_AVATAR' => $mchat_avatar,
|
'MCHAT_USER_AVATAR' => $mchat_avatar,
|
||||||
'U_VIEWPROFILE' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
'U_VIEWPROFILE' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
||||||
'U_USER_IDS' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id']) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
'MCHAT_IS_POSTER' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id']) ? true : false,
|
||||||
'BOT_USER_ID' => $row['user_id'] != '1',
|
'MCHAT_PM' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id'] && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_'))) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
||||||
'U_USER_ID' => ($row['user_id'] != ANONYMOUS && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && $this->user->data['user_id'] != $row['user_id'] && $row['user_id'] != '1' && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_'))) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
|
||||||
'MCHAT_MESSAGE_EDIT' => $message_edit,
|
'MCHAT_MESSAGE_EDIT' => $message_edit,
|
||||||
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
||||||
'MCHAT_USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
'MCHAT_USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
||||||
@@ -783,9 +781,8 @@ class render_helper
|
|||||||
'MCHAT_MESSAGE_EDIT' => $message_edit,
|
'MCHAT_MESSAGE_EDIT' => $message_edit,
|
||||||
'MCHAT_USER_AVATAR' => $mchat_avatar,
|
'MCHAT_USER_AVATAR' => $mchat_avatar,
|
||||||
'U_VIEWPROFILE' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
'U_VIEWPROFILE' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
||||||
'U_USER_IDS' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id']) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
'MCHAT_IS_POSTER' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id']) ? true : false,
|
||||||
'BOT_USER_ID' => $row['user_id'] != '1',
|
'MCHAT_PM' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id'] && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_'))) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
||||||
'U_USER_ID' => ($row['user_id'] != ANONYMOUS && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && $this->user->data['user_id'] != $row['user_id'] && $row['user_id'] != '1' && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_'))) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
|
||||||
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
||||||
'MCHAT_USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
'MCHAT_USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
||||||
'MCHAT_USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
'MCHAT_USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
||||||
@@ -1008,9 +1005,8 @@ class render_helper
|
|||||||
'MCHAT_ALLOW_DEL' => $mchat_del,
|
'MCHAT_ALLOW_DEL' => $mchat_del,
|
||||||
'MCHAT_USER_AVATAR' => $mchat_avatar,
|
'MCHAT_USER_AVATAR' => $mchat_avatar,
|
||||||
'U_VIEWPROFILE' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
'U_VIEWPROFILE' => ($row['user_id'] != ANONYMOUS) ? append_sid("{$this->phpbb_root_path}memberlist.{$this->phpEx}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
||||||
'U_USER_IDS' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id']) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
'MCHAT_IS_POSTER' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id']) ? true : false,
|
||||||
'BOT_USER_ID' => $row['user_id'] != '1',
|
'MCHAT_PM' => ($row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id'] && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_'))) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
||||||
'U_USER_ID' => ($row['user_id'] != ANONYMOUS && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && $this->user->data['user_id'] != $row['user_id'] && $row['user_id'] != '1' && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_'))) ? append_sid("{$this->phpbb_root_path}ucp.{$this->phpEx}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
|
||||||
'MCHAT_MESSAGE_EDIT' => $message_edit,
|
'MCHAT_MESSAGE_EDIT' => $message_edit,
|
||||||
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
||||||
'MCHAT_USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
'MCHAT_USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']),
|
||||||
@@ -1146,6 +1142,7 @@ class render_helper
|
|||||||
'U_MORE_SMILIES' => append_sid("{$this->phpbb_root_path}posting.{$this->phpEx}", 'mode=smilies'),
|
'U_MORE_SMILIES' => append_sid("{$this->phpbb_root_path}posting.{$this->phpEx}", 'mode=smilies'),
|
||||||
'U_MCHAT_RULES' => $this->helper->route('dmzx_mchat_controller', array('mode' => 'rules')),
|
'U_MCHAT_RULES' => $this->helper->route('dmzx_mchat_controller', array('mode' => 'rules')),
|
||||||
'S_MCHAT_ON_INDEX' => ($this->config['mchat_on_index'] && !empty($this->user->data['user_mchat_index'])) ? true : false,
|
'S_MCHAT_ON_INDEX' => ($this->config['mchat_on_index'] && !empty($this->user->data['user_mchat_index'])) ? true : false,
|
||||||
|
'EXT_URL' => generate_board_url() . '/ext/dmzx/mchat/',
|
||||||
));
|
));
|
||||||
|
|
||||||
// Return for: \$this->helper->render(filename, lang_title);
|
// Return for: \$this->helper->render(filename, lang_title);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ jQuery(function($) {
|
|||||||
}, 1000, "swing");
|
}, 1000, "swing");
|
||||||
}
|
}
|
||||||
if (mChat.pause) {
|
if (mChat.pause) {
|
||||||
$("#mChatMessage").bind("keypress", function() {
|
$("#mChatMessage").on("keypress", function() {
|
||||||
clearInterval(mChat.interval);
|
clearInterval(mChat.interval);
|
||||||
$("#mChatLoadIMG,#mChatOkIMG,#mChatErrorIMG").hide();
|
$("#mChatLoadIMG,#mChatOkIMG,#mChatErrorIMG").hide();
|
||||||
$("#mChatRefreshText").html(mChat.refreshNo).addClass("mchat-alert");
|
$("#mChatRefreshText").html(mChat.refreshNo).addClass("mchat-alert");
|
||||||
@@ -90,7 +90,7 @@ jQuery(function($) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
testSubject.insertAfter(input);
|
testSubject.insertAfter(input);
|
||||||
$(this).bind("keypress blur change submit focus", check);
|
$(this).on("keypress blur change submit focus", check);
|
||||||
});
|
});
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
@@ -181,7 +181,7 @@ jQuery(function($) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var messChars = $("#mChatMessage").val().replace(/ /g, "");
|
var messChars = $("#mChatMessage").val().replace(/ /g, "");
|
||||||
if (messChars.length > mChat.mssgLngth && mChat.mssgLngth) {
|
if (mChat.mssgLngth && messChars.length > mChat.mssgLngth) {
|
||||||
alert(mChat.mssgLngthLong);
|
alert(mChat.mssgLngthLong);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -225,7 +225,7 @@ jQuery(function($) {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
edit: function(id) {
|
edit: function(id) {
|
||||||
var message = $("#edit" + id).val();
|
var message = $("#mess" + id).data("edit");
|
||||||
apprise(mChat.editInfo, {
|
apprise(mChat.editInfo, {
|
||||||
"textarea": message,
|
"textarea": message,
|
||||||
"animate": true,
|
"animate": true,
|
||||||
@@ -433,6 +433,16 @@ jQuery(function($) {
|
|||||||
$("#mChatPauseIMG").show();
|
$("#mChatPauseIMG").show();
|
||||||
$("#mChatRefreshText").html(mChat.refreshNo).addClass("mchat-alert");
|
$("#mChatRefreshText").html(mChat.refreshNo).addClass("mchat-alert");
|
||||||
$("#mChatSessMess").html(mChat.sessOut).addClass("mchat-alert");
|
$("#mChatSessMess").html(mChat.sessOut).addClass("mchat-alert");
|
||||||
|
},
|
||||||
|
entityDecode: function(text) {
|
||||||
|
var s = decodeURIComponent(text.replace(/\+/g, " "));
|
||||||
|
s = s.replace(/</g, "<");
|
||||||
|
s = s.replace(/>/g, ">");
|
||||||
|
s = s.replace(/:/g, ':');
|
||||||
|
s = s.replace(/./g, '.');
|
||||||
|
s = s.replace(/&/g, '&');
|
||||||
|
s = s.replace(/"/g, '"');
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -465,6 +475,43 @@ jQuery(function($) {
|
|||||||
$.cookie("mChatNoSound", $(this).is(":checked") ? null : "yes");
|
$.cookie("mChatNoSound", $(this).is(":checked") ? null : "yes");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#mChatmain").on("click", "span.mChatInsertMention", function() {
|
||||||
|
var $msg = $(this).closest('.mChatHover');
|
||||||
|
var username = mChat.entityDecode($msg.data("username"));
|
||||||
|
var usercolor = $msg.data("usercolor");
|
||||||
|
if (usercolor) {
|
||||||
|
username = "[b][color=" + usercolor + "]" + username + "[/color][/b]";
|
||||||
|
} else if (mChat.allowBBCodes) {
|
||||||
|
username = "[b]" + username + "[/b]";
|
||||||
|
}
|
||||||
|
insert_text("@ " + username + ", ");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#mChatData").on("click", "img.mChatInsertQuote", function() {
|
||||||
|
var $msg = $(this).closest('.mChatHover');
|
||||||
|
var username = mChat.entityDecode($msg.data("username"));
|
||||||
|
var id = $msg.data("id");
|
||||||
|
var quote = mChat.entityDecode($("#mess" + id).data("edit"));
|
||||||
|
insert_text('[quote="' + username + '"]' + quote + '[/quote]');
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#mChatData").on("click", "img.mChatInsertLike", function() {
|
||||||
|
var $msg = $(this).closest('.mChatHover');
|
||||||
|
var username = mChat.entityDecode($msg.data("username"));
|
||||||
|
var quote = mChat.entityDecode($msg.data("edit"));
|
||||||
|
insert_text(mChat.likes + '[quote="' + username + '"]' + quote + "[/quote]");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#mChatData").on("click", "img.mChatEdit", function() {
|
||||||
|
var $msg = $(this).closest('.mChatHover');
|
||||||
|
mChat.edit($msg.data("id"));
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#mChatData").on("click", "img.mChatDelete", function() {
|
||||||
|
var $msg = $(this).closest('.mChatHover');
|
||||||
|
mChat.del($msg.data("id"));
|
||||||
|
});
|
||||||
|
|
||||||
// Apprise 1.5 by Daniel Raftery
|
// Apprise 1.5 by Daniel Raftery
|
||||||
// http://thrivingkings.com/apprise
|
// http://thrivingkings.com/apprise
|
||||||
//
|
//
|
||||||
@@ -567,14 +614,14 @@ jQuery(function($) {
|
|||||||
if (!n) {
|
if (!n) {
|
||||||
n = false;
|
n = false;
|
||||||
}
|
}
|
||||||
$(".aTextbox").bind("keydown blur", function() {
|
$(".aTextbox").on("keydown blur", function() {
|
||||||
n = $(this).val();
|
n = $(this).val();
|
||||||
});
|
});
|
||||||
var o = $(".aEdit").val();
|
var o = $(".aEdit").val();
|
||||||
if (!o) {
|
if (!o) {
|
||||||
o = false;
|
o = false;
|
||||||
}
|
}
|
||||||
$(".aEdit").bind("keydown blur", function() {
|
$(".aEdit").on("keydown blur", function() {
|
||||||
o = $(this).val();
|
o = $(this).val();
|
||||||
});
|
});
|
||||||
$(".aButtons > button").click(function() {
|
$(".aButtons > button").click(function() {
|
||||||
|
|||||||
2
styles/prosilver/template/mchat.min.js
vendored
2
styles/prosilver/template/mchat.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,10 +0,0 @@
|
|||||||
<!-- BEGIN mchatrow -->
|
|
||||||
<div id="mess{mchatrow.MCHAT_MESSAGE_ID}" class="mChatBG{mchatrow.MCHAT_CLASS} mChatHover">
|
|
||||||
<div class="mChatAvatars"><!-- IF mchatrow.U_VIEWPROFILE --><a href="{mchatrow.U_VIEWPROFILE}" title="{L_READ_PROFILE}"><!-- ENDIF --><!-- IF mchatrow.MCHAT_USER_AVATAR -->{mchatrow.MCHAT_USER_AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" width="40px;" height="40px;" alt="" /><!-- ENDIF --><!-- IF mchatrow.U_VIEWPROFILE --></a><!-- ENDIF -->
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span style="float:left;"><!-- IF not MCHAT_ARCHIVE_MODE and MCHAT_ADD_MESSAGE --><!-- IF MCHAT_ALLOW_BBCODES --><!-- IF mchatrow.MCHAT_USERNAME_COLOR --><a class="mChatScriptLink" href="#" onclick="insert_text('@ [b][color={mchatrow.MCHAT_USERNAME_COLOR}]{mchatrow.MCHAT_USERNAME}[/color][/b], ', false);return false;" title="{L_MCHAT_RESPOND}"><span style="color: {mchatrow.MCHAT_USERNAME_COLOR}"><strong>@</strong></span></a><!-- ELSE --> <a href="#" class="mChatScriptLink" onclick="insert_text('@ [b]{mchatrow.MCHAT_USERNAME}[/b], ', false);return false;" title="{L_MCHAT_RESPOND}"><strong>@</strong></a><!-- ENDIF --><!-- ELSE --> <a href="#" class="mChatScriptLink" onclick="insert_text('@ {mchatrow.MCHAT_USERNAME}, ', false);return false;" title="{L_MCHAT_RESPOND}">@</a><!-- ENDIF --> <!-- ENDIF -->{mchatrow.MCHAT_USERNAME_FULL} - {mchatrow.MCHAT_TIME}</span>
|
|
||||||
<span style="float:right;"><!-- IF mchatrow.U_USER_ID and mchatrow.BOT_USER_ID and MCHAT_ALLOW_PM and not MCHAT_ARCHIVE_MODE --><a href="{mchatrow.U_USER_ID}" title="{L_MCHAT_SEND_PM}" return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/message.gif" alt="{L_MCHAT_SEND_PM}" title="{L_MCHAT_SEND_PM}" class="mChatImage" /></a> <!-- ENDIF --><!-- IF mchatrow.U_USER_IDS and MCHAT_ALLOW_LIKE and not MCHAT_ARCHIVE_MODE --><a href="#" onclick="insert_like('{mchatrow.MCHAT_USERNAME}','{mchatrow.MCHAT_MESSAGE_EDIT}'); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/like.png" alt="{L_REPLY_WITH_LIKE}" title="{L_REPLY_WITH_LIKE}" class="mChatImage" /></a><!-- ENDIF --> <!-- IF mchatrow.U_USER_IDS and MCHAT_ALLOW_QUOTE and not MCHAT_ARCHIVE_MODE --><a href="#" onclick="insert_quote('{mchatrow.MCHAT_USERNAME}','{mchatrow.MCHAT_MESSAGE_EDIT}'); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/quota.png" alt="{L_REPLY_WITH_QUOTE}" title="{L_REPLY_WITH_QUOTE}" class="mChatImage" /></a><!-- ENDIF --> <!-- IF MCHAT_ALLOW_IP --><a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/ip.gif" alt="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" title="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="#" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" class="mChatImage" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="#" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" class="mChatImage" /></a><!-- ENDIF --></span><br /><div class="avatarMessage mChatMessage">{mchatrow.MCHAT_MESSAGE}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- END mchatrow -->
|
|
||||||
@@ -76,42 +76,6 @@
|
|||||||
focusFix : <!-- IF MCHAT_ARCHIVE_MODE -->false<!-- ELSE -->true<!-- ENDIF -->,
|
focusFix : <!-- IF MCHAT_ARCHIVE_MODE -->false<!-- ELSE -->true<!-- ENDIF -->,
|
||||||
archiveMode : <!-- IF MCHAT_ARCHIVE_MODE -->true<!-- ELSE -->false<!-- ENDIF -->
|
archiveMode : <!-- IF MCHAT_ARCHIVE_MODE -->true<!-- ELSE -->false<!-- ENDIF -->
|
||||||
};
|
};
|
||||||
function insert_quote(user, text) {
|
|
||||||
var quote = decodeURIComponent(text.replace(/\+/g, " "));
|
|
||||||
quote = quote.replace(/</g, "<");
|
|
||||||
quote = quote.replace(/>/g, ">");
|
|
||||||
quote = quote.replace(/:/g, ':');
|
|
||||||
quote = quote.replace(/./g, '.');
|
|
||||||
quote = quote.replace(/&/g, '&');
|
|
||||||
quote = quote.replace(/"/g, '"');
|
|
||||||
var username = decodeURIComponent(user.replace(/\+/g, " "));
|
|
||||||
username = username.replace(/</g, "<");
|
|
||||||
username = username.replace(/>/g, ">");
|
|
||||||
username = username.replace(/:/g, ':');
|
|
||||||
username = username.replace(/./g, '.');
|
|
||||||
username = username.replace(/&/g, '&');
|
|
||||||
username = username.replace(/"/g, '"');
|
|
||||||
document.getElementById('mChatMessage').value += '[quote="' + username + '"]' + quote + '[/quote]';
|
|
||||||
document.getElementById('mChatMessage').focus();
|
|
||||||
}
|
|
||||||
function insert_like(user, text) {
|
|
||||||
var quote = decodeURIComponent(text.replace(/\+/g, " "));
|
|
||||||
quote = quote.replace(/</g, "<");
|
|
||||||
quote = quote.replace(/>/g, ">");
|
|
||||||
quote = quote.replace(/:/g, ':');
|
|
||||||
quote = quote.replace(/./g, '.');
|
|
||||||
quote = quote.replace(/&/g, '&');
|
|
||||||
quote = quote.replace(/"/g, '"');
|
|
||||||
var username = decodeURIComponent(user.replace(/\+/g, " "));
|
|
||||||
username = username.replace(/</g, "<");
|
|
||||||
username = username.replace(/>/g, ">");
|
|
||||||
username = username.replace(/:/g, ':');
|
|
||||||
username = username.replace(/./g, '.');
|
|
||||||
username = username.replace(/&/g, '&');
|
|
||||||
username = username.replace(/"/g, '"');
|
|
||||||
document.getElementById('mChatMessage').value += '' + mChat.likes + '[quote="' + username + '"]' + quote + '[/quote]';
|
|
||||||
document.getElementById('mChatMessage').focus();
|
|
||||||
}
|
|
||||||
// ]]>
|
// ]]>
|
||||||
</script>
|
</script>
|
||||||
<!-- IF not MCHAT_ARCHIVE_MODE -->
|
<!-- IF not MCHAT_ARCHIVE_MODE -->
|
||||||
@@ -120,11 +84,7 @@
|
|||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<div id="mChatData">
|
<div id="mChatData">
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF S_MCHAT_AVATARS -->
|
<!-- INCLUDE mchat_messages.html -->
|
||||||
<!-- INCLUDE mchat_avatars.html -->
|
|
||||||
<!-- ELSE -->
|
|
||||||
<!-- INCLUDE mchat_no_avatars.html -->
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<!-- IF not MCHAT_READ_MODE -->
|
<!-- IF not MCHAT_READ_MODE -->
|
||||||
<!-- IF MCHAT_NOMESSAGE_MODE --><div id="mChatNoMessage">{L_MCHAT_NOMESSAGE}</div><!-- ENDIF -->
|
<!-- IF MCHAT_NOMESSAGE_MODE --><div id="mChatNoMessage">{L_MCHAT_NOMESSAGE}</div><!-- ENDIF -->
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
26
styles/prosilver/template/mchat_messages.html
Normal file
26
styles/prosilver/template/mchat_messages.html
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<!-- BEGIN mchatrow -->
|
||||||
|
<div id="mess{mchatrow.MCHAT_MESSAGE_ID}" class="mChatBG{mchatrow.MCHAT_CLASS} mChatHover" data-id="{mchatrow.MCHAT_MESSAGE_ID}" data-username="{mchatrow.MCHAT_USERNAME}"<!-- IF mchatrow.MCHAT_USERNAME_COLOR --> data-usercolor="{mchatrow.MCHAT_USERNAME_COLOR}"<!-- ENDIF --> data-edit="{mchatrow.MCHAT_MESSAGE_EDIT}">
|
||||||
|
<!-- IF S_MCHAT_AVATARS -->
|
||||||
|
<div class="mChatAvatars">
|
||||||
|
<!-- IF mchatrow.U_VIEWPROFILE --><a href="{mchatrow.U_VIEWPROFILE}" title="{L_READ_PROFILE}"><!-- ENDIF -->
|
||||||
|
<!-- IF mchatrow.MCHAT_USER_AVATAR -->{mchatrow.MCHAT_USER_AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" width="40px;" height="40px;" alt="" /><!-- ENDIF -->
|
||||||
|
<!-- IF mchatrow.U_VIEWPROFILE --></a><!-- ENDIF -->
|
||||||
|
</div>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
<div class="mChatMessageHeader">
|
||||||
|
<!-- IF not MCHAT_ARCHIVE_MODE --><span class="mChatInsertMention" title="{L_MCHAT_RESPOND}" <!-- IF mchatrow.MCHAT_USERNAME_COLOR --> style="color:{mchatrow.MCHAT_USERNAME_COLOR}"<!-- ENDIF -->><strong>@</strong></span><!-- ENDIF -->
|
||||||
|
{mchatrow.MCHAT_USERNAME_FULL} - {mchatrow.MCHAT_TIME}
|
||||||
|
</div>
|
||||||
|
<div class="mChatMessageIcons">
|
||||||
|
<!-- IF MCHAT_ALLOW_PM and mchatrow.MCHAT_PM and mchatrow.U_VIEWPROFILE --><a href="{mchatrow.MCHAT_PM}" title="{L_MCHAT_SEND_PM}"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/message.gif" alt="{L_MCHAT_SEND_PM}" title="{L_MCHAT_SEND_PM}" class="mChatImage" /></a><!-- ENDIF -->
|
||||||
|
<!-- IF MCHAT_ALLOW_LIKE and not MCHAT_ARCHIVE_MODE and not mchatrow.MCHAT_IS_POSTER --><img src="{EXT_URL}styles/prosilver/theme/images/like.png" alt="{L_REPLY_WITH_LIKE}" title="{L_REPLY_WITH_LIKE}" class="mChatImage mChatInsertLike" /></a><!-- ENDIF -->
|
||||||
|
<!-- IF MCHAT_ALLOW_QUOTE and not MCHAT_ARCHIVE_MODE and not mchatrow.MCHAT_IS_POSTER --><img src="{EXT_URL}styles/prosilver/theme/images/quota.png" alt="{L_REPLY_WITH_QUOTE}" title="{L_REPLY_WITH_QUOTE}" class="mChatImage mChatInsertQuote" /><!-- ENDIF -->
|
||||||
|
<!-- IF MCHAT_ALLOW_IP --><a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;"><img src="{EXT_URL}styles/prosilver/theme/images/ip.gif" alt="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" title="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" class="mChatImage" /></a><!-- ENDIF -->
|
||||||
|
<!-- IF mchatrow.MCHAT_ALLOW_BAN --><a href="{mchatrow.MCHAT_U_BAN}"><img src="{EXT_URL}styles/prosilver/theme/images/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" class="mChatImage" /></a><!-- ENDIF -->
|
||||||
|
<!-- IF mchatrow.MCHAT_ALLOW_EDIT --><img src="{EXT_URL}styles/prosilver/theme/images/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" class="mChatImage mChatEdit" /><!-- ENDIF -->
|
||||||
|
<!-- IF mchatrow.MCHAT_ALLOW_DEL --><img src="{EXT_URL}styles/prosilver/theme/images/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" class="mChatImage mChatDelete" /><!-- ENDIF -->
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="mChatMessage<!-- IF S_MCHAT_AVATARS --> avatarMessage<!-- ENDIF -->">{mchatrow.MCHAT_MESSAGE}</div>
|
||||||
|
</div>
|
||||||
|
<!-- END mchatrow -->
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<!-- BEGIN mchatrow -->
|
|
||||||
<div id="mess{mchatrow.MCHAT_MESSAGE_ID}" class="mChatBG{mchatrow.MCHAT_CLASS} mChatHover"><span style="float:left;"><!-- IF not MCHAT_ARCHIVE_MODE and MCHAT_ADD_MESSAGE --><!-- IF MCHAT_ALLOW_BBCODES --><!-- IF mchatrow.MCHAT_USERNAME_COLOR --><a class="mChatScriptLink" href="javascript://" onclick="insert_text('@ [b][color={mchatrow.MCHAT_USERNAME_COLOR}]{mchatrow.MCHAT_USERNAME}[/color][/b], ', false);" title="{L_MCHAT_RESPOND}"><span style="color: {mchatrow.MCHAT_USERNAME_COLOR}"><strong>@</strong></span></a><!-- ELSE --> <a href="javascript://" class="mChatScriptLink" onclick="insert_text('@ [b]{mchatrow.MCHAT_USERNAME}[/b], ', false);" title="{L_MCHAT_RESPOND}"><strong>@</strong></a><!-- ENDIF --><!-- ELSE --> <a href="javascript://" class="mChatScriptLink" onclick="insert_text('@ {mchatrow.MCHAT_USERNAME}, ', false);" title="{L_MCHAT_RESPOND}">@</a><!-- ENDIF --> <!-- ENDIF -->{mchatrow.MCHAT_USERNAME_FULL} <!-- IF mchatrow.U_USER_ID and mchatrow.BOT_USER_ID --><a href="{mchatrow.U_USER_ID}" title="{L_MCHAT_SEND_PM}">{L_MCHAT_PM}</a><!-- ENDIF --> - {mchatrow.MCHAT_TIME}</span><span style="float:right;"><!-- IF mchatrow.U_USER_ID and mchatrow.BOT_USER_ID --><a href="#" onclick="insert_quote('{mchatrow.MCHAT_USERNAME}','{mchatrow.MCHAT_MESSAGE_EDIT}'); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/quota.png" alt="{L_REPLY_WITH_QUOTE}" title="{L_REPLY_WITH_QUOTE}" class="mChatImage" /></a><!-- ENDIF --> <!-- IF MCHAT_ALLOW_IP -->
|
|
||||||
|
|
||||||
<a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/ip.gif" alt="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" title="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="javascript://" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" class="mChatImage" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="javascript://" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{BOARD_URL}ext/dmzx/mchat/styles/prosilver/theme/images/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" class="mChatImage" /></a><!-- ENDIF --></span><br /><div class="mChatMessage">{mchatrow.MCHAT_MESSAGE}</div></div>
|
|
||||||
<!-- END mchatrow -->
|
|
||||||
@@ -135,6 +135,18 @@ img.mChatImage{
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.mChatMessageHeader {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.mChatMessageIcons {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
img.mChatImage, span.mChatInsertMention {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
img.mChatImageLoad {
|
img.mChatImageLoad {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
cursor: wait;
|
cursor: wait;
|
||||||
|
|||||||
Reference in New Issue
Block a user