]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/question_edit.html
Removes a redundant piece of text from the tags template.
[osqa.git] / forum / skins / default / templates / question_edit.html
index fe711849006390ba64b0f5bd52685a8a5cd505d1..9207209956dd0a452b03aca86d70534a93643e12 100644 (file)
@@ -4,9 +4,6 @@
 {% load extra_tags %}
 {% block title %}{% spaceless %}{% trans "Edit question" %}{% endspaceless %}{% endblock %}
 {% block forejs %}
-        <script type='text/javascript' src='{% media  "/media/js/com.cnprog.editor.js" %}'></script>
-        <script type='text/javascript' src='{% media  "/media/js/com.cnprog.post.js" %}'></script>
-        <script type='text/javascript' src='{% media  "/media/js/jquery.validate.pack.js" %}'></script>
         <script type='text/javascript' src='{% media  "/media/js/wmd/showdown.js" %}'></script>
         <script type='text/javascript' src='{% media  "/media/js/wmd/wmd.js" %}'></script>
         <link rel="stylesheet" type="text/css" href="{% media  "/media/js/wmd/wmd.css" %}" />
             $("#nav_questions").attr('className',"on");
             $('#editor').TextAreaResizer();
             
-            //highlight code synctax when editor has new text
-            $("#editor").typeWatch({highlight: false, wait: 3000,
-                             captureLength: 5, callback: lanai.highlightSyntax});
-                             
+
             //toggle preview of editor
             var display = true;
             var txt = "[{% trans "hide preview" %}]";
@@ -32,8 +26,7 @@
             });
             
             //Tags autocomplete action
-            var tags = {{ tags|safe }};
-               $("#id_tags").autocomplete(tags, {
+               $("#id_tags").autocomplete("/matching_tags/", {
                        matchContains: true,
                 max: 20,
                 multiple: true,
                 highlightItem: true,
                 scroll: true,
                 scrollHeight: 300,
-                       formatItem: function(row, i, max) {
+                       /*formatItem: function(row, i, max) {
                                return row.n + " ("+ row.c +")";
                        },
                 formatResult: function(row, i, max){
                     return row.n;
+                }*/
+                formatItem: function(row, i, max, value) {
+                    return row[1].split(".")[0] + " (" + row[1].split(".")[1] + ")";
+                },
+
+                formatResult: function(row, i, max, value){
+                    return row[0];
                 }
                 
-            });
-            
-            setupFormValidation("#fmedit", CPValidator.getQuestionFormRules(), CPValidator.getQuestionFormMessages());
-            
+            });         
+
             $('#id_revision').unbind().change(function(){
                 $("#select_revision").click();
             });
-            lanai.highlightSyntax();
-            
+
         });
         </script>
 {% endblock %}