[richfaces-svn-commits] JBoss Rich Faces SVN: r11577 - 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 09:29:15 EST 2008


Author: pyaschenko
Date: 2008-12-05 09:29:14 -0500 (Fri, 05 Dec 2008)
New Revision: 11577

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

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 13:44:20 UTC (rev 11576)
+++ trunk/ui/editor/src/main/resources/org/richfaces/renderkit/html/scripts/editor.js	2008-12-05 14:29:14 UTC (rev 11577)
@@ -65,23 +65,23 @@
 	},
 	
 	onChangeCallback: function(inst) {		        
-        this.invokeEvent(this.onChangeCallbackFunction, $A(arguments));
+        this.invokeEvent("Change", $A(arguments));
 	},
 	
 	onInitCallback: function() {		        
-        this.invokeEvent(this.onInitCallbackFunction, $A(arguments));
+        this.invokeEvent("Init", $A(arguments));
 	},
 	
 	onSaveCallback: function(element_id, html, body) {
 		if(this.onSaveCallbackFunction){	        
-        	return this.invokeEvent(this.onSaveCallbackFunction, $A(arguments));
+        	return this.invokeEvent("Save", $A(arguments));
 		}else{
 			return html;
 		}
 	},
 	
 	onSetupCallback: function(ed) {		        
-        this.invokeEvent(this.onSetupCallbackFunction, $A(arguments));
+        this.invokeEvent("Setup", $A(arguments));
 	},
 	
 	synchronizeConfiguration: function(){
@@ -99,7 +99,8 @@
 		}
 	},
 	
-	invokeEvent: function(callback, args){
+	invokeEvent: function(eventName, args){
+		callback = this["on"+eventName+"CallbackFunction"];
 		if (!callback) return;
 		var eventObj;
 		var result;
@@ -108,7 +109,7 @@
 			eventObj = document.createEventObject();
 		} else if( document.createEvent ) {
 			eventObj = document.createEvent('Events');
-			eventObj.initEvent( callback + 'Event', true, false );
+			eventObj.initEvent( eventName, true, false );
 		}
 		
 		eventObj.rich = {component:this, tinyMceInstance: this.tinyMCE_editor};		
@@ -117,7 +118,7 @@
 		try {
 			result = callback.apply(this, args);
 		} catch (e) { 
-			LOG.warn("Exception: " + e.Message + "\n[on " + callback + " ]"); 
+			LOG.warn("Exception: " + e.Message + "\n[on " + eventName + " ]"); 
 		}
 		return result;
 	}




More information about the richfaces-svn-commits mailing list