Browse Source

修复图片失效功能,请检查

tags/6.2.7
叙述、别离 1 year ago
parent
commit
2a7057d924
4 changed files with 29 additions and 149 deletions
  1. +12
    -49
      src/admin/js/album.js
  2. +3
    -7
      src/admin/templets/album_add.htm
  3. +1
    -16
      src/admin/templets/album_edit.htm
  4. +13
    -77
      src/static/web/js/user.album.js

+ 12
- 49
src/admin/js/album.js View File

@@ -1,13 +1,4 @@
function checkSubmitAlb() {
if (document.form1.title.value == '') {
ShowMsg("标题不能为空");
return false;
}
if (document.form1.typeid.value == 0) {
ShowMsg("请选择主类别");
return false;
}
document.form1.imagebody.value = $Obj('copyhtml').innerHTML;
if ($("#thumbnails .albCt").length > 0) {
//这里从thumbnails中取出图片元素信息
$("#thumbnails .albCt").each(function () {
@@ -20,46 +11,6 @@ function checkSubmitAlb() {
$("#albums").val(JSON.stringify(albums));
return true;
}
function testGet() {
LoadTestDiv();
}
function checkMuList(psid, cmid) {
if ($Obj('pagestyle3').checked) {
$Obj('cfgmulist').style.display = 'table-row';
$Obj('spagelist').style.display = 'none';
} else if ($Obj('pagestyle1').checked) {
$Obj('cfgmulist').style.display = 'none';
$Obj('spagelist').style.display = 'table-row';
} else {
$Obj('cfgmulist').style.display = 'none';
$Obj('spagelist').style.display = 'none';
}
}
//图片显示与隐藏zip文件选项
function showZipField(formitem, zipid, upid) {
if (formitem.checked) {
$Obj(zipid).style.display = 'table-row';
$Obj(upid).style.display = 'none';
$Obj('copyhtml').innerHTML = '';
} else {
$Obj(zipid).style.display = 'none';
}
}
//图片显示与隐藏修改框
function showHtmlField(formitem, htmlid, upid) {
if ($Nav() != "IE") {
alert("该方法不适用于非IE浏览器");
return;
}
if (formitem.checked) {
$Obj(htmlid).style.display = 'table-row';
$Obj(upid).style.display = 'none';
$Obj('formzip').checked = false;
} else {
$Obj(htmlid).style.display = 'none';
$Obj('copyhtml').innerHTML = '';
}
}
function seePicNewAlb(f, imgdid, frname, hpos, acname) {
var newobj = null;
if (f.value == '') return;
@@ -95,6 +46,18 @@ function seePicNewAlb(f, imgdid, frname, hpos, acname) {
nForm.target = '';
nForm.litpic.disabled = true;
}
function checkMuList(psid, cmid) {
if ($Obj('pagestyle3').checked) {
$Obj('cfgmulist').style.display = 'table-row';
$Obj('spagelist').style.display = 'none';
} else if ($Obj('pagestyle1').checked) {
$Obj('cfgmulist').style.display = 'none';
$Obj('spagelist').style.display = 'table-row';
} else {
$Obj('cfgmulist').style.display = 'none';
$Obj('spagelist').style.display = 'none';
}
}
//删除已经上传的图片
function delAlbPic(pid) {
var tgobj = $Obj('albCtok' + pid);


+ 3
- 7
src/admin/templets/album_add.htm View File

@@ -100,7 +100,6 @@
<span class="btn btn-success btn-sm fileinput-button">上传图片<input type="file" name="files[]" id="iptAddImages"></span>
<button type="button" name="Submit2" onclick="SelectImage('form1.picname','small');" class="btn btn-success btn-sm">选择图片</button>
<button type="button" id="btnClearAll" class="btn btn-sm btn-success delete">清空</button>
<label><input type="checkbox" name="ddisfirst" value="1"> 使用图片的第一幅图</label>
</td>
<td><img src="../static/web/img/thumbnail.jpg" id="litPic" class="thumbnail-md"></td>
</tr>
@@ -235,16 +234,13 @@
</table>
</td>
</tr>
<tr id="htmlfield" style="display:none">
<tr>
<td class="admin-td">
<table cellspacing="0" cellpadding="0">
<tr>
<td width="90">网上复制:</td>
<td width="90">附加选项:</td>
<td>
<label>源网址:<input type="text" name="copysource" value="http://" class="admin-input-lg"></label>
<button type="button" name="button" id="button" class="btn btn-success btn-sm" onclick="LoadTestDiv()">预览</button>
<p class="my-2">(图片从别的网页复制,在这里用Ctrl+V粘贴,提交后程序可直接获取这个区域的所有图片防盗链网站需填写您复制图片的其中一个网页网址)</p>
<div id="copyhtml" contenteditable="true" class="form-control admin-textarea-xl"></div>
<label><input type="checkbox" name="ddisfirst" value="1"> 使用图片的第一幅图</label>
</td>
</tr>
</table>


+ 1
- 16
src/admin/templets/album_edit.htm View File

@@ -238,24 +238,9 @@
</table>
</td>
</tr>
<tr id="htmlfield" style="display:none">
<td class="admin-td">
<table cellspacing="0" cellpadding="0">
<tr>
<td width="90">网上复制:</td>
<td>
<label>源网址:<input type="text" name="copysource" value="http://" class="admin-input-lg"></label>
<button type="button" name="button" id="button" class="btn btn-success btn-sm" onclick="LoadTestDiv()">预览</button>
<p class="my-2">(图片从别的网页复制,在这里用Ctrl+V粘贴,提交后程序可直接获取这个区域的所有图片防盗链网站需填写您复制图片的其中一个网页网址)</p>
<div id="copyhtml" contenteditable="true" class="form-control admin-textarea-xl"></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="admin-td">
<table width="100%">
<table>
<tr>
<td>
<div id="thumbnailsEdit">


+ 13
- 77
src/static/web/js/user.album.js View File

@@ -1,22 +1,3 @@
function checkSubmit() {
if (document.form1.title.value=='') {
alert("文档标题不能为空");
document.form1.title.focus();
return false;
}
if (document.form1.typeid.value==0) {
alert("请您选择文档所属栏目");
return false;
}
document.form1.imagebody.value = document.getElementById('copyhtml').innerHTML;
document.getElementById('postloader').style.display = 'block';
}
function CheckSelTable(nnum) {
var cbox = document.getElementById('isokcheck'+nnum);
var seltb = document.getElementById('seltb'+nnum);
if (!cbox.checked) seltb.style.display = 'none';
else seltb.style.display = 'block';
}
var startNum = 1;
function MakeUpload(mnum) {
var endNum = 0;
@@ -43,43 +24,22 @@ function MakeUpload(mnum) {
upfield.innerHTML += fhtml;
}
}
function TestGet() {
LoadTestDiv();
function CheckSelTable(nnum) {
var cbox = document.getElementById('isokcheck'+nnum);
var seltb = document.getElementById('seltb'+nnum);
if (!cbox.checked) seltb.style.display = 'none';
else seltb.style.display = 'block';
}
var vcc = 0;
function LoadTestDiv() {
var posLeft = 100; var posTop = 100;
var newobj = document.getElementById('_myhtml');
document.getElementById('imagebody').value = document.getElementById('copyhtml').innerHTML;
var dfstr = '粘贴到这里...';
if (document.getElementById('imagebody').value.length <= dfstr.length)
{
alert('您还没有粘贴任何东西在修改框');
return;
function checkSubmit() {
if (document.form1.title.value=='') {
alert("文档标题不能为空");
document.form1.title.focus();
return false;
}
if (!newobj){
newobj = document.createElement("DIV");
newobj.id = '_myhtml';
newobj.style.position='absolute';
newobj.className = "dlg2";
newobj.style.top = posTop;
newobj.style.left = posLeft;
document.body.appendChild(newobj);
} else {
newobj.style.display = "block";
if (document.form1.typeid.value==0) {
alert("请您选择文档所属栏目");
return false;
}
const formData = new FormData()
formData.append('myhtml', v);
formData.append('vcc', vcc);
fetch('album_testhtml.php', {
method: 'POST',
body: formData
})
.then(r => r.text())
.then(d => {
newobj.innerHTML = d;
vcc++;
})
}
function checkMuList(psid, cmid) {
if (document.getElementById('pagestyle3').checked) {
@@ -89,28 +49,4 @@ function checkMuList(psid, cmid) {
} else {
document.getElementById('spagelist').style.display = 'none';
}
}
//图片显示与隐藏zip文件选项
function ShowZipField(formitem, zipid, upid) {
if (formitem.checked) {
document.getElementById(zipid).style.display = 'block';
document.getElementById(upid).style.display = 'none';
document.getElementById('formhtml').checked = false;
document.getElementById('copyhtml').innerHTML = '';
} else {
document.getElementById(zipid).style.display = 'none';
}
}
//图片显示与隐藏修改框
function ShowHtmlField(formitem, htmlid, upid) {
if ($Nav()!="IE") {
alert("该方法不适用于非IE浏览器");
return ;
}
if (formitem.checked) {
document.getElementById(htmlid).style.display = 'block';
} else {
document.getElementById(htmlid).style.display = 'none';
document.getElementById('copyhtml').innerHTML = '';
}
}

Loading…
Cancel
Save