var __silverAlbumViewServices = null; $(function(A) { page_init(); buildSilverAlbum("silverAlbumContainer", __currentSilverAlbumId); $("#commentsContainer a[commandName=deleteComment]").bind("click", deleteSilverAlbumComments) }); function page_init(A) { __silverAlbumViewServices = new SilverAlbumViewServices(); $.Lightbox.construct({ show_linkback: false, opacity: 0.6, text: { image: "Photo", close: "关闭", closeInfo: "点击任意区域关闭图像浏览", download: "在新页面中浏览当前图像", help: { close: "点击任意区域关闭图像浏览", interact: ""}} }) } function buildSilverAlbum(C, B) { if (__silverAlbumViewServices == null) { __silverAlbumViewServices = new SilverAlbumViewServices() } var D = 580; var A = 435; var E = $(String.format("#{0}", C)); __silverAlbumViewServices.getSilverAlbum(B, D, A, getSilverAlbum_success, callback_error, { swfContainerId: C, swfWidth: D, swfHeight: A }) } function getSilverAlbum_success(result, userContext) { result = eval("(" + result + ")"); var swfContainer = $(String.format("#{0}", userContext.swfContainerId)); displayLoading(swfContainer, true); if (result.type == PopupMessageType.Success) { var silverAlbum = result.customData; var flashvars = { musicUrl: silverAlbum.musicUrl, frameId: silverAlbum.frameId, effectsId: silverAlbum.effectsId, images: silverAlbum.images, titles: silverAlbum.titles }; var params = { menu: "false", wmode: "transparent" }; var attributes = { id: userContext.swfContainerId, name: userContext.swfContainerId }; swfobject.embedSWF(String.format("{0}?randId={1}", "/Common/Flash/enjooSiteSilverAlbum_view.swf", Math.random()), userContext.swfContainerId, userContext.swfWidth, userContext.swfHeight, "9.0.0", "expressInstall.swf", flashvars, params, attributes) } else { swfContainer.html("当前相册已关闭或删除.") } } function callback_error(A, B) { alert(A.message) } function saveSilverAlbumComments(D) { var C = D.data.sender; var B = D.data.fckeditorID; var A = D.data.titleTextBox.val().trim(); var E = FCKeditorAPI.GetInstance(B).GetHTML(); if (A == "") { new popupAlert("注意", "评论标题不能为空！", "alert", true, null, null).show(); return false } if (E == "" || E == "<br />") { new popupAlert("注意", "评论内容不能为空！", "alert", true, null, null).show(); FCKeditorAPI.GetInstance(B).SetHTML(""); return false } displayLoading(C.parent(), false); __silverAlbumViewServices.saveSilverAlbumComments(__currentSilverAlbumId, A, E, saveSilverAlbumComments_success, callback_error, { sender: C, title: A, body: E, fckeditorId: B }) } var commentsTemplate = '<li class="author" commandArgument="{2}"><table class="comment_item simply_table "><tr><td class="enjooTd01" valign="top"><img class="small_logo" src="{0}" alt="{1}" /></td><td class="enjooTd02" valign="top"><ul class="commentHead h_list clearfix"><li><a name="SilverAlbumComments_{2}">#第{3}楼</a></li><li class="separator">|</li><li>刚才</li><li  class="separator">|</li><li>我</li><li class="action"><a href="#" commandName="deleteComment" commandArgument="{2}">删除</a></li></ul><div class="comment_content">{4}</div></td></tr></table></li>'; function saveSilverAlbumComments_success(result, userContext) { result = eval("(" + result + ")"); if (result.type == PopupMessageType.Success) { var resultComments = result.customData; $(String.format(commentsTemplate, resultComments.LogoUrl, resultComments.Author, resultComments.Id, $("#commentsContainer>li").size() + 1, userContext.body)).appendTo($("#commentsContainer")); $("#commentsContainer a[commandName=deleteComment]").unbind("click"); $("#commentsContainer a[commandName=deleteComment]").bind("click", deleteSilverAlbumComments); FCKeditorAPI.GetInstance(userContext.fckeditorId).SetHTML("") } new popupAlert(result.title, result.message, result.type, true, null, null).show(); displayLoading(userContext.sender.parent(), true) } function deleteSilverAlbumComments(C) { var B = $(this); var A = B.attr("commandArgument"); __silverAlbumViewServices.deleteSilverAlbumComments(A, deleteSilverAlbumComments_success, callback_error, { commentsId: A }); return false } function deleteSilverAlbumComments_success(result, userContext) { result = eval("(" + result + ")"); if (result.type == PopupMessageType.Success) { $(String.format("#commentsContainer>li[commandArgument={0}]", userContext.commentsId)).remove() } new popupAlert(result.title, result.message, result.type, true, null, null).show() } if (typeof (Sys) !== "undefined") { Sys.Application.notifyScriptLoaded() };