examples/bootstrap/Editor.html
authorAlan Knowles <alan@roojs.com>
Fri, 30 Nov 2018 08:29:33 +0000 (16:29 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 30 Nov 2018 08:29:33 +0000 (16:29 +0800)
examples/bootstrap/Editor.html

index a8e937e..5918102 100644 (file)
   <body id="body">
     <script type="text/javascript">
         Campaign = { Dialog : {} };
-        
-        var baseURL = '/web.campaign/index.local.php';
-        var rootURL = '/web.campaign';
-        
+          
         Roo.XComponent.hideProgress = true;
         
         Roo.onReady(function() {
             Roo.XComponent.build();
         });
         
-        Roo.XComponent.on('buildcomplete', function() {
-            Roo.Ajax.request({
-                url : baseURL + '/editor/data.php',
-                method: 'GET',
-                success : function(r)
-                {
-                    var res = Roo.decode(r.responseText);
-                    
-                    if(!res.success){
-                        return;
-                    }
-                    
-                    Roo.example.Editor.previewPanel.body().dom.innerHTML = res.data.email;
-                    
-                    Roo.each(Roo.example.Editor.previewPanel.body().select('.campaign-editable', true).elements, function(el){
-                        
-                        var target = el.attr('data-target');
-                        
-                        Roo.example.Editor[target] = new Roo.bootstrap.editor.TextBlock({ panel : 'thanks-email' }).render(el);
-                        
-                    })
-                    
-                    Roo.each(Roo.example.Editor.previewPanel.body().select('.campaign-image-editable', true).elements, function(el){
-                        
-                        var target = el.attr('data-target');
-                        
-                        Roo.example.Editor[target] = new Roo.bootstrap.editor.ImageBlock({ panel : 'thanks-email' }).render(el);
-                        Roo.example.Editor[target].parent = el;
-                        
-                        Roo.example.Editor[target].on('upload', function(){
-                            Campaign.Dialog.Images.show(
-                                {
-                                    onid : 237,
-                                    ontable : 'campaign_detail',
-                                    imgtype : target
-                                }, 
-                                function(){
-                                    Roo.Ajax.request({
-                                        url : baseURL + '/Roo/Images',
-                                        method: 'GET',
-                                        params: {
-                                            _preview : target,
-                                            onid : 237
-                                        },
-                                        success : function(r)
-                                        {
-                                            var res = Roo.decode(r.responseText);
-                                            
-                                            if(!res.success){
-                                                return;
-                                            }
-                                            
-                                            var width = Roo.example.Editor[target].parent.getWidth();
-                                            
-                                            Roo.example.Editor[target].setValue((baseURL + '/Images/Thumb/' + width + '/' + res.data.id));
-                                        }
-                                    });
-                                }
-                            );
-                        })
-                        
-                    })
-                    
-                    for ( var p in res.data.campaign.emails ){
-                        var f = res.data.campaign.emails[p];
-                        
-                        for (var d in f['message']){
-                            Roo.example.Editor[d].setValue(f['message'][d])
-                        }
-                        
-                        for (var d in f['image']){
-                            var width = Roo.example.Editor[d].parent.getWidth();
-                            Roo.example.Editor[d].setValue(baseURL + '/Images/Thumb/' + width + '/' + f['image'][d]);
-                        }
-                        
-                    }
-                    
-                }
-            });
-        });
-        
+          
 
         
     </script>
     
-    <script src="../../../Campaign/Campaign.Dialog.Images.js" type="text/javascript"></script>
-  </body>
+   </body>
 </html>
\ No newline at end of file