Selaa lähdekoodia

优化富文本插入多图布局,flex布局下兼容问题

tags/6.5.6
叙述、别离 6 päivää sitten
vanhempi
commit
ac1b6242c4
8 muutettua tiedostoa jossa 39 lisäystä ja 42 poistoa
  1. +22
    -17
      src/admin/dialog/select_mimages.php
  2. +1
    -1
      src/admin/templets/ai_model_main.htm
  3. +1
    -1
      src/admin/templets/article_add.htm
  4. +1
    -1
      src/admin/templets/article_edit.htm
  5. +1
    -1
      src/admin/templets/catalog_add.htm
  6. +1
    -1
      src/admin/templets/catalog_add_quick.htm
  7. +1
    -1
      src/admin/templets/catalog_edit.htm
  8. +11
    -19
      src/static/web/css/admin.css

+ 22
- 17
src/admin/dialog/select_mimages.php Näytä tiedosto

@@ -16,15 +16,20 @@ include(DEDEDATA.'/mark/inc_photowatermark_config.php');
<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
<link rel="stylesheet" href="/static/web/css/admin.css">
</head>
<body>
<div id="wrap">
<div id="topbar">
<body class="p-3">
<div class="card shadow-sm mb-3">
<div id="imgs-topbar" class="card-body">
<label><input type="checkbox" name="isWater" id="isWater" <?php if ($photo_markup == '1') echo 'checked';?>> 是否水印</label>
<button class="btn btn-success btn-sm addfile">添加图片</button>
<button class="btn btn-success btn-sm removeall">清空图片</button>
<button class="btn btn-success btn-sm upall">全部上传</button>
</div>
<ul id="file_list"></ul>
</div>
<div class="card shadow-sm">
<div class="card-header">插入多图</div>
<div class="card-body">
<ul id="imgs-list"></ul>
</div>
</div>
<script>
var axupimgs = {};
@@ -57,7 +62,7 @@ include(DEDEDATA.'/mark/inc_photowatermark_config.php');
var upload_base_path = axupimgs.images_upload_base_path;
//为列表添加排序
function reSort() {
document.querySelectorAll('#file_list li').forEach((el, i) => {
document.querySelectorAll('#imgs-list li').forEach((el, i) => {
el.setAttribute('data-num', i);
});
}
@@ -81,13 +86,13 @@ include(DEDEDATA.'/mark/inc_photowatermark_config.php');
li.innerHTML='<div class="picbox"><img src="'+blobUrl+'"></div><div class="namebox"><span>'+file.name+'</span></div><div class="tools"><a class="remove"></a></div>';
vDom.appendChild(li);
}
document.querySelector('#file_list').appendChild(vDom);
document.querySelector('#imgs-list').appendChild(vDom);
//reSort();
}
//清空列表
document.querySelector('#topbar .removeall').addEventListener('click', () => {
document.querySelector('#imgs-topbar .removeall').addEventListener('click', () => {
axupimgs.res=[]
document.querySelectorAll('#file_list li').forEach((el, i) => {
document.querySelectorAll('#imgs-list li').forEach((el, i) => {
el.parentNode.removeChild(el)
});
});
@@ -124,7 +129,7 @@ include(DEDEDATA.'/mark/inc_photowatermark_config.php');
}
});
//添加文件
document.querySelector('#topbar .addfile').addEventListener('click', () => {
document.querySelector('#imgs-topbar .addfile').addEventListener('click', () => {
var input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('multiple', 'multiple');
@@ -141,7 +146,7 @@ include(DEDEDATA.'/mark/inc_photowatermark_config.php');
file_i = n;
if (len == n) {
file_i=0;
document.querySelector('#topbar .upall').innerText='全部上传';
document.querySelector('#imgs-topbar .upall').innerText='全部上传';
//返回
axupimgs.res.forEach((v, k) => {
let addonHTML = `<img src='${v.url}'>`;
@@ -168,26 +173,26 @@ include(DEDEDATA.'/mark/inc_photowatermark_config.php');
}
axupimgs.res[file_i].url = url;
filename = url.split('/').pop();
var li = document.querySelectorAll('#file_list li')[file_i];
var li = document.querySelectorAll('#imgs-list li')[file_i];
li.setAttribute('class','up-over');
li.querySelector('.namebox span').innerText = filename;
n++
upAllFiles(n);
},function(err) {
document.querySelector('#topbar .upall').innerText='全部上传';
document.querySelectorAll('#file_list li.up-now').forEach((el,i) => {
document.querySelector('#imgs-topbar .upall').innerText='全部上传';
document.querySelectorAll('#imgs-list li.up-now').forEach((el,i) => {
el.setAttribute('class','up-no');
});
alert(err);
});
}
}
document.querySelector('#topbar .upall').addEventListener('click', (e) => {
document.querySelector('#imgs-topbar .upall').addEventListener('click', (e) => {
if (e.target.innerText!='全部上传') {
return false;
}
if (axupimgs.res.length > 0) {
document.querySelectorAll('#file_list li.up-no').forEach((el, i) => {
document.querySelectorAll('#imgs-list li.up-no').forEach((el, i) => {
el.classList ? el.classList.add('up-now') : el.className+=' up-now';
});
e.target.innerText='上传中';
@@ -200,7 +205,7 @@ include(DEDEDATA.'/mark/inc_photowatermark_config.php');
el.querySelector('.remove').addEventListener('click', (e) => {
var li = e.target.parentNode.parentNode;
var n = li.getAttribute('data-num');
var el = document.querySelectorAll('#file_list li')[n];
var el = document.querySelectorAll('#imgs-list li')[n];
el.parentNode.removeChild(el);
axupimgs.res.splice(n, 1);
});
@@ -208,7 +213,7 @@ include(DEDEDATA.'/mark/inc_photowatermark_config.php');
}
reSort();
});
observ_flist.observe(document.querySelector('#file_list'),{childList:true});
observ_flist.observe(document.querySelector('#imgs-list'),{childList:true});
</script>
</body>
</html>

+ 1
- 1
src/admin/templets/ai_model_main.htm Näytä tiedosto

@@ -20,7 +20,7 @@
<li class="breadcrumb-item active">模型版本管理</li>
</ol>
<div class="card shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center">模型版本管理</div>
<div class="card-header">模型版本管理</div>
<div class="card-body">
<form name="form1" method="post" action="ai_model_edit.php">
<input type="hidden" name="dopost" value="delall">


+ 1
- 1
src/admin/templets/article_add.htm Näytä tiedosto

@@ -26,7 +26,7 @@
<li class="breadcrumb-item active">发布文档</li>
</ol>
<div class="card shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center">发布文档<?php if($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-header d-flex justify-content-between align-items-center"><span>发布文档</span><?php if ($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-body">
<form name="form1" action="article_add.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="channelid" value="<?php echo $channelid?>">


+ 1
- 1
src/admin/templets/article_edit.htm Näytä tiedosto

@@ -26,7 +26,7 @@
<li class="breadcrumb-item active">修改文档</li>
</ol>
<div class="card shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center">修改<?php echo $arcRow['title'];?>文档<?php if($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-header d-flex justify-content-between align-items-center"><span>修改<?php echo $arcRow['title'];?>文档</span><?php if ($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-body">
<form name="form1" action="article_edit.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="dopost" value="save">


+ 1
- 1
src/admin/templets/catalog_add.htm Näytä tiedosto

@@ -19,7 +19,7 @@
<li class="breadcrumb-item active">添加栏目</li>
</ol>
<div class="card shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center">添加栏目<?php if($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-header d-flex justify-content-between align-items-center"><span>添加栏目</span><?php if ($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-body">
<form name="form1" action="catalog_add.php" method="post">
<input type="hidden" name="dopost" value="save">


+ 1
- 1
src/admin/templets/catalog_add_quick.htm Näytä tiedosto

@@ -19,7 +19,7 @@
<li class="breadcrumb-item active">批量添加栏目</li>
</ol>
<div class="card shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center">批量添加栏目<?php if($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-header d-flex justify-content-between align-items-center"><span>批量添加栏目</span><?php if ($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-body">
<form name="form1" action="catalog_add.php" method="post">
<input type="hidden" name="dopost" value="savequick">


+ 1
- 1
src/admin/templets/catalog_edit.htm Näytä tiedosto

@@ -19,7 +19,7 @@
<li class="breadcrumb-item active">修改栏目</li>
</ol>
<div class="card shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center">修改栏目<?php if($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-header d-flex justify-content-between align-items-center"><span>修改栏目</span><?php if ($cfg_ai_enabled == 'Y'){;?><button type="button" id="btnAI" onclick="showAI();" class="btn btn-success btn-sm">小德AI助手</button><?php };?></div>
<div class="card-body">
<form name="form1" action="catalog_edit.php" method="post">
<input type="hidden" name="dopost" value="save">


+ 11
- 19
src/static/web/css/admin.css Näytä tiedosto

@@ -475,30 +475,22 @@ body.menu-show .admin-content {
border-radius:0 var(--b-radius) var(--b-radius) 0;
cursor:pointer
}
#wrap {
padding:1rem
}
#topbar {
margin-bottom:1rem;
border-bottom:1px solid var(--light);
text-align:right
}
#file_list {
#imgs-list {
display:grid;
grid-gap:1rem;
grid-template-columns:repeat(auto-fill,minmax(160px,1fr))
}
#file_list:empty:after {
#imgs-list:empty:after {
content:'支持拖拽图此处片上传'
}
#file_list li {
#imgs-list li {
position:relative
}
#file_list li .picbox {
#imgs-list li .picbox {
padding-bottom:75%;
position:relative
}
#file_list li .picbox img {
#imgs-list li .picbox img {
position:absolute;
top:0;
left:0;
@@ -506,10 +498,10 @@ body.menu-show .admin-content {
height:100%;
object-fit:cover
}
#file_list li .namebox {
#imgs-list li .namebox {
padding-top:0.5rem
}
#file_list li.up-over .picbox:after {
#imgs-list li.up-over .picbox:after {
position:absolute;
top:0;
left:0;
@@ -519,20 +511,20 @@ body.menu-show .admin-content {
content:'\f058';
z-index:1991
}
#file_list li .tools {
#imgs-list li .tools {
display:none;
position:absolute;
bottom:0;
right:0;
z-index:1992
}
#file_list li:hover .tools {
#imgs-list li:hover .tools {
display:block
}
#file_list li .tools .remove {
#imgs-list li .tools .remove {
cursor:pointer
}
#file_list li .tools .remove:after {
#imgs-list li .tools .remove:after {
font-family:'FontAwesome';
font-size:14px;
color:var(--danger);


Loading…
Peruuta
Tallenna