Changeset 6831
- Timestamp:
- 05/01/11 17:12:10 (2 years ago)
- Location:
- CKEditor.Java
- Files:
-
- 6 edited
-
ckeditor-java-core/trunk/src/main/java/com/ckeditor/EventHandler.java (modified) (1 diff)
-
ckeditor-java/trunk/src/main/webapp/_samples/advanced.jsp (modified) (3 diffs)
-
ckeditor-java/trunk/src/main/webapp/_samples/index.jsp (modified) (1 diff)
-
ckeditor-java/trunk/src/main/webapp/_samples/replace.jsp (modified) (1 diff)
-
ckeditor-java/trunk/src/main/webapp/_samples/replaceAll.jsp (modified) (1 diff)
-
ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CKEditor.Java/ckeditor-java-core/trunk/src/main/java/com/ckeditor/EventHandler.java
r6796 r6831 35 35 * @param jsCode JavaScript anonymous function or a function name 36 36 */ 37 public void addEvent (final String event, final String jsCode) {37 public void addEventHandler(final String event, final String jsCode) { 38 38 if (events.get(event) == null) { 39 39 events.put(event, new LinkedHashSet<String>()); -
CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/advanced.jsp
r6791 r6831 22 22 CKEditor Sample — Creating CKEditor Instances 23 23 </h1> 24 <div class="description"> 25 <p> 26 This sample shows how to add event handlers to CKEditor with PHP. 27 </p> 28 <p> 29 A snippet of the configuration code can be seen below; check the source code of this page for 30 the full definition: 31 </p> 32 <pre class="samples"> 33 <% 34 CKEditorConfig settings = new CKEditorConfig(); 35 settings.addConfigValue("skin", "office2003"); 36 EventHandler eventHandler = new EventHandler(); 37 eventHandler.addEventHandler("instanceReady", "function (ev) { alert(\"Loaded: \" + ev.editor.name); }"); 38 %> 39 40 <ckeditor:editor basePath="/ckeditor/" config="<%=settings %>" editor="editor1" events="<%=eventHandler %>"/> 41 42 <% 43 settings.removeConfigValue("skin"); 44 settings.addConfigValue("uiColor", "#ADE82E"); 45 settings.addConfigValue("toolbar", "[['Format'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript']]"); 46 %> 47 48 <ckeditor:replace basePath="/ckeditor/" config="<%=settings %>" replace="editor2" /> 49 </pre> 50 </div> 24 51 <!-- This <div> holds alert messages to be display in the sample page. --> 25 52 <div id="alerts"> … … 41 68 <% 42 69 String value = "My first CKEditor Java tag"; 43 CKEditorConfig config2 = new CKEditorConfig(); 44 config2.addConfigValue("width", "80%"); 45 config2.addConfigValue("toolbar", "Basic"); 70 CKEditorConfig settings = new CKEditorConfig(); 71 settings.addConfigValue("skin", "office2003"); 46 72 EventHandler eventHandler = new EventHandler(); 47 eventHandler.addEvent ("instanceReady", "function (ev) { alert(\"Loaded: \" + ev.editor.name); }");73 eventHandler.addEventHandler("instanceReady", "function (ev) { alert(\"Loaded: \" + ev.editor.name); }"); 48 74 %> 49 <ckeditor:editor basePath="../ckeditor/" config="<%= config2%>"75 <ckeditor:editor basePath="../ckeditor/" config="<%=settings %>" 50 76 editor="editor1" value="<%= value %>" 51 77 events="<%=eventHandler %>"/> … … 57 83 </p> 58 84 <% 59 config2.removeConfigValue("width");60 config2.addConfigValue("toolbar", "[['Styles'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript']]");61 config2.addConfigValue("stylesSet", "[{name : 'Strong Emphasis', element : 'strong'}, {name : 'Emphasis', element : 'em'}, {name : 'Computer Code', element : 'code'}]");85 settings.removeConfigValue("skin"); 86 settings.addConfigValue("uiColor", "#ADE82E"); 87 settings.addConfigValue("toolbar", "[['Format'],['Bold','Italic','Underline','Strike','-','Subscript','Superscript']]"); 62 88 %> 63 <ckeditor:replace basePath="../ckeditor/" config="<%= config2%>" replace="editor2" />89 <ckeditor:replace basePath="../ckeditor/" config="<%=settings %>" replace="editor2" /> 64 90 <input type="submit" value="Submit"/> 65 91 </form> -
CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/index.jsp
r6775 r6831 24 24 <li><a class="samples" href="standalone.jsp">Create CKEditor instances in Java</a><br /> 25 25 Creating a CKEditor instance (no initial textarea element is required).</li> 26 <li><a class="samples" href="advanced.jsp">Create CKEditor instances in Java with eventHandler</a><br /> 26 </ul> 27 <h2 class="samples"> 28 Advanced Samples 29 </h2> 30 <ul> 31 <li><a class="samples" href="advanced.jsp">Create CKEditor instances in Java with event handler</a><br /> 27 32 Creating a CKEditor instance (no initial textarea element is required) with advanced settings.</li> 28 33 </ul> -
CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replace.jsp
r6790 r6831 22 22 This sample shows how to replace a selected <code><textarea></code> element 23 23 with a CKEditor instance by using Java code. 24 </p> 25 <p> 26 To replace a <code><textarea></code> element, place the following call at any point 27 after the <code><textarea></code> element: 28 </p> 29 <pre class="samples"> 30 <ckeditor:replace replace="textarea_id" basePath="/ckeditor/" /></pre> 31 <p> 32 Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of 33 the <code><textarea></code> element to be replaced. 24 34 </p> 25 35 </div> -
CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/replaceAll.jsp
r6790 r6831 25 25 after the last <code><textarea></code> element: 26 26 </p> 27 <pre class="samples"> 28 <ckeditor:replaceAll basePath="/ckeditor/" /></pre> 27 29 </div> 28 30 <!-- This <div> holds alert messages to be displayed in the sample page. --> -
CKEditor.Java/ckeditor-java/trunk/src/main/webapp/_samples/standalone.jsp
r6791 r6831 30 30 </p> 31 31 </noscript> 32 </div> 33 <div class="description"> 34 <p> 35 This sample shows how to create a CKEditor instance with Java. 36 </p> 37 <pre class="samples"> 38 <% 39 String value = "My first <strong>CKEditor</strong> Java tag"; 40 41 CKEditorConfig settings = new CKEditorConfig(); 42 settings.addConfigValue("width", "500"); 43 settings.addConfigValue("toolbar", "Basic"); 44 %> 45 46 <ckeditor:editor basePath="/ckeditor/" config="<%=settings %>" editor="textarea_id" value="<%= value %>"/></pre> 47 <p> 48 Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> and <code>name</code> attribute of 49 the <code><textarea></code> element that will be created. 50 </p> 32 51 </div> 33 52 <!-- This <fieldset> holds the HTML code that you will usually find in your pages. -->
Note: See TracChangeset
for help on using the changeset viewer.
