r1386 - in xwiki/trunk/src/main: java/com/xpn/xwiki/web web/tiny_mce/plugins/wikiplugin web/wiki_editor/plugins

Phung Hai Nam namphunghai at users.forge.objectweb.org
Fri Oct 13 12:13:25 CEST 2006


Author: namphunghai
Date: 2006-10-13 12:13:24 +0200 (Fri, 13 Oct 2006)
New Revision: 1386

Removed:
   xwiki/trunk/src/main/web/tiny_mce/plugins/wikiplugin/editor_plugin_src.js
Modified:
   xwiki/trunk/src/main/java/com/xpn/xwiki/web/EditAction.java
   xwiki/trunk/src/main/web/wiki_editor/plugins/core.js
Log:
Fixed bug XWIKI-367  "Wysiwyg Internet Explorer looses changes on simple title"

Modified: xwiki/trunk/src/main/java/com/xpn/xwiki/web/EditAction.java
===================================================================
--- xwiki/trunk/src/main/java/com/xpn/xwiki/web/EditAction.java	2006-10-12 16:18:18 UTC (rev 1385)
+++ xwiki/trunk/src/main/java/com/xpn/xwiki/web/EditAction.java	2006-10-13 10:13:24 UTC (rev 1386)
@@ -116,19 +116,17 @@
             }
 
             XWikiDocument tdoc2 = (XWikiDocument) tdoc.clone();
-            if (content != null && !content.equals(""))
-                tdoc2.setContent(content);
-            if(sectionContent != null && !sectionContent.equals("")){
-                if(content != null && !content.equals("")) tdoc2.setContent(content);
+            if (content != null) tdoc2.setContent(content);
+            if(sectionContent != null && !sectionContent.equals("")) {
+                if(content != null) tdoc2.setContent(content);
                 else tdoc2.setContent(sectionContent);
                 tdoc2.setTitle(doc.getDocumentSection(sectionNumber).getSectionTitle());
             }
             context.put("tdoc", tdoc2);
             vcontext.put("tdoc", tdoc2.newDocument(context));
-            try{
-            tdoc2.readFromTemplate(peform, context);
-            }
-            catch (XWikiException e) {
+            try {
+                tdoc2.readFromTemplate(peform, context);
+            } catch (XWikiException e) {
                 if (e.getCode() == XWikiException.ERROR_XWIKI_APP_DOCUMENT_NOT_EMPTY) {
                     context.put("exception", e);
                     return "docalreadyexists";

Deleted: xwiki/trunk/src/main/web/tiny_mce/plugins/wikiplugin/editor_plugin_src.js
===================================================================
--- xwiki/trunk/src/main/web/tiny_mce/plugins/wikiplugin/editor_plugin_src.js	2006-10-12 16:18:18 UTC (rev 1385)
+++ xwiki/trunk/src/main/web/tiny_mce/plugins/wikiplugin/editor_plugin_src.js	2006-10-13 10:13:24 UTC (rev 1386)
@@ -1,45 +0,0 @@
-/* Import plugin specific language pack */
-//tinyMCE.importPluginLanguagePack('wikieditor', 'en'); // <- Add a comma separated list of all supported languages
-
-
-function TinyMCE_wikiplugin_initInstance(inst) {
-}
-
-function TinyMCE_wikiplugin_execCommand(editor_id, element, command, user_interface, value) {
-	return false;
-}
-
-function TinyMCE_wikiplugin_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
-	return true;
-}
-
-/**
- * Gets executed when contents is inserted / retrived.
- */
-function TinyMCE_wikiplugin_cleanup(type, content) {
-	switch (type) {
-		case "get_from_editor":
-			//alert("[FROM before] Value HTML string: " + content);
-
-			content = wikiEditor.convertInternal(content);
-			
-			//alert("[FROM after] Value HTML string: " + content);
-
-			break;
-
-		case "get_from_editor_dom":
-			
-			content = wikiEditor.tagListInternal(content);
-			//alert("[FROM] Value DOM Element " + content.innerHTML);
-
-			break;
-			
-		case "insert_to_editor":
-			//alert("[TO not modified] Value HTML string: " + content);
-			content = wikiEditor.convertExternal(content);
-
-            break;
-	}
-
-	return content;
-}
\ No newline at end of file

Modified: xwiki/trunk/src/main/web/wiki_editor/plugins/core.js
===================================================================
--- xwiki/trunk/src/main/web/wiki_editor/plugins/core.js	2006-10-12 16:18:18 UTC (rev 1385)
+++ xwiki/trunk/src/main/web/wiki_editor/plugins/core.js	2006-10-13 10:13:24 UTC (rev 1386)
@@ -256,9 +256,14 @@
 		for(var i=0; oldNode.childNodes[i];i++) {
 			newNode.appendChild(oldNode.childNodes[i]);
 		}
-		parent.insertBefore(newNode, oldNode);
-		parent.removeChild(oldNode);
-	}
+        // fix bug oldNode is BODY in MSIE
+        if (oldNode.nodeName.toLowerCase() == 'body') {
+            oldNode.appendChild(newNode);
+        } else {
+            parent.insertBefore(newNode, oldNode);
+            parent.removeChild(oldNode);
+        }
+    }
 }
 
 WikiEditor.prototype.titleCommand = function(editor_id, element, command, user_interface, value) {





More information about the Xwiki-notifications mailing list