2012-03-17 21:13:10 +00:00
|
|
|
var ajaxpollTmp;
|
2012-03-13 22:31:46 +00:00
|
|
|
|
|
|
|
$(".ajaxpoll-answer-vote").live("mouseover",
|
|
|
|
function(){
|
2012-03-17 21:13:10 +00:00
|
|
|
var sp=$(this).find("span");
|
|
|
|
ajaxpollTmp=sp.html();
|
|
|
|
sp.text(sp.attr("title"));
|
|
|
|
sp.attr("title","");
|
2012-03-13 22:31:46 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
$(".ajaxpoll-answer-vote").live("mouseout",
|
|
|
|
function(){
|
2012-03-17 21:13:10 +00:00
|
|
|
var sp=$(this).find("span");
|
|
|
|
sp.attr("title",sp.text());
|
|
|
|
sp.text(ajaxpollTmp);
|
2012-03-13 22:31:46 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2012-03-17 21:13:10 +00:00
|
|
|
/* attach click handler */
|
2012-03-18 08:08:35 +00:00
|
|
|
$(".ajaxpoll-answer-name label")
|
2012-03-17 21:13:10 +00:00
|
|
|
.live("click",
|
|
|
|
function(event){
|
|
|
|
event.preventDefault();
|
|
|
|
event.stopPropagation();
|
2012-03-18 08:08:35 +00:00
|
|
|
$this = $(this).parent().parent();
|
2012-03-17 21:13:10 +00:00
|
|
|
var poll = $this.attr( "poll" );
|
2013-05-19 09:54:00 +00:00
|
|
|
var answer = $this.attr( "answer" );
|
|
|
|
var token = $this.parent().find("input[name='ajaxPollToken']").val();
|
2012-03-18 07:15:30 +00:00
|
|
|
$this.find(".ajaxpoll-hover-vote").addClass("ajaxpoll-checkevent");
|
2012-03-18 08:08:35 +00:00
|
|
|
$this.find("input").prop("checked","checked");
|
2012-03-17 21:13:10 +00:00
|
|
|
$( "#ajaxpoll-ajax-"+poll )
|
2013-06-05 00:37:12 +00:00
|
|
|
.text( mw.message( 'ajaxpoll-submitting' ).text() )
|
2013-05-19 09:54:00 +00:00
|
|
|
.css("display","inline-block");
|
2012-03-17 21:13:10 +00:00
|
|
|
if (useAjax){
|
|
|
|
sajax_do_call(
|
|
|
|
"AJAXPoll::submitVote",
|
2013-05-19 09:54:00 +00:00
|
|
|
[poll,answer,token],
|
2012-03-17 21:13:10 +00:00
|
|
|
$("#ajaxpoll-container-"+poll)[0]
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
$("#ajaxpoll-answer-id-"+poll).submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2012-03-13 22:31:46 +00:00
|
|
|
|
2012-03-13 22:48:18 +00:00
|
|
|
$(".ajaxpoll-answer-name:not(.ajaxpoll-answer-name-revoke) label").live("mouseover",
|
2012-03-13 22:31:46 +00:00
|
|
|
function(){
|
|
|
|
$(this).addClass("ajaxpoll-hover-vote");
|
|
|
|
}
|
|
|
|
);
|
2012-03-13 22:48:18 +00:00
|
|
|
$(".ajaxpoll-answer-name:not(.ajaxpoll-answer-name-revoke) label").live("mouseout",
|
2012-03-13 22:31:46 +00:00
|
|
|
function(){
|
|
|
|
$(this).removeClass("ajaxpoll-hover-vote");
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2012-03-13 22:48:18 +00:00
|
|
|
$(".ajaxpoll-answer-name-revoke label").live("mouseover",
|
2012-03-13 22:31:46 +00:00
|
|
|
function(){
|
|
|
|
$(this).addClass("ajaxpoll-hover-revoke");
|
|
|
|
}
|
|
|
|
);
|
2012-03-13 22:48:18 +00:00
|
|
|
$(".ajaxpoll-answer-name-revoke label").live("mouseout",
|
2012-03-13 22:31:46 +00:00
|
|
|
function(){
|
|
|
|
$(this).removeClass("ajaxpoll-hover-revoke");
|
|
|
|
}
|
|
|
|
);
|