[richfaces-svn-commits] JBoss Rich Faces SVN: r11583 - trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Dec 5 10:26:04 EST 2008


Author: alevkovsky
Date: 2008-12-05 10:26:04 -0500 (Fri, 05 Dec 2008)
New Revision: 11583

Modified:
   trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
Log:
https://jira.jboss.org/jira/browse/RF-5077

Modified: trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js
===================================================================
--- trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js	2008-12-05 15:16:35 UTC (rev 11582)
+++ trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js	2008-12-05 15:26:04 UTC (rev 11583)
@@ -21,6 +21,7 @@
     	Richfaces.Editor.extCssSuffix = params.extCssSuffix;
     	
     	this.synchronizeConfiguration();
+    	this.setDialogType();
     	
     	this.tinyMCE_editor = null;
     	this.onInitInstanceCallbackFunction =  this.tinyparams.init_instance_callback;
@@ -52,6 +53,10 @@
 			this.tinyMCE_editor.remove();
 		}
 		this.onInitInstanceCallbackFunction = null;
+		this.onInitCallbackFunction = null;
+		this.onChangeCallbackFunction = null;
+		this.onSaveCallbackFunction = null;
+		this.onSetupCallbackFunction = null;
 		this.tinyMCE_editor = null;
 	},
 	
@@ -84,7 +89,7 @@
         this.invokeEvent("Setup", $A(arguments));
 	},
 	
-	synchronizeConfiguration: function(){
+	synchronizeConfiguration: function(){		
 		if(this.params.useSeamText){
 			this.tinyparams.plugins = Richfaces.Editor.SeamTextConfiguration.plugins;
 			this.tinyparams.convert_fonts_to_spans = false;
@@ -121,6 +126,43 @@
 			LOG.warn("Exception: " + e.Message + "\n[on " + eventName + " ]"); 
 		}
 		return result;
+	},
+	
+	setDialogType: function(){
+		var plugins = this.tinyparams.plugins;
+		if(this.tinyparams.dialog_type && this.tinyparams.dialog_type == 'modal'){
+			if(plugins && plugins.length > 0){
+				if(plugins.indexOf('inlinepopups') == -1){
+					plugins += ',inlinepopups';
+				}
+			}else{
+				plugins = 'inlinepopups';
+			}
+		}else if(this.tinyparams.dialog_type && this.tinyparams.dialog_type == 'window'){
+			if(plugins && plugins.length > 0 && plugins.indexOf('inlinepopups') != -1){
+				if(plugins.indexOf('inlinepopups') != -1){
+					var wordIndex = plugins.indexOf('inlinepopups');
+					var firstCommaIndex = -1;
+					var secondCommaIndex = -1;
+					if(wordIndex > 0){
+						firstCommaIndex = plugins.lastIndexOf(',', wordIndex);
+					}
+					if(wordIndex < plugins.length - 1){
+						secondCommaIndex = plugins.indexOf(',', wordIndex);
+					}
+					
+					if(firstCommaIndex != -1 && secondCommaIndex != -1){
+						plugins = plugins.replace(plugins.substring(firstCommaIndex, secondCommaIndex + 1), ",");
+					}else if(firstCommaIndex != -1){
+						plugins = plugins.replace(plugins.substring(firstCommaIndex, wordIndex + 'inlinepopups'.length), "");
+					}else if(secondCommaIndex != -1){
+						plugins = plugins.replace(plugins.substring(wordIndex, secondCommaIndex + 1), "");
+					}
+					
+				}
+			}
+		}
+		this.tinyparams.plugins = plugins;
 	}
 });
 




More information about the richfaces-svn-commits mailing list