var __spaceThemeManagerHelper = null; var __currentBlogId = enjooSiteBlogInfo.getCurrentBlogId(); var __currentBlogRootUrl = enjooSiteBlogInfo.getVirtualBlogRoot(); var __authBlogId = _authBlogInfo.ID; var __authBlogName = _authBlogInfo.Name; $(function(A) { __spaceThemeManagerHelper = EnjooSite.Web.WebServices.SpaceThemeManagerHelper; $("#themeCategoriesContainer a[commandName=updateTheme]").bind("click", initThemeThumbLinkEvent); $("#saveSpaceThemeButton").bind("click", saveSpaceThemeConfig); $("#canelButton").bind("click", redirectHome) }); function initThemeThumbLinkEvent(D) { var C = $(this); if (!C.hasClass("current")) { $("#themeCategoriesContainer ul.themes_container>li").removeClass("current"); C.parent().addClass("current"); var A = C.attr("commandArgument"); var B = String.format(__themeCssPathFormatString, A); $("#themeStyle").attr("href", B + String.format("?tid={0}", Math.random(10))); $("#saveSpaceThemeButton").removeAttr("disabled"); $("#saveSpaceThemeButton").data("themeName", A); if (A == $("#saveSpaceThemeButton").attr("commandArgument")) { $("#saveSpaceThemeButton").attr("disabled", true) } } return false } function saveSpaceThemeConfig(B) { var A = $(this).data("themeName"); displayLoading($(this), false); __spaceThemeManagerHelper.SaveSpaceTheme(__currentBlogId, A, saveSpaceThemeConfig_success, callback_error, { sender: $(this) }) } function saveSpaceThemeConfig_success(result, userContext, methodName) { result = eval("(" + result + ")"); var resultMessage = result.message; if (result.type == PopupMessageType.Success) { var redirectUrl = String.format("{0}", __currentBlogRootUrl); resultMessage += "<br /><a href='" + redirectUrl + "'>3秒后自动返回编辑页面|返回</a>" } new popupAlert(result.title, resultMessage, result.type, true, null, null).show(); window.setTimeout(function(e) { window.location = redirectUrl }, 3000); displayLoading(userContext.sender, true) } function callback_error(B, C, A) { new popupAlert(Strings.Dialog_Alert, B.get_message(), PopupMessageType.Error, true, null, null).show() } function redirectHome(B) { var A = String.format("{0}", __currentBlogRootUrl); window.location = A } if (typeof (Sys) !== "undefined") { Sys.Application.notifyScriptLoaded() };