X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Pman.Dialog.CoreEmail.bjs;h=f6f0c1c570da443acdacaaed6744156c19a42612;hb=4015aa1dfa46088648f45e9f1d9b9c10a3418de8;hp=294e10a8e11dbb1ffd06728ca21be007f341c07f;hpb=7477e45b82472796a6aabcd4191022f9fa759b0e;p=Pman.Core diff --git a/Pman.Dialog.CoreEmail.bjs b/Pman.Dialog.CoreEmail.bjs index 294e10a8..f6f0c1c5 100644 --- a/Pman.Dialog.CoreEmail.bjs +++ b/Pman.Dialog.CoreEmail.bjs @@ -206,7 +206,7 @@ "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').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 \n var skip = i.getAttribute('src').match(/baseURL/);\n \n if(skip){\n mkimg();\n return;\n }\n \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 \n var n = i.getAttribute('src').match(/baseURL/);\n \n if(n){\n mkimg();\n return;\n }\n \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": [