Commit 2816991d authored by Vanessa's avatar Vanessa

about #261

parent 4ccace5f
...@@ -225,6 +225,7 @@ blogSubtitle1Label=Blog Subtitle: ...@@ -225,6 +225,7 @@ blogSubtitle1Label=Blog Subtitle:
blogHost1Label=Blog Host: blogHost1Label=Blog Host:
submmitCommentLabel=Commit Comment submmitCommentLabel=Commit Comment
saveLabel=Save saveLabel=Save
autoSaveLabel=Auto Save
tagLabel=Tag tagLabel=Tag
tagsLabel=Tags tagsLabel=Tags
importedLabel=Imported importedLabel=Imported
......
...@@ -225,6 +225,7 @@ blogSubtitle1Label=\u535a\u5ba2\u5b50\u6807\u9898\uff1a ...@@ -225,6 +225,7 @@ blogSubtitle1Label=\u535a\u5ba2\u5b50\u6807\u9898\uff1a
blogHost1Label=\u535a\u5ba2\u5730\u5740\uff1a blogHost1Label=\u535a\u5ba2\u5730\u5740\uff1a
submmitCommentLabel=\u63d0\u4ea4\u8bc4\u8bba submmitCommentLabel=\u63d0\u4ea4\u8bc4\u8bba
saveLabel=\u4fdd\u5b58 saveLabel=\u4fdd\u5b58
autoSaveLabel=\u81ea\u52a8\u4fdd\u5b58
tagLabel=\u6807\u7b7e tagLabel=\u6807\u7b7e
tagsLabel=\u6807\u7b7e tagsLabel=\u6807\u7b7e
importedLabel=\u5df2\u5bfc\u5165 importedLabel=\u5df2\u5bfc\u5165
......
...@@ -114,7 +114,8 @@ ...@@ -114,7 +114,8 @@
"navLabel": "${navLabel}", "navLabel": "${navLabel}",
"userLabel": "${userLabel}", "userLabel": "${userLabel}",
"changeRoleLabel": "${changeRoleLabel}", "changeRoleLabel": "${changeRoleLabel}",
"visitorUserLabel": "${visitorUserLabel}" "visitorUserLabel": "${visitorUserLabel}",
"autoSaveLabel": "${autoSaveLabel}"
}; };
admin.init(); admin.init();
......
...@@ -32,7 +32,7 @@ admin.article = { ...@@ -32,7 +32,7 @@ admin.article = {
// 自动保存草稿定时器 // 自动保存草稿定时器
autoSaveDraftTimer: "", autoSaveDraftTimer: "",
// 自动保存间隔 // 自动保存间隔
AUTOSAVETIME: 3000, AUTOSAVETIME: 1000 * 60,
/** /**
* @description 获取文章并把值塞入发布文章页面 * @description 获取文章并把值塞入发布文章页面
* @param {String} id 文章 id * @param {String} id 文章 id
...@@ -171,7 +171,7 @@ admin.article = { ...@@ -171,7 +171,7 @@ admin.article = {
data: JSON.stringify(requestJSONObject), data: JSON.stringify(requestJSONObject),
success: function(result, textStatus) { success: function(result, textStatus) {
if (isAuto) { if (isAuto) {
$("#tipMsg").text("TODO:"); $("#tipMsg").text(Label.autoSaveLabel);
admin.article.status.id = result.oId; admin.article.status.id = result.oId;
return; return;
} }
...@@ -246,7 +246,7 @@ admin.article = { ...@@ -246,7 +246,7 @@ admin.article = {
data: JSON.stringify(requestJSONObject), data: JSON.stringify(requestJSONObject),
success: function(result, textStatus) { success: function(result, textStatus) {
if (isAuto) { if (isAuto) {
$("#tipMsg").text("TODO:"); $("#tipMsg").text(Label.autoSaveLabel);
return; return;
} }
...@@ -450,7 +450,6 @@ admin.article = { ...@@ -450,7 +450,6 @@ admin.article = {
* @description 自动保存草稿件 * @description 自动保存草稿件
*/ */
_autoSaveToDraft: function() { _autoSaveToDraft: function() {
console.log("auto");
if ($("#title").val().replace(/\s/g, "") === "" || if ($("#title").val().replace(/\s/g, "") === "" ||
admin.editors.articleEditor.getContent().replace(/\s/g, "") === "" || admin.editors.articleEditor.getContent().replace(/\s/g, "") === "" ||
$("#tag").val().replace(/\s/g, "") === "") { $("#tag").val().replace(/\s/g, "") === "") {
...@@ -458,13 +457,15 @@ admin.article = { ...@@ -458,13 +457,15 @@ admin.article = {
} }
if (admin.article.status.id) { if (admin.article.status.id) {
if (admin.article.status.isArticle) { if (admin.article.status.isArticle) {
admin.article.unPublish(true);
admin.article.status.isArticle = false; admin.article.status.isArticle = false;
admin.article.setStatus();
admin.article.unPublish(true);
} else { } else {
admin.article.update(false, true); admin.article.update(false, true);
} }
} else { } else {
admin.article.add(false, true); admin.article.add(false, true);
admin.article.status.isArticle = false;
} }
}, },
/** /**
...@@ -508,7 +509,7 @@ admin.article = { ...@@ -508,7 +509,7 @@ admin.article = {
cache: false, cache: false,
success: function(result, textStatus) { success: function(result, textStatus) {
if (isAuto) { if (isAuto) {
$("#tipMsg").text("TODO:"); $("#tipMsg").text(Label.autoSaveLabel);
return; return;
} }
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment