examples/form/htmledit.js
authorAlan <alan@roojs.com>
Thu, 30 Dec 2021 04:00:56 +0000 (12:00 +0800)
committerAlan <alan@roojs.com>
Thu, 30 Dec 2021 04:00:56 +0000 (12:00 +0800)
examples/form/htmledit.js

index fd8ba50..2fc1058 100644 (file)
@@ -33,7 +33,7 @@ Roo.onReady(function(){
                         btns : [
                             {
                                 xtype : 'Button',
-                                text : "+Table",
+                                text : "Add Table",
                                 cls : 'x-init-enable',
                                 listeners : {
                                     click : function (_self, e)
@@ -50,6 +50,32 @@ Roo.onReady(function(){
                                 },
                                 xns : Roo,
                                
+                            },
+                             {
+                                xtype : 'Button',
+                                text : "Add Image",
+                                cls : 'x-init-enable',
+                                listeners : {
+                                    click : function (_self, e)
+                                    {
+                                        
+                                        var rr = new Roo.htmleditor.BlockFigure({
+                                            image_src: 'https://www.roojs.org/Roojscom/templates/images/roojsorg_logo-100.png',
+    
+                                            align: 'left',
+                                            caption : 'test',
+                                            text_align: 'left',
+                                            
+                                            width : '46%',
+                                            margin: '2%',
+                                        });
+                                        editor.editorcore.insertAtCursor(rr.toHTML());
+                                    
+                                 
+                                    }
+                                },
+                                xns : Roo,
+                               
                             }
                    
                         ]