Hybrid View

  1. #1
    Ext User
    Join Date
    Aug 2009
    Posts
    5
    Vote Rating
    0
    iosoftgame is on a distinguished road

      0  

    Default CKEditor Extension

    CKEditor Extension


    Hello.

    First of all, I would like to say that I'm not sure if this is the right forum for this question But anyway, here it goes:

    I have been searching for an extension to ExtJS that will enable me to use CKEditor inside an ExtJS application, instead of the HtmlEditor ExtJS offeres, but I can't seem to find one.

    My question is therefore: Does there exists an CKEditor extension to ExtJS and if so, where can I download it?

    In advance, thanks.

    Best regards
    Morten Johansen

  2. #2
    Ext User sidaliextjs's Avatar
    Join Date
    Aug 2007
    Posts
    5
    Vote Rating
    0
    sidaliextjs is on a distinguished road

      0  

    Default


    Hi
    I think that is delivered with Group Office Community edition
    here is the code

    PHP Code:
    /****************************************************
    * FCKEditor Extension
    *****************************************************/


    Ext.form.FCKeditor = function(config){
        
    this.config config;
        
    Ext.form.FCKeditor.superclass.constructor.call(thisconfig);
        
    this.FCKid=0;
        
    this.MyisLoaded=false;
        
    this.MyValue='';
    };

    Ext.extend(Ext.form.FCKeditorExt.form.TextArea,  {
        
    onRender : function(ctposition){
            if(!
    this.el){
                
    this.defaultAutoCreate = {
                    
    tag"textarea",
                    
    autocomplete"off"                
                
    };
            }
            
    Ext.form.TextArea.superclass.onRender.call(thisctposition);
            
    //Hide textarea to stop flashing up before FCKEditor renders.
            
    this.hideMode "visibility"// set hideMode to visibility, to retain height.
            
    this.hidden true// hide textarea
            
            
    if(this.grow){
                
    this.textSizeEl Ext.DomHelper.append(document.body, {
                    
    tag"pre"cls"x-form-grow-sizer"
                
    });
                if(
    this.preventScrollbars){
                    
    this.el.setStyle("overflow""hidden");
                }
                
    this.el.setHeight(this.growMin);
            }
            if (
    this.FCKid==0this.FCKid=get_FCKeditor_id_value()
            
            
            
    setTimeout("loadFCKeditor('"+this.id+"',"this.container.getHeight() +");",100); //Change this.name to this.id
            
            
            //this.on('resize', this.textAreaResized, this);     
        
    },
        
    setValue : function(value){
            
    this.MyValue=value;
            if (
    this.FCKid==0this.FCKid=get_FCKeditor_id_value();
            
    // only after FCKeditor_OnComplete
            
    if (this.MyisLoaded){
              
    FCKeditorSetValue(this.FCKid,this.id,value); //Change this.name to this.id
            
    } else {
              
    //alert('MyisLoaded = false');
            
    }
            
    Ext.form.TextArea.superclass.setValue.apply(this,[value]);
        },

        
    getValue : function(){
            if (
    this.MyisLoaded){
                
    value=FCKeditorGetValue(this.id); //Change this.name to this.id
                
    Ext.form.TextArea.superclass.setValue.apply(this,[value]);
                if (
    Ext.form.TextArea.superclass.getValue(this))
                    return 
    Ext.form.TextArea.superclass.getValue(this);
                else
                    return 
    value;
            }else{
                return 
    this.MyValue;
            }
        },

        
    getRawValue : function(){
            if (
    this.MyisLoaded){
                
    value=FCKeditorGetValue(this.id); //Change this.name to this.id
                
    Ext.form.TextArea.superclass.setRawValue.apply(this,[value]);
                return 
    Ext.form.TextArea.superclass.getRawValue(this);
            }else{
                return 
    this.MyValue;
            }
        },
        
        
    textAreaResized : function(textareaadjWidthadjHeightrawWidthrawHeight){
            
            if(
    typeof(FCKeditorAPI)!= 'undefined')
            {
                    var 
    oEditor FCKeditorAPI.GetInstance(this.FCKid);
                    
    oEditor.EditorWindow.parent.frameElement.height rawHeight-51;
                    
    oEditor.EditorWindow.parent.frameElement.width rawWidth;
            }        
        }
    });
    Ext.reg('fckeditor'Ext.form.FCKeditor);


    function 
    loadFCKeditor(elementheight){
        
    oFCKeditor = new FCKeditorelement );
        
    oFCKeditor.BasePath      oFCKeditorOptions.BasePath;
        
    oFCKeditor.ToolbarSet    oFCKeditorOptions.ToolbarSet;
        
    oFCKeditor.Config        oFCKeditorOptions.Config;
        
    oFCKeditor.Height height;
        
    oFCKeditor.ReplaceTextarea();
        
        
    }
    function 
    FCKeditor_OnComplete(editorInstance){

        
    Ext.getCmp(editorInstance.Name).MyisLoaded=true;

        
    // Removed OnStatusChange element, does not appear to be need, cause permission error in IE
    }
    var 
    FCKeditor_value=new Array();
    function 
    FCKeditorSetValue(id,name,value){
        if ((
    id!=undefined)&&(name!=undefined)){
            if (
    value!=undefinedFCKeditor_value[id]=value;
            else if (
    FCKeditor_value[id]==undefinedFCKeditor_value[id]='';
            var 
    oEditor FCKeditorAPI.GetInstance(name);
            
    // some trouble in Opera 9.50
            
    if(oEditor!=undefinedoEditor.SetData(FCKeditor_value[id]);
        }
    }
    function 
    FCKeditorGetValue(name){
        if ((
    id!=undefined)&&(name!=undefined)){
            
    data='';
            var 
    oEditor FCKeditorAPI.GetInstance(name);
            
    // some trouble in Opera 9.50:
            //
            // message: Statement on line 36: Cannot convert undefined or null to Object
            // oEditor.GetData();
            //
            
    if(oEditor!=undefineddata=oEditor.GetData();
            return 
    data;
        }
    }
    var 
    FCKeditor_id_value;
    function 
    get_FCKeditor_id_value(){
        if (!
    FCKeditor_id_value){
            
    FCKeditor_id_value=0;
        }
        
    FCKeditor_id_value=FCKeditor_id_value+1;
        return 
    FCKeditor_id_value;

    Enjoy!

  3. #3
    Ext JS Premium Member
    Join Date
    Nov 2008
    Posts
    274
    Vote Rating
    1
    wki01 is on a distinguished road

      0  

    Default


    My knowledge of ExtJS are still too poor to understand what I do.

    Can someone post a working example with ExtJS 3.0 and CKEditor 3.0?

    thanks

  4. #4
    Sencha User Alex84's Avatar
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    49
    Vote Rating
    0
    Alex84 is on a distinguished road

      0  

    Default


    Hm I tested it today. Replace

    PHP Code:
    oFCKeditor = new FCKeditorelement ); 
    with

    PHP Code:
    oFCKeditor = new CKEDITOR.replace(element); 
    And it works. I have the editor in a Tabpanel. Only the sizing not work correctly at the moment. The editor is smaller than my window and I can resize the editor in the window manually

    Edit:
    for Height replace
    PHP Code:
     oFCKeditor.Heightheight
    with
    PHP Code:
     oFCKeditor.config.height height
    here is a link to the docs: http://docs.fckeditor.net/ckeditor_a...OR.config.html



  5. #5
    Ext JS Premium Member
    Join Date
    Nov 2008
    Posts
    274
    Vote Rating
    1
    wki01 is on a distinguished road

      0  

    Default


    A small complete example I would be very useful.
    thanks

  6. #6
    Sencha User Alex84's Avatar
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    49
    Vote Rating
    0
    Alex84 is on a distinguished road

      0  

    Default


    Here is a complete example for using FCKEditor Extension
    http://www.extjs.com/forum/showthread.php?t=17423

    When this works replace the two lines I posted and set the correct paths to CKEditor.

  7. #7
    Ext User
    Join Date
    Jul 2009
    Posts
    1
    Vote Rating
    0
    panyi1982 is on a distinguished road

      0  

    Default


    i have own file browser(design by ext3.1),how adding to ckeditor

  8. #8
    Ext User
    Join Date
    Jan 2010
    Posts
    2
    Vote Rating
    0
    Kapweb is on a distinguished road

      0  

    Default


    Hi panyi1982 ,

    Just read that :
    http://docs.cksource.com/CKEditor_3....%28Uploader%29

    All is explicated.

    I do the same work. But my media browser not finish, so i can't help you for ck editor now.

    Have a good Day !

    And always sorry for my verry bad english.

  9. #9
    Sencha User
    Join Date
    Sep 2009
    Posts
    112
    Vote Rating
    0
    asagala is on a distinguished road

      0  

    Default


    if this extension is used in form with trackResetOnLoad: true it doesnt seem to respect the isDirty concept. Anyone have a clue how to fix it?

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar