Merge branch 'master' of http://git.roojs.com:8081/roojs1
authorEdward <edward@roojs.com>
Thu, 15 May 2014 10:45:45 +0000 (18:45 +0800)
committerEdward <edward@roojs.com>
Thu, 15 May 2014 10:45:45 +0000 (18:45 +0800)
Roo/HtmlEditorCore.js
Roo/bootstrap/Button.js
Roo/bootstrap/Component.js
Roo/bootstrap/HtmlEditor.js
Roo/bootstrap/Input.js
Roo/bootstrap/Menu.js
examples/bootstrap/htmleditor.html [new file with mode: 0644]
examples/bootstrap/htmleditor.js [new file with mode: 0644]
examples/form/htmleditor2.html [deleted file]
examples/form/htmleditor2.js [deleted file]

index a564559..7520ff4 100644 (file)
@@ -170,12 +170,12 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
     {
         var _t = this;
         //Roo.HtmlEditorCore.superclass.onRender.call(this, ct, position);
-        this.el = this.owner.el;
+        this.el = this.owner.inputEl ? this.owner.inputEl() : this.owner.el;
         
         
         this.el.dom.style.border = '0 none';
         this.el.dom.setAttribute('tabIndex', -1);
-        this.el.addClass('x-hidden');
+        this.el.addClass('x-hidden hide');
         
         
         
@@ -190,6 +190,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
         
         var iframe = this.owner.wrap.createChild({
             tag: 'iframe',
+            cls: 'form-control', // bootstrap..
             id: this.frameId,
             name: this.frameId,
             frameBorder : 'no',
@@ -265,7 +266,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component,  {
         
         if(this.sourceEditMode){
  
-            this.iframe.className = 'x-hidden';     //FIXME - what's the BS styles for these
+            this.iframe.className = 'x-hidden hide';     //FIXME - what's the BS styles for these
             
         }else{
  
index 98d90c9..f50379e 100644 (file)
@@ -122,9 +122,9 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
         if (this.theme==='default') {
             cfg.cls = 'btn roo-button';
             
-            if (this.parentType != 'Navbar') {
-                this.weight = this.weight.length ?  this.weight : 'default';
-            }
+            //if (this.parentType != 'Navbar') {
+            this.weight = this.weight.length ?  this.weight : 'default';
+            //}
             if (['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'].indexOf(this.weight) > -1) {
                 
                 cfg.cls += ' btn-' + this.weight;
@@ -163,7 +163,9 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
         cfg.cls += this.size.length ? (' btn-' + this.size) : '';
          
         //gsRoo.log(this.parentType);
-        if (this.parentType === 'Navbar') {
+        if (this.parentType === 'Navbar' && !this.parent().bar) {
+            Roo.log('changing to li?');
+            
             cfg.tag = 'li';
             
             cfg.cls = '';
@@ -180,7 +182,9 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
             
             delete cfg.html;
             
-        } 
+        }
+        
+       cfg.cls += this.parentType === 'Navbar' ?  ' navbar-btn' : '';
         
         if (this.glyphicon) {
             cfg.html = ' ' + cfg.html;
index 0f586cd..7045f9b 100644 (file)
@@ -129,7 +129,7 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
         cn.parentType = this.xtype; //??
         cn.parentId = this.id;
         
-        cntr = typeof(cntr == 'undefined' ) ? 'getChildContainer' : cntr;
+        cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr;
         
         var has_flexy_each =  (typeof(tree['flexy:foreach']) != 'undefined');
         
@@ -179,8 +179,9 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
     
     addxtypeChild : function (tree, cntr)
     {
+        Roo.log('addxtypeChild:' + cntr);
         var cn = this;
-        cntr = typeof(cntr == 'undefined' ) ? 'getChildContainer' : cntr;
+        cntr = (typeof(cntr) == 'undefined' ) ? 'getChildContainer' : cntr;
         
         
         var has_flexy = (typeof(tree['flexy:if']) != 'undefined') ||
@@ -233,7 +234,8 @@ Roo.extend(Roo.bootstrap.Component, Roo.BoxComponent,  {
                  
                 // actually if flexy:foreach is found, we really want to create 
                 // multiple copies here...
-                
+                Roo.log('render');
+                Roo.log(this[cntr]());
                 cn.render(this[cntr]());
              }
             // then add the element..
index 18e5a10..99ee032 100644 (file)
 
 Roo.bootstrap.HtmlEditor = function(config){
     Roo.bootstrap.HtmlEditor.superclass.constructor.call(this, config);
-    
+    if (!this.toolbars) {
+        this.toolbars = [];
+    }
+    this.editorcore = new Roo.HtmlEditorCore(Roo.apply({ owner : this} , config));
+    this.addEvents({
+            /**
+             * @event initialize
+             * Fires when the editor is fully initialized (including the iframe)
+             * @param {HtmlEditor} this
+             */
+            initialize: true,
+            /**
+             * @event activate
+             * Fires when the editor is first receives the focus. Any insertion must wait
+             * until after this event.
+             * @param {HtmlEditor} this
+             */
+            activate: true,
+             /**
+             * @event beforesync
+             * Fires before the textarea is updated with content from the editor iframe. Return false
+             * to cancel the sync.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            beforesync: true,
+             /**
+             * @event beforepush
+             * Fires before the iframe editor is updated with content from the textarea. Return false
+             * to cancel the push.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            beforepush: true,
+             /**
+             * @event sync
+             * Fires when the textarea is updated with content from the editor iframe.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            sync: true,
+             /**
+             * @event push
+             * Fires when the iframe editor is updated with content from the textarea.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            push: true,
+             /**
+             * @event editmodechange
+             * Fires when the editor switches edit modes
+             * @param {HtmlEditor} this
+             * @param {Boolean} sourceEdit True if source edit, false if standard editing.
+             */
+            editmodechange: true,
+            /**
+             * @event editorevent
+             * Fires when on any editor (mouse up/down cursor movement etc.) - used for toolbar hooks.
+             * @param {HtmlEditor} this
+             */
+            editorevent: true,
+            /**
+             * @event firstfocus
+             * Fires when on first focus - needed by toolbars..
+             * @param {HtmlEditor} this
+             */
+            firstfocus: true,
+            /**
+             * @event autosave
+             * Auto save the htmlEditor value as a file into Events
+             * @param {HtmlEditor} this
+             */
+            autosave: true,
+            /**
+             * @event savedpreview
+             * preview the saved version of htmlEditor
+             * @param {HtmlEditor} this
+             */
+            savedpreview: true
+        });
 };
 
 
-Roo.extend(Roo.bootstrap.HtmlEditor, Roo.bootstrap.Component,  {
+Roo.extend(Roo.bootstrap.HtmlEditor, Roo.bootstrap.TextArea,  {
+    
+    
+      /**
+     * @cfg {Array} toolbars Array of toolbars. - defaults to just the Standard one
+     */
+    toolbars : false,
+   
+     /**
+     * @cfg {String} resizable  's' or 'se' or 'e' - wrapps the element in a
+     *                        Roo.resizable.
+     */
+    resizable : false,
+     /**
+     * @cfg {Number} height (in pixels)
+     */   
+    height: 300,
+   /**
+     * @cfg {Number} width (in pixels)
+     */   
+    width: 500,
+    
+    /**
+     * @cfg {Array} stylesheets url of stylesheets. set to [] to disable stylesheets.
+     * 
+     */
+    stylesheets: false,
+    
+    // id of frame..
+    frameId: false,
     
-    getAutoCreate : function()
+    // private properties
+    validationEvent : false,
+    deferHeight: true,
+    initialized : false,
+    activated : false,
+    
+    onFocus : Roo.emptyFn,
+    iframePad:3,
+    hideMode:'offsets',
+    
+    
+    tbContainer : false,
+    
+    toolbarContainer :function() {
+        return this.wrap.select('.x-html-editor-tb',true).first();
+    },
+
+    /**
+     * Protected method that will not generally be called directly. It
+     * is called when the editor creates its toolbar. Override this method if you need to
+     * add custom toolbar buttons.
+     * @param {HtmlEditor} editor
+     */
+    createToolbar : function(){
+        
+        this.toolbars = [ new Roo.bootstrap.HtmlEditor.ToolbarStandard({editor: this} ) ];
+        this.toolbars[0].render(this.toolbarContainer());
+         
+        Roo.log("create toolbars");
+        return;
+        if (!editor.toolbars || !editor.toolbars.length) {
+            editor.toolbars = [ new Roo.bootstrap.HtmlEditor.ToolbarStandard() ]; // can be empty?
+        }
+        
+        for (var i =0 ; i < editor.toolbars.length;i++) {
+            editor.toolbars[i] = Roo.factory(
+                    typeof(editor.toolbars[i]) == 'string' ?
+                        { xtype: editor.toolbars[i]} : editor.toolbars[i],
+                Roo.bootstrap.HtmlEditor);
+            editor.toolbars[i].init(editor);
+        }
+         
+        
+    },
+
+     
+    // private
+    onRender : function(ct, position)
     {
-//        var cfg = {};
-//        
-//        var toolbar = new Roo.bootstrap.ButtonGroup({
-//            toolbar: true,
-//            cn: [
-//                {
-//                    new Roo.bootstrap.Button({
-//                        
-//                    })
-//                }
-//            ]
-//        });
-//        
-//        return cfg;
+       // Roo.log("Call onRender: " + this.xtype);
+        
+        Roo.bootstrap.HtmlEditor.superclass.onRender.call(this, ct, position);
+      
+        this.wrap = this.inputEl().wrap({
+            cls:'x-html-editor-wrap', cn:{cls:'x-html-editor-tb'}
+        });
+        
+        this.editorcore.onRender(ct, position);
+         
+        if (this.resizable) {
+            this.resizeEl = new Roo.Resizable(this.wrap, {
+                pinned : true,
+                wrap: true,
+                dynamic : true,
+                minHeight : this.height,
+                height: this.height,
+                handles : this.resizable,
+                width: this.width,
+                listeners : {
+                    resize : function(r, w, h) {
+                        _t.onResize(w,h); // -something
+                    }
+                }
+            });
+            
+        }
+        this.createToolbar(this);
+       
+        
+        if(!this.width){
+            this.setSize(this.wrap.getSize());
+        }
+        if (this.resizeEl) {
+            this.resizeEl.resizeTo.defer(100, this.resizeEl,[ this.width,this.height ] );
+            // should trigger onReize..
+        }
+        
+//        if(this.autosave && this.w){
+//            this.autoSaveFn = setInterval(this.autosave, 1000);
+//        }
+    },
+
+    // private
+    onResize : function(w, h)
+    {
+        //Roo.log('resize: ' +w + ',' + h );
+        Roo.bootstrap.HtmlEditor.superclass.onResize.apply(this, arguments);
+        var ew = false;
+        var eh = false;
+        
+        if(this.inputEl() ){
+            if(typeof w == 'number'){
+                var aw = w - this.wrap.getFrameWidth('lr');
+                this.inputEl().setWidth(this.adjustWidth('textarea', aw));
+                ew = aw;
+            }
+            if(typeof h == 'number'){
+                var tbh = 0;
+                for (var i =0; i < this.toolbars.length;i++) {
+                    // fixme - ask toolbars for heights?
+                    tbh += this.toolbars[i].tb.el.getHeight();
+                    if (this.toolbars[i].footer) {
+                        tbh += this.toolbars[i].footer.el.getHeight();
+                    }
+                }
+                
+                
+                
+                
+                var ah = h - this.wrap.getFrameWidth('tb') - tbh;// this.tb.el.getHeight();
+                ah -= 5; // knock a few pixes off for look..
+                this.inputEl().setHeight(this.adjustWidth('textarea', ah));
+                var eh = ah;
+            }
+        }
+        Roo.log('onResize:' + [w,h,ew,eh].join(',') );
+        this.editorcore.onResize(ew,eh);
         
+    },
+
+    /**
+     * Toggles the editor between standard and source edit mode.
+     * @param {Boolean} sourceEdit (optional) True for source edit, false for standard
+     */
+    toggleSourceEdit : function(sourceEditMode)
+    {
+        this.editorcore.toggleSourceEdit(sourceEditMode);
+        
+        if(this.editorcore.sourceEditMode){
+            Roo.log('editor - showing textarea');
+            
+//            Roo.log('in');
+//            Roo.log(this.syncValue());
+            this.editorcore.syncValue();
+            this.inputEl().removeClass('hide');
+            this.inputEl().dom.removeAttribute('tabIndex');
+            this.inputEl().focus();
+        }else{
+            Roo.log('editor - hiding textarea');
+//            Roo.log('out')
+//            Roo.log(this.pushValue()); 
+            this.editorcore.pushValue();
+            
+            this.inputEl().addClass('hide');
+            this.inputEl().dom.setAttribute('tabIndex', -1);
+            //this.deferFocus();
+        }
+         
+        this.setSize(this.wrap.getSize());
+        this.fireEvent('editmodechange', this, this.editorcore.sourceEditMode);
+    },
+    // private (for BoxComponent)
+    adjustSize : Roo.BoxComponent.prototype.adjustSize,
+
+    // private (for BoxComponent)
+    getResizeEl : function(){
+        return this.wrap;
+    },
+
+    // private (for BoxComponent)
+    getPositionEl : function(){
+        return this.wrap;
+    },
+
+    // private
+    initEvents : function(){
+        this.originalValue = this.getValue();
+    },
+
+    /**
+     * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
+     * @method
+     */
+    markInvalid : Roo.emptyFn,
+    /**
+     * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
+     * @method
+     */
+    clearInvalid : Roo.emptyFn,
+
+    setValue : function(v){
+        Roo.bootstrap.HtmlEditor.superclass.setValue.call(this, v);
+        this.editorcore.pushValue();
+    },
+
+     
+    // private
+    deferFocus : function(){
+        this.focus.defer(10, this);
+    },
+
+    // doc'ed in Field
+    focus : function(){
+        this.editorcore.focus();
+        
+    },
+      
+
+    // private
+    onDestroy : function(){
+        
+        
+        
+        if(this.rendered){
+            
+            for (var i =0; i < this.toolbars.length;i++) {
+                // fixme - ask toolbars for heights?
+                this.toolbars[i].onDestroy();
+            }
+            
+            this.wrap.dom.innerHTML = '';
+            this.wrap.remove();
+        }
+    },
+
+    // private
+    onFirstFocus : function(){
+        //Roo.log("onFirstFocus");
+        this.editorcore.onFirstFocus();
+         for (var i =0; i < this.toolbars.length;i++) {
+            this.toolbars[i].onFirstFocus();
+        }
+        
+    },
+    
+    // private
+    syncValue : function()
+    {
+        this.editorcore.syncValue();
     }
+     
+    
+    // hide stuff that is not compatible
+    /**
+     * @event blur
+     * @hide
+     */
+    /**
+     * @event change
+     * @hide
+     */
+    /**
+     * @event focus
+     * @hide
+     */
+    /**
+     * @event specialkey
+     * @hide
+     */
+    /**
+     * @cfg {String} fieldClass @hide
+     */
+    /**
+     * @cfg {String} focusClass @hide
+     */
+    /**
+     * @cfg {String} autoCreate @hide
+     */
+    /**
+     * @cfg {String} inputType @hide
+     */
+    /**
+     * @cfg {String} invalidClass @hide
+     */
+    /**
+     * @cfg {String} invalidText @hide
+     */
+    /**
+     * @cfg {String} msgFx @hide
+     */
+    /**
+     * @cfg {String} validateOnBlur @hide
+     */
 });
+    
+   
+   
+   
+    
\ No newline at end of file
index 17129e2..573a49c 100644 (file)
@@ -316,7 +316,7 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
 
         } else {
             
-                   Roo.log(" no label && no align");
+                Roo.log(" no label && no align");
                 cfg.cn = [
                     
                         inputblock
@@ -325,6 +325,12 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
                 
                 
         };
+        Roo.log('input-parentType: ' + this.parentType);
+        
+        if (this.parentType === 'Navbar' &&  this.parent().bar) {
+           cfg.cls += ' navbar-form';
+           Roo.log(cfg);
+        }
         
         return cfg;
         
@@ -710,6 +716,27 @@ Roo.extend(Roo.bootstrap.Input, Roo.bootstrap.Component,  {
             this.setValue( event.shiftKey ?  cc : cc.toLowerCase());
             
         }
+    },
+    adjustWidth : function(tag, w){
+        tag = tag.toLowerCase();
+        if(typeof w == 'number' && Roo.isStrict && !Roo.isSafari){
+            if(Roo.isIE && (tag == 'input' || tag == 'textarea')){
+                if(tag == 'input'){
+                    return w + 2;
+                }
+                if(tag == 'textarea'){
+                    return w-2;
+                }
+            }else if(Roo.isOpera){
+                if(tag == 'input'){
+                    return w + 2;
+                }
+                if(tag == 'textarea'){
+                    return w-2;
+                }
+            }
+        }
+        return w;
     }
     
 });
index ad2e75c..d3c32df 100644 (file)
@@ -35,14 +35,14 @@ Roo.extend(Roo.bootstrap.Menu, Roo.bootstrap.Component,  {
     
     getAutoCreate : function(){
         
-       //if (['right'].indexOf(this.align)!==-1) {
-       //    cfg.cn[1].cls += ' pull-right'
-       //}
-       var cfg = {
-           tag : 'ul',
-           cls : 'dropdown-menu' 
-           
-       }
+        //if (['right'].indexOf(this.align)!==-1) {
+        //    cfg.cn[1].cls += ' pull-right'
+        //}
+        var cfg = {
+            tag : 'ul',
+            cls : 'dropdown-menu' 
+            
+        }
        
        if (this.type==='submenu') {
            cfg.cls='submenu active'
diff --git a/examples/bootstrap/htmleditor.html b/examples/bootstrap/htmleditor.html
new file mode 100644 (file)
index 0000000..46414e2
--- /dev/null
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>Html editor for bootstrap test</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    
+    <!-- Bootstrap -->
+    <link rel="stylesheet" href="../../css-bootstrap/bootstrap.min.css">
+        
+    
+        
+        
+        
+    <script type="text/javascript" src="../../roojs-core-debug.js"></script>
+    <!-- bootstrap js.. needs to compile it later.. -->
+    <script type="text/javascript" src="../../Roo/XComponent.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Component.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Body.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Container.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Column.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Navbar.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Navbar/Item.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Menu.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/MenuItem.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/MenuSeparator.js"></script>
+    
+    <script type="text/javascript" src="../../Roo/bootstrap/NavGroup.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Row.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Button.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/ButtonGroup.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Img.js"></script>
+    
+    <script type="text/javascript" src="../../Roo/bootstrap/Modal.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Form.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Input.js"></script>
+    
+    <script type="text/javascript" src="../../Roo/bootstrap/TriggerField.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/ComboBox.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Calendar.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/Popover.js"></script>
+    
+    <script type="text/javascript" src="../../Roo/data/SortTypes.js"></script>
+    <script type="text/javascript" src="../../Roo/data/Record.js"></script>
+    <script type="text/javascript" src="../../Roo/data/Store.js"></script>
+    <script type="text/javascript" src="../../Roo/data/SimpleStore.js"></script>
+    <script type="text/javascript" src="../../Roo/data/JsonStore.js"></script>
+    <script type="text/javascript" src="../../Roo/data/Field.js"></script>
+    <script type="text/javascript" src="../../Roo/data/DataReader.js"></script>
+    <script type="text/javascript" src="../../Roo/data/DataProxy.js"></script>
+    <script type="text/javascript" src="../../Roo/data/MemoryProxy.js"></script>
+    <script type="text/javascript" src="../../Roo/data/HttpProxy.js"></script>
+    <script type="text/javascript" src="../../Roo/data/ScriptTagProxy.js"></script>
+    <script type="text/javascript" src="../../Roo/data/JsonReader.js"></script>
+    <script type="text/javascript" src="../../Roo/data/ArrayReader.js"></script>
+    
+    
+<script type="text/javascript" src="../../Roo/bootstrap/TextArea.js"></script>
+    <script type="text/javascript" src="../../Roo/HtmlEditorCore.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/HtmlEditor.js"></script>
+    <script type="text/javascript" src="../../Roo/bootstrap/HtmlEditor/ToolbarStandard.js"></script>
+
+    <!-- test code -->
+    <script type="text/javascript" src="htmleditor.js"></script>
+  </head>
+  <body id="body">
+    <script type="text/javascript">
+      Roo.onReady(function() {
+          Roo.XComponent.build();
+      });
+    </script>
+  </body>
+</html>
\ No newline at end of file
diff --git a/examples/bootstrap/htmleditor.js b/examples/bootstrap/htmleditor.js
new file mode 100644 (file)
index 0000000..95bf42c
--- /dev/null
@@ -0,0 +1,67 @@
+var htmleditor;
+
+Roo.example = Roo.example || {};
+
+Roo.example.calendar = new Roo.XComponent({
+    part     :  ["layout","viewpanel"],
+    order    : '001-viewpanel',
+    region   : '',
+    parent   : '#bootstrap',
+    name     : "unnamed module",
+    disabled : false, 
+    permname : '', 
+    _tree : function()
+    {
+        
+        this.parent = {
+            el : new Roo.bootstrap.Body()
+        }
+        this.parent.el.layout = false;
+        this.parent.el.render(document.body);
+        
+        var _this = this;
+        var MODULE = this;
+        //var baseURL = '/web.eventmanager/admin.php';
+        
+        return {
+            xtype: 'Body',
+            xns: Roo.bootstrap,
+            items : [
+                 {
+                    xtype: 'Container',
+                    xns: Roo.bootstrap,
+                    style :  'margin-top:50px', 
+                    items : [
+                        {
+                            xtype: 'Row',
+                            xns: Roo.bootstrap,
+                            style :  'margin-top:50px',
+                            items : [
+                                { 
+                                    xtype: 'Form',
+                                    xns: Roo.bootstrap,
+                                    style :  'margin-top:50px',
+                                    items : [
+                                        {
+                                            xtype: 'HtmlEditor',
+                                            xns: Roo.bootstrap,
+                                            fieldLabel : "Editor",
+                                            name : "editor",
+                                            listeners : {
+                                                render : function() {
+                                                    htmleditor = this;
+                                                }
+                                            }
+                                            
+                                        }
+                                    ]
+                                }
+                            ]
+                        }
+                    ]
+                 },
+                  
+            ]
+        };
+    }
+});
\ No newline at end of file
diff --git a/examples/form/htmleditor2.html b/examples/form/htmleditor2.html
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/examples/form/htmleditor2.js b/examples/form/htmleditor2.js
deleted file mode 100644 (file)
index f8ec896..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Based on:
- * Ext JS Library 1.1.1
- * Copyright(c) 2006-2007, Ext JS, LLC.
- *
- * Originally Released Under LGPL - original licence link has changed is not relivant.
- *
- * Fork - LGPL
- * <script type="text/javascript">
- */
-var mform;
-var editor;
-Roo.onReady(function(){
-
-    Roo.QuickTips.init();
-
-    /*
-     * ================  Form 2  =======================
-     */
-    mform = new Roo.form.Form({
-        labelAlign: 'top',
-        items : [
-            {
-                xtype : 'HtmlEditor',
-                xns: Roo.form,
-           /*     toolbars : [    
-                    {
-                        xtype : 'ToolbarStandard',
-                        xns : Roo.form.HtmlEditor
-                    },
-                      {
-                        xtype : 'ToolbarContext',
-                        xns : Roo.form.HtmlEditor,
-                        styles : {
-                            '*' : [ 'headline' ] ,
-                            'TD' : [ 'underline', 'double-underline' ]
-                        }
-                    },
-                    
-                    
-                ],
-                */
-                id:'bio',
-                name : 'bio',
-                fieldLabel:'Biography',
-                width:800,
-                height:400,
-                resizable: 's' /// where the handles should got..
-
-            },
-            {
-                xtype : 'Button',
-                xns: Roo.form,
-                text: 'Save'
-            },
-            {
-                xtype : 'Button',
-                xns: Roo.form,
-                text: 'Cancel'
-            }
-            
-        ]
-        
-    });
-
-    mform.render('form-ct5');
-    editor = mform.findField('bio');
-});
\ No newline at end of file