Skip to content

Commit

Permalink
fix few bugs (3.2.1)
Browse files Browse the repository at this point in the history
- แก้ไขคำอธิบายต่าง ๆ ในหน้าตั้งค่าปลั๊กอินให้ถูกต้องกับปลั๊กอินในปัจจุบัน
- แก้ไขปัญหาการเปลี่ยนลิงก์อัตโนมัติที่ไม่ถูกต้อง
- แก้ไขปัญหาการแสดงผลในการอ้างอิงและแก้ไขข้อความในหน้าแชทหลัก
- แก้ไขปัญหากดปุ่มลูกศรขึ้นในช่องพิมพ์ข้อความ เพื่อแก้ไขข้อความที่โพสต์ไปล่าสุด ใช้งานไม่ได้
- ปรับแต่งหน้าตาห้องแชทส่วนตัวเล็กน้อย
- อัปเดต jQuery เป็นเวอร์ชั่น 3.6.0 (ล่าสุด)
  • Loading branch information
popiazaza committed Sep 22, 2021
1 parent 41b0bd4 commit 54e5632
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 22 deletions.
8 changes: 4 additions & 4 deletions th_chat/discuz_plugin_th_chat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<item id="datatables"><![CDATA[]]></item>
<item id="directory"><![CDATA[th_chat/]]></item>
<item id="copyright"><![CDATA[newz & popiazaza]]></item>
<item id="version"><![CDATA[3.2.0]]></item>
<item id="version"><![CDATA[3.2.1]]></item>
<item id="__modules">
<item id="0">
<item id="name"><![CDATA[chat]]></item>
Expand Down Expand Up @@ -191,7 +191,7 @@
</item>
<item id="21">
<item id="displayorder"><![CDATA[21]]></item>
<item id="title"><![CDATA[ใช้งาน Discuz! Code บางส่วนที่ไม่จำเปิด]]></item>
<item id="title"><![CDATA[ใช้งาน Discuz! Code บางส่วนที่ไม่จำเป็น]]></item>
<item id="description"><![CDATA[จำเป็นหากต้องการเปิดใช้งาน BBCODE ที่เพิ่มขึ้นเอง
หากเปิดการใช้งานส่วนนี้ โค้ดบางส่วนที่ไม่มีปุ่มก็แสดงผลได้เช่น [table] เป็นต้น]]></item>
<item id="variable"><![CDATA[useunshowdzc]]></item>
Expand All @@ -202,7 +202,7 @@
<item id="22">
<item id="displayorder"><![CDATA[22]]></item>
<item id="title"><![CDATA[ใช้งานรูปภาพ]]></item>
<item id="description"><![CDATA[จะมีปุ่มกดเพื่อแสดงรูปแสดงแทนฝังรูปไว้ในแชท]]></item>
<item id="description"><![CDATA[]]></item>
<item id="variable"><![CDATA[useimg]]></item>
<item id="type"><![CDATA[radio]]></item>
<item id="value"><![CDATA[1]]></item>
Expand All @@ -211,7 +211,7 @@
<item id="23">
<item id="displayorder"><![CDATA[23]]></item>
<item id="title"><![CDATA[ใช้งาน Media Code]]></item>
<item id="description"><![CDATA[จะมีปุ่มกดเพื่อแสดงวีดีโอแสดงแทนการฝังวีดีโอไว้ในแชท]]></item>
<item id="description"><![CDATA[]]></item>
<item id="variable"><![CDATA[mediacode]]></item>
<item id="type"><![CDATA[radio]]></item>
<item id="value"><![CDATA[0]]></item>
Expand Down
2 changes: 0 additions & 2 deletions th_chat/js/jquery-3.5.1.min.js

This file was deleted.

