$(function() { $("#VoteForm #postVoteButton").bind("click", { sender: $("#VoteForm #postVoteButton") }, postVote); $("#VoteForm div.actionBox a").click(function() { return getVoterList(); }); }); function postVote(E) { var B = E.data.sender; if (_authBlogInfo == null) { new popupAlert(Strings.Dialog_Alert, Strings.Dialog_NotLogin, PopupMessageType.Alert, true, null, null).show(); return false; } var C = $("#VoteForm input[name='voteItem']:checked"); if (C.size() > _maxChoose) { new popupAlert(Strings.Dialog_Alert, String.format(Strings.Dialog_BadChooseNum, _maxChoose), PopupMessageType.Alert, true, null, null).show(); return false; } if (C.size() <= 0) { new popupAlert(Strings.Dialog_Alert, Strings.Dialog_BadChooseNum_Min, PopupMessageType.Alert, true, null, null).show(); return false; } var A = new Array(); C.each(function(F) { A.push($(this).attr("commentArgument")); }); displayLoading(B.parent().parent(), false); var D = EnjooSite.Web.WebServices.VoteService.PostVote; D(A.join(","), _authBlogInfo.ID, _authBlogInfo.ClientIP, postVote_Success, postVote_Error, B); return false; } function postVote_Success(result, userContext, methodName) { result = eval("(" + result + ")"); new popupAlert(result.title, result.message, result.type, true, null, null).show(); displayLoading(userContext.parent().parent(), true); } function postVote_Error(B, C, A) { new popupAlert(Strings.Dialog_Error, B.get_message(), PopupMessageType.Error, true, null, null).show(); displayLoading(C.parent().parent(), true); } if (typeof (Sys) !== "undefined") { Sys.Application.notifyScriptLoaded(); }