diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2009-11-28 00:10:01 -0500 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2009-11-28 00:10:01 -0500 |
commit | 30afd77f73b54346ae2b34487513773c3a86b935 (patch) | |
tree | 81a65675c257e8c97cf705491519a7320899c838 /templates | |
parent | d95cfd82d608dd33b7357803ee6b2c7b8ce118cb (diff) | |
download | askbot-30afd77f73b54346ae2b34487513773c3a86b935.tar.gz askbot-30afd77f73b54346ae2b34487513773c3a86b935.tar.bz2 askbot-30afd77f73b54346ae2b34487513773c3a86b935.zip |
configuration of javascript base url is no longer needed
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base.html | 3 | ||||
-rw-r--r-- | templates/base_content.html | 5 | ||||
-rw-r--r-- | templates/content/js/com.cnprog.post.js | 42 | ||||
-rw-r--r-- | templates/content/js/com.cnprog.utils.js | 2 | ||||
-rw-r--r-- | templates/content/js/wmd/wmd.js | 2 | ||||
-rw-r--r-- | templates/content/style/style.css | 2 |
6 files changed, 34 insertions, 22 deletions
diff --git a/templates/base.html b/templates/base.html index 2b933c4a..ec0a53d7 100644 --- a/templates/base.html +++ b/templates/base.html @@ -18,7 +18,8 @@ <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript">google.load("jquery", "1.2.6");</script> <script type="text/javascript"> - var i18nLang = '{{settings.LANGUAGE_CODE}}'; + var i18nLang = '{{settings.LANGUAGE_CODE}}'; + var scriptUrl = '/{{settings.FORUM_SCRIPT_ALIAS}}' </script> <script type='text/javascript' src='{% href "/content/js/com.cnprog.i18n.js" %}'></script> <script type='text/javascript' src='{% href "/content/js/jquery.i18n.js" %}'></script> diff --git a/templates/base_content.html b/templates/base_content.html index 52cc6134..78e5fe38 100644 --- a/templates/base_content.html +++ b/templates/base_content.html @@ -6,7 +6,9 @@ <head> <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE }}</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + {% if settings.GOOGLE_SITEMAP_CODE %} <meta name="verify-v1" content="{{ settings.GOOGLE_SITEMAP_CODE }}" /> + {% endif %} <link rel="shortcut icon" href="{% href "/content/images/favicon.ico" %}" /> <link href="{% href "/content/style/style.css" %}" rel="stylesheet" type="text/css" /> {% spaceless %} @@ -15,7 +17,8 @@ <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript">google.load("jquery", "1.2.6");</script> <script type="text/javascript"> - var i18nLang = '{{ settings.LANGUAGE_CODE }}'; + var i18nLang = '{{ settings.LANGUAGE_CODE }}'; + var scriptUrl = '/{{settings.FORUM_SCRIPT_ALIAS}}' </script> <script type='text/javascript' src='{% href "/content/js/com.cnprog.i18n.js" %}'></script> <script type='text/javascript' src='{% href "/content/js/jquery.i18n.js" %}'></script> diff --git a/templates/content/js/com.cnprog.post.js b/templates/content/js/com.cnprog.post.js index 0e604b8f..0ddc8f74 100644 --- a/templates/content/js/com.cnprog.post.js +++ b/templates/content/js/com.cnprog.post.js @@ -53,11 +53,11 @@ var Vote = function(){ var acceptAnonymousMessage = $.i18n._('insufficient privilege'); var acceptOwnAnswerMessage = $.i18n._('cannot pick own answer as best'); - var pleaseLogin = "<a href='" + $.i18n._("/") + $.i18n._("account/") + $.i18n._("signin/") - + "?next=" + $.i18n._("/") + $.i18n._("questions/") + "{{QuestionID}}'>" + var pleaseLogin = "<a href='" + scriptUrl + $.i18n._("account/") + $.i18n._("signin/") + + "?next=" + scriptUrl + $.i18n._("questions/") + "{{QuestionID}}'>" + $.i18n._('please login') + "</a>"; - var pleaseSeeFAQ = $.i18n._('please see') + "<a href='" + $.i18n._("/") + $.i18n._("faq/") + "'>faq</a>"; + var pleaseSeeFAQ = $.i18n._('please see') + "<a href='" + scriptUrl + $.i18n._("faq/") + "'>faq</a>"; var favoriteAnonymousMessage = $.i18n._('anonymous users cannot select favorite questions') var voteAnonymousMessage = $.i18n._('anonymous users cannot vote') + pleaseLogin; @@ -151,17 +151,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", $.i18n._("/") + "content/images/vote-arrow-"+ arrow + flag +".png"); + object.attr("src", scriptUrl + "content/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", $.i18n._("/") + "content/images/vote-arrow-up.png"); - $(getQuestionVoteDownButton()).attr("src", $.i18n._("/") + "content/images/vote-arrow-down.png"); + $(getQuestionVoteUpButton()).attr("src", scriptUrl + "content/images/vote-arrow-up.png"); + $(getQuestionVoteDownButton()).attr("src", scriptUrl + "content/images/vote-arrow-down.png"); } else{ - $(getAnswerVoteUpButton(postId)).attr("src", $.i18n._("/") + "content/images/vote-arrow-up.png"); - $(getAnswerVoteDownButton(postId)).attr("src", $.i18n._("/") + "content/images/vote-arrow-down.png"); + $(getAnswerVoteUpButton(postId)).attr("src", scriptUrl + "content/images/vote-arrow-up.png"); + $(getAnswerVoteDownButton(postId)).attr("src", scriptUrl + "content/images/vote-arrow-down.png"); } } }; @@ -237,7 +237,7 @@ var Vote = function(){ type: "POST", cache: false, dataType: "json", - url: $.i18n._("/") + $.i18n._("questions/") + questionId + "/" + $.i18n._("vote/"), + url: scriptUrl + $.i18n._("questions/") + questionId + "/" + $.i18n._("vote/"), data: { "type": voteType, "postId": postId }, error: handleFail, success: function(data){callback(object, voteType, data)}}); @@ -256,19 +256,23 @@ var Vote = function(){ showMessage(object, acceptOwnAnswerMessage); } else if(data.status == "1"){ +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js object.attr("src", $.i18n._("/") + "content/images/vote-accepted.png"); +======= + object.attr("src", scriptUrl + "content/images/vote-accepted.png"); +>>>>>>> private:templates/content/js/com.cnprog.post.js $("#"+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", $.i18n._("/") + "content/images/vote-accepted.png"); + $(acceptedButtons).attr("src", scriptUrl + "content/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", $.i18n._("/") + "content/images/vote-accepted-on.png"); + object.attr("src", scriptUrl + "content/images/vote-accepted-on.png"); $("#"+answerContainerIdPrefix+postId).addClass("accepted-answer"); $("#"+commentLinkIdPrefix+postId).addClass("comment-link-accepted"); } @@ -282,7 +286,7 @@ var Vote = function(){ showMessage(object, favoriteAnonymousMessage.replace("{{QuestionID}}", questionId)); } else if(data.status == "1"){ - object.attr("src", $.i18n._("/") + "content/images/vote-favorite-off.png"); + object.attr("src", scriptUrl + "content/images/vote-favorite-off.png"); var fav = getFavoriteNumber(); fav.removeClass("my-favorite-number"); if(data.count == 0) @@ -290,7 +294,7 @@ var Vote = function(){ fav.text(data.count); } else if(data.success == "1"){ - object.attr("src", $.i18n._("/") + "content/images/vote-favorite-on.png"); + object.attr("src", scriptUrl + "content/images/vote-favorite-on.png"); var fav = getFavoriteNumber(); fav.text(data.count); fav.addClass("my-favorite-number"); @@ -359,7 +363,7 @@ var Vote = function(){ } else if (data.success == "1"){ if (voteType == VoteType.removeQuestion){ - window.location.href = $.i18n._("/") + $.i18n._("questions/"); + window.location.href = scriptUrl + $.i18n._("questions/"); } else { if (removeActionType == 'delete'){ @@ -508,7 +512,7 @@ function createComments(type) { var getComments = function(id, jDiv) { //appendLoaderImg(id); - $.getJSON($.i18n._("/") + objectType + "s/" + id + "/" + $.i18n._("comments/") + $.getJSON(scriptUrl + objectType + "s/" + id + "/" + $.i18n._("comments/") , function(json) { showComments(id, json); }); }; @@ -529,8 +533,8 @@ function createComments(type) { var renderDeleteCommentIcon = function(post_id, delete_url){ if (canPostComments(post_id)){ var html = ''; - var img = $.i18n._("/") + "content/images/close-small.png"; - var imgHover = $.i18n._("/") + "content/images/close-small-hover.png"; + var img = scriptUrl + "content/images/close-small.png"; + var imgHover = scriptUrl + "content/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') + '" />'; @@ -569,7 +573,11 @@ function createComments(type) { //todo fix url translations!!! $.ajax({ type: "POST", +<<<<<<< HEAD:templates/content/js/com.cnprog.post.js url: $.i18n._("/") + objectType + "s/" + id + "/" + $.i18n._("comments/"), +======= + url: scriptUrl + objectType + "s/" + id + "/" + $.i18n._("comments/"), +>>>>>>> private:templates/content/js/com.cnprog.post.js dataType: "json", data: { comment: textarea.val() }, success: function(json) { diff --git a/templates/content/js/com.cnprog.utils.js b/templates/content/js/com.cnprog.utils.js index fff61759..cf27c8a1 100644 --- a/templates/content/js/com.cnprog.utils.js +++ b/templates/content/js/com.cnprog.utils.js @@ -23,7 +23,7 @@ var notify = function() { }, close: function(doPostback) { if (doPostback) { - $.post($.i18n._("/") + $.i18n._("messages/") + + $.post(scriptUrl + $.i18n._("messages/") + $.i18n._("markread/"), { formdata: "required" }); } $(".notify").fadeOut("fast"); diff --git a/templates/content/js/wmd/wmd.js b/templates/content/js/wmd/wmd.js index 0bdc55b6..e396d3cb 100644 --- a/templates/content/js/wmd/wmd.js +++ b/templates/content/js/wmd/wmd.js @@ -54,7 +54,7 @@ Attacklab.wmdBase = function(){ var uploadImageHTML ="<div>" + $.i18n._('upload image') + "</div>" + "<input type=\"file\" name=\"file-upload\" id=\"file-upload\" size=\"26\" "+ "onchange=\"return ajaxFileUpload($('#image-url'));\"/><br>" + - "<img id=\"loading\" src=\"" + $.i18n._("/") + "content/images/indicator.gif\" style=\"display:none;\"/>"; + "<img id=\"loading\" src=\"" + scriptUrl + "content/images/indicator.gif\" style=\"display:none;\"/>"; // The default text that appears in the dialog input box when entering // links. diff --git a/templates/content/style/style.css b/templates/content/style/style.css index 13494721..ffa72676 100644 --- a/templates/content/style/style.css +++ b/templates/content/style/style.css @@ -258,7 +258,7 @@ blockquote border:1px solid #fff; background-color:#fff; color:#777; - padding:.3em; + padding:2px 4px 3px 4px; font:bold 100% sans-serif; } |