summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/404.html2
-rw-r--r--templates/500.html4
-rw-r--r--templates/about.html68
-rw-r--r--templates/answer_edit.html2
-rw-r--r--templates/answer_edit_tips.html87
-rw-r--r--templates/ask.html52
-rw-r--r--templates/authopenid/changeemail.html100
-rw-r--r--templates/authopenid/changeopenid.html2
-rw-r--r--templates/authopenid/changepw.html2
-rw-r--r--templates/authopenid/complete.html17
-rw-r--r--templates/authopenid/confirm_email.txt17
-rw-r--r--templates/authopenid/delete.html2
-rw-r--r--templates/authopenid/email_validation.txt15
-rw-r--r--templates/authopenid/failure.html3
-rw-r--r--templates/authopenid/sendpw.html2
-rw-r--r--templates/authopenid/sendpw_email.txt18
-rw-r--r--templates/authopenid/settings.html2
-rw-r--r--templates/authopenid/signin.html122
-rw-r--r--templates/authopenid/signup.html3
-rw-r--r--templates/badge.html2
-rw-r--r--templates/badges.html14
-rw-r--r--templates/base.html29
-rw-r--r--templates/base_content.html27
-rw-r--r--templates/book.html2
-rw-r--r--templates/close.html2
-rw-r--r--templates/content/jquery-openid/images/aol.gifbin0 -> 2205 bytes
-rw-r--r--templates/content/jquery-openid/images/blogger.icobin0 -> 3638 bytes
-rw-r--r--templates/content/jquery-openid/images/claimid.icobin0 -> 3638 bytes
-rw-r--r--templates/content/jquery-openid/images/facebook.gifbin0 -> 2075 bytes
-rw-r--r--templates/content/jquery-openid/images/flickr.icobin0 -> 1150 bytes
-rw-r--r--templates/content/jquery-openid/images/google.gifbin0 -> 1596 bytes
-rw-r--r--templates/content/jquery-openid/images/livejournal.icobin0 -> 5222 bytes
-rw-r--r--templates/content/jquery-openid/images/myopenid.icobin0 -> 2862 bytes
-rw-r--r--templates/content/jquery-openid/images/openid-inputicon.gifbin0 -> 237 bytes
-rw-r--r--templates/content/jquery-openid/images/openid.gifbin0 -> 740 bytes
-rw-r--r--templates/content/jquery-openid/images/openidico.pngbin0 -> 654 bytes
-rw-r--r--templates/content/jquery-openid/images/technorati.icobin0 -> 2294 bytes
-rw-r--r--templates/content/jquery-openid/images/verisign.icobin0 -> 4710 bytes
-rw-r--r--templates/content/jquery-openid/images/vidoop.icobin0 -> 1406 bytes
-rw-r--r--templates/content/jquery-openid/images/wordpress.icobin0 -> 1150 bytes
-rw-r--r--templates/content/jquery-openid/images/yahoo.gifbin0 -> 1682 bytes
-rw-r--r--templates/content/jquery-openid/jquery.openid.js92
-rw-r--r--templates/content/jquery-openid/openid.css33
-rw-r--r--templates/content/js/com.cnprog.editor.js134
-rw-r--r--templates/content/js/com.cnprog.i18n.js8
-rw-r--r--templates/content/js/com.cnprog.post.js1247
-rw-r--r--templates/content/js/com.cnprog.utils.js2
-rw-r--r--templates/content/js/jquery.ajaxfileupload.js390
-rw-r--r--templates/content/style/default.css12
-rw-r--r--templates/content/style/openid.css2
-rw-r--r--templates/content/style/style.css2116
-rw-r--r--templates/faq.html230
-rw-r--r--templates/footer.html61
-rw-r--r--templates/header.html140
-rw-r--r--templates/index.html10
-rw-r--r--templates/logout.html4
-rw-r--r--templates/pagesize.html4
-rw-r--r--templates/paginator.html14
-rw-r--r--templates/privacy.html2
-rw-r--r--templates/question.html21
-rw-r--r--templates/question_edit.html2
-rw-r--r--templates/question_retag.html25
-rw-r--r--templates/questions.html88
-rw-r--r--templates/reopen.html5
-rw-r--r--templates/revisions_answer.html2
-rw-r--r--templates/revisions_question.html3
-rw-r--r--templates/tags.html1
-rw-r--r--templates/unanswered.html2
-rwxr-xr-xtemplates/upfiles/1245715031297631.pngbin0 -> 3863 bytes
-rwxr-xr-xtemplates/upfiles/12457157052552259.pngbin0 -> 3863 bytes
-rw-r--r--templates/user.html64
-rw-r--r--templates/user_edit.html2
-rw-r--r--templates/user_favorites.html2
-rw-r--r--templates/user_info.html2
-rw-r--r--templates/user_preferences.html15
-rw-r--r--templates/user_recent.html2
-rw-r--r--templates/user_reputation.html2
-rw-r--r--templates/user_responses.html2
-rw-r--r--templates/user_stats.html2
-rw-r--r--templates/user_tabs.html2
-rw-r--r--templates/user_votes.html2
-rw-r--r--templates/users.html1
82 files changed, 2893 insertions, 2451 deletions
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 @@
-<!-- template 404.html -->
{% extends "base_content.html" %}
+<!-- template 404.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 @@
-<!-- template 500.html -->
{% extends "base_content.html" %}
+<!-- template 500.html -->
{% load i18n %}
{% block title %}{% spaceless %}500 Error{% endspaceless %}{% endblock %}
{% block forejs %}
@@ -19,7 +19,7 @@
</div>
<div id="main-body" class="headNormal">
<div style="padding:5px 0px 10px 0;line-height:25px">
- <h3>{% trans "sorry, system error"</h3>
+ <h3>{% trans "sorry, system error" %}</h3>
<br>
{% trans "system error log is recorded, error will be fixed as soon as possible" %}<br>
{% trans "please report the error to the site administrators if you wish" %}
diff --git a/templates/about.html b/templates/about.html
index 6638060e..eaf0d591 100644
--- a/templates/about.html
+++ b/templates/about.html
@@ -1,71 +1,21 @@
{% extends "base_content.html" %}
+<!-- template about.html -->
+{% load i18n %}
{% load extra_tags %}
{% load humanize %}
-{% block title %}{% spaceless %}关于本站{% endspaceless %}{% endblock %}
+{% block title %}{% spaceless %}{% trans "About" %}{% endspaceless %}{% endblock %}
{% block forejs %}
{% endblock %}
{% block content %}
<div class="headNormal">
-关于本站
+{% trans "About" %}
</div>
<div class="content">
- <p>
- CNProg 是<strong>一个面向中国程序员的免费技术问答社区</strong>。它是一个介于论坛、博客、维基和Digg之间的社区系统,基于Python和Django开发。<br>
- 创办CNProg的灵感来自于国外知名QA社区<a href="http://www.stackoverflow.com">StackOverflow</a>,但是CNProg不仅仅是一个汉化版的SO。<br>
- 我们通过开源社区来维护和更新源代码,你可以访问<strong><a href="http://code.google.com/p/cnprog/">这里</a></strong>获取本站的所有源代码(请注意源代码使用的授权许可)。<br>
- </p>
- <br>
- <p>
- <strong>我们不运作社区,由你来运作。</strong>CNProg 是<strong><a href="http://blog.cnprog.com/2009/01/%e7%94%a8%e6%88%b7%e9%a9%b1%e5%8a%a8%e7%9a%84%e6%8a%80%e6%9c%af%e7%a4%be%e5%8c%ba/">一个由用户来驱动的社区</a></strong>。每个用户不仅是管理员,也是社区功能需求的提出者。<br>
- 社区内容是协作的,系统越信任你,你就在社区获得更多的管理权限,可以开始编辑问题或回答,
- 帮助我们组织问题和答案,帮助需要帮助的广大程序员用户。<br>
- 透明、开放、全民管理的运作模式是本网站的特点,我们希望通过CNProg让用户能够更加容易地寻求帮助,找到问题答案,解决实际的技术问题。
- </p>
- <p>
- 我们关注国内程序员的成长!
- </p>
-
- <br>
- <h3 class="subtitle">你们是谁?</h3>
- <p>
- 我们是一群奋斗在互联网的编程爱好者,和你一样,也是希望自己编写高质量软件的开发人员。
- 我们的团队:
- </p>
- <table cellspacing="5" cellpadding="3">
- <tr>
- <td width="150px"><img src="/content/images/nophoto.png"></td>
- <td width="150px"><img src="/content/images/nophoto.png"></td>
- <td width="150px"><img src="/content/images/nophoto.png"></td>
- <td width="150px"></td>
- </tr>
- <tr>
- <td> </td>
- <td> </td>
- <td> </td>
- <td><a ></a></td>
- </tr>
- <tr>
- <td colspan="4" height="5"></td>
- </tr>
- <tr>
- <td width="150px"><img src="/content/images/nophoto.png"></td>
- <td width="150px"><img src="/content/images/nophoto.png"></td>
- <td width="150px"></td>
- <td width="150px"></td>
- </tr>
- <tr>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- </table>
- <p>
- 欢迎访问我们的<strong><a href="http://blog.cnprog.com">团队Blog</a></strong>或查看更多介绍的<a href="/faq" class="big">CNProg FAQ</a>。
- </p>
+ <p>edit file templates/about.html. Below are just suggestions of what can go here</p>
+ <p>what is your site for?</p>
+ <p>how does it work? what are roles of members?</p>
+ <p>is there a place to find out more about this website?</p>
</div>
{% endblock %}
-
-
-
+<!-- end template about.html -->
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 @@
-<!-- template answer_edit.html -->
{% extends "base.html" %}
+<!-- template answer_edit.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 3ab63f70..31f71e34 100644
--- a/templates/answer_edit_tips.html
+++ b/templates/answer_edit_tips.html
@@ -1,54 +1,53 @@
-<!-- template answer_edit_tips.html -->
-{% load i18n %}
-<div class="boxC">
- <p class="subtitle darkred">{% trans "answer tips" %}</p>
- <div>
- <ul class="list-item">
- <li> <b>{% trans "please make your answer relevant to this community" %}</b>
- </li>
- <li>
- {% trans "try to give an answer, rather than engage into a discussion" %}
- </li>
- <li>
- {% trans "please try to provide details" %}
- </li>
- <li>
-{% trans "be clear and concise" %}
- </li>
- </ul>
- <a href="/faq/" target="_blank" title="{% trans "see frequently asked questions" %}" style="float:right;position:relative">faq »</a>
- <br>
- </div>
-</div>
-
-<div class="boxC">
- <p class="subtitle">{% trans "Markdown tips" %}</p>
- <ul class="list-item">
- <li>
- {% trans "*italic* or __italic__" %}
- </li>
- <li>
-{% trans "**bold** or __bold__" %}
- </li>
- <li>
- <b>{% trans "link" %}</b>:[{% trans "text" %}](http://url.com/ "{% trans "title" %}")
-
- </li>
-
+<!-- template answer_edit_tips.html -->
+{% load i18n %}
+<div class="boxC">
+ <p class="subtitle darkred">{% trans "answer tips" %}</p>
+ <div>
+ <ul class="list-item">
+ <li> <b>{% trans "please make your answer relevant to this community" %}</b>
+ </li>
+ <li>
+ {% trans "try to give an answer, rather than engage into a discussion" %}
+ </li>
+ <li>
+ {% trans "please try to provide details" %}
+ </li>
+ <li>
+ {% trans "be clear and concise" %}
+ </li>
+ </ul>
+ <a href="/faq/" target="_blank" title="{% trans "see frequently asked questions" %}" style="float:right;position:relative">faq »</a>
+ <br>
+ </div>
+</div>
+
+<div class="boxC">
+ <p class="subtitle">{% trans "Markdown tips" %}</p>
+ <ul class="list-item">
+ <li>
+ {% trans "*italic* or __italic__" %}
+ </li>
+ <li>
+ {% trans "**bold** or __bold__" %}
+ </li>
+ <li>
+ <b>{% trans "link" %}</b>:[{% trans "text" %}](http://url.com/ "{% trans "title" %}")
+
+ </li>
<li>
- <b>{% trans "image" %}</b>:![alt {% trans "text" %}](/path/img.jpg "{% trans "title" %}")
+ <b>{% trans "image" %}</b>:![alt {% trans "text" %}](/path/img.jpg "{% trans "title" %}")
</li>
<li>
-{% trans "numbered list:" %}
- 1. Foo
- 2. Bar
+ {% trans "numbered list:" %}
+ 1. Foo
+ 2. Bar
</li>
<li>
-{% trans "basic HTML tags are also supported" %}
+ {% trans "basic HTML tags are also supported" %}
</li>
</ul>
<a href="http://en.wikipedia.org/wiki/Markdown" target="_blank" style="float:right;position:relative">{% trans "learn more about Markdown" %} »</a>
- <br>
+ <br>
</div>
-<!-- end template answer_edit_tips.html --> \ No newline at end of file
+<!-- end template answer_edit_tips.html -->
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 @@
-<!-- template ask.html -->
{% extends "base.html" %}
+<!-- template ask.html -->
{% load i18n %}
{% block title %}{% spaceless %}{% trans "Ask a question" %}{% endspaceless %}{% endblock %}
{% block forejs %}
@@ -62,6 +62,19 @@
<div id="main-body" class="ask-body">
<div id="askform">
<form id="fmask" action="" method="post" >
+ {% if not request.user.is_authenticated %}
+ <div class="message">
+ <p>{% trans "login to post question info" %}</p>
+ </div>
+ {% else %}
+ {% ifequal settings.EMAIL_VALIDATION 'on' %}
+ {% if not request.user.email_isvalid %}
+ <div class="message">
+ {% blocktrans with request.user.email as email %}must have valid {{email}} to post{% endblocktrans %}
+ </div>
+ {% endif %}
+ {% endifequal %}
+ {% endif %}
<p class="form-item">
<label for="id_title" ><strong>{{ form.title.label_tag }}:</strong></label> <span class="form-error"></span><br>
{{ form.title }} {{ form.title.errors }}
@@ -92,40 +105,17 @@
<br>
</p>
<p class="form-item">
- <strong>{{ form.tags.label_tag }}:</strong> <span class="form-error"></span><br>
+ <strong>{{ form.tags.label_tag }}:</strong> {% trans "(required)" %} <span class="form-error"></span><br>
{{ form.tags }} {{ form.tags.errors }}
- <div class="title-desc">
- {{ form.tags.help_text }}
- </div>
</p>
- <br>
+ <p class="title-desc">
+ {{ form.tags.help_text }}
+ </p>
{% if not request.user.is_authenticated %}
- <table id="login-box">
- <tr>
- <td style="vertical-align:middle;">
- <strong>{% trans "Use" %} <a href="http://openid.net/" title="{% trans "learn more about OpenID" %}">OpenID</a> {% trans "Login" %}:</strong><br>
- {{ form.openid }}
- <div class="title-desc">
- {% trans "Get your own "%} <a href="https://www.myopenid.com/" target=="_blank">OpenID</a>。
- </div>
- </td>
- <td style="vertical-align:middle; padding: 0px 40px 0px 40px">
- <div style="position: absolute; margin-top:40px; background-color:white; margin-left:-10px; padding:5px;">或</div>
- <div style="width:1px; border-left:solid 1px #999; height:8em; margin:auto;"></div>
- </td>
- <td style="vertical-align:middle;">
- <strong>{% trans "User name" %}:</strong><br>
- {{ form.user }}
- <p>
- <strong>{% trans "Email: (won't be shown to anyone)" %}:</strong><br>
- {{ form.email }}
- </p>
- </td>
- </tr>
- </table>
- {% endif %}
+ <input type="submit" value="{% trans "Login/signup to post your question" %}" class="submit" />
+ {% else %}
<input type="submit" value="{% trans "Ask your question" %}" class="submit" />
- <br><br>
+ {% endif %}
</form>
</div>
</div>
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 %}
-<div id="main-bar" class="">
- <h3>
- {% trans "Account: change email" %}
- </h3>
-</div>
-<p class="settings-descr">{% 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 %}</p>
-{% if form.errors %}
-<p class="errors">{% trans "Please correct errors below:" %}<br />
- {% if form.email.errors %}
- <span class="error">{{ form.email.errors|join:", " }}</span>
- {% endif %}
- {% if form.password.errors %}
- <span class="error">{{ form.password.errors|join:", " }}</span>
- {% endif %}
-</p>
-{% endif %}
+<!-- changeemail.html action_type={{action_type}}-->
+{% ifequal action_type "change" %}
+ <div id="main-bar" class="headNormal">
+ {% trans "Change email" %}
+ </div>
+ <p class="message">
+ {% blocktrans %}change {{email}} info{% endblocktrans %}
+ </p>
+ {% if form.errors %}
+ <p class="errors">{% trans "Please correct errors below:" %}<br />
+ {% if form.email.errors %}
+ <span class="error">{{ form.email.errors|join:", " }}</span>
+ {% endif %}
+ {% if form.password.errors %}
+ <span class="error">{{ form.password.errors|join:", " }}</span>
+ {% endif %}
+ </p>
+ {% endif %}
-{% if msg %}
-<p class="errors">{{ msg }}</p>
-{% endif %}
+ {% if msg %}
+ <p class="errors">{{ msg }}</p>
+ {% endif %}
-<div class="aligned">
- <form action="." method="post" accept-charset="utf-8">
+ <div class="aligned">
+ <form action="." method="post" accept-charset="utf-8">
- <div id="form-row"><label for="id_email">{% trans "Email" %}</label>{{ form.email }}</div>
- <div id="form-row"><label for="id_password">{% trans "Password" %}</label>{{ form.password }}</div>
+ <div class="form-row"><label for="id_email">{% trans "Your new Email" %}</label><br>{{ form.email }}</div>
+ <!--<div class="form-row"><label for="id_password">{% trans "Password" %}</label>{{ form.password }}</div>-->
+ <div class="submit-row">
+ <input class="submit" type="submit" name="change_email" value="{% trans "Change email" %}">
+ <input class="submit" type="submit" name="cancel" value="{% trans "Cancel" %}">
+ </div>
- <p><input type="submit" value="{% trans "Change email" %}"></p>
-
- </form>
- </div>
+ </form>
+ </div>
+{% endifequal %}
+{% ifequal action_type "validate" %}
+ <div id="main-bar" class="headNormal">
+ {% trans "Validate email" %}
+ </div>
+ <p class="message">
+ {% blocktrans %}validate {{email}} info{% endblocktrans %}
+ </p>
+{% endifequal %}
+{% ifequal action_type "keep" %}
+ <div id="main-bar" class="headNormal">
+ {% trans "Email not changed" %}
+ </div>
+ <p class="message">
+ {% blocktrans %}old {{email}} kept{% endblocktrans %}
+ </p>
+{% endifequal %}
+{% ifequal action_type "done_novalidate" %}
+ <div id="main-bar" class="headNormal">
+ {% trans "Email changed" %}
+ </div>
+ <p class="message">
+ {% blocktrans %}your current {{email}} can be used for this{% endblocktrans %}
+ </p>
+{% endifequal %}
+{% ifequal action_type "validation_complete" %}
+ <div id="main-bar" class="headNormal">
+ {% trans "Email verified" %}
+ </div>
+ <p class="message">
+ {% trans "thanks for verifying email" %}
+ </p>
+{% endifequal %}
+{% ifequal action_type "key_not_sent" %}
+ <div id="main-bar" class="headNormal">
+ {% trans "email key not sent" %}
+ </div>
+ <p class="message">
+ {% blocktrans %}email key not sent {{email}} change email here {{change_link}}{% endblocktrans %}
+ </p>
+{% endifequal %}
{% endblock %}
+<!-- end changeemail.html -->
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" %}
+<!-- changeopenid.html -->
{% load i18n %}
{% block content %}
@@ -31,3 +32,4 @@
</form>
</div>
{% endblock %}
+<!-- end changeopenid.html -->
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" %}
+<!-- changepw.html -->
{% load i18n %}
{% block head %}
@@ -31,3 +32,4 @@
</form>
</div>
{% endblock %}
+<!-- end changepw.html -->
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" %}
+<!-- complete.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" %}
</div>
<p id="completetxt" >
- <h3>{% trans "Your OpenID is accepted. Please complete this to finish registration." %}</h3>
+ <div class="message">
+ {% blocktrans %}register new {{provider}} account info{% endblocktrans %}
+ </div>
<p style="display:none">{% trans "This account already exists, please use another." %}</p>
</p>
@@ -41,12 +44,9 @@
<div class="login">
<form name="fregister" action="{% url user_register %}" method="POST">
{{ form.next }}
- <fieldset style="padding:10px">
- <legend class="big">{% trans "New account" %}</legend>
- <div class="form-row"><label for="id_username">{% trans "User name (<i>will be shown to others, cannot be modified</i>)" %}</label><br />{{ form1.username }}</div>
- <div class="form-row"><label for="id_email">{% trans "Email (<i>not shared with anyone</i>)" %}</label><br />{{ form1.email }}</div>
- <div class="submit-row"><input type="submit" class="submit" name="bnewaccount" value="{% trans "create account" %}"></div>
- </fieldset>
+ <div class="form-row"><label for="id_username">{% trans "Screen name label" %}</label><br />{{ form1.username }}</div>
+ <div class="form-row"><label for="id_email">{% trans "Email address label" %}</label><br />{{ form1.email }}</div>
+ <div class="submit-row"><input type="submit" class="submit" name="bnewaccount" value="{% trans "create account" %}"></div>
</form>
</div>
<div class="login" style="display:none">
@@ -65,3 +65,4 @@
</form>
</div>
{% endblock %}
+<!-- end complete.html -->
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" %}
+<!-- delete.html -->
{% load i18n %}
@@ -36,3 +37,4 @@
</form>
</div>
{% endblock %}
+<!-- end delete.html -->
diff --git a/templates/authopenid/email_validation.txt b/templates/authopenid/email_validation.txt
new file mode 100644
index 00000000..5b166a9b
--- /dev/null
+++ b/templates/authopenid/email_validation.txt
@@ -0,0 +1,15 @@
+{% load i18n %}
+{% trans "Greetings from the Q&A forum" %},
+
+{% trans "To make use of the Forum, please follow the link below:" %}
+
+{{validation_link}}
+
+{% trans "Following the link above will help us verify your email address." %}
+
+{% blocktrans %}If you beleive that this message was sent in mistake -
+no further action is needed. Just ingore this email, we apologize
+for any inconvenience{% endblocktrans %}
+
+{% blocktrans %}Sincerely,
+Forum Administrator{% endblocktrans %}
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 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
+<!-- failure.html -->
<html>
<head>
<title>OpenID failed</title>
@@ -10,4 +11,4 @@
<p>{{ message|escape }}</p>
</body>
-</html> \ No newline at end of file
+</html><!-- end failure.html -->
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" %}
+<!-- sendpw.html -->
{% load i18n %}
{% block title %}{% spaceless %}{% trans "Send new password" %}{% endspaceless %}{% endblock %}
@@ -32,3 +33,4 @@
<span class="darkred">{% trans "Note: your new password will be activated only after you click the activation link in the email message" %}</span>
</div>
{% endblock %}
+<!-- end sendpw.html -->
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" %}
+<!-- settings.html -->
{% load i18n %}
{% block head %}
@@ -39,3 +40,4 @@
</dl>
</div>
{% endblock %}
+<!-- end settings.html -->
diff --git a/templates/authopenid/signin.html b/templates/authopenid/signin.html
index aff2f06f..9a1a6780 100644
--- a/templates/authopenid/signin.html
+++ b/templates/authopenid/signin.html
@@ -1,41 +1,119 @@
{% extends "base.html" %}
+<!-- signin.html -->
{% load i18n %}
{% block title %}{% spaceless %}{% trans "User login" %}{% endspaceless %}{% endblock %}
{% block forejs %}
- <script type="text/javascript" src="/content/js/jquery.openid.js?"></script>
+ <!--<script type="text/javascript" src="/content/js/jquery.openid.js?"></script>-->
<script type='text/javascript' src='/content/js/jquery.validate.pack.js'></script>
- <script type="text/javascript">
+
+ <link rel="stylesheet" type="text/css" media="screen" href="/content/jquery-openid/openid.css"/>
+ <script type="text/javascript" src="/content/jquery-openid/jquery.openid.js"></script>
+ <script type="text/javascript"> $().ready( function() { $("form.openid:eq(0)").openid(); })</script>
+ <!--<script type="text/javascript">
$().ready(function(){
openid.init('id_openid_url');
setupFormValidation("#openid_form", {bsignin:{required: true}});
});
- </script>
+ </script>-->
{% endblock %}
{% block content %}
<div class="headNormal">
{% trans "User login" %}
</div>
-<div class="login">
- <form name="openid_form" action="{% url user_signin %}" method="post">
- {{ form2.next }}
- <p style="display:none">{% trans "we support two login modes" %}</p>
{% if msg %}
<p class="warning">{{ msg }}</p>
{% endif %}
- <fieldset class="fieldset">
- <legend ><strong>{% trans "Login with your OpenID" %}</strong></legend>
- <div id="openid_choice">
- <p>{% trans "select openid provider" %}</p>
- <div id="openid_btns">
- </div>
- <br><br><br>
- <p>{% trans "verify openid link and login" %}</p>
+ {% if answer %}
+ <div class="message">
+ {% 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 %}
+ </div>
+ {% endif %}
+ {% if question %}
+ <div class="message">
+ {% blocktrans with question.title as title and question.summary as summary %}Your question
+ {{title}} {{summary}} will be posted once you log in
+ {% endblocktrans %}
</div>
- <p>
- {{ form2.openid_url }} <input id="bsignin" name="bsignin" type="submit" value="{% trans "Login" %}" class="openid-login-submit" />
- </p>
- </fieldset>
- </form>
+ {% endif %}
+ <div style="width:600px;float:left;margin-bottom:5px;">{% trans "Click to sign in through any of these services." %}</div>
+ <form id="openid_form" name="openid_form" class="openid" method="post" action="{% url user_signin %}">
+ <ul class="providers">
+ <li class="openid" title="OpenID">
+ <div class="logo_box openid_box">
+ <img src="/content/jquery-openid/images/openid.gif" alt="icon" />
+ </div>
+ <span><strong>http://{your-openid-url}</strong></span>
+ </li>
+ <li class="direct" title="Google">
+ <div class="logo_box google_box">
+ <img src="/content/jquery-openid/images/google.gif" alt="icon" /><span>https://www.google.com/accounts/o8/id</span>
+ </div>
+ </li>
+ <li class="direct" title="Yahoo">
+ <div class="logo_box yahoo_box">
+ <img src="/content/jquery-openid/images/yahoo.gif" alt="icon" /><span>http://yahoo.com/</span>
+ </div>
+ </li>
+ <li class="username" title="AOL screen name">
+ <div class="logo_box aol_box">
+ <img src="/content/jquery-openid/images/aol.gif" alt="icon" /><span>http://openid.aol.com/<strong>username</strong></span>
+ </div>
+ </li>
+ <li class="username first_tiny_li" title="MyOpenID user name">
+ <img src="/content/jquery-openid/images/myopenid.ico" alt="icon" />
+ <span>http://<strong>username</strong>.myopenid.com/</span>
+ </li>
+ <li class="username" title="Flickr user name">
+ <img src="/content/jquery-openid/images/flickr.ico" alt="icon" />
+ <span>http://flickr.com/<strong>username</strong>/</span>
+ </li>
+ <li class="username" title="Technorati user name">
+ <img src="/content/jquery-openid/images/technorati.ico" alt="icon" />
+ <span>http://technorati.com/people/technorati/<strong>username</strong>/</span>
+ </li>
+ <li class="username" title="Wordpress blog name">
+ <img src="/content/jquery-openid/images/wordpress.ico" alt="icon" />
+ <span>http://<strong>username</strong>.wordpress.com</span>
+ </li>
+ <li class="username" title="Blogger blog name">
+ <img src="/content/jquery-openid/images/blogger.ico" alt="icon" />
+ <span>http://<strong>username</strong>.blogspot.com/</span>
+ </li>
+ <li class="username" title="LiveJournal blog name">
+ <img src="/content/jquery-openid/images/livejournal.ico" alt="icon" />
+ <span>http://<strong>username</strong>.livejournal.com</span>
+ </li>
+ <li class="username" title="ClaimID user name">
+ <img src="/content/jquery-openid/images/claimid.ico" alt="icon" />
+ <span>http://claimid.com/<strong>username</strong></span>
+ </li>
+ <li class="username" title="Vidoop user name">
+ <img src="/content/jquery-openid/images/vidoop.ico" alt="icon" />
+ <span>http://<strong>username</strong>.myvidoop.com/</span>
+ </li>
+ <li class="username" title="Verisign user name">
+ <img src="/content/jquery-openid/images/verisign.ico" alt="icon" />
+ <span>http://<strong>username</strong>.pip.verisignlabs.com/</span>
+ </li>
+ </ul>
+ {{ form2.next }}
+ <fieldset>
+ <p id="provider_name_slot">{% trans 'Enter your <span id="enter_your_what">Provider user name</span>' %}</p>
+ <div><p><span></span>
+ <input id="openid_username" type="text" name="openid_username" /><span></span>
+ <input type="submit" value="Login" />
+ </p></div>
+ </fieldset>
+ <fieldset>
+ <p>{% trans 'Enter your <a class="openid_logo" href="http://openid.net">OpenID</a> web address' %}</p>
+ <div><p><input id="openid_url" type="text" value="http://" name="openid_url" />
+ <input id="bsignin" name="bsignin" type="submit" value="{% trans "Login" %}" /></p></div>
+ </fieldset>
+ </form>
+<div class="login">
+ <p style="display:none">{% trans "we support two login modes" %}</p>
<div style="display:none">
<br>
{% if form1.errors %}
@@ -60,7 +138,7 @@
<div class="form-row"><label for="id_password">{% trans "Password" %}:</label><br />{{ form1.password }}</div>
<div class="submit-row"><input type="submit" class="submit" name="blogin" value="{% trans "Login" %}">
<a href="">{% trans "Forgot your password?" %}</a>
- <a href="">{% trans "Create new acccount" %}</a></div>
+ <a href="">{% trans "Create new account" %}</a></div>
</fieldset>
</form>
</div>
@@ -93,3 +171,5 @@
</div>
{% endblock%}
+ <script type="text/javascript"> $( function() { $("form.openid:eq(0)").openid(); })</script>
+<!-- end signin.html -->
diff --git a/templates/authopenid/signup.html b/templates/authopenid/signup.html
index a4460aa3..a65dafdc 100644
--- a/templates/authopenid/signup.html
+++ b/templates/authopenid/signup.html
@@ -1,4 +1,6 @@
{% extends "base.html" %}
+<!--signup.html-->
+{% load i18n %}
{% block title %}{% spaceless %}{% trans "Signup" %}{% endspaceless %}{% endblock %}
{% block content %}
@@ -50,3 +52,4 @@
</form>
</div>
{% endblock %}
+<!--end signup.html-->
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 @@
-<!-- template badge.html -->
{% extends "base_content.html" %}
+<!-- template badge.html -->
{% load i18n %}
{% load extra_tags %}
{% load humanize %}
diff --git a/templates/badges.html b/templates/badges.html
index ef0a5451..69ddc39f 100644
--- a/templates/badges.html
+++ b/templates/badges.html
@@ -1,4 +1,5 @@
{% extends "base.html" %}
+<!-- template badges.html -->
{% load extra_tags %}
{% load humanize %}
{% load i18n %}
@@ -15,9 +16,10 @@
<div class="headlineA">
<span class="headMedals">{% trans "Badges" %}</span>
</div>
-<div id="main-body" style="width:100%">
+<div class="badges" id="main-body" style="width:100%">
<p>
- {% 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." %}<br>
+ {% trans "Below is the list of available badges and number of times each type of badge has been awarded." %}
</p>
<br>
<div id="medalList">
@@ -43,14 +45,14 @@
{% endblock %}
{% block sidebar %}
-<div class="boxB">
+<div class="boxC">
<h3>{% trans "Community badges" %}</h3>
<div class="body">
<p>
<a style="cursor:default;" title="gold badge: the highest honor and is very rare" class="medal"><span class="badge1">&#9679;</span>&nbsp;{% trans "gold" %}</a>
</p>
<p>
- {% 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" %}
</p>
<p>
<a style="cursor:default;"
@@ -58,14 +60,14 @@
class="medal"><span class="badge2">&#9679;</span>&nbsp;{% trans "silver" %}</a>
</p>
<p>
- {% trans "Obtaining silver badge requires significant patience. If you got one, you've very significantly contributed to this community" %}
+ {% trans "silver badge description" %}
</p>
<p>
<a style="cursor:default;" title="{% trans "bronze badge: often given as a special honor" %}" class="medal">
<span class="badge3">&#9679;</span>&nbsp;{% trans "bronze" %}</a>
</p>
<p>
- {% trans "If you are active in this community, you will get this medal - still it is a special honor." %}
+ {% trans "bronze badge description" %}
</p>
</div>
</div>
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 %}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>{% block title %}{% endblock %} - {{ APP_TITLE }}</title>
+ <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE }}</title>
{% spaceless %}
{% block meta %}{% endblock %}
{% endspaceless %}
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="verify-v1" content="{{verify_v1_code}}" />
+ <meta name="verify-v1" content="{{settings.GOOGLE_SITEMAP_CODE}}" />
<link rel="shortcut icon" href="/content/images/favicon.ico" >
<link href="/content/style/style.css" rel="stylesheet" type="text/css" />
<script src="http://www.google.com/jsapi"></script>
<script>google.load("jquery", "1.2.6");</script>
<script type="text/javascript">
- var i18nLang = 'en';
+ var i18nLang = '{{settings.LANGUAGE_CODE}}';
</script>
<script type='text/javascript' src='/content/js/com.cnprog.i18n.js'></script>
<script type='text/javascript' src='/content/js/jquery.i18n.js'></script>
@@ -26,9 +26,8 @@
</script>
<script type="text/javascript">
UserVoice.Tab.show({
- //EDIT!!!
- key: 'key',
- host: 'where.uservoice.com',
+ key: 'cnprog',
+ host: 'cnprog.uservoice.com',
forum: 'general',
alignment: 'left', /* 'left', 'right' */
background_color:'#777',
@@ -38,30 +37,31 @@
})
</script>-->
<!-- todo move this to settings -->
- {% with request.user.get_messages as messages%}
{% if messages %}
<style type="text/css">
body { margin-top:2.4em; }
</style>
<script type="text/javascript">
$().ready(function() {
+ $('#validate_email_alert').click(function(){notify.close(true)})
notify.show();
});
</script>
-
{% endif %}
- {% endwith %}
{% block forejs %}
{% endblock %}
</head>
<body>
<div class="notify" style="display:none">
- <span>{% if request.user.get_messages %}
- {% trans "congratulations, community gave you a badge" %}: {% for message in request.user.get_messages %}
- <font class="darkred">{{ message }}</font>, {% endfor %}查看
- <a href="{{ request.user.get_profile_url }}">{% trans "profile" %}</a>{% endif %}</span>
- <a class="close-notify" onclick="notify.close(true)">&times;</a>
+ {% autoescape off %}
+ {% if messages %}
+ {% for message in messages %}
+ <p class="darkred">{{ message }}<p>
+ {% endfor %}
+ {% endif %}
+ {% endautoescape %}
+ <a id="close-notify" onclick="notify.close(true)">&times;</a>
</div>
{% include "header.html" %}
<div id="wrapper">
@@ -89,3 +89,4 @@
{% endblock %}
</body>
</html>
+<!-- end template base.html -->
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 %}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!-- base_content.html -->
+{% load i18n %}
<html>
<head>
- <title>{% block title %}{% endblock %} - {{ APP_TITLE }}</title>
+ <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="verify-v1" content="55uGNnQVJW8p1bbXeF/Xbh9I7nZBM/wLhRz6N/I1kkA=" />
+ <meta name="verify-v1" content="{{ settings.GOOGLE_SITEMAP_CODE }}" />
<link rel="shortcut icon" href="/content/images/favicon.ico" >
<link href="/content/style/style.css" rel="stylesheet" type="text/css" />
{% spaceless %}
@@ -13,7 +14,7 @@
<script src="http://www.google.com/jsapi"></script>
<script>google.load("jquery", "1.2.6");</script>
<script type="text/javascript">
- var i18nLang = 'en';
+ var i18nLang = '{{ settings.LANGUAGE_CODE }}';
</script>
<script type='text/javascript' src='/content/js/com.cnprog.i18n.js'></script>
<script type='text/javascript' src='/content/js/jquery.i18n.js'></script>
@@ -38,29 +39,32 @@
</script>-->
<!-- todo move this to settings-->
- {% with request.user.get_messages as messages%}
{% if messages %}
<style type="text/css">
body { margin-top:2.4em; }
</style>
<script type="text/javascript">
$().ready(function() {
+ var element = $('#validate_email_alert')
+ element.click(function(){notify.close(true);setTimeout(function(){},1000)})
notify.show();
});
</script>
{% endif %}
- {% endwith %}
{% block forejs %}
{% endblock %}
</head>
<body>
<div class="notify" style="display:none">
- <span>{% if request.user.get_messages %}
- {% trans "congratulations, community gave you a badge" %}:{% for message in request.user.get_messages %}
- <font class="darkred">{{ message }}</font>, {% endfor %}{% trans "see" %}
- <a href="{{ request.user.get_profile_url }}">{% trans "profile" %}</a>{% endif %}</span>
- <a class="close-notify" onclick="notify.close(true)">&times;</a>
+ {% autoescape off %}
+ {% if messages %}
+ {% for message in messages %}
+ <p class="darkred">{{ message }}<p>
+ {% endfor %}
+ {% endif %}
+ {% endautoescape %}
+ <a id="close-notify" onclick="notify.close(true)">&times;</a>
</div>
{% include "header.html" %}
<div id="wrapper">
@@ -82,3 +86,4 @@
{% endblock %}
</body>
</html>
+<!-- end template base_content.html -->
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 @@
-<!-- template book.html -->
{% extends "base_content.html" %}
+<!-- template book.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 @@
-<!-- template close.html -->
{% extends "base_content.html" %}
+<!-- template close.html -->
{% load i18n %}
{% load extra_tags %}
{% load humanize %}
diff --git a/templates/content/jquery-openid/images/aol.gif b/templates/content/jquery-openid/images/aol.gif
new file mode 100644
index 00000000..decc4f12
--- /dev/null
+++ b/templates/content/jquery-openid/images/aol.gif
Binary files differ
diff --git a/templates/content/jquery-openid/images/blogger.ico b/templates/content/jquery-openid/images/blogger.ico
new file mode 100644
index 00000000..1b9730b0
--- /dev/null
+++ b/templates/content/jquery-openid/images/blogger.ico
Binary files differ
diff --git a/templates/content/jquery-openid/images/claimid.ico b/templates/content/jquery-openid/images/claimid.ico
new file mode 100644
index 00000000..2b80f491
--- /dev/null
+++ b/templates/content/jquery-openid/images/claimid.ico
Binary files differ
diff --git a/templates/content/jquery-openid/images/facebook.gif b/templates/content/jquery-openid/images/facebook.gif
new file mode 100644
index 00000000..b997b358
--- /dev/null
+++ b/templates/content/jquery-openid/images/facebook.gif
Binary files differ
diff --git a/templates/content/jquery-openid/images/flickr.ico b/templates/content/jquery-openid/images/flickr.ico
new file mode 100644
index 00000000..11f6e07f
--- /dev/null
+++ b/templates/content/jquery-openid/images/flickr.ico
Binary files differ
diff --git a/templates/content/jquery-openid/images/google.gif b/templates/content/jquery-openid/images/google.gif
new file mode 100644
index 00000000..1b6cd07b
--- /dev/null
+++ b/templates/content/jquery-openid/images/google.gif
Binary files differ
diff --git a/templates/content/jquery-openid/images/livejournal.ico b/templates/content/jquery-openid/images/livejournal.ico
new file mode 100644
index 00000000..f3d21ec5
--- /dev/null
+++ b/templates/content/jquery-openid/images/livejournal.ico
Binary files differ
diff --git a/templates/content/jquery-openid/images/myopenid.ico b/templates/content/jquery-openid/images/myopenid.ico
new file mode 100644
index 00000000..ceb06e6a
--- /dev/null
+++ b/templates/content/jquery-openid/images/myopenid.ico
Binary files differ
diff --git a/templates/content/jquery-openid/images/openid-inputicon.gif b/templates/content/jquery-openid/images/openid-inputicon.gif
new file mode 100644
index 00000000..cde836c8
--- /dev/null
+++ b/templates/content/jquery-openid/images/openid-inputicon.gif
Binary files differ
diff --git a/templates/content/jquery-openid/images/openid.gif b/templates/content/jquery-openid/images/openid.gif
new file mode 100644
index 00000000..c718b0e6
--- /dev/null
+++ b/templates/content/jquery-openid/images/openid.gif
Binary files differ
diff --git a/templates/content/jquery-openid/images/openidico.png b/templates/content/jquery-openid/images/openidico.png
new file mode 100644
index 00000000..ab622669
--- /dev/null
+++ b/templates/content/jquery-openid/images/openidico.png
Binary files differ
diff --git a/templates/content/jquery-openid/images/technorati.ico b/templates/content/jquery-openid/images/technorati.ico
new file mode 100644
index 00000000..fa1083c1
--- /dev/null
+++ b/templates/content/jquery-openid/images/technorati.ico
Binary files differ
diff --git a/templates/content/jquery-openid/images/verisign.ico b/templates/content/jquery-openid/images/verisign.ico
new file mode 100644
index 00000000..3953af93
--- /dev/null
+++ b/templates/content/jquery-openid/images/verisign.ico
Binary files differ
diff --git a/templates/content/jquery-openid/images/vidoop.ico b/templates/content/jquery-openid/images/vidoop.ico
new file mode 100644
index 00000000..bbd9a0d5
--- /dev/null
+++ b/templates/content/jquery-openid/images/vidoop.ico
Binary files differ
diff --git a/templates/content/jquery-openid/images/wordpress.ico b/templates/content/jquery-openid/images/wordpress.ico
new file mode 100644
index 00000000..31b7d2c2
--- /dev/null
+++ b/templates/content/jquery-openid/images/wordpress.ico
Binary files differ
diff --git a/templates/content/jquery-openid/images/yahoo.gif b/templates/content/jquery-openid/images/yahoo.gif
new file mode 100644
index 00000000..42adbfa5
--- /dev/null
+++ b/templates/content/jquery-openid/images/yahoo.gif
Binary files differ
diff --git a/templates/content/jquery-openid/jquery.openid.js b/templates/content/jquery-openid/jquery.openid.js
new file mode 100644
index 00000000..eec29ab2
--- /dev/null
+++ b/templates/content/jquery-openid/jquery.openid.js
@@ -0,0 +1,92 @@
+//jQuery OpenID Plugin 1.1 Copyright 2009 Jarrett Vance http://jvance.com/pages/jQueryOpenIdPlugin.xhtml
+$.fn.openid = function() {
+ var $this = $(this);
+
+ //name input value - needed for name based OpenID
+ var $usr = $this.find('input[name=openid_username]');
+
+ //final url input value
+ var $id = $this.find('input[name=openid_url]');
+
+ //beginning and end of name OpenID url (name being the middle)
+ var $front = $this.find('p:has(input[name=openid_username])>span:eq(0)');
+ var $end = $this.find('p:has(input[name=openid_username])>span:eq(1)');
+
+ //needed for special effects only
+ var $usrfs = $this.find('fieldset:has(input[name=openid_username])');
+ var $idfs = $this.find('fieldset:has(input[name=openid_url])');
+
+ var submitusr = function() {
+ if ($usr.val().length < 1) {
+ $usr.focus();
+ return false;
+ }
+ $id.val($front.text() + $usr.val() + $end.text());
+ return true;
+ };
+
+ var submitid = function() {
+ if ($id.val().length < 1) {
+ $id.focus();
+ return false;
+ }
+ return true;
+
+ };
+ var direct = function() {
+ var $li = $(this);
+ $li.parent().find('li').removeClass('highlight');
+ $li.addClass('highlight');
+ $usrfs.fadeOut('slow');
+ $idfs.fadeOut('slow');
+ $id.val($this.find("li.highlight span").text());
+ setTimeout(function(){$('#bsignin').click()},1000);
+ return false;
+ };
+
+ var openid = function() {
+ var $li = $(this);
+ $li.parent().find('li').removeClass('highlight');
+ $li.addClass('highlight');
+ $usrfs.hide();
+ $idfs.show();
+ $id.focus();
+ $this.unbind('submit').submit(submitid);
+ return false;
+ };
+
+ var username = function() {
+ var $li = $(this);
+ $li.parent().find('li').removeClass('highlight');
+ $li.addClass('highlight');
+ $idfs.hide();
+ $usrfs.show();
+ $this.find('#enter_your_what').text($li.attr("title"));
+ $front.text($li.find("span").text().split("username")[0]);
+ $end.text("").text($li.find("span").text().split("username")[1]);
+ $id.focus();
+ $this.unbind('submit').submit(submitusr);
+ return false;
+ };
+
+ $this.find('li.direct').click(direct);
+ $this.find('li.openid').click(openid);
+ $this.find('li.username').click(username);
+ $id.keypress(function(e) {
+ if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
+ return submitid();
+ }
+ });
+ $usr.keypress(function(e) {
+ if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
+ return submitusr();
+ }
+ });
+ $this.find('li span').hide();
+ $this.find('li').css('line-height', 0).css('cursor', 'pointer');
+ $this.find('li:eq(0)').click();
+
+ return this;
+};
+// submitting next=%2F&openid_username=&openid_url=http%3A%2F%2Fyahoo.com%2F
+// submitting next=%2F&openid_username=&openid_url=http%3A%2F%2Fyahoo.com%2F
diff --git a/templates/content/jquery-openid/openid.css b/templates/content/jquery-openid/openid.css
new file mode 100644
index 00000000..e53c1823
--- /dev/null
+++ b/templates/content/jquery-openid/openid.css
@@ -0,0 +1,33 @@
+fieldset {border-style:none;}
+img {border-style:none;}
+
+.logo_box {width:90px;height:40px;background:white;border:1px solid #dddddd;}
+.openid_box img {margin-top:6px;}
+.aol_box img {margin-top:6px;}
+.yahoo_box img {margin-top:13px;}
+.google_box img {margin-top:6px;}
+
+form.openid ul{ margin:0;padding:0;text-align:center; list-style-type:none; display:block;}
+form.openid ul li {float:left; padding:4px;}
+form.openid ul li span {padding:0 1em 0 3px}
+form.openid ul li.first_tiny_li {clear:left;}
+form.openid fieldset {clear:both;padding:10px 0px 0px 0px;}
+form.openid div+fieldset {display:none}
+form.openid label {display:block; font-weight:bold; margin-bottom:.5em}
+input[name=openid_username] {width:8em}
+input[name=openid_identifier] {width:18em}
+form.openid ul li.highlight { -moz-border-radius:4px; -webkit-border-radius:4px; background-color: #FD6}
+form.openid fieldset div {-moz-border-radius:4px; -webkit-border-radius:4px;
+ background: #DCDCDC;
+ padding:10px;display:inline-block}
+form.openid fieldset div p {padding:0px;margin:0px;}
+/*form.openid input[type='submit'] {margin-left:1em;}*/
+#openid_username {background:#ffffa0;}
+#openid_url {background:#ffffa0;}
+
+.openid_logo{color:#F7931E;padding:6px 0px 8px 28px;
+background: url(images/openidico.png) no-repeat;
+}
+
+#openid_login {float:left; width:30%; margin:2em 1em; text-align:center}
+#openid_login div{margin-top:0.5em}
diff --git a/templates/content/js/com.cnprog.editor.js b/templates/content/js/com.cnprog.editor.js
index 289d9866..6cfa2c74 100644
--- a/templates/content/js/com.cnprog.editor.js
+++ b/templates/content/js/com.cnprog.editor.js
@@ -1,68 +1,68 @@
-/*
- jQuery TextAreaResizer plugin
- Created on 17th January 2008 by Ryan O'Dell
- Version 1.0.4
-*/(function($){var textarea,staticOffset;var iLastMousePos=0;var iMin=32;var grip;$.fn.TextAreaResizer=function(){return this.each(function(){textarea=$(this).addClass('processed'),staticOffset=null;$(this).wrap('<div class="resizable-textarea"><span></span></div>').parent().append($('<div class="grippie"></div>').bind("mousedown",{el:this},startDrag));var grippie=$('div.grippie',$(this).parent())[0];grippie.style.marginRight=(grippie.offsetWidth-$(this)[0].offsetWidth)+'px'})};function startDrag(e){textarea=$(e.data.el);textarea.blur();iLastMousePos=mousePosition(e).y;staticOffset=textarea.height()-iLastMousePos;textarea.css('opacity',0.25);$(document).mousemove(performDrag).mouseup(endDrag);return false}function performDrag(e){var iThisMousePos=mousePosition(e).y;var iMousePos=staticOffset+iThisMousePos;if(iLastMousePos>=(iThisMousePos)){iMousePos-=5}iLastMousePos=iThisMousePos;iMousePos=Math.max(iMin,iMousePos);textarea.height(iMousePos+'px');if(iMousePos<iMin){endDrag(e)}return false}function endDrag(e){$(document).unbind('mousemove',performDrag).unbind('mouseup',endDrag);textarea.css('opacity',1);textarea.focus();textarea=null;staticOffset=null;iLastMousePos=0}function mousePosition(e){return{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}}})(jQuery);
-/*
- * Autocomplete - jQuery plugin 1.0.2
- * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- */;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v;}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value){return[""];}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value))result[i]=$.trim(value);});return result;}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else
-$input.val("");}});}if(wasVisible)$.Autocompleter.Selection(input,input.value.length,input.value.length);};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}setTimeout(populate,25);function flush(){data={};length=0;}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else
-if(data[q]){return data[q];}else
-if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}field.focus();};})(jQuery);
-/*
- * TypeWatch 2.0 - Original by Denny Ferrassoli / Refactored by Charles Christolini
- * Copyright(c) 2007 Denny Ferrassoli - DennyDotNet.com
- * Coprright(c) 2008 Charles Christolini - BinaryPie.com
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
-*/(function(jQuery){jQuery.fn.typeWatch=function(o){var options=jQuery.extend({wait:750,callback:function(){},highlight:true,captureLength:2},o);function checkElement(timer,override){var elTxt=jQuery(timer.el).val();if((elTxt.length>options.captureLength&&elTxt.toUpperCase()!=timer.text)||(override&&elTxt.length>options.captureLength)){timer.text=elTxt.toUpperCase();timer.cb(elTxt)}};function watchElement(elem){if(elem.type.toUpperCase()=="TEXT"||elem.nodeName.toUpperCase()=="TEXTAREA"){var timer={timer:null,text:jQuery(elem).val().toUpperCase(),cb:options.callback,el:elem,wait:options.wait};if(options.highlight){jQuery(elem).focus(function(){this.select()})}var startWatch=function(evt){var timerWait=timer.wait;var overrideBool=false;if(evt.keyCode==13&&this.type.toUpperCase()=="TEXT"){timerWait=1;overrideBool=true}var timerCallbackFx=function(){checkElement(timer,overrideBool)};clearTimeout(timer.timer);timer.timer=setTimeout(timerCallbackFx,timerWait)};jQuery(elem).keydown(startWatch)}};return this.each(function(index){watchElement(this)})}})(jQuery);
-/*
-Ajax upload
-*/jQuery.extend({createUploadIframe:function(d,b){var a="jUploadFrame"+d;if(window.ActiveXObject){var c=document.createElement('<iframe id="'+a+'" name="'+a+'" />');if(typeof b=="boolean"){c.src="javascript:false"}else{if(typeof b=="string"){c.src=b}}}else{var c=document.createElement("iframe");c.id=a;c.name=a}c.style.position="absolute";c.style.top="-1000px";c.style.left="-1000px";document.body.appendChild(c);return c},createUploadForm:function(g,b){var e="jUploadForm"+g;var a="jUploadFile"+g;var d=$('<form action="" method="POST" name="'+e+'" id="'+e+'" enctype="multipart/form-data"></form>');var c=$("#"+b);var f=$(c).clone();$(c).attr("id",a);$(c).before(f);$(c).appendTo(d);$(d).css("position","absolute");$(d).css("top","-1200px");$(d).css("left","-1200px");$(d).appendTo("body");return d},ajaxFileUpload:function(k){k=jQuery.extend({},jQuery.ajaxSettings,k);var a=new Date().getTime();var b=jQuery.createUploadForm(a,k.fileElementId);var i=jQuery.createUploadIframe(a,k.secureuri);var h="jUploadFrame"+a;var j="jUploadForm"+a;if(k.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var c=false;var f={};if(k.global){jQuery.event.trigger("ajaxSend",[f,k])}var d=function(l){var p=document.getElementById(h);try{if(p.contentWindow){f.responseText=p.contentWindow.document.body?p.contentWindow.document.body.innerText:null;f.responseXML=p.contentWindow.document.XMLDocument?p.contentWindow.document.XMLDocument:p.contentWindow.document}else{if(p.contentDocument){f.responseText=p.contentDocument.document.body?p.contentDocument.document.body.textContent||document.body.innerText:null;f.responseXML=p.contentDocument.document.XMLDocument?p.contentDocument.document.XMLDocument:p.contentDocument.document}}}catch(o){jQuery.handleError(k,f,null,o)}if(f||l=="timeout"){c=true;var m;try{m=l!="timeout"?"success":"error";if(m!="error"){var n=jQuery.uploadHttpData(f,k.dataType);if(k.success){k.success(n,m)}if(k.global){jQuery.event.trigger("ajaxSuccess",[f,k])}}else{jQuery.handleError(k,f,m)}}catch(o){m="error";jQuery.handleError(k,f,m,o)}if(k.global){jQuery.event.trigger("ajaxComplete",[f,k])}if(k.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}if(k.complete){k.complete(f,m)}jQuery(p).unbind();setTimeout(function(){try{$(p).remove();$(b).remove()}catch(q){jQuery.handleError(k,f,null,q)}},100);f=null}};if(k.timeout>0){setTimeout(function(){if(!c){d("timeout")}},k.timeout)}try{var b=$("#"+j);$(b).attr("action",k.url);$(b).attr("method","POST");$(b).attr("target",h);if(b.encoding){b.encoding="multipart/form-data"}else{b.enctype="multipart/form-data"}$(b).submit()}catch(g){jQuery.handleError(k,f,null,g)}if(window.attachEvent){document.getElementById(h).attachEvent("onload",d)}else{document.getElementById(h).addEventListener("load",d,false)}return{abort:function(){}}},uploadHttpData:function(r,type){var data=!type;data=type=="xml"||data?r.responseXML:r.responseText;if(type=="script"){jQuery.globalEval(data)}if(type=="json"){eval("data = "+data)}if(type=="html"){jQuery("<div>").html(data).evalScripts()}return data}});
-/*Upload call*/
-function ajaxFileUpload(imageUrl)
-{
- $("#loading").ajaxStart(function(){
- $(this).show();
- }).ajaxComplete(function(){
- $(this).hide();
- });
-
- $("#upload").ajaxStart(function(){
- $(this).hide();
- }).ajaxComplete(function(){
- $(this).show();
- });
-
- $.ajaxFileUpload
- (
- {
- url:'/upload/',
- secureuri:false,
- fileElementId:'file-upload',
- dataType: 'xml',
- success: function (data, status)
- {
- var fileURL = $(data).find('file_url').text();
- var error = $(data).find('error').text();
- if(error != ''){
- alert(error);
- }else{
- imageUrl.attr('value', fileURL);
- }
-
- },
- error: function (data, status, e)
- {
- alert(e);
- }
- }
- )
-
- return false;
+/*
+ jQuery TextAreaResizer plugin
+ Created on 17th January 2008 by Ryan O'Dell
+ Version 1.0.4
+*/(function($){var textarea,staticOffset;var iLastMousePos=0;var iMin=32;var grip;$.fn.TextAreaResizer=function(){return this.each(function(){textarea=$(this).addClass('processed'),staticOffset=null;$(this).wrap('<div class="resizable-textarea"><span></span></div>').parent().append($('<div class="grippie"></div>').bind("mousedown",{el:this},startDrag));var grippie=$('div.grippie',$(this).parent())[0];grippie.style.marginRight=(grippie.offsetWidth-$(this)[0].offsetWidth)+'px'})};function startDrag(e){textarea=$(e.data.el);textarea.blur();iLastMousePos=mousePosition(e).y;staticOffset=textarea.height()-iLastMousePos;textarea.css('opacity',0.25);$(document).mousemove(performDrag).mouseup(endDrag);return false}function performDrag(e){var iThisMousePos=mousePosition(e).y;var iMousePos=staticOffset+iThisMousePos;if(iLastMousePos>=(iThisMousePos)){iMousePos-=5}iLastMousePos=iThisMousePos;iMousePos=Math.max(iMin,iMousePos);textarea.height(iMousePos+'px');if(iMousePos<iMin){endDrag(e)}return false}function endDrag(e){$(document).unbind('mousemove',performDrag).unbind('mouseup',endDrag);textarea.css('opacity',1);textarea.focus();textarea=null;staticOffset=null;iLastMousePos=0}function mousePosition(e){return{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}}})(jQuery);
+/*
+ * Autocomplete - jQuery plugin 1.0.2
+ * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v;}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&&currentValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value){return[""];}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value))result[i]=$.trim(value);});return result;}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else
+$input.val("");}});}if(wasVisible)$.Autocompleter.Selection(input,input.value.length,input.value.length);};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}setTimeout(populate,25);function flush(){data={};length=0;}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else
+if(data[q]){return data[q];}else
+if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}field.focus();};})(jQuery);
+/*
+ * TypeWatch 2.0 - Original by Denny Ferrassoli / Refactored by Charles Christolini
+ * Copyright(c) 2007 Denny Ferrassoli - DennyDotNet.com
+ * Coprright(c) 2008 Charles Christolini - BinaryPie.com
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+*/(function(jQuery){jQuery.fn.typeWatch=function(o){var options=jQuery.extend({wait:750,callback:function(){},highlight:true,captureLength:2},o);function checkElement(timer,override){var elTxt=jQuery(timer.el).val();if((elTxt.length>options.captureLength&&elTxt.toUpperCase()!=timer.text)||(override&&elTxt.length>options.captureLength)){timer.text=elTxt.toUpperCase();timer.cb(elTxt)}};function watchElement(elem){if(elem.type.toUpperCase()=="TEXT"||elem.nodeName.toUpperCase()=="TEXTAREA"){var timer={timer:null,text:jQuery(elem).val().toUpperCase(),cb:options.callback,el:elem,wait:options.wait};if(options.highlight){jQuery(elem).focus(function(){this.select()})}var startWatch=function(evt){var timerWait=timer.wait;var overrideBool=false;if(evt.keyCode==13&&this.type.toUpperCase()=="TEXT"){timerWait=1;overrideBool=true}var timerCallbackFx=function(){checkElement(timer,overrideBool)};clearTimeout(timer.timer);timer.timer=setTimeout(timerCallbackFx,timerWait)};jQuery(elem).keydown(startWatch)}};return this.each(function(index){watchElement(this)})}})(jQuery);
+/*
+Ajax upload
+*/jQuery.extend({createUploadIframe:function(d,b){var a="jUploadFrame"+d;if(window.ActiveXObject){var c=document.createElement('<iframe id="'+a+'" name="'+a+'" />');if(typeof b=="boolean"){c.src="javascript:false"}else{if(typeof b=="string"){c.src=b}}}else{var c=document.createElement("iframe");c.id=a;c.name=a}c.style.position="absolute";c.style.top="-1000px";c.style.left="-1000px";document.body.appendChild(c);return c},createUploadForm:function(g,b){var e="jUploadForm"+g;var a="jUploadFile"+g;var d=$('<form action="" method="POST" name="'+e+'" id="'+e+'" enctype="multipart/form-data"></form>');var c=$("#"+b);var f=$(c).clone();$(c).attr("id",a);$(c).before(f);$(c).appendTo(d);$(d).css("position","absolute");$(d).css("top","-1200px");$(d).css("left","-1200px");$(d).appendTo("body");return d},ajaxFileUpload:function(k){k=jQuery.extend({},jQuery.ajaxSettings,k);var a=new Date().getTime();var b=jQuery.createUploadForm(a,k.fileElementId);var i=jQuery.createUploadIframe(a,k.secureuri);var h="jUploadFrame"+a;var j="jUploadForm"+a;if(k.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")}var c=false;var f={};if(k.global){jQuery.event.trigger("ajaxSend",[f,k])}var d=function(l){var p=document.getElementById(h);try{if(p.contentWindow){f.responseText=p.contentWindow.document.body?p.contentWindow.document.body.innerText:null;f.responseXML=p.contentWindow.document.XMLDocument?p.contentWindow.document.XMLDocument:p.contentWindow.document}else{if(p.contentDocument){f.responseText=p.contentDocument.document.body?p.contentDocument.document.body.textContent||document.body.innerText:null;f.responseXML=p.contentDocument.document.XMLDocument?p.contentDocument.document.XMLDocument:p.contentDocument.document}}}catch(o){jQuery.handleError(k,f,null,o)}if(f||l=="timeout"){c=true;var m;try{m=l!="timeout"?"success":"error";if(m!="error"){var n=jQuery.uploadHttpData(f,k.dataType);if(k.success){k.success(n,m)}if(k.global){jQuery.event.trigger("ajaxSuccess",[f,k])}}else{jQuery.handleError(k,f,m)}}catch(o){m="error";jQuery.handleError(k,f,m,o)}if(k.global){jQuery.event.trigger("ajaxComplete",[f,k])}if(k.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")}if(k.complete){k.complete(f,m)}jQuery(p).unbind();setTimeout(function(){try{$(p).remove();$(b).remove()}catch(q){jQuery.handleError(k,f,null,q)}},100);f=null}};if(k.timeout>0){setTimeout(function(){if(!c){d("timeout")}},k.timeout)}try{var b=$("#"+j);$(b).attr("action",k.url);$(b).attr("method","POST");$(b).attr("target",h);if(b.encoding){b.encoding="multipart/form-data"}else{b.enctype="multipart/form-data"}$(b).submit()}catch(g){jQuery.handleError(k,f,null,g)}if(window.attachEvent){document.getElementById(h).attachEvent("onload",d)}else{document.getElementById(h).addEventListener("load",d,false)}return{abort:function(){}}},uploadHttpData:function(r,type){var data=!type;data=type=="xml"||data?r.responseXML:r.responseText;if(type=="script"){jQuery.globalEval(data)}if(type=="json"){eval("data = "+data)}if(type=="html"){jQuery("<div>").html(data).evalScripts()}return data}});
+/*Upload call*/
+function ajaxFileUpload(imageUrl)
+{
+ $("#loading").ajaxStart(function(){
+ $(this).show();
+ }).ajaxComplete(function(){
+ $(this).hide();
+ });
+
+ $("#upload").ajaxStart(function(){
+ $(this).hide();
+ }).ajaxComplete(function(){
+ $(this).show();
+ });
+
+ $.ajaxFileUpload
+ (
+ {
+ url:'/upload/',
+ secureuri:false,
+ fileElementId:'file-upload',
+ dataType: 'xml',
+ success: function (data, status)
+ {
+ var fileURL = $(data).find('file_url').text();
+ var error = $(data).find('error').text();
+ if(error != ''){
+ alert(error);
+ }else{
+ imageUrl.attr('value', fileURL);
+ }
+
+ },
+ error: function (data, status, e)
+ {
+ alert(e);
+ }
+ }
+ )
+
+ return false;
} \ No newline at end of file
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 e3101ea7..546cf101 100644
--- a/templates/content/js/com.cnprog.post.js
+++ b/templates/content/js/com.cnprog.post.js
@@ -1,616 +1,631 @@
-/*
-Scripts for cnprog.com
-Project Name: Lanai
-All Rights Resevred 2008. CNPROG.COM
-*/
-var lanai =
-{
- /**
- * Finds any <pre><code></code></pre> tags which aren't registered for
- * pretty printing, adds the appropriate class name and invokes prettify.
- */
- highlightSyntax: function(){
- var styled = false;
- $("pre code").parent().each(function(){
- if (!$(this).hasClass('prettyprint')){
- $(this).addClass('prettyprint');
- styled = true;
- }
- });
-
- if (styled){
- prettyPrint();
- }
- }
-};
-
-var Vote = function(){
- // All actions are related to a question
- var questionId;
- // The object we operate on actually. It can be a question or an answer.
- var postId;
- var questionAuthorId;
- var currentUserId;
- var answerContainerIdPrefix = 'answer-container-';
- var voteContainerId = 'vote-buttons';
- var imgIdPrefixAccept = 'answer-img-accept-';
- var imgClassPrefixFavorite = 'question-img-favorite';
- var imgIdPrefixQuestionVoteup = 'question-img-upvote-';
- var imgIdPrefixQuestionVotedown = 'question-img-downvote-';
- var imgIdPrefixAnswerVoteup = 'answer-img-upvote-';
- var imgIdPrefixAnswerVotedown = 'answer-img-downvote-';
- var divIdFavorite = 'favorite-number';
- var commentLinkIdPrefix = 'comment-';
- var voteNumberClass = "vote-number";
- var offensiveIdPrefixQuestionFlag = 'question-offensive-flag-';
- var offensiveIdPrefixAnswerFlag = 'answer-offensive-flag-';
- var offensiveClassFlag = 'offensive-flag';
- var questionControlsId = 'question-controls';
- var removeQuestionLinkIdPrefix = 'question-delete-link-';
- var removeAnswerLinkIdPrefix = 'answer-delete-link-';
-
- var acceptAnonymousMessage = $.i18n._('insufficient privilege');
- var acceptOwnAnswerMessage = $.i18n._('cannot pick own answer as best');
- var favoriteAnonymousMessage = $.i18n._('anonymous user cannot select favorite questions')
- + "<a href='/account/signin/?next=/questions/{{QuestionID}}'>"
- + $.i18n._('please login') + "</a>";
- var voteAnonymousMessage = $.i18n._('anonymous users cannot vote')
- + "<a href='/account/signin/?next=/questions/{{QuestionID}}'>"
- + $.i18n._('please login') + "</a>";
- var upVoteRequiredScoreMessage = $.i18n._('>15 points requried to upvote')
- + $.i18n._('please see') + "<a href='/faq'>faq</a>";
- var downVoteRequiredScoreMessage = $.i18n._('>100 points requried to downvote')
- + $.i18n._('please see') + "<a href='/faq'>faq</a>";
- var voteOwnDeniedMessage = $.i18n._('cannot vote for own posts');
- var voteRequiredMoreVotes = $.i18n._('daily vote cap exhausted')
- + $.i18n._('please see') + "<a href='/faq'>faq</a>";
- var voteDenyCancelMessage = $.i18n._('cannot revoke old vote')
- + $.i18n._('please see') + "<a href='/faq'>faq</a>";
- var offensiveConfirmation = $.i18n._('please confirm offensive');
- var offensiveAnonymousMessage = $.i18n._('anonymous users cannot flag offensive posts')
- + "<a href='/account/signin/?next=/questions/{{QuestionID}}'>"
- + $.i18n._('please login') + "</a>";
- var offensiveTwiceMessage = $.i18n._('cannot flag message as offensive twice')
- + $.i18n._('please see') + "<a href='/faq'>faq</a>";
- var offensiveNoFlagsLeftMessage = $.i18n._('flag offensive cap exhausted')
- + $.i18n._('please see') + "<a href='/faq'>faq</a>";
- var offensiveNoPermissionMessage = $.i18n._('need >15 points to report spam')
- + $.i18n._('please see') + "<a href='/faq'>faq</a>";
- var removeConfirmation = $.i18n._('confirm delete');
- var removeAnonymousMessage = $.i18n._('anonymous users cannot delete/undelete');
- var recoveredMessage = $.i18n._('post recovered');
- var deletedMessage = $.i18n._('post deleted');
-
- var VoteType = {
- acceptAnswer : 0,
- questionUpVote : 1,
- questionDownVote : 2,
- favorite : 4,
- answerUpVote: 5,
- answerDownVote:6,
- offensiveQuestion : 7,
- offensiveAnswer:8,
- removeQuestion: 9,
- removeAnswer:10
- };
-
- var getFavoriteButton = function(){
- var favoriteButton = 'div.'+ voteContainerId +' img[class='+ imgClassPrefixFavorite +']';
- return $(favoriteButton);
- };
- var getFavoriteNumber = function(){
- var favoriteNumber = '#'+ divIdFavorite ;
- return $(favoriteNumber);
- };
- var getQuestionVoteUpButton = function(){
- var questionVoteUpButton = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixQuestionVoteup +']';
- return $(questionVoteUpButton);
- };
- var getQuestionVoteDownButton = function(){
- var questionVoteDownButton = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixQuestionVotedown +']';
- return $(questionVoteDownButton);
- };
- var getAnswerVoteUpButtons = function(){
- var answerVoteUpButton = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAnswerVoteup +']';
- return $(answerVoteUpButton);
- };
- var getAnswerVoteDownButtons = function(){
- var answerVoteDownButton = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAnswerVotedown +']';
- return $(answerVoteDownButton);
- };
- var getAnswerVoteUpButton = function(id){
- var answerVoteUpButton = 'div.'+ voteContainerId +' img[id='+ imgIdPrefixAnswerVoteup + id + ']';
- return $(answerVoteUpButton);
- };
- var getAnswerVoteDownButton = function(id){
- var answerVoteDownButton = 'div.'+ voteContainerId +' img[id='+ imgIdPrefixAnswerVotedown + id + ']';
- return $(answerVoteDownButton);
- };
-
- var getOffensiveQuestionFlag = function(){
- var offensiveQuestionFlag = 'table[id=question-table] span[class='+ offensiveClassFlag +']';
- return $(offensiveQuestionFlag);
- };
-
- var getOffensiveAnswerFlags = function(){
- var offensiveQuestionFlag = 'div.answer span[class='+ offensiveClassFlag +']';
- return $(offensiveQuestionFlag);
- };
-
- var getremoveQuestionLink = function(){
- var removeQuestionLink = 'div#question-controls a[id^='+ removeQuestionLinkIdPrefix +']';
- return $(removeQuestionLink);
- };
-
- var getremoveAnswersLinks = function(){
- var removeAnswerLinks = 'div.answer-controls a[id^='+ removeAnswerLinkIdPrefix +']';
- return $(removeAnswerLinks);
- };
-
- var setVoteImage = function(voteType, undo, object){
- var flag = undo ? "" : "-on";
- var arrow = (voteType == VoteType.questionUpVote || voteType == VoteType.answerUpVote) ? "up" : "down";
- object.attr("src", "/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", "/content/images/vote-arrow-up.png");
- $(getQuestionVoteDownButton()).attr("src", "/content/images/vote-arrow-down.png");
- }
- else{
- $(getAnswerVoteUpButton(postId)).attr("src", "/content/images/vote-arrow-up.png");
- $(getAnswerVoteDownButton(postId)).attr("src", "/content/images/vote-arrow-down.png");
- }
- }
- };
-
- var setVoteNumber = function(object, number){
- var voteNumber = object.parent('div.'+ voteContainerId).find('div.'+ voteNumberClass);
- $(voteNumber).text(number);
- };
-
- var bindEvents = function(){
- // accept answers
- if(questionAuthorId == currentUserId){
- var acceptedButtons = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAccept +']';
- $(acceptedButtons).unbind('click').click(function(event){
- Vote.accept($(event.target))
- });
- }
- // set favorite question
- var favoriteButton = getFavoriteButton();
- favoriteButton.unbind('click').click(function(event){
- Vote.favorite($(event.target))
- });
-
- // question vote up
- var questionVoteUpButton = getQuestionVoteUpButton();
- questionVoteUpButton.unbind('click').click(function(event){
- Vote.vote($(event.target), VoteType.questionUpVote)
- });
-
- var questionVoteDownButton = getQuestionVoteDownButton();
- questionVoteDownButton.unbind('click').click(function(event){
- Vote.vote($(event.target), VoteType.questionDownVote)
- });
-
- var answerVoteUpButton = getAnswerVoteUpButtons();
- answerVoteUpButton.unbind('click').click(function(event){
- Vote.vote($(event.target), VoteType.answerUpVote)
- });
-
- var answerVoteDownButton = getAnswerVoteDownButtons();
- answerVoteDownButton.unbind('click').click(function(event){
- Vote.vote($(event.target), VoteType.answerDownVote)
- });
-
- getOffensiveQuestionFlag().unbind('click').click(function(event){
- Vote.offensive(this, VoteType.offensiveQuestion)
- });
-
- getOffensiveAnswerFlags().unbind('click').click(function(event){
- Vote.offensive(this, VoteType.offensiveAnswer)
- });
-
- getremoveQuestionLink().unbind('click').click(function(event){
- Vote.remove(this, VoteType.removeQuestion);
- });
-
- getremoveAnswersLinks().unbind('click').click(function(event){
- Vote.remove(this, VoteType.removeAnswer)
- });
- };
-
- var submit = function(object, voteType, callback) {
- $.ajax({
- type: "POST",
- cache: false,
- dataType: "json",
- url: "/questions/" + questionId + "/vote/",
- data: { "type": voteType, "postId": postId },
- error: handleFail,
- success: function(data){callback(object, voteType, data)}});
- };
-
- var handleFail = function(xhr, msg){
- alert("Callback invoke error: " + msg)
- };
-
- // callback function for Accept Answer action
- var callback_accept = function(object, voteType, data){
- if(data.allowed == "0" && data.success == "0"){
- showMessage(object, acceptAnonymousMessage);
- }
- else if(data.allowed == "-1"){
- showMessage(object, acceptOwnAnswerMessage);
- }
- else if(data.status == "1"){
- object.attr("src", "/content/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", "/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", "/content/images/vote-accepted-on.png");
- $("#"+answerContainerIdPrefix+postId).addClass("accepted-answer");
- $("#"+commentLinkIdPrefix+postId).addClass("comment-link-accepted");
- }
- else{
- showMessage(object, data.message);
- }
- };
-
- var callback_favorite = function(object, voteType, data){
- if(data.allowed == "0" && data.success == "0"){
- showMessage(object, favoriteAnonymousMessage.replace("{{QuestionID}}", questionId));
- }
- else if(data.status == "1"){
- object.attr("src", "/content/images/vote-favorite-off.png");
- var fav = getFavoriteNumber();
- fav.removeClass("my-favorite-number");
- if(data.count == 0)
- data.count = '';
- fav.text(data.count);
- }
- else if(data.success == "1"){
- object.attr("src", "/content/images/vote-favorite-on.png");
- var fav = getFavoriteNumber();
- fav.text(data.count);
- fav.addClass("my-favorite-number");
- }
- else{
- showMessage(object, data.message);
- }
- };
-
- var callback_vote = function(object, voteType, data){
- if(data.allowed == "0" && data.success == "0"){
- showMessage(object, voteAnonymousMessage.replace("{{QuestionID}}", questionId));
- }
- else if(data.allowed == "-3"){
- showMessage(object, voteRequiredMoreVotes);
- }
- else if(data.allowed == "-2"){
- if(voteType == VoteType.questionUpVote || voteType == VoteType.answerUpVote){
- showMessage(object, upVoteRequiredScoreMessage);
- }
- else if(voteType == VoteType.questionDownVote || voteType == VoteType.answerDownVote){
- showMessage(object, downVoteRequiredScoreMessage);
- }
- }
- else if(data.allowed == "-1"){
- showMessage(object, voteOwnDeniedMessage);
- }
- else if(data.status == "2"){
- showMessage(object, voteDenyCancelMessage);
- }
- else if(data.status == "1"){
- setVoteImage(voteType, true, object);
- setVoteNumber(object, data.count);
- }
- else if(data.success == "1"){
- setVoteImage(voteType, false, object);
- setVoteNumber(object, data.count);
- if(data.message.length > 0)
- showMessage(object, data.message);
- }
- };
-
- var callback_offensive = function(object, voteType, data){
- object = $(object);
- if(data.allowed == "0" && data.success == "0"){
- showMessage(object, offensiveAnonymousMessage.replace("{{QuestionID}}", questionId));
- }
- else if(data.allowed == "-3"){
- showMessage(object, offensiveNoFlagsLeftMessage);
- }
- else if(data.allowed == "-2"){
- showMessage(object, offensiveNoPermissionMessage);
- }
- else if(data.status == "1"){
- showMessage(object, offensiveTwiceMessage);
- }
- else if(data.success == "1"){
- $(object).children('span[class=darkred]').text("("+ data.count +")");
- }
- };
-
- var callback_remove = function(object, voteType, data){
- alert(data.status);
- if(data.allowed == "0" && data.success == "0"){
- showMessage(object, removeAnonymousMessage.replace("{{QuestionID}}", questionId));
- }
- else if (data.success == "1"){
- if (removeActionType == 'delete'){
- postNode.addClass('deleted');
- postRemoveLink.innerHTML = $.i18n._('undelete');
- showMessage(object, deletedMessage);
- }
- else if (removeActionType == 'undelete') {
- postNode.removeClass('deleted');
- postRemoveLink.innerHTML = $.i18n._('delete');
- showMessage(object, recoveredMessage);
- }
- }
- };
-
- return {
- init : function(qId, questionAuthor, userId){
- questionId = qId;
- questionAuthorId = questionAuthor;
- currentUserId = userId;
- bindEvents();
- },
-
- // Accept answer public function
- accept: function(object){
- postId = object.attr("id").substring(imgIdPrefixAccept.length);
- submit(object, VoteType.acceptAnswer, callback_accept);
- },
-
- favorite: function(object){
- if(!currentUserId || currentUserId.toUpperCase() == "NONE"){
- showMessage(object, favoriteAnonymousMessage.replace("{{QuestionID}}", questionId));
- return false;
- }
- submit(object, VoteType.favorite, callback_favorite);
- },
-
- vote: function(object, voteType){
- if(!currentUserId || currentUserId.toUpperCase() == "NONE"){
- showMessage(object, voteAnonymousMessage.replace("{{QuestionID}}", questionId));
- return false;
- }
- if(voteType == VoteType.answerUpVote){
- postId = object.attr("id").substring(imgIdPrefixAnswerVoteup.length);
- }
- else if(voteType == VoteType.answerDownVote){
- postId = object.attr("id").substring(imgIdPrefixAnswerVotedown.length);
- }
-
- submit(object, voteType, callback_vote);
- },
-
- offensive: function(object, voteType){
- if(!currentUserId || currentUserId.toUpperCase() == "NONE"){
- showMessage($(object), offensiveAnonymousMessage.replace("{{QuestionID}}", questionId));
- return false;
- }
- if(confirm(offensiveConfirmation)){
- postId = object.id.substr(object.id.lastIndexOf('-') + 1);
- submit(object, voteType, callback_offensive);
- }
- },
-
- remove: function(object, voteType){
- if(!currentUserId || currentUserId.toUpperCase() == "NONE"){
- showMessage($(object), removeAnonymousMessage.replace("{{QuestionID}}", questionId));
- return false;
- }
- if(confirm(removeConfirmation)){
- bits = object.id.split('-');
- postId = bits.pop();/* this seems to be used within submit! */
- postType = bits.shift();
-
- if (postType == 'answer'){
- postNode = $('#answer-container-' + postId);
- postRemoveLink = object;
- if (postNode.hasClass('deleted')){
- removeActionType = 'undelete';
- }
- else {
- removeActionType = 'delete';
- }
- }
- submit($(object), voteType, callback_remove);
-
-
- }
- }
- }
-} ();
-
-
-// site comments
-function createComments(type) {
- var objectType = type;
- var jDivInit = function(id) {
- return $("#comments-" + objectType + '-' + id);
- };
-
- var appendLoaderImg = function(id) {
- appendLoader("#comments-" + objectType + '-' + id + " div.comments");
- };
-
- var canPostComments = function(id, jDiv) {
- var jHidden = jDiv.siblings("#can-post-comments-" + objectType + '-' + id);
- return jHidden.val().toLowerCase() == "true";
- };
-
- var renderForm = function(id, jDiv) {
- var formId = "form-comments-" + objectType + "-" + id;
- if (canPostComments(id, jDiv)) {
- if (jDiv.find("#" + formId).length == 0) {
- var form = '<form id="' + formId + '" class="post-comments"><div>';
- form += '<textarea name="comment" cols="60" rows="5" maxlength="300" onblur="'+ objectType +'Comments.updateTextCounter(this)" ';
- form += 'onfocus="' + objectType + 'Comments.updateTextCounter(this)" onkeyup="'+ objectType +'Comments.updateTextCounter(this)"></textarea>';
- form += '<input type="submit" value="'
- + $.i18n._('add comment') + '" /><br><span class="text-counter"></span>';
- form += '<span class="form-error"></span></div></form>';
-
- jDiv.append(form);
-
- setupFormValidation("#" + formId,
- { comment: { required: true, minlength: 10} }, '',
- function() { postComment(id, formId); });
- }
- }
- else {
- var divId = "comments-rep-needed-" + objectType + '-' + id;
- if (jDiv.find("#" + divId).length == 0) {
- jDiv.append('<div id="' + divId + '" style="color:red">'
- + $.i18n._('to comment, need') + ' ' +
- + repNeededForComments + ' ' + $.i18n._('community reputation points')
- + '<a href="/faq" class="comment-user">' + $.i18n._('please see') + 'faq</a></span>');
- }
- }
- };
-
- var getComments = function(id, jDiv) {
- appendLoaderImg(id);
- $.getJSON("/" + objectType + "s/" + id + "/comments/", function(json) { showComments(id, json); });
- };
-
- var showComments = function(id, json) {
- var jDiv = jDivInit(id);
-
- jDiv = jDiv.find("div.comments"); // this div should contain any fetched comments..
- jDiv.find("div[id^='comment-" + objectType + "-'" + "]").remove(); // clean previous calls..
-
- removeLoader();
-
- if (json && json.length > 0) {
- for (var i = 0; i < json.length; i++)
- renderComment(jDiv, json[i]);
-
- jDiv.children().show();
- }
- };
-
- // {"Id":6,"PostId":38589,"CreationDate":"an hour ago","Text":"hello there!","UserDisplayName":"Jarrod Dixon","UserUrl":"/users/3/jarrod-dixon","DeleteUrl":null}
- var renderComment = function(jDiv, json) {
- var html = '<div id="comment-' + objectType + "-" + json.id + '" style="display:none">' + json.text;
- html += json.user_url ? '&nbsp;&ndash;&nbsp;<a href="' + json.user_url + '"' : '<span';
- html += ' class="comment-user">' + json.user_display_name + (json.user_url ? '</a>' : '</span>');
- html += ' <span class="comment-date">(' + json.add_date + ')</span>';
-
- if (json.delete_url) {
- var img = "/content/images/close-small.png";
- var imgHover = "/content/images/close-small-hover.png";
- html += '<img onclick="' + objectType + 'Comments.deleteComment($(this), ' + json.object_id + ', \'' + json.delete_url + '\')" src="' + img;
- html += '" onmouseover="$(this).attr(\'src\', \'' + imgHover + '\')" onmouseout="$(this).attr(\'src\', \'' + img
- html += '\')" title="' + $.i18n._('delete this comment') + '" />';
- }
-
- html += '</div>';
-
- jDiv.append(html);
- };
-
- var postComment = function(id, formId) {
- appendLoaderImg(id);
-
- var formSelector = "#" + formId;
- var textarea = $(formSelector + " textarea");
-
- $.ajax({
- type: "POST",
- url: "/" + objectType + "s/" + id + "/comments/",
- dataType: "json",
- data: { comment: textarea.val() },
- success: function(json) {
- showComments(id, json);
- textarea.val("");
- commentsFactory[objectType].updateTextCounter(textarea);
- enableSubmitButton(formSelector);
- },
- error: function(res, textStatus, errorThrown) {
- removeLoader();
- showMessage(formSelector, res.responseText);
- enableSubmitButton(formSelector);
- }
- });
- };
-
- // public methods..
- return {
-
- init: function() {
- // Setup "show comments" clicks..
- $("a[id^='comments-link-" + objectType + "-" + "']").unbind("click").click(function() { commentsFactory[objectType].show($(this).attr("id").substr(("comments-link-" + objectType + "-").length)); });
- },
-
- show: function(id) {
- var jDiv = jDivInit(id);
- getComments(id, jDiv);
- renderForm(id, jDiv);
- jDiv.show();
- if (canPostComments(id, jDiv)) jDiv.find("textarea").get(0).focus();
- jDiv.siblings("a").unbind("click").click(function(){
- commentsFactory[objectType].hide(id);
- }).text($.i18n._('hide comments'));
- },
-
- hide: function(id) {
- var jDiv = jDivInit(id);
- var len = jDiv.children("div.comments").children().length;
- var anchorText = len == 0 ? $.i18n._('add a comment') : $.i18n._('comments') + ' (<b>' + len + "</b>)";
-
- jDiv.hide();
- jDiv.siblings("a").unbind("click").click(function() { commentsFactory[objectType].show(id); }).html(anchorText);
- jDiv.children("div.comments").children().hide();
- },
-
- deleteComment: function(jImg, id, deleteUrl) {
- if (confirm($.i18n._('confirm delete comment'))) {
- jImg.hide();
- appendLoaderImg(id);
- $.post(deleteUrl, { dataNeeded: "forIIS7" }, function(json) {
- showComments(id, json);
- }, "json");
- }
- },
-
- updateTextCounter: function(textarea) {
- var length = textarea.value ? textarea.value.length : 0;
- var color = length > 270 ? "#f00" : length > 200 ? "#f60" : "#999";
- var jSpan = $(textarea).siblings("span.text-counter");
- jSpan.html($.i18n._('can write')
- + (300 - length) + ' '
- + $.i18n._('characters')).css("color", color);
- }
- };
-}
-
-var questionComments = createComments('question');
-var answerComments = createComments('answer');
-
-$().ready(function() {
- questionComments.init();
- answerComments.init();
-});
-
-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_gt = />/g; var pr_quot = /\"/g; function attribToHtml(str) { return str.replace(pr_amp, '&amp;').replace(pr_lt, '&lt;').replace(pr_gt, '&gt;').replace(pr_quot, '&quot;'); } function textToHtml(str) { return str.replace(pr_amp, '&amp;').replace(pr_lt, '&lt;').replace(pr_gt, '&gt;'); } var pr_ltEnt = /&lt;/g; var pr_gtEnt = /&gt;/g; var pr_aposEnt = /&apos;/g; var pr_quotEnt = /&quot;/g; var pr_ampEnt = /&amp;/g; var pr_nbspEnt = /&nbsp;/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('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />')); PR_innerHtmlWorks = !/</.test(testNode.innerHTML); } if (PR_innerHtmlWorks) { var content = node.innerHTML; if (isRawContent(node)) { content = textToHtml(content); } return content; } var out = []; for (var child = node.firstChild; child; child = child.nextSibling) { normalizedHtml(child, out); } return out.join(''); } function makeTabExpander(tabWidth) { var SPACES = ' '; var charInLine = 0; return function(plainText) { var out = null; var pos = 0; for (var i = 0, n = plainText.length; i < n; ++i) { var ch = plainText.charAt(i); switch (ch) { case '\t': if (!out) { out = []; } out.push(plainText.substring(pos, i)); var nSpaces = tabWidth - (charInLine % tabWidth); charInLine += nSpaces; for (; nSpaces >= 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 = /(?:[^<]+|<!--[\s\S]*?-->|<!\[CDATA\[([\s\S]*?)\]\]>|<\/?[a-zA-Z][^>]*>|<)/g; var pr_commentPrefix = /^<!--/; var pr_cdataPrefix = /^<\[CDATA\[/; var pr_brPrefix = /^<br\b/i; var pr_tagNameRe = /^<(\/?)([a-zA-Z]+)/; function extractTags(s) { var matches = s.match(pr_chunkPattern); var sourceBuf = []; var sourceBufLen = 0; var extractedTags = []; if (matches) { for (var i = 0, n = matches.length; i < n; ++i) { var match = matches[i]; if (match.length > 1 && match.charAt(0) === '<') { if (pr_commentPrefix.test(match)) { continue; } if (pr_cdataPrefix.test(match)) { sourceBuf.push(match.substring(9, match.length - 3)); sourceBufLen += match.length - 12; } else if (pr_brPrefix.test(match)) { sourceBuf.push('\n'); ++sourceBufLen; } else { if (match.indexOf(PR_NOCODE) >= 0 && isNoCodeTag(match)) { var name = match.match(pr_tagNameRe)[2]; var depth = 1; end_tag_loop: for (var j = i + 1; j < n; ++j) { var name2 = matches[j].match(pr_tagNameRe); if (name2 && name2[2] === name) { if (name2[1] === '/') { if (--depth === 0) { break end_tag_loop; } } else { ++depth; } } } if (j < n) { extractedTags.push(sourceBufLen, matches.slice(i, j + 1).join('')); i = j; } else { extractedTags.push(sourceBufLen, match); } } else { extractedTags.push(sourceBufLen, match); } } } else { var literalText = htmlToText(match); sourceBuf.push(literalText); sourceBufLen += literalText.length; } } } return { source: sourceBuf.join(''), tags: extractedTags }; } function isNoCodeTag(tag) { return !!tag.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g, ' $1="$2$3$4"').match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/); } function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) { var shortcuts = {}; (function() { var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns); for (var i = allPatterns.length; --i >= 0; ) { var patternParts = allPatterns[i]; var shortcutChars = patternParts[3]; if (shortcutChars) { for (var c = shortcutChars.length; --c >= 0; ) { shortcuts[shortcutChars.charAt(c)] = patternParts; } } } })(); var nPatterns = fallthroughStylePatterns.length; var notWs = /\S/; return function(sourceCode, opt_basePos) { opt_basePos = opt_basePos || 0; var decorations = [opt_basePos, PR_PLAIN]; var lastToken = ''; var pos = 0; var tail = sourceCode; while (tail.length) { var style; var token = null; var match; var patternParts = shortcuts[tail.charAt(0)]; if (patternParts) { match = tail.match(patternParts[1]); token = match[0]; style = patternParts[0]; } else { for (var i = 0; i < nPatterns; ++i) { patternParts = fallthroughStylePatterns[i]; var contextPattern = patternParts[2]; if (contextPattern && !contextPattern.test(lastToken)) { continue; } match = tail.match(patternParts[1]); if (match) { token = match[0]; style = patternParts[0]; break; } } if (!token) { style = PR_PLAIN; token = tail.substring(0, 1); } } decorations.push(opt_basePos + pos, style); pos += token.length; tail = tail.substring(token.length); if (style !== PR_COMMENT && notWs.test(token)) { lastToken = token; } } return decorations; }; } var PR_MARKUP_LEXER = createSimpleLexer([], [[PR_PLAIN, /^[^<]+/, null], [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/, null], [PR_COMMENT, /^<!--[\s\S]*?(?:-->|$)/, 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:\-]+/, /^</], [PR_ATTRIB_VALUE, /^[\w\-]+/, /^=/], [PR_ATTRIB_NAME, /^[\w:\-]+/, null], [PR_PLAIN, /^\s+/, null, ' \t\r\n']]); function splitTagAttributes(source, decorations) { for (var i = 0; i < decorations.length; i += 2) { var style = decorations[i + 1]; if (style === PR_TAG) { var start, end; start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; var chunk = source.substring(start, end); var subDecorations = PR_TAG_LEXER(chunk, start); spliceArrayInto(subDecorations, decorations, i, 2); i += subDecorations.length - 2; } } return decorations; } function sourceDecorator(options) { var shortcutStylePatterns = [], fallthroughStylePatterns = []; if (options.tripleQuotedStrings) { shortcutStylePatterns.push([PR_STRING, /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, null, '\'"']); } else if (options.multiLineStrings) { shortcutStylePatterns.push([PR_STRING, /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/, null, '\'"`']); } else { shortcutStylePatterns.push([PR_STRING, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/, null, '"\'']); } fallthroughStylePatterns.push([PR_PLAIN, /^(?:[^\'\"\`\/\#]+)/, null, ' \r\n']); if (options.hashComments) { shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']); } if (options.cStyleComments) { fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]); fallthroughStylePatterns.push([PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]); } if (options.regexLiterals) { var REGEX_LITERAL = ('^/(?=[^/*])' + '(?:[^/\\x5B\\x5C]' + '|\\x5C[\\s\\S]' + '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+' + '(?:/|$)'); fallthroughStylePatterns.push([PR_STRING, new RegExp(REGEX_LITERAL), REGEXP_PRECEDER_PATTERN]); } var keywords = wordSet(options.keywords); options = null; var splitStringAndCommentTokens = createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns); var styleLiteralIdentifierPuncRecognizer = createSimpleLexer([], [[PR_PLAIN, /^\s+/, null, ' \r\n'], [PR_PLAIN, /^[a-z_$@][a-z_$@0-9]*/i, null], [PR_LITERAL, /^0x[a-f0-9]+[a-z]/i, null], [PR_LITERAL, /^(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?[a-z]*/i, null, '123456789'], [PR_PUNCTUATION, /^[^\s\w\.$@]+/, null]]); function splitNonStringNonCommentTokens(source, decorations) { for (var i = 0; i < decorations.length; i += 2) { var style = decorations[i + 1]; if (style === PR_PLAIN) { var start, end, chunk, subDecs; start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; chunk = source.substring(start, end); subDecs = styleLiteralIdentifierPuncRecognizer(chunk, start); for (var j = 0, m = subDecs.length; j < m; j += 2) { var subStyle = subDecs[j + 1]; if (subStyle === PR_PLAIN) { var subStart = subDecs[j]; var subEnd = j + 2 < m ? subDecs[j + 2] : chunk.length; var token = source.substring(subStart, subEnd); if (token === '.') { subDecs[j + 1] = PR_PUNCTUATION; } else if (token in keywords) { subDecs[j + 1] = PR_KEYWORD; } else if (/^@?[A-Z][A-Z$]*[a-z][A-Za-z$]*$/.test(token)) { subDecs[j + 1] = token.charAt(0) === '@' ? PR_LITERAL : PR_TYPE; } } } spliceArrayInto(subDecs, decorations, i, 2); i += subDecs.length - 2; } } return decorations; } return function(sourceCode) { var decorations = splitStringAndCommentTokens(sourceCode); decorations = splitNonStringNonCommentTokens(sourceCode, decorations); return decorations; }; } var decorateSource = sourceDecorator({ keywords: ALL_KEYWORDS, hashComments: true, cStyleComments: true, multiLineStrings: true, regexLiterals: true }); function splitSourceNodes(source, decorations) { for (var i = 0; i < decorations.length; i += 2) { var style = decorations[i + 1]; if (style === PR_SOURCE) { var start, end; start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; var subDecorations = decorateSource(source.substring(start, end)); for (var j = 0, m = subDecorations.length; j < m; j += 2) { subDecorations[j] += start; } spliceArrayInto(subDecorations, decorations, i, 2); i += subDecorations.length - 2; } } return decorations; } function splitSourceAttributes(source, decorations) { var nextValueIsSource = false; for (var i = 0; i < decorations.length; i += 2) { var style = decorations[i + 1]; var start, end; if (style === PR_ATTRIB_NAME) { start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; nextValueIsSource = /^on|^style$/i.test(source.substring(start, end)); } else if (style === PR_ATTRIB_VALUE) { if (nextValueIsSource) { start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; var attribValue = source.substring(start, end); var attribLen = attribValue.length; var quoted = (attribLen >= 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('</span>'); openDecoration = null; } if (!openDecoration && currentDecoration) { openDecoration = currentDecoration; html.push('<span class="', openDecoration, '">'); } var htmlChunk = textToHtml(tabExpander(sourceText.substring(outputIdx, sourceIdx))).replace(lastWasSpace ? startOrSpaceRe : adjacentSpaceRe, '$1&nbsp;'); lastWasSpace = trailingSpaceRe.test(htmlChunk); html.push(htmlChunk.replace(newlineRe, '<br />')); 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('</span>'); 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('</span>'); } 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*</.test(source) ? 'default-markup' : 'default-code'; } var decorations = langHandlerRegistry[opt_langExtension].call({}, source); return recombineTagsAndDecorations(source, extractedTags, decorations); } catch (e) { if ('console' in window) { console.log(e); console.trace(); } return sourceCodeHtml; } } function prettyPrint(opt_whenDone) { var isIE6 = _pr_isIE6(); var codeSegments = [document.getElementsByTagName('pre'), document.getElementsByTagName('code'), document.getElementsByTagName('xmp')]; var elements = []; for (var i = 0; i < codeSegments.length; ++i) { for (var j = 0; j < codeSegments[i].length; ++j) { elements.push(codeSegments[i][j]); } } codeSegments = null; var k = 0; function doWork() { var endTime = (PR_SHOULD_USE_CONTINUATION ? new Date().getTime() + 250 : Infinity); for (; k < elements.length && new Date().getTime() < endTime; k++) { var cs = elements[k]; if (cs.className && cs.className.indexOf('prettyprint') >= 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
+/*
+Scripts for cnprog.com
+Project Name: Lanai
+All Rights Resevred 2008. CNPROG.COM
+*/
+var lanai =
+{
+ /**
+ * Finds any <pre><code></code></pre> tags which aren't registered for
+ * pretty printing, adds the appropriate class name and invokes prettify.
+ */
+ highlightSyntax: function(){
+ var styled = false;
+ $("pre code").parent().each(function(){
+ if (!$(this).hasClass('prettyprint')){
+ $(this).addClass('prettyprint');
+ styled = true;
+ }
+ });
+
+ if (styled){
+ prettyPrint();
+ }
+ }
+};
+
+var Vote = function(){
+ // All actions are related to a question
+ var questionId;
+ // The object we operate on actually. It can be a question or an answer.
+ var postId;
+ var questionAuthorId;
+ var currentUserId;
+ var answerContainerIdPrefix = 'answer-container-';
+ var voteContainerId = 'vote-buttons';
+ var imgIdPrefixAccept = 'answer-img-accept-';
+ var imgClassPrefixFavorite = 'question-img-favorite';
+ var imgIdPrefixQuestionVoteup = 'question-img-upvote-';
+ var imgIdPrefixQuestionVotedown = 'question-img-downvote-';
+ var imgIdPrefixAnswerVoteup = 'answer-img-upvote-';
+ var imgIdPrefixAnswerVotedown = 'answer-img-downvote-';
+ var divIdFavorite = 'favorite-number';
+ var commentLinkIdPrefix = 'comment-';
+ var voteNumberClass = "vote-number";
+ var offensiveIdPrefixQuestionFlag = 'question-offensive-flag-';
+ var offensiveIdPrefixAnswerFlag = 'answer-offensive-flag-';
+ var offensiveClassFlag = 'offensive-flag';
+ 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 users cannot select favorite questions')
+ + "<a href='/account/signin/?next=/questions/{{QuestionID}}'>"
+ + $.i18n._('please login') + "</a>";
+ var voteAnonymousMessage = $.i18n._('anonymous users cannot vote')
+ + "<a href='/account/signin/?next=/questions/{{QuestionID}}'>"
+ + $.i18n._('please login') + "</a>";
+ var upVoteRequiredScoreMessage = $.i18n._('>15 points requried to upvote')
+ + $.i18n._('please see') + "<a href='/faq'>faq</a>";
+ var downVoteRequiredScoreMessage = $.i18n._('>100 points requried to downvote')
+ + $.i18n._('please see') + "<a href='/faq'>faq</a>";
+ var voteOwnDeniedMessage = $.i18n._('cannot vote for own posts');
+ var voteRequiredMoreVotes = $.i18n._('daily vote cap exhausted')
+ + $.i18n._('please see') + "<a href='/faq'>faq</a>";
+ var voteDenyCancelMessage = $.i18n._('cannot revoke old vote')
+ + $.i18n._('please see') + "<a href='/faq'>faq</a>";
+ var offensiveConfirmation = $.i18n._('please confirm offensive');
+ var offensiveAnonymousMessage = $.i18n._('anonymous users cannot flag offensive posts')
+ + "<a href='/account/signin/?next=/questions/{{QuestionID}}'>"
+ + $.i18n._('please login') + "</a>";
+ var offensiveTwiceMessage = $.i18n._('cannot flag message as offensive twice')
+ + $.i18n._('please see') + "<a href='/faq'>faq</a>";
+ var offensiveNoFlagsLeftMessage = $.i18n._('flag offensive cap exhausted')
+ + $.i18n._('please see') + "<a href='/faq'>faq</a>";
+ var offensiveNoPermissionMessage = $.i18n._('need >15 points to report spam')
+ + $.i18n._('please see') + "<a href='/faq'>faq</a>";
+ var removeConfirmation = $.i18n._('confirm delete');
+ var removeAnonymousMessage = $.i18n._('anonymous users cannot delete/undelete');
+ var recoveredMessage = $.i18n._('post recovered');
+ var deletedMessage = $.i18n._('post deleted');
+
+ var VoteType = {
+ acceptAnswer : 0,
+ questionUpVote : 1,
+ questionDownVote : 2,
+ favorite : 4,
+ answerUpVote: 5,
+ answerDownVote:6,
+ offensiveQuestion : 7,
+ offensiveAnswer:8,
+ removeQuestion: 9,
+ removeAnswer:10,
+ questionSubscribeUpdates:11,
+ questionUnsubscribeUpdates:12,
+ };
+
+ var getFavoriteButton = function(){
+ var favoriteButton = 'div.'+ voteContainerId +' img[class='+ imgClassPrefixFavorite +']';
+ return $(favoriteButton);
+ };
+ var getFavoriteNumber = function(){
+ var favoriteNumber = '#'+ divIdFavorite ;
+ return $(favoriteNumber);
+ };
+ var getQuestionVoteUpButton = function(){
+ var questionVoteUpButton = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixQuestionVoteup +']';
+ return $(questionVoteUpButton);
+ };
+ var getQuestionVoteDownButton = function(){
+ var questionVoteDownButton = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixQuestionVotedown +']';
+ return $(questionVoteDownButton);
+ };
+ var getAnswerVoteUpButtons = function(){
+ var answerVoteUpButton = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAnswerVoteup +']';
+ return $(answerVoteUpButton);
+ };
+ var getAnswerVoteDownButtons = function(){
+ var answerVoteDownButton = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAnswerVotedown +']';
+ return $(answerVoteDownButton);
+ };
+ var getAnswerVoteUpButton = function(id){
+ var answerVoteUpButton = 'div.'+ voteContainerId +' img[id='+ imgIdPrefixAnswerVoteup + id + ']';
+ return $(answerVoteUpButton);
+ };
+ var getAnswerVoteDownButton = function(id){
+ var answerVoteDownButton = 'div.'+ voteContainerId +' img[id='+ imgIdPrefixAnswerVotedown + id + ']';
+ return $(answerVoteDownButton);
+ };
+
+ var getOffensiveQuestionFlag = function(){
+ var offensiveQuestionFlag = 'table[id=question-table] span[class='+ offensiveClassFlag +']';
+ return $(offensiveQuestionFlag);
+ };
+
+ var getOffensiveAnswerFlags = function(){
+ var offensiveQuestionFlag = 'div.answer span[class='+ offensiveClassFlag +']';
+ return $(offensiveQuestionFlag);
+ };
+
+ var getremoveQuestionLink = 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 +']';
+ return $(removeAnswerLinks);
+ };
+
+ var setVoteImage = function(voteType, undo, object){
+ var flag = undo ? "" : "-on";
+ var arrow = (voteType == VoteType.questionUpVote || voteType == VoteType.answerUpVote) ? "up" : "down";
+ object.attr("src", "/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", "/content/images/vote-arrow-up.png");
+ $(getQuestionVoteDownButton()).attr("src", "/content/images/vote-arrow-down.png");
+ }
+ else{
+ $(getAnswerVoteUpButton(postId)).attr("src", "/content/images/vote-arrow-up.png");
+ $(getAnswerVoteDownButton(postId)).attr("src", "/content/images/vote-arrow-down.png");
+ }
+ }
+ };
+
+ var setVoteNumber = function(object, number){
+ var voteNumber = object.parent('div.'+ voteContainerId).find('div.'+ voteNumberClass);
+ $(voteNumber).text(number);
+ };
+
+ var bindEvents = function(){
+ // accept answers
+ if(questionAuthorId == currentUserId){
+ var acceptedButtons = 'div.'+ voteContainerId +' img[id^='+ imgIdPrefixAccept +']';
+ $(acceptedButtons).unbind('click').click(function(event){
+ Vote.accept($(event.target))
+ });
+ }
+ // set favorite question
+ var favoriteButton = getFavoriteButton();
+ favoriteButton.unbind('click').click(function(event){
+ Vote.favorite($(event.target))
+ });
+
+ // question vote up
+ var questionVoteUpButton = getQuestionVoteUpButton();
+ questionVoteUpButton.unbind('click').click(function(event){
+ Vote.vote($(event.target), VoteType.questionUpVote)
+ });
+
+ var questionVoteDownButton = getQuestionVoteDownButton();
+ questionVoteDownButton.unbind('click').click(function(event){
+ Vote.vote($(event.target), VoteType.questionDownVote)
+ });
+
+ var answerVoteUpButton = getAnswerVoteUpButtons();
+ answerVoteUpButton.unbind('click').click(function(event){
+ Vote.vote($(event.target), VoteType.answerUpVote)
+ });
+
+ var answerVoteDownButton = getAnswerVoteDownButtons();
+ answerVoteDownButton.unbind('click').click(function(event){
+ Vote.vote($(event.target), VoteType.answerDownVote)
+ });
+
+ getOffensiveQuestionFlag().unbind('click').click(function(event){
+ Vote.offensive(this, VoteType.offensiveQuestion)
+ });
+
+ getOffensiveAnswerFlags().unbind('click').click(function(event){
+ Vote.offensive(this, VoteType.offensiveAnswer)
+ });
+
+ 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)
+ });
+ };
+
+ var submit = function(object, voteType, callback) {
+ $.ajax({
+ type: "POST",
+ cache: false,
+ dataType: "json",
+ url: "/questions/" + questionId + "/vote/",
+ data: { "type": voteType, "postId": postId },
+ error: handleFail,
+ success: function(data){callback(object, voteType, data)}});
+ };
+
+ var handleFail = function(xhr, msg){
+ alert("Callback invoke error: " + msg)
+ };
+
+ // callback function for Accept Answer action
+ var callback_accept = function(object, voteType, data){
+ if(data.allowed == "0" && data.success == "0"){
+ showMessage(object, acceptAnonymousMessage);
+ }
+ else if(data.allowed == "-1"){
+ showMessage(object, acceptOwnAnswerMessage);
+ }
+ else if(data.status == "1"){
+ object.attr("src", "/content/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", "/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", "/content/images/vote-accepted-on.png");
+ $("#"+answerContainerIdPrefix+postId).addClass("accepted-answer");
+ $("#"+commentLinkIdPrefix+postId).addClass("comment-link-accepted");
+ }
+ else{
+ showMessage(object, data.message);
+ }
+ };
+
+ var callback_favorite = function(object, voteType, data){
+ if(data.allowed == "0" && data.success == "0"){
+ showMessage(object, favoriteAnonymousMessage.replace("{{QuestionID}}", questionId));
+ }
+ else if(data.status == "1"){
+ object.attr("src", "/content/images/vote-favorite-off.png");
+ var fav = getFavoriteNumber();
+ fav.removeClass("my-favorite-number");
+ if(data.count == 0)
+ data.count = '';
+ fav.text(data.count);
+ }
+ else if(data.success == "1"){
+ object.attr("src", "/content/images/vote-favorite-on.png");
+ var fav = getFavoriteNumber();
+ fav.text(data.count);
+ fav.addClass("my-favorite-number");
+ }
+ else{
+ showMessage(object, data.message);
+ }
+ };
+
+ var callback_vote = function(object, voteType, data){
+ if(data.allowed == "0" && data.success == "0"){
+ showMessage(object, voteAnonymousMessage.replace("{{QuestionID}}", questionId));
+ }
+ else if(data.allowed == "-3"){
+ showMessage(object, voteRequiredMoreVotes);
+ }
+ else if(data.allowed == "-2"){
+ if(voteType == VoteType.questionUpVote || voteType == VoteType.answerUpVote){
+ showMessage(object, upVoteRequiredScoreMessage);
+ }
+ else if(voteType == VoteType.questionDownVote || voteType == VoteType.answerDownVote){
+ showMessage(object, downVoteRequiredScoreMessage);
+ }
+ }
+ else if(data.allowed == "-1"){
+ showMessage(object, voteOwnDeniedMessage);
+ }
+ else if(data.status == "2"){
+ showMessage(object, voteDenyCancelMessage);
+ }
+ else if(data.status == "1"){
+ setVoteImage(voteType, true, object);
+ setVoteNumber(object, data.count);
+ }
+ else if(data.success == "1"){
+ setVoteImage(voteType, false, object);
+ setVoteNumber(object, data.count);
+ if(data.message.length > 0)
+ showMessage(object, data.message);
+ }
+ };
+
+ var callback_offensive = function(object, voteType, data){
+ object = $(object);
+ if(data.allowed == "0" && data.success == "0"){
+ showMessage(object, offensiveAnonymousMessage.replace("{{QuestionID}}", questionId));
+ }
+ else if(data.allowed == "-3"){
+ showMessage(object, offensiveNoFlagsLeftMessage);
+ }
+ else if(data.allowed == "-2"){
+ showMessage(object, offensiveNoPermissionMessage);
+ }
+ else if(data.status == "1"){
+ showMessage(object, offensiveTwiceMessage);
+ }
+ else if(data.success == "1"){
+ $(object).children('span[class=darkred]').text("("+ data.count +")");
+ }
+ };
+
+ var callback_remove = function(object, voteType, data){
+ if(data.allowed == "0" && data.success == "0"){
+ showMessage(object, removeAnonymousMessage.replace("{{QuestionID}}", questionId));
+ }
+ else if (data.success == "1"){
+ if (removeActionType == 'delete'){
+ postNode.addClass('deleted');
+ postRemoveLink.innerHTML = $.i18n._('undelete');
+ showMessage(object, deletedMessage);
+ }
+ else if (removeActionType == 'undelete') {
+ postNode.removeClass('deleted');
+ postRemoveLink.innerHTML = $.i18n._('delete');
+ showMessage(object, recoveredMessage);
+ }
+ }
+ };
+
+ return {
+ init : function(qId, questionAuthor, userId){
+ questionId = qId;
+ questionAuthorId = questionAuthor;
+ currentUserId = userId;
+ bindEvents();
+ },
+
+ // Accept answer public function
+ accept: function(object){
+ postId = object.attr("id").substring(imgIdPrefixAccept.length);
+ submit(object, VoteType.acceptAnswer, callback_accept);
+ },
+
+ favorite: function(object){
+ if(!currentUserId || currentUserId.toUpperCase() == "NONE"){
+ showMessage(object, favoriteAnonymousMessage.replace("{{QuestionID}}", questionId));
+ return false;
+ }
+ submit(object, VoteType.favorite, callback_favorite);
+ },
+
+ vote: function(object, voteType){
+ if(!currentUserId || currentUserId.toUpperCase() == "NONE"){
+ showMessage(object, voteAnonymousMessage.replace("{{QuestionID}}", questionId));
+ return false;
+ }
+ if(voteType == VoteType.answerUpVote){
+ postId = object.attr("id").substring(imgIdPrefixAnswerVoteup.length);
+ }
+ else if(voteType == VoteType.answerDownVote){
+ postId = object.attr("id").substring(imgIdPrefixAnswerVotedown.length);
+ }
+
+ submit(object, voteType, callback_vote);
+ },
+
+ offensive: function(object, voteType){
+ if(!currentUserId || currentUserId.toUpperCase() == "NONE"){
+ showMessage($(object), offensiveAnonymousMessage.replace("{{QuestionID}}", questionId));
+ return false;
+ }
+ if(confirm(offensiveConfirmation)){
+ postId = object.id.substr(object.id.lastIndexOf('-') + 1);
+ submit(object, voteType, callback_offensive);
+ }
+ },
+
+ remove: function(object, voteType){
+ if(!currentUserId || currentUserId.toUpperCase() == "NONE"){
+ showMessage($(object), removeAnonymousMessage.replace("{{QuestionID}}", questionId));
+ return false;
+ }
+ if(confirm(removeConfirmation)){
+ bits = object.id.split('-');
+ postId = bits.pop();/* this seems to be used within submit! */
+ postType = bits.shift();
+
+ if (postType == 'answer'){
+ postNode = $('#answer-container-' + postId);
+ postRemoveLink = object;
+ if (postNode.hasClass('deleted')){
+ removeActionType = 'undelete';
+ }
+ else {
+ removeActionType = 'delete';
+ }
+ }
+ submit($(object), voteType, callback_remove);
+
+
+ }
+ }
+ }
+} ();
+
+
+// site comments
+function createComments(type) {
+ var objectType = type;
+ var jDivInit = function(id) {
+ return $("#comments-" + objectType + '-' + id);
+ };
+
+ var appendLoaderImg = function(id) {
+ appendLoader("#comments-" + objectType + '-' + id + " div.comments");
+ };
+
+ var canPostComments = function(id, jDiv) {
+ var jHidden = jDiv.siblings("#can-post-comments-" + objectType + '-' + id);
+ return jHidden.val().toLowerCase() == "true";
+ };
+
+ var renderForm = function(id, jDiv) {
+ var formId = "form-comments-" + objectType + "-" + id;
+ if (canPostComments(id, jDiv)) {
+ if (jDiv.find("#" + formId).length == 0) {
+ var form = '<form id="' + formId + '" class="post-comments"><div>';
+ form += '<textarea name="comment" cols="60" rows="5" maxlength="300" onblur="'+ objectType +'Comments.updateTextCounter(this)" ';
+ form += 'onfocus="' + objectType + 'Comments.updateTextCounter(this)" onkeyup="'+ objectType +'Comments.updateTextCounter(this)"></textarea>';
+ form += '<input type="submit" value="'
+ + $.i18n._('add comment') + '" /><br><span class="text-counter"></span>';
+ form += '<span class="form-error"></span></div></form>';
+
+ jDiv.append(form);
+
+ setupFormValidation("#" + formId,
+ { comment: { required: true, minlength: 10} }, '',
+ function() { postComment(id, formId); });
+ }
+ }
+ else {
+ var divId = "comments-rep-needed-" + objectType + '-' + id;
+ if (jDiv.find("#" + divId).length == 0) {
+ jDiv.append('<div id="' + divId + '" style="color:red">'
+ + $.i18n._('to comment, need') + ' ' +
+ + repNeededForComments + ' ' + $.i18n._('community reputation points')
+ + '<a href="/faq" class="comment-user">' + $.i18n._('please see') + 'faq</a></span>');
+ }
+ }
+ };
+
+ var getComments = function(id, jDiv) {
+ appendLoaderImg(id);
+ $.getJSON("/" + objectType + "s/" + id + "/comments/", function(json) { showComments(id, json); });
+ };
+
+ var showComments = function(id, json) {
+ var jDiv = jDivInit(id);
+
+ jDiv = jDiv.find("div.comments"); // this div should contain any fetched comments..
+ jDiv.find("div[id^='comment-" + objectType + "-'" + "]").remove(); // clean previous calls..
+
+ removeLoader();
+
+ if (json && json.length > 0) {
+ for (var i = 0; i < json.length; i++)
+ renderComment(jDiv, json[i]);
+
+ jDiv.children().show();
+ }
+ };
+
+ // {"Id":6,"PostId":38589,"CreationDate":"an hour ago","Text":"hello there!","UserDisplayName":"Jarrod Dixon","UserUrl":"/users/3/jarrod-dixon","DeleteUrl":null}
+ var renderComment = function(jDiv, json) {
+ var html = '<div id="comment-' + objectType + "-" + json.id + '" style="display:none">' + json.text;
+ html += json.user_url ? '&nbsp;&ndash;&nbsp;<a href="' + json.user_url + '"' : '<span';
+ html += ' class="comment-user">' + json.user_display_name + (json.user_url ? '</a>' : '</span>');
+ html += ' <span class="comment-date">(' + json.add_date + ')</span>';
+
+ if (json.delete_url) {
+ var img = "/content/images/close-small.png";
+ var imgHover = "/content/images/close-small-hover.png";
+ html += '<img onclick="' + objectType + 'Comments.deleteComment($(this), ' + json.object_id + ', \'' + json.delete_url + '\')" src="' + img;
+ html += '" onmouseover="$(this).attr(\'src\', \'' + imgHover + '\')" onmouseout="$(this).attr(\'src\', \'' + img
+ html += '\')" title="' + $.i18n._('delete this comment') + '" />';
+ }
+
+ html += '</div>';
+
+ jDiv.append(html);
+ };
+
+ var postComment = function(id, formId) {
+ appendLoaderImg(id);
+
+ var formSelector = "#" + formId;
+ var textarea = $(formSelector + " textarea");
+
+ $.ajax({
+ type: "POST",
+ url: "/" + objectType + "s/" + id + "/comments/",
+ dataType: "json",
+ data: { comment: textarea.val() },
+ success: function(json) {
+ showComments(id, json);
+ textarea.val("");
+ commentsFactory[objectType].updateTextCounter(textarea);
+ enableSubmitButton(formSelector);
+ },
+ error: function(res, textStatus, errorThrown) {
+ removeLoader();
+ showMessage(formSelector, res.responseText);
+ enableSubmitButton(formSelector);
+ }
+ });
+ };
+
+ // public methods..
+ return {
+
+ init: function() {
+ // Setup "show comments" clicks..
+ $("a[id^='comments-link-" + objectType + "-" + "']").unbind("click").click(function() { commentsFactory[objectType].show($(this).attr("id").substr(("comments-link-" + objectType + "-").length)); });
+ },
+
+ show: function(id) {
+ var jDiv = jDivInit(id);
+ getComments(id, jDiv);
+ renderForm(id, jDiv);
+ jDiv.show();
+ if (canPostComments(id, jDiv)) jDiv.find("textarea").get(0).focus();
+ jDiv.siblings("a").unbind("click").click(function(){
+ commentsFactory[objectType].hide(id);
+ }).text($.i18n._('hide comments'));
+ },
+
+ hide: function(id) {
+ var jDiv = jDivInit(id);
+ var len = jDiv.children("div.comments").children().length;
+ var anchorText = len == 0 ? $.i18n._('add a comment') : $.i18n._('comments') + ' (<b>' + len + "</b>)";
+
+ jDiv.hide();
+ jDiv.siblings("a").unbind("click").click(function() { commentsFactory[objectType].show(id); }).html(anchorText);
+ jDiv.children("div.comments").children().hide();
+ },
+
+ deleteComment: function(jImg, id, deleteUrl) {
+ if (confirm($.i18n._('confirm delete comment'))) {
+ jImg.hide();
+ appendLoaderImg(id);
+ $.post(deleteUrl, { dataNeeded: "forIIS7" }, function(json) {
+ showComments(id, json);
+ }, "json");
+ }
+ },
+
+ updateTextCounter: function(textarea) {
+ var length = textarea.value ? textarea.value.length : 0;
+ var color = length > 270 ? "#f00" : length > 200 ? "#f60" : "#999";
+ var jSpan = $(textarea).siblings("span.text-counter");
+ jSpan.html($.i18n._('can write')
+ + (300 - length) + ' '
+ + $.i18n._('characters')).css("color", color);
+ }
+ };
+}
+
+var questionComments = createComments('question');
+var answerComments = createComments('answer');
+
+$().ready(function() {
+ questionComments.init();
+ answerComments.init();
+});
+
+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_gt = />/g; var pr_quot = /\"/g; function attribToHtml(str) { return str.replace(pr_amp, '&amp;').replace(pr_lt, '&lt;').replace(pr_gt, '&gt;').replace(pr_quot, '&quot;'); } function textToHtml(str) { return str.replace(pr_amp, '&amp;').replace(pr_lt, '&lt;').replace(pr_gt, '&gt;'); } var pr_ltEnt = /&lt;/g; var pr_gtEnt = /&gt;/g; var pr_aposEnt = /&apos;/g; var pr_quotEnt = /&quot;/g; var pr_ampEnt = /&amp;/g; var pr_nbspEnt = /&nbsp;/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('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />')); PR_innerHtmlWorks = !/</.test(testNode.innerHTML); } if (PR_innerHtmlWorks) { var content = node.innerHTML; if (isRawContent(node)) { content = textToHtml(content); } return content; } var out = []; for (var child = node.firstChild; child; child = child.nextSibling) { normalizedHtml(child, out); } return out.join(''); } function makeTabExpander(tabWidth) { var SPACES = ' '; var charInLine = 0; return function(plainText) { var out = null; var pos = 0; for (var i = 0, n = plainText.length; i < n; ++i) { var ch = plainText.charAt(i); switch (ch) { case '\t': if (!out) { out = []; } out.push(plainText.substring(pos, i)); var nSpaces = tabWidth - (charInLine % tabWidth); charInLine += nSpaces; for (; nSpaces >= 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 = /(?:[^<]+|<!--[\s\S]*?-->|<!\[CDATA\[([\s\S]*?)\]\]>|<\/?[a-zA-Z][^>]*>|<)/g; var pr_commentPrefix = /^<!--/; var pr_cdataPrefix = /^<\[CDATA\[/; var pr_brPrefix = /^<br\b/i; var pr_tagNameRe = /^<(\/?)([a-zA-Z]+)/; function extractTags(s) { var matches = s.match(pr_chunkPattern); var sourceBuf = []; var sourceBufLen = 0; var extractedTags = []; if (matches) { for (var i = 0, n = matches.length; i < n; ++i) { var match = matches[i]; if (match.length > 1 && match.charAt(0) === '<') { if (pr_commentPrefix.test(match)) { continue; } if (pr_cdataPrefix.test(match)) { sourceBuf.push(match.substring(9, match.length - 3)); sourceBufLen += match.length - 12; } else if (pr_brPrefix.test(match)) { sourceBuf.push('\n'); ++sourceBufLen; } else { if (match.indexOf(PR_NOCODE) >= 0 && isNoCodeTag(match)) { var name = match.match(pr_tagNameRe)[2]; var depth = 1; end_tag_loop: for (var j = i + 1; j < n; ++j) { var name2 = matches[j].match(pr_tagNameRe); if (name2 && name2[2] === name) { if (name2[1] === '/') { if (--depth === 0) { break end_tag_loop; } } else { ++depth; } } } if (j < n) { extractedTags.push(sourceBufLen, matches.slice(i, j + 1).join('')); i = j; } else { extractedTags.push(sourceBufLen, match); } } else { extractedTags.push(sourceBufLen, match); } } } else { var literalText = htmlToText(match); sourceBuf.push(literalText); sourceBufLen += literalText.length; } } } return { source: sourceBuf.join(''), tags: extractedTags }; } function isNoCodeTag(tag) { return !!tag.replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g, ' $1="$2$3$4"').match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/); } function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) { var shortcuts = {}; (function() { var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns); for (var i = allPatterns.length; --i >= 0; ) { var patternParts = allPatterns[i]; var shortcutChars = patternParts[3]; if (shortcutChars) { for (var c = shortcutChars.length; --c >= 0; ) { shortcuts[shortcutChars.charAt(c)] = patternParts; } } } })(); var nPatterns = fallthroughStylePatterns.length; var notWs = /\S/; return function(sourceCode, opt_basePos) { opt_basePos = opt_basePos || 0; var decorations = [opt_basePos, PR_PLAIN]; var lastToken = ''; var pos = 0; var tail = sourceCode; while (tail.length) { var style; var token = null; var match; var patternParts = shortcuts[tail.charAt(0)]; if (patternParts) { match = tail.match(patternParts[1]); token = match[0]; style = patternParts[0]; } else { for (var i = 0; i < nPatterns; ++i) { patternParts = fallthroughStylePatterns[i]; var contextPattern = patternParts[2]; if (contextPattern && !contextPattern.test(lastToken)) { continue; } match = tail.match(patternParts[1]); if (match) { token = match[0]; style = patternParts[0]; break; } } if (!token) { style = PR_PLAIN; token = tail.substring(0, 1); } } decorations.push(opt_basePos + pos, style); pos += token.length; tail = tail.substring(token.length); if (style !== PR_COMMENT && notWs.test(token)) { lastToken = token; } } return decorations; }; } var PR_MARKUP_LEXER = createSimpleLexer([], [[PR_PLAIN, /^[^<]+/, null], [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/, null], [PR_COMMENT, /^<!--[\s\S]*?(?:-->|$)/, 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:\-]+/, /^</], [PR_ATTRIB_VALUE, /^[\w\-]+/, /^=/], [PR_ATTRIB_NAME, /^[\w:\-]+/, null], [PR_PLAIN, /^\s+/, null, ' \t\r\n']]); function splitTagAttributes(source, decorations) { for (var i = 0; i < decorations.length; i += 2) { var style = decorations[i + 1]; if (style === PR_TAG) { var start, end; start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; var chunk = source.substring(start, end); var subDecorations = PR_TAG_LEXER(chunk, start); spliceArrayInto(subDecorations, decorations, i, 2); i += subDecorations.length - 2; } } return decorations; } function sourceDecorator(options) { var shortcutStylePatterns = [], fallthroughStylePatterns = []; if (options.tripleQuotedStrings) { shortcutStylePatterns.push([PR_STRING, /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, null, '\'"']); } else if (options.multiLineStrings) { shortcutStylePatterns.push([PR_STRING, /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/, null, '\'"`']); } else { shortcutStylePatterns.push([PR_STRING, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/, null, '"\'']); } fallthroughStylePatterns.push([PR_PLAIN, /^(?:[^\'\"\`\/\#]+)/, null, ' \r\n']); if (options.hashComments) { shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']); } if (options.cStyleComments) { fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]); fallthroughStylePatterns.push([PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]); } if (options.regexLiterals) { var REGEX_LITERAL = ('^/(?=[^/*])' + '(?:[^/\\x5B\\x5C]' + '|\\x5C[\\s\\S]' + '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+' + '(?:/|$)'); fallthroughStylePatterns.push([PR_STRING, new RegExp(REGEX_LITERAL), REGEXP_PRECEDER_PATTERN]); } var keywords = wordSet(options.keywords); options = null; var splitStringAndCommentTokens = createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns); var styleLiteralIdentifierPuncRecognizer = createSimpleLexer([], [[PR_PLAIN, /^\s+/, null, ' \r\n'], [PR_PLAIN, /^[a-z_$@][a-z_$@0-9]*/i, null], [PR_LITERAL, /^0x[a-f0-9]+[a-z]/i, null], [PR_LITERAL, /^(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?[a-z]*/i, null, '123456789'], [PR_PUNCTUATION, /^[^\s\w\.$@]+/, null]]); function splitNonStringNonCommentTokens(source, decorations) { for (var i = 0; i < decorations.length; i += 2) { var style = decorations[i + 1]; if (style === PR_PLAIN) { var start, end, chunk, subDecs; start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; chunk = source.substring(start, end); subDecs = styleLiteralIdentifierPuncRecognizer(chunk, start); for (var j = 0, m = subDecs.length; j < m; j += 2) { var subStyle = subDecs[j + 1]; if (subStyle === PR_PLAIN) { var subStart = subDecs[j]; var subEnd = j + 2 < m ? subDecs[j + 2] : chunk.length; var token = source.substring(subStart, subEnd); if (token === '.') { subDecs[j + 1] = PR_PUNCTUATION; } else if (token in keywords) { subDecs[j + 1] = PR_KEYWORD; } else if (/^@?[A-Z][A-Z$]*[a-z][A-Za-z$]*$/.test(token)) { subDecs[j + 1] = token.charAt(0) === '@' ? PR_LITERAL : PR_TYPE; } } } spliceArrayInto(subDecs, decorations, i, 2); i += subDecs.length - 2; } } return decorations; } return function(sourceCode) { var decorations = splitStringAndCommentTokens(sourceCode); decorations = splitNonStringNonCommentTokens(sourceCode, decorations); return decorations; }; } var decorateSource = sourceDecorator({ keywords: ALL_KEYWORDS, hashComments: true, cStyleComments: true, multiLineStrings: true, regexLiterals: true }); function splitSourceNodes(source, decorations) { for (var i = 0; i < decorations.length; i += 2) { var style = decorations[i + 1]; if (style === PR_SOURCE) { var start, end; start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; var subDecorations = decorateSource(source.substring(start, end)); for (var j = 0, m = subDecorations.length; j < m; j += 2) { subDecorations[j] += start; } spliceArrayInto(subDecorations, decorations, i, 2); i += subDecorations.length - 2; } } return decorations; } function splitSourceAttributes(source, decorations) { var nextValueIsSource = false; for (var i = 0; i < decorations.length; i += 2) { var style = decorations[i + 1]; var start, end; if (style === PR_ATTRIB_NAME) { start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; nextValueIsSource = /^on|^style$/i.test(source.substring(start, end)); } else if (style === PR_ATTRIB_VALUE) { if (nextValueIsSource) { start = decorations[i]; end = i + 2 < decorations.length ? decorations[i + 2] : source.length; var attribValue = source.substring(start, end); var attribLen = attribValue.length; var quoted = (attribLen >= 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('</span>'); openDecoration = null; } if (!openDecoration && currentDecoration) { openDecoration = currentDecoration; html.push('<span class="', openDecoration, '">'); } var htmlChunk = textToHtml(tabExpander(sourceText.substring(outputIdx, sourceIdx))).replace(lastWasSpace ? startOrSpaceRe : adjacentSpaceRe, '$1&nbsp;'); lastWasSpace = trailingSpaceRe.test(htmlChunk); html.push(htmlChunk.replace(newlineRe, '<br />')); 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('</span>'); 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('</span>'); } 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*</.test(source) ? 'default-markup' : 'default-code'; } var decorations = langHandlerRegistry[opt_langExtension].call({}, source); return recombineTagsAndDecorations(source, extractedTags, decorations); } catch (e) { if ('console' in window) { console.log(e); console.trace(); } return sourceCodeHtml; } } function prettyPrint(opt_whenDone) { var isIE6 = _pr_isIE6(); var codeSegments = [document.getElementsByTagName('pre'), document.getElementsByTagName('code'), document.getElementsByTagName('xmp')]; var elements = []; for (var i = 0; i < codeSegments.length; ++i) { for (var j = 0; j < codeSegments[i].length; ++j) { elements.push(codeSegments[i][j]); } } codeSegments = null; var k = 0; function doWork() { var endTime = (PR_SHOULD_USE_CONTINUATION ? new Date().getTime() + 250 : Infinity); for (; k < elements.length && new Date().getTime() < endTime; k++) { var cs = elements[k]; if (cs.className && cs.className.indexOf('prettyprint') >= 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;c<Hilite.search_engines.length;c++){var f=Hilite.search_engines[c];e.compile("^http://(www\\.)?"+f[0],"i");var b=d.match(e);if(b){var a;if(isNaN(f[1])){a=Hilite.decodeReferrerQS(d,f[1])}else{a=b[f[1]+1]}if(a){a=decodeURIComponent(a);if(f.length>2&&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;b<e.length;b++){e[b]=e[b].toLowerCase();if(Hilite.exact){c.push("\\b"+e[b]+"\\b")}else{c.push(e[b])}}c=new RegExp(c.join("|"),"i");var a={};for(var b=0;b<e.length;b++){if(Hilite.style_name_suffix){a[e[b]]=Hilite.style_name+(b+1)}else{a[e[b]]=Hilite.style_name}}var d=function(m){var j=c.exec(m.data);if(j){var n=j[0];var i="";var h=m.splitText(j.index);var g=h.splitText(n.length);var l=m.ownerDocument.createElement("SPAN");m.parentNode.replaceChild(l,h);l.className=a[n.toLowerCase()];l.appendChild(h);return l}else{return m}};Hilite.walkElements(f.childNodes[0],1,d)};Hilite.hilite=function(){var a=Hilite.debug_referrer?Hilite.debug_referrer:document.referrer;var b=null;a=Hilite.decodeReferrer(a);if(a&&((Hilite.elementid&&(b=document.getElementById(Hilite.elementid)))||(b=document.body))){Hilite.hiliteElement(b,a)}};Hilite.walkElements=function(d,f,e){var a=/^(script|style|textarea)/i;var c=0;while(d&&f>0){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;c<Hilite.search_engines.length;c++){var f=Hilite.search_engines[c];e.compile("^http://(www\\.)?"+f[0],"i");var b=d.match(e);if(b){var a;if(isNaN(f[1])){a=Hilite.decodeReferrerQS(d,f[1])}else{a=b[f[1]+1]}if(a){a=decodeURIComponent(a);if(f.length>2&&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;b<e.length;b++){e[b]=e[b].toLowerCase();if(Hilite.exact){c.push("\\b"+e[b]+"\\b")}else{c.push(e[b])}}c=new RegExp(c.join("|"),"i");var a={};for(var b=0;b<e.length;b++){if(Hilite.style_name_suffix){a[e[b]]=Hilite.style_name+(b+1)}else{a[e[b]]=Hilite.style_name}}var d=function(m){var j=c.exec(m.data);if(j){var n=j[0];var i="";var h=m.splitText(j.index);var g=h.splitText(n.length);var l=m.ownerDocument.createElement("SPAN");m.parentNode.replaceChild(l,h);l.className=a[n.toLowerCase()];l.appendChild(h);return l}else{return m}};Hilite.walkElements(f.childNodes[0],1,d)};Hilite.hilite=function(){var a=Hilite.debug_referrer?Hilite.debug_referrer:document.referrer;var b=null;a=Hilite.decodeReferrer(a);if(a&&((Hilite.elementid&&(b=document.getElementById(Hilite.elementid)))||(b=document.body))){Hilite.hiliteElement(b,a)}};Hilite.walkElements=function(d,f,e){var a=/^(script|style|textarea)/i;var c=0;while(d&&f>0){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/js/jquery.ajaxfileupload.js b/templates/content/js/jquery.ajaxfileupload.js
index 106de906..75292776 100644
--- a/templates/content/js/jquery.ajaxfileupload.js
+++ b/templates/content/js/jquery.ajaxfileupload.js
@@ -1,195 +1,195 @@
-jQuery.extend({
- createUploadIframe: function(id, uri){
- //create frame
- var frameId = 'jUploadFrame' + id;
- if(window.ActiveXObject) {
- var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
- if(typeof uri== 'boolean'){
- io.src = 'javascript:false';
- }
- else if(typeof uri== 'string'){
- io.src = uri;
- }
- }
- else {
- var io = document.createElement('iframe');
- io.id = frameId;
- io.name = frameId;
- }
- io.style.position = 'absolute';
- io.style.top = '-1000px';
- io.style.left = '-1000px';
-
- document.body.appendChild(io);
- return io;
- },
- createUploadForm: function(id, fileElementId)
- {
- //create form
- var formId = 'jUploadForm' + id;
- var fileId = 'jUploadFile' + id;
- var form = $('<form action="" method="POST" name="' + formId + '" id="' + formId
- + '" enctype="multipart/form-data"></form>');
- var oldElement = $('#' + fileElementId);
- var newElement = $(oldElement).clone();
- $(oldElement).attr('id', fileId);
- $(oldElement).before(newElement);
- $(oldElement).appendTo(form);
- //set attributes
- $(form).css('position', 'absolute');
- $(form).css('top', '-1200px');
- $(form).css('left', '-1200px');
- $(form).appendTo('body');
- return form;
- },
-
- ajaxFileUpload: function(s) {
- // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
- s = jQuery.extend({}, jQuery.ajaxSettings, s);
- var id = new Date().getTime()
- var form = jQuery.createUploadForm(id, s.fileElementId);
- var io = jQuery.createUploadIframe(id, s.secureuri);
- var frameId = 'jUploadFrame' + id;
- var formId = 'jUploadForm' + id;
- // Watch for a new set of requests
- if ( s.global && ! jQuery.active++ )
- {
- jQuery.event.trigger( "ajaxStart" );
- }
- var requestDone = false;
- // Create the request object
- var xml = {}
- if ( s.global )
- jQuery.event.trigger("ajaxSend", [xml, s]);
- // Wait for a response to come back
- var uploadCallback = function(isTimeout)
- {
- var io = document.getElementById(frameId);
- try {
- if(io.contentWindow){
- xml.responseText = io.contentWindow.document.body ?
- io.contentWindow.document.body.innerText : null;
- xml.responseXML = io.contentWindow.document.XMLDocument ?
- io.contentWindow.document.XMLDocument : io.contentWindow.document;
-
- }
- else if(io.contentDocument)
- {
- xml.responseText = io.contentDocument.document.body ?
- io.contentDocument.document.body.textContent || document.body.innerText : null;
- xml.responseXML = io.contentDocument.document.XMLDocument ?
- io.contentDocument.document.XMLDocument : io.contentDocument.document;
- }
- }
- catch(e)
- {
- jQuery.handleError(s, xml, null, e);
- }
- if ( xml || isTimeout == "timeout")
- {
- requestDone = true;
- var status;
- try {
- status = isTimeout != "timeout" ? "success" : "error";
- // Make sure that the request was successful or notmodified
- if ( status != "error" )
- {
- // process the data (runs the xml through httpData regardless of callback)
- var data = jQuery.uploadHttpData( xml, s.dataType );
- // If a local callback was specified, fire it and pass it the data
- if ( s.success )
- s.success( data, status );
-
- // Fire the global callback
- if( s.global )
- jQuery.event.trigger( "ajaxSuccess", [xml, s] );
- } else
- jQuery.handleError(s, xml, status);
- } catch(e)
- {
- status = "error";
- jQuery.handleError(s, xml, status, e);
- }
-
- // The request was completed
- if( s.global )
- jQuery.event.trigger( "ajaxComplete", [xml, s] );
-
- // Handle the global AJAX counter
- if ( s.global && ! --jQuery.active )
- jQuery.event.trigger( "ajaxStop" );
-
- // Process result
- if ( s.complete )
- s.complete(xml, status);
-
- jQuery(io).unbind();
-
- setTimeout(function()
- { try
- {
- $(io).remove();
- $(form).remove();
-
- } catch(e) {
- jQuery.handleError(s, xml, null, e);
- }
- }, 100)
- xml = null;
- }
- }
- // Timeout checker
- if ( s.timeout > 0 ) {
- setTimeout(function(){
- // Check to see if the request is still happening
- if( !requestDone ) uploadCallback( "timeout" );
- }, s.timeout);
- }
- try
- {
- // var io = $('#' + frameId);
- var form = $('#' + formId);
- $(form).attr('action', s.url);
- $(form).attr('method', 'POST');
- $(form).attr('target', frameId);
- if(form.encoding)
- {
- form.encoding = 'multipart/form-data';
- }
- else
- {
- form.enctype = 'multipart/form-data';
- }
- $(form).submit();
-
- } catch(e)
- {
- jQuery.handleError(s, xml, null, e);
- }
- if(window.attachEvent){
- document.getElementById(frameId).attachEvent('onload', uploadCallback);
- }
- else{
- document.getElementById(frameId).addEventListener('load', uploadCallback, false);
- }
- return {abort: function () {}};
-
- },
-
- uploadHttpData: function( r, type ) {
- var data = !type;
- data = type == "xml" || data ? r.responseXML : r.responseText;
- // If the type is "script", eval it in global context
- if ( type == "script" )
- jQuery.globalEval( data );
- // Get the JavaScript object, if JSON is used.
- if ( type == "json" )
- eval( "data = " + data );
- // evaluate scripts within html
- if ( type == "html" )
- jQuery("<div>").html(data).evalScripts();
- //alert($('param', data).each(function(){alert($(this).attr('value'));}));
- return data;
- }
-})
-
+jQuery.extend({
+ createUploadIframe: function(id, uri){
+ //create frame
+ var frameId = 'jUploadFrame' + id;
+ if(window.ActiveXObject) {
+ var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
+ if(typeof uri== 'boolean'){
+ io.src = 'javascript:false';
+ }
+ else if(typeof uri== 'string'){
+ io.src = uri;
+ }
+ }
+ else {
+ var io = document.createElement('iframe');
+ io.id = frameId;
+ io.name = frameId;
+ }
+ io.style.position = 'absolute';
+ io.style.top = '-1000px';
+ io.style.left = '-1000px';
+
+ document.body.appendChild(io);
+ return io;
+ },
+ createUploadForm: function(id, fileElementId)
+ {
+ //create form
+ var formId = 'jUploadForm' + id;
+ var fileId = 'jUploadFile' + id;
+ var form = $('<form action="" method="POST" name="' + formId + '" id="' + formId
+ + '" enctype="multipart/form-data"></form>');
+ var oldElement = $('#' + fileElementId);
+ var newElement = $(oldElement).clone();
+ $(oldElement).attr('id', fileId);
+ $(oldElement).before(newElement);
+ $(oldElement).appendTo(form);
+ //set attributes
+ $(form).css('position', 'absolute');
+ $(form).css('top', '-1200px');
+ $(form).css('left', '-1200px');
+ $(form).appendTo('body');
+ return form;
+ },
+
+ ajaxFileUpload: function(s) {
+ // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
+ s = jQuery.extend({}, jQuery.ajaxSettings, s);
+ var id = new Date().getTime()
+ var form = jQuery.createUploadForm(id, s.fileElementId);
+ var io = jQuery.createUploadIframe(id, s.secureuri);
+ var frameId = 'jUploadFrame' + id;
+ var formId = 'jUploadForm' + id;
+ // Watch for a new set of requests
+ if ( s.global && ! jQuery.active++ )
+ {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+ var requestDone = false;
+ // Create the request object
+ var xml = {}
+ if ( s.global )
+ jQuery.event.trigger("ajaxSend", [xml, s]);
+ // Wait for a response to come back
+ var uploadCallback = function(isTimeout)
+ {
+ var io = document.getElementById(frameId);
+ try {
+ if(io.contentWindow){
+ xml.responseText = io.contentWindow.document.body ?
+ io.contentWindow.document.body.innerText : null;
+ xml.responseXML = io.contentWindow.document.XMLDocument ?
+ io.contentWindow.document.XMLDocument : io.contentWindow.document;
+
+ }
+ else if(io.contentDocument)
+ {
+ xml.responseText = io.contentDocument.document.body ?
+ io.contentDocument.document.body.textContent || document.body.innerText : null;
+ xml.responseXML = io.contentDocument.document.XMLDocument ?
+ io.contentDocument.document.XMLDocument : io.contentDocument.document;
+ }
+ }
+ catch(e)
+ {
+ jQuery.handleError(s, xml, null, e);
+ }
+ if ( xml || isTimeout == "timeout")
+ {
+ requestDone = true;
+ var status;
+ try {
+ status = isTimeout != "timeout" ? "success" : "error";
+ // Make sure that the request was successful or notmodified
+ if ( status != "error" )
+ {
+ // process the data (runs the xml through httpData regardless of callback)
+ var data = jQuery.uploadHttpData( xml, s.dataType );
+ // If a local callback was specified, fire it and pass it the data
+ if ( s.success )
+ s.success( data, status );
+
+ // Fire the global callback
+ if( s.global )
+ jQuery.event.trigger( "ajaxSuccess", [xml, s] );
+ } else
+ jQuery.handleError(s, xml, status);
+ } catch(e)
+ {
+ status = "error";
+ jQuery.handleError(s, xml, status, e);
+ }
+
+ // The request was completed
+ if( s.global )
+ jQuery.event.trigger( "ajaxComplete", [xml, s] );
+
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active )
+ jQuery.event.trigger( "ajaxStop" );
+
+ // Process result
+ if ( s.complete )
+ s.complete(xml, status);
+
+ jQuery(io).unbind();
+
+ setTimeout(function()
+ { try
+ {
+ $(io).remove();
+ $(form).remove();
+
+ } catch(e) {
+ jQuery.handleError(s, xml, null, e);
+ }
+ }, 100)
+ xml = null;
+ }
+ }
+ // Timeout checker
+ if ( s.timeout > 0 ) {
+ setTimeout(function(){
+ // Check to see if the request is still happening
+ if( !requestDone ) uploadCallback( "timeout" );
+ }, s.timeout);
+ }
+ try
+ {
+ // var io = $('#' + frameId);
+ var form = $('#' + formId);
+ $(form).attr('action', s.url);
+ $(form).attr('method', 'POST');
+ $(form).attr('target', frameId);
+ if(form.encoding)
+ {
+ form.encoding = 'multipart/form-data';
+ }
+ else
+ {
+ form.enctype = 'multipart/form-data';
+ }
+ $(form).submit();
+
+ } catch(e)
+ {
+ jQuery.handleError(s, xml, null, e);
+ }
+ if(window.attachEvent){
+ document.getElementById(frameId).attachEvent('onload', uploadCallback);
+ }
+ else{
+ document.getElementById(frameId).addEventListener('load', uploadCallback, false);
+ }
+ return {abort: function () {}};
+
+ },
+
+ uploadHttpData: function( r, type ) {
+ var data = !type;
+ data = type == "xml" || data ? r.responseXML : r.responseText;
+ // If the type is "script", eval it in global context
+ if ( type == "script" )
+ jQuery.globalEval( data );
+ // Get the JavaScript object, if JSON is used.
+ if ( type == "json" )
+ eval( "data = " + data );
+ // evaluate scripts within html
+ if ( type == "html" )
+ jQuery("<div>").html(data).evalScripts();
+ //alert($('param', data).each(function(){alert($(this).attr('value'));}));
+ return data;
+ }
+})
+
diff --git a/templates/content/style/default.css b/templates/content/style/default.css
index 9b561803..0221cc03 100644
--- a/templates/content/style/default.css
+++ b/templates/content/style/default.css
@@ -164,7 +164,7 @@ h4 {display:block;font-size:90%; font-family:Verdana;color:#ccc;}
color:darkred;
font-weight:400;
font-size:100%;
- letter-spacing:1px;
+ /*letter-spacing:1px;*/
}
@@ -198,7 +198,7 @@ h4 {display:block;font-size:90%; font-family:Verdana;color:#ccc;}
float: left;
font-size: 140%;
font-weight:700;
- letter-spacing:3px;
+ /*letter-spacing:3px;*/
margin-top:8px;
padding:5px 0 0 3px ;
height:20px;
@@ -329,7 +329,7 @@ h4 {display:block;font-size:90%; font-family:Verdana;color:#ccc;}
font-size:120%;
font-weight:bold;
width:120px;
- letter-spacing:1px;
+ /*letter-spacing:1px;*/
background-color:#D4D0C8;
}
.notify
@@ -461,7 +461,7 @@ h4 {display:block;font-size:90%; font-family:Verdana;color:#ccc;}
}
.highlight-box{
- letter-spacing:1px;
+ /*letter-spacing:1px;*/
color:#735005;
}
@@ -890,7 +890,7 @@ h4 {display:block;font-size:90%; font-family:Verdana;color:#ccc;}
margin-bottom:-10px;
width:600px;
color:#aaa;
- letter-spacing:1px;
+ /*letter-spacing:1px;*/
}
@@ -1750,4 +1750,4 @@ 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;} \ No newline at end of file
+.fieldset{border:solid 1px #777;margin-top:10px;padding:10px;}
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 bfbd603a..b3fa6a6c 100644
--- a/templates/content/style/style.css
+++ b/templates/content/style/style.css
@@ -1,999 +1,1119 @@
-@import url(/content/style/jquery.autocomplete.css);
-@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;
-}
-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%;}
-a {color:#663333; text-decoration:none;}
-a:hover {text-decoration:underline;}
-.block{width:960px; height:auto;}
-.fleft{float:left;}
-.fright{float:right;}
-.tleft{text-align:left;}
-.tcenter{text-align:center;}
-.tright{text-align:right;}
-.dis{display:block;}
-.inline{display:inline;}
-.none{display:none;}
-.red{color:#CC0000;}
-.b{font-weight:bold;}
-.f10{font-size:10px;}
-.f11{font-size:11px;}
-.f12{font-size:12px;}
-.f13{font-size:13px;}
-.f14{font-size:14px;}
-.white{color:#FFFFFF;}
-.u{text-decoration:underline;}
-.spacer1{height:6px; line-height:6px; clear:both; visibility:hidden;}
-.spacer3{height:30px; line-height:30px; clear:both; visibility:hidden;}
-h1{font-size:160%;padding:5px 0 5px 0;}
-h2{font-size:140%;padding:3px 0 3px 0;}
-h3{font-size:120%;padding:3px 0 3px 0;}
-ul
-{
- list-style: disc;
- margin-left: 20px;
- padding-left:0px;
- margin-bottom: 1em;
-}
-ol
-{
- list-style: decimal;
- margin-left: 30px;
- margin-bottom: 1em;
- padding-left:0px;
-}
-pre
-{
- font-family: Consolas, Monaco, Liberation Mono, Lucida Console, Monospace;
- font-size:100%;
- margin-bottom: 10px;
- overflow: auto;
- width: 580px;
- background-color: #F5F5F5;
- padding-left:5px;
- padding-top:5px;
- padding-bottom: 20px !ie7;
-}
-
-code{
- font-family: Consolas, Monaco, Liberation Mono, Lucida Console, Monospace;
- font-size:100%;
-
-}
-
-blockquote
-{
- margin-bottom: 10px;
- margin-right: 15px;
- padding: 10px 0px 1px 10px;
- background-color: #F5F5F5;
-}
-
-/*页面布局*/
-#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}
-#CAFull{float:left;padding:0 5px 0 5px;width:950px;}
-#ground {clear:both;border-top:6px solid #000; padding-top:6px; padding-bottom:50px; text-align:center;background:#777;}
-
-/*顶部及导航栏*/
-#top {height:20px; text-align:right; padding:3px;background-color:#eee;}
-#header {width:960px;}
-#top a {height:35px; text-align:right;letter-spacing:1px; margin-left:20px;text-decoration:underline; font-size:12px; color:#666;}
-#logo {padding:5px;}
-#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; 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:hover {text-decoration:underline}
-#navBar .nav a.on {height:24px;line-height:28px;border:1px solid green; background:green; color:#FFF; font-weight:600; text-decoration:none}
-#navBar .nav a.special {font-size:15px; color:white;background:grey; font-weight:bold; text-decoration:none;}
-#navBar .nav a.special:hover {text-decoration:underline;}
-#navBar .nav div.focus {position:absolute; top:4px; padding-right:0px;}
-/*搜索栏*/
-#searchBar {background-color:green;padding:5px;}
-#searchBar .content { }
-#searchBar .searchInput {font-size:13px; height:18px; width:400px;}
-#searchBar .searchBtn {font-size:14px; height:26px; width:80px;}
-#searchBar .options {padding-top:5px; font-size:100%;color:#EEE;letter-spacing:1px;}
-#searchBar .options INPUT {margin-left:15px;}
-#searchBar .options INPUT:hover {cursor:pointer}
-
-/*问题列表*/
-#listA {float:left; background-color:#FFF;padding:0 0px 0 0px; width:100%;}
-#listA .qstA {padding:3px 5px 0 5px; margin:0 0px 10px 0px; background:url(/content/images/quest-bg.gif) repeat-x top;}
-#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 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;}
-#listA .qstA .stat .unit {color:#777;}
-#listA .qstA .from {margin-top:5px; font-size:13px;}
-#listA .qstA .from .score {font-family:arial;}
-#listA .qstA .date {margin-left:20px; color:#777;}
-#listA .qstA .wiki {color:#663333;font-size:12px;}
-#listA .qstA .from a {}
-#listA .qstA .from IMG {vertical-align:middle;}
-#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;}
-
-/*内容块*/
-.boxA {background:#777; padding:6px; margin-bottom:8px;}
-.boxA H3 {font-size:13px; font-weight:800; color:#FFF; margin:0; padding:0; margin-bottom:4px;}
-.boxA .body {border:1px solid #999; padding:8px; background:#FFF; font-size:13px;}
-.boxA .more {padding:2px; text-align:right; font-weight:800;}
-.boxB {background:#F9F7CD; padding:6px; margin-bottom:8px;}
-.boxB H3 {font-size:13px; font-weight:800; color:#000; margin:0; padding:0 0 0 15px; margin-bottom:4px; background:url(/content/images/dot-g.gif) no-repeat left center;}
-.boxB .body {border:1px solid #FFFF88; padding:8px; background:#FFF; font-size:13px; line-height:160%;}
-.boxB .more {padding:1px; text-align:right; font-weight:800;}
-.boxC {background:#F5F5F5; padding:6px; margin-bottom:8px;}
-/*分页*/
-.pager {margin-top:10px; margin-bottom:16px; float:left;}
-.pagesize {margin-top:10px; margin-bottom:16px; float:right;}
-
-/** PAGINATOR **/
-.paginator {
- padding:5px 0 10px 0;
- font:normal 12px arial;
-}
-
-.paginator .prev-na,
-.paginator .next-na {
- padding:.3em;
- font:bold .875em arial;
-}
-
-.paginator .prev-na,
-.paginator .next-na {
- border:1px solid #ccc;
- background-color:#f9f9f9;
- color:#aaa;
- font-weight:normal;
-}
-
-.paginator .prev a, .paginator .prev a:visited,
-.paginator .next a, .paginator .next a:visited {
- border:1px solid #fff;
- background-color:#fff;
- color:#777;
- padding:.3em;
- font:bold 100% arial;
-}
-
-.paginator .prev, .paginator .prev-na { margin-right:.5em; }
-.paginator .next, .paginator .next-na { margin-left:.5em; }
-
-.paginator .page a, .paginator .page a:visited, .paginator .curr {
- padding:.25em;
- font:normal .875em verdana;
- border:1px solid #ccc;
- background-color:#fff;
- margin:0em .25em;
- color:#777;
-}
-
-.paginator .curr {
- background-color:#777;
- color:#fff;
- border:1px solid #777;
- font-weight:bold;
-}
-
-.paginator .page a:hover,
-.paginator .curr a:hover,
-.paginator .prev a:hover,
-.paginator .next a:hover {
- color:#fff;
- background-color:#777;
- border:1px solid #777;
- text-decoration:none;
-}
-
-.paginator .text{
- color:#777;
- padding:.3em;
- font:bold 100% arial;
-}
-
-.paginator-container{
- float:right;
- padding:10px 0 10px 0;
-}
-
-.paginator-container-left{
- padding:5px 0 10px 0;
-}
-
-/*标签*/
-.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;}
-.tags a:hover {background-color:#fFF;color:#333;}
-.tag-number {font-weight:700;font-family:arial;}
-
-/*奖牌*/
-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;}
-a:hover.medal {color:#333; text-decoration:none; background:url(/content/images/medala_on.gif) no-repeat; border-left:1px solid #E7E296; border-top:1px solid #E7E296; border-bottom:1px solid #D1CA3D; border-right:1px solid #D1CA3D;}
-
-/*Tab栏*/
-.tabBar{background-color:#FFF;border-bottom: 1px solid #666;height: 30px; width: 100%;clear:both; margin-bottom:3px;}
-.tabsA {background-color:#FFF;float:right;position:relative;display:block;font-weight:bold;height:20px;}
-.tabsB {background-color:#FFF;float:left;position:relative;display:block;font-weight:bold;height:20px;}
-.tabsA a.on, .tabsA a.on:hover,.tabsB a.on, .tabsB a.on:hover {background: #fff;
- color:#333;
- border: 1px solid #777;
- border-bottom:2px solid #FFF;
- height: 25px;
- line-height: 26px;
- margin-top: 3px;
- padding: 0px 11px 0px 11px;}
-
-.tabsA a {background: #eee;
- border: 1px solid #eee;
- color: #777;
- display: block;
- float: left;
- height: 22px;
- line-height: 28px;
- margin: 5px 4px 0 0;
- padding: 0 11px 0 11px;
- text-decoration: none;
-}
-.tabsB a {background: #eee;
- border: 1px solid #eee;
- color: #777;
- display: block;
- float: left;
- height: 22px;
- line-height: 28px;
- margin: 5px 0px 0 4px;
- padding: 0 11px 0 11px;
- text-decoration: none;
-}
-.tabsA a:hover, .tabsB a:hover {background: #fff;border: 1px solid #777;border-bottom:3px solid #FFF;}
-.headlineA {font-size:13px; border-bottom:1px solid #777; padding-bottom:2px; font-weight:800; margin-bottom:12px; text-align:right; height:30px;}
-.headQuestions {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;}
-.headAnswers {float:left; padding:3px; font-size:18px; font-weight:800; background:url(/content/images/ico_answers.gif) left 2px no-repeat; padding-left:24px;}
-.headTags {float:left; padding:3px; font-size:18px; font-weight:800; background:url(/content/images/ico_tags.gif) no-repeat; padding-left:24px;}
-.headUsers {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;}
-.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;}
-/*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; }
-
-/*问题*/
-#question {margin-bottom:30px;}
-#question h1{font-size:15px;background:#CCC; padding:6px 8px;;}
-#question .body{background:#F7F7F7; padding:20px 10px;}
-.starter {padding:10px; background:#E0EAF1;}
-.vote {font-size:20px; color:#666; font-weight:800;}
-.questions-related{font-weight:700;word-wrap:break-word;}
-.questions-related p{line-height:20px; margin-bottom:10px;font-size:100%;}
-.question-status{
- margin-top:10px;
- padding: 20px;
- background-color:#F5F5F5;
- text-align:center;
-}
-.question-status h3{font-size:125%;}
-.question-body{
- min-height:100px;
- font-size:13px;
- line-height:20px;
-}
-.question-body IMG{
- max-width:600px;
-}
-.question-mark{
- background-color:#E9E9FF;
- text-align:left;
- padding:5px;
- overflow:hidden;
-}
-.question-edit{
- text-align:left;
- overflow:hidden;
-}
-.vote-buttons {float:left;text-align:center;}
-.vote-buttons IMG{cursor:pointer;}
-.vote-number{
- font-family:Arial;
- padding:0px 0 3px 0;
- font-size:140%;
- font-weight:bold;
- color:#777;
-}
-.question-img-upvote:hover{background:url(/content/images/vote-arrow-up-on.png)}
-.question-img-downvote:hover{background:url(/content/images/vote-arrow-down-on.png)}
-.question-img-favorite:hover{background:url(/content/images/vote-favorite-on.png)}
-.favorite-number{padding:0px;font-size:100%; font-family:Arial;font-weight:bold;color:#777;}
-.vote-notification
-{
- z-index: 1;
- cursor: pointer;
- display: none;
- position: absolute;
- padding: 15px;
- color: White;
- background-color: darkred;
-}
-.vote-notification a
-{
- color: White;
- text-decoration:underline;
-}
-.offensive-flag a{
- color:#777;
- padding:3px;
- cursor:pointer;
-}
-
-.offensive-flag a:hover{
- background-color:#777;
- text-decoration:none;
- color:#fff;
-}
-
-.linksopt a{
- color:#777;
- padding:3px;
- cursor:pointer;
-}
-
-.linksopt a:hover{
- background-color:#777;
- text-decoration:none;
- color:#fff;
-}
-
-.action-link a{
- color:#777;
- padding:3px;
- cursor:pointer;
-}
-
-.action-link a:hover{
- background-color:#777;
- text-decoration:none;
- color:#fff;
-}
-.action-link-separator{
- color:#ccc;
-}
-.wiki-category{
- margin-left:5px;
- color:#999;
- font-size:90%;
-}
-
-div.comments {
- line-height:150%;
- padding:10px 0;
-}
-
-div.post-comments{
- width:100%;
-}
-
-form.post-comments textarea {
- height:6em;
- margin-bottom:4px;
-}
-
-form.post-comments input {
- margin-left:10px;
- margin-top:1px;
- vertical-align:top;
- width:100px;
-}
-span.text-counter {
- margin-right:20px;
-}
-
-span.form-error {
- color:#990000;
- font-weight:normal;
- margin-left:5px;
-}
-
-div.comments-container, div.comments-container-accepted, div.comments-container-owner, div.comments-container-deleted {
- display:none;
- margin-top:-1px;
- padding:0 5px 5px;
-}
-
-div.comments-container, a.comments-link {
- background-color:#EEEEEE;
-}
-
-.post-comments a {
- color:#888888;
- padding:0 3px 2px;
-}
-
-a.comments-link, a.comments-link-accepted, a.comments-link-owner, a.comments-link-deleted {
- color:black;
- padding:2px;
- cursor:pointer;
-}
-
-.post-comments a:hover {
- background-color:#777777;
- color:white;
- text-decoration:none;
-}
-
-a.comment-user, a.comment-user:hover {
- background-color:inherit;
- color:#0077CC;
- padding:0;
-}
-
-a.comment-user:hover {
- text-decoration:underline;
-}
-.deleted{
- background:#F4E7E7 none repeat scroll 0 0;
-}
-/*回答*/
-#answers {}
-.answer{
- border-bottom:1px dotted #666666;
- padding-bottom:20px;
- padding-top:20px;
- width: 100%;
- margin-bottom:10px;
-}
-.answer-body{
- min-height:80px;
- font-size:13px;
- line-height:20px;
-}
-
-.answer-body IMG{
- max-width:600px;
-}
-
-.accepted-answer{
- background-color:#EBFFE6;
- border-bottom-color:#9BD59B;
-}
-
-.accepted-answer .comments-link{
- background-color:#CCFFBF;
-}
-
-.accepted-answer .comments-container{
- background-color:#CCFFBF;
-}
-
-.answered
-{
- background: #CCC;
- color: #999;
-}
-
-.answered-accepted
-{
- background: #CCC;
- color: #663333;
-}
-
-.unanswered
-{
- background: #777;
- color: white;
-}
-
-.answered-by-owner
-{
- background: #E9E9FF;
-}
-
-.answered-by-owner .comments-link
-{
- background-color:#E6ECFF;
-}
-
-.answered-by-owner .comments-container
-{
- background-color:#E6ECFF;
-}
-
-.answered-accepted strong
-{
- color: #E1E818;
-}
-
-.answer-img-accept:hover{background:url(/content/images/vote-accepted-on.png)}
-
-/*标签列表*/
-.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:green;}
-.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;}
-/*登录*/
-.list-item{margin-left:15px;}
-.list-item LI{list-style-type:disc; font-size:13px; line-height:20px; margin-bottom:10px;}
-/* openid styles */
-.form-row{line-height:25px;}
-.submit-row{line-height:30px;padding-top:10px;}
-.errors{line-height:20px;color:red;}
-.error{color:red;}
-.error-list li{padding:5px;}
-.login{margin-bottom:10px;}
-.fieldset{border:solid 1px #777;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;
- background:url(/content/images/openid.gif) no-repeat 0% 50%;
- padding:5px 5px 5px 15px;
- cursor:pointer;
- font-family:Trebuchet MS;
- font-weight:300;
- font-size:150%;
- width:500px;
-}
-
-.openid-login-submit{
- height:40px;
- width:80px;
- line-height:40px;
- cursor:pointer;
- border:1px solid #777;
- font-weight:bold;
- font-size:120%;
-}
-
-.openid-samples{
-
-}
-
-.openid-samples .list, .list li{
- font-family:Trebuchet MS,"segoe ui",Helvetica,"Microsoft YaHei",宋体,Tahoma,Verdana,MingLiu,PMingLiu,Arial,sans-serif;
- list-style:none !important;
- margin-left:-30px !important;
- line-height:20px !important;
-}
-
-/*表单相关*/
-span.form-error {
- color:#990000;
- font-size:90%;
- font-weight:normal;
- margin-left:5px;
-}
-.title-desc{
- color:#999;
- font-size:90%;
-}
-
-/*adjustment for editor preview*/
-#editor{
- font-size:100%;
- min-height:200px;
- line-height: 18px;
- width:100%;
-}
-
-.wmd-preview{
- margin-top:10px;
- padding:6px;
- width:100%;
- background-color:#F5F5F5;
- min-height:20px;
-}
-.wmd-preview pre{
- background-color:#E7F1F8;
-
-}
-
-.wmd-preview blockquote
-{
- background-color: #eee;
-}
-
-.wmd-preview IMG{
- max-width:600px;
-}
-.preview-toggle{
- font-weight:600;
- width:100%;
- color:#aaa;
- letter-spacing:1px;
- text-align:left;
-}
-
-.preview-toggle span:hover{
- cursor:pointer;
-}
-
-.edit-content-html{
- border-top:1px dotted #D8D2A9;
- border-bottom:1px dotted #D8D2A9;
- margin:5px 0 5px 0;
-}
-
-/*修订记录*/
-
-#revisions{
- width:950px;
-}
-
-.revision{
- margin:10px 0 10px 0;
- width:100%;
- font-size:13px;
-}
-
-.revision .header{
- background-color:#eee;
- padding:5px;
- cursor:pointer;
-}
-
-.revision .author{
- background-color:#E9E9FF;
-}
-
-.revision .summary{
- padding: 5px 0 10px 0;
-}
-
-.revision .summary span{
- background-color:yellow;
- display:inline;
-}
-.revision h1{
- font-size:130%;
- font-weight:600;
- padding:15px 0 15px 0;
-}
-
-.revision-mark{
- width:200px;
- text-align:left;
- font-size:90%;
- overflow:hidden;
-}
-
-.revision-number{
- font-size:300%;
- font-weight:bold;
- font-family:arial;
-}
-
-.revision .body{
- padding-left:10px;
- margin-bottom:50px;
-}
-.revision .answerbody{
- padding:10px 0 5px 10px;
-}
-
-/* Revision pages */
-del { color: #FF5F5F; }
-del .post-tag{
-color: #FF5F5F;
-}
-ins { background-color: #97ff97;}
-ins .post-tag{
-background-color: #97ff97;
-}
-
-/*用户资料页面*/
-.count {font-family:Arial;font-size:200%;font-weight:700;color:#777}
-.scoreNumber{font-family:Arial;font-size:35px;font-weight:800;color:#777;line-height:40px;letter-spacing:0px}
-.user-details{font-size:13px;}
-.user-about{background-color:#EEEEEE;height:200px;line-height:20px; overflow:auto;padding:10px;width:90%;}
-.user-edit-link {background:url(/content/images/edit.png) no-repeat; padding-left:20px; font-weight:600;}
-.favorites-count-off {
- color:#919191;
- float:left;
- padding:3px;
- margin:10px 0 0 0 ;
- text-align:center;
-}
-
-.favorites-count {
- color:#D4A849;
- float:left;
- padding:3px;
- margin:10px 0 0 0 ;
- text-align:center;
-}
-.favorites-empty{
- width: 32px; height: 45px; float: left;
-}
-.question-summary {
- border-bottom:1px dotted #999999;
- float:left;
- overflow:hidden;
- padding:11px 0;
- width:670px;
-}
-
-.user-info-table{
-width:950;margin-bottom:10px;
-}
-
-.user-stats-table .question-summary {
- width:800px;
-}
-
-.narrow .stats {
- background:transparent none repeat scroll 0 0;
- float:left;
- height:48px;
- margin:0 0 0 7px;
- padding:0;
- width:auto;
- font-family:Arial;
-}
-
-.narrow .votes {
- background:#EEEEEE none repeat scroll 0 0;
- float:left;
- height:38px;
- margin:0 3px 0 0;
- padding:5px;
- width:40px;
- text-align:center;
- -moz-border-radius: 5px;
- -khtml-border-radius: 5px;
- -webkit-border-radius: 5px;
-}
-
-.narrow .summary {
- width:620px;
-}
-
-.narrow .summary h3 {
- padding:0px;
- margin:0px;
-}
-
-.narrow .views {
- float:left;
- height:38px;
- margin:0 7px 0 0;
- padding:5px 0 5px 4px;
- width:40px;
- text-align:center;
- -moz-border-radius: 5px;
- -khtml-border-radius: 5px;
- -webkit-border-radius: 5px;
- color:#777;
-}
-
-.narrow .status {
- float:left;
- height:38px;
- margin:0 3px 0 0;
- padding:5px;
- width:40px;
- text-align:center;
- -moz-border-radius: 5px;
- -khtml-border-radius: 5px;
- -webkit-border-radius: 5px;
-}
-
-.narrow .vote-count-post {
- font-weight:800;
- margin:0;
- font-size: 190%; color:#555; line-height:20px;
-}
-.narrow .answer-count-post{font-weight:800;margin:0; font-size: 190%; }
-.narrow .views-count-post{font-weight:800;margin:0; font-size: 190%;}
-div.started {
- color:#999999;
- float:right;
- line-height:18px;
-
-}
-
-.narrow div.started {
- line-height:inherit;
- padding-top:4px;
- white-space:nowrap;
- width:auto;
-}
-
-.relativetime {
- font-weight:bold;
- text-decoration:none;
-}
-
-div.started a {
- font-weight:bold;
-}
-
-div.started .reputation-score {
- margin-left:1px;
-}
-
-.narrow .tags{float:left;}
-
-.answer-summary {
- clear:both;
- padding:3px;
-}
-
-.answer-votes {
- background-color:#EEEEEE;
- color:#555555;
- float:left;
- font-family:Arial;
- font-size:110%;
- font-weight:bold;
- height:15px;
- padding:4px 4px 5px;
- text-align:center;
- text-decoration:none;
- width:20px;
- margin-right:10px;
-}
-.vote-count{font-family:Arial; font-size:160%; font-weight:700; color:#777;}
-.user-action{
-
-}
-.user-action-1{
- font-weight:bold;
- color:#333;
-}
-.user-action-2{
- font-weight:bold;
- color:#CCC;
-}
-.user-action-3{
- color:#333;
-}
-.user-action-4{
- color:#333;
-}
-.user-action-5{
- color:darkred;
-}
-.user-action-6{
- color:darkred;
-}
-.user-action-7{
- color:#333;
-}
-.user-action-8{
- padding:3px;
- font-weight:bold;
- background-color:#CCC;
- color:#663333;
-}
-
-.revision-summary{
- background-color:#FFFE9B;
- padding:2px;
-}
-.question-title-link a{
- font-weight:bold;
- color:#0077CC;
-}
-.answer-title-link a{
- color:#333;
-}
-
-.post-type-1 a {
- font-weight:bold;
-
-}
-.post-type-3 a {
- font-weight:bold;
-
-}
-.post-type-5 a {
- font-weight:bold;
- }
-.post-type-2 a{
- color:#333;
-}
-.post-type-4 a{
- color:#333;
-}
-.post-type-6 a{
- color:#333;
-}
-.post-type-8 a{
- color:#333;
-}
-
-
-/*读书频道*/
-.bookInfo {float:left; width:940px;padding:5px;}
-.bookCover {float:left; width:200px;}
-.bookCover img{border:1px solid #ccc;max-width:200px;}
-.bookSummary {float:left; font-size:13px;}
-.blogRss {float:right;margin:0 10px 0 0;width:460px;height:240px;background-color:#EEE; padding:5px;}
-.bookQuestions {margin-bottom:10px;}
-.bookFeed {float:right;}
-.bookAsk{letter-spacing:1px; float:right;margin:-30px 10px 0 0; padding:3px 5px 3px 5px;}
-.bookAsk a {font-size:15px; color:#FFF; font-weight:bold; text-decoration:none;background-color:#EC7000;padding:3px 6px 3px 6px; }
-.bookAsk a:hover {text-decoration:underline;}
-
-
-/*其他全局样式*/
-.hilite { background-color: #ff0; }
-.hilite1 { background-color: #ff0; }
-.hilite2 { background-color: #f0f; }
-.hilite3 { background-color: #0ff; }
-.userStatus {margin-left:12px; color:#FFF; float:right;}
-.userStatus a {color:#FFF;}
-.gold, .badge1 {color:#FFCC00;}
-.silver, .badge2 {color:#CCCCCC;}
-.bronze, .badge3 {color:#CC9933;}
-.score {font-weight:800; color:#333;}
-.footerLinks {color:#EEE; font-size:13px; letter-spacing:1px;}
-.footerLinks a {color:#FFF; font-size:13px;}
-.subSearch {margin-bottom:12px; padding:4px;}
-a.comment {background:#EEE; color:#993300; padding:4px;}
-a.permLink {padding:2px;}
-a.offensive {color:#999;}
-ul.bulleta li {background:url(/content/images/bullet_green.gif) no-repeat 0px 2px; padding-left:16px; margin-bottom:4px;}
-.user {padding:5px; line-height:140%; width:170px;}
-.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;}
-.warning{color:red;}
-.darkred{color:darkred;}
-.submit{cursor:pointer;letter-spacing:1px;background-color:#D4D0C8;height:40px;border:1px solid #777;width:100px;font-weight:bold;font-size:120%;}
-.submit:hover{text-decoration:underline;}
-.ask-body{padding-right:10px;}
-.thousand{color:orange;}
-.notify
-{
- position: fixed;
- top: 0px;
- left: 0px;
- width: 100%;
- z-index: 100;
- padding: 7px 0 5px 0;
- text-align: center;
- font-size: 130%;
- font-weight: Bold;
- color: #444;
- background-color: #F4A83D;
-}
-
-.notify span
-{
- float: left;
- width: 95%;
- text-align: center;
-}
-
-.close-notify
-{
- float: right;
- margin-right: 20px;
- color: #735005;
- text-decoration: none;
- background-color: #FAD163;
- border: 2px #735005 solid;
- padding-left: 3px;
- padding-right: 3px;
- cursor:pointer;
+@import url(/content/style/jquery.autocomplete.css);
+@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: 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: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;}
+.fright{float:right;}
+.tleft{text-align:left;}
+.tcenter{text-align:center;}
+.tright{text-align:right;}
+.dis{display:block;}
+.inline{display:inline;}
+.none{display:none;}
+.red{color:#CC0000;}
+.b{font-weight:bold;}
+.f10{font-size:10px;}
+.f11{font-size:11px;}
+.f12{font-size:12px;}
+.f13{font-size:13px;}
+.f14{font-size:14px;}
+.white{color:#FFFFFF;}
+.u{text-decoration:underline;}
+.spacer1{height:6px; line-height:6px; clear:both; visibility:hidden;}
+.spacer3{height:30px; line-height:30px; clear:both; visibility:hidden;}
+h1{font-size:160%;padding:5px 0 5px 0;}
+h2{font-size:140%;padding:3px 0 3px 0;}
+h3{font-size:120%;padding:3px 0 3px 0;}
+ul
+{
+ list-style: disc;
+ margin-left: 20px;
+ padding-left:0px;
+ margin-bottom: 1em;
+}
+ol
+{
+ list-style: decimal;
+ margin-left: 30px;
+ margin-bottom: 1em;
+ padding-left:0px;
+}
+pre
+{
+ font-family: Consolas, Monaco, Liberation Mono, Lucida Console, Monospace;
+ font-size:100%;
+ margin-bottom: 10px;
+ overflow: auto;
+ width: 580px;
+ background-color: #F5F5F5;
+ padding-left:5px;
+ padding-top:5px;
+ padding-bottom: 20px !ie7;
+}
+
+code{
+ font-family: Consolas, Monaco, Liberation Mono, Lucida Console, Monospace;
+ font-size:100%;
+
+}
+
+blockquote
+{
+ margin-bottom: 10px;
+ margin-right: 15px;
+ padding: 10px 0px 1px 10px;
+ background-color: #F5F5F5;
+}
+
+/*页面布局*/
+#wrapper {width:960px;margin:auto;padding:0;}
+#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:0px; text-align:center;background:#777;}
+/*#licenseLogo {position:absolute;top:10px;right:10px;}*/
+
+/*顶部及导航栏*/
+#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 0px 0px 0px;
+ margin-bottom:-3px;
+}
+#navBar {float:clear;position:relative;display:block;width:960px;}
+#navBar .nav {margin:50px 0px 0px 16px;
+ /*letter-spacing:1px; */
+ }
+#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: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; border:solid 1px;}
+#navBar .nav a.special:hover {text-decoration:underline;}
+#navBar .nav div.focus {position: absolute; top:10px;
+ padding-right:0px;}
+/*搜索栏*/
+#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;}
+#searchBar .options {padding-top:5px; font-size:100%;color:#EEE;
+ /*letter-spacing:1px;*/
+ }
+#searchBar .options INPUT {margin-left:15px;}
+#searchBar .options INPUT:hover {cursor:pointer}
+
+/*问题列表*/
+#listA {float:left; background-color:#FFF;padding:0 0px 0 0px; width:100%;}
+#listA .qstA {padding:3px 5px 0 5px; margin:0 0px 10px 0px; background:url(/content/images/quest-bg.gif) repeat-x top;}
+#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 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;}
+#listA .qstA .stat .unit {color:#777;}
+#listA .qstA .from {margin-top:5px; font-size:13px;}
+#listA .qstA .from .score {font-family:arial;}
+#listA .qstA .date {margin-left:20px; color:#777;}
+#listA .qstA .wiki {color:#663333;font-size:12px;}
+#listA .qstA .from a {}
+#listA .qstA .from IMG {vertical-align:middle;}
+#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:sans-serif;font-weight:600;padding:0 0 5px 7px;color:#a40000;}
+
+/*内容块*/
+.boxA {background:#777; padding:6px; margin-bottom:8px;}
+.boxA H3 {font-size:13px; font-weight:800; color:#FFF; margin:0; padding:0; margin-bottom:4px;}
+.boxA .body {border:1px solid #999; padding:8px; background:#FFF; font-size:13px;}
+.boxA .more {padding:2px; text-align:right; font-weight:800;}
+.boxB {background:#F9F7CD; padding:6px; margin-bottom:8px;}
+.boxB H3 {font-size:13px; font-weight:800; color:#000; margin:0; padding:0 0 0 15px; margin-bottom:4px; background:url(/content/images/dot-g.gif) no-repeat left center;}
+.boxB .body {border:1px solid #FFFF88; padding:8px; background:#FFF; font-size:13px; line-height:160%;}
+.boxB .more {padding:1px; text-align:right; font-weight:800;}
+.boxC {background:#F5F5F5; padding:6px; margin-bottom:8px;}
+/*分页*/
+.pager {margin-top:10px; margin-bottom:16px; float:left;}
+.pagesize {margin-top:10px; margin-bottom:16px; float:right;}
+
+/** PAGINATOR **/
+.paginator {
+ padding:5px 0 10px 0;
+ font:normal 12px sans-serif;
+}
+
+.paginator .prev-na,
+.paginator .next-na {
+ padding:.3em;
+ font:bold .875em sans-serif;
+}
+
+.paginator .prev-na,
+.paginator .next-na {
+ border:1px solid #ccc;
+ background-color:#f9f9f9;
+ color:#aaa;
+ font-weight:normal;
+}
+
+.paginator .prev a, .paginator .prev a:visited,
+.paginator .next a, .paginator .next a:visited {
+ border:1px solid #fff;
+ background-color:#fff;
+ color:#777;
+ padding:.3em;
+ font:bold 100% sans-serif;
+}
+
+.paginator .prev, .paginator .prev-na { margin-right:.5em; }
+.paginator .next, .paginator .next-na { margin-left:.5em; }
+
+.paginator .page a, .paginator .page a:visited, .paginator .curr {
+ padding:.25em;
+ font:normal .875em verdana;
+ border:1px solid #ccc;
+ background-color:#fff;
+ margin:0em .25em;
+ color:#777;
+}
+
+.paginator .curr {
+ background-color:#777;
+ color:#fff;
+ border:1px solid #777;
+ font-weight:bold;
+}
+
+.paginator .page a:hover,
+.paginator .curr a:hover,
+.paginator .prev a:hover,
+.paginator .next a:hover {
+ color:#fff;
+ background-color:#777;
+ border:1px solid #777;
+ text-decoration:none;
+}
+
+.paginator .text{
+ color:#777;
+ padding:.3em;
+ font:bold 100% sans-serif;
+}
+
+.paginator-container{
+ float:right;
+ padding:10px 0 10px 0;
+}
+
+.paginator-container-left{
+ padding:5px 0 10px 0;
+}
+
+/*标签*/
+.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;}
+.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;}
+a:hover.medal {color:#333; text-decoration:none; background:url(/content/images/medala_on.gif) no-repeat; border-left:1px solid #E7E296; border-top:1px solid #E7E296; border-bottom:1px solid #D1CA3D; border-right:1px solid #D1CA3D;}
+
+/*Tab栏*/
+.tabBar{background-color:#FFF;border-bottom: 1px solid #666;height: 30px; width: 100%;clear:both; margin-bottom:3px;}
+.tabsA {background-color:#FFF;float:right;position:relative;display:block;font-weight:bold;height:20px;}
+.tabsB {background-color:#FFF;float:left;position:relative;display:block;font-weight:bold;height:20px;}
+.tabsA a.on, .tabsA a.on:hover,.tabsB a.on, .tabsB a.on:hover {background: #fff;
+ color:#333;
+ border: 1px solid #777;
+ border-bottom:2px solid #FFF;
+ height: 25px;
+ line-height: 26px;
+ margin-top: 3px;
+ padding: 0px 11px 0px 11px;}
+
+.tabsA a {background: #eee;
+ border: 1px solid #eee;
+ color: #777;
+ display: block;
+ float: left;
+ height: 22px;
+ line-height: 28px;
+ margin: 5px 4px 0 0;
+ padding: 0 11px 0 11px;
+ text-decoration: none;
+}
+.tabsB a {background: #eee;
+ border: 1px solid #eee;
+ color: #777;
+ display: block;
+ float: left;
+ height: 22px;
+ line-height: 28px;
+ margin: 5px 0px 0 4px;
+ padding: 0 11px 0 11px;
+ text-decoration: none;
+}
+.tabsA a:hover, .tabsB a:hover {background: #fff;border: 1px solid #777;border-bottom:3px solid #FFF;}
+.headlineA {font-size:13px; border-bottom:1px solid #777; padding-bottom:2px; font-weight:800; margin-bottom:12px; text-align:right; height:30px;}
+.headQuestions {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;}
+.headAnswers {float:left; padding:3px; font-size:18px; font-weight:800; background:url(/content/images/ico_answers.gif) left 2px no-repeat; padding-left:24px;}
+.headTags {float:left; padding:3px; font-size:18px; font-weight:800; background:url(/content/images/ico_tags.gif) no-repeat; padding-left:24px;}
+.headUsers {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;}
+.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;}
+/*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; }
+
+/*问题*/
+#question {margin-bottom:30px;}
+#question h1{font-size:15px;background:#CCC; padding:6px 8px;;}
+#question .body{background:#F7F7F7; padding:20px 10px;}
+.starter {padding:10px; background:#E0EAF1;}
+.vote {font-size:20px; color:#666; font-weight:800;}
+.questions-related{font-weight:700;word-wrap:break-word;}
+.questions-related p{line-height:20px; margin-bottom:10px;font-size:100%;}
+.question-status{
+ margin-top:10px;
+ padding: 20px;
+ background-color:#F5F5F5;
+ text-align:center;
+}
+.question-status h3{font-size:125%;}
+.question-body{
+ min-height:100px;
+ font-size:13px;
+ line-height:20px;
+}
+.question-body IMG{
+ max-width:600px;
+}
+.question-mark{
+ /*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;
+}
+.question-edit{
+ text-align:left;
+ overflow:hidden;
+}
+.vote-buttons {float:left;text-align:center;}
+.vote-buttons IMG{cursor:pointer;}
+.vote-number{
+ font-family:Arial;
+ padding:0px 0 3px 0;
+ font-size:140%;
+ font-weight:bold;
+ color:#777;
+}
+.question-img-upvote:hover{background:url(/content/images/vote-arrow-up-on.png)}
+.question-img-downvote:hover{background:url(/content/images/vote-arrow-down-on.png)}
+.question-img-favorite:hover{background:url(/content/images/vote-favorite-on.png)}
+.favorite-number{padding:0px;font-size:100%; font-family:Arial;font-weight:bold;color:#777;}
+.vote-notification
+{
+ z-index: 1;
+ cursor: pointer;
+ display: none;
+ position: absolute;
+ padding: 15px;
+ color: White;
+ background-color: darkred;
+ text-align: center;
+}
+.vote-notification a
+{
+ color: White;
+ text-decoration:underline;
+}
+.offensive-flag a{
+ color:#777;
+ padding:3px;
+ cursor:pointer;
+}
+
+.offensive-flag a:hover{
+ background-color:#777;
+ text-decoration:none;
+ color:#fff;
+}
+
+.linksopt a{
+ color:#777;
+ padding:3px;
+ cursor:pointer;
+}
+
+.linksopt a:hover{
+ background-color:#777;
+ text-decoration:none;
+ color:#fff;
+}
+
+.action-link a{
+ color:#777;
+ padding:3px;
+ cursor:pointer;
+}
+
+.action-link a:hover{
+ background-color:#777;
+ text-decoration:none;
+ color:#fff;
+}
+.action-link-separator{
+ color:#ccc;
+}
+.wiki-category{
+ margin-left:5px;
+ color:#999;
+ font-size:90%;
+}
+
+div.comments {
+ line-height:150%;
+ padding:10px 0;
+}
+
+div.post-comments{
+ width:100%;
+ margin-bottom:10px;
+}
+
+form.post-comments textarea {
+ height:6em;
+ margin-bottom:4px;
+}
+
+form.post-comments input {
+ margin-left:10px;
+ margin-top:1px;
+ vertical-align:top;
+ width:100px;
+}
+span.text-counter {
+ margin-right:20px;
+}
+
+span.form-error {
+ color:#990000;
+ 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;
+ margin-top:-1px;
+ padding:0 5px 5px;
+}
+
+div.comments-container, a.comments-link {
+ background-color:#EEEEEE;
+}
+
+.post-comments a {
+ color:#888888;
+ padding:0 3px 2px;
+}
+
+a.comments-link, a.comments-link-accepted, a.comments-link-owner, a.comments-link-deleted {
+ color:black;
+ padding:2px;
+ cursor:pointer;
+}
+
+.post-comments a:hover {
+ background-color:#777777;
+ color:white;
+ text-decoration:none;
+}
+
+a.comment-user, a.comment-user:hover {
+ background-color:inherit;
+ color:#0077CC;
+ padding:0;
+}
+
+a.comment-user:hover {
+ text-decoration:underline;
+}
+/*回答*/
+#answers {}
+.answer{
+ padding-top:10px;
+ width: 100%;
+}
+.answer-body{
+ min-height:80px;
+ font-size:13px;
+ line-height:20px;
+}
+
+.answer-body IMG{
+ max-width:600px;
+}
+
+.accepted-answer{
+ background-color:#EBFFE6;
+ border-bottom-color:#9BD59B;
+}
+
+.accepted-answer .comments-link{
+ background-color:#CCFFBF;
+}
+
+.accepted-answer .comments-container{
+ background-color:#CCFFBF;
+}
+
+.answered
+{
+ background: #CCC;
+ color: #999;
+}
+
+.answered-accepted
+{
+ background: #CCC;
+ color: #763333;
+}
+
+.unanswered
+{
+ background: #777;
+ color: white;
+}
+
+.answered-by-owner
+{
+ background: #E9E9FF;
+}
+
+.answered-by-owner .comments-link
+{
+ background-color:#E6ECFF;
+}
+
+.answered-by-owner .comments-container
+{
+ background-color:#E6ECFF;
+}
+
+.answered-accepted strong
+{
+ color: #E1E818;
+}
+
+.answer-img-accept:hover{background:url(/content/images/vote-accepted-on.png)}
+
+.deleted{
+ background:#F4E7E7 none repeat scroll 0 0;
+}
+
+/*标签列表*/
+/*
+.tagsbox {}
+.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;}
+/*登录*/
+.list-item{margin-left:15px;}
+.list-item LI{list-style-type:disc; font-size:13px; line-height:20px; margin-bottom:10px;}
+/* openid styles */
+.form-row{line-height:25px;}
+.submit-row{line-height:30px;padding-top:10px;}
+.errors{line-height:20px;color:red;}
+.error{color:red;}
+.error-list li{padding:5px;}
+.login{margin-bottom: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;
+ background:url(/content/images/openid.gif) no-repeat 0% 50%;
+ padding:5px 5px 5px 15px;
+ cursor:pointer;
+ font-family:Trebuchet MS;
+ font-weight:300;
+ font-size:150%;
+ width:500px;
+}
+
+.openid-login-submit{
+ height:40px;
+ width:80px;
+ line-height:40px;
+ cursor:pointer;
+ border:1px solid #777;
+ font-weight:bold;
+ font-size:120%;
+}
+
+.openid-samples{
+
+}
+
+.openid-samples .list, .list li{
+ font-family:Trebuchet MS,"segoe ui",Helvetica,"Microsoft YaHei",宋体,Tahoma,Verdana,MingLiu,PMingLiu,Arial,sans-serif;
+ list-style:none !important;
+ margin-left:-30px !important;
+ line-height:20px !important;
+}
+
+/*表单相关*/
+span.form-error {
+ color:#990000;
+ font-size:90%;
+ font-weight:normal;
+ margin-left:5px;
+}
+.title-desc{
+ color:#999;
+ font-size:90%;
+}
+
+/*adjustment for editor preview*/
+#editor{
+ font-size:100%;
+ min-height:200px;
+ line-height: 18px;
+ width:100%;
+}
+
+.wmd-preview{
+ margin-top:10px;
+ padding:6px;
+ width:100%;
+ background-color:#F5F5F5;
+ min-height:20px;
+}
+.wmd-preview pre{
+ background-color:#E7F1F8;
+
+}
+
+.wmd-preview blockquote
+{
+ background-color: #eee;
+}
+
+.wmd-preview IMG{
+ max-width:600px;
+}
+.preview-toggle{
+ font-weight:600;
+ width:100%;
+ color:#aaa;
+ /*letter-spacing:1px;*/
+ text-align:left;
+}
+
+.preview-toggle span:hover{
+ cursor:pointer;
+}
+
+.edit-content-html{
+ border-top:1px dotted #D8D2A9;
+ border-bottom:1px dotted #D8D2A9;
+ margin:5px 0 5px 0;
+}
+
+/*修订记录*/
+
+#revisions{
+ width:950px;
+}
+
+.revision{
+ margin:10px 0 10px 0;
+ width:100%;
+ font-size:13px;
+}
+
+.revision .header{
+ background-color:#eee;
+ padding:5px;
+ cursor:pointer;
+}
+
+.revision .author{
+ background-color:#E9E9FF;
+}
+
+.revision .summary{
+ padding: 5px 0 10px 0;
+}
+
+.revision .summary span{
+ background-color:yellow;
+ display:inline;
+}
+.revision h1{
+ font-size:130%;
+ font-weight:600;
+ padding:15px 0 15px 0;
+}
+
+.revision-mark{
+ width:200px;
+ text-align:left;
+ font-size:90%;
+ overflow:hidden;
+}
+
+.revision-number{
+ font-size:300%;
+ font-weight:bold;
+ font-family:sans-serif;
+}
+
+.revision .body{
+ padding-left:10px;
+ margin-bottom:50px;
+}
+.revision .answerbody{
+ padding:10px 0 5px 10px;
+}
+
+/* Revision pages */
+del { color: #FF5F5F; }
+del .post-tag{
+color: #FF5F5F;
+}
+ins { background-color: #97ff97;}
+ins .post-tag{
+background-color: #97ff97;
+}
+
+/*用户资料页面*/
+.count {font-family:Arial;font-size:200%;font-weight:700;color:#777}
+.scoreNumber{font-family:Arial;font-size:35px;font-weight:800;color:#777;line-height:40px;
+ /*letter-spacing:0px*/
+ }
+.user-details{font-size:13px;}
+.user-about{background-color:#EEEEEE;height:200px;line-height:20px; overflow:auto;padding:10px;width:90%;}
+.user-edit-link {background:url(/content/images/edit.png) no-repeat; padding-left:20px; font-weight:600;}
+.favorites-count-off {
+ color:#919191;
+ float:left;
+ padding:3px;
+ margin:10px 0 0 0 ;
+ text-align:center;
+}
+
+.favorites-count {
+ color:#D4A849;
+ float:left;
+ padding:3px;
+ margin:10px 0 0 0 ;
+ text-align:center;
+}
+.favorites-empty{
+ width: 32px; height: 45px; float: left;
+}
+.question-summary {
+ border-bottom:1px dotted #999999;
+ float:left;
+ overflow:hidden;
+ padding:11px 0;
+ width:670px;
+}
+
+.user-info-table{
+width:950;margin-bottom:10px;
+}
+
+.user-stats-table .question-summary {
+ width:800px;
+}
+
+.narrow .stats {
+ background:transparent none repeat scroll 0 0;
+ float:left;
+ height:48px;
+ margin:0 0 0 7px;
+ padding:0;
+ width:auto;
+ font-family:Arial;
+}
+
+.stats div {
+ font-size:11px;
+ text-align:center;
+}
+
+.narrow .votes {
+ background:#EEEEEE none repeat scroll 0 0;
+ float:left;
+ height:42px;
+ margin:0 3px 0 0;
+ padding:5px;
+ width:46px;
+ text-align:center;
+ -moz-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ -webkit-border-radius: 5px;
+}
+
+.narrow .summary {
+ width:620px;
+}
+
+.narrow .summary h3 {
+ padding:0px;
+ margin:0px;
+}
+
+.narrow .views {
+ float:left;
+ height:42px;
+ margin:0 7px 0 0;
+ /*padding:5px 0 5px 4px;*/
+ padding: 5px;
+ width:46px;
+ text-align:center;
+ -moz-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ color:#777;
+}
+
+.narrow .status {
+ float:left;
+ height:42px;
+ margin:0 3px 0 0;
+ padding:5px;
+ width:46px;
+ text-align:center;
+ -moz-border-radius: 5px;
+ -khtml-border-radius: 5px;
+ -webkit-border-radius: 5px;
+}
+
+.narrow .vote-count-post {
+ font-weight:800;
+ margin:0;
+ font-size: 190%; color:#555; line-height:20px;
+}
+.narrow .answer-count-post{font-weight:800;margin:0; font-size: 190%; }
+.narrow .views-count-post{font-weight:800;margin:0; font-size: 190%;}
+div.started {
+ color:#999999;
+ float:right;
+ line-height:18px;
+
+}
+
+.narrow div.started {
+ line-height:inherit;
+ padding-top:4px;
+ white-space:nowrap;
+ width:auto;
+}
+
+.relativetime {
+ font-weight:bold;
+ text-decoration:none;
+}
+
+div.started a {
+ font-weight:bold;
+}
+
+div.started .reputation-score {
+ margin-left:1px;
+}
+
+.narrow .tags{float:left;}
+
+.answer-summary {
+ clear:both;
+ padding:3px;
+}
+
+.answer-votes {
+ background-color:#EEEEEE;
+ color:#555555;
+ float:left;
+ font-family:Arial;
+ font-size:110%;
+ font-weight:bold;
+ height:15px;
+ padding:4px 4px 5px;
+ text-align:center;
+ text-decoration:none;
+ width:20px;
+ margin-right:10px;
+}
+.vote-count{font-family:Arial; font-size:160%; font-weight:700; color:#777;}
+.user-action{
+
+}
+.user-action-1{
+ font-weight:bold;
+ color:#333;
+}
+.user-action-2{
+ font-weight:bold;
+ color:#CCC;
+}
+.user-action-3{
+ color:#333;
+}
+.user-action-4{
+ color:#333;
+}
+.user-action-5{
+ color:darkred;
+}
+.user-action-6{
+ color:darkred;
+}
+.user-action-7{
+ color:#333;
+}
+.user-action-8{
+ padding:3px;
+ font-weight:bold;
+ background-color:#CCC;
+ color:#763333;
+}
+
+.revision-summary{
+ background-color:#FFFE9B;
+ padding:2px;
+}
+.question-title-link a{
+ font-weight:bold;
+ color:#0077CC;
+}
+.answer-title-link a{
+ color:#333;
+}
+
+.post-type-1 a {
+ font-weight:bold;
+
+}
+.post-type-3 a {
+ font-weight:bold;
+
+}
+.post-type-5 a {
+ font-weight:bold;
+ }
+.post-type-2 a{
+ color:#333;
+}
+.post-type-4 a{
+ color:#333;
+}
+.post-type-6 a{
+ color:#333;
+}
+.post-type-8 a{
+ color:#333;
+}
+
+
+/*读书频道*/
+.bookInfo {float:left; width:940px;padding:5px;}
+.bookCover {float:left; width:200px;}
+.bookCover img{border:1px solid #ccc;max-width:200px;}
+.bookSummary {float:left; font-size:13px;}
+.blogRss {float:right;margin:0 10px 0 0;width:460px;height:240px;background-color:#EEE; padding:5px;}
+.bookQuestions {margin-bottom:10px;}
+.bookFeed {float:right;}
+.bookAsk{
+ /*letter-spacing:1px; */
+ float:right;margin:-30px 10px 0 0; padding:3px 5px 3px 5px;}
+.bookAsk a {font-size:15px; color:#FFF; font-weight:bold; text-decoration:none;background-color:#EC7000;padding:3px 6px 3px 6px; }
+.bookAsk a:hover {text-decoration:underline;}
+
+
+/*其他全局样式*/
+.hilite { background-color: #ff0; }
+.hilite1 { background-color: #ff0; }
+.hilite2 { background-color: #f0f; }
+.hilite3 { background-color: #0ff; }
+.userStatus {margin-left:12px; color:#FFF; float:right;}
+.userStatus a {color:#FFF;}
+.gold, .badge1 {color:#FFCC00;}
+.silver, .badge2 {color:#CCCCCC;}
+.bronze, .badge3 {color:#CC9933;}
+.score {font-weight:800; color:#333;}
+.footerLinks {color:#EEE; font-size:13px;
+ /* letter-spacing:1px;*/
+ }
+.footerLinks a {color:#FFF; font-size:13px;}
+.subSearch {margin-bottom:12px; padding:4px;}
+a.comment {background:#EEE; color:#993300; padding:4px;}
+a.permLink {padding:2px;}
+a.offensive {color:#999;}
+ul.bulleta li {background:url(/content/images/bullet_green.gif) no-repeat 0px 2px; padding-left:16px; margin-bottom:4px;}
+.user {padding:5px; line-height:140%; width:170px;}
+.user ul {margin:0; list-style-type:none;}
+.user .thumb{clear:both;float:left; margin-right:4px; display:inline;}
+.yellowbg{background:yellow;}
+
+.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{
+ cursor:pointer;
+ /*letter-spacing:1px;*/
+ background-color:#D4D0C8;
+ height:40px;
+ border:1px solid #777;
+/* width:100px; */
+ font-weight:bold;
+ font-size:120%;}
+.submit:hover{text-decoration:underline;}
+.ask-body{padding-right:10px;}
+.thousand{color:orange;}
+.notify
+{
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ z-index: 100;
+ padding: 0;
+ text-align: center;
+ font-weight: Bold;
+ color: #444;
+ background-color: #F4A83D;
+}
+.notify p {
+ margin-top:5px;
+ margin-bottom:5px;
+ font-size:16px;
+}
+#close-notify
+{
+ 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;
+ 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 e9650c3e..78c433ae 100644
--- a/templates/faq.html
+++ b/templates/faq.html
@@ -1,114 +1,148 @@
{% extends "base_content.html" %}
+<!-- template faq.html -->
{% load extra_tags %}
{% load humanize %}
+{% load i18n %}
{% block title %}{% spaceless %}FAQ{% endspaceless %}{% endblock %}
{% block forejs %}
{% endblock %}
{% block content %}
<div class="headNormal">
- 常见问题(FAQ)
+ {% trans "Frequently Asked Questions " %}(FAQ)
</div>
-<div id="main-body" style="width:100%">
-
- <h3 class="subtitle">我可以在这里提问什么样的问题?</h3>
- <p>毫无疑问,首先必须是<span class="yellowbg">技术编程问题!</span>
- 提问之前,充分利用系统的自动查找、标签和搜索,看看是否已经有一样的问题并有了答案。<br>
- 避免问相同的问题,减少后有问题的朋友的疑惑,以后能够清晰地找到唯一问题和答案。
- </p><br>
-
- <h3 class="subtitle">什么样的问题我不该在这里提问?</h3>
- <p> <span class="yellowbg">与程序员或技术无关的,引起争吵或太过于主观性等违背社区宗旨的内容。</span>本站建立是为了帮助大众程序员解决实际技术问题,我们需要实际的问题!
- </p><p>
- 同样,在社区建立之初,很多用户可能对社区有各种各样的疑问。我们希望能够通过更多的faq或者文档去解释这些疑问,如果用户没有找到答案,希望你在社区提出此类问题,并引用“faq”或者“cnprog”等相关的标签。毕竟,访问社区的用户,是关心他们要寻找的答案,不是来学习如何使用复杂的社区功能的。
- </p><p>
- 如果还没有拜读过Eric S. Raymond的<a href="http://www.catb.org/~esr/faqs/smart-questions.html">《How To Ask Questions The Smart Way》</a>的朋友,推荐先读一下大师的箴言。另外,这里有一<a href="http://www.dianbo.org/9238/stone/tiwendezhihui.htm">中文版本</a>,可以参考浏览。
- </p><p><span class="yellowbg">管理运行社区的是你们,而不是我们。</span></p>
- </p><br>
+<div id="main-body" class="about" style="width:100%">
+
+ <div class="first">
+ <h3 class="subtitle">{% trans "What kinds of questions can I ask here?" %}</h3>
+ <p>{% trans "Most importanly - questions should be <strong>relevant</strong> to this community." %}
+ {% trans "Before asking the question - please make sure to use search to see whether your question has alredy been answered."%}
+ </p>
+
+ <h3 class="subtitle">{% trans "What questions should I avoid asking?" %}</h3>
+ <p>{% trans "Please avoid asking questions that are not relevant to this community, too subjective and argumentative." %}</p>
+ </p>
+ </div>
- <h3 class="subtitle">什么样的回答是不受欢迎的?</h3>
- <p> CNProg 希望用户提供针对提问的技术回答,可以是进一步了解问题实质,给予参考方案,或完全解决问题的回答。我们希望通过问答的形式解决用户的实际问题。因此,<span class="yellowbg">我们不欢迎在回答中出现不是回答问题的内容,包括针对他人回答的讨论,和其他无意义的浪费网络资源行为</span>。CNProg建议您使用<span class="yellowbg">评论</span>功能来讨论你的意见和想法。
-
- </p><br>
+ <div>
+ <h3 class="subtitle">{% trans "What should I avoid in my answers?" %}</h3>
+ <p>{% 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." %}</p>
+ </div>
- <h3 class="subtitle">谁是社区的管理员?</h3>
- <p> 答案是:<span class="yellowbg">每个用户。</span><br>
+ <div>
+ <h3 class="subtitle">{% trans "Who moderates this community?" %}</h3>
+ <p>{% trans "The short answer is: <strong>you</strong>." %}
+ {% trans "This website is moderated by the users." %}
+ {% trans "The reputation system allows users earn the authorization to perform a variety of moderation tasks." %}
+ </p>
+ </div>
- 社区没有严格意义上的管理员身份。
- 通过积分运作,<span class="yellowbg">每个用户都有权限创建标签,进行对所有问题、回答的投票、编辑、关闭等操作。</span>
- </p><br>
-
- <h3 class="subtitle">什么是社区积分?</h3>
- <p> 对于正常使用社区进行提问、回答而言,积分不是必须的。<br>
- 我们一再声明,CNProg由你来运行和维护。如果你想帮助我们来运作CNProg,你需要一定的积分等级。<span class="yellowbg">积分是一种用来粗略衡量社区对你有多信任的数据。</span>积分不是有谁来支付或直接给予你的,而是你通过获得其他用户的支持和信任“赚得”的。
- <br><br>
- 举例来说,如果你提了一个非常有帮助的问题或者做了很有用的回答,你将会被其他用户投赞成票。相反,你提了不受欢迎的问题,或者误导用户的回答,你将可能被其他用户投反对票。每个赞成票会帮你产生<strong>10</strong>个社区积分,每个反对票会相应扣除你<strong>2</strong>个积分。每天通过别人投赞成票,你最多只能产生<strong>200</strong>个积分,这是上限。当你累计到一定积分,你可以在社区做更多的事情:<br>
- <table style="font-family:arial;" cellspacing="3" cellpadding="3">
- <tr>
- <th width="40px" style="text-align:right"></th>
- <th width="300px"></th>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>15</strong></td>
- <td>投赞成票</td>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>15</strong></td>
- <td>标记垃圾帖</td>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>50</strong></td>
- <td>添加评论</td>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>100</strong></td>
- <td>投反对票</td>
- </tr><tr>
- <td style="text-align:right;padding-right:5px"><strong>250</strong></td>
- <td>打开关闭自己的问题</td>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>500</strong></td>
- <td>给任何问题整理标签</td>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>750</strong></td>
- <td>编辑wiki类问题</td>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>2000</strong></td>
- <td>编辑任何问题或答案</td>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>3000</strong></td>
- <td>打开关闭任何人的问题</td>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>5000</strong></td>
- <td>删除任何一个评论</td>
- </tr>
- <tr>
- <td style="text-align:right;padding-right:5px"><strong>10000</strong></td>
- <td>删除任何一个问题或答案,及其他管理功能</td>
- </tr>
+ <div>
+ <h3 class="subtitle">{% trans "How does reputation system work?" %}</h3>
+ <p>{% trans "Rep system summary" %}</p>
+ <p>
+ 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 <strong>10</strong> points, each vote against will subtract <strong>2</strong> points.
+ There is a limit of <strong>200</strong> points that can be accumulated per question or answer.
- </table>
-
- </p><br>
-
- <h3 class="subtitle">我需要注册一个新用户吗?</h3>
- <p> 不需要。社区提供了OpenID的登录支持,你要用Google、Yahoo等任何支持OpenID登录的帐号就可以使用系统。<strong><a href="/account/signin">马上登录</a> »</strong>
- </p><br>
-
- <h3 class="subtitle">为什么其他人可以修改我的问题/回答?</h3>
- <p> CNProg 是为了帮助程序员解决更多问题,更加方便的解决问题。所以问题和答案都是如Wiki一样可编辑的,我们希望社区能帮助用户沉淀、积累更多有用的知识和经验。如果您不喜欢这种方式,我们尊重你的选择。
- </p><br>
+ The table below explains reputation point requirements for each type of moderation task.
+ </p>
+
+ <table style="font-family:arial;" cellspacing="3" cellpadding="3">
+ <tr>
+ <th width="40px" style="text-align:right"></th>
+ <th width="300px"></th>
+ </tr>
+ <!--
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>15</strong></td>
+ <td>{% trans "upvote" %}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>15</strong></td>
+ <td>{% trans "use tags" %}</td>
+ </tr>
+ -->
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>50</strong></td>
+ <td>{% trans "add comments" %}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>100</strong></td>
+ <td>{% trans "downvote" %}</td>
+ </tr><tr>
+ <td style="text-align:right;padding-right:5px"><strong>250</strong></td>
+ <td>{% trans "open and close own questions" %}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>500</strong></td>
+ <td>{% trans "retag questions" %}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>750</strong></td>
+ <td>{% trans "edit community wiki questions" %}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>2000</strong></td>
+ <td>{% trans "edit any answer" %}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>3000</strong></td>
+ <td>{% trans "open any closed question" %}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>5000</strong></td>
+ <td>{% trans "delete any comment" %}</td>
+ </tr>
+ <tr>
+ <td style="text-align:right;padding-right:5px"><strong>10000</strong></td>
+ <td>{% trans "delete any questions and answers and perform other moderation tasks" %}</td>
+ </tr>
+
+ </table>
+ </div>
+ {% ifequal settings.EMAIL_VALIDATION 'on' %}
+ <div>
+ <a id='validate'></a><h3 class="subtitle">{% trans "how to validate email title" %}</h3>
+ <!--special case here message must contain paragraphs-->
+ {% trans "how to validate email info" %}
+ </div>
+ {% endifequal %}
+ <div>
+ <a id='gravatar'></a><h3 class="subtitle">{% trans "what is gravatar" %}</h3>
+ <p>{% trans "gravatar faq info" %}</p>
+ </div>
+ <div>
+ <h3 class="subtitle">{% trans "To register, do I need to create new password?" %}</h3>
+ <p>{% trans "No, you don't have to. You can login through any service that supports OpenID, e.g. Google, Yahoo, AOL, etc." %}
+ <strong><a href="/account/signin">{% trans "Login now!" %}</a> »</strong>
+ </p>
+ </div>
- <h3 class="subtitle">还有其他问题?</h3>
- <p> 如果您对社区还有其他疑问,请一起来完善我们的<a href="/tags/faq" class="big">CNProg FAQ</a>。
- </p>
- <br><br>
+ <div>
+ <h3 class="subtitle">{% trans "Why other people can edit my questions/answers?" %}</h3>
+ <p> {% 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." %}
+ </p>
+ </div>
+ <div>
+ <h3 class="subtitle">{% trans "Still have questions?" %}</h3>
+ <p>{% trans "Please ask your question, help make our community better!" %}
+ <!--
+ <a href="/tags/faq" class="big">{% trans "site title" %} {% trans "questions" %}</a>{% trans "." %}
+ -->
+ </p>
+ </div>
</div>
+<script type="text/javascript">
+ //highlihts section if url has matching #anchor_name
+ $(document).ready(function (){
+ var hash = window.location.hash;
+ if (hash.length > 1){
+ $(hash).parent().addClass('highlight');
+ window.location.hash = hash;
+ }
+ })
+</script>
{% endblock %}
-
-
-
+<!-- end template faq.html -->
diff --git a/templates/footer.html b/templates/footer.html
index 46649b9f..637ca0d8 100644
--- a/templates/footer.html
+++ b/templates/footer.html
@@ -1,28 +1,33 @@
-{% load extra_tags %}
-{% load i18n %}
- <div id="ground">
- <div class="footerLinks" >
- <a href="/about">{% trans "About us" %}</a><span class="link-separator"> |</span>
- <a href="/faq">{% trans "faq" %}</a><span class="link-separator"> |</span>
- <a href="http://blog.cnprog.com">Blog</a><span class="link-separator"> |</span>
- <a href="mailto:team@cnprog.com">{% trans "Contact" %}</a><span class="link-separator"> |</span>
- <a href="/privacy">{% trans "Privacy" %}</a><span class="link-separator"> |</span>
- <a href="http://cnprog.uservoice.com" target="_blank">{% trans "Feedback" %}</a>
- </div>
- <p style="margin-top:10px;">
- <a href="http://code.google.com/p/cnprog/" target="_blank">
- <img src="/content/images/djangomade124x25_grey.gif" border="0" alt="Made with Django." title="Made with Django." >
- </a>
- </p>
- <p style="margin-top:-30px; margin-right:15px;" class="fright"><img src="/content/images/cc-wiki.png" title="Creative Commons: Attribution - Share Alike" alt="cc-wiki" width="50" height="68" /></p>
- </div>
- <script type="text/javascript">
- var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
- document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script>
- <script type="text/javascript">
- try {
- var pageTracker = _gat._getTracker("UA-248512-5");
- pageTracker._trackPageview();
- } catch(err) {}
- </script>
+<!-- template footer.html -->
+{% load extra_tags %}
+{% load i18n %}
+<!-- 页面底部开始: -->
+ <div id="ground">
+ <div class="footerLinks" >
+ <a href="/about">{% trans "about" %}</a><span class="link-separator"> |</span>
+ <a href="/faq">{% trans "faq" %}</a><span class="link-separator"> |</span>
+ <a href="{{ blog_url }}">{% trans "blog" %}</a><span class="link-separator"> |</span>
+ <a href="{{ webmaster_email }}">{% trans "contact us" %}</a><span class="link-separator"> |</span>
+ <a href="/privacy">{% trans "privacy policy" %}</a><span class="link-separator"> |</span>
+ <a href="{{ feedback_url }}" target="_blank">{% trans "give feedback" %}</a>
+ </div>
+ <p style="margin-top:10px;">
+ <a href="http://code.google.com/p/cnprog/" target="_blank">
+ <img src="/content/images/djangomade124x25_grey.gif" border="0" alt="Made with Django." title="Made with Django." >
+ </a>
+ <!--<div style="font-size:90%;color:#333">{% trans "current revision" %}: R-0120-20090406</div>-->
+ </p>
+ <p id="licenseLogo"><img src="/content/images/cc-wiki.png" title="Creative Commons: Attribution - Share Alike" alt="cc-wiki" width="50" height="68" /></p>
+ </div>
+ <!-- 页面底部结束: -->
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try {
+ var pageTracker = _gat._getTracker({{ settings.GOOGLE_ANALYTICS_KEY }});
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+<!-- end template footer.html -->
diff --git a/templates/header.html b/templates/header.html
index fb07a4c0..db08a39a 100644
--- a/templates/header.html
+++ b/templates/header.html
@@ -1,70 +1,70 @@
-<!-- template header.html -->
-{% load extra_tags %}
-{% load i18n %}
- <div id="top">
- <div id="header">
- {% if request.user.is_authenticated %}
- <a href="/users/{{ request.user.id }}/{{ request.user.username }}/">{{ request.user.username }}</a> {% get_score_badge request.user %}
- <a href="{% url user_signout %}">{% trans "logout" %}</a>
- {% else %}
- <a href="{% url user_signin %}">{% trans "login" %}</a>
- {% endif %}
- <a href="/about">{% trans "about" %}</a>
- <a href="/faq">{% trans "faq" %}</a>
- </div>
- </div>
- <div id="roof">
- <div id="navBar">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="23%">
- <div id="logo">
- <a href="/">
- <img src="/content/images/logo.png" title="{% trans "back to home page" %}" />
- </a>
- </div>
- </td>
- <td width="77%" valign="bottom">
- <div class="nav">
- <a id="nav_questions" href="/questions/" >{% trans "questions" %}</a>
- <a id="nav_tags" href="/tags/">{% trans "tags" %}</a>
- <a id="nav_users" href="/users/">{% trans "users" %}</a>
- <!--<a id="nav_books" href="/books/">{% trans "books" %}</a>-->
- <a id="nav_badges" href="/badges/">{% trans "badges" %}</a>
- <a id="nav_unanswered" href="/questions/unanswered/">{% trans "unanswered questions" %}</a>
-
- {% comment %}<!-- i think this needs to be removed -e.f. -->
- {% if request.user.is_authenticated %}
- <a id="nav_profile" href="/users/{{ request.user.id }}/{{ request.user.username }}/">{% trans "my profile" %}</a>
- {% endif %}
- {% endcomment %}
- <div class="focus">
- <a id="nav_ask" href="/questions/ask/" class="special">{% trans "ask a question" %}</a>
- </div>
- </div>
-
- </td>
- </tr>
- </table>
- </div>
- <div id="searchBar">
- <table width="100%" height="60" border="0" cellpadding="0" cellspacing="0" class="content">
- <tr>
- <td align="center" valign="middle">
- <form action="/search/" method="GET">
- <div>
- <input type="text" class="searchInput" value="{{ keywords }}" name="q" id="keywords" >
- <input type="submit" name="Submit" value="{% trans "search" %}" class="searchBtn" >
- </div>
- <div class="options">
- <input id="type-question" type="radio" class="" value="question" name="t" checked >{% trans "questions" %}
- <input id="type-tag" type="radio" class="" value="tag" name="t" >{% trans "tags" %}
- <input id="type-user" type="radio" class="" value="user" name="t" >{% trans "users" %}
- </div>
- </form>
- </td>
- </tr>
- </table>
- </div>
- </div>
-<!-- end template header.html -->
+<!-- template header.html -->
+{% load extra_tags %}
+{% load i18n %}
+ <div id="roof">
+ <div id="navBar">
+ <div id="top">
+ <!--<div id="header">-->
+ {% if request.user.is_authenticated %}
+ <a href="/users/{{ request.user.id }}/{{ request.user.username }}/">{{ request.user.username }}</a> {% get_score_badge request.user %}
+ <a href="/logout/">{% trans "logout" %}</a>
+ {% else %}
+ <a href="/account/signin">{% trans "login" %}</a>
+ {% endif %}
+ <a href="/about">{% trans "about" %}</a>
+ <a href="/faq">{% trans "faq" %}</a>
+ <!--</div>-->
+ </div>
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td width="23%">
+ <div id="logo">
+ <a href="/">
+ <img src="/content/images/logo.png" title="{% trans "back to home page" %}" />
+ </a>
+ </div>
+ </td>
+ <td width="77%" valign="bottom">
+ <div class="nav">
+ <a id="nav_questions" href="/questions/" >{% trans "questions" %}</a>
+ <a id="nav_tags" href="/tags/">{% trans "tags" %}</a>
+ <a id="nav_users" href="/users/">{% trans "users" %}</a>
+ <!--<a id="nav_books" href="/books/">{% trans "books" %}</a>-->
+ <a id="nav_badges" href="/badges/">{% trans "badges" %}</a>
+ <a id="nav_unanswered" href="/questions/unanswered/">{% trans "unanswered questions" %}</a>
+
+ {% comment %}<!-- i think this needs to be removed -e.f. -->
+ {% if request.user.is_authenticated %}
+ <a id="nav_profile" href="/users/{{ request.user.id }}/{{ request.user.username }}/">{% trans "my profile" %}</a>
+ {% endif %}
+ {% endcomment %}
+ <div class="focus">
+ <a id="nav_ask" href="/questions/ask/" class="special">{% trans "ask a question" %}</a>
+ </div>
+ </div>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div id="searchBar">
+ <table width="100%" height="60" border="0" cellpadding="0" cellspacing="0" class="content">
+ <tr>
+ <td align="center" valign="middle">
+ <form action="/search/" method="GET">
+ <div>
+ <input type="text" class="searchInput" value="{{ keywords }}" name="q" id="keywords" >
+ <input type="submit" name="Submit" value="{% trans "search" %}" class="searchBtn" >
+ </div>
+ <div class="options">
+ <input id="type-question" type="radio" class="" value="question" name="t" checked >{% trans "questions" %}
+ <input id="type-tag" type="radio" class="" value="tag" name="t" >{% trans "tags" %}
+ <input id="type-user" type="radio" class="" value="user" name="t" >{% trans "users" %}
+ </div>
+ </form>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+<!-- end template header.html -->
diff --git a/templates/index.html b/templates/index.html
index db2bb12e..a1ab06a4 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,11 +1,12 @@
{% extends "base.html" %}
+<!-- index.html -->
{% load i18n %}
{% load extra_tags %}
{% load humanize %}
{% load extra_filters %}
{% block title %}{% spaceless %}{% trans "Home" %}{% endspaceless %}{% endblock %}
-{% block meta %}<meta name="keywords" content="{{ APP_KEYWORDS }}" />
- <meta name="description" content="{{ APP_DESCRIPTION }}" />{% endblock %}
+{% block meta %}<meta name="keywords" content="{{ settings.APP_KEYWORDS }}" />
+ <meta name="description" content="{{ settings.APP_DESCRIPTION }}" />{% endblock %}
{% block forejs %}
<script type="text/javascript">
$().ready(function(){
@@ -78,7 +79,7 @@
<div class="boxA">
<h3>{% trans "welcome to website" %}</h3>
<div class="body">
- {{ APP_INTRO|safe }}
+ {{ settings.APP_INTRO|safe }}
<div class="more"><a href="/about">{% trans "about" %} »</a></div>
<div class="more"><a href="/faq">{% trans "faq" %} »</a></div>
</div>
@@ -117,6 +118,7 @@
{% endblock %}
{% block tail %}
<div style="padding:5px 0 5px 5px;">
-<span class="evenMore">{% trans "Still looking for more? See" %} <a href="/questions/">{% trans "complete list of quesionts" %}</a>, {% trans "or" %} <a href="/tags/">{% trans "popular tags" %}</a>{% trans "." %} {% trans "Please help us answer" %} <a href="/questions/unanswered">{% trans "unanswered questions" %}</a>{% trans "." %}</span>
+<span class="evenMore">{% trans "Still looking for more? See" %} <a href="/questions/">{% trans "complete list of questions" %}</a> {% trans "or" %} <a href="/tags/">{% trans "popular tags" %}</a>{% trans "." %} {% trans "Please help us answer" %} <a href="/questions/unanswered">{% trans "list of unanswered questions" %}</a>{% trans "." %}</span>
</div>
{% endblock %}
+<!-- index.html -->
diff --git a/templates/logout.html b/templates/logout.html
index 6270924a..e05a4328 100644
--- a/templates/logout.html
+++ b/templates/logout.html
@@ -1,5 +1,5 @@
-<!-- template logout.html -->
{% extends "base_content.html" %}
+<!-- template logout.html -->
{% load extra_tags %}
{% load humanize %}
{% load i18n %}
@@ -22,4 +22,4 @@
<br><br>
</div>
{% endblock %}
-<!-- ent template logout.html -->
+<!-- end logout.html -->
diff --git a/templates/pagesize.html b/templates/pagesize.html
index e5e17a24..5037f1f6 100644
--- a/templates/pagesize.html
+++ b/templates/pagesize.html
@@ -1,8 +1,9 @@
+<!-- template pagesize.html -->
{% spaceless %}
{% load i18n %}
{% if is_paginated %}
<div class="paginator">
- <span class="text">{% trans "Size per page:" %}</span>
+ <span class="text">{% trans "posts per page" %}</span>
{% ifequal pagesize 10 %}
<span class="curr">10</span>
{% else %}
@@ -23,3 +24,4 @@
</div>
{% endif %}
{% endspaceless %}
+<!-- end template pagesize.html -->
diff --git a/templates/paginator.html b/templates/paginator.html
index ae8329cb..2fba5425 100644
--- a/templates/paginator.html
+++ b/templates/paginator.html
@@ -1,9 +1,10 @@
+<!-- paginator.html -->
{% spaceless %}
{% load i18n %}
{% if is_paginated %}
<div class="paginator">
-{% if has_previous %}<span class="prev"><a href="{{base_url}}page={{ previous }}{{ extend_url }}" title="{% trans 'Previous'%}">&laquo; <% trans "Previous" %></a></span>{% endif %}
-
+{% if has_previous %}<span class="prev"><a href="{{base_url}}page={{ previous }}{{ extend_url }}" title="{% trans "previous" %}">
+&laquo; {% trans "previous" %}</a></span>{% endif %}
{% if not in_leading_range %}
{% for num in pages_outside_trailing_range %}
<span class="page"><a href="{{base_url}}page={{ num }}{{ extend_url }}" >{{ num }}</a></span>
@@ -15,22 +16,23 @@
{% ifequal num page %}
{% ifequal pages 1 %}
{% else %}
- <span class="curr" title='<% trans "Current page" %>'>{{ num }}</span>
+ <span class="curr" title="{% trans "current page" %}">{{ num }}</span>
{% endifequal %}
{% else %}
- <span class="page"><a href="{{base_url}}page={{ num }}{{ extend_url }}" title="No.{{ num }}">{{ num }}</a></span>
+ <span class="page"><a href="{{base_url}}page={{ num }}{{ extend_url }}" title="{% trans "page number " %}{{ num }}{% trans "number - make blank in english" %}">{{ num }}</a></span>
{% endifequal %}
{% endfor %}
{% if not in_trailing_range %}
...
{% for num in pages_outside_leading_range reversed %}
- <span class="page"><a href="{{base_url}}page={{ num }}{{ extend_url }}" title="No.{{ num }}">{{ num }}</a></span>
+ <span class="page"><a href="{{base_url}}page={{ num }}{{ extend_url }}" title="{% trans "page number " %}{{ num }}{% trans "number - make blank in english" %}">{{ num }}</a></span>
{% endfor %}
{% endif %}
-{% if has_next %}<span class="next"><a href="{{base_url}}page={{ next }}{{ extend_url }}" title="下一页">下一页 &raquo;</a></span>{% endif %}
+{% if has_next %}<span class="next"><a href="{{base_url}}page={{ next }}{{ extend_url }}" title="{% trans "next page" %}">{% trans "next page" %} &raquo;</a></span>{% endif %}
</div>
{% endif %}
{% endspaceless %}
+<!-- end paginator.html -->
diff --git a/templates/privacy.html b/templates/privacy.html
index 335aba92..d5d7dd43 100644
--- a/templates/privacy.html
+++ b/templates/privacy.html
@@ -1,5 +1,5 @@
-<!-- privacy.html -->
{% extends "base_content.html" %}
+<!-- privacy.html -->
{% load extra_tags %}
{% load i18n %}
{% load humanize %}
diff --git a/templates/question.html b/templates/question.html
index 5ba08b63..eaff9da3 100644
--- a/templates/question.html
+++ b/templates/question.html
@@ -1,5 +1,8 @@
+{% extends "base.html" %}
<!-- question.html -->
-{% extends "base.html" %}{% load extra_tags %}{% load extra_filters %}{% load humanize %}
+{% load extra_tags %}
+{% load extra_filters %}
+{% load humanize %}
{% load i18n %}
{% block title %}{% spaceless %}{{ question.get_question_title }}{% endspaceless %}{% endblock %}
{% block forejs %}
@@ -250,10 +253,10 @@
</div>
{% endif %}
- {% ifnotequal question.answer_count 0 %}
+ {% ifnotequal answers.length 0 %}
<div class="tabBar">
<a name="sort-top"></a>
- <div class="headQuestions">{{ question.answer_count }}{% trans "Answers" %}:</div>
+ <div class="headQuestions">{{ answers|length }}{% trans "Answers" %}:</div>
<div class="tabsA">
<a id="oldest" href="?sort=oldest#sort-top" title="{% trans "oldest answers will be shown first" %}">{% trans "oldest answers" %}</a>
<a id="latest" href="?sort=latest#sort-top" title="{% trans "newest answers will be shown first" %}">{% trans "newest answers" %}</a>
@@ -431,10 +434,12 @@
</div>
{% if not question.closed %}
- {% if request.user.is_authenticated %}
<div style="padding:10px 0 0 0;">
<div class="headNormal">{% trans "Your answer" %}:</div>
</div>
+ {% if not request.user.is_authenticated %}
+ <div class="message">{% trans "you can answer anonymously and then login" %}</div>
+ {% endif %}
<div id="description" class="" >
<div id="wmd-button-bar" class="wmd-panel"></div>
@@ -458,9 +463,11 @@
</div>
<br>
<input type="submit" value="{% trans "Answer the question" %}" class="submit"><span class="form-error"></span>
- {% else %}
- <input id="btLogin" type="button" class="submit" style="width:200px" value="{% trans "Login to answer" %}">
- {% endif %}
+ {% if request.user.is_authenticated %}
+ {{ answer.email_notify }} <label for="question-subscribe-updates">{% trans "Notify me daily if there are any new answers." %}</label>
+ {% else %}
+ <input type="checkbox" disabled><label>{% trans "once you sign in you will be able to subscribe for any updates here" %}</label>
+ {% endif %}
{% endif %}
<br><br>
</form>
diff --git a/templates/question_edit.html b/templates/question_edit.html
index 6fe8bb41..9ad60a88 100644
--- a/templates/question_edit.html
+++ b/templates/question_edit.html
@@ -1,5 +1,5 @@
-<!-- question_edit.html -->
{% extends "base.html" %}
+<!-- question_edit.html -->
{% load i18n %}
{% block title %}{% spaceless %}{% trans "Edit question" %}{% endspaceless %}{% endblock %}
{% block forejs %}
diff --git a/templates/question_retag.html b/templates/question_retag.html
index aebf93a5..c7062e30 100644
--- a/templates/question_retag.html
+++ b/templates/question_retag.html
@@ -1,5 +1,6 @@
{% extends "base.html" %}
-{% block title %}{% spaceless %}修改问题标签{% endspaceless %}{% endblock %}
+<!-- question_retag.html -->
+{% block title %}{% spaceless %}{% trans "Change tags" %}{% endspaceless %}{% endblock %}
{% block forejs %}
<script type='text/javascript' src='/content/js/com.cnprog.editor.js'></script>
<script type='text/javascript' src='/content/js/com.cnprog.post.js'></script>
@@ -34,8 +35,8 @@
},
messages: {
tags: {
- required: " 标签不能为空。",
- maxlength: " 最多5个标签,每个标签长度小于20个字符。"
+ required: "{% trans "tags are required" %}",
+ maxlength: "{% trans "up to 5 tags, less than 20 characters each" %}
}
}
@@ -48,7 +49,7 @@
{% block content %}
<div id="main-bar" class="headNormal">
- 修改标签 [<a href="{{ question.get_absolute_url }}">返回</a>]
+ {% trans "Change tags" %} [<a href="{{ question.get_absolute_url }}">{% trans "back" %}</a>]
</div>
<div id="main-body" class="ask-body">
<div id="askform">
@@ -71,8 +72,8 @@
<br>
<div class="error" ></div>
- <input type="submit" value="现在修改" class="submit" />
- <input type="button" value="取消" class="submit" onclick="history.back(-1);" />
+ <input type="submit" value="{% trans "Save edit" %}" class="submit" />
+ <input type="button" value="{% trans "Cancel" %}" class="submit" onclick="history.back(-1);" />
<br>
<br>
</form>
@@ -82,20 +83,16 @@
{% block sidebar %}
<div class="boxC">
- <p class="subtitle">为什么我只能修改问题标签?</p>
+ <p class="subtitle">{% trans "Why use and modify tags?" %}</p>
<ul class="list-item">
-
<li>
- CNProg用标签来分类系统的信息
-
+ {% trans "tags help us keep Questions organized" %}
</li>
<li>
修改完整问题需要用户的积分达到一定条件(比如:积分 >= 3000分,自己发布的问题除外),而用户积分达到比较低的时候,就可以修改问题的标签(比如:积分 >= 500, 这里指所有问题的标签)。
-
</li>
<li>
- 修改标签的用户将授予特殊的社区奖牌
-
+ {% trans "tag editors receive special awards from the community" %}
</li>
</ul>
<a href="{% url faq %}" style="float:right;position:relative">faq »</a>
@@ -106,4 +103,4 @@
{% block endjs %}
{% endblock %}
-
+<!-- end question_retag.html -->
diff --git a/templates/questions.html b/templates/questions.html
index bfc1177c..5dac0156 100644
--- a/templates/questions.html
+++ b/templates/questions.html
@@ -1,9 +1,10 @@
{% extends "base.html" %}
-{% load i18n %}
+<!-- questions.html -->
{% load extra_tags %}
+{% load i18n %}
{% load humanize %}
{% load extra_filters %}
-{% block title %}{% spaceless %}{% trans "Question list" %}{% endspaceless %}{% endblock %}
+{% block title %}{% spaceless %}{% trans "Questions" %}{% endspaceless %}{% endblock %}
{% block forejs %}
<script type="text/javascript">
$().ready(function(){
@@ -19,12 +20,12 @@
{% endblock %}
{% block content %}
<div class="tabBar">
- <div class="headQuestions">{% if searchtag %}{% trans "Tagged questions" %}{% else %}{% if searchtitle %}{% trans "Query result" %}{% else %}{% trans "All questions" %}{% endif %}{% endif %}</div>
+ <div class="headQuestions">{% if searchtag %}{% trans "Found by tags" %}{% else %}{% if searchtitle %}{% trans "Found by title" %}{% else %}{% trans "All questions" %}{% endif %}{% endif %}</div>
<div class="tabsA">
- <a id="latest" href="?sort=latest" class="off" title="{% trans 'New questions' %}">{% trans "Newest" %}</a>
- <a id="active" href="?sort=active" class="off" title="{% trans 'Newest updated questions' %}">{% trans "Active" %}</a>
- <a id="hottest" href="?sort=hottest" class="off" title="{% trans 'Questions with most answers' %}">{% trans "Hottest" %}</a>
- <a id="mostvoted" href="?sort=mostvoted" class="off" title="{% trans 'Questions with most votes' %}">{% trans "Best" %}</a>
+ <a id="latest" href="?sort=latest" class="off" title="{% trans "most recently asked questions" %}">{% trans "newest" %}</a>
+ <a id="active" href="?sort=active" class="off" title="{% trans "most recently updated questions" %}">{% trans "active" %}</a>
+ <a id="hottest" href="?sort=hottest" class="off" title="{% trans "hottest questions" %}">{% trans "hottest" %}</a>
+ <a id="mostvoted" href="?sort=mostvoted" class="off" title="{% trans "most voted questions" %}">{% trans "most voted" %}</a>
</div>
</div>
<div id="listA">
@@ -41,9 +42,9 @@
<td><span class="num">{{ question.view_count|cnprog_intword|safe }}</span> </td>
</tr>
<tr>
- <td><span class="unit">{% trans "Answers" %}</span></td>
- <td><span class="unit">{% trans "Votes" %}</span></td>
- <td><span class="unit">{% trans "Visits" %}</span></td>
+ <td><span class="unit">{% trans "answers" %}</span></td>
+ <td><span class="unit">{% trans "votes" %}</span></td>
+ <td><span class="unit">{% trans "views" %}</span></td>
</tr>
</table>
</div>
@@ -54,7 +55,7 @@
{% ifequal tab_id 'active'%}
{% if question.wiki %}
- <span class="from wiki">{% trans "Community wiki" %}</span>
+ <span class="from wiki">{% trans "community wiki" %}</span>
<span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>
{% else %}
<div class="from">
@@ -66,7 +67,7 @@
{% endif %}
{% else %}
{% if question.wiki %}
- <span class="from wiki">{% trans "Community wiki" %}</span>
+ <span class="from wiki">{% trans "community wiki" %}</span>
<span class="date" title="{{ question.added_at }}">{% diff_date question.added_at %}</span>
{% else %}
<div class="from">
@@ -80,7 +81,7 @@
<div class="tags">
{% for tag in question.tagname_list %}
- <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans 'Browse questions with tag of '%}" rel="tag">{{ tag }}</a>
+ <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans "see questions tagged" %}'{{ tag }}'{% trans "using tags" %}" rel="tag">{{ tag }}</a>
{% endfor %}
</div>
</div>
@@ -104,28 +105,55 @@
{% block sidebar %}
<div class="boxC">
<p>
- 您正在浏览所有<br><div class="questions-count">{{ questions_count|intcomma }}</div>
- <p>个
- {% if searchtag %}
- 标记为
- <span class="tag">
- {{ searchtag }}
- </span>
- {% endif %}
- {% if searchtitle %}
- 标题含有
- <strong class="darkred">
- {{ searchtitle }}
- </strong>
- {% endif %}
- 的问题。</p>
+ {% if searchtag %}
+ {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num and searchtag as tagname %}
+ have total {{q_num}} questions tagged {{tagname}}
+ {% plural %}
+ have total {{q_num}} questions tagged {{tagname}}
+ {% endblocktrans %}
+ {% else %}
+ {% if searchtitle %}
+ {% blocktrans count questions_count as cnt with questions_count|intcomma as q_num %}
+ have total {{q_num}} questions containing {{searchtitle}}
+ {% plural %}
+ have total {{q_num}} questions containing {{searchtitle}}
+ {% endblocktrans %}
+ {% else %}
+ {% blocktrans count questions as cnt with questions_count|intcomma as q_num %}
+ have total {{q_num}} questions
+ {% plural %}
+ have total {{q_num}} questions
+ {% endblocktrans %}
+ {% endif %}
+ {% endif %}
+
+ {% ifequal tab_id "latest" %}
+ <p>{% trans "latest questions info" %}</p>
+ {% endifequal %}
+
+ {% ifequal tab_id "active" %}
+ <p>{% trans "Questions are sorted by the <strong>time of last update</strong>." %}
+ {% trans "Most recently answered ones are shown first." %}</p>
+ {% endifequal %}
+
+ {% ifequal tab_id "hottest" %}
+ <p>{% trans "Questions sorted by <strong>number of responses</strong>." %}
+ {% trans "Most answered questions are shown first." %}</p>
+ {% endifequal %}
+
+ {% ifequal tab_id "mostvoted" %}
+ <p>{% trans "Questions are sorted by the <strong>number of votes</strong>." %}
+ {% trans "Most voted questions are shown first." %}</p>
+ {% endifequal %}
+
+
</p>
</div>
<div class="boxC">
<h3 class="subtitle">{% trans "Related tags" %}</h3>
<div class="tags">
{% for tag in tags %}
- <a rel="tag" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a>
+ <a rel="tag" title="{% trans "see questions tagged" %}'{{ tag.name }}'{% trans "using tags" %}" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a>
<span class="tag-number">× {{ tag.used_count|intcomma }}</span>
<br>
{% endfor %}
@@ -134,4 +162,4 @@
</div>
{% endblock %}
-
+<!-- end questions.html -->
diff --git a/templates/reopen.html b/templates/reopen.html
index 7ab59421..37fb69c1 100644
--- a/templates/reopen.html
+++ b/templates/reopen.html
@@ -1,5 +1,5 @@
-<!-- reopen.html -->
{% extends "base_content.html" %}
+<!-- reopen.html -->
{% load extra_tags %}
{% load i18n %}
{% load humanize %}
@@ -34,7 +34,4 @@
</form>
</div>
{% endblock %}
-
-
-
<!-- end reopen.html -->
diff --git a/templates/revisions_answer.html b/templates/revisions_answer.html
index 5ab12fbf..9c2e53eb 100644
--- a/templates/revisions_answer.html
+++ b/templates/revisions_answer.html
@@ -1,5 +1,5 @@
-<!-- revisions_answer.html -->
{% extends "base_content.html" %}
+<!-- revisions_answer.html -->
{% load i18n %}
{% load extra_tags %}
{% load extra_filters %}
diff --git a/templates/revisions_question.html b/templates/revisions_question.html
index 77a421bb..7ada3e74 100644
--- a/templates/revisions_question.html
+++ b/templates/revisions_question.html
@@ -1,5 +1,5 @@
-<!-- revisions_question.html -->
{% extends "base_content.html" %}
+<!-- revisions_question.html -->
<!--somehow very similar to revisions_answer.html-->
{% load extra_tags %}
{% load i18n %}
@@ -99,5 +99,4 @@
{% block endjs %}
{% endblock %}
-
<!-- end revisions_question.html -->
diff --git a/templates/tags.html b/templates/tags.html
index 6131e527..6f9b3aed 100644
--- a/templates/tags.html
+++ b/templates/tags.html
@@ -1,4 +1,5 @@
{% extends "base_content.html" %}
+<!-- tags.html -->
{% load i18n %}
{% load extra_tags %}
{% load humanize %}
diff --git a/templates/unanswered.html b/templates/unanswered.html
index 926f2ffd..13b3a3b2 100644
--- a/templates/unanswered.html
+++ b/templates/unanswered.html
@@ -1,5 +1,5 @@
-<!-- unanswered.html -->
{% extends "base.html" %}
+<!-- unanswered.html -->
{% load extra_tags %}
{% load i18n %}
{% load humanize %}
diff --git a/templates/upfiles/1245715031297631.png b/templates/upfiles/1245715031297631.png
new file mode 100755
index 00000000..89a6aed4
--- /dev/null
+++ b/templates/upfiles/1245715031297631.png
Binary files differ
diff --git a/templates/upfiles/12457157052552259.png b/templates/upfiles/12457157052552259.png
new file mode 100755
index 00000000..89a6aed4
--- /dev/null
+++ b/templates/upfiles/12457157052552259.png
Binary files differ
diff --git a/templates/user.html b/templates/user.html
index 53a30dc0..efca80e6 100644
--- a/templates/user.html
+++ b/templates/user.html
@@ -1,35 +1,33 @@
+{% extends "base_content.html" %}
<!-- user.html -->
-{% extends "base_content.html" %}
-{% load extra_tags %}
-{% load humanize %}
-{% block title %}{% spaceless %}{{ page_title }}{% endspaceless %}{% endblock %}
-{% block forestyle%}
- <style type="text/css">
- .history-table td { padding: 5px; }
- .user-stats-table { margin-left:50px; }
- </style>
-{% endblock %}
-{% block forejs %}
- <script type="text/javascript">
- $().ready(function(){
- {% ifequal view_user request.user%}
- $("#nav_profile").attr('className',"on");
- {% else %}
- $("#nav_users").attr('className',"on");
-
- {% endifequal %}
- });
- </script>
- {% block userjs %}
- {% endblock %}
-{% endblock %}
-
-{% block content %}
- <div id="mainbar-full">
- {% include "user_info.html" %}
- {% include "user_tabs.html" %}
- {% block usercontent %}
- {% endblock %}
- {% include "user_footer.html" %}
- </div>
+{% load extra_tags %}
+{% load humanize %}
+{% block title %}{% spaceless %}{{ page_title }}{% endspaceless %}{% endblock %}
+{% block forestyle%}
+ <style type="text/css">
+ .history-table td { padding: 5px; }
+ .user-stats-table { margin-left:50px; }
+ </style>
+{% endblock %}
+{% block forejs %}
+ <script type="text/javascript">
+ $().ready(function(){
+ {% ifequal view_user request.user%}
+ $("#nav_profile").attr('className',"on");
+ {% else %}
+ $("#nav_users").attr('className',"on");
+ {% endifequal %}
+ });
+ </script>
+ {% block userjs %}
+ {% endblock %}
+{% endblock %}
+{% block content %}
+ <div id="mainbar-full">
+ {% include "user_info.html" %}
+ {% include "user_tabs.html" %}
+ {% block usercontent %}
+ {% endblock %}
+ {% include "user_footer.html" %}
+ </div>
{% endblock %}<!-- end user.html -->
diff --git a/templates/user_edit.html b/templates/user_edit.html
index 0f927374..b49cea31 100644
--- a/templates/user_edit.html
+++ b/templates/user_edit.html
@@ -1,5 +1,5 @@
-<!-- user_edit.html -->
{% extends "base_content.html" %}
+<!-- user_edit.html -->
{% load extra_tags %}
{% load humanize %}
{% load i18n %}
diff --git a/templates/user_favorites.html b/templates/user_favorites.html
index d47670bd..185423c6 100644
--- a/templates/user_favorites.html
+++ b/templates/user_favorites.html
@@ -1,5 +1,5 @@
-<!-- user_favorites.html -->
{% extends "user.html" %}
+<!-- user_favorites.html -->
{% load extra_tags %}
{% load humanize %}
diff --git a/templates/user_info.html b/templates/user_info.html
index 8e6dca84..8d35015c 100644
--- a/templates/user_info.html
+++ b/templates/user_info.html
@@ -70,12 +70,14 @@
<td>{% get_age view_user.date_of_birth %} {% trans "age unit" %}</td>
</tr>
{% endif %}
+ <!--
{% if votes_today_left %}
<tr>
<td>{% trans "todays unused votes" %}</td>
<td><strong class="darkred">{{ votes_today_left }}</strong> {% trans "votes left" %}</td>
</tr>
{% endif %}
+ -->
</table>
</td>
<td width="380">
diff --git a/templates/user_preferences.html b/templates/user_preferences.html
index 3a760a25..eb7c4761 100644
--- a/templates/user_preferences.html
+++ b/templates/user_preferences.html
@@ -1,20 +1,23 @@
{% extends "user.html" %}
+<!-- user_preferences.html -->
+{% load i18n %}
{% load extra_tags %}
{% load humanize %}
{% block usercontent %}
<div style="padding:5px;">
<fieldset>
- <legend><b>同步Twitter消息</b></legend>
+ <legend><b>{% trans "Connect with Twitter" %}</b></legend>
<form>
- <label for="name">账号:</label>
+ <label for="name">{% trans "Twitter account name:" %}</label>
<input id="name" /><br>
- <label for="password">密码:</label>
+ <label for="password">{% trans "Twitter password:" %}</label>
<input id="password" type="password"/><br>
- <input id="cbMessage" type="checkbox" />发布我的提问到我的Twitter<br>
- <input id="cbReply" type="checkbox" />发布我的回答到我的Twitter<br>
- <input type="submit" value="保存" />
+ <input id="cbMessage" type="checkbox" />{% trans "Send my Questions to Twitter" %}<br>
+ <input id="cbReply" type="checkbox" />{% trans "Send my Answers to Twitter" %}<br>
+ <input type="submit" value="{% trans "Save" %}" />
</form>
</fieldset>
</div>
{% endblock %}
+<!-- end user_preferences.html -->
diff --git a/templates/user_recent.html b/templates/user_recent.html
index 70c074ad..7f6c9c8c 100644
--- a/templates/user_recent.html
+++ b/templates/user_recent.html
@@ -1,5 +1,5 @@
-<!-- user_recent.html -->
{% extends "user.html" %}
+<!-- user_recent.html -->
{% load extra_tags %}
{% load humanize %}
diff --git a/templates/user_reputation.html b/templates/user_reputation.html
index 7a1c7366..bb7200de 100644
--- a/templates/user_reputation.html
+++ b/templates/user_reputation.html
@@ -1,5 +1,5 @@
-<!-- user_reputation.html -->
{% extends "user.html" %}
+<!-- user_reputation.html -->
{% load extra_tags %}
{% load humanize %}
{% block userjs %}
diff --git a/templates/user_responses.html b/templates/user_responses.html
index 45aab21b..d739395b 100644
--- a/templates/user_responses.html
+++ b/templates/user_responses.html
@@ -1,5 +1,5 @@
-<!-- user_responses.html -->
{% extends "user.html" %}
+<!-- user_responses.html -->
{% load extra_tags %}
{% load humanize %}
diff --git a/templates/user_stats.html b/templates/user_stats.html
index a5be1a77..432a5b34 100644
--- a/templates/user_stats.html
+++ b/templates/user_stats.html
@@ -1,5 +1,5 @@
-<!-- user_stats.html -->
{% extends "user.html" %}
+<!-- user_stats.html -->
{% load i18n %}
{% load extra_tags %}
{% load humanize %}
diff --git a/templates/user_tabs.html b/templates/user_tabs.html
index 03a9d111..bcc12b8f 100644
--- a/templates/user_tabs.html
+++ b/templates/user_tabs.html
@@ -22,13 +22,11 @@
<a id="favorites" {% ifequal tab_name "favorites" %}class="on"{% endifequal %}
title="{% trans "questions that user selected as his/her favorite"
href="/users/{{view_user.id}}/{{view_user.username}}?sort=favorites">{% trans "favorites" %}</a>
- <!--
{% if request.user|can_view_user_preferences:view_user %}
<a id="preferences" {% ifequal tab_name "preferences" %}class="on"{% endifequal %}
title="{% trans "user preference settings" %}"
href="/users/{{view_user.id}}/{{view_user.username}}?sort=preferences">{% trans "settings" %}</a>
{% endif %}
- -->
</div>
</div>
<!-- end user_tabs.html -->
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 @@
-<!-- user_votes.html -->
{% extends "user.html" %}
+<!-- user_votes.html -->
{% load extra_tags %}
{% load humanize %}
{% load i18n %}
diff --git a/templates/users.html b/templates/users.html
index c3c9f790..966596fc 100644
--- a/templates/users.html
+++ b/templates/users.html
@@ -1,4 +1,5 @@
{% extends "base_content.html" %}
+<!-- users.html -->
{% load extra_tags %}
{% load humanize %}
{% load i18n %}