🍎 后台优化

pull/21/head
ruibaby 2018-07-12 11:03:21 +08:00
parent 08a915850b
commit e31b6d9d24
11 changed files with 101 additions and 103 deletions

View File

@ -99,3 +99,15 @@
.layout-boxed { .layout-boxed {
background: url('../images/boxed-bg.jpg') repeat fixed; background: url('../images/boxed-bg.jpg') repeat fixed;
} }
::-webkit-scrollbar {
width: 0;
height: 0;
background-color: transparent;
}
::-webkit-scrollbar-thumb {
background-color: transparent;
}
::-webkit-scrollbar-track {
background-color: transparent;
}

View File

@ -1,10 +1,23 @@
$(document).ready(function () { $(document).ready(function () {
if($(window).width()<1024){
if($('body').hasClass('layout-boxed')){
$('body').removeClass('layout-boxed');
}
if($('body').hasClass('sidebar-collapse')){
$('body').removeClass('sidebar-collapse');
}
}
initMenu(); initMenu();
}); });
$(document).on('pjax:clicked', function() {
$('.content-wrapper').html("");
});
$(document).on('pjax:complete',function () { $(document).on('pjax:complete',function () {
initMenu(); initMenu();
}); });
/** /**
* https://github.com/JpressProjects/jpress/blob/master/jpress-web/src/main/resources/static/admin/js/jpressadmin.js * https://github.com/JpressProjects/jpress/blob/master/jpress-web/src/main/resources/static/admin/js/jpressadmin.js
*/ */

View File

