Browse Source

看图优化

1.x
xiaoz 6 years ago
parent
commit
b4e15da30a
  1. 46
      admin/picadmin.php
  2. 2
      functions/version.txt
  3. 26
      static/embed.js
  4. 12
      static/style.css
  5. 2
      tpl/admin/footer.php
  6. 2
      tpl/admin/header.php
  7. 2
      tpl/user/header.php

46
admin/picadmin.php

@ -63,9 +63,15 @@
$imgurl = $config['domain'].$img['path']; $imgurl = $config['domain'].$img['path'];
$id = $img['id']; $id = $img['id'];
?> ?>
<div class="layui-col-lg4 picadmin"> <div id = "imgid<?php echo $id; ?>" class="layui-col-lg4 picadmin" onmouseover = "show_imgcon(<?php echo $id; ?>)" onmouseout = "hide_imgcon(<?php echo $id; ?>)">
<!-- <a id = "imgid<?php echo $id; ?>" href="javascript:;" onclick = "adminshow('<?php echo $imgurl ?>',<?php echo $id; ?>)"></a> --> <!-- <a id = "imgid<?php echo $id; ?>" href="javascript:;" onclick = "adminshow('<?php echo $imgurl ?>',<?php echo $id; ?>)"></a> -->
<img lay-src="<?php echo $imgurl; ?>" layer-src="<?php echo $imgurl; ?>" alt="图片ID: <?php echo $id; ?>" src = "../static/loading32.gif"> <img lay-src="<?php echo $imgurl; ?>" layer-src="<?php echo $imgurl; ?>" alt="图片ID: <?php echo $id; ?>" src = "../static/loading32.gif">
<!-- 删除按钮 -->
<div class = "imgcon" id = "imgcon<?php echo $id; ?>">
<a href="javascript:;" title = "图片链接" class="layui-btn layui-btn-xs layui-btn-normal" onclick = "adminshow('<?php echo $imgurl ?>',<?php echo $id; ?>)"><i class="layui-icon">&#xe64c;</i></a>
<a href="javascript:;" title = "删除这张图片" class="layui-btn layui-btn-xs layui-btn-danger" onclick="deleteimg(<?php echo $id; ?>)"><i class="layui-icon">&#xe640;</i></a>
</div>
<!-- 删除按钮END -->
</div> </div>
<?php } ?> <?php } ?>
</div> </div>
@ -75,6 +81,44 @@
<!-- 后台内容部分END --> <!-- 后台内容部分END -->
</div> </div>
</div> </div>
<!--图片查看-->
<div id="adminshow">
<div style = "margin-top:2em;"><center><img src="" alt=""></center></div>
<div id = "copy">
<center>
<table class="layui-table" lay-skin="nob">
<colgroup>
<col width="80">
<col width="520">
<col>
</colgroup>
<tbody>
<tr>
<td>URL</td>
<td><input type="text" class="layui-input" id="url" data-cip-id="url"></td>
<td><a href="javascript:;" class="layui-btn layui-btn-sm" onclick="newcopy('url')">复制</a></td>
</tr>
<tr>
<td>HTML</td>
<td><input type="text" class="layui-input" id="html" data-cip-id="html"></td>
<td><a href="javascript:;" class="layui-btn layui-btn-sm" onclick="newcopy('html')">复制</a></td>
</tr>
<tr>
<td>MarkDown</td>
<td><input type="text" class="layui-input" id="markdown" data-cip-id="markdown"></td>
<td><a href="javascript:;" class="layui-btn layui-btn-sm" onclick="newcopy('markdown')">复制</a></td>
</tr>
<tr>
<td>BBcode</td>
<td><input type="text" class="layui-input" id="bbcode" data-cip-id="bbcode"></td>
<td><a href="javascript:;" class="layui-btn layui-btn-sm" onclick="newcopy('bbcode')">复制</a></td>
</tr>
</tbody>
</table>
</center>
</div>
</div>
<!--图片查看-->
<?php <?php
// 载入页脚 // 载入页脚
// 载入头部 // 载入头部

