var __ajaxHelperService = null; $(function(A) { bindMenuButtonEvents(); __ajaxHelperService = EnjooSite.Web.Admin.Services.Ajax.AjaxHelper }); function bindMenuButtonEvents(A) { $("ul.menuButtons>li>a.checkAll").bind("click", toggleCheckedBox); $("ul.menuButtons>li>a.checkAll>span>:checkbox").bind("click", toggleSelf); $("ul.menuButtons>li>a.delete").bind("click", deleteEntriesConfirm) } function toggleCheckedBox(B) { var A = $("span>:checkbox", $(this)).attr("checked"); $("span>:checkbox", $(this)).attr("checked", !A); toggleAllCheckbox(!A); return false } function toggleSelf(A) { toggleAllCheckbox($(this).attr("checked")); A.stopPropagation() } function toggleAllCheckbox(A) { $("#Listing>tbody>tr>td>:checkbox").attr("checked", A) } function deleteEntriesConfirm(B) { var A = $(this); var C = []; $("#Listing>tbody>tr>td>input:checked").each(function(D) { C.push($(this).attr("commandArgument")) }); if (C.length <= 0) { new popupAlert(Strings.Dialog_Alert, Strings.Message_EmptyChecked, PopupMessageType.Alert, true, null, null).show() } else { new popupAlert(Strings.Dialog_Alert, Strings.Message_DeleteConfirm, PopupMessageType.Alert, true, deleteEntries, { sender: A, entryIds: C }).show() } return false } function deleteEntries(B, A) { B.close(B); var C = A.entryIds; var B = A.sender; $(B).hide(); toggleAjaxLoading(true); __ajaxHelperService.DeletePosts(C, deleteEntries_success, callback_error, { sender: B, commandArgument: C }) } function deleteEntries_success(result, userContext, methodName) { result = eval("(" + result + ")"); $(userContext.sender).show(); toggleAjaxLoading(false); if (result.type == PopupMessageType.Success) { var redirectUrl = String.format(Strings.Formats_RedirectUrl, window.location); var popupMessage = String.format("{0}<br />{1}", result.message, redirectUrl); new popupAlert(Strings.Dialog_Alert, popupMessage, PopupMessageType.Success, true, null, null).show(); window.setTimeout(function(e) { window.location = window.location }, 3000) } } function callback_error(B, C, A) { $("").trigger("click") } function toggleAjaxLoading(A) { if (A == true) { $("#content_actions .actionLoading").show().animate({ right: "2%" }, { queue: false, duration: 5000 }) } else { $("#content_actions .actionLoading").hide().css("right", "80%") } } if (typeof (Sys) !== "undefined") { Sys.Application.notifyScriptLoaded() };