@ -8,7 +8,6 @@
<!-- 菜单栏模块 --> <!-- 菜单栏模块 -->
<#include "module/_sidebar.ftl"> <#include "module/_sidebar.ftl">
<div class="content-wrapper"> <div class="content-wrapper">
<link rel="stylesheet" href="/static/plugins/fileinput/fileinput.min.css">
<style type="text/css" rel="stylesheet"> <style type="text/css" rel="stylesheet">
#showForm{margin-left:4px;padding:3px 6px;position:relative;top:-4px;border:1px solid #ccc;border-radius:2px;background:#fff;text-shadow:none;font-weight:600;font-size:12px;line-height:normal;color:#3c8dbc;cursor:pointer;transition:all .2s ease-in-out} #showForm{margin-left:4px;padding:3px 6px;position:relative;top:-4px;border:1px solid #ccc;border-radius:2px;background:#fff;text-shadow:none;font-weight:600;font-size:12px;line-height:normal;color:#3c8dbc;cursor:pointer;transition:all .2s ease-in-out}
#showForm:hover{background:#3c8dbc;color:#fff} #showForm:hover{background:#3c8dbc;color:#fff}
@ -56,7 +55,6 @@
</div> </div>
</div> </div>
</section> </section>
<script src="/static/plugins/layer/layer.js"></script>
<script type="application/javascript"> <script type="application/javascript">
function openDetail(id) { function openDetail(id) {
layer.open({ layer.open({
@ -71,39 +69,35 @@
}); });
} }
function loadFileInput() { function loadFileInput() {
$.getScript("/static/plugins/fileinput/fileinput.min.js",function () { $('#uploadImg').fileinput({
$.getScript("/static/plugins/fileinput/zh.min.js",function () { language: 'zh',
$('#uploadImg').fileinput({ uploadUrl: '/admin/attachments/upload',
language: 'zh', uploadAsync: true,
uploadUrl: '/admin/attachments/upload', allowedFileExtensions: ['jpg','gif','png','jpeg','svg','psd'],
uploadAsync: true, maxFileCount: 100,
allowedFileExtensions: ['jpg','gif','png','jpeg','svg','psd'], enctype : 'multipart/form-data',
maxFileCount: 100, showClose: false
enctype : 'multipart/form-data', }).on("fileuploaded",function (event,data,previewId,index) {
showClose: false var data = data.jqXHR.responseJSON;
}).on("fileuploaded",function (event,data,previewId,index) { if(data.success=="1"){
var data = data.jqXHR.responseJSON; $("#uploadForm").hide(400);
if(data.success=="1"){ $.toast({
$("#uploadForm").hide(400); text: "上传成功!",
$.toast({ heading: '提示',
text: "上传成功!", icon: 'success',
heading: '提示', showHideTransition: 'fade',
icon: 'success', allowToastClose: true,
showHideTransition: 'fade', hideAfter: 1000,
allowToastClose: true, stack: 1,
hideAfter: 1000, position: 'top-center',
stack: 1, textAlign: 'left',
position: 'top-center', loader: true,
textAlign: 'left', loaderBg: '#ffffff',
loader: true, afterHidden: function () {
loaderBg: '#ffffff', window.location.reload();
afterHidden: function () {
window.location.reload();
}
});
} }
}); });
}); }
}); });
} }
$(document).ready(function () { $(document).ready(function () {

View File

@ -358,8 +358,6 @@
</div> </div>
</div> </div>
</div> </div>
<script src="/static/plugins/layer/layer.js"></script>
<script src="/static/js/app.js"></script>
<script type="application/javascript"> <script type="application/javascript">
$(document).ready(function () { $(document).ready(function () {
var dateBegin = new Date("${options.blog_start?default('0000-00-00')}"); var dateBegin = new Date("${options.blog_start?default('0000-00-00')}");

View File

@ -615,8 +615,6 @@
</div> </div>
</div> </div>
</section> </section>
<script src="/static/plugins/layer/layer.js"></script>
<script src="/static/js/app.js"></script>
<@compress single_line=true> <@compress single_line=true>
<script> <script>
$(function () { $(function () {

View File

@ -109,7 +109,6 @@
</div> </div>
</div> </div>
</section> </section>
<script src="/static/plugins/layer/layer.js"></script>
<script type="application/javascript"> <script type="application/javascript">
$('#btnNewPicture').click(function () { $('#btnNewPicture').click(function () {
$('#newPicturePanel').slideToggle(400); $('#newPicturePanel').slideToggle(400);

View File

@ -114,7 +114,6 @@
</div> </div>
</div> </div>
</section> </section>
<script src="/static/plugins/layer/layer.js"></script>
<script src="/static/plugins/editor.md/editormd.min.js"></script> <script src="/static/plugins/editor.md/editormd.min.js"></script>
<script> <script>
@ -272,7 +271,7 @@
}); });
} }
setInterval("autoPush()","30000"); setInterval("autoPush()","60000");
/** /**
* 自动保存文章 * 自动保存文章
*/ */

View File

@ -165,7 +165,6 @@
</div> </div>
</div> </div>
</section> </section>
<script src="/static/plugins/layer/layer.js"></script>
<script src="/static/plugins/editor.md/editormd.min.js"></script> <script src="/static/plugins/editor.md/editormd.min.js"></script>
<script src="/static/plugins/jquery-tageditor/jquery.tag-editor.min.js"></script> <script src="/static/plugins/jquery-tageditor/jquery.tag-editor.min.js"></script>
<script src="/static/plugins/jquery-tageditor/jquery.caret.min.js"></script> <script src="/static/plugins/jquery-tageditor/jquery.caret.min.js"></script>
@ -366,7 +365,7 @@
} }
}); });
} }
setInterval("autoPush()","30000"); setInterval("autoPush()","60000");
/** /**
* 自动保存文章 * 自动保存文章
*/ */

View File

@ -131,7 +131,6 @@
</div> </div>
</div> </div>
</section> </section>
<script src="/static/plugins/layer/layer.js"></script>
<@compress single_line=true> <@compress single_line=true>
<script> <script>
$(function () { $(function () {

View File

@ -7,7 +7,6 @@
<!-- 菜单栏模块 --> <!-- 菜单栏模块 -->
<#include "module/_sidebar.ftl"> <#include "module/_sidebar.ftl">
<div class="content-wrapper"> <div class="content-wrapper">
<link rel="stylesheet" href="/static/plugins/fileinput/fileinput.min.css">
<style type="text/css" rel="stylesheet"> <style type="text/css" rel="stylesheet">
.theme-thumbnail{ .theme-thumbnail{
width:100%; width:100%;
@ -133,56 +132,51 @@
</div> </div>
</div> </div>
</div> </div>
<script src="/static/plugins/layer/layer.js"></script>
<script type="application/javascript"> <script type="application/javascript">
function loadFileInput() { function loadFileInput() {
$.getScript("/static/plugins/fileinput/fileinput.min.js",function () { $('#uploadTheme').fileinput({
$.getScript("/static/plugins/fileinput/zh.min.js",function () { language: 'zh',
$('#uploadTheme').fileinput({ uploadUrl: '/admin/themes/upload',
language: 'zh', allowedFileExtensions: ['zip','jpg'],
uploadUrl: '/admin/themes/upload', maxFileCount: 1,
allowedFileExtensions: ['zip','jpg'], enctype: 'multipart/form-data',
maxFileCount: 1, dropZoneTitle: '拖拽主题压缩包到这里 &hellip;<br>不支持多个主题同时上传',
enctype: 'multipart/form-data', showClose: false
dropZoneTitle: '拖拽主题压缩包到这里 &hellip;<br>不支持多个主题同时上传', }).on("fileuploaded",function (event,data,previewId,index) {
showClose: false var data = data.jqXHR.responseJSON;
}).on("fileuploaded",function (event,data,previewId,index) { if(data.code==1){
var data = data.jqXHR.responseJSON; $("#uploadForm").hide(400);
if(data.code==1){ $.toast({
$("#uploadForm").hide(400); text: data.msg,
$.toast({ heading: '提示',
text: data.msg, icon: 'success',
heading: '提示', showHideTransition: 'fade',
icon: 'success', allowToastClose: true,
showHideTransition: 'fade', hideAfter: 1000,
allowToastClose: true, stack: 1,
hideAfter: 1000, position: 'top-center',
stack: 1, textAlign: 'left',
position: 'top-center', loader: true,
textAlign: 'left', loaderBg: '#ffffff',
loader: true, afterHidden: function () {
loaderBg: '#ffffff', window.location.reload();
afterHidden: function () {
window.location.reload();
}
});
}else{
$.toast({
text: data.msg,
heading: '提示',
icon: 'error',
showHideTransition: 'fade',
allowToastClose: true,
hideAfter: 1000,
stack: 1,
position: 'top-center',
textAlign: 'left',
loader: true,
loaderBg: '#ffffff'
});
} }
}); });
}); }else{
$.toast({
text: data.msg,
heading: '提示',
icon: 'error',
showHideTransition: 'fade',
allowToastClose: true,
hideAfter: 1000,
stack: 1,
position: 'top-center',
textAlign: 'left',
loader: true,
loaderBg: '#ffffff'
});
}
}); });
} }
$(document).ready(function () { $(document).ready(function () {

View File

@ -14,13 +14,13 @@
<link rel="stylesheet" href="/static/css/style.css"> <link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/loader.css"> <link rel="stylesheet" href="/static/css/loader.css">
<link rel="stylesheet" href="/static/plugins/toast/css/jquery.toast.min.css"> <link rel="stylesheet" href="/static/plugins/toast/css/jquery.toast.min.css">
<link rel="stylesheet" href="/static/plugins/fileinput/fileinput.min.css">
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="//oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <script src="//oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--> <![endif]-->
<script src="/static/plugins/jquery/jquery.min.js"></script> <script src="/static/plugins/jquery/jquery.min.js"></script>
<script src="/static/plugins/bootstrap/js/bootstrap.min.js"></script> <script src="/static/plugins/bootstrap/js/bootstrap.min.js"></script>
</head> </head>
<body class="hold-transition sidebar-mini ${options.admin_theme?default('skin-blue')} ${options.admin_layout?default('')} ${options.sidebar_style?default('')}"> <body class="hold-transition sidebar-mini ${options.admin_theme?default('skin-blue')} ${options.admin_layout?default('')} ${options.sidebar_style?default('')}">
<#if options.admin_loading?default("false") == "true"> <#if options.admin_loading?default("false") == "true">
@ -45,6 +45,9 @@
<script src="/static/plugins/pace/pace.min.js"></script> <script src="/static/plugins/pace/pace.min.js"></script>
<script src="/static/js/adminlte.min.js"></script> <script src="/static/js/adminlte.min.js"></script>
<script src="/static/plugins/toast/js/jquery.toast.min.js"></script> <script src="/static/plugins/toast/js/jquery.toast.min.js"></script>
<script src="/static/plugins/layer/layer.js"></script>
<script src="/static/plugins/fileinput/fileinput.min.js"></script>
<script src="/static/plugins/fileinput/zh.min.js"></script>
<script src="/static/js/app.js"></script> <script src="/static/js/app.js"></script>
<@compress single_line=true> <@compress single_line=true>
<script> <script>
@ -63,16 +66,6 @@
},500); },500);
}); });
</#if> </#if>
$(function () {
if($(window).width()<1024){
if($('body').hasClass('layout-boxed')){
$('body').removeClass('layout-boxed');
}
if($('body').hasClass('sidebar-collapse')){
$('body').removeClass('sidebar-collapse');
}
}
});
</script> </script>
</@compress> </@compress>
</body> </body>