Improved template code for mChat messages

This commit is contained in:
kasimi
2015-12-17 12:59:11 +01:00
parent 0701ac10c1
commit c6f27407a8
8 changed files with 103 additions and 76 deletions

View File

@@ -76,42 +76,6 @@
focusFix : <!-- IF MCHAT_ARCHIVE_MODE -->false<!-- ELSE -->true<!-- ENDIF -->,
archiveMode : <!-- IF MCHAT_ARCHIVE_MODE -->true<!-- ELSE -->false<!-- ENDIF -->
};
function insert_quote(user, text) {
var quote = decodeURIComponent(text.replace(/\+/g, " "));
quote = quote.replace(/&lt;/g, "<");
quote = quote.replace(/&gt;/g, ">");
quote = quote.replace(/&#58;/g, ':');
quote = quote.replace(/&#46;/g, '.');
quote = quote.replace(/&amp;/g, '&');
quote = quote.replace(/&quot;/g, '"');
var username = decodeURIComponent(user.replace(/\+/g, " "));
username = username.replace(/&lt;/g, "<");
username = username.replace(/&gt;/g, ">");
username = username.replace(/&#58;/g, ':');
username = username.replace(/&#46;/g, '.');
username = username.replace(/&amp;/g, '&');
username = username.replace(/&quot;/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(/&lt;/g, "<");
quote = quote.replace(/&gt;/g, ">");
quote = quote.replace(/&#58;/g, ':');
quote = quote.replace(/&#46;/g, '.');
quote = quote.replace(/&amp;/g, '&');
quote = quote.replace(/&quot;/g, '"');
var username = decodeURIComponent(user.replace(/\+/g, " "));
username = username.replace(/&lt;/g, "<");
username = username.replace(/&gt;/g, ">");
username = username.replace(/&#58;/g, ':');
username = username.replace(/&#46;/g, '.');
username = username.replace(/&amp;/g, '&');
username = username.replace(/&quot;/g, '"');
document.getElementById('mChatMessage').value += '' + mChat.likes + '[quote="' + username + '"]' + quote + '[/quote]';
document.getElementById('mChatMessage').focus();
}
// ]]>
</script>
<!-- IF not MCHAT_ARCHIVE_MODE -->
@@ -120,11 +84,7 @@
<!-- ENDIF -->
<div id="mChatData">
<!-- ENDIF -->
<!-- IF S_MCHAT_AVATARS -->
<!-- INCLUDE mchat_avatars.html -->
<!-- ELSE -->
<!-- INCLUDE mchat_no_avatars.html -->
<!-- ENDIF -->
<!-- INCLUDE mchat_messages.html -->
<!-- IF not MCHAT_READ_MODE -->
<!-- IF MCHAT_NOMESSAGE_MODE --><div id="mChatNoMessage">{L_MCHAT_NOMESSAGE}</div><!-- ENDIF -->
</div>