]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/ask.html
Adds question and answer metrics (chars and words) on the editors, and in the "more...
[osqa.git] / forum / skins / default / templates / ask.html
index 7b34ba4c9743a0e17574225c1b2eb8b02791edd1..b027ce49bf7b8f042a4c26131331496fdcb1731d 100644 (file)
 
         });
 
-        function submitClicked(e) {
+        function submitClicked(e, f) {
             if(!(browserTester('chrome') || browserTester('safari'))) {
                 $("input.submit")[0].disabled=true;
             }
             window.removeEventListener('beforeunload', beforeUnload, true);
+            if (f) {
+                f.submit();
+            }
         }
 
         function beforeUnload(e) {
                             <td>
                                 <span id="pre-collapse" title="{% trans "Toggle the real time Markdown editor preview" %}">{% trans "toggle preview" %}</span>
                             </td>
+                            <td style="text-align: right;" id="editor-metrics"></td>
                             {% if settings.WIKI_ON %}
                             <td class="tright">
                                 {{ form.wiki }} <span class="help_text" title="{{form.wiki.help_text}}">{{ form.wiki.label_tag }} </span>
                                {{ form.tags.help_text }}
                        </p>
             {% if not request.user.is_authenticated %}                                                                        
-            <input name="ask" type="submit" value="{% trans "Login/signup to post your question" %}" class="submit" onclick="submitClicked(event)"/>
+            <input name="ask" type="button" value="{% trans "Login/signup to post your question" %}" class="submit" onclick="submitClicked(event, this.form)"/>
                        {% else %}
-            <input name="ask" type="submit" value="{% trans "Ask your question" %}" class="submit" onclick="submitClicked(event)"/>
+            <input name="ask" type="button" value="{% trans "Ask your question" %}" class="submit" onclick="submitClicked(event, this.form)"/>
             {% endif %}
         </form>
     </div>