google-code-export / gwt-ckeditor

Automatically exported from code.google.com/p/gwt-ckeditor
2 stars 0 forks source link

Patch to enable sins through the wrapper #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
It's not possible to skin the CKEditor through the GWT interface.
I've supplied a patch that will enable this.

Please provide any additional information below.

Index: src/com/axeiya/gwtckeditor/client/CKConfig.java
===================================================================
--- src/com/axeiya/gwtckeditor/client/CKConfig.java (revision 55)
+++ src/com/axeiya/gwtckeditor/client/CKConfig.java (working copy)
@@ -52,6 +52,7 @@

    JavaScriptObject config = JavaScriptObject.createObject();
+   private String skin;

    /**
     * Defines existing toolbar configuration in CKEDITOR environment
@@ -62,7 +63,7 @@
     * Defines existing toolbar options ; use _ as "-" separator
     */
    public enum TOOLBAR_OPTIONS{Source,Save,NewPage,Preview,Templates,Cut,Copy,Paste,PasteText,PasteFromWord,Print,SpellChecker,Scayt,Undo,Redo,Find,Replace,SelectAll,RemoveFormat,
-                       Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenFi
eld,Bold,Italic,Underline,Strike,Subscript,Superscript,NumberedList,
+                       Form,Checkbox,qmlink,Radio,TextField,Textarea,Select,Button,ImageButton,H
iddenField,Bold,Italic,Underline,Strike,Subscript,Superscript,NumberedList,
                        BulletedList,Outdent,Indent,Blockquote,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,Link,Unlink,Anchor,Image,Flash,Table,HorizontalRule,
                        Smiley,SpecialChar,PageBreak,Styles,Format,Font,FontSize,TextColor,BGColor,Maximize,ShowBlocks,About,_}

@@ -342,6 +343,20 @@
    }

    /**
+    * Set the skin you want to use in the editor. 
+    * available skins: karma, office2003, v2
+    * @param skin
+    */
+   public void setSkin(String skin) {
+       this.skin = skin;
+       setNativeSkin(skin);
+   }
+
+   private native void setNativeSkin(String skin2)/*-{
+       this.@com.axeiya.gwtckeditor.client.CKConfig::config.skin = skin2;
+   }-*/; 
+
+   /**
     * Returns a CKEDITOR.config object with the defined configuration
     * @return a CKEDITOR.config object
     */
Index: src/com/axeiya/gwtckeditor/client/CKEditor.java
===================================================================
--- src/com/axeiya/gwtckeditor/client/CKEditor.java (revision 55)
+++ src/com/axeiya/gwtckeditor/client/CKEditor.java (working copy)
@@ -23,6 +23,8 @@
 import com.google.gwt.dom.client.Node;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.logical.shared.HasResizeHandlers;
+import com.google.gwt.event.logical.shared.ResizeHandler;
 import com.google.gwt.event.shared.HandlerRegistration;
 import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.DOM;
@@ -607,6 +609,5 @@
    public boolean isDisabled() {
        return disabled;
    }
-   
-   
+
 }

Original issue reported on code.google.com by henrik.a...@gmail.com on 14 Sep 2010 at 8:24

GoogleCodeExporter commented 9 years ago
oops, a bit too much in that patch, disregard toolbar changes.

Original comment by henrik.a...@gmail.com on 14 Sep 2010 at 8:27

GoogleCodeExporter commented 9 years ago

Original comment by picard.d...@gmail.com on 22 Sep 2010 at 5:27