summaryrefslogtreecommitdiffstats
path: root/askbot/skins/old/templates/question.html
diff options
context:
space:
mode:
Diffstat (limited to 'askbot/skins/old/templates/question.html')
-rw-r--r--askbot/skins/old/templates/question.html553
1 files changed, 0 insertions, 553 deletions
diff --git a/askbot/skins/old/templates/question.html b/askbot/skins/old/templates/question.html
deleted file mode 100644
index 956ebc3a..00000000
--- a/askbot/skins/old/templates/question.html
+++ /dev/null
@@ -1,553 +0,0 @@
-{% extends "two_column_body.html" %}
-{% import "macros.html" as macros %}
-<!-- question.html -->
-{% block title %}{% spaceless %}{{ question.get_question_title() }}{% endspaceless %}{% endblock %}
-{% block meta_description %}
- <meta name="description" content="{{question.summary|striptags|escape}}" />
-{% endblock %}
-{% block keywords %}{{question.tagname_meta_generator()}}{% endblock %}
-{% block forestyle %}
- <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url()}}" />
- <link rel="stylesheet" type="text/css" href="{{'/js/wmd/wmd.css'|media}}" />
-{% endblock %}
-{% block content %}
-<h1><a href="{{ question.get_absolute_url() }}">{{ question.get_question_title() }}</a></h1>
-<table style="width:100%;" id="question-table" {% if question.deleted %}class="deleted"{%endif%}>
- <tr>
- <td style="width:30px;vertical-align:top">
- <div class="vote-buttons">
- {% if question_vote %}
- <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
- {% if question_vote.is_upvote() %}
- src="{{'/images/vote-arrow-up-on.png'|media}}"
- {% else %}
- src="{{'/images/vote-arrow-up.png'|media}}"
- {% endif %}
- alt="{% trans %}i like this post (click again to cancel){% endtrans %}"
- title="{% trans %}i like this post (click again to cancel){% endtrans %}" />
- <div id="question-vote-number-{{ question.id }}" class="vote-number"
- title="{% trans %}current number of votes{% endtrans %}">
- {{ question.score }}
- </div>
- <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
- {% if question_vote.is_downvote() %}
- src="{{'/images/vote-arrow-down-on.png'|media}}"
- {% else %}
- src="{{'/images/vote-arrow-down.png'|media}}"
- {% endif %}
- alt="{% trans %}i dont like this post (click again to cancel){% endtrans %}"
- title="{% trans %}i dont like this post (click again to cancel){% endtrans %}" />
- {% else %}
- <img id="question-img-upvote-{{ question.id }}" class="question-img-upvote"
- alt="{% trans %}i like this post (click again to cancel){% endtrans %}"
- src="{{'/images/vote-arrow-up.png'|media}}"
- title="{% trans %}i like this post (click again to cancel){% endtrans %}" />
- <div id="question-vote-number-{{ question.id }}" class="vote-number"
- title="{% trans %}current number of votes{% endtrans %}">
- {{ question.score }}
- </div>
- <img id="question-img-downvote-{{ question.id }}" class="question-img-downvote"
- src="{{'/images/vote-arrow-down.png'|media}}"
- alt="{% trans %}i dont like this post (click again to cancel){% endtrans %}"
- title="{% trans %}i dont like this post (click again to cancel){% endtrans %}" />
- {% endif %}
-
- {% if settings.ENABLE_SHARING_TWITTER %}{{ macros.share(site = 'twitter', icon = True) }}{% endif %}
- {% if settings.ENABLE_SHARING_FACEBOOK %}{{ macros.share(site = 'facebook', icon = True) }}{% endif %}
- {% if settings.ENABLE_SHARING_LINKEDIN %}{{ macros.share(site = 'linkedin', icon = True) }}{% endif %}
- {% if settings.ENABLE_SHARING_IDENTICA %}{{ macros.share(site = 'identica', icon = True) }}{% endif %}
- {% if settings.ENABLE_SHARING_GOOGLE %}<g:plusone size="small" count="false"></g:plusone>{% endif %}
- </div>
- </td>
- <td>
- <div class="question-body">
- {{question.html}}
- </div>
- <ul id="question-tags" class="post-tags tags">
- {% for tag in question.get_tag_names() %}
- {{ macros.tag_widget(
- tag,
- css_class = 'post-tag',
- html_tag = 'li'
- )
- }}
- {% endfor %}
- </ul>
- <div id="question-controls" class="post-controls">
- {% set pipe=joiner('<span class="sep">|</span>') %}
- {% if request.user|can_edit_post(question) %}{{ pipe() }}
- <a href="{% url edit_question question.id %}">{% trans %}edit{% endtrans %}</a>
- {% endif %}
- {% if request.user|can_retag_question(question) %}{{ pipe() }}
- <a id="retag" href="{% url retag_question question.id %}">{% trans %}retag{% endtrans %}</a>
- <script type="text/javascript">
- var retagUrl = "{% url retag_question question.id %}";
- </script>
- {% endif %}
- {% if question.thread.closed %}
- {% if request.user|can_reopen_question(question) %}{{ pipe() }}
- <a href="{% url reopen question.id %}">{% trans %}reopen{% endtrans %}</a>
- {% endif %}
- {% else %}
- {% if request.user|can_close_question(question) %}{{ pipe() }}
- <a href="{% url close question.id %}">{% trans %}close{% endtrans %}</a>
- {% endif %}
- {% endif %}
- {% if request.user|can_flag_offensive(question) %}{{ pipe() }}
- <span id="question-offensive-flag-{{ question.id }}" class="offensive-flag"
- title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}">
- <a>{% trans %}flag offensive{% endtrans %}</a>
- {% if request.user|can_see_offensive_flags(question) %}
- <span class="darkred">{% if question.offensive_flag_count > 0 %}({{ question.offensive_flag_count }}){% endif %}</span>
- {% endif %}
- </span>
- {% endif %}
- {% if request.user|can_delete_post(question) %}{{ pipe() }}
- <a id="question-delete-link-{{question.id}}">{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
- {% endif %}
- </div>
- <div class="post-update-info-container">
- {{
- macros.post_contributor_info(
- question,
- "original_author",
- question.wiki,
- settings.MIN_REP_TO_EDIT_WIKI
- )
- }}
- {{
- macros.post_contributor_info(
- question,
- "last_updater",
- question.wiki,
- settings.MIN_REP_TO_EDIT_WIKI,
- )
- }}
- </div>
- {{
- macros.post_comments_widget(
- post = question,
- show_post = show_post,
- show_comment = show_comment,
- comment_order_number = comment_order_number,
- user = request.user,
- max_comments = settings.MAX_COMMENTS_TO_SHOW
- )
- }}
- <!--/div-->
- </td>
- </tr>
-</table>
-{% if question.thread.closed %}
-<div class="question-status" style="margin-bottom:15px">
-<h3>{% trans close_reason=question.thread.get_close_reason_display() %}The question has been closed for the following reason "{{ close_reason }}" by{% endtrans %}
-<a href="{{ question.thread.closed_by.get_profile_url() }}">{{ question.thread.closed_by.username }}</a>
-{% trans closed_at=question.thread.closed_at %}close date {{closed_at}}{% endtrans %}</h3>
-</div>
-{% endif %}
-{% if answers %}
- <div class="tabBar">
- <h2 id="sort-top">
- {% trans counter=answers|length %}
- {{counter}} Answer:
- {% pluralize %}
- {{counter}} Answers:
- {% endtrans %}
- </h2>
- <div class="tabsA">
- <a id="oldest" href="{{ question.get_absolute_url() }}?sort=oldest#sort-top"
- title="{% trans %}oldest answers will be shown first{% endtrans %}"
- ><span>{% trans %}oldest answers{% endtrans %}</span></a>
- <a id="latest" href="{{ question.get_absolute_url() }}?sort=latest#sort-top"
- title="{% trans %}newest answers will be shown first{% endtrans %}"
- ><span>{% trans %}newest answers{% endtrans %}</span></a>
- <a id="votes" href="{{ question.get_absolute_url() }}?sort=votes#sort-top"
- title="{% trans %}most voted answers will be shown first{% endtrans %}"
- ><span>{% trans %}popular answers{% endtrans %}</span></a>
- </div>
- </div>
- {{ macros.paginator(paginator_context) }}
-
- {% for answer in answers %}
- <a name="{{ answer.id }}"></a>
- <div id="answer-container-{{ answer.id }}" class="answer {% if answer.accepted() %}accepted-answer{% endif %} {% if answer.author_id==question.author_id %} answered-by-owner{% endif %} {% if answer.deleted %}deleted{% endif %}">
- <table style="width:100%;" class="answer-table">
- <tr>
- <td style="width:30px;vertical-align:top">
- <div class="vote-buttons">
- <img id="answer-img-upvote-{{ answer.id }}" class="answer-img-upvote"
- {% if user_answer_votes[answer.id] == 1 %}
- src="{{'/images/vote-arrow-up-on.png'|media}}"
- {% else %}
- src="{{'/images/vote-arrow-up.png'|media}}"
- {% endif %}
- alt="{% trans %}i like this answer (click again to cancel){% endtrans %}"
- title="{% trans %}i like this answer (click again to cancel){% endtrans %}"/>
- <div id="answer-vote-number-{{ answer.id }}" class="vote-number" title="{% trans %}current number of votes{% endtrans %}">
- {{ answer.score }}
- </div>
- <img id="answer-img-downvote-{{ answer.id }}" class="answer-img-downvote"
- {% if user_answer_votes[answer.id] == -1 %}
- src="{{'/images/vote-arrow-down-on.png'|media}}"
- {% else %}
- src="{{'/images/vote-arrow-down.png'|media}}"
- {% endif %}
- alt="{% trans %}i dont like this answer (click again to cancel){% endtrans %}"
- title="{% trans %}i dont like this answer (click again to cancel){% endtrans %}" />
- {% if request.user == question.author %}
- <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept"
- {% if answer.accepted() %}
- src="{{'/images/vote-accepted-on.png'|media}}"
- {% else %}
- src="{{'/images/vote-accepted.png'|media}}"
- {% endif %}
- alt="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}"
- title="{% trans %}mark this answer as favorite (click again to undo){% endtrans %}" />
- {% else %}
- {% if answer.accepted() %}
- <img id="answer-img-accept-{{ answer.id }}" class="answer-img-accept"
- {% if answer.accepted() %}
- src="{{'/images/vote-accepted-on.png'|media}}"
- {% else %}
- src="{{'/images/vote-accepted.png'|media}}"
- {% endif %}
- alt="{% trans question_author=question.author.username %}{{question_author}} has selected this answer as correct{% endtrans %}"
- title="{% trans questsion_author=question.author.username%}{{question_author}} has selected this answer as correct{% endtrans %}"
- {% endif %}
- {% endif %}
- </div>
- </td>
- <td>
- <div class="item-right">
- <div class="answer-body">
- {{ answer.html }}
- </div>
- <div class="answer-controls post-controls">
- {% set pipe=joiner('<span class="sep">|</span>') %}
- <span class="linksopt">{{ pipe() }}
- <a
- href="{{ answer.get_absolute_url() }}"
- title="{% trans %}answer permanent link{% endtrans %}">
- {% trans %}permanent link{% endtrans %}
- </a>
- </span>
- {% if request.user|can_edit_post(answer) %}{{ pipe() }}
- <span class="action-link"><a href="{% url edit_answer answer.id %}">{% trans %}edit{% endtrans %}</a></span>
- {% endif %}
- {% if request.user|can_flag_offensive(answer) %}{{ pipe() }}
- <span id="answer-offensive-flag-{{ answer.id }}" class="offensive-flag"
- title="{% trans %}report as offensive (i.e containing spam, advertising, malicious text, etc.){% endtrans %}">
- <a>{% trans %}flag offensive{% endtrans %}</a>
- {% if request.user|can_see_offensive_flags(answer) %}
- <span class="darkred">{% if answer.offensive_flag_count > 0 %}({{ answer.offensive_flag_count }}){% endif %}</span>
- {% endif %}
- </span>
- {% endif %}
- {% if request.user|can_delete_post(answer) %}{{ pipe() }}
- {% spaceless %}
- <span class="action-link">
- <a id="answer-delete-link-{{answer.id}}">
- {% if answer.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
- </span>
- {% endspaceless %}
- {% endif %}
- {% if settings.ALLOW_SWAPPING_QUESTION_WITH_ANSWER and request.user.is_authenticated() and request.user.is_administrator_or_moderator() %}{{ pipe() }}
- <span class="action-link">
- <a id="swap-question-with-answer-{{answer.id}}">{% trans %}swap with question{% endtrans %}</a>
- </span>
- {% endif %}
- </div>
- <div class="post-update-info-container">
- {{
- macros.post_contributor_info(
- answer,
- "original_author",
- answer.wiki,
- settings.MIN_REP_TO_EDIT_WIKI
- )
- }}
- {{
- macros.post_contributor_info(
- answer,
- "last_updater",
- answer.wiki,
- settings.MIN_REP_TO_EDIT_WIKI
- )
- }}
- </div>
- {{
- macros.post_comments_widget(
- post = answer,
- show_post = show_post,
- show_comment = show_comment,
- comment_order_number = comment_order_number,
- user = request.user,
- max_comments = settings.MAX_COMMENTS_TO_SHOW
- )
- }}
- </div>
- </td>
- </tr>
- </table>
- </div>
- {% endfor %}
- {{ macros.paginator(paginator_context) }}
-{% else %}
- {% set question_url=settings.APP_URL+question.get_absolute_url()|urlencode %}
- <h2 class="share-question">{% trans %}Know someone who can answer? Share a <a href="{{ question_url }}">link</a> to this question via{% endtrans %}
- {% if settings.ENABLE_SHARING_TWITTER %}{{ macros.share(site = 'twitter', site_label = 'Twitter') }},{% endif %}
- {% if settings.ENABLE_SHARING_FACEBOOK %}{{ macros.share(site = 'facebook', site_label = 'Facebook') }},{% endif %}
- {% if settings.ENABLE_SHARING_LINKEDIN %}{{ macros.share(site = 'linkedin', site_label = 'LinkedIn') }},{% endif %}
- {% if settings.ENABLE_SHARING_IDENTICA %}{{ macros.share(site = 'identica', site_label = 'Identi.ca') }},{% endif %}
- {%- if settings.ENABLE_SHARING_TWITTER or settings.ENABLE_SHARING_FACEBOOK or settings.ENABLE_SHARING_LINKEDIN or settings.ENABLE_SHARING_IDENTICA -%}
- {% trans %} or{% endtrans %}
- {% endif %}
- <a href="mailto:?subject={{ settings.APP_SHORT_NAME|urlencode }}&amp;body={{ question_url }}">{% trans %}email{% endtrans %}</a>.
- </h2>
-{% endif %}
-<form id="fmanswer" action="{% url answer question.id %}" method="post">{% csrf_token %}
- {% if request.user.is_authenticated() %}
- <p style="padding-left:3px">
- {{ answer.email_notify }}
- <label for="question-subscribe-updates">
- {% set email_feed_frequency = request.user.get_followed_question_alert_frequency() %}
- {% if email_feed_frequency =='n' %}
- {% trans %}Notify me once a day when there are any new answers{% endtrans %}
- {% elif email_feed_frequency =='d' %}
- {% trans %}Notify me once a day when there are any new answers{% endtrans %}
- {% elif email_feed_frequency =='w' %}
- {% trans %}Notify me weekly when there are any new answers{% endtrans %}
- {% elif email_feed_frequency =='i' %}
- {% trans %}Notify me immediately when there are any new answers{% endtrans %}
- {% endif %}
- </label>
- {% trans profile_url=request.user.get_profile_url() %}You can always adjust frequency of email updates from your {{profile_url}}{% endtrans %}
- </p>
- {% else %}
- <p style="padding-left:3px">
- {{ answer.email_notify }}
- <label>{% trans %}once you sign in you will be able to subscribe for any updates here{% endtrans %}</label>
- </p>
- {% endif %}
- <div style="clear:both">
- </div>
- {% if request.user.is_anonymous() and settings.ALLOW_POSTING_BEFORE_LOGGING_IN == False %}
- {% if not question.thread.closed %}
- <a
- class="submit"
- href="{{settings.LOGIN_URL}}?next={% url question question.id %}"
- >{% trans %}Login/Signup to Answer{% endtrans %}</a>
- {% endif %}
- {% else %}
- {% if not question.thread.closed %}
- <div style="padding:10px 0 0 0;">
- {% spaceless %}
- <h2>
- {% if answers %}
- {% trans %}Your answer{% endtrans %}
- {% else %}
- {% trans %}Be the first one to answer this question!{% endtrans %}
- {% endif %}
- </h2>
- {% endspaceless %}
- </div>
- {% if request.user.is_anonymous() %}
- <div class="message">{% trans %}you can answer anonymously and then login{% endtrans %}</div>
- {% else %}
- <p class="message">
- {% if request.user==question.author %}
- {% trans %}answer your own question only to give an answer{% endtrans %}
- {% else %}
- {% trans %}please only give an answer, no discussions{% endtrans %}
- {% endif %}
- </p>
- {% endif %}
- {{ macros.edit_post(answer) }}
- <input type="submit"
- {% if user.is_anonymous() %}
- value="{% trans %}Login/Signup to Post Your Answer{% endtrans %}"
- {% else %}
- {% if user == question.author %}
- value="{% trans %}Answer Your Own Question{% endtrans %}"
- {% else %}
- value="{% trans %}Answer the question{% endtrans %}"
- {% endif %}
- {% endif %}
- class="submit after-editor" style="float:left"/>
- {% if settings.WIKI_ON %}
- {{ macros.checkbox_in_div(answer.wiki) }}
- {% endif %}
- {% endif %}
- {% endif %}
- </form>
-{% endblock %}
-
-{% block sidebar %}
-
-{{ settings.SIDEBAR_QUESTION_HEADER }}
-<div class="boxC vote-buttons">
- <h2 style="font-size: 22px;margin-top: 11px; text-align: left;">{% trans %}Question tools{% endtrans %}</h2>
- {% if favorited %}
- <a class="button followed"
- alt="{% trans %}click to unfollow this question{% endtrans %}">
- <div>{% trans %}Following{% endtrans %}</div>
- <div class='unfollow'>{% trans %}Unfollow{% endtrans %}</div>
- </a>
- {% else %}
- <a class="button follow"
- alt="{% trans %}click to follow this question{% endtrans %}">
- {%trans %}Follow{%endtrans%}
- </a>
- {% endif %}
- <div class="clearfix"></div>
- <div id="favorite-number" class="favorite-number{% if favorited %} my-favorite-number{% endif %}">
- {% set follower_count = question.thread.favourite_count %}
- {% if follower_count > 0 %}
- {% trans count=follower_count %}{{count}} follower{% pluralize %}{{count}} followers{% endtrans %}
- {% endif %}
- </div>
-<div class="notify-sidebar">
- {%if request.user.is_authenticated() %}
- <input type="checkbox" id="question-subscribe-sidebar"/>
- <label for="question-subscribe-sidebar">{% trans %}email the updates{% endtrans %}</label>
- {%else%}
- <input type="checkbox" id="question-subscribe-sidebar"/>
- <label for="question-subscribe-sidebar">{% trans %}<strong>Here</strong> (once you log in) you will be able to sign up for the periodic email updates about this question.{% endtrans %}</label>
- {%endif%}
- </div>
-</div>
-{% cache 0 "questions_tags" questions_tags question.id language_code %}
-{% if settings.SIDEBAR_QUESTION_SHOW_TAGS %}
- <div class="boxC">
- <div class="clearfix"></div>
- <h2>
- {% trans %}Question tags{% endtrans %}:
- </h2>
- <ul id="related-tags" class="tags">
- {% for tag in tags %}
- <li>
- {{ macros.tag_widget(
- tag,
- html_tag = 'div',
- url_params = 'start_over=true',
- extra_content = '<span class="tag-number">&#215; ' ~
- tag.used_count|intcomma ~ '</span>'
- )
- }}
- </li>
- {% endfor %}
- </ul>
- </div>
-{% endif %}
-
-{% if settings.SIDEBAR_QUESTION_SHOW_META %}
-<div class="boxC">
- <div class="clearfix"></div>
- <h2>{% trans %}Stats:{% endtrans %}</h2>
- <p>
- {% trans %}question asked{% endtrans %}: <strong title="{{ question.added_at }}">{{question.added_at|diff_date}}</strong>
- </p>
- <p>
- {% trans %}question was seen{% endtrans %}: <strong>{{ question.thread.view_count|intcomma }} {% trans %}times{% endtrans %}</strong>
- </p>
- <p>
- {% trans %}last updated{% endtrans %}: <strong title="{{ question.last_activity_at }}">{{question.last_activity_at|diff_date}}</strong>
- </p>
-</div>
-{% endif %}
-{% endcache %}
-
-{% if similar_questions.data and settings.SIDEBAR_QUESTION_SHOW_RELATED %}
- {#% cache 1800 "related_questions" related_questions question.id language_code %#}
- <div class="boxC">
- <h2>{% trans %}Related questions{% endtrans %}</h2>
- <div class="questions-related">
- {% for question in similar_questions.data() %}
- <p>
- <a href="{{ question.get_absolute_url() }}">{{ question.get_question_title() }}</a>
- </p>
- {% endfor %}
- </div>
- </div>
- {#% endcache %#}
-{% endif %}
-
-{{ settings.SIDEBAR_QUESTION_FOOTER }}
-
-{% endblock %}
-{% block endjs %}
- {% if not question.thread.closed %}
- <script type='text/javascript' src='{{"/js/editor.js"|media}}'></script>
- <script type='text/javascript'>
- {% if settings.ENABLE_MATHJAX or settings.MARKUP_CODE_FRIENDLY %}
- var codeFriendlyMarkdown = true;
- {% else %}
- var codeFriendlyMarkdown = false;
- {% endif %}
- var maxCommentLength = {{settings.MAX_COMMENT_LENGTH}};
- askbot['urls']['postComments'] = '{% url post_comments %}';
- askbot['urls']['editComment'] = '{% url edit_comment %}';
- askbot['urls']['deleteComment'] = '{% url delete_comment %}';
- askbot['urls']['getComment'] = '{% url get_comment %}';
- askbot['urls']['question_url_template'] = scriptUrl + '{% trans %}question/{% endtrans %}{{ "{{QuestionID}}/{{questionSlug}}" }}';{# yes it needs to be that whacky #}
- askbot['urls']['user_signin'] = '{{ settings.LOGIN_URL }}';
- askbot['urls']['vote_url_template'] = scriptUrl + '{% trans %}questions/{% endtrans %}{{ "{{QuestionID}}/" }}{% trans %}vote/{% endtrans %}';
- askbot['urls']['swap_question_with_answer'] = '{% url swap_question_with_answer %}';
- askbot['urls']['upvote_comment'] = '{% url upvote_comment %}';
- askbot['messages']['addComment'] = '{% trans %}add comment{% endtrans %}';
- {% if settings.SAVE_COMMENT_ON_ENTER %}
- askbot['settings']['saveCommentOnEnter'] = true;
- {% else %}
- askbot['settings']['saveCommentOnEnter'] = false;
- {% endif %}
- </script>
- <script type='text/javascript' src='{{"/js/wmd/showdown.js"|media}}'></script>
- <script type='text/javascript' src='{{"/js/wmd/wmd.js"|media}}'></script>
- {% endif %}
- <script type='text/javascript' src='{{"/js/jquery.validate.min.js"|media}}'></script>
- <script type='text/javascript' src='{{"/js/post.js"|media}}'></script>
- <script type="text/javascript">
- // define reputation needs for comments
- var repNeededForComments = 50;
- $().ready(function(){
- {% if request.user.is_authenticated() %}
- if ($('#question-subscribe-updates')[0].checked){
- $('#question-subscribe-sidebar').attr({'checked': 'checked'});
- }
- {%endif%}
- $("#nav_questions").attr('className',"on");
- var answer_sort_tab = "{{ tab_id }}";
- $("#" + answer_sort_tab).attr('className',"on");
-
- Vote.init({{ question.id }}, '{{ question.title|slugify }}', '{{ question.author.id }}','{{ request.user.id }}');
-
- {% if not question.thread.closed and request.user.is_authenticated %}initEditor();{% endif %}
-
- lanai.highlightSyntax();
- $('#btLogin').bind('click', function(){window.location.href='{{ settings.LOGIN_URL }}'; } )
- if (window.location.hash === 'fmanswer'){
- $('#fmanswer textarea').focus();
- }
- {% if settings.ENABLE_SHARING_GOOGLE %}$.getScript("http://apis.google.com/js/plusone.js"){% endif %}
- });
-
- function initEditor(){
- $('#editor').TextAreaResizer();
- //highlight code synctax when editor has new text
- $("#editor").typeWatch({highlight: false, wait: 3000,
- captureLength: 5, callback: lanai.highlightSyntax});
-
- var display = true;
- var txt = "[{% trans %}hide preview{% endtrans %}]";
- $('#pre-collapse').text(txt);
- $('#pre-collapse').bind('click', function(){
- txt = display ? "[{% trans %}show preview{% endtrans %}]" : "[{% trans %}hide preview{% endtrans %}]";
- display = !display;
- $('#previewer').toggle();
- $('#pre-collapse').text(txt);
- });
- setupFormValidation($("#fmanswer"), CPValidator.getQuestionFormRules(), CPValidator.getQuestionFormMessages());
- }
- </script>
- {% include "blocks/editor_data.html" %}
-{% endblock %}