From 026541b6a70cd183d49ffec205232cfb0b205b25 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 5 Aug 2009 22:49:44 -0400 Subject: added anonymous posting, per-question subscription and fixes by Pothers and some more, see development.log --- templates/404.html | 2 +- templates/500.html | 4 +- templates/answer_edit.html | 2 +- templates/answer_edit_tips.html | 2 +- templates/ask.html | 52 +++---- templates/authopenid/changeemail.html | 100 ++++++++++---- templates/authopenid/changeopenid.html | 2 + templates/authopenid/changepw.html | 2 + templates/authopenid/complete.html | 17 +-- templates/authopenid/confirm_email.txt | 17 +-- templates/authopenid/delete.html | 2 + templates/authopenid/failure.html | 3 +- templates/authopenid/sendpw.html | 2 + templates/authopenid/sendpw_email.txt | 18 +-- templates/authopenid/settings.html | 2 + templates/authopenid/signin.html | 124 ++++++++++++++--- templates/authopenid/signup.html | 2 + templates/badge.html | 2 +- templates/badges.html | 15 ++- templates/base.html | 29 ++-- templates/base_content.html | 27 ++-- templates/book.html | 2 +- templates/close.html | 2 +- templates/content/js/com.cnprog.i18n.js | 8 +- templates/content/js/com.cnprog.post.js | 23 +++- templates/content/js/com.cnprog.utils.js | 2 +- templates/content/style/openid.css | 2 +- templates/content/style/style.css | 212 +++++++++++++++++++---------- templates/faq.html | 223 ++++++++++++++++++------------- templates/footer.html | 2 +- templates/header.html | 37 +++-- templates/index.html | 10 +- templates/logout.html | 4 +- templates/pagesize.html | 2 + templates/question.html | 21 ++- templates/question_edit.html | 2 +- templates/question_retag.html | 25 ++-- templates/questions.html | 28 ++-- templates/revisions_answer.html | 2 +- templates/revisions_question.html | 3 +- templates/unanswered.html | 2 +- templates/user.html | 6 +- templates/user_edit.html | 2 +- templates/user_favorites.html | 2 +- templates/user_info.html | 2 + templates/user_preferences.html | 15 ++- templates/user_recent.html | 2 +- templates/user_reputation.html | 2 +- templates/user_responses.html | 2 +- templates/user_stats.html | 2 +- templates/user_tabs.html | 2 - templates/user_votes.html | 2 +- 52 files changed, 678 insertions(+), 399 deletions(-) (limited to 'templates') diff --git a/templates/404.html b/templates/404.html index d24edaf0..cd23a36b 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,5 +1,5 @@ - {% extends "base_content.html" %} + {% load i18n %} {% block title %}{% spaceless %}404 Error{% endspaceless %}{% endblock %} {% block forestyle%} diff --git a/templates/500.html b/templates/500.html index c99774b3..52dcafae 100644 --- a/templates/500.html +++ b/templates/500.html @@ -1,5 +1,5 @@ - {% extends "base_content.html" %} + {% load i18n %} {% block title %}{% spaceless %}500 Error{% endspaceless %}{% endblock %} {% block forejs %} @@ -19,7 +19,7 @@
-

