diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..02f69a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +temp/ +upload/ diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..e8621af --- /dev/null +++ b/.htaccess @@ -0,0 +1 @@ +ErrorDocument 404 /static/404.svg \ No newline at end of file diff --git a/admin/senioradmin.php b/admin/senioradmin.php index 1b0c226..09c4194 100644 --- a/admin/senioradmin.php +++ b/admin/senioradmin.php @@ -69,9 +69,12 @@ - + +
+ +
@@ -106,8 +109,45 @@ + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
URL复制
HTML复制
MarkDown复制
BBcode复制
+
+
+
+ \ No newline at end of file diff --git a/functions/version.txt b/functions/version.txt index a25c11d..dcc7c95 100644 --- a/functions/version.txt +++ b/functions/version.txt @@ -1 +1 @@ -v1.1(20180630) \ No newline at end of file +v1.12(20180810) \ No newline at end of file diff --git a/static/embed.js b/static/embed.js index 4f3730b..bd336be 100644 --- a/static/embed.js +++ b/static/embed.js @@ -149,6 +149,26 @@ function copyurl(url){ }); } +//复制链接 +function newcopy(info){ + var copy = new clipBoard(document.getElementById('url'), { + beforeCopy: function() { + info = $("#" + info).val(); + }, + copy: function() { + return info; + }, + afterCopy: function() { + + } + }); + layui.use('layer', function(){ + var layer = layui.layer; + + layer.msg('复制成功!', {time: 2000}) + }); +} + //用户登录方法 function login(){ // 获取用户提交的信息 @@ -176,37 +196,49 @@ function userpreview(imgurl,id){ //后台管理员查看图片 function adminshow(imgurl,id){ - var showimg = "
"; + $("#adminshow").show(); + $("#url").val(imgurl); + $("#html").val(""); + $("#markdown").val("![](" + imgurl + ")"); + $("#bbcode").val("[img]" + imgurl + "[/img]"); + + $("#copy").show(); + $("#adminshow img").attr("src",imgurl); layui.use('layer', function(){ var layer = layui.layer; layer.open({ type: 1, - title:"图片预览", - area: ['80%', '80%'], - content: showimg, - btn: ['压缩', '删除'], + title:false, + area: '720px', + content: $("#adminshow"), + btn: ['删除'], + cancel: function(index, layero){ + $("#adminshow img").attr("src",""); + $("#copy").hide(); + }, yes: function(index, layero){ - layer.msg('该功能还在开发中!', {time: 2000}) - } - //删除按钮 - ,btn2: function(index, layero){ layer.confirm('确认删除?', {icon: 3, title:'温馨提示!'}, function(index){ $.get("./delete.php?id="+id,function(data,status){ if(data == 'ok') { + $("#imgid"+id).remove(); + $("#adminshow img").attr("src",""); + $("#copy").hide(); } else{ alert(data); } }); - layer.close(index); + layer.closeAll(); }); } }); }); } + + //后台管理员查看SM.MS图片 function smshow(imgurl,id){ var showimg = "
"; @@ -362,4 +394,18 @@ function hideimg(id){ // if(event.keyCode == 86){ // } -//}); \ No newline at end of file +//}); + +//预览图片 +function viewimg(id,imgurl){ + id = "viewimg" + id; + $("#" + id + " img").attr('src',imgurl); + //显示图片 + $("#" + id).show(); + +} +//隐藏图片 +function hideimg(id){ + id = "viewimg" + id; + $("#" + id).hide(); +} \ No newline at end of file diff --git a/static/style.css b/static/style.css index b2e2a8a..1751619 100644 --- a/static/style.css +++ b/static/style.css @@ -176,4 +176,29 @@ } .layui-table img { max-width: 460px; +} +.viewimg{ + position: absolute; + display:none; + border:1px solid #F0F0F0; + border-radius:5px; + z-index:99; + top:3em; +} +.viewimg img{ + max-width:660px; +} + +#adminshow{ + display: none; +} +#adminshow img{ + max-width:680px; + text-align:center; + +} +#copy{ + width:680px; + margin-left:auto; + margin-right:auto; } \ No newline at end of file diff --git a/tpl/admin/footer.php b/tpl/admin/footer.php index 240d473..60b74d3 100644 --- a/tpl/admin/footer.php +++ b/tpl/admin/footer.php @@ -13,6 +13,6 @@ - + \ No newline at end of file diff --git a/tpl/admin/header.php b/tpl/admin/header.php index 3f10205..316d618 100644 --- a/tpl/admin/header.php +++ b/tpl/admin/header.php @@ -11,7 +11,7 @@ - + @@ -22,10 +22,7 @@

ImgURL