<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() {
return;
- Roo.Ajax.request({
- url : baseURL + '/editor/data.php',
- method: 'GET',
- success : function(r)
- {
-
-
- Roo.example.Editor.previewPanel.body().dom.innerHTML = "this is an examples"
-
- 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]);
- }
-
- }
-
- }
- });
+
});