{% trans "sorry, system error"

+

{% trans "sorry, system error" %}


{% trans "system error log is recorded, error will be fixed as soon as possible" %}
{% trans "please report the error to the site administrators if you wish" %} diff --git a/templates/answer_edit.html b/templates/answer_edit.html index 008d9f78..9f0f1bec 100644 --- a/templates/answer_edit.html +++ b/templates/answer_edit.html @@ -1,5 +1,5 @@ - {% extends "base.html" %} + {% load i18n %} {% block title %}{% spaceless %}{% trans "Edit answer" %}{% endspaceless %}{% endblock %} {% block forejs %} diff --git a/templates/answer_edit_tips.html b/templates/answer_edit_tips.html index 565c5298..31f71e34 100644 --- a/templates/answer_edit_tips.html +++ b/templates/answer_edit_tips.html @@ -35,7 +35,7 @@
  • - {% trans "image" %}:![alt {% trans "text" %}](/path/img.jpg "{% trans "title" %}") + {% trans "image" %}:![alt {% trans "text" %}](/path/img.jpg "{% trans "title" %}")
  • diff --git a/templates/ask.html b/templates/ask.html index 1b00a701..4aa18dd5 100644 --- a/templates/ask.html +++ b/templates/ask.html @@ -1,5 +1,5 @@ - {% extends "base.html" %} + {% load i18n %} {% block title %}{% spaceless %}{% trans "Ask a question" %}{% endspaceless %}{% endblock %} {% block forejs %} @@ -62,6 +62,19 @@
    + {% if not request.user.is_authenticated %} +
    +

    {% trans "login to post question info" %}

    +
    + {% else %} + {% ifequal settings.EMAIL_VALIDATION 'on' %} + {% if not request.user.email_isvalid %} +
    + {% blocktrans with request.user.email as email %}must have valid {{email}} to post{% endblocktrans %} +
    + {% endif %} + {% endifequal %} + {% endif %}


    {{ form.title }} {{ form.title.errors }} @@ -92,40 +105,17 @@

    - {{ form.tags.label_tag }}:
    + {{ form.tags.label_tag }}: {% trans "(required)" %}
    {{ form.tags }} {{ form.tags.errors }} -

    - {{ form.tags.help_text }} -

    -
    +

    + {{ form.tags.help_text }} +

    {% if not request.user.is_authenticated %} - - - - - - -
    - {% trans "Use" %} OpenID {% trans "Login" %}:
    - {{ form.openid }} -
    - {% trans "Get your own "%} OpenID。 -
    -
    -
    -
    -
    - {% trans "User name" %}:
    - {{ form.user }} -

    - {% trans "Email: (won't be shown to anyone)" %}:
    - {{ form.email }} -

    -
    - {% endif %} + + {% else %} -

    + {% endif %}
    diff --git a/templates/authopenid/changeemail.html b/templates/authopenid/changeemail.html index 99984b3f..d5acb6c9 100644 --- a/templates/authopenid/changeemail.html +++ b/templates/authopenid/changeemail.html @@ -1,35 +1,81 @@ {% extends "base_content.html" %} {% load i18n %} {% block content %} -
    -

    - {% trans "Account: change email" %} -

    -
    -

    {% blocktrans %}This is where you can change the email address associated with your account. Please keep this email address up to date so we can send you a password-reset email if you request one.{% endblocktrans %}

    -{% if form.errors %} -

    {% trans "Please correct errors below:" %}
    - {% if form.email.errors %} - {{ form.email.errors|join:", " }} - {% endif %} - {% if form.password.errors %} - {{ form.password.errors|join:", " }} - {% endif %} -

    -{% endif %} + +{% ifequal action_type "change" %} +
    + {% trans "Change email" %} +
    +

    + {% blocktrans %}change {{email}} info{% endblocktrans %} +

    + {% if form.errors %} +

    {% trans "Please correct errors below:" %}
    + {% if form.email.errors %} + {{ form.email.errors|join:", " }} + {% endif %} + {% if form.password.errors %} + {{ form.password.errors|join:", " }} + {% endif %} +

    + {% endif %} -{% if msg %} -

    {{ msg }}

    -{% endif %} + {% if msg %} +

    {{ msg }}

    + {% endif %} -
    -
    +
    + -
    {{ form.email }}
    -
    {{ form.password }}
    +

    {{ form.email }}
    + +
    + + +
    -

    - - -
    + +
    +{% endifequal %} +{% ifequal action_type "validate" %} +
    + {% trans "Validate email" %} +
    +

    + {% blocktrans %}validate {{email}} info{% endblocktrans %} +

    +{% endifequal %} +{% ifequal action_type "keep" %} +
    + {% trans "Email not changed" %} +
    +

    + {% blocktrans %}old {{email}} kept{% endblocktrans %} +

    +{% endifequal %} +{% ifequal action_type "done_novalidate" %} +
    + {% trans "Email changed" %} +
    +

    + {% blocktrans %}your current {{email}} can be used for this{% endblocktrans %} +

    +{% endifequal %} +{% ifequal action_type "validation_complete" %} +
    + {% trans "Email verified" %} +
    +

    + {% trans "thanks for verifying email" %} +

    +{% endifequal %} +{% ifequal action_type "key_not_sent" %} +
    + {% trans "email key not sent" %} +
    +

    + {% blocktrans %}email key not sent {{email}} change email here {{change_link}}{% endblocktrans %} +

    +{% endifequal %} {% endblock %} + diff --git a/templates/authopenid/changeopenid.html b/templates/authopenid/changeopenid.html index c1f3d180..9b5a196a 100644 --- a/templates/authopenid/changeopenid.html +++ b/templates/authopenid/changeopenid.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% load i18n %} {% block content %} @@ -31,3 +32,4 @@
  • {% endblock %} + diff --git a/templates/authopenid/changepw.html b/templates/authopenid/changepw.html index f3cf4be0..0e90b172 100644 --- a/templates/authopenid/changepw.html +++ b/templates/authopenid/changepw.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% load i18n %} {% block head %} @@ -31,3 +32,4 @@
    {% endblock %} + diff --git a/templates/authopenid/complete.html b/templates/authopenid/complete.html index 28c38a04..b9a14e16 100644 --- a/templates/authopenid/complete.html +++ b/templates/authopenid/complete.html @@ -1,4 +1,5 @@ -{% extends "base.html" %} +{% extends "base_content.html" %} + {% load i18n %} {% block head %}{% endblock %} {% block title %}{% spaceless %}{% trans "Connect your OpenID with this site" %}{% endspaceless %}{% endblock %} @@ -7,7 +8,9 @@ {% trans "Connect your OpenID with your account on this site" %}

    -

    {% trans "Your OpenID is accepted. Please complete this to finish registration." %}

    +
    + {% blocktrans %}register new {{provider}} account info{% endblocktrans %} +

    {% trans "This account already exists, please use another." %}

    @@ -41,12 +44,9 @@
    {{ form.next }} -
    - {% trans "New account" %} -

    {{ form1.username }}
    -

    {{ form1.email }}
    -
    -
    +

    {{ form1.username }}
    +

    {{ form1.email }}
    +
    {% endblock %} + diff --git a/templates/authopenid/confirm_email.txt b/templates/authopenid/confirm_email.txt index 9af177ed..202db0fc 100644 --- a/templates/authopenid/confirm_email.txt +++ b/templates/authopenid/confirm_email.txt @@ -1,12 +1,13 @@ -Thank you for registering. +{% load i18n %} +{% trans "Thank you for registering at our Q&A forum!" %} -Your account details are: +{% trans "Your account details are:" %} -Username: {{ username }} -Password: {{ password }} - - -You may sign in here: -{{ site_url }}signin/ +{% trans "Username:" %} {{ username }} +{% trans "Password:" %} {{ password }} +{% trans "Please sign in here:" %} +{{ site_url }}{% trans "signin/" %} +{% blocktrans %}Sincerely, +Forum Administrator{% endblocktrans %} diff --git a/templates/authopenid/delete.html b/templates/authopenid/delete.html index 19e0884a..d39bc962 100644 --- a/templates/authopenid/delete.html +++ b/templates/authopenid/delete.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% load i18n %} @@ -36,3 +37,4 @@ {% endblock %} + diff --git a/templates/authopenid/failure.html b/templates/authopenid/failure.html index 87839ab2..d075d6b0 100644 --- a/templates/authopenid/failure.html +++ b/templates/authopenid/failure.html @@ -1,5 +1,6 @@ + OpenID failed @@ -10,4 +11,4 @@

    {{ message|escape }}

    - \ No newline at end of file + diff --git a/templates/authopenid/sendpw.html b/templates/authopenid/sendpw.html index a9488c4c..ba81dba4 100644 --- a/templates/authopenid/sendpw.html +++ b/templates/authopenid/sendpw.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% load i18n %} {% block title %}{% spaceless %}{% trans "Send new password" %}{% endspaceless %}{% endblock %} @@ -32,3 +33,4 @@ {% trans "Note: your new password will be activated only after you click the activation link in the email message" %} {% endblock %} + diff --git a/templates/authopenid/sendpw_email.txt b/templates/authopenid/sendpw_email.txt index dec062a8..2024061c 100644 --- a/templates/authopenid/sendpw_email.txt +++ b/templates/authopenid/sendpw_email.txt @@ -1,14 +1,14 @@ -Someone has requested to reset your password on {{ site_url }}. -If this is not you, it is safe to ignore this email. +{% load i18n %} +{% blocktrans %}Someone has requested to reset your password on {{ site_url }}. +If it were not you, it is safe to ignore this email.{% endblocktrans %} -Your new account details are: +{% trans "Your new account details are:" %} -Username: {{ username }} -New password: {{ password }} +{% trans "Username:" %} {{ username }} +{% trans "New password:" %} {{ password }} -To confirm reset of your password go to this address: +{% trans "To confirm that you wanted to reset your password please visit:" %} {{ site_url }}{{ url_confirm }}?key={{ confirm_key }} -Regards, - - +{% blocktrans %}Sincerely, +Forum Administrator{% endblocktrans %} diff --git a/templates/authopenid/settings.html b/templates/authopenid/settings.html index ffd5dd8f..a373324e 100644 --- a/templates/authopenid/settings.html +++ b/templates/authopenid/settings.html @@ -1,4 +1,5 @@ {% extends "base_content.html" %} + {% load i18n %} {% block head %} @@ -39,3 +40,4 @@ {% endblock %} + diff --git a/templates/authopenid/signin.html b/templates/authopenid/signin.html index d8a98329..9a1a6780 100644 --- a/templates/authopenid/signin.html +++ b/templates/authopenid/signin.html @@ -1,42 +1,120 @@ {% extends "base.html" %} + {% load i18n %} {% block title %}{% spaceless %}{% trans "User login" %}{% endspaceless %}{% endblock %} {% block forejs %} - + - + + {% endblock %} {% block content %}
    {% trans "User login" %}
    -
    -
    - {{ form2.next }} -

    {% trans "we support two login modes" %}

    {% if msg %}

    {{ msg }}

    {% endif %} -
    - {% trans "Login with your OpenID" %} -
    -

    {% trans "select openid provider" %}

    -
    -
    -


    -

    {% trans "verify openid link and login" %}

    + {% if answer %} +
    + {% blocktrans with answer.question.title as title and answer.summary as summary %} + Your answer to {{title}} {{summary}} will be posted once you log in + {% endblocktrans %} +
    + {% endif %} + {% if question %} +
    + {% blocktrans with question.title as title and question.summary as summary %}Your question + {{title}} {{summary}} will be posted once you log in + {% endblocktrans %}
    -

    - {{ form2.openid_url }} -

    -
    -
    -
    + {% endif %} +
    {% trans "Click to sign in through any of these services." %}
    +
    +
      +
    • +
      + icon +
      + http://{your-openid-url} +
    • +
    • +
      + iconhttps://www.google.com/accounts/o8/id +
      +
    • +
    • +
      + iconhttp://yahoo.com/ +
      +
    • +
    • +
      + iconhttp://openid.aol.com/username +
      +
    • +
    • + icon + http://username.myopenid.com/ +
    • +
    • + icon + http://flickr.com/username/ +
    • +
    • + icon + http://technorati.com/people/technorati/username/ +
    • +
    • + icon + http://username.wordpress.com +
    • +
    • + icon + http://username.blogspot.com/ +
    • +
    • + icon + http://username.livejournal.com +
    • +
    • + icon + http://claimid.com/username +
    • +
    • + icon + http://username.myvidoop.com/ +
    • +
    • + icon + http://username.pip.verisignlabs.com/ +
    • +
    + {{ form2.next }} +
    +

    {% trans 'Enter your Provider user name' %}

    +

    + + +

    +
    +
    +

    {% trans 'Enter your web address' %}

    +

    +

    +
    +
    + @@ -93,3 +171,5 @@
    {% endblock%} + + diff --git a/templates/authopenid/signup.html b/templates/authopenid/signup.html index 9ac0aab3..a65dafdc 100644 --- a/templates/authopenid/signup.html +++ b/templates/authopenid/signup.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% load i18n %} {% block title %}{% spaceless %}{% trans "Signup" %}{% endspaceless %}{% endblock %} @@ -51,3 +52,4 @@
    {% endblock %} + diff --git a/templates/badge.html b/templates/badge.html index d0906918..029ba0d9 100644 --- a/templates/badge.html +++ b/templates/badge.html @@ -1,5 +1,5 @@ - {% extends "base_content.html" %} + {% load i18n %} {% load extra_tags %} {% load humanize %} diff --git a/templates/badges.html b/templates/badges.html index 7fd1402a..69ddc39f 100644 --- a/templates/badges.html +++ b/templates/badges.html @@ -1,5 +1,5 @@ - {% extends "base.html" %} + {% load extra_tags %} {% load humanize %} {% load i18n %} @@ -16,9 +16,10 @@
    {% trans "Badges" %}
    -
    +

    - {% trans "Community gives you awards for your questions, answers and votes. Below is the list of available badges and number of times each type of badge has been awarded." %} + {% trans "Community gives you awards for your questions, answers and votes." %}
    + {% trans "Below is the list of available badges and number of times each type of badge has been awarded." %}


    @@ -44,14 +45,14 @@ {% endblock %} {% block sidebar %} -
    +

    {% trans "Community badges" %}

     {% trans "gold" %}

    - {% trans "Gold badge is very rare. To obtain it you have to show profound knowledge and ability in addition to actively participating in the community. Gold badge is the highest award in this community." %} + {% trans "gold badge description" %}

     {% trans "silver" %}

    - {% trans "Obtaining silver badge requires significant patience. If you got one, you've very significantly contributed to this community" %} + {% trans "silver badge description" %}

     {% trans "bronze" %}

    - {% trans "If you are active in this community, you will get this medal - still it is a special honor." %} + {% trans "bronze badge description" %}

    diff --git a/templates/base.html b/templates/base.html index bf24c840..ae389255 100644 --- a/templates/base.html +++ b/templates/base.html @@ -4,18 +4,18 @@ {% load i18n %} - {% block title %}{% endblock %} - {{ APP_TITLE }} + {% block title %}{% endblock %} - {{ settings.APP_TITLE }} {% spaceless %} {% block meta %}{% endblock %} {% endspaceless %} - + @@ -26,9 +26,8 @@ --> - {% with request.user.get_messages as messages%} {% if messages %} - {% endif %} - {% endwith %} {% block forejs %} {% endblock %} {% include "header.html" %}
    @@ -89,3 +89,4 @@ {% endblock %} + diff --git a/templates/base_content.html b/templates/base_content.html index 39627a0e..4ee9675f 100644 --- a/templates/base_content.html +++ b/templates/base_content.html @@ -1,10 +1,11 @@ -{% load i18n %} + +{% load i18n %} - {% block title %}{% endblock %} - {{ APP_TITLE }} + {% block title %}{% endblock %} - {{ settings.APP_TITLE }} - + {% spaceless %} @@ -13,7 +14,7 @@ @@ -38,29 +39,32 @@ --> - {% with request.user.get_messages as messages%} {% if messages %} {% endif %} - {% endwith %} {% block forejs %} {% endblock %} {% include "header.html" %}
    @@ -82,3 +86,4 @@ {% endblock %} + diff --git a/templates/book.html b/templates/book.html index a58a09f2..dddd13e6 100644 --- a/templates/book.html +++ b/templates/book.html @@ -1,5 +1,5 @@ - {% extends "base_content.html" %} + {% load i18n %} {% load extra_tags %} {% load extra_filters %} diff --git a/templates/close.html b/templates/close.html index 32df3e82..d9e73507 100644 --- a/templates/close.html +++ b/templates/close.html @@ -1,5 +1,5 @@ - {% extends "base_content.html" %} + {% load i18n %} {% load extra_tags %} {% load humanize %} diff --git a/templates/content/js/com.cnprog.i18n.js b/templates/content/js/com.cnprog.i18n.js index 2d8c90a6..90166eec 100644 --- a/templates/content/js/com.cnprog.i18n.js +++ b/templates/content/js/com.cnprog.i18n.js @@ -1,5 +1,3 @@ -// Evgeny Fadeev evgeny.fadeev@gmail.com localized for english and chinese -// i18nLang variable must be set in html header to extract correct language var i18nZh = { 'insufficient privilege':'用户权限不在操作范围', 'cannot pick own answer as best':'不能设置自己的回答为最佳答案', @@ -59,6 +57,10 @@ var i18nZh = { }; var i18nEn = { + '>15 points requried to upvote':'>15 points requried to upvote ', + 'tags cannot be empty':'please enter at least one tag', + 'anonymous users cannot vote':'anonymous users cannot vote ', + 'anonymous users cannot select favorite questions':'anonymous users cannot select favorite questions ', 'to comment, need': 'to comment, need reputation ', 'please see':'please see ', 'community reputation points':' ', @@ -84,7 +86,7 @@ var i18nEn = { var i18n = { 'en':i18nEn, - 'zh':i18nZh + 'zh_CN':i18nZh }; var i18n_dict = i18n[i18nLang]; diff --git a/templates/content/js/com.cnprog.post.js b/templates/content/js/com.cnprog.post.js index 723e34ae..546cf101 100644 --- a/templates/content/js/com.cnprog.post.js +++ b/templates/content/js/com.cnprog.post.js @@ -48,10 +48,11 @@ var Vote = function(){ var questionControlsId = 'question-controls'; var removeQuestionLinkIdPrefix = 'question-delete-link-'; var removeAnswerLinkIdPrefix = 'answer-delete-link-'; + var questionSubscribeUpdates = 'question-subscribe-updates'; var acceptAnonymousMessage = $.i18n._('insufficient privilege'); var acceptOwnAnswerMessage = $.i18n._('cannot pick own answer as best'); - var favoriteAnonymousMessage = $.i18n._('anonymous user cannot select favorite questions') + var favoriteAnonymousMessage = $.i18n._('anonymous users cannot select favorite questions') + "" + $.i18n._('please login') + ""; var voteAnonymousMessage = $.i18n._('anonymous users cannot vote') @@ -91,7 +92,9 @@ var Vote = function(){ offensiveQuestion : 7, offensiveAnswer:8, removeQuestion: 9, - removeAnswer:10 + removeAnswer:10, + questionSubscribeUpdates:11, + questionUnsubscribeUpdates:12, }; var getFavoriteButton = function(){ @@ -141,6 +144,10 @@ var Vote = function(){ var removeQuestionLink = 'div#question-controls a[id^='+ removeQuestionLinkIdPrefix +']'; return $(removeQuestionLink); }; + + var getquestionSubscribeUpdatesCheckbox = function(){ + return $('#' + questionSubscribeUpdates); + }; var getremoveAnswersLinks = function(){ var removeAnswerLinks = 'div.answer-controls a[id^='+ removeAnswerLinkIdPrefix +']'; @@ -216,6 +223,15 @@ var Vote = function(){ getremoveQuestionLink().unbind('click').click(function(event){ Vote.remove(this, VoteType.removeQuestion); }); + + getquestionSubscribeUpdatesCheckbox().unbind('click').click(function(event){ + if (this.checked){ + Vote.vote($(event.target), VoteType.questionSubscribeUpdates); + } + else { + Vote.vote($(event.target), VoteType.questionUnsubscribeUpdates); + } + }); getremoveAnswersLinks().unbind('click').click(function(event){ Vote.remove(this, VoteType.removeAnswer) @@ -343,7 +359,6 @@ var Vote = function(){ }; var callback_remove = function(object, voteType, data){ - alert(data.status); if(data.allowed == "0" && data.success == "0"){ showMessage(object, removeAnonymousMessage.replace("{{QuestionID}}", questionId)); } @@ -613,4 +628,4 @@ var commentsFactory = {'question' : questionComments, 'answer' : answerComments} Prettify http://www.apache.org/licenses/LICENSE-2.0 */ -var PR_SHOULD_USE_CONTINUATION = true; var PR_TAB_WIDTH = 8; var PR_normalizedHtml; var PR; var prettyPrintOne; var prettyPrint; function _pr_isIE6() { var isIE6 = navigator && navigator.userAgent && /\bMSIE 6\./.test(navigator.userAgent); _pr_isIE6 = function() { return isIE6; }; return isIE6; } (function() { function wordSet(words) { words = words.split(/ /g); var set = {}; for (var i = words.length; --i >= 0; ) { var w = words[i]; if (w) { set[w] = null; } } return set; } var FLOW_CONTROL_KEYWORDS = "break continue do else for if return while "; var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " + "double enum extern float goto int long register short signed sizeof " + "static struct switch typedef union unsigned void volatile "; var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " + "new operator private protected public this throw true try "; var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " + "concept concept_map const_cast constexpr decltype " + "dynamic_cast explicit export friend inline late_check " + "mutable namespace nullptr reinterpret_cast static_assert static_cast " + "template typeid typename typeof using virtual wchar_t where "; var JAVA_KEYWORDS = COMMON_KEYWORDS + "boolean byte extends final finally implements import instanceof null " + "native package strictfp super synchronized throws transient "; var CSHARP_KEYWORDS = JAVA_KEYWORDS + "as base by checked decimal delegate descending event " + "fixed foreach from group implicit in interface internal into is lock " + "object out override orderby params readonly ref sbyte sealed " + "stackalloc string select uint ulong unchecked unsafe ushort var "; var JSCRIPT_KEYWORDS = COMMON_KEYWORDS + "debugger eval export function get null set undefined var with " + "Infinity NaN "; var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " + "goto if import last local my next no our print package redo require " + "sub undef unless until use wantarray while BEGIN END "; var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " + "elif except exec finally from global import in is lambda " + "nonlocal not or pass print raise try with yield " + "False True None "; var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" + " defined elsif end ensure false in module next nil not or redo rescue " + "retry self super then true undef unless until when yield BEGIN END "; var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " + "function in local set then until "; var ALL_KEYWORDS = (CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS + PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS); var PR_STRING = 'str'; var PR_KEYWORD = 'kwd'; var PR_COMMENT = 'com'; var PR_TYPE = 'typ'; var PR_LITERAL = 'lit'; var PR_PUNCTUATION = 'pun'; var PR_PLAIN = 'pln'; var PR_TAG = 'tag'; var PR_DECLARATION = 'dec'; var PR_SOURCE = 'src'; var PR_ATTRIB_NAME = 'atn'; var PR_ATTRIB_VALUE = 'atv'; var PR_NOCODE = 'nocode'; function isWordChar(ch) { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'); } function spliceArrayInto(inserted, container, containerPosition, countReplaced) { inserted.unshift(containerPosition, countReplaced || 0); try { container.splice.apply(container, inserted); } finally { inserted.splice(0, 2); } } var REGEXP_PRECEDER_PATTERN = function() { var preceders = ["!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=", "&=", "(", "*", "*=", "+=", ",", "-=", "->", "/", "/=", ":", "::", ";", "<", "<<", "<<=", "<=", "=", "==", "===", ">", ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[", "^", "^=", "^^", "^^=", "{", "|", "|=", "||", "||=", "~", "break", "case", "continue", "delete", "do", "else", "finally", "instanceof", "return", "throw", "try", "typeof"]; var pattern = '(?:' + '(?:(?:^|[^0-9.])\\.{1,3})|' + '(?:(?:^|[^\\+])\\+)|' + '(?:(?:^|[^\\-])-)'; for (var i = 0; i < preceders.length; ++i) { var preceder = preceders[i]; if (isWordChar(preceder.charAt(0))) { pattern += '|\\b' + preceder; } else { pattern += '|' + preceder.replace(/([^=<>:&])/g, '\\$1'); } } pattern += '|^)\\s*$'; return new RegExp(pattern); } (); var pr_amp = /&/g; var pr_lt = //g; var pr_quot = /\"/g; function attribToHtml(str) { return str.replace(pr_amp, '&').replace(pr_lt, '<').replace(pr_gt, '>').replace(pr_quot, '"'); } function textToHtml(str) { return str.replace(pr_amp, '&').replace(pr_lt, '<').replace(pr_gt, '>'); } var pr_ltEnt = /</g; var pr_gtEnt = />/g; var pr_aposEnt = /'/g; var pr_quotEnt = /"/g; var pr_ampEnt = /&/g; var pr_nbspEnt = / /g; function htmlToText(html) { var pos = html.indexOf('&'); if (pos < 0) { return html; } for (--pos; (pos = html.indexOf('&#', pos + 1)) >= 0; ) { var end = html.indexOf(';', pos); if (end >= 0) { var num = html.substring(pos + 3, end); var radix = 10; if (num && num.charAt(0) === 'x') { num = num.substring(1); radix = 16; } var codePoint = parseInt(num, radix); if (!isNaN(codePoint)) { html = (html.substring(0, pos) + String.fromCharCode(codePoint) + html.substring(end + 1)); } } } return html.replace(pr_ltEnt, '<').replace(pr_gtEnt, '>').replace(pr_aposEnt, "'").replace(pr_quotEnt, '"').replace(pr_ampEnt, '&').replace(pr_nbspEnt, ' '); } function isRawContent(node) { return 'XMP' === node.tagName; } function normalizedHtml(node, out) { switch (node.nodeType) { case 1: var name = node.tagName.toLowerCase(); out.push('<', name); for (var i = 0; i < node.attributes.length; ++i) { var attr = node.attributes[i]; if (!attr.specified) { continue; } out.push(' '); normalizedHtml(attr, out); } out.push('>'); for (var child = node.firstChild; child; child = child.nextSibling) { normalizedHtml(child, out); } if (node.firstChild || !/^(?:br|link|img)$/.test(name)) { out.push('<\/', name, '>'); } break; case 2: out.push(node.name.toLowerCase(), '="', attribToHtml(node.value), '"'); break; case 3: case 4: out.push(textToHtml(node.nodeValue)); break; } } var PR_innerHtmlWorks = null; function getInnerHtml(node) { if (null === PR_innerHtmlWorks) { var testNode = document.createElement('PRE'); testNode.appendChild(document.createTextNode('\n')); PR_innerHtmlWorks = !/= 0; nSpaces -= SPACES.length) { out.push(SPACES.substring(0, nSpaces)); } pos = i + 1; break; case '\n': charInLine = 0; break; default: ++charInLine; } } if (!out) { return plainText; } out.push(plainText.substring(pos)); return out.join(''); }; } var pr_chunkPattern = /(?:[^<]+|||<\/?[a-zA-Z][^>]*>|<)/g; var pr_commentPrefix = /^|$)/, null], [PR_SOURCE, /^<\?[\s\S]*?(?:\?>|$)/, null], [PR_SOURCE, /^<%[\s\S]*?(?:%>|$)/, null], [PR_SOURCE, /^<(script|style|xmp)\b[^>]*>[\s\S]*?<\/\1\b[^>]*>/i, null], [PR_TAG, /^<\/?\w[^<>]*>/, null]]); var PR_SOURCE_CHUNK_PARTS = /^(<[^>]*>)([\s\S]*)(<\/[^>]*>)$/; function tokenizeMarkup(source) { var decorations = PR_MARKUP_LEXER(source); for (var i = 0; i < decorations.length; i += 2) { if (decorations[i + 1] === PR_SOURCE) { var start, end; start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; var sourceChunk = source.substring(start, end); var match = sourceChunk.match(PR_SOURCE_CHUNK_PARTS); if (match) { decorations.splice(i, 2, start, PR_TAG, start + match[1].length, PR_SOURCE, start + match[1].length + (match[2] || '').length, PR_TAG); } } } return decorations; } var PR_TAG_LEXER = createSimpleLexer([[PR_ATTRIB_VALUE, /^\'[^\']*(?:\'|$)/, null, "'"], [PR_ATTRIB_VALUE, /^\"[^\"]*(?:\"|$)/, null, '"'], [PR_PUNCTUATION, /^[<>\/=]+/, null, '<>/=']], [[PR_TAG, /^[\w:\-]+/, /^= 2 && /^[\"\']/.test(attribValue) && attribValue.charAt(0) === attribValue.charAt(attribLen - 1)); var attribSource; var attribSourceStart; var attribSourceEnd; if (quoted) { attribSourceStart = start + 1; attribSourceEnd = end - 1; attribSource = attribValue; } else { attribSourceStart = start + 1; attribSourceEnd = end - 1; attribSource = attribValue.substring(1, attribValue.length - 1); } var attribSourceDecorations = decorateSource(attribSource); for (var j = 0, m = attribSourceDecorations.length; j < m; j += 2) { attribSourceDecorations[j] += attribSourceStart; } if (quoted) { attribSourceDecorations.push(attribSourceEnd, PR_ATTRIB_VALUE); spliceArrayInto(attribSourceDecorations, decorations, i + 2, 0); } else { spliceArrayInto(attribSourceDecorations, decorations, i, 2); } } nextValueIsSource = false; } } return decorations; } function decorateMarkup(sourceCode) { var decorations = tokenizeMarkup(sourceCode); decorations = splitTagAttributes(sourceCode, decorations); decorations = splitSourceNodes(sourceCode, decorations); decorations = splitSourceAttributes(sourceCode, decorations); return decorations; } function recombineTagsAndDecorations(sourceText, extractedTags, decorations) { var html = []; var outputIdx = 0; var openDecoration = null; var currentDecoration = null; var tagPos = 0; var decPos = 0; var tabExpander = makeTabExpander(PR_TAB_WIDTH); var adjacentSpaceRe = /([\r\n ]) /g; var startOrSpaceRe = /(^| ) /gm; var newlineRe = /\r\n?|\n/g; var trailingSpaceRe = /[ \r\n]$/; var lastWasSpace = true; function emitTextUpTo(sourceIdx) { if (sourceIdx > outputIdx) { if (openDecoration && openDecoration !== currentDecoration) { html.push(''); openDecoration = null; } if (!openDecoration && currentDecoration) { openDecoration = currentDecoration; html.push(''); } var htmlChunk = textToHtml(tabExpander(sourceText.substring(outputIdx, sourceIdx))).replace(lastWasSpace ? startOrSpaceRe : adjacentSpaceRe, '$1 '); lastWasSpace = trailingSpaceRe.test(htmlChunk); html.push(htmlChunk.replace(newlineRe, '
    ')); outputIdx = sourceIdx; } } while (true) { var outputTag; if (tagPos < extractedTags.length) { if (decPos < decorations.length) { outputTag = extractedTags[tagPos] <= decorations[decPos]; } else { outputTag = true; } } else { outputTag = false; } if (outputTag) { emitTextUpTo(extractedTags[tagPos]); if (openDecoration) { html.push('
    '); openDecoration = null; } html.push(extractedTags[tagPos + 1]); tagPos += 2; } else if (decPos < decorations.length) { emitTextUpTo(decorations[decPos]); currentDecoration = decorations[decPos + 1]; decPos += 2; } else { break; } } emitTextUpTo(sourceText.length); if (openDecoration) { html.push(''); } return html.join(''); } var langHandlerRegistry = {}; function registerLangHandler(handler, fileExtensions) { for (var i = fileExtensions.length; --i >= 0; ) { var ext = fileExtensions[i]; if (!langHandlerRegistry.hasOwnProperty(ext)) { langHandlerRegistry[ext] = handler; } else if ('console' in window) { console.log('cannot override language handler %s', ext); } } } registerLangHandler(decorateSource, ['default-code']); registerLangHandler(decorateMarkup, ['default-markup', 'html', 'htm', 'xhtml', 'xml', 'xsl']); registerLangHandler(sourceDecorator({ keywords: CPP_KEYWORDS, hashComments: true, cStyleComments: true }), ['c', 'cc', 'cpp', 'cs', 'cxx', 'cyc']); registerLangHandler(sourceDecorator({ keywords: JAVA_KEYWORDS, cStyleComments: true }), ['java']); registerLangHandler(sourceDecorator({ keywords: SH_KEYWORDS, hashComments: true, multiLineStrings: true }), ['bsh', 'csh', 'sh']); registerLangHandler(sourceDecorator({ keywords: PYTHON_KEYWORDS, hashComments: true, multiLineStrings: true, tripleQuotedStrings: true }), ['cv', 'py']); registerLangHandler(sourceDecorator({ keywords: PERL_KEYWORDS, hashComments: true, multiLineStrings: true, regexLiterals: true }), ['perl', 'pl', 'pm']); registerLangHandler(sourceDecorator({ keywords: RUBY_KEYWORDS, hashComments: true, multiLineStrings: true, regexLiterals: true }), ['rb']); registerLangHandler(sourceDecorator({ keywords: JSCRIPT_KEYWORDS, cStyleComments: true, regexLiterals: true }), ['js']); function prettyPrintOne(sourceCodeHtml, opt_langExtension) { try { var sourceAndExtractedTags = extractTags(sourceCodeHtml); var source = sourceAndExtractedTags.source; var extractedTags = sourceAndExtractedTags.tags; if (!langHandlerRegistry.hasOwnProperty(opt_langExtension)) { opt_langExtension = /^\s*= 0) { var langExtension = cs.className.match(/\blang-(\w+)\b/); if (langExtension) { langExtension = langExtension[1]; } var nested = false; for (var p = cs.parentNode; p; p = p.parentNode) { if ((p.tagName === 'pre' || p.tagName === 'code' || p.tagName === 'xmp') && p.className && p.className.indexOf('prettyprint') >= 0) { nested = true; break; } } if (!nested) { var content = getInnerHtml(cs); content = content.replace(/(?:\r\n?|\n)$/, ''); var newContent = prettyPrintOne(content, langExtension); if (!isRawContent(cs)) { cs.innerHTML = newContent; } else { var pre = document.createElement('PRE'); for (var i = 0; i < cs.attributes.length; ++i) { var a = cs.attributes[i]; if (a.specified) { var aname = a.name.toLowerCase(); if (aname === 'class') { pre.className = a.value; } else { pre.setAttribute(a.name, a.value); } } } pre.innerHTML = newContent; cs.parentNode.replaceChild(pre, cs); cs = pre; } if (isIE6 && cs.tagName === 'PRE') { var lineBreaks = cs.getElementsByTagName('br'); for (var j = lineBreaks.length; --j >= 0; ) { var lineBreak = lineBreaks[j]; lineBreak.parentNode.replaceChild(document.createTextNode('\r\n'), lineBreak); } } } } } if (k < elements.length) { setTimeout(doWork, 250); } else if (opt_whenDone) { opt_whenDone(); } } doWork(); } window['PR_normalizedHtml'] = normalizedHtml; window['prettyPrintOne'] = prettyPrintOne; window['prettyPrint'] = prettyPrint; window['PR'] = { 'createSimpleLexer': createSimpleLexer, 'registerLangHandler': registerLangHandler, 'sourceDecorator': sourceDecorator, 'PR_ATTRIB_NAME': PR_ATTRIB_NAME, 'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE, 'PR_COMMENT': PR_COMMENT, 'PR_DECLARATION': PR_DECLARATION, 'PR_KEYWORD': PR_KEYWORD, 'PR_LITERAL': PR_LITERAL, 'PR_NOCODE': PR_NOCODE, 'PR_PLAIN': PR_PLAIN, 'PR_PUNCTUATION': PR_PUNCTUATION, 'PR_SOURCE': PR_SOURCE, 'PR_STRING': PR_STRING, 'PR_TAG': PR_TAG, 'PR_TYPE': PR_TYPE }; })(); \ No newline at end of file +var PR_SHOULD_USE_CONTINUATION = true; var PR_TAB_WIDTH = 8; var PR_normalizedHtml; var PR; var prettyPrintOne; var prettyPrint; function _pr_isIE6() { var isIE6 = navigator && navigator.userAgent && /\bMSIE 6\./.test(navigator.userAgent); _pr_isIE6 = function() { return isIE6; }; return isIE6; } (function() { function wordSet(words) { words = words.split(/ /g); var set = {}; for (var i = words.length; --i >= 0; ) { var w = words[i]; if (w) { set[w] = null; } } return set; } var FLOW_CONTROL_KEYWORDS = "break continue do else for if return while "; var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " + "double enum extern float goto int long register short signed sizeof " + "static struct switch typedef union unsigned void volatile "; var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " + "new operator private protected public this throw true try "; var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " + "concept concept_map const_cast constexpr decltype " + "dynamic_cast explicit export friend inline late_check " + "mutable namespace nullptr reinterpret_cast static_assert static_cast " + "template typeid typename typeof using virtual wchar_t where "; var JAVA_KEYWORDS = COMMON_KEYWORDS + "boolean byte extends final finally implements import instanceof null " + "native package strictfp super synchronized throws transient "; var CSHARP_KEYWORDS = JAVA_KEYWORDS + "as base by checked decimal delegate descending event " + "fixed foreach from group implicit in interface internal into is lock " + "object out override orderby params readonly ref sbyte sealed " + "stackalloc string select uint ulong unchecked unsafe ushort var "; var JSCRIPT_KEYWORDS = COMMON_KEYWORDS + "debugger eval export function get null set undefined var with " + "Infinity NaN "; var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " + "goto if import last local my next no our print package redo require " + "sub undef unless until use wantarray while BEGIN END "; var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " + "elif except exec finally from global import in is lambda " + "nonlocal not or pass print raise try with yield " + "False True None "; var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" + " defined elsif end ensure false in module next nil not or redo rescue " + "retry self super then true undef unless until when yield BEGIN END "; var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " + "function in local set then until "; var ALL_KEYWORDS = (CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS + PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS); var PR_STRING = 'str'; var PR_KEYWORD = 'kwd'; var PR_COMMENT = 'com'; var PR_TYPE = 'typ'; var PR_LITERAL = 'lit'; var PR_PUNCTUATION = 'pun'; var PR_PLAIN = 'pln'; var PR_TAG = 'tag'; var PR_DECLARATION = 'dec'; var PR_SOURCE = 'src'; var PR_ATTRIB_NAME = 'atn'; var PR_ATTRIB_VALUE = 'atv'; var PR_NOCODE = 'nocode'; function isWordChar(ch) { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'); } function spliceArrayInto(inserted, container, containerPosition, countReplaced) { inserted.unshift(containerPosition, countReplaced || 0); try { container.splice.apply(container, inserted); } finally { inserted.splice(0, 2); } } var REGEXP_PRECEDER_PATTERN = function() { var preceders = ["!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=", "&=", "(", "*", "*=", "+=", ",", "-=", "->", "/", "/=", ":", "::", ";", "<", "<<", "<<=", "<=", "=", "==", "===", ">", ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[", "^", "^=", "^^", "^^=", "{", "|", "|=", "||", "||=", "~", "break", "case", "continue", "delete", "do", "else", "finally", "instanceof", "return", "throw", "try", "typeof"]; var pattern = '(?:' + '(?:(?:^|[^0-9.])\\.{1,3})|' + '(?:(?:^|[^\\+])\\+)|' + '(?:(?:^|[^\\-])-)'; for (var i = 0; i < preceders.length; ++i) { var preceder = preceders[i]; if (isWordChar(preceder.charAt(0))) { pattern += '|\\b' + preceder; } else { pattern += '|' + preceder.replace(/([^=<>:&])/g, '\\$1'); } } pattern += '|^)\\s*$'; return new RegExp(pattern); } (); var pr_amp = /&/g; var pr_lt = //g; var pr_quot = /\"/g; function attribToHtml(str) { return str.replace(pr_amp, '&').replace(pr_lt, '<').replace(pr_gt, '>').replace(pr_quot, '"'); } function textToHtml(str) { return str.replace(pr_amp, '&').replace(pr_lt, '<').replace(pr_gt, '>'); } var pr_ltEnt = /</g; var pr_gtEnt = />/g; var pr_aposEnt = /'/g; var pr_quotEnt = /"/g; var pr_ampEnt = /&/g; var pr_nbspEnt = / /g; function htmlToText(html) { var pos = html.indexOf('&'); if (pos < 0) { return html; } for (--pos; (pos = html.indexOf('&#', pos + 1)) >= 0; ) { var end = html.indexOf(';', pos); if (end >= 0) { var num = html.substring(pos + 3, end); var radix = 10; if (num && num.charAt(0) === 'x') { num = num.substring(1); radix = 16; } var codePoint = parseInt(num, radix); if (!isNaN(codePoint)) { html = (html.substring(0, pos) + String.fromCharCode(codePoint) + html.substring(end + 1)); } } } return html.replace(pr_ltEnt, '<').replace(pr_gtEnt, '>').replace(pr_aposEnt, "'").replace(pr_quotEnt, '"').replace(pr_ampEnt, '&').replace(pr_nbspEnt, ' '); } function isRawContent(node) { return 'XMP' === node.tagName; } function normalizedHtml(node, out) { switch (node.nodeType) { case 1: var name = node.tagName.toLowerCase(); out.push('<', name); for (var i = 0; i < node.attributes.length; ++i) { var attr = node.attributes[i]; if (!attr.specified) { continue; } out.push(' '); normalizedHtml(attr, out); } out.push('>'); for (var child = node.firstChild; child; child = child.nextSibling) { normalizedHtml(child, out); } if (node.firstChild || !/^(?:br|link|img)$/.test(name)) { out.push('<\/', name, '>'); } break; case 2: out.push(node.name.toLowerCase(), '="', attribToHtml(node.value), '"'); break; case 3: case 4: out.push(textToHtml(node.nodeValue)); break; } } var PR_innerHtmlWorks = null; function getInnerHtml(node) { if (null === PR_innerHtmlWorks) { var testNode = document.createElement('PRE'); testNode.appendChild(document.createTextNode('\n')); PR_innerHtmlWorks = !/= 0; nSpaces -= SPACES.length) { out.push(SPACES.substring(0, nSpaces)); } pos = i + 1; break; case '\n': charInLine = 0; break; default: ++charInLine; } } if (!out) { return plainText; } out.push(plainText.substring(pos)); return out.join(''); }; } var pr_chunkPattern = /(?:[^<]+|||<\/?[a-zA-Z][^>]*>|<)/g; var pr_commentPrefix = /^|$)/, null], [PR_SOURCE, /^<\?[\s\S]*?(?:\?>|$)/, null], [PR_SOURCE, /^<%[\s\S]*?(?:%>|$)/, null], [PR_SOURCE, /^<(script|style|xmp)\b[^>]*>[\s\S]*?<\/\1\b[^>]*>/i, null], [PR_TAG, /^<\/?\w[^<>]*>/, null]]); var PR_SOURCE_CHUNK_PARTS = /^(<[^>]*>)([\s\S]*)(<\/[^>]*>)$/; function tokenizeMarkup(source) { var decorations = PR_MARKUP_LEXER(source); for (var i = 0; i < decorations.length; i += 2) { if (decorations[i + 1] === PR_SOURCE) { var start, end; start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; var sourceChunk = source.substring(start, end); var match = sourceChunk.match(PR_SOURCE_CHUNK_PARTS); if (match) { decorations.splice(i, 2, start, PR_TAG, start + match[1].length, PR_SOURCE, start + match[1].length + (match[2] || '').length, PR_TAG); } } } return decorations; } var PR_TAG_LEXER = createSimpleLexer([[PR_ATTRIB_VALUE, /^\'[^\']*(?:\'|$)/, null, "'"], [PR_ATTRIB_VALUE, /^\"[^\"]*(?:\"|$)/, null, '"'], [PR_PUNCTUATION, /^[<>\/=]+/, null, '<>/=']], [[PR_TAG, /^[\w:\-]+/, /^= 2 && /^[\"\']/.test(attribValue) && attribValue.charAt(0) === attribValue.charAt(attribLen - 1)); var attribSource; var attribSourceStart; var attribSourceEnd; if (quoted) { attribSourceStart = start + 1; attribSourceEnd = end - 1; attribSource = attribValue; } else { attribSourceStart = start + 1; attribSourceEnd = end - 1; attribSource = attribValue.substring(1, attribValue.length - 1); } var attribSourceDecorations = decorateSource(attribSource); for (var j = 0, m = attribSourceDecorations.length; j < m; j += 2) { attribSourceDecorations[j] += attribSourceStart; } if (quoted) { attribSourceDecorations.push(attribSourceEnd, PR_ATTRIB_VALUE); spliceArrayInto(attribSourceDecorations, decorations, i + 2, 0); } else { spliceArrayInto(attribSourceDecorations, decorations, i, 2); } } nextValueIsSource = false; } } return decorations; } function decorateMarkup(sourceCode) { var decorations = tokenizeMarkup(sourceCode); decorations = splitTagAttributes(sourceCode, decorations); decorations = splitSourceNodes(sourceCode, decorations); decorations = splitSourceAttributes(sourceCode, decorations); return decorations; } function recombineTagsAndDecorations(sourceText, extractedTags, decorations) { var html = []; var outputIdx = 0; var openDecoration = null; var currentDecoration = null; var tagPos = 0; var decPos = 0; var tabExpander = makeTabExpander(PR_TAB_WIDTH); var adjacentSpaceRe = /([\r\n ]) /g; var startOrSpaceRe = /(^| ) /gm; var newlineRe = /\r\n?|\n/g; var trailingSpaceRe = /[ \r\n]$/; var lastWasSpace = true; function emitTextUpTo(sourceIdx) { if (sourceIdx > outputIdx) { if (openDecoration && openDecoration !== currentDecoration) { html.push(''); openDecoration = null; } if (!openDecoration && currentDecoration) { openDecoration = currentDecoration; html.push(''); } var htmlChunk = textToHtml(tabExpander(sourceText.substring(outputIdx, sourceIdx))).replace(lastWasSpace ? startOrSpaceRe : adjacentSpaceRe, '$1 '); lastWasSpace = trailingSpaceRe.test(htmlChunk); html.push(htmlChunk.replace(newlineRe, '
    ')); outputIdx = sourceIdx; } } while (true) { var outputTag; if (tagPos < extractedTags.length) { if (decPos < decorations.length) { outputTag = extractedTags[tagPos] <= decorations[decPos]; } else { outputTag = true; } } else { outputTag = false; } if (outputTag) { emitTextUpTo(extractedTags[tagPos]); if (openDecoration) { html.push('
    '); openDecoration = null; } html.push(extractedTags[tagPos + 1]); tagPos += 2; } else if (decPos < decorations.length) { emitTextUpTo(decorations[decPos]); currentDecoration = decorations[decPos + 1]; decPos += 2; } else { break; } } emitTextUpTo(sourceText.length); if (openDecoration) { html.push(''); } return html.join(''); } var langHandlerRegistry = {}; function registerLangHandler(handler, fileExtensions) { for (var i = fileExtensions.length; --i >= 0; ) { var ext = fileExtensions[i]; if (!langHandlerRegistry.hasOwnProperty(ext)) { langHandlerRegistry[ext] = handler; } else if ('console' in window) { console.log('cannot override language handler %s', ext); } } } registerLangHandler(decorateSource, ['default-code']); registerLangHandler(decorateMarkup, ['default-markup', 'html', 'htm', 'xhtml', 'xml', 'xsl']); registerLangHandler(sourceDecorator({ keywords: CPP_KEYWORDS, hashComments: true, cStyleComments: true }), ['c', 'cc', 'cpp', 'cs', 'cxx', 'cyc']); registerLangHandler(sourceDecorator({ keywords: JAVA_KEYWORDS, cStyleComments: true }), ['java']); registerLangHandler(sourceDecorator({ keywords: SH_KEYWORDS, hashComments: true, multiLineStrings: true }), ['bsh', 'csh', 'sh']); registerLangHandler(sourceDecorator({ keywords: PYTHON_KEYWORDS, hashComments: true, multiLineStrings: true, tripleQuotedStrings: true }), ['cv', 'py']); registerLangHandler(sourceDecorator({ keywords: PERL_KEYWORDS, hashComments: true, multiLineStrings: true, regexLiterals: true }), ['perl', 'pl', 'pm']); registerLangHandler(sourceDecorator({ keywords: RUBY_KEYWORDS, hashComments: true, multiLineStrings: true, regexLiterals: true }), ['rb']); registerLangHandler(sourceDecorator({ keywords: JSCRIPT_KEYWORDS, cStyleComments: true, regexLiterals: true }), ['js']); function prettyPrintOne(sourceCodeHtml, opt_langExtension) { try { var sourceAndExtractedTags = extractTags(sourceCodeHtml); var source = sourceAndExtractedTags.source; var extractedTags = sourceAndExtractedTags.tags; if (!langHandlerRegistry.hasOwnProperty(opt_langExtension)) { opt_langExtension = /^\s*= 0) { var langExtension = cs.className.match(/\blang-(\w+)\b/); if (langExtension) { langExtension = langExtension[1]; } var nested = false; for (var p = cs.parentNode; p; p = p.parentNode) { if ((p.tagName === 'pre' || p.tagName === 'code' || p.tagName === 'xmp') && p.className && p.className.indexOf('prettyprint') >= 0) { nested = true; break; } } if (!nested) { var content = getInnerHtml(cs); content = content.replace(/(?:\r\n?|\n)$/, ''); var newContent = prettyPrintOne(content, langExtension); if (!isRawContent(cs)) { cs.innerHTML = newContent; } else { var pre = document.createElement('PRE'); for (var i = 0; i < cs.attributes.length; ++i) { var a = cs.attributes[i]; if (a.specified) { var aname = a.name.toLowerCase(); if (aname === 'class') { pre.className = a.value; } else { pre.setAttribute(a.name, a.value); } } } pre.innerHTML = newContent; cs.parentNode.replaceChild(pre, cs); cs = pre; } if (isIE6 && cs.tagName === 'PRE') { var lineBreaks = cs.getElementsByTagName('br'); for (var j = lineBreaks.length; --j >= 0; ) { var lineBreak = lineBreaks[j]; lineBreak.parentNode.replaceChild(document.createTextNode('\r\n'), lineBreak); } } } } } if (k < elements.length) { setTimeout(doWork, 250); } else if (opt_whenDone) { opt_whenDone(); } } doWork(); } window['PR_normalizedHtml'] = normalizedHtml; window['prettyPrintOne'] = prettyPrintOne; window['prettyPrint'] = prettyPrint; window['PR'] = { 'createSimpleLexer': createSimpleLexer, 'registerLangHandler': registerLangHandler, 'sourceDecorator': sourceDecorator, 'PR_ATTRIB_NAME': PR_ATTRIB_NAME, 'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE, 'PR_COMMENT': PR_COMMENT, 'PR_DECLARATION': PR_DECLARATION, 'PR_KEYWORD': PR_KEYWORD, 'PR_LITERAL': PR_LITERAL, 'PR_NOCODE': PR_NOCODE, 'PR_PLAIN': PR_PLAIN, 'PR_PUNCTUATION': PR_PUNCTUATION, 'PR_SOURCE': PR_SOURCE, 'PR_STRING': PR_STRING, 'PR_TAG': PR_TAG, 'PR_TYPE': PR_TYPE }; })(); diff --git a/templates/content/js/com.cnprog.utils.js b/templates/content/js/com.cnprog.utils.js index 683b7a3f..e271ed78 100644 --- a/templates/content/js/com.cnprog.utils.js +++ b/templates/content/js/com.cnprog.utils.js @@ -119,4 +119,4 @@ var CPValidator = function(){ }(); //Search Engine Keyword Highlight with Javascript //http://scott.yang.id.au/code/se-hilite/ -Hilite={elementid:"content",exact:true,max_nodes:1000,onload:true,style_name:"hilite",style_name_suffix:true,debug_referrer:""};Hilite.search_engines=[["local","q"],["cnprog\\.","q"],["google\\.","q"],["search\\.yahoo\\.","p"],["search\\.msn\\.","q"],["search\\.live\\.","query"],["search\\.aol\\.","userQuery"],["ask\\.com","q"],["altavista\\.","q"],["feedster\\.","q"],["search\\.lycos\\.","q"],["alltheweb\\.","q"],["technorati\\.com/search/([^\\?/]+)",1],["dogpile\\.com/info\\.dogpl/search/web/([^\\?/]+)",1,true]];Hilite.decodeReferrer=function(d){var g=null;var e=new RegExp("");for(var c=0;c2&&f[2]){a=decodeURIComponent(a)}a=a.replace(/\'|"/g,"");a=a.split(/[\s,\+\.]+/);return a}break}}return null};Hilite.decodeReferrerQS=function(f,d){var b=f.indexOf("?");var c;if(b>=0){var a=new String(f.substring(b+1));b=0;c=0;while((b>=0)&&((c=a.indexOf("=",b))>=0)){var e,g;e=a.substring(b,c);b=a.indexOf("&",c)+1;if(e==d){if(b<=0){return a.substring(c+1)}else{return a.substring(c+1,b-1)}}else{if(b<=0){return null}}}}return null};Hilite.hiliteElement=function(f,e){if(!e||f.childNodes.length==0){return}var c=new Array();for(var b=0;b0){c++;if(c>=Hilite.max_nodes){var b=function(){Hilite.walkElements(d,f,e)};setTimeout(b,50);return}if(d.nodeType==1){if(!a.test(d.tagName)&&d.childNodes.length>0){d=d.childNodes[0];f++;continue}}else{if(d.nodeType==3){d=e(d)}}if(d.nextSibling){d=d.nextSibling}else{while(f>0){d=d.parentNode;f--;if(d.nextSibling){d=d.nextSibling;break}}}}};if(Hilite.onload){if(window.attachEvent){window.attachEvent("onload",Hilite.hilite)}else{if(window.addEventListener){window.addEventListener("load",Hilite.hilite,false)}else{var __onload=window.onload;window.onload=function(){Hilite.hilite();__onload()}}}}; \ No newline at end of file +Hilite={elementid:"content",exact:true,max_nodes:1000,onload:true,style_name:"hilite",style_name_suffix:true,debug_referrer:""};Hilite.search_engines=[["local","q"],["cnprog\\.","q"],["google\\.","q"],["search\\.yahoo\\.","p"],["search\\.msn\\.","q"],["search\\.live\\.","query"],["search\\.aol\\.","userQuery"],["ask\\.com","q"],["altavista\\.","q"],["feedster\\.","q"],["search\\.lycos\\.","q"],["alltheweb\\.","q"],["technorati\\.com/search/([^\\?/]+)",1],["dogpile\\.com/info\\.dogpl/search/web/([^\\?/]+)",1,true]];Hilite.decodeReferrer=function(d){var g=null;var e=new RegExp("");for(var c=0;c2&&f[2]){a=decodeURIComponent(a)}a=a.replace(/\'|"/g,"");a=a.split(/[\s,\+\.]+/);return a}break}}return null};Hilite.decodeReferrerQS=function(f,d){var b=f.indexOf("?");var c;if(b>=0){var a=new String(f.substring(b+1));b=0;c=0;while((b>=0)&&((c=a.indexOf("=",b))>=0)){var e,g;e=a.substring(b,c);b=a.indexOf("&",c)+1;if(e==d){if(b<=0){return a.substring(c+1)}else{return a.substring(c+1,b-1)}}else{if(b<=0){return null}}}}return null};Hilite.hiliteElement=function(f,e){if(!e||f.childNodes.length==0){return}var c=new Array();for(var b=0;b0){c++;if(c>=Hilite.max_nodes){var b=function(){Hilite.walkElements(d,f,e)};setTimeout(b,50);return}if(d.nodeType==1){if(!a.test(d.tagName)&&d.childNodes.length>0){d=d.childNodes[0];f++;continue}}else{if(d.nodeType==3){d=e(d)}}if(d.nextSibling){d=d.nextSibling}else{while(f>0){d=d.parentNode;f--;if(d.nextSibling){d=d.nextSibling;break}}}}};if(Hilite.onload){if(window.attachEvent){window.attachEvent("onload",Hilite.hilite)}else{if(window.addEventListener){window.addEventListener("load",Hilite.hilite,false)}else{var __onload=window.onload;window.onload=function(){Hilite.hilite();__onload()}}}}; diff --git a/templates/content/style/openid.css b/templates/content/style/openid.css index 7a892840..0d201df2 100644 --- a/templates/content/style/openid.css +++ b/templates/content/style/openid.css @@ -42,4 +42,4 @@ } .openid_selected { border: 4px solid #DDD; - } \ No newline at end of file + } diff --git a/templates/content/style/style.css b/templates/content/style/style.css index 1cd5d438..fa20b014 100644 --- a/templates/content/style/style.css +++ b/templates/content/style/style.css @@ -2,13 +2,15 @@ @import url(/content/style/openid.css); @import url(/content/style/prettify.css); /* 公用 */ -body{background:#FFF; font-size:12px; line-height:150%; margin:0; padding:0; color:#000; font-family: "segoe ui",Helvetica,微软雅黑,宋体,Tahoma,Verdana,MingLiu,PMingLiu,Arial,sans-serif; +body{background:#FFF; font-size:12px; line-height:150%; margin:0; padding:0; color:#000; font-family: sans-serif; } div{margin:0 auto; padding:0;} h1,h2,h3,h4,h5,h6,ul,li,dl,dt,dd,form,img,p{margin:0; padding:0; border:none; } input, select {font-family:Trebuchet MS,"segoe ui",Helvetica,"Microsoft YaHei",宋体,Tahoma,Verdana,MingLiu,PMingLiu,Arial,sans-serif;} -p{margin-bottom:4px; font-size:13px; line-height:160%;} +p{margin-bottom:13px; font-size:13px; line-height:140%;} a {color:#333333; text-decoration:none;} + +.badges a {color:#763333;text-decoration:underline;} a:hover {text-decoration:underline;} .block{width:960px; height:auto;} .fleft{float:left;} @@ -76,45 +78,55 @@ blockquote /*页面布局*/ #wrapper {width:960px;margin:auto;padding:0;} -#roof {margin-top:0px;background:#FFF;} -#room {padding-top:10px;background-color:#FFF;border-bottom:1px solid #777;} -#CALeft{width:700px; float:left; position:relative;padding-left:5px} -#CARight{width:240px; float:right; padding-right:5px} +#roof { + position:relative; + margin-top:0px; + background:#FFF; +} +#room {padding:10px 0 10px 0;background-color:#FFF;border-bottom:1px solid #777;} +#CALeft{width:710px; float:left; position:relative;} +#CARight{width:240px; float:right;} #CAFull{float:left;padding:0 5px 0 5px;width:950px;} -#ground {width:100%;border-top:1px solid #000; padding-top:6px; padding-bottom:10px; text-align:center;background:#777;} -/*#licenseLogo {top:10px;right:10px;}*/ +#ground {width:100%;border-top:1px solid #000; padding-top:6px; padding-bottom:0px; text-align:center;background:#777;} +/*#licenseLogo {position:absolute;top:10px;right:10px;}*/ /*顶部及导航栏*/ -#top {height:20px; text-align:right; padding:3px;background-color:#ffffff;} -#header {width:960px;} +#top { + position:absolute; + top:0px; + right:0px; + height:20px; + text-align:right; + color:black; + padding:3px; + background-color:#ffffff; + width:500px; +} +/*#header {width:960px;}*/ #top a {height:35px; text-align:right; /*letter-spacing:1px; */ margin-left:20px;text-decoration:underline; font-size:12px; color:#333333;} -#logo {padding:5px;} +#logo { + padding: 5px 0px 0px 0px; + margin-bottom:-3px; +} #navBar {float:clear;position:relative;display:block;width:960px;} #navBar .nav {margin:20px 0px 0px 16px; /*letter-spacing:1px; */ } -#navBar .nav a {color:#333; background-color:#F9F7ED; - border-bottom: none; - border-left: 1px solid #aaaaaa; - border-right: 1px solid #aaaaaa; - border-top: 1px solid #aaaaaa; - padding:0px 12px 3px 12px; height:25px; line-height:30px;margin-left:10px; font-size:15px; font-weight:400; text-decoration:none;display: block;float: left;} +#navBar .nav a {color:#333333; background-color:#F9F7ED; + border: 1px solid #aaaaaa; + border-bottom: none; + padding:0px 12px 3px 12px; height:25px; line-height:30px;margin-left:10px; font-size:14px; font-weight:400; text-decoration:none;display: block;float: left;} #navBar .nav a:hover {text-decoration:underline} -#navBar .nav a.on {height:24px;line-height:28px; - border-top:1px solid #e66222; - border-bottom: 1px solid #d64000; - border-right:1px solid #e66222; - border-left:1px solid #e66222; - /*background:#A31E39; */ - background:#d64000; - color:#FFF; font-weight:600; text-decoration:none} +#navBar .nav a.on {height:24px;line-height:28px;border:1px solid #d64000; background:#B02B2C; color:#FFF; font-weight:600; text-decoration:none} #navBar .nav a.special {font-size:15px; color:#B02B2C; font-weight:bold; text-decoration:none; } #navBar .nav a.special:hover {text-decoration:underline;} #navBar .nav div.focus {float:right; padding-right:0px;} /*搜索栏*/ -#searchBar {background-color:#9db2b1;padding:5px;} /* #B02B2C */ +#searchBar { + background-color:#9db2b1;/*#e9b96e;*/ + padding:5px 0 0 0;} /* #B02B2C */ #searchBar .content { } #searchBar .searchInput {font-size:13px; height:18px; width:400px;} #searchBar .searchBtn {font-size:14px; height:26px; width:80px;} @@ -130,9 +142,7 @@ blockquote #listA .qstA thumb {float:left; } #listA .qstA H2 {font-size:15px; font-weight:800; margin:8px auto;padding:0px;} #listA .qstA H2 a {color:#663333; } -#listA .qstA .stat {font-size:13px; - /*letter-spacing:1px;*/ - float:right;} +#listA .qstA .stat {font-size:13px;letter-spacing:1px;float:right;} #listA .qstA .stat span {margin-right:5px;} #listA .qstA .stat td {min-width:40px;text-align:center;} #listA .qstA .stat .num {font-family:arial;color:#905213; font-size:20px; font-weight:800;} @@ -146,8 +156,9 @@ blockquote #listA .qstA .author {font-weight:400; } #listA .qstA .author a{ } #listA .qstA .summary{margin-right:5px;} + .evenMore {font-size:14px; font-weight:800;} -.questions-count{font-size:32px;font-family:arial;font-weight:600;padding:5px;color:#777;} +.questions-count{font-size:32px;font-family:sans-serif;font-weight:600;padding:0 0 5px 7px;color:#a40000;} /*内容块*/ .boxA {background:#777; padding:6px; margin-bottom:8px;} @@ -166,13 +177,13 @@ blockquote /** PAGINATOR **/ .paginator { padding:5px 0 10px 0; - font:normal 12px arial; + font:normal 12px sans-serif; } .paginator .prev-na, .paginator .next-na { padding:.3em; - font:bold .875em arial; + font:bold .875em sans-serif; } .paginator .prev-na, @@ -189,7 +200,7 @@ blockquote background-color:#fff; color:#777; padding:.3em; - font:bold 100% arial; + font:bold 100% sans-serif; } .paginator .prev, .paginator .prev-na { margin-right:.5em; } @@ -224,7 +235,7 @@ blockquote .paginator .text{ color:#777; padding:.3em; - font:bold 100% arial; + font:bold 100% sans-serif; } .paginator-container{ @@ -237,11 +248,14 @@ blockquote } /*标签*/ -.tag {font-size:100%; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} -.tags {font-family:arial; line-height:200%; display:block; margin-top:5px;} -.tags a {font-size:100%; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} +.tag {font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} +.tags {font-family:sans-serif; line-height:200%; display:block; margin-top:5px;} +.tags a {font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} .tags a:hover {background-color:#fFF;color:#333;} -.tag-number {font-weight:700;font-family:arial;} +.tagsbox {line-height:200%;} +.tagsbox a {font-size:13px; font-weight:normal; color:#333; text-decoration:none;background-color:#EEE; border-left:3px solid #777; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:1px 8px 1px 8px;} +.tagsbox a:hover {background-color:#fFF;color:#333;} +.tag-number {font-weight:700;font-family:sans-serif;} /*奖牌*/ a.medal { font-size:14px; line-height:250%; font-weight:800; color:#333; text-decoration:none; background:url(/content/images/medala.gif) no-repeat; border-left:1px solid #EEE; border-top:1px solid #EEE; border-bottom:1px solid #CCC; border-right:1px solid #CCC; padding:4px 12px 4px 6px;} @@ -291,9 +305,7 @@ a:hover.medal {color:#333; text-decoration:none; background:url(/content/images .headMedals {float:left; height:23px; line-height:23px; margin:5px 0 0 5px;padding:0px 6px 0px 15px; font-size:15px; font-weight:700; border-bottom:0px solid #777; border-left:0px solid #darkred; background-color:#FFF;background:url(/content/images/dot-list.gif) no-repeat left center;} .headLogin {float:left; padding:3px; font-size:15px; font-weight:800; background:url(/content/images/ico_login.gif) no-repeat; padding-left:24px;} .headNormal {text-align:left;padding:3px; font-size:15px; margin-bottom:12px; font-weight:800;border-bottom:1px solid #777;} -.headUser {text-align:left;padding:5px; font-size:20px; - /*letter-spacing:1px;*/ - margin-bottom:12px; font-weight:800;border-bottom:1px solid #777;} +.headUser {text-align:left;padding:5px; font-size:20px; letter-spacing:1px;margin-bottom:12px; font-weight:800;border-bottom:1px solid #777;} /*RSS订阅*/ #feeds {margin:10px 0; } #feeds a {background:url(/content/images/feed-icon-small.png) no-repeat 0; padding-left:18px; font-weight:700; font-size:13px; } @@ -322,7 +334,11 @@ a:hover.medal {color:#333; text-decoration:none; background:url(/content/images max-width:600px; } .question-mark{ - background-color:#E9E9FF; + /*background-color:#fff5e0; + border-top: 1px solid #eeeeec; + border-right: 1px solid #babdb6; + border-bottom: 1px solid #babdb6; + border-left: 1px solid #eeeeec;*/ text-align:left; padding:5px; overflow:hidden; @@ -411,6 +427,7 @@ div.comments { div.post-comments{ width:100%; + margin-bottom:10px; } form.post-comments textarea { @@ -433,6 +450,9 @@ span.form-error { font-weight:normal; margin-left:5px; } +p.form-item { + margin:0px; +} div.comments-container, div.comments-container-accepted, div.comments-container-owner, div.comments-container-deleted { display:none; @@ -473,11 +493,8 @@ a.comment-user:hover { /*回答*/ #answers {} .answer{ - border-bottom:1px dotted #666666; - padding-bottom:20px; - padding-top:20px; + padding-top:10px; width: 100%; - margin-bottom:10px; } .answer-body{ min-height:80px; @@ -511,7 +528,7 @@ a.comment-user:hover { .answered-accepted { background: #CCC; - color: #663333; + color: #763333; } .unanswered @@ -547,10 +564,11 @@ a.comment-user:hover { } /*标签列表*/ +/* .tagsbox {} -.tagsbox a {color:#000;line-height:30px;margin-right:10px;font-size:100%;background-color:#F9F7ED;padding:3px;} -.tagsbox a:hover {text-decoration:none;background-color:#F9F7CD;color:#B02B2C;} -.tagsList {margin:0; list-style-type:none;padding:0px;min-height:360px;} +.tagsbox a {color:#000;line-height:30px;margin-right:10px;font-size:100%;background-color:#F9F7ED;padding:3px;border:1px solid #aaaaaa;} +.tagsbox a:hover {text-decoration:none;background-color:#F9F7ED;color:#B02B2C;} */ +.tagsList {margin:0; list-style-type:none;padding:0px;min-height:360px;} .tagsList li {width:235px; float:left;} .badge-list{margin:0; list-style-type:none;} /*登录*/ @@ -563,7 +581,12 @@ a.comment-user:hover { .error{color:red;} .error-list li{padding:5px;} .login{margin-bottom:10px;} -.fieldset{border:solid 1px #777;margin-top:10px;padding:10px;} +.fieldset{ +/* border:solid 1px #777;*/ + border: none; + margin-top:10px; + padding:10px; +} .openid-input{background:url(/content/images/openid.gif) no-repeat;padding-left:15px;cursor:pointer;} .openid-login-input{ background-position:center left; @@ -701,7 +724,7 @@ span.form-error { .revision-number{ font-size:300%; font-weight:bold; - font-family:arial; + font-family:sans-serif; } .revision .body{ @@ -913,7 +936,7 @@ div.started .reputation-score { padding:3px; font-weight:bold; background-color:#CCC; - color:#663333; + color:#763333; } .revision-summary{ @@ -992,8 +1015,21 @@ ul.bulleta li {background:url(/content/images/bullet_green.gif) no-repeat 0px 2p .user ul {margin:0; list-style-type:none;} .user .thumb{clear:both;float:left; margin-right:4px; display:inline;} .yellowbg{background:yellow;} -.subtitle{line-height:30px;font-size:15px; font-weight:700;} -.message{padding:5px;font-weight:bold;background-color:#eee;margin:10px 0 10px 0;} + +.message{ + padding:5px; + margin:10px 0 10px 0; + background-color:#eee; + border: 1px solid #aaaaaa; +} +.message h1 { + padding-top:0px; + font-size:15px; +} +.message p { + margin-bottom:0px; +} + .warning{color:red;} .darkred{color:darkred;} .submit{ @@ -1015,30 +1051,68 @@ ul.bulleta li {background:url(/content/images/bullet_green.gif) no-repeat 0px 2p left: 0px; width: 100%; z-index: 100; - padding: 7px 0 5px 0; + padding: 0; text-align: center; - font-size: 130%; font-weight: Bold; color: #444; background-color: #F4A83D; } - -.notify span -{ - float: left; - width: 95%; - text-align: center; +.notify p { + margin-top:5px; + margin-bottom:5px; + font-size:16px; } - -.close-notify +#close-notify { - float: right; - margin-right: 20px; + position:absolute; + right:5px; + top:5px; + padding:0 3px 0 3px; color: #735005; text-decoration: none; + font-size:14px; + line-height:18px; background-color: #FAD163; border: 2px #735005 solid; - padding-left: 3px; - padding-right: 3px; cursor:pointer; } +#close-notify:hover { + text-decoration:none; +} + +.big { + font-size:15px; +} +.bigger { + font-size:14px; +} +.strong { + font-weight:bold; +} +.orange +{ + color:#d64000; + font-weight:bold; +} + +.about div { + padding:10px 5px 10px 5px; + border-top:1px dashed #aaaaaa; +} +.about div.first { + padding-top:0; + border-top:none; +} +.about p { + margin-bottom:10px; +} +.about a {color:#d64000;text-decoration:underline;} +.about h3{ + line-height:30px; + font-size:15px; + font-weight:700; + padding-top: 0px; +} +.highlight { + background-color:#FFF8C6; +} diff --git a/templates/faq.html b/templates/faq.html index 253d3590..78c433ae 100644 --- a/templates/faq.html +++ b/templates/faq.html @@ -10,104 +10,139 @@
    {% trans "Frequently Asked Questions " %}(FAQ)
    -
    - -

    {% trans "What kinds of questions can I ask here?" %}

    -

    {% trans "Most importanly - questions should be relevant to this community." %}
    - {% trans "Before asking the question - please make sure to use search to see whether your question has alredy been answered."%}
    -


    - -

    {% trans "What questions should I avoid asking?" %}

    -

    {% trans "Please avoid asking questions that are not relevant to this community, too subjective and argumentative." %}

    -


    - -

    {% trans "What should I avoid in my answers?" %}

    -

    {% trans "site title" %} {% trans "is a Q&A site, not a discussion group. Therefore - please avoid having discussions in your answers, comment facility allows some space for brief discussions." %} -


    +
    + +
    +

    {% trans "What kinds of questions can I ask here?" %}

    +

    {% trans "Most importanly - questions should be relevant to this community." %} + {% trans "Before asking the question - please make sure to use search to see whether your question has alredy been answered."%} +

    + +

    {% trans "What questions should I avoid asking?" %}

    +

    {% trans "Please avoid asking questions that are not relevant to this community, too subjective and argumentative." %}

    +

    +
    -

    {% trans "Who moderates this community?" %}

    -

    {% trans "The short answer is: you." %}
    - {% trans "This website is moderated by the users." %} - {% trans "The reputation system allows users earn the authorization to perform a variety of moderation tasks." %} -


    +
    +

    {% trans "What should I avoid in my answers?" %}

    +

    {% trans "site title" %} {% trans "is a Q&A site, not a discussion group. Therefore - please avoid having discussions in your answers, comment facility allows some space for brief discussions." %}

    +
    -

    {% trans "How does reputation system work?" %}

    -

    {% trans "Anyone can ask questions and give answers, points are not necessary for that." %}
    - {% trans "As we've said before, users help running this site. Point system helps select users who can administer this community."%} - {% trans "Reputation points roughly measure how community trusts you. These points are given to you directly by other members of the community." %} -

    -

    - {% trans "For example, if you ask an interesting question or give a helpful answer, your input will be upvoted and you will gain more trust in the community." %} - {% trans "If on the other hand someone gives a misleading answer, the answer will be voted down and he/she loses some points." %} - {% trans "Each vote in favor will generate 10 points, each vote against will subtract 2 points." %} - {% trans "Through the votes of other people you can accumulate a maximum of 200 points." %} - {% trans "After accumulating certain number of points, you can do more:" %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    +

    {% trans "Who moderates this community?" %}

    +

    {% trans "The short answer is: you." %} + {% trans "This website is moderated by the users." %} + {% trans "The reputation system allows users earn the authorization to perform a variety of moderation tasks." %} +

    +
    + +
    +

    {% trans "How does reputation system work?" %}

    +

    {% trans "Rep system summary" %}

    +

    + For example, if you ask an interesting question or give a helpful answer, your input will be upvoted. + On the other hand if the answer is misleading - it will be downvoted. + Each vote in favor will generate 10 points, each vote against will subtract 2 points. + There is a limit of 200 points that can be accumulated per question or answer. + + The table below explains reputation point requirements for each type of moderation task. +

    + +
    15{% trans "upvote" %}
    15{% trans "use tags" %}
    50{% trans "add comments" %}
    100{% trans "downvote" %}
    250打开关闭自己的问题
    500{% trans "retag questions" %}
    750{% trans "edit community wiki questions" %}
    2000{% trans "edit any answer" %}
    3000{% trans "open any closed question" %}
    5000{% trans "delete any comment" %}
    10000{% trans "delete any questions and answers and perform other moderation tasks" %}
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
    50{% trans "add comments" %}
    100{% trans "downvote" %}
    250{% trans "open and close own questions" %}
    500{% trans "retag questions" %}
    750{% trans "edit community wiki questions" %}
    2000{% trans "edit any answer" %}
    3000{% trans "open any closed question" %}
    5000{% trans "delete any comment" %}
    10000{% trans "delete any questions and answers and perform other moderation tasks" %}
    - -


    - -

    {% trans "To register, do I need to create new password?" %}

    -

    {% trans "No, you don't have to. You can login through any service that supports OpenID, e.g. Google, Yahoo, AOL, etc." %} - {% trans "Login now!" %} » -


    + +
    + {% ifequal settings.EMAIL_VALIDATION 'on' %} +
    +

    {% trans "how to validate email title" %}

    + + {% trans "how to validate email info" %} +
    + {% endifequal %} +
    +

    {% trans "what is gravatar" %}

    +

    {% trans "gravatar faq info" %}

    +
    +
    +

    {% trans "To register, do I need to create new password?" %}

    +

    {% trans "No, you don't have to. You can login through any service that supports OpenID, e.g. Google, Yahoo, AOL, etc." %} + {% trans "Login now!" %} » +

    +
    -

    {% trans "Why other people can edit my questions/answers?" %}

    -

    {% trans "Goal of this site is..." %} {% trans "So questions and answers can be edited like wiki pages by experienced users of this site and this improves the overall quality of the knowledge base content." %} - {% trans "If this approach is not for you, we respect your choice." %} -


    -

    {% trans "Still have questions?" %}

    -

    {% trans "Please ask your question, help make our community better!" %} {% trans "site title" %} {% trans "questions" %}{% trans "." %} -

    -

    +
    +

    {% trans "Why other people can edit my questions/answers?" %}

    +

    {% trans "Goal of this site is..." %} {% trans "So questions and answers can be edited like wiki pages by experienced users of this site and this improves the overall quality of the knowledge base content." %} + {% trans "If this approach is not for you, we respect your choice." %} +

    +
    +
    +

    {% trans "Still have questions?" %}

    +

    {% trans "Please ask your question, help make our community better!" %} + +

    +
    + {% endblock %} diff --git a/templates/footer.html b/templates/footer.html index 207104ce..637ca0d8 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -26,7 +26,7 @@ diff --git a/templates/header.html b/templates/header.html index 64cf2bf0..db08a39a 100644 --- a/templates/header.html +++ b/templates/header.html @@ -1,30 +1,29 @@ {% load extra_tags %} {% load i18n %} -
    - -
    diff --git a/templates/user_votes.html b/templates/user_votes.html index ec967704..80fa27ee 100644 --- a/templates/user_votes.html +++ b/templates/user_votes.html @@ -1,5 +1,5 @@ - {% extends "user.html" %} + {% load extra_tags %} {% load humanize %} {% load i18n %} -- cgit v1.2.3-1-g7c22