2 changes: 2 additions & 0 deletions th_chat/js/jquery-3.6.0.min.js

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions th_chat/js/th_chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ nzchatobj.ajaxSetup({

nzchatobj(function () {
nzchatobj("#nzchatmessage").keydown(function (event) {
if (event.keyCode == '13') {
if (event.key == 'Enter') {
nzSend();
}
if (event.keyCode == '27') {
} else if (event.key == 'Escape') {
nzTouid(0);
} else if (event.key == 'ArrowUp') {
if (nzchatobj('.nzchatrow:last').length) {
nzCommand('edit', nzchatobj('.nzchatrow:last').attr('id').substr(7));
}
}
});
nzchatobj('#nzchatmessage').bind('paste', function (e) {
Expand Down Expand Up @@ -146,11 +149,6 @@ nzchatobj(function () {
nzchatobj('#nznewmessage').click(function () {
nzScrollChat(true);
});
nzchatobj("#nzchatmessage").keydown(function (event) {
if (event.keyCode == '13') {
nzSend();
}
});
nzchatobj('#nzchatcontent').scroll(function () {
var objDiv = document.getElementById("nzchatcontent");
if (objDiv.scrollHeight - objDiv.scrollTop == nzsetting.chatheight) {
Expand Down Expand Up @@ -400,7 +398,7 @@ function nzTouid(i) {
nzcommandz = '';
nzchatobj(".nzquoteboxi").hide();
if (i > 0) {
nzchatobj(".nzquoteboxp").html('<div style="margin: 0 auto;"><span class="nzquoteboxh">แชทส่วนตัวกับ</span> <img src="uc_server/avatar.php?uid=' + i + '&size=small" class="nzchatavatar" width="32" height="32" onerror="this.src=\'uc_server/images/noavatar_small.gif\';" align="absmiddle"> ' + nzchatobj(".nzat_" + i).last()[0].outerHTML + '</div><div class="nzcancel" onclick="nzTouid(0)" title="ยกเลิก"></div>');
nzchatobj(".nzquoteboxp").html('<div style="margin: 0 auto;line-height: 30px;"><span class="nzquoteboxh">แชทส่วนตัวกับ</span> <img src="uc_server/avatar.php?uid=' + i + '&size=small" class="nzchatavatar" width="32" height="32" onerror="this.src=\'uc_server/images/noavatar_small.gif\';"> ' + nzchatobj(".nzat_" + i).last()[0].outerHTML + '</div><div class="nzcancel" onclick="nzTouid(0)" title="ยกเลิก"></div>');
nzchatobj(".nzquoteboxp").show();
nzchatobj(".nzquoteboxo").show();
nzchatobj("#nzchatcontent").css('height', nzsetting.chatheight - nzchatobj(".nzquoteboxo").height());
Expand Down
2 changes: 1 addition & 1 deletion th_chat/js/th_chat.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions th_chat/post.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
$config['usedzc'] = $config['usedzc'] ? 0 : 1;
$config['useunshowdzc'] = $config['useunshowdzc'] ? 0 : 1;
if ($config['autourl']) {
$text = preg_replace('/((http|https):\/\/)?([a-z0-9-]+\.)?[a-z0-9-]+(\.[a-z]{2,6}){1,3}(\/[a-z0-9.,_\/~#&=;%+?-]*)?/is', '[url]$0[/url]', $text);
$text = preg_replace('/(?<=^|\s)((http|https):\/\/)([a-z0-9-]+\.)?[a-z0-9-]+(\.[a-z]{2,6}){1,3}(\/[a-z0-9.,_\/~#&=;%+?-]*)?/is', '[url]$0[/url]', $text);
}
preg_match_all('/\[url\]'.str_replace('/','\/',preg_quote($_G['siteurl'])).'(.*?)\[\/url\]/s', $text, $urls, PREG_SET_ORDER);
foreach($urls as $url){
Expand Down Expand Up @@ -127,7 +127,7 @@
$text = str_replace($bw['find'], $bw['replacement'], $text);
}
$text = preg_replace('/\[quota\](.*?)\[\/quota\]/s', '[quota]$1[[color=#fff][/color]/quota]', $text);
$text = str_replace("[media]", "[media=x,640,480]", $text);
$text = str_replace("[media]", "[media=x,320,180]", $text);
if ($config['usemore']) {$usemore = -$_G['groupid'];} else { $usemore = 1;}
$text = discuzcode($text, $config['useemo'], $config['usedzc'], $config['usehtml'], 1, $usemore, $config['useimg'], 1, 0, $config['useunshowdzc'], 0, $config['mediacode']);
if ($ip == 'notice') {
Expand Down
4 changes: 2 additions & 2 deletions th_chat/template/big.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<span id="n_copyright">&copy; <a href="http://2th.me/" target="_blank">2th Chat</a> <!--{$_G['setting']['plugins']['version']['th_chat']}--></span>
</div>
<!--{else}-->
<script src="source/plugin/th_chat/js/jquery-3.5.1.min.js"></script>
<script src="source/plugin/th_chat/js/jquery-3.6.0.min.js"></script>
<script src="source/plugin/th_chat/js/jquery.timeago.js"></script>
<script src="source/plugin/th_chat/js/emoji-button-2.12.1.min.js" type="module"></script>
<link rel="stylesheet" type="text/css" href="{$_G[setting][csspath]}{STYLEID}_forum_viewthread.css?{VERHASH}" />
Expand Down Expand Up @@ -77,7 +77,7 @@
</div>
<div id="nznewmessage">⤓ มีข้อความใหม่ด้านล่าง ⤓</div>
<div class="nzquoteboxo">
<div class="nzquoteboxp"></div>
<div class="nzquoteboxp" style="display: none;"></div>
<div class="nzquoteboxi"></div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions th_chat/template/discuz.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<span id="n_copyright">&copy; <a href="http://2th.me/" target="_blank">2th Chat</a> <!--{$_G['setting']['plugins']['version']['th_chat']}--></span>
</div>
<!--{else}-->
<script src="source/plugin/th_chat/js/jquery-3.5.1.min.js"></script>
<script src="source/plugin/th_chat/js/jquery-3.6.0.min.js"></script>
<script src="source/plugin/th_chat/js/jquery.timeago.js"></script>
<script src="source/plugin/th_chat/js/emoji-button-2.12.1.min.js" type="module"></script>
<link rel="stylesheet" type="text/css" href="{$_G[setting][csspath]}{STYLEID}_forum_viewthread.css?{VERHASH}" />
Expand Down Expand Up @@ -77,7 +77,7 @@
</div>
<div id="nznewmessage">⤓ มีข้อความใหม่ด้านล่าง ⤓</div>
<div class="nzquoteboxo">
<div class="nzquoteboxp"></div>
<div class="nzquoteboxp" style="display: none;"></div>
<div class="nzquoteboxi"></div>
</div>
</div>
Expand Down

0 comments on commit 54e5632

Please sign in to comment.