Index: /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/EventHandler.java
===================================================================
--- /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/EventHandler.java (revision 6830)
+++ /CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/EventHandler.java (revision 6831)
@@ -35,5 +35,5 @@
* @param jsCode JavaScript anonymous function or a function name
*/
- public void addEvent(final String event, final String jsCode) {
+ public void addEventHandler(final String event, final String jsCode) {
if (events.get(event) == null) {
events.put(event, new LinkedHashSet
+ This sample shows how to add event handlers to CKEditor with PHP.
+
+ A snippet of the configuration code can be seen below; check the source code of this page for
+ the full definition:
+
+ To replace a
+ Note that
+<%
+CKEditorConfig settings = new CKEditorConfig();
+settings.addConfigValue("skin", "office2003");
+EventHandler eventHandler = new EventHandler();
+eventHandler.addEventHandler("instanceReady", "function (ev) { alert(\"Loaded: \" + ev.editor.name); }");
+%>
+
+<ckeditor:editor basePath="/ckeditor/" config="<%=settings %>" editor="editor1" events="<%=eventHandler %>"/>
+
+<%
+settings.removeConfigValue("skin");
+settings.addConfigValue("uiColor", "#ADE82E");
+settings.addConfigValue("toolbar", "[['Format'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript']]");
+%>
+
+<ckeditor:replace basePath="/ckeditor/" config="<%=settings %>" replace="editor2" />
+
+
Creating a CKEditor instance (no initial textarea element is required).
+
+
+ Advanced Samples
+
+
+
Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replace.jsp
===================================================================
--- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replace.jsp (revision 6830)
+++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replace.jsp (revision 6831)
@@ -22,4 +22,14 @@
This sample shows how to replace a selected
Creating a CKEditor instance (no initial textarea element is required) with advanced settings.<textarea>
element
with a CKEditor instance by using Java code.
+
+ <textarea>
element, place the following call at any point
+ after the <textarea>
element:
+
+<ckeditor:replace replace="textarea_id" basePath="/ckeditor/" />
+ textarea_id
in the code above is the id
attribute of
+ the <textarea>
element to be replaced.
<textarea>
element:
+<ckeditor:replaceAll basePath="/ckeditor/" />Index: /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp =================================================================== --- /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp (revision 6830) +++ /CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp (revision 6831) @@ -30,4 +30,23 @@ + +
+ This sample shows how to create a CKEditor instance with Java. +
++<% +String value = "My first <strong>CKEditor</strong> Java tag"; + +CKEditorConfig settings = new CKEditorConfig(); +settings.addConfigValue("width", "500"); +settings.addConfigValue("toolbar", "Basic"); +%> + +<ckeditor:editor basePath="/ckeditor/" config="<%=settings %>" editor="textarea_id" value="<%= value %>"/>+
+ Note that textarea_id
in the code above is the id
and name
attribute of
+ the <textarea>
element that will be created.
+