适配新接口、插件;更新附录、通知书、课外书;修复、优化部分功能
This commit is contained in:
@@ -133,25 +133,6 @@ cocoMessage.config({
|
||||
duration: 2000,
|
||||
});
|
||||
|
||||
//sortable事件 隐藏input
|
||||
UIkit.util.on('.img_show', 'start', function (item) {
|
||||
$(".up_img_btn").hide();
|
||||
});
|
||||
UIkit.util.on('.img_show', 'moved', function (item) {
|
||||
var img_num = $('.add_img_box .t_media_item').length;
|
||||
if (img_num < 9) {
|
||||
$(".up_img_btn").show();
|
||||
}
|
||||
|
||||
});
|
||||
UIkit.util.on('.img_show', 'stop', function (item) {
|
||||
var img_num = $('.add_img_box .t_media_item').length;
|
||||
if (img_num < 9) {
|
||||
$(".up_img_btn").show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//ajax上传媒体文件到媒体库(已兼容图片/视频)
|
||||
$(document).on('change', '#topic_img_up', function (e) {
|
||||
e.preventDefault();
|
||||
@@ -390,68 +371,6 @@ $(document).on('click', '.topic-img-de', function (e) {
|
||||
}
|
||||
});
|
||||
|
||||
// 样式修复:3列布局 + 正方形显示(核心)
|
||||
$(function () {
|
||||
var style = `<style>
|
||||
/* 媒体库视频封面:正方形显示,和图片一致 */
|
||||
.media-video-thumb {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover; /* 裁剪为正方形,不拉伸 */
|
||||
border: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
/* 媒体库li:适配3列,强制正方形 */
|
||||
.wp_get_media_list li {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: calc(33.333% - 10px); /* 3列基础宽度 */
|
||||
aspect-ratio: 1/1; /* 强制正方形(宽高比1:1) */
|
||||
margin: 5px;
|
||||
overflow: hidden; /* 裁剪超出部分 */
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* 核心:.t_media_item 强制正方形 + 3列布局 */
|
||||
.t_media_item {
|
||||
position: relative !important;
|
||||
display: inline-block !important;
|
||||
width: calc(33.333% - 10px) !important; /* 3列宽度,和原有布局一致 */
|
||||
aspect-ratio: 1/1 !important; /* 强制正方形,覆盖视频原比例 */
|
||||
margin: 5px !important;
|
||||
overflow: hidden !important; /* 裁剪超出的视频内容 */
|
||||
vertical-align: top !important;
|
||||
touch-action: none !important;
|
||||
user-select: none !important;
|
||||
}
|
||||
/* 删除按钮:固定在正方形右上角 */
|
||||
.t_media_item .topic-img-de {
|
||||
position: absolute !important;
|
||||
top: 5px !important;
|
||||
right: 5px !important;
|
||||
background: rgba(0,0,0,0.5) !important;
|
||||
color: #fff !important;
|
||||
width: 20px !important;
|
||||
height: 20px !important;
|
||||
border-radius: 50% !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
text-decoration: none !important;
|
||||
z-index: 99 !important;
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
/* 视频/图片:裁剪为正方形,不拉伸 */
|
||||
.t_media_item video, .t_media_item img {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
object-fit: cover !important; /* 关键:裁剪多余部分,保持正方形 */
|
||||
display: block !important;
|
||||
}
|
||||
</style>`;
|
||||
$('head').append(style);
|
||||
});
|
||||
|
||||
//插入外部图片链接
|
||||
$(document).on('click', '.up_from_cdn a', function () {
|
||||
//$(".show_media_box .souqi").click();
|
||||
|
||||
Reference in New Issue
Block a user