Skip to content

Commit

Permalink
1. 优化正文内容表格中图片过宽问题和超链接问题。
Browse files Browse the repository at this point in the history
2. 优化评论回复和取消回复点击问题。
3. 优化版权链接换行问题。
  • Loading branch information
awinds committed Oct 8, 2024
1 parent a29ae7d commit 80255ad
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Open sourced under the MIT license.
保留Theme by Xaink,谢谢!
# 更新说明
## 1.5.1
1. 优化正文内容表格中图片过宽问题和超链接问题。
2. 优化评论回复和取消回复点击问题。
3. 优化版权链接换行问题。
## 1.5.0
1. 修改代码过长没自动换行的问题。
2. 如果使用高亮插件,要解决换行问题,要改插件中样式`pre[class*="language-"]`中`white-space`值为`pre-wrap`。
Expand Down
8 changes: 5 additions & 3 deletions assets/css/xa-ink-post.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

.xa-post-content a {
background-color: transparent;
color: var(--link-hover-color);
color: var(--link-hover-color,#58a6ff);
text-decoration: none;
}

Expand Down Expand Up @@ -195,7 +195,8 @@
border-spacing: 0;
border-collapse: collapse;
display: block;
width: max-content;
/*width: max-content;*/
width: auto;
max-width: 100%;
overflow: auto;
}
Expand Down Expand Up @@ -1218,7 +1219,8 @@
border-spacing: 0;
border-collapse: collapse;
display: block;
width: max-content;
/*width: max-content;*/
width: auto;
max-width: 100%;
overflow: auto;
}
Expand Down
11 changes: 9 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function threadedComments($comments, $options)
</div>
<!-- 评论脚本 -->
<script type="text/javascript">
var lastCommentId = '';
window.TypechoComment = {
dom: function (id) {
return document.getElementById(id)
Expand All @@ -137,6 +138,11 @@ function threadedComments($comments, $options)
}
return el;
}, reply: function (cid, coid) {
//先把之前的取消回复改成回复
if(lastCommentId != '') {
$('#reply-'+lastCommentId+' button a').eq(1).show();
$('#reply-'+lastCommentId+' button a').eq(0).hide();
}
//console.log(cid);
var comment = this.dom(cid), response = this.dom("<?php $this->respondId(); ?>"),
input = this.dom("comment-parent"),
Expand All @@ -156,14 +162,14 @@ function threadedComments($comments, $options)

$('#reply-'+cid+' button a').eq(0).show();
$('#reply-'+cid+' button a').eq(1).hide();

lastCommentId = cid;
//this.dom("cancel-comment-reply-link").style.display = "";
//this.dom("cancel-comment-reply-link").className += " xa-button px-4 py-1 bg-blue-500 text-white rounded-2xl hover:bg-blue-600 focus:outline-none";
//this.dom("cancel-comment-reply-link").style.display = "";

if (null != textarea && "text" == textarea.name) {
textarea.focus();
console.log($('#reply-'+cid).attr("data-author"))
//console.log($('#reply-'+cid).attr("data-author"))
textarea.placeholder = "回复" + $('#reply-'+cid).attr("data-author");
}
return false;
Expand All @@ -181,6 +187,7 @@ function threadedComments($comments, $options)
holder.parentNode.insertBefore(response, holder);
textarea = response.getElementsByTagName("textarea")[0];
textarea.placeholder = "发表神评妙论";
lastCommentId = '';
return false;
}, customCancelReply: function (cid) {
$('#reply-'+cid+' button a').eq(0).hide();
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @package XaInk
* @author XiaoA
* @version 1.5.0
* @version 1.5.1
* @link https://www.xa.ink/
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
Expand Down
10 changes: 5 additions & 5 deletions post.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@
<?php if (xaGetOptionValue("enablePostCopyright", "no") === "yes"): ?>
<?php if (($this->fields->copy_link) == ''): ?>
<div class="xa-post-copy border-gray-200 border rounded-2xl break-words px-5 py-5 flex flex-col space-y-1">
<span class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-user-circle"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855" /></svg>版权属于<?php $this->author(); ?></span>
<span class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-link"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 15l6 -6" /><path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464" /><path d="M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463" /></svg>本文链接<a href="<?php $this->permalink();?>"><?php $this->permalink();?></a></span>
<span class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-share"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M18 6m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M8.7 10.7l6.6 -3.4" /><path d="M8.7 13.3l6.6 3.4" /></svg>转载申明转载请保留本文转载地址,著作权归作者所有。</span>
<span class="flex items-center break-all"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-user-circle"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" /><path d="M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855" /></svg><span class="whitespace-nowrap mr-1">版权属于:</span><?php $this->author(); ?></span>
<span class="flex items-center break-all"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-link"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 15l6 -6" /><path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464" /><path d="M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463" /></svg><span class="whitespace-nowrap mr-1">本文链接:</span><a href="<?php $this->permalink();?>"><?php $this->permalink();?></a></span>
<span class="flex items-center break-all"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-share"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M18 6m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M8.7 10.7l6.6 -3.4" /><path d="M8.7 13.3l6.6 3.4" /></svg><span class="whitespace-nowrap mr-1">转载申明:</span>转载请保留本文转载地址,著作权归作者所有。</span>
</div>
<?php else: ?>
<div class="post-copyright" style="word-wrap: break-word; border-radius: 10px; border: 1px solid #ddd; padding: 20px;">
<span class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-link"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 15l6 -6" /><path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464" /><path d="M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463" /></svg>本文链接<a href="<?php $this->permalink();?>"><?php $this->permalink();?></a></span>
<span class="flex items-center"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-description"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4" /><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /><path d="M9 17h6" /><path d="M9 13h6" /></svg>免责声明本文主要内容转载自【<a target="_blank" rel="external noopener noreferrer nofollow" href="<?php echo $this->fields->copy_link;?>" title="文章来源 <?php echo $this->fields->copy_link;?>"><?php echo $this->fields->copy_link;?></a>】,仅用于学习和交流,若有侵权请邮件联系本站!</span>
<span class="flex items-center break-all"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-link"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 15l6 -6" /><path d="M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464" /><path d="M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463" /></svg><span class="whitespace-nowrap mr-1">本文链接:</span><a href="<?php $this->permalink();?>"><?php $this->permalink();?></a></span>
<span class="flex items-center break-all"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-description"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M14 3v4a1 1 0 0 0 1 1h4" /><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /><path d="M9 17h6" /><path d="M9 13h6" /></svg><span class="whitespace-nowrap mr-1">免责声明:</span>本文主要内容转载自【<a target="_blank" rel="external noopener noreferrer nofollow" href="<?php echo $this->fields->copy_link;?>" title="文章来源 <?php echo $this->fields->copy_link;?>"><?php echo $this->fields->copy_link;?></a>】,仅用于学习和交流,若有侵权请邮件联系本站!</span>
</div>
<?php endif;?>
<?php endif; ?>
Expand Down

0 comments on commit 80255ad

Please sign in to comment.