summaryrefslogtreecommitdiffstats
path: root/forum/skins/default/media/js/com.cnprog.post.js
diff options
context:
space:
mode:
Diffstat (limited to 'forum/skins/default/media/js/com.cnprog.post.js')
-rw-r--r--forum/skins/default/media/js/com.cnprog.post.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/forum/skins/default/media/js/com.cnprog.post.js b/forum/skins/default/media/js/com.cnprog.post.js
index 5469a374..4325e665 100644
--- a/forum/skins/default/media/js/com.cnprog.post.js
+++ b/forum/skins/default/media/js/com.cnprog.post.js
@@ -153,17 +153,17 @@ var Vote = function(){
var setVoteImage = function(voteType, undo, object){
var flag = undo ? "" : "-on";
var arrow = (voteType == VoteType.questionUpVote || voteType == VoteType.answerUpVote) ? "up" : "down";
- object.attr("src", scriptUrl + "media/images/vote-arrow-"+ arrow + flag +".png");
+ object.attr("src", mediaUrl("media/images/vote-arrow-"+ arrow + flag +".png"));
// if undo voting, then undo the pair of arrows.
if(undo){
if(voteType == VoteType.questionUpVote || voteType == VoteType.questionDownVote){
- $(getQuestionVoteUpButton()).attr("src", scriptUrl + "media/images/vote-arrow-up.png");
- $(getQuestionVoteDownButton()).attr("src", scriptUrl + "media/images/vote-arrow-down.png");
+ $(getQuestionVoteUpButton()).attr("src", mediaUrl("media/images/vote-arrow-up.png"));
+ $(getQuestionVoteDownButton()).attr("src", mediaUrl("media/images/vote-arrow-down.png"));
}
else{
- $(getAnswerVoteUpButton(postId)).attr("src", scriptUrl + "media/images/vote-arrow-up.png");
- $(getAnswerVoteDownButton(postId)).attr("src", scriptUrl + "media/images/vote-arrow-down.png");
+ $(getAnswerVoteUpButton(postId)).attr("src", mediaUrl("media/images/vote-arrow-up.png"));
+ $(getAnswerVoteDownButton(postId)).attr("src", mediaUrl("media/images/vote-arrow-down.png"));
}
}
};
@@ -259,19 +259,19 @@ var Vote = function(){
showMessage(object, acceptOwnAnswerMessage);
}
else if(data.status == "1"){
- object.attr("src", scriptUrl + "media/images/vote-accepted.png");
+ object.attr("src", mediaUrl("media/images/vote-accepted.png"));
$("#"+answerContainerIdPrefix+postId).removeClass("accepted-answer");
$("#"+commentLinkIdPrefix+postId).removeClass("comment-link-accepted");
}
else if(data.success == "1"){
var acceptedButtons = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAccept +']';
- $(acceptedButtons).attr("src", scriptUrl + "media/images/vote-accepted.png");
+ $(acceptedButtons).attr("src", mediaUrl("media/images/vote-accepted.png"));
var answers = ("div[id^="+answerContainerIdPrefix +"]");
$(answers).removeClass("accepted-answer");
var commentLinks = ("div[id^="+answerContainerIdPrefix +"] div[id^="+ commentLinkIdPrefix +"]");
$(commentLinks).removeClass("comment-link-accepted");
- object.attr("src", scriptUrl + "media/images/vote-accepted-on.png");
+ object.attr("src", mediaUrl("media/images/vote-accepted-on.png"));
$("#"+answerContainerIdPrefix+postId).addClass("accepted-answer");
$("#"+commentLinkIdPrefix+postId).addClass("comment-link-accepted");
}
@@ -285,7 +285,7 @@ var Vote = function(){
showMessage(object, favoriteAnonymousMessage.replace("{{QuestionID}}", questionId));
}
else if(data.status == "1"){
- object.attr("src", scriptUrl + "media/images/vote-favorite-off.png");
+ object.attr("src", mediaUrl("media/images/vote-favorite-off.png"));
var fav = getFavoriteNumber();
fav.removeClass("my-favorite-number");
if(data.count === 0){
@@ -294,7 +294,7 @@ var Vote = function(){
fav.text(data.count);
}
else if(data.success == "1"){
- object.attr("src", scriptUrl + "media/images/vote-favorite-on.png");
+ object.attr("src", mediaUrl("media/images/vote-favorite-on.png"));
var fav = getFavoriteNumber();
fav.text(data.count);
fav.addClass("my-favorite-number");
@@ -538,8 +538,8 @@ function createComments(type) {
var renderDeleteCommentIcon = function(post_id, delete_url){
if (canPostComments(post_id)){
var html = '';
- var img = scriptUrl + "media/images/close-small.png";
- var imgHover = scriptUrl + "media/images/close-small-hover.png";
+ var img = mediaUrl("media/images/close-small.png");
+ var imgHover = mediaUrl("media/images/close-small-hover.png");
html += '<img class="delete-icon" onclick="' + objectType + 'Comments.deleteComment($(this), ' + post_id + ', \'' + delete_url + '\')" src="' + img;
html += '" onmouseover="$(this).attr(\'src\', \'' + imgHover + '\')" onmouseout="$(this).attr(\'src\', \'' + img;
html += '\')" title="' + $.i18n._('delete this comment') + '" />';
@@ -624,12 +624,12 @@ function createComments(type) {
delete_icon.click(function(){CommentsClass.deleteComment($(this),comment_id,delete_url);});
delete_icon.unbind('mouseover').bind('mouseover',
function(){
- $(this).attr('src',scriptUrl + 'media/images/close-small-hover.png');
+ $(this).attr('src',mediaUrl('media/images/close-small-hover.png'));
}
);
delete_icon.unbind('mouseout').bind('mouseout',
function(){
- $(this).attr('src',scriptUrl + 'media/images/close-small.png');
+ $(this).attr('src',mediaUrl('media/images/close-small.png'));
}
);
}