diff src/browser/sat_browser/editor_widget.py @ 696:c2f22ca12e23

browser and server side: remove unibox
author souliane <souliane@mailoo.org>
date Mon, 20 Apr 2015 08:51:25 +0200
parents 9877607c719a
children 3b91225b457a
line wrap: on
line diff
--- a/src/browser/sat_browser/editor_widget.py	Sun Apr 19 13:10:41 2015 +0200
+++ b/src/browser/sat_browser/editor_widget.py	Mon Apr 20 08:51:25 2015 +0200
@@ -171,27 +171,21 @@
 
         return diff(content, self._original_content)
 
-    def edit(self, edit, abort=False, sync=False):
+    def edit(self, edit, abort=False):
         """
         Remark: the editor must be visible before you call this method.
         @param edit: set to True to edit the content or False to only display it
         @param abort: set to True to cancel the edition and loose the changes.
         If edit and abort are both True, self.abortEdition can be used to ask for a
         confirmation. When edit is False and abort is True, abortion is actually done.
-        @param sync: set to True to cancel the edition after the content has been saved somewhere else
         """
         if edit:
-            if not self.initialized:
-                self.syncToEditor()  # e.g.: use the selected target and unibox content
             self.setFocus(True)
             if abort:
                 content = self.getContent()
                 if not self.modified(content) or self.abortEdition(content):  # e.g: ask for confirmation
-                    self.edit(False, True, sync)
+                    self.edit(False, True)
                     return
-            if sync:
-                self.syncFromEditor(content)  # e.g.: save the content to unibox
-                return
         else:
             if not self.initialized:
                 return
@@ -217,12 +211,6 @@
         """
         raise NotImplementedError
 
-    def syncToEditor(self):
-        pass
-
-    def syncFromEditor(self, content):
-        pass
-
     def abortEdition(self, content):
         return True
 
@@ -271,7 +259,7 @@
     def getContent(self):
         raise NotImplementedError
 
-    def edit(self, edit, abort=False, sync=False):
+    def edit(self, edit, abort=False):
         BaseTextEditor.edit(self, edit)
         if edit:
             if self.options['listen_focus'] and self not in self.textarea._focusListeners:
@@ -352,11 +340,11 @@
         text = DOM.getInnerHTML(self.getElement())
         return {'text': self.strproc(text) if text else ''}
 
-    def edit(self, edit, abort=False, sync=False):
+    def edit(self, edit, abort=False):
         if edit:
             self.textarea.setHTML(self._original_content['text'])
         self.getElement().setAttribute('contenteditable', 'true' if edit else 'false')
-        SimpleTextEditor.edit(self, edit, abort, sync)
+        SimpleTextEditor.edit(self, edit, abort)
 
     def setFocus(self, focus):
         if focus:
@@ -378,11 +366,11 @@
         text = self.textarea.getText()
         return {'text': self.strproc(text) if text else ''}
 
-    def edit(self, edit, abort=False, sync=False):
+    def edit(self, edit, abort=False):
         if edit:
             self.textarea.setText(self._original_content['text'])
         self.setWidget(self.textarea if edit else self.display)
-        SimpleTextEditor.edit(self, edit, abort, sync)
+        SimpleTextEditor.edit(self, edit, abort)
 
     def setFocus(self, focus):
         if focus and self.isAttached():