member i18n
This commit is contained in:
@ -28,8 +28,10 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content1">{{msg . "content"}}</label>
|
||||
<div id="popularToolbar"></div>
|
||||
<textarea id="content1" name="content">{{.single.Content}}</textarea>
|
||||
<div class="toolbar-content">
|
||||
<div id="popularToolbar" class="tool-bar"></div>
|
||||
<div id="content1" class="content-ctn" name="content">{{if .single}}{{.single.Content|raw}}{{end}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
@ -40,28 +42,16 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<style>
|
||||
.mce-btn.mce-active, .mce-btn.mce-active:hover {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.mce-btn {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="/tinymce/tinymce.js"></script>
|
||||
<script>
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
var LeaAce = {nowIsInAce: function() {return false;}};
|
||||
var LeaAce = null;
|
||||
$(function() {
|
||||
tinymce.init({
|
||||
selector : "#content1",
|
||||
content_css : ["/css/editor/editor.css" ],
|
||||
theme : "leanote",
|
||||
theme: 'leanote',
|
||||
language : "{{.locale}}",
|
||||
height : 300,
|
||||
width : "100%",
|
||||
// skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
@ -95,12 +85,12 @@ $(function() {
|
||||
ajaxPost("/member/blog/doAddOrUpdateSingle/", data, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
// 添加成功后, 跳转之
|
||||
art.tips("Success")
|
||||
art.tips(getMsg("Success"));
|
||||
if(!data.pageId) {
|
||||
location.href = "/member/blog/single";
|
||||
}
|
||||
} else {
|
||||
art.alert(re.Msg || "error")
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -69,7 +69,6 @@
|
||||
|
||||
</div>
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="/tinymce/tinymce.min.js"></script>
|
||||
<script>
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
$(function() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "cate"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "Category"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
@ -46,9 +46,9 @@ $(function() {
|
||||
});
|
||||
ajaxPost("/member/blog/upateCateIds", {cateIds: ids}, function(re){
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -61,7 +61,7 @@ $(function() {
|
||||
if(reIsOk(re)) {
|
||||
$t.val(re.Item);
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"><h3 class="m-b-none">{{msg . "postList"}}</h3></div>
|
||||
<div class="m-b-md"><h3 class="m-b-none">{{msg . "Posts"}}</h3></div>
|
||||
<style>
|
||||
.url-title {
|
||||
width: 260px;
|
||||
@ -15,7 +15,7 @@
|
||||
<div class="input-group search-group">
|
||||
<input type="text" class="input-sm form-control" placeholder="{{msg . "title"}}" id="keywords" value="{{.keywords}}" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-sm btn-default" type="button" data-url="/member/blog/index">Search</button>
|
||||
<button class="btn btn-sm btn-default" type="button" data-url="/member/blog/index">{{leaMsg $ "Search"}}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -92,7 +92,7 @@
|
||||
{{end}}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{$.userAndBlog.PostUrl}}/{{$.urlTitle}}" class="post" target="_blank">{{.Title|raw}}</a>
|
||||
<a href="{{$.userAndBlog.PostUrl}}/{{$.urlTitle}}" class="post" target="_blank">{{.Title}}</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@ -166,4 +166,4 @@ $(function() {
|
||||
});
|
||||
</script>
|
||||
|
||||
{{template "member/end.html" .}}
|
||||
{{template "member/end.html" .}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "single"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "Single"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
@ -47,22 +47,22 @@ $(function() {
|
||||
});
|
||||
ajaxPost("/member/blog/sortSingles", {singleIds: ids}, function(re){
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".page-delete").click(function() {
|
||||
var singleId = $(this).data('id');
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure ?"), function() {
|
||||
ajaxPost("/member/blog/deleteSingle", {singleId: singleId}, function(re){
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
location.reload();
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -76,7 +76,7 @@ $(function() {
|
||||
if(reIsOk(re)) {
|
||||
$t.val(re.Item);
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md clearfix">
|
||||
<h3 class="m-b-none">
|
||||
{{msg . "themeSet"}}
|
||||
{{msg . "theme"}}
|
||||
<small>
|
||||
(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">Leanote Blog Theme Api</a>)
|
||||
@ -138,10 +138,10 @@
|
||||
|
||||
</div>
|
||||
{{template "member/footer.html" .}}
|
||||
<script src="/js/require.js"></script>
|
||||
|
||||
<script>
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
$(function() {
|
||||
$(function() {
|
||||
// 使用主题
|
||||
$(".btn-active").click(function() {
|
||||
var id = $(this).parent().data('id');
|
||||
@ -169,7 +169,7 @@ $(".btn-export").click(function() {
|
||||
$(".btn-delete").click(function() {
|
||||
var id = $(this).parent().data('id');
|
||||
var t = $(this);
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure ?"), function() {
|
||||
t.button("loading");
|
||||
ajaxPost("/member/blog/deleteTheme", {themeId: id}, function(re) {
|
||||
t.button("reset");
|
||||
@ -187,15 +187,15 @@ $(".btn-delete").click(function() {
|
||||
$(".btn-install").click(function() {
|
||||
var id = $(this).parent().data('id');
|
||||
var t = $(this);
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure to install it ?"), function() {
|
||||
t.button("loading");
|
||||
ajaxPost("/member/blog/installTheme", {themeId: id}, function(re) {
|
||||
t.button("reset");
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
location.reload();
|
||||
} else {
|
||||
art.alert("Error");
|
||||
art.alert(getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -206,15 +206,15 @@ $(".btn-install").click(function() {
|
||||
$(".btn-public").click(function() {
|
||||
var id = $(this).parent().data('id');
|
||||
var t = $(this);
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure ?"), function() {
|
||||
t.button("loading");
|
||||
ajaxPost("/member/blog/publicTheme", {themeId: id}, function(re) {
|
||||
t.button("reset");
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
location.reload();
|
||||
} else {
|
||||
art.alert("Error");
|
||||
art.alert(getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -222,19 +222,17 @@ $(".btn-public").click(function() {
|
||||
{{end}}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="/js/require.js"></script>
|
||||
<script>
|
||||
// 导入主题
|
||||
require.config({
|
||||
baseUrl: '/public',
|
||||
paths: {
|
||||
'import_theme': 'js/app/import_theme',
|
||||
'jquery.ui.widget': 'tinymce/plugins/leaui_image/public/js/jquery.ui.widget',
|
||||
'fileupload': '/tinymce/plugins/leaui_image/public/js/jquery.fileupload',
|
||||
'iframe-transport': '/tinymce/plugins/leaui_image/public/js/jquery.iframe-transport'
|
||||
'import_theme': 'member/js/import_theme',
|
||||
'fileupload': 'js/plugins/libs-min/fileupload',
|
||||
},
|
||||
shim: {
|
||||
'fileupload': {deps: ['jquery.ui.widget', 'iframe-transport']}
|
||||
}
|
||||
});
|
||||
$(function() {
|
||||
require(['import_theme'], function(import_theme) {});
|
||||
|
@ -7,50 +7,63 @@
|
||||
</style>
|
||||
|
||||
<div class="m-b-md"> <h3 class="m-b-none">
|
||||
{{.note.Title}} - 摘要设置
|
||||
{{.note.Title}} - {{msg $ "setAbstract"}}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
以下内容设置后, 以后修改笔记时将不自动获取. 若将该文章取消为博客后, 以下内容会自动获取.
|
||||
|
||||
{{leaMsg . "Once the abstract has been updated, it will not set the abstract automatically other than you cancel it."}}
|
||||
|
||||
<hr />
|
||||
<div class="alert alert-danger" id="baseMsg" style="display: none"></div>
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-group" id="mainImg">
|
||||
<label>
|
||||
主图片
|
||||
<a class="btn btn-default btn-select-img">从笔记中自动获取下一张</a>
|
||||
{{leaMsg $ "Main Image"}}
|
||||
<a class="btn btn-default btn-select-img">
|
||||
{{leaMsg $ "Get next image as main image from content"}}
|
||||
</a>
|
||||
</label>
|
||||
<div>
|
||||
<div style="border: 2px dashed #ccc; padding: 5px;">
|
||||
<img src="{{.note.ImgSrc}}" class="img-src" id="imgSrc"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>描述</label>
|
||||
<label>{{leaMsg $ "Description" }}</label>
|
||||
<textarea type="text" rows="6" class="form-control" id="desc" name="desc">{{.note.Desc}}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content1">摘要</label>
|
||||
<div id="popularToolbar"></div>
|
||||
<textarea id="content1" name="content">{{.note.Abstract}}</textarea>
|
||||
<label for="content1">{{leaMsg $ "Abstract"}}</label>
|
||||
<div class="toolbar-content">
|
||||
<div id="popularToolbar" class="tool-bar"></div>
|
||||
<div id="content1" class="content-ctn" name="content">{{raw .note.Abstract}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="submitBtn" class="btn btn-success">{{msg . "submit"}}</button>
|
||||
</footer>
|
||||
|
||||
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
原文:
|
||||
{{leaMsg . "Raw Content"}}:
|
||||
<hr />
|
||||
</p>
|
||||
<div id="rawContent">
|
||||
{{.note.Content|raw}}
|
||||
{{if .note.IsMarkdown}}
|
||||
<pre>{{.note.Content|raw}}</pre>
|
||||
{{else}}
|
||||
{{.note.Content|raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@ -62,20 +75,18 @@
|
||||
<script type="text/javascript" src="/tinymce/tinymce.js"></script>
|
||||
<script>
|
||||
var UrlPrefix = "{{.siteUrl}}";
|
||||
var LeaAce = null;
|
||||
$(function() {
|
||||
tinymce.init({
|
||||
inline: true,
|
||||
selector : "#content1",
|
||||
content_css : [ "/css/bootstrap.css", "/css/editor/editor.css" ],
|
||||
skin : "custom",
|
||||
theme: 'leanote',
|
||||
language : "{{.locale}}",
|
||||
height : 300,
|
||||
width : "100%",
|
||||
skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link leanote_image lists charmap hr ",
|
||||
"advlist autolink link lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
"table contextmenu directionality textcolor paste fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist",
|
||||
"table contextmenu directionality textcolor fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist |",
|
||||
menubar : false,
|
||||
statusbar : false,
|
||||
font_formats : "Arial=arial,helvetica,sans-serif;"
|
||||
@ -108,19 +119,39 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
// 选择主图
|
||||
var $imgs = $("#rawContent").find("img");
|
||||
var imgLen = $imgs.length;
|
||||
var imgSeq = 0;
|
||||
var $imgSrc = $("#imgSrc");
|
||||
$(".btn-select-img").click(function() {
|
||||
if(imgLen == 0) {
|
||||
return;
|
||||
var isMarkdown = {{$.note.IsMarkdown}};
|
||||
|
||||
var images = [];
|
||||
if (isMarkdown) {
|
||||
var content = $('#rawContent').html();
|
||||
var reg = /!\[.*?\]\((.*)\)/g;
|
||||
var ret = reg.exec(content);
|
||||
while(ret) {
|
||||
images.push(ret[1]);
|
||||
ret = reg.exec(content);
|
||||
}
|
||||
imgSeq++;
|
||||
imgSeq = imgSeq%imgLen;
|
||||
$imgSrc.attr("src", $imgs.eq(imgSeq).attr("src"));
|
||||
});
|
||||
// console.log(images);
|
||||
}
|
||||
// 选择主图
|
||||
$("#rawContent").find("img").each(function () {
|
||||
if($(this).attr('src')) {
|
||||
images.push($(this).attr('src'));
|
||||
}
|
||||
});;
|
||||
var imgLen = images.length;
|
||||
var imgSeq = 0;
|
||||
$imgSrc = $('#imgSrc');
|
||||
|
||||
if (imgLen) {
|
||||
$(".btn-select-img").click(function() {
|
||||
imgSeq++;
|
||||
imgSeq = imgSeq % imgLen;
|
||||
$imgSrc.attr("src", images[imgSeq]);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$(".btn-select-img").hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
<a class="btn btn-default" href="{{$.siteUrl}}/preview?themeId={{.themeId}}" target="_blank"><span class="fa fa-eye"></span> {{msg . "preview"}}</a>
|
||||
|
||||
<small>
|
||||
(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">Leanote Blog Theme Api</a>)
|
||||
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">{{msg . "needHelp"}} {{msg . "Leanote Blog Theme Api"}}</a>
|
||||
</small>
|
||||
</h3>
|
||||
</div>
|
||||
@ -49,7 +49,7 @@
|
||||
<header class="panel-heading">
|
||||
{{msg . "tplStyleScript"}}:
|
||||
</header>
|
||||
<div class="panel-body" style="height:430px;overflow: auto;">
|
||||
<div class="panel-body" style="<!--height:430px;-->overflow: auto;">
|
||||
|
||||
<div class="list-group bg-white file-list">
|
||||
{{range .myTpls}}
|
||||
@ -67,6 +67,7 @@
|
||||
</footer>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading">
|
||||
@ -74,7 +75,7 @@
|
||||
<span id="msg"></span>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<div id="tplContent" class="form-control" style="width: 100%; height: 400px;"></div>
|
||||
<div id="tplContent" class="form-control" style="width: 100%; height: 500px;"></div>
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="saveBtn" class="btn btn-success">{{msg . "save"}}</button>
|
||||
@ -107,7 +108,7 @@
|
||||
</div>
|
||||
|
||||
{{template "member/footer.html" .}}
|
||||
<script src="/public/libs/ace/ace.js" type="text/javascript"></script>
|
||||
<script src="/public/libs/ace/ace.js"></script>
|
||||
<script>
|
||||
var editor = ace.edit("tplContent");
|
||||
editor.setTheme("ace/theme/tomorrow");
|
||||
@ -118,6 +119,7 @@ var themeId = "{{.themeId}}";
|
||||
var themeBasePath = "/{{$.theme.Path}}";
|
||||
var theme = {
|
||||
cache: {}, // filename => content
|
||||
inited: {}, // filename => bool, 是否已初始化, 防止未加载完就切换到其它
|
||||
curTplO: $("#curTpl"),
|
||||
tplContentO: $("#tplContent"),
|
||||
saveBtnO: $("#saveBtn"),
|
||||
@ -153,10 +155,10 @@ var theme = {
|
||||
e.stopPropagation();
|
||||
var $a = $(this).closest("a");
|
||||
var file = $a.data('file');
|
||||
art.confirm("Are you sure to delete " + file + " ?", function() {
|
||||
art.confirm(getMsg("Are you sure to delete") + ' ' + file + " ?", function() {
|
||||
ajaxPost("/member/blog/deleteTpl", {themeId: themeId, filename: file}, function(re) {
|
||||
// if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
$a.remove();
|
||||
if(self.curTpl == file) {
|
||||
$(".file-list a").eq(0).trigger("click");
|
||||
@ -173,18 +175,20 @@ var theme = {
|
||||
self.newFileO.click(function() {
|
||||
// 文件是否存在?
|
||||
|
||||
|
||||
art.prompt("Filename", function(file) {
|
||||
art.prompt(getMsg("Filename"), function(file) {
|
||||
if(!file) {
|
||||
return;
|
||||
}
|
||||
if($('[data-filename="' + file + '"]').length > 0) {
|
||||
art.alert('File exists');
|
||||
art.alert(getMsg('File exists'));
|
||||
return;
|
||||
}
|
||||
var t = $('<a href="#" class="list-group-item " data-file="' + file + '"> <i class="fa fa-remove icon-muted remove-file" title="delete file" ></i> <span class="filename" data-filename="' + file + '">' + file + '</span><span class="badge"></span></a>');
|
||||
var t = $('<a href="#" class="list-group-item " data-file="' + file + '"> <i class="fa fa-remove icon-muted remove-file" title="' + getMsg("Delete file") + '" ></i> <span class="filename" data-filename="' + file + '">' + file + '</span><span class="badge"></span></a>');
|
||||
$(".file-list").append(t);
|
||||
|
||||
self.cache[file] = "";
|
||||
self.inited[file] = true;
|
||||
|
||||
// trigger click, 选中之
|
||||
t.click();
|
||||
});
|
||||
@ -221,6 +225,12 @@ var theme = {
|
||||
}
|
||||
// 之前的内容是否有改动
|
||||
if(self.cache[filename] == content) {
|
||||
// console.log('content is same');
|
||||
return;
|
||||
}
|
||||
// 内容都没有加载进来
|
||||
if(!self.inited[filename]) {
|
||||
// console.log('not inited');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -247,7 +257,7 @@ var theme = {
|
||||
renderContent: function(name, content) {
|
||||
var self = this;
|
||||
self.curTplO.html(name);
|
||||
self.curTpl = name; // 这里才设置
|
||||
// self.curTpl = name; // 这里才设置
|
||||
var lang = "html";
|
||||
if(name.indexOf(".js") > 0 || name.indexOf(".json") > 0) {
|
||||
lang = "javascript";
|
||||
@ -264,7 +274,7 @@ var theme = {
|
||||
renderTpl: function(name) {
|
||||
var self = this;
|
||||
var content = "";
|
||||
self.curTpl = ""; // 这里设置为空
|
||||
self.curTpl = name; // 这里设置为空
|
||||
if(self.cache[name] != undefined) {
|
||||
content = self.cache[name];
|
||||
self.renderContent(name, content);
|
||||
@ -273,7 +283,13 @@ var theme = {
|
||||
ajaxGet("/member/blog/getTplContent", {themeId: themeId, filename: name}, function(re){
|
||||
if(reIsOk(re)) {
|
||||
self.cache[name] = re.Item;
|
||||
self.renderContent(name, re.Item);
|
||||
self.inited[name] = true;
|
||||
// 以防点击过快, 响应不按顺序
|
||||
if (self.curTpl == name) {
|
||||
self.renderContent(name, re.Item);
|
||||
} else {
|
||||
alert(getMsg('Error'));
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -287,10 +303,10 @@ var theme = {
|
||||
self.imageListO.on("click", ".delete-image", function(re) {
|
||||
var file = $(this).data('image');
|
||||
var t = this;
|
||||
art.confirm("Are you sure to delete it " + file + " ?", function() {
|
||||
art.confirm(getMsg("Are you sure to delete") + ' ' + file + " ?", function() {
|
||||
ajaxPost("/member/blog/deleteThemeImage", {themeId: themeId, filename: file}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
$(t).closest("li").remove();
|
||||
} else {
|
||||
art.alert(re.Msg);
|
||||
@ -302,7 +318,7 @@ var theme = {
|
||||
renderImages: function(images) {
|
||||
var self = this;
|
||||
if(!images || images.length == 0) {
|
||||
self.imageListO.html("无图片");
|
||||
self.imageListO.html(getMsg("No images"));
|
||||
return;
|
||||
}
|
||||
var html = "";
|
||||
@ -324,7 +340,7 @@ var theme = {
|
||||
});
|
||||
},
|
||||
}
|
||||
$(function() {
|
||||
$(function() {
|
||||
theme.init();
|
||||
$(window).keydown(function(e) {
|
||||
if (e.keyCode == 83 && (e.ctrlKey || e.metaKey)) {
|
||||
@ -346,7 +362,7 @@ function uploadFinish(ret) {
|
||||
return;
|
||||
}
|
||||
// 上传出错
|
||||
art.alert("error");
|
||||
art.alert(getMsg("Error"));
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user