2
functions/version.txt

@ -1 +1 @@
v1.40(20181106) v1.41(20181119)

26
static/embed.js

@ -283,6 +283,7 @@ function deleteimg(id){
$.get("./delete.php?id="+id,function(data,status){ $.get("./delete.php?id="+id,function(data,status){
if(data == 'ok') { if(data == 'ok') {
$("#imgid"+id).remove(); $("#imgid"+id).remove();
console.log("#imgid"+id);
} }
else{ else{
alert(data); alert(data);
@ -474,4 +475,27 @@ function screen(page){
else{ else{
window.location.href = page + "?page=1&date=" + starttime + '|' + endtime; window.location.href = page + "?page=1&date=" + starttime + '|' + endtime;
} }
} }
//显示图片操作按钮
function show_imgcon(id){
$("#imgcon" + id).show();
}
//隐藏图片操作按钮
function hide_imgcon(id){
$("#imgcon" + id).hide();
}
//新版删除图片
// function deleteimg(id){
// layer.confirm('确认删除?', {icon: 3, title:'温馨提示!'}, function(index){
// $.get("./delete.php?id="+id,function(data,status){
// if(data == 'ok') {
// $("#imgid"+id).remove();
// }
// else{
// alert(data);
// }
// });
// layer.close(index);
// });
// }

12
static/style.css

@ -98,6 +98,7 @@
top:4em; top:4em;
} }
.picadmin{ .picadmin{
/* display:table; */
margin:0 auto; margin:0 auto;
height:200px; height:200px;
border:1px solid #ECECEC; border:1px solid #ECECEC;
@ -206,7 +207,8 @@
display: none; display: none;
} }
#adminshow img{ #adminshow img{
max-width:680px; max-width:680px;
max-height: 400px;
text-align:center; text-align:center;
} }
@ -236,4 +238,12 @@
} }
#tongji a{ #tongji a{
color:#FFFFFF; color:#FFFFFF;
}
/* 图片控制 */
.imgcon{
position: absolute;
z-index: 99;
right:5px;
bottom: 5px;
display: none;
} }

2
tpl/admin/footer.php

@ -13,7 +13,7 @@
<script src="../static/jquery.min.js"></script> <script src="../static/jquery.min.js"></script>
<script src="../static/layui/layui.js"></script> <script src="../static/layui/layui.js"></script>
<script src="../static/embed.js?v=1.31"></script> <script src="../static/embed.js?v=v1.41"></script>
<script> <script>
layui.use('laydate', function(){ layui.use('laydate', function(){
var laydate = layui.laydate; var laydate = layui.laydate;

2
tpl/admin/header.php

@ -11,7 +11,7 @@
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<link rel="Bookmark" href="../favicon.ico" /> <link rel="Bookmark" href="../favicon.ico" />
<link rel="stylesheet" href="../static/layui/css/layui.css"> <link rel="stylesheet" href="../static/layui/css/layui.css">
<link rel="stylesheet" href="../static/style.css?v=1.31"> <link rel="stylesheet" href="../static/style.css?v=v1.41">
<script src = "../static/clipBoard.min.js"></script> <script src = "../static/clipBoard.min.js"></script>
</head> </head>
<body> <body>

2
tpl/user/header.php

@ -14,7 +14,7 @@
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="Bookmark" href="favicon.ico" /> <link rel="Bookmark" href="favicon.ico" />
<link rel="stylesheet" href="./static/layui/css/layui.css"> <link rel="stylesheet" href="./static/layui/css/layui.css">
<link rel="stylesheet" href="./static/style.css?v=1.31"> <link rel="stylesheet" href="./static/style.css?v=v1.41">
<script src = "./static/clipBoard.min.js"></script> <script src = "./static/clipBoard.min.js"></script>
<script src = "./static/ctrv-upload.js"></script> <script src = "./static/ctrv-upload.js"></script>
</head> </head>

Loading…
Cancel
Save