Pman.Dialog.CoreEmail.bjs
authorEdward <edward@roojs.com>
Thu, 15 May 2014 06:41:26 +0000 (14:41 +0800)
committerEdward <edward@roojs.com>
Thu, 15 May 2014 06:41:26 +0000 (14:41 +0800)
Pman.Dialog.CoreEmail.js

Pman.Dialog.CoreEmail.bjs
Pman.Dialog.CoreEmail.js

index 9ab0d35..0c94030 100644 (file)
                                             "method": "POST",
                                             "style": "margin:10px",
                                             "xtype": "Form",
-                                            "|preValidate": "function(done_callback) {\n    \n    Roo.MessageBox.progress(\"Uploading Images\", \"Uploading\");\n    var html = _this.form.findField('bodytext').getValue();\n    \n    var s = Roo.get(_this.form.findField('bodytext').doc.documentElement);\n    \n    var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';\n    \n    var nodes = [];\n    s.select('img[src]').each(function(i) {\n        nodes.push(i.dom);\n    });\n    var total = nodes.length;\n    var mkimg = function() {\n    \n        if (!nodes.length) {\n              Roo.MessageBox.hide();\n              _this.form.findField('bodytext').syncValue();\n              done_callback(true);\n           //    _this.form.doAction(\"submit\");\n              return;\n        }\n        var i = nodes.pop();        \n        var n = i.getAttribute('src').match(/^http(.*)/);\n        if(!n ){\n            mkimg();\n            return;\n        }\n        \n        new Pman.Request({\n            url : baseURL + '/Roo/Images.php',\n            method : 'POST',\n            params : {\n                onid : _this.form.findField('id').getValue(),\n                ontable : ontable ,\n                _remote_upload : i.src\n            },\n            success : function(res){\n                if(res.success == true){      \n                    i.setAttribute('src', res.data);\n                    Roo.MessageBox.updateProgress( (total - nodes.length) / total , \"Done \" + (total - nodes.length) + '/' + total);\n                }\n                mkimg();\n            }\n        });\n       \n    }\n    mkimg();\n}\n",
+                                            "|preValidate": "function(done_callback) {\n    \n    Roo.MessageBox.progress(\"Uploading Images\", \"Uploading\");\n    var html = _this.form.findField('bodytext').getValue();\n    \n    var s = Roo.get(_this.form.findField('bodytext').editorcore.doc.documentElement);\n    \n    var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';\n    \n    var nodes = [];\n    s.select('img[src]').each(function(i) {\n        nodes.push(i.dom);\n    });\n    var total = nodes.length;\n    var mkimg = function() {\n    \n        if (!nodes.length) {\n              Roo.MessageBox.hide();\n              _this.form.findField('bodytext').syncValue();\n              done_callback(true);\n           //    _this.form.doAction(\"submit\");\n              return;\n        }\n        var i = nodes.pop();        \n        var n = i.getAttribute('src').match(/^http(.*)/);\n        if(!n ){\n            mkimg();\n            return;\n        }\n        \n        new Pman.Request({\n            url : baseURL + '/Roo/Images.php',\n            method : 'POST',\n            params : {\n                onid : _this.form.findField('id').getValue(),\n                ontable : ontable ,\n                _remote_upload : i.src\n            },\n            success : function(res){\n                if(res.success == true){      \n                    i.setAttribute('src', res.data);\n                    Roo.MessageBox.updateProgress( (total - nodes.length) / total , \"Done \" + (total - nodes.length) + '/' + total);\n                }\n                mkimg();\n            }\n        });\n       \n    }\n    mkimg();\n}\n",
                                             "|url": "baseURL + '/Roo/crm_mailing_list_message.php'",
                                             "|xns": "Roo.form",
                                             "items": [
index 73b01c7..3f92c9f 100644 (file)
@@ -356,7 +356,7 @@ Pman.Dialog.CoreEmail = {
                                             Roo.MessageBox.progress("Uploading Images", "Uploading");
                                             var html = _this.form.findField('bodytext').getValue();
                                             
-                                            var s = Roo.get(_this.form.findField('bodytext').doc.documentElement);
+                                            var s = Roo.get(_this.form.findField('bodytext').editorcore.doc.documentElement);
                                             
                                             var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';