Commit 6059316e authored by Vanessa's avatar Vanessa

about #135

parent a10545dc
......@@ -18,20 +18,17 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.3, Jan 7, 2012
* @version 1.0.0.4, May 28, 2013
*/
/* about 相关操作 */
admin.about = {
init: function () {
init: function() {
$.ajax({
url: "http://rhythm.b3log.org/version/solo/latest/" + Label.version,
type: "GET",
cache: false,
dataType:"jsonp",
error: function() {
// alert("Error loading articles from Rhythm");
},
dataType: "jsonp",
success: function(data, textStatus) {
var version = data.soloVersion;
if (version === Label.version) {
......@@ -40,7 +37,9 @@ admin.about = {
$("#aboutLatest").html(Label.outOfDateLabel +
"<a href='" + data.soloDownload + "'>" + version + "</a>");
}
$("#loadMsg").text("");
},
complete: function(XHR, TS) {
admin.clearTip();
}
});
}
......@@ -52,7 +51,7 @@ admin.about = {
admin.register["about"] = {
"obj": admin.about,
"init": admin.about.init,
"refresh": function () {
$("#loadMsg").text("");
"refresh": function() {
admin.clearTip();
}
}
\ No newline at end of file
};
\ No newline at end of file
......@@ -17,10 +17,9 @@
* index for admin
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.2.1, Jan 29, 2013
* @version 1.0.2.2, May 28, 2013
*/
var Admin = function () {
var Admin = function() {
this.register = {};
// 工具栏下的工具
this.tools = ['#page-list', '#file-list', '#link-list', '#preference',
......@@ -34,15 +33,21 @@ $.extend(Admin.prototype, {
/*
* 登出
*/
logout: function () {
logout: function() {
window.location.href = latkeConfig.servePath + "/logout?goto=" + latkeConfig.servePath;
},
/**
* @description 清除提示
*/
clearTip: function() {
$("#tipMsg").text("");
$("#loadMsg").text("");
},
/*
* 根据当前页数设置 hash
* @currentPage {string} 当前页
*/
setHashByPage: function (currentPage) {
setHashByPage: function(currentPage) {
var hash = window.location.hash,
hashList = hash.split("/");
if (/^\d*$/.test(hashList[hashList.length - 1])) {
......@@ -52,19 +57,17 @@ $.extend(Admin.prototype, {
}
window.location.hash = hashList.join("/");
},
/*
* 设置某个 tab 被选择
* @id tab id
*/
selectTab: function (id) {
selectTab: function(id) {
window.location.hash = "#" + id;
},
/*
* 根据当前 hash 解析出当前页数及 hash 数组。
*/
analyseHash: function () {
analyseHash: function() {
var hash = window.location.hash;
var tag = hash.substr(1, hash.length - 1);
var tagList = tag.split("/");
......@@ -80,11 +83,11 @@ $.extend(Admin.prototype, {
}
return tags;
},
/*
* 根据当前 hash 设置当前 tab
*/
setCurByHash: function () {
setCurByHash: function() {
$("#tipMsg").text("");
var tags = admin.analyseHash();
var tab = tags.hashList[1],
subTab = tags.hashList[2];
......@@ -146,7 +149,7 @@ $.extend(Admin.prototype, {
if ($("#tabsPanel_" + tab).length === 1) {
if ($("#tabsPanel_" + tab).html().replace(/\s/g, "") === "") {
// 还未加载 HTML
$("#tabsPanel_" + tab).load("admin-" + tab + ".do", function () {
$("#tabsPanel_" + tab).load("admin-" + tab + ".do", function() {
// 页面加载完后,回调初始函数
if (tab === "article" && admin.article.status.id) {
// 当文章页面编辑器未初始化时,调用更新文章需先初始化编辑器
......@@ -188,11 +191,10 @@ $.extend(Admin.prototype, {
$("#loadMsg").text("");
}
},
/*
* 初始化整个后台
*/
init: function () {
init: function() {
//window.onerror = Util.error;
Util.killIE();
......@@ -202,23 +204,22 @@ $.extend(Admin.prototype, {
$("#tabs").tabs();
// tipMsg
setInterval(function () {
if($("#tipMsg").text() !== "") {
setTimeout(function () {
setInterval(function() {
if ($("#tipMsg").text() !== "") {
setTimeout(function() {
$("#tipMsg").text("");
}, 7000);
}
}, 6000);
$("#loadMsg").text("");
},
/*
* @description tools and article collapse
* @param {bom} it 触发事件对象
*/
collapseNav: function (it) {
collapseNav: function(it) {
var subNav = $(it).next();
subNav.slideToggle("normal", function () {
subNav.slideToggle("normal", function() {
if (this.style.display !== "none") {
$(it).find(".ico-arrow-down")[0].className = "ico-arrow-up";
} else {
......@@ -226,11 +227,10 @@ $.extend(Admin.prototype, {
}
});
},
/*
* 后台及当前页面所需插件初始化完后,对权限进行控制及当前页面属于 tools 时,tools 选项需展开。
*/
inited: function () {
inited: function() {
// Removes functions with the current user role
if (Label.userRole !== "adminRole") {
for (var i = 0; i < this.adTools.length; i++) {
......
......@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.3.1, Feb 23, 2013
* @version 1.0.3.2, May 28, 2013
*/
admin.article = {
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
......@@ -42,7 +42,7 @@ admin.article = {
getAndSet: function () {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$.ajax({
url: latkeConfig.servePath + "/console/article/" + admin.article.status.id,
type: "GET",
......@@ -515,7 +515,7 @@ admin.article = {
admin.article.clear();
}
}
$("#tipMsg").text("");
$("#loadMsg").text("");
},
......@@ -547,5 +547,6 @@ admin.register.article = {
"init": admin.article.init,
"refresh": function () {
$("#loadMsg").text("");
$("#tipMsg").text("");
}
}
\ No newline at end of file
};
\ No newline at end of file
......@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.4, Feb 23, 2013
* @version 1.0.1.5, May 28, 2013
*/
/* article-list 相关操作 */
......@@ -67,7 +67,6 @@ admin.articleList = {
getList: function (pageNum) {
var that = this;
$("#loadMsg").text(Label.loadingLabel);
$.ajax({
url: latkeConfig.servePath + "/console/articles/status/published/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
type: "GET",
......
......@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.8, Feb 23, 2013
* @version 1.0.0.9, May 28, 2013
*/
admin.comment = {
......@@ -40,6 +40,7 @@ admin.comment = {
*/
getList: function (onId, fromId) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$("#" + fromId + "Comments").html("");
var from = "article";
......
......@@ -17,10 +17,9 @@
* index for admin
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.2.1, Jan 29, 2013
* @version 1.0.2.2, May 28, 2013
*/
var Admin = function () {
var Admin = function() {
this.register = {};
// 工具栏下的工具
this.tools = ['#page-list', '#file-list', '#link-list', '#preference',
......@@ -34,15 +33,21 @@ $.extend(Admin.prototype, {
/*
* 登出
*/
logout: function () {
logout: function() {
window.location.href = latkeConfig.servePath + "/logout?goto=" + latkeConfig.servePath;
},
/**
* @description 清除提示
*/
clearTip: function() {
$("#tipMsg").text("");
$("#loadMsg").text("");
},
/*
* 根据当前页数设置 hash
* @currentPage {string} 当前页
*/
setHashByPage: function (currentPage) {
setHashByPage: function(currentPage) {
var hash = window.location.hash,
hashList = hash.split("/");
if (/^\d*$/.test(hashList[hashList.length - 1])) {
......@@ -52,19 +57,17 @@ $.extend(Admin.prototype, {
}
window.location.hash = hashList.join("/");
},
/*
* 设置某个 tab 被选择
* @id tab id
*/
selectTab: function (id) {
selectTab: function(id) {
window.location.hash = "#" + id;
},
/*
* 根据当前 hash 解析出当前页数及 hash 数组。
*/
analyseHash: function () {
analyseHash: function() {
var hash = window.location.hash;
var tag = hash.substr(1, hash.length - 1);
var tagList = tag.split("/");
......@@ -80,11 +83,11 @@ $.extend(Admin.prototype, {
}
return tags;
},
/*
* 根据当前 hash 设置当前 tab
*/
setCurByHash: function () {
setCurByHash: function() {
$("#tipMsg").text("");
var tags = admin.analyseHash();
var tab = tags.hashList[1],
subTab = tags.hashList[2];
......@@ -146,7 +149,7 @@ $.extend(Admin.prototype, {
if ($("#tabsPanel_" + tab).length === 1) {
if ($("#tabsPanel_" + tab).html().replace(/\s/g, "") === "") {
// 还未加载 HTML
$("#tabsPanel_" + tab).load("admin-" + tab + ".do", function () {
$("#tabsPanel_" + tab).load("admin-" + tab + ".do", function() {
// 页面加载完后,回调初始函数
if (tab === "article" && admin.article.status.id) {
// 当文章页面编辑器未初始化时,调用更新文章需先初始化编辑器
......@@ -188,11 +191,10 @@ $.extend(Admin.prototype, {
$("#loadMsg").text("");
}
},
/*
* 初始化整个后台
*/
init: function () {
init: function() {
//window.onerror = Util.error;
Util.killIE();
......@@ -202,23 +204,22 @@ $.extend(Admin.prototype, {
$("#tabs").tabs();
// tipMsg
setInterval(function () {
if($("#tipMsg").text() !== "") {
setTimeout(function () {
setInterval(function() {
if ($("#tipMsg").text() !== "") {
setTimeout(function() {
$("#tipMsg").text("");
}, 7000);
}
}, 6000);
$("#loadMsg").text("");
},
/*
* @description tools and article collapse
* @param {bom} it 触发事件对象
*/
collapseNav: function (it) {
collapseNav: function(it) {
var subNav = $(it).next();
subNav.slideToggle("normal", function () {
subNav.slideToggle("normal", function() {
if (this.style.display !== "none") {
$(it).find(".ico-arrow-down")[0].className = "ico-arrow-up";
} else {
......@@ -226,11 +227,10 @@ $.extend(Admin.prototype, {
}
});
},
/*
* 后台及当前页面所需插件初始化完后,对权限进行控制及当前页面属于 tools 时,tools 选项需展开。
*/
inited: function () {
inited: function() {
// Removes functions with the current user role
if (Label.userRole !== "adminRole") {
for (var i = 0; i < this.adTools.length; i++) {
......@@ -867,7 +867,7 @@ $.extend(TablePaginate.prototype, {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.3.1, Feb 23, 2013
* @version 1.0.3.2, May 28, 2013
*/
admin.article = {
// 当发文章,取消发布,更新文章时设置为 false。不需在离开编辑器时进行提示。
......@@ -891,7 +891,7 @@ admin.article = {
getAndSet: function () {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$.ajax({
url: latkeConfig.servePath + "/console/article/" + admin.article.status.id,
type: "GET",
......@@ -1364,7 +1364,7 @@ admin.article = {
admin.article.clear();
}
}
$("#tipMsg").text("");
$("#loadMsg").text("");
},
......@@ -1396,8 +1396,9 @@ admin.register.article = {
"init": admin.article.init,
"refresh": function () {
$("#loadMsg").text("");
$("#tipMsg").text("");
}
}/*
};/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
......@@ -1417,7 +1418,7 @@ admin.register.article = {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.8, Feb 23, 2013
* @version 1.0.0.9, May 28, 2013
*/
admin.comment = {
......@@ -1439,6 +1440,7 @@ admin.comment = {
*/
getList: function (onId, fromId) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$("#" + fromId + "Comments").html("");
var from = "article";
......@@ -1546,7 +1548,7 @@ admin.comment = {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.4, Feb 23, 2013
* @version 1.0.1.5, May 28, 2013
*/
/* article-list 相关操作 */
......@@ -1595,7 +1597,6 @@ admin.articleList = {
getList: function (pageNum) {
var that = this;
$("#loadMsg").text(Label.loadingLabel);
$.ajax({
url: latkeConfig.servePath + "/console/articles/status/published/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
type: "GET",
......@@ -1809,7 +1810,7 @@ admin.register["draft-list"] = {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.2.3, Feb 23, 2013
* @version 1.0.2.4, May 28, 2013
*/
/* page-list 相关操作 */
......@@ -1905,6 +1906,7 @@ admin.pageList = {
*/
getList: function (pageNum) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var that = this;
$.ajax({
......@@ -2247,7 +2249,7 @@ admin.register["page-list"] = {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.7, May 3, 2012
* @version 1.0.0.8, May 28, 2013
*/
/* oterhs 相关操作 */
......@@ -2351,9 +2353,9 @@ admin.register.others = {
"obj": admin.others,
"init":admin.others.init,
"refresh": function () {
$("#loadMsg").text("");
admin.clearTip();
}
}
};
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
*
......@@ -2724,7 +2726,7 @@ admin.register["link-list"] = {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.7, Mar 5, 2013
* @version 1.0.1.8, May 28, 2013
*/
/* preference 相关操作 */
......@@ -2963,9 +2965,9 @@ admin.register["preference"] = {
"obj": admin.preference,
"init": admin.preference.init,
"refresh": function () {
$("#loadMsg").text("");
admin.clearTip();
}
}
};
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
*
......@@ -2986,7 +2988,7 @@ admin.register["preference"] = {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.3, May 3, 2012
* @version 1.0.1.4, May 28, 2013
*/
/* plugin-list 相关操作 */
......@@ -3000,7 +3002,7 @@ admin.pluginList = {
/*
* 初始化 table, pagination
*/
init: function (page) {
init: function(page) {
this.tablePagination.buildTable([{
style: "padding-left: 12px;",
text: Label.pluginNameLabel,
......@@ -3032,20 +3034,20 @@ admin.pluginList = {
});
this.getList(page);
},
/*
* 根据当前页码获取列表
* @pagNum 当前页码
*/
getList: function (pageNum) {
getList: function(pageNum) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var that = this;
$.ajax({
url: latkeConfig.servePath + "/console/plugins/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
type: "GET",
cache: false,
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
......@@ -3066,8 +3068,8 @@ admin.pluginList = {
}
datas[i].expendRow += "</a> ";
if(datas[i].setting!="{}"){
datas[i].expendRow +="<a href='javascript:void(0)' onclick=\"admin.pluginList.toSetting('"+datas[i].oId+"')\"> "+Label.settingLabel+" </a> ";
if (datas[i].setting != "{}") {
datas[i].expendRow += "<a href='javascript:void(0)' onclick=\"admin.pluginList.toSetting('" + datas[i].oId + "')\"> " + Label.settingLabel + " </a> ";
}
}
......@@ -3077,10 +3079,9 @@ admin.pluginList = {
}
});
},
toSetting:function(pluginId){
toSetting: function(pluginId) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var requestJSONObject = {
"oId": pluginId
};
......@@ -3090,7 +3091,7 @@ admin.pluginList = {
type: "POST",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
$("#pluginSetting").html(result);
......@@ -3100,9 +3101,9 @@ admin.pluginList = {
}
});
},
changeStatus: function (pluginId, status) {
changeStatus: function(pluginId, status) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
if (status === "ENABLED") {
status = "DISABLED";
} else {
......@@ -3119,7 +3120,7 @@ admin.pluginList = {
type: "PUT",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
......@@ -3134,15 +3135,15 @@ admin.pluginList = {
};
/*
* 注册到 admin 进行管理
*/
* 注册到 admin 进行管理
*/
admin.register["plugin-list"] = {
"obj": admin.pluginList,
"init": admin.pluginList.init,
"refresh": function () {
$("#loadMsg").text("");
"refresh": function() {
admin.claerTip();
}
}
};
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
*
......@@ -3163,7 +3164,7 @@ admin.register["plugin-list"] = {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.6, Apr 2, 2013
* @version 1.0.1.7, May 28, 2013
*/
/* user-list 相关操作 */
......@@ -3215,6 +3216,7 @@ admin.userList = {
*/
getList: function(pageNum) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
this.pageInfo.currentPage = pageNum;
var that = this;
......@@ -3321,6 +3323,7 @@ admin.userList = {
*/
get: function(id, userRole) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$("#userUpdate").dialog("open");
$.ajax({
......@@ -3435,6 +3438,7 @@ admin.userList = {
* @param id
*/
changeRole: function(id) {
$("#tipMsg").text("");
$.ajax({
url: latkeConfig.servePath + "/console/changeRole/" + id,
type: "GET",
......@@ -3497,7 +3501,7 @@ admin.register["user-list"] = {
"obj": admin.userList,
"init": admin.userList.init,
"refresh": function() {
$("#loadMsg").text("");
admin.clearTip();
}
}/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
......@@ -3802,7 +3806,7 @@ admin.plugin = {
* main for admin
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.2, Aug 9, 2011
* @version 1.0.0.3, May 28, 2013
*/
/* main 相关操作 */
......@@ -3815,12 +3819,12 @@ admin.main = {
admin.register.main = {
"obj": admin.main,
"init": function () {
$("#loadMsg").text("");
admin.clearTip();
},
"refresh": function () {
$("#loadMsg").text("");
admin.clearTip();
}
}
};
/*
* Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team
*
......@@ -3841,20 +3845,17 @@ admin.register.main = {
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.3, Jan 7, 2012
* @version 1.0.0.4, May 28, 2013
*/
/* about 相关操作 */
admin.about = {
init: function () {
init: function() {
$.ajax({
url: "http://rhythm.b3log.org/version/solo/latest/" + Label.version,
type: "GET",
cache: false,
dataType:"jsonp",
error: function() {
// alert("Error loading articles from Rhythm");
},
dataType: "jsonp",
success: function(data, textStatus) {
var version = data.soloVersion;
if (version === Label.version) {
......@@ -3863,7 +3864,9 @@ admin.about = {
$("#aboutLatest").html(Label.outOfDateLabel +
"<a href='" + data.soloDownload + "'>" + version + "</a>");
}
$("#loadMsg").text("");
},
complete: function(XHR, TS) {
admin.clearTip();
}
});
}
......@@ -3875,7 +3878,7 @@ admin.about = {
admin.register["about"] = {
"obj": admin.about,
"init": admin.about.init,
"refresh": function () {
$("#loadMsg").text("");
"refresh": function() {
admin.clearTip();
}
}
\ No newline at end of file
};
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -17,7 +17,7 @@
* main for admin
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.2, Aug 9, 2011
* @version 1.0.0.3, May 28, 2013
*/
/* main 相关操作 */
......@@ -30,9 +30,9 @@ admin.main = {
admin.register.main = {
"obj": admin.main,
"init": function () {
$("#loadMsg").text("");
admin.clearTip();
},
"refresh": function () {
$("#loadMsg").text("");
admin.clearTip();
}
}
};
......@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.0.7, May 3, 2012
* @version 1.0.0.8, May 28, 2013
*/
/* oterhs 相关操作 */
......@@ -122,6 +122,6 @@ admin.register.others = {
"obj": admin.others,
"init":admin.others.init,
"refresh": function () {
$("#loadMsg").text("");
admin.clearTip();
}
}
};
......@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.2.3, Feb 23, 2013
* @version 1.0.2.4, May 28, 2013
*/
/* page-list 相关操作 */
......@@ -114,6 +114,7 @@ admin.pageList = {
*/
getList: function (pageNum) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var that = this;
$.ajax({
......
......@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.3, May 3, 2012
* @version 1.0.1.4, May 28, 2013
*/
/* plugin-list 相关操作 */
......@@ -32,7 +32,7 @@ admin.pluginList = {
/*
* 初始化 table, pagination
*/
init: function (page) {
init: function(page) {
this.tablePagination.buildTable([{
style: "padding-left: 12px;",
text: Label.pluginNameLabel,
......@@ -64,20 +64,20 @@ admin.pluginList = {
});
this.getList(page);
},
/*
* 根据当前页码获取列表
* @pagNum 当前页码
*/
getList: function (pageNum) {
getList: function(pageNum) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var that = this;
$.ajax({
url: latkeConfig.servePath + "/console/plugins/" + pageNum + "/" + Label.PAGE_SIZE + "/" + Label.WINDOW_SIZE,
type: "GET",
cache: false,
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
......@@ -98,8 +98,8 @@ admin.pluginList = {
}
datas[i].expendRow += "</a> ";
if(datas[i].setting!="{}"){
datas[i].expendRow +="<a href='javascript:void(0)' onclick=\"admin.pluginList.toSetting('"+datas[i].oId+"')\"> "+Label.settingLabel+" </a> ";
if (datas[i].setting != "{}") {
datas[i].expendRow += "<a href='javascript:void(0)' onclick=\"admin.pluginList.toSetting('" + datas[i].oId + "')\"> " + Label.settingLabel + " </a> ";
}
}
......@@ -109,10 +109,9 @@ admin.pluginList = {
}
});
},
toSetting:function(pluginId){
toSetting: function(pluginId) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
var requestJSONObject = {
"oId": pluginId
};
......@@ -122,7 +121,7 @@ admin.pluginList = {
type: "POST",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
$("#pluginSetting").html(result);
......@@ -132,9 +131,9 @@ admin.pluginList = {
}
});
},
changeStatus: function (pluginId, status) {
changeStatus: function(pluginId, status) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
if (status === "ENABLED") {
status = "DISABLED";
} else {
......@@ -151,7 +150,7 @@ admin.pluginList = {
type: "PUT",
cache: false,
data: JSON.stringify(requestJSONObject),
success: function(result, textStatus){
success: function(result, textStatus) {
$("#tipMsg").text(result.msg);
if (!result.sc) {
$("#loadMsg").text("");
......@@ -166,12 +165,12 @@ admin.pluginList = {
};
/*
* 注册到 admin 进行管理
*/
* 注册到 admin 进行管理
*/
admin.register["plugin-list"] = {
"obj": admin.pluginList,
"init": admin.pluginList.init,
"refresh": function () {
$("#loadMsg").text("");
"refresh": function() {
admin.claerTip();
}
}
};
......@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.7, Mar 5, 2013
* @version 1.0.1.8, May 28, 2013
*/
/* preference 相关操作 */
......@@ -257,6 +257,6 @@ admin.register["preference"] = {
"obj": admin.preference,
"init": admin.preference.init,
"refresh": function () {
$("#loadMsg").text("");
admin.clearTip();
}
}
};
......@@ -18,7 +18,7 @@
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
* @version 1.0.1.6, Apr 2, 2013
* @version 1.0.1.7, May 28, 2013
*/
/* user-list 相关操作 */
......@@ -70,6 +70,7 @@ admin.userList = {
*/
getList: function(pageNum) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
this.pageInfo.currentPage = pageNum;
var that = this;
......@@ -176,6 +177,7 @@ admin.userList = {
*/
get: function(id, userRole) {
$("#loadMsg").text(Label.loadingLabel);
$("#tipMsg").text("");
$("#userUpdate").dialog("open");
$.ajax({
......@@ -290,6 +292,7 @@ admin.userList = {
* @param id
*/
changeRole: function(id) {
$("#tipMsg").text("");
$.ajax({
url: latkeConfig.servePath + "/console/changeRole/" + id,
type: "GET",
......@@ -352,6 +355,6 @@ admin.register["user-list"] = {
"obj": admin.userList,
"init": admin.userList.init,
"refresh": function() {
$("#loadMsg").text("");
admin.clearTip();
}
}
\ No newline at end of file
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