changeset 423:9ff65a48bfbd

SvgEditor: removed the TextCha feature to be consistent with twikidraw and anywikidraw
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 19 Sep 2009 22:05:32 +0200
parents b3f6d04627c9
children 0b33069ed160 8853f2b49a2a
files data/plugin/action/SvgEditor.py htdocs/svg-edit/editor/svg-editor.js
diffstat 2 files changed, 3 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/action/SvgEditor.py	Sun Sep 13 11:39:55 2009 +0200
+++ b/data/plugin/action/SvgEditor.py	Sat Sep 19 22:05:32 2009 +0200
@@ -13,7 +13,6 @@
 from MoinMoin import config, wikiutil
 from MoinMoin.action import AttachFile, do_show
 from MoinMoin.Page import Page
-from MoinMoin.security.textcha import TextCha
 
 action_name = __name__.split('.')[-1]
 
@@ -81,8 +80,6 @@
         _ = self._
         pagename = self.pagename
         request = self.request
-        if not TextCha(request).check_answer_from_form():
-            return _('TextCha: Wrong answer! Go back and try again...')
         if not request.user.may.write(pagename):
             return _('You are not allowed to save a drawing on this page.')
 
@@ -133,13 +130,8 @@
 <script type="text/javascript" src="%(htdocs)s/svg-editor.js"></script>
 <!--script type="text/javascript" src="%(htdocs)s/svg-editor.min.js"></script-->
 """ % {"htdocs": htdocs}
-
-        question = ''
-        if TextCha(self.request).is_enabled():
-            question = TextCha(self.request).question
-            
+        
         html = """<h2> %(editdrawing)s </h2>
-%(textcha)s
 <div id="htdocs"><!-- %(htdocs)s/ --></div>
 <div id="svg_editor">
 <div id="workarea">
@@ -427,8 +419,7 @@
     </div>
 </div>
 
-""" % {"textcha": TextCha(self.request).render(),
-       "htdocs": htdocs,
+""" % {"htdocs": htdocs,
        "filecontent": filecontent,
        "editdrawing": _("Edit drawing"),
        }
--- a/htdocs/svg-edit/editor/svg-editor.js	Sun Sep 13 11:39:55 2009 +0200
+++ b/htdocs/svg-edit/editor/svg-editor.js	Sat Sep 19 22:05:32 2009 +0200
@@ -11,7 +11,6 @@
 	var isMac = false; //(navigator.platform.indexOf("Mac") != -1);
 	var modKey = ""; //(isMac ? "meta+" : "ctrl+");
 	var htdocs = document.getElementById("htdocs").innerHTML.replace('<!-- ', '').replace(' -->', '');
-	var textcha_question = document.getElementById("textcha-question").firstChild.data;
 	var svgCanvas = new SvgCanvas(document.getElementById("svgcanvas"));
 	// because moin uses currently HTML 4.0.1 we send the data as a comment in the HTML code
 	var svgdata = document.getElementById("svgdata").innerHTML;
@@ -55,10 +54,9 @@
 	var svg_data = Utils.encode64(svg);
 	var pagename = titlename.split(':')[0];
 	var svg_target = titlename.split(':')[1];
-	var textcha_answer = document.getElementById("textcha-answer").value;
 	$.post(
 	        pagename,
-	        {'action': "SvgEditor", 'do': "save", 'target': svg_target, 'svg_data': svg_data, 'textcha-question': textcha_question, 'textcha-answer': textcha_answer}
+	        {'action': "SvgEditor", 'do': "save", 'target': svg_target, 'svg_data': svg_data}
 	      );
 
 		//window.open("data:image/svg+xml;base64," + Utils.encode64(svg));