'1243daf593fa297e07ab03bf06d925af' :"Searching...",
'c7892ebbb139886662c6f2fc8c450710' :"Subject",
'dc0de523c25be298ba751c63c694109e' :"Responsive Email (1)",
+ '8e5fb038528cb96c95ed88a734589034' :"Mailout Name ?",
'396ecabf0cd1f9503e591418851ef406' :"Edit / Create Message",
'b9c49611cfda3259a2b837b39489e650' :"Add Image",
'ea4788705e6873b424c65e91c2846b19' :"Cancel",
'bd88a20b53a47f7b5704a83a15ff5506' :"Saved Version",
- 'b20a8b77b05d53b4e695738731400c85' :"Mailout Name",
'1bd18d39370b7f26c1c5e18067b74c6f' :"Html File",
'5da618e8e4b89c66fe86e32cdafde142' :"From",
'31bb2f6e9b8fb11cbb7fb63c6025223f' :"Select Template",
if (action.type == 'setdata') {
- setInterval(_this.form.findField('bodytext').autosave, 60000);
+ setInterval(_this.form.findField('bodytext').autosave, 5000);
_this.data.module = _this.data.module || 'crm_mailing_list_message';
}
if (action.type == 'load') {
_this.dialog.el.unmask();
+
+ _this.form.findField('bodytext').originalValue = _this.form.findField('bodytext').getValue();
+
return;
}
if (action.type =='submit') {
items : [
{
allowBlank : false,
- fieldLabel : _this._strings['b20a8b77b05d53b4e695738731400c85'] /* Mailout Name */,
+ fieldLabel : _this._strings['8e5fb038528cb96c95ed88a734589034'] /* Mailout Name ? */,
name : 'name',
width : 400,
xns : Roo.form,
xtype : 'FieldSet',
items : [
{
+ autosave : function() {
+
+ var body = _this.form.findField('bodytext');
+
+ if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
+ Roo.log('body not dirty');
+ return;
+ }
+
+ Roo.log('body dirty, auto save!');
+
+ body.fireEvent('autosave', body);
+
+ },
clearUp : false,
cwhite : [
'margin',
'|xns' : 'Roo.form',
xtype : 'HtmlEditor',
listeners : {
- savedpreview : function (_self)
+ autosave : function (_self)
{
- Roo.log('saved preview');
+ Roo.log('autosave');
var id = _this.form.findField('id').getValue() * 1;
+ /*
+ if(!_self.editorcore.sourceEditMode){
+ _self.syncValue();
+ }else{
+ _self.pushValue();
+ }
+ */
+
+ new Pman.Request({
+ url : baseURL + '/Roo/Events.php',
+ method :'POST',
+ params : {
+ id : 0,
+ action : 'AUTOSAVE',
+ on_id : (id > 0) ? id : 0,
+ on_table : 'crm_mailing_list_message',
+ remarks : 'BODY',
+ source: _self.getValue()
+ },
+ success : function() {
+ _self.originalValue = _self.getValue();
+
+ },
+ failure : function()
+ {
+ Roo.log('body autosave failed?!');
+ }
+ });
+
+ },
+ savedpreview : function (_self)
+ {
+ var id = _this.form.findField('id').getValue() * 1;
+
var successFn = function(res){
return res.data.POST.source;
};
xtype : 'Separator'
},
{
+ cls : 'x-init-enable',
text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
xns : Roo.Toolbar,
'|xns' : 'Roo.Toolbar',
click : function (_self, e)
{
this.scope.owner.fireEvent('savedpreview', this.scope.owner);
+
}
}
}