mirror of https://github.com/halo-dev/halo
🎨 精简js代码
parent
1d2fdfbbec
commit
65cd25eeb4
|
@ -1,7 +1,7 @@
|
|||
.native-list-one-head a, .native-list-one-content a{
|
||||
/* color: #424242; */
|
||||
color: #7575d0;
|
||||
opacity: 1;!important;
|
||||
opacity: 1!important;
|
||||
-webkit-transition: all .15s linear;
|
||||
-moz-transition: all .15s linear;
|
||||
-o-transition: all .15s linear;
|
||||
|
|
|
@ -1,101 +1,102 @@
|
|||
/**
|
||||
皮肤颜色附加
|
||||
*/
|
||||
.skin-blue .box.box-primary{
|
||||
.skin-blue .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-blue .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-blue .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-blue-light .box.box-primary{
|
||||
.skin-blue-light .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-blue-light .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-blue-light .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-black .box.box-primary{
|
||||
.skin-black .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-black .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-black .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-black-light .box.box-primary{
|
||||
.skin-black-light .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-black-light .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-black-light .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-green .box.box-primary{
|
||||
.skin-green .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-green .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-green .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-green-light .box.box-primary{
|
||||
.skin-green-light .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-green-light .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-green-light .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-purple .box.box-primary{
|
||||
.skin-purple .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-purple .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-purple .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-purple-light .box.box-primary{
|
||||
.skin-purple-light .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-purple-light .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-purple-light .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-red .box.box-primary{
|
||||
.skin-red .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-red .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-red .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-red-light .box.box-primary{
|
||||
.skin-red-light .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-red-light .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-red-light .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-yellow .box.box-primary{
|
||||
.skin-yellow .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-yellow .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-yellow .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-yellow-light .box.box-primary{
|
||||
.skin-yellow-light .box.box-primary {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.skin-yellow-light .nav-tabs-custom > .nav-tabs > li.active{
|
||||
.skin-yellow-light .nav-tabs-custom > .nav-tabs > li.active {
|
||||
border-top-color: #fff;
|
||||
}
|
||||
|
||||
.layout-boxed {
|
||||
background: url('../images/boxed-bg.jpg') repeat fixed;
|
||||
}
|
||||
|
@ -105,9 +106,11 @@
|
|||
height: 2px;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #d0afaf;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #eee;
|
||||
}
|
||||
|
@ -129,16 +132,19 @@
|
|||
transition: all .2s ease-in-out
|
||||
}
|
||||
|
||||
.btn-header:hover{
|
||||
background:#3c8dbc;color:#fff
|
||||
.btn-header:hover {
|
||||
background: #3c8dbc;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.table-responsive{
|
||||
border: none!important;
|
||||
.table-responsive {
|
||||
border: none !important;
|
||||
}
|
||||
.table-bordered{
|
||||
border: none!important;
|
||||
|
||||
.table-bordered {
|
||||
border: none !important;
|
||||
}
|
||||
.box{
|
||||
border-top: none!important;
|
||||
|
||||
.box {
|
||||
border-top: none !important;
|
||||
}
|
||||
|
|
|
@ -185,6 +185,38 @@ $.halo.prototype.showMsgAndRedirect = function (text, icon, hideAfter, url) {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 格式化字符串
|
||||
*
|
||||
* @param a a
|
||||
* @returns {*} a
|
||||
*/
|
||||
$.halo.prototype.formatContent = function (a) {
|
||||
a = a.replace(/\r\n/g, '<br/>');
|
||||
a = a.replace(/\n/g, '<br/>');
|
||||
a = a.replace(/\s/g, ' ');
|
||||
return a;
|
||||
};
|
||||
|
||||
/**
|
||||
* layer弹出框
|
||||
*
|
||||
* @param url 地址
|
||||
* @param title 标题
|
||||
*/
|
||||
$.halo.prototype.layerModal = function (url, title) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: title,
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: url,
|
||||
scrollbar: false
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 保存设置选项
|
||||
*/
|
||||
|
|
|
@ -5,7 +5,7 @@ var s = new OwO({
|
|||
position: 'down',
|
||||
width: '100%',
|
||||
maxHeight: '210px',
|
||||
api:"/static/plugins/OwO/OwO.min.json"
|
||||
api: "/static/plugins/OwO/OwO.min.json"
|
||||
});
|
||||
$(document).ready(function () {
|
||||
$(".comment-list-one-head").each(function (i) {
|
||||
|
@ -27,10 +27,10 @@ $('#comment-submit').click(function () {
|
|||
$(".comment-message").fadeIn(1000);
|
||||
setTimeout(function () {
|
||||
$(".comment-message").fadeOut(1000);
|
||||
},1500);
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
$(this).attr("disabled","disabled");
|
||||
$(this).attr("disabled", "disabled");
|
||||
$(this).html("提交中...");
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
|
@ -49,11 +49,11 @@ $('#comment-submit').click(function () {
|
|||
localStorage.setItem('author', author.val());
|
||||
localStorage.setItem('email', email.val());
|
||||
localStorage.setItem('url', url.val());
|
||||
if(data.code==1){
|
||||
if (data.code == 1) {
|
||||
$('.comment-input-content').val("");
|
||||
$(".comment-message").html("<span>"+data.msg+"</span>");
|
||||
}else{
|
||||
$(".comment-message").html("<span style='color:red'>"+data.msg+"</span>");
|
||||
$(".comment-message").html("<span>" + data.msg + "</span>");
|
||||
} else {
|
||||
$(".comment-message").html("<span style='color:red'>" + data.msg + "</span>");
|
||||
}
|
||||
$(".comment-message").fadeIn(1000);
|
||||
setTimeout(function () {
|
||||
|
@ -61,21 +61,21 @@ $('#comment-submit').click(function () {
|
|||
$("#comment-submit").removeAttr("disabled");
|
||||
$("#comment-submit").html("提交");
|
||||
window.location.reload();
|
||||
},1500);
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
});
|
||||
$('.comment-list-one-footer-reback').click(function () {
|
||||
var at = $(this).attr("at");
|
||||
var commentParentAuthor = $('#comment-id-'+at).find(".comment-list-one-head-name").html();
|
||||
var commentParentAuthor = $('#comment-id-' + at).find(".comment-list-one-head-name").html();
|
||||
$('#commentParent').val(at);
|
||||
$('#commentContent').attr("placeholder","@"+commentParentAuthor);
|
||||
$('#commentContent').attr("placeholder", "@" + commentParentAuthor);
|
||||
$(".comment-cancel-reply").show();
|
||||
$('#commentContent').focus();
|
||||
});
|
||||
$('.comment-cancel-reply').click(function () {
|
||||
$('#commentParent').val(0);
|
||||
$('#commentContent').attr("placeholder","");
|
||||
$('#commentContent').attr("placeholder", "");
|
||||
$(".comment-cancel-reply").hide();
|
||||
});
|
||||
|
||||
|
@ -83,9 +83,9 @@ $('.comment-cancel-reply').click(function () {
|
|||
* 加载头像
|
||||
*/
|
||||
function loadAvatar() {
|
||||
$(".comment-author-avatar").attr("src","//gravatar.loli.net/avatar/"+md5(localStorage.getItem("email"))+"?s=256&d="+avatarType);
|
||||
if($('input[name=commentAuthorEmail]').val()!='' && $('input[name=commentAuthorEmail]').val()!=null){
|
||||
$(".comment-author-avatar").attr("src","//gravatar.loli.net/avatar/"+md5($('input[name=commentAuthorEmail]').val())+"?s=256&d="+avatarType);
|
||||
$(".comment-author-avatar").attr("src", "//gravatar.loli.net/avatar/" + md5(localStorage.getItem("email")) + "?s=256&d=" + avatarType);
|
||||
if ($('input[name=commentAuthorEmail]').val() != '' && $('input[name=commentAuthorEmail]').val() != null) {
|
||||
$(".comment-author-avatar").attr("src", "//gravatar.loli.net/avatar/" + md5($('input[name=commentAuthorEmail]').val()) + "?s=256&d=" + avatarType);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,15 +95,16 @@ function loadAvatar() {
|
|||
* @returns {string}
|
||||
*/
|
||||
var parser = new UAParser();
|
||||
function show_ua(string){
|
||||
|
||||
function show_ua(string) {
|
||||
parser.setUA(string);
|
||||
var uua = parser.getResult();
|
||||
if(uua.os.version=='x86_64') {
|
||||
if (uua.os.version == 'x86_64') {
|
||||
uua.os.version = 'x64';
|
||||
}
|
||||
var browser = uua.browser.name+' '+uua.browser.version;
|
||||
var browser = uua.browser.name + ' ' + uua.browser.version;
|
||||
var os = uua.os.name + ' ' + uua.os.version;
|
||||
return '<span class="ua">'+browser+'</span><span class="ua">'+os+'</span>';
|
||||
return '<span class="ua">' + browser + '</span><span class="ua">' + os + '</span>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,27 +2,28 @@ var halo = new $.halo();
|
|||
$(document).ready(function () {
|
||||
$("#login-name").val(localStorage.getItem("loginName"));
|
||||
});
|
||||
|
||||
function btn_login() {
|
||||
$('#btn-login').button('loading');
|
||||
var name = $("#login-name").val();
|
||||
var pwd = $("#login-pwd").val();
|
||||
if(name==""||pwd==""){
|
||||
halo.showMsg("请输入完整信息!",'info',2000);
|
||||
if (name == "" || pwd == "") {
|
||||
halo.showMsg("请输入完整信息!", 'info', 2000);
|
||||
$('#btn-login').button('reset');
|
||||
}else{
|
||||
} else {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/admin/getLogin',
|
||||
async: false,
|
||||
data:{
|
||||
data: {
|
||||
'loginName': name,
|
||||
'loginPwd': pwd
|
||||
},
|
||||
success: function (data) {
|
||||
localStorage.setItem('loginName', $("#login-name").val());
|
||||
if(data.code==1){
|
||||
halo.showMsgAndRedirect(data.msg,'success',1000,'/admin');
|
||||
}else{
|
||||
if (data.code == 1) {
|
||||
halo.showMsgAndRedirect(data.msg, 'success', 1000, '/admin');
|
||||
} else {
|
||||
$('.login-body').addClass('animate shake');
|
||||
$.toast({
|
||||
text: data.msg,
|
||||
|
@ -46,8 +47,9 @@ function btn_login() {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(document).keydown(function (event) {
|
||||
if(event.keyCode == 13){
|
||||
if (event.keyCode == 13) {
|
||||
btn_login();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<#list attachments.content as attachment>
|
||||
<div class="col-lg-2 col-md-3 col-sm-6 col-xs-6 div-thumbnail" onclick="openDetail(${attachment.attachId?c})">
|
||||
<div class="col-lg-2 col-md-3 col-sm-6 col-xs-6 div-thumbnail" onclick="halo.layerModal('/admin/attachments/attachment?attachId=${attachment.attachId?c}','<@spring.message code="admin.attachments.js.modal.detail-title" />')">
|
||||
<a href="#" class="thumbnail">
|
||||
<img src="${attachment.attachSmallPath?if_exists}" class="img-responsive">
|
||||
</a>
|
||||
|
@ -53,18 +53,6 @@
|
|||
</div>
|
||||
</section>
|
||||
<script type="application/javascript">
|
||||
function openDetail(id) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="admin.attachments.js.modal.detail-title" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/attachments/attachment?attachId='+id,
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
function loadFileInput() {
|
||||
$('#uploadImg').fileinput({
|
||||
language: 'zh',
|
||||
|
|
|
@ -185,7 +185,7 @@
|
|||
'commentId': $("#commentId").val(),
|
||||
'userAgent': $("#userAgent").val(),
|
||||
'postId': $("#postId").val(),
|
||||
'commentContent': formatContent($("#commentContent").val())
|
||||
'commentContent': halo.formatContent($("#commentContent").val())
|
||||
},
|
||||
success: function (data) {
|
||||
if(data.code==1){
|
||||
|
@ -194,18 +194,6 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 格式化字符串
|
||||
* @param a a
|
||||
* @returns {*}
|
||||
*/
|
||||
function formatContent(a) {
|
||||
a = a.replace(/\r\n/g, '<br/>');
|
||||
a = a.replace(/\n/g, '<br/>');
|
||||
a = a.replace(/\s/g, ' ');
|
||||
return a;
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<#include "module/_footer.ftl">
|
||||
|
|
|
@ -337,7 +337,7 @@
|
|||
<button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-bars"></i></button>
|
||||
<ul class="dropdown-menu pull-right" role="menu">
|
||||
<li><a href="#" onclick="openAllLogs()"><@spring.message code='common.btn.view-all' /></a></li>
|
||||
<li><a href="#" onclick="halo.layerModal('/admin/logs','<@spring.message code="admin.index.widgets.text.all-logs" />')"><@spring.message code='common.btn.view-all' /></a></li>
|
||||
<li><a href="/admin/logs/clear"><@spring.message code='admin.index.widgets.btn.clear-logs' /></a></li>
|
||||
</ul>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
|
||||
|
@ -409,18 +409,6 @@
|
|||
$('#blogStart').html(days+1);
|
||||
$('#blogStartDay').html(days+1);
|
||||
});
|
||||
function openAllLogs() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="admin.index.widgets.text.all-logs" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/logs',
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
$('#btnWidgetsOption').click(function () {
|
||||
$('#widgetOptionsPanel').slideToggle(400);
|
||||
});
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
<div class="input-group">
|
||||
<input type="text" class="form-control selectData" id="blogLogo" name="blog_logo" value="${options.blog_logo?if_exists}">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default " type="button" onclick="openAttach('blogLogo')"><@spring.message code='common.btn.choose' /></button>
|
||||
<button class="btn btn-default " type="button" onclick="halo.layerModal('/admin/attachments/select?id=blogLogo','<@spring.message code="common.js.all-attachment" />')"><@spring.message code='common.btn.choose' /></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -105,7 +105,7 @@
|
|||
<div class="input-group">
|
||||
<input type="text" class="form-control selectData" id="blogFavicon" name="blog_favicon" value="${options.blog_favicon?if_exists}">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default " type="button" onclick="openAttach('blogFavicon')"><@spring.message code='common.btn.choose' /></button>
|
||||
<button class="btn btn-default " type="button" onclick="halo.layerModal('/admin/attachments/select?id=blogFavicon','<@spring.message code="common.js.all-attachment" />')"><@spring.message code='common.btn.choose' /></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -663,22 +663,6 @@
|
|||
checkAttachOption();
|
||||
});
|
||||
|
||||
/**
|
||||
* 打开附件
|
||||
*/
|
||||
function openAttach(id) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="common.js.all-attachment" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/attachments/select?id='+id,
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新所有文章的摘要
|
||||
*/
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="galleryUrl" name="galleryUrl">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default " type="button" onclick="openAttach('galleryUrl')"><@spring.message code='common.btn.choose' /></button>
|
||||
<button class="btn btn-default " type="button" onclick="halo.layerModal('/admin/attachments/select?id=galleryUrl','<@spring.message code="common.js.all-attachment" />')"><@spring.message code='common.btn.choose' /></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -87,7 +87,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<#list galleries.content as gallery>
|
||||
<div class="col-lg-2 col-md-3 col-sm-6 col-xs-6 div-thumbnail" onclick="openDetail(${gallery.galleryId?c})">
|
||||
<div class="col-lg-2 col-md-3 col-sm-6 col-xs-6 div-thumbnail" onclick="halo.layerModal('/admin/page/gallery?galleryId=${gallery.galleryId?c}','<@spring.message code="admin.pages.galleries.modal.title" />')">
|
||||
<a href="#" class="thumbnail">
|
||||
<img src="${gallery.galleryThumbnailUrl?if_exists}" class="img-responsive">
|
||||
</a>
|
||||
|
@ -110,28 +110,6 @@
|
|||
$('#btnNewPicture').click(function () {
|
||||
$('#newPicturePanel').slideToggle(400);
|
||||
});
|
||||
function openAttach(id) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="common.js.all-attachment" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/attachments/select?id='+id,
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
function openDetail(id) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="admin.pages.galleries.modal.title" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/page/gallery?galleryId='+id,
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
<#include "module/_footer.ftl">
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<h1 style="display: inline-block;">
|
||||
<@spring.message code='admin.pages.edit.title' />
|
||||
</h1>
|
||||
<a class="btn-header" id="btnOpenAttach" href="#" onclick="openAttachCopy()">
|
||||
<a class="btn-header" id="btnOpenAttach" href="#" onclick="halo.layerModal('/admin/attachments/select?type=post','<@spring.message code="common.js.all-attachment" />')">
|
||||
<@spring.message code='admin.editor.btn.attachs' />
|
||||
</a>
|
||||
<ol class="breadcrumb">
|
||||
|
@ -104,9 +104,9 @@
|
|||
<div class="box-body">
|
||||
<div>
|
||||
<#if post??>
|
||||
<img src="${post.postThumbnail?default("/static/images/thumbnail/thumbnail.png")}" class="img-responsive img-thumbnail" id="selectImg" onclick="openAttach('selectImg')" style="cursor: pointer;">
|
||||
<img src="${post.postThumbnail?default("/static/images/thumbnail/thumbnail.png")}" class="img-responsive img-thumbnail" id="selectImg" onclick="halo.layerModal('/admin/attachments/select?id=selectImg','<@spring.message code="common.js.all-attachment" />')" style="cursor: pointer;">
|
||||
<#else >
|
||||
<img src="/static/images/thumbnail/thumbnail.png" class="img-responsive img-thumbnail" id="selectImg" onclick="openAttach('selectImg')" style="cursor: pointer;">
|
||||
<img src="/static/images/thumbnail/thumbnail.png" class="img-responsive img-thumbnail" id="selectImg" onclick="halo.layerModal('/admin/attachments/select?id=selectImg','<@spring.message code="common.js.all-attachment" />')" style="cursor: pointer;">
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -147,33 +147,6 @@
|
|||
});
|
||||
})
|
||||
|
||||
/**
|
||||
* 打开附件
|
||||
*/
|
||||
function openAttach(e) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="common.js.all-attachment" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/attachments/select?id='+e,
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
function openAttachCopy() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="common.js.all-attachment" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/attachments/select?type=post',
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 检测是否已经存在该链接
|
||||
* @constructor
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</style>
|
||||
<section class="content-header">
|
||||
<h1 style="display: inline-block;"><@spring.message code='admin.posts.edit.title' /></h1>
|
||||
<a class="btn-header" id="btnOpenAttach" href="#" onclick="openAttachCopy()">
|
||||
<a class="btn-header" id="btnOpenAttach" href="#" onclick="halo.layerModal('/admin/attachments/select?type=post','<@spring.message code="common.js.all-attachment" />')">
|
||||
<@spring.message code='admin.editor.btn.attachs' />
|
||||
</a>
|
||||
<ol class="breadcrumb">
|
||||
|
@ -169,9 +169,9 @@
|
|||
<div class="box-body">
|
||||
<div>
|
||||
<#if post??>
|
||||
<img src="${post.postThumbnail?default("/static/images/thumbnail/thumbnail.png")}" class="img-responsive img-thumbnail" id="selectImg" onclick="openAttach('selectImg')" style="cursor: pointer;">
|
||||
<img src="${post.postThumbnail?default("/static/images/thumbnail/thumbnail.png")}" class="img-responsive img-thumbnail" id="selectImg" onclick="halo.layerModal('/admin/attachments/select?id=selectImg','<@spring.message code="common.js.all-attachment" />')" style="cursor: pointer;">
|
||||
<#else >
|
||||
<img src="/static/images/thumbnail/thumbnail.png" class="img-responsive img-thumbnail" id="selectImg" onclick="openAttach('selectImg')" style="cursor: pointer;">
|
||||
<img src="/static/images/thumbnail/thumbnail.png" class="img-responsive img-thumbnail" id="selectImg" onclick="halo.layerModal('/admin/attachments/select?id=selectImg','<@spring.message code="common.js.all-attachment" />')" style="cursor: pointer;">
|
||||
</#if>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -240,35 +240,6 @@
|
|||
$('#tagList').tagEditor('addTag',$(this).val());
|
||||
});
|
||||
|
||||
/**
|
||||
* 打开附件
|
||||
*/
|
||||
function openAttach(e) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="common.js.all-attachment" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/attachments/select?id='+e,
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
|
||||
function openAttachCopy() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="common.js.all-attachment" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/attachments/select?type=post',
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动填充路径,并且将汉字转化成拼音以-隔开
|
||||
*/
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="userAvatar" name="userAvatar" value="${user.userAvatar?if_exists}">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default " type="button" onclick="openAttach('userAvatar')"><@spring.message code='common.btn.choose' /></button>
|
||||
<button class="btn btn-default " type="button" onclick="halo.layerModal('/admin/attachments/select?id=userAvatar','<@spring.message code="common.js.all-attachment" />')"><@spring.message code='common.btn.choose' /></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -136,18 +136,6 @@
|
|||
$(function () {
|
||||
$('[data-toggle="tooltip"]').tooltip()
|
||||
});
|
||||
function openAttach(id) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="common.js.all-attachment" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/attachments/select?id='+id,
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
function saveUser(option) {
|
||||
var param = $('#'+option).serialize();
|
||||
$.ajax({
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</style>
|
||||
<section class="content-header">
|
||||
<h1 style="display: inline-block;"><@spring.message code='admin.themes.title' /></h1>
|
||||
<a class="btn-header" id="showForm" href="#" onclick="openThemeInstall()">
|
||||
<a class="btn-header" id="showForm" href="#" onclick="halo.layerModal('/admin/themes/install','<@spring.message code="admin.themes.js.install-theme" />')">
|
||||
<i class="fa fa-cloud-upload" aria-hidden="true"></i><@spring.message code='admin.themes.btn.install' />
|
||||
</a>
|
||||
<ol class="breadcrumb">
|
||||
|
@ -61,7 +61,7 @@
|
|||
<div class="box-footer">
|
||||
<span class="theme-title">${theme.themeName?if_exists?cap_first}</span>
|
||||
<#if theme.hasOptions>
|
||||
<button class="btn btn-primary btn-sm pull-right btn-theme-setting" onclick="openSetting('${theme.themeName?if_exists}','<#if theme.hasUpdate>true<#else>false</#if>')" style="display: none"><@spring.message code='admin.themes.btn.setting' /></button>
|
||||
<button class="btn btn-primary btn-sm pull-right btn-theme-setting" onclick="halo.layerModal('/admin/themes/options?theme=${theme.themeName?if_exists}&hasUpdate=<#if theme.hasUpdate>true<#else>false</#if>','${theme.themeName?if_exists} <@spring.message code="admin.themes.js.theme-setting" />')" style="display: none"><@spring.message code='admin.themes.btn.setting' /></button>
|
||||
</#if>
|
||||
<#if activeTheme != "${theme.themeName}">
|
||||
<button class="btn btn-default btn-sm pull-right btn-theme-enable" onclick="setTheme('${theme.themeName?if_exists}')" style="display: none;margin-right: 3px"><@spring.message code='admin.themes.btn.enable' /></button>
|
||||
|
@ -104,21 +104,6 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="application/javascript">
|
||||
/**
|
||||
* 打开安装主题的窗口
|
||||
*/
|
||||
function openThemeInstall() {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '<@spring.message code="admin.themes.js.install-theme" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/themes/install',
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置主题
|
||||
|
@ -140,24 +125,6 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开主题设置
|
||||
*
|
||||
* @param theme 主题名
|
||||
*/
|
||||
function openSetting(theme,hasUpdate) {
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: theme+' <@spring.message code="admin.themes.js.theme-setting" />',
|
||||
shadeClose: true,
|
||||
shade: 0.5,
|
||||
maxmin: true,
|
||||
area: ['90%', '90%'],
|
||||
content: '/admin/themes/options?theme='+theme+'&hasUpdate='+hasUpdate,
|
||||
scrollbar: false
|
||||
});
|
||||
}
|
||||
$('.theme-thumbnail').mouseover(function () {
|
||||
$(this).children('.btn-delete').show();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue