var swfu, swfu2; var uLimit = -1; var batchHtml = ""; function dialogComplete(numFilesSelected, numFilesQueued){ if (numFilesQueued > 0){ this.startUpload(); }else{ var msg="你没选择文件或不符合以下要求"; msg += "\r\n·上传文件最大限制"+ 1024 +"KB"; if (uLimit>0){ msg += "\r\n·今天还可上传 "+ (uLimit-swfu.getStats().successful_uploads) +" 个文件"; } alert(msg); } } function uploadStart(file){ dopost.show(); swfu.setButtonDisabled(true); if(swfu2){ swfu2.setButtonDisabled(true); } } function uploadSuccessSingle(file, responseText){ // alert(file.name + " saveas " + responseText); dopost.hide(); swfu.setButtonDisabled(false); if(swfu2){ swfu2.destroy(false); } if(responseText.indexOf("")>=0){ alert("文件超过IIS上传大小限制或服务器错误"); return; } // eval("var jsObj={'success':false}"); eval(responseText); if (jsObj.success){ var oSrc = document.getElementById("src"); var uSuccess = this.getStats().successful_uploads; var logFunction = tinyMCEPopup.getParam('swfupload_log_function',function(s){}); oSrc.value = jsObj.msg; oSrc.onchange(); // 添加新闻时记录上传文件 logFunction(jsObj.msg); if (uLimit > 0){ if (uSuccess")>=0){ alert("文件超过IIS上传大小限制或服务器错误"); return; } eval(responseText); if (jsObj.success){ var logFunction = tinyMCEPopup.getParam('swfupload_log_function',function(s){}); logFunction(jsObj.msg); batchHtml += '
'; }else{ alert(jsObj.msg); } } function uploadComplete(file){ var stats = this.getStats(); if (stats.files_queued>0){ this.startUpload(); }else{ // 批量时插入 if(batchHtml.length>0){ var ed = tinyMCEPopup.editor; tinyMCEPopup.restoreSelection(); if (stats.successful_uploads>1){ ed.selection.collapse(false); } batchHtml = '
'+batchHtml+'<\/div>
'; ed.execCommand('mceInsertContent',false,batchHtml); ed.selection.select(ed.dom.select('#__mce_tmp_img')[0],true); tinyMCEPopup.storeSelection(); ed.dom.setAttrib('__mce_tmp_img', 'id', ''); batchHtml = ""; } alert("成功上传 "+ stats.successful_uploads +" 个,失败 "+ stats.upload_errors +" 个"); dopost.hide(); tinyMCEPopup.close(); } } window.onload = function (){ var imgMark=self.parent.$('input[name$="$imgWithMark"]').prop("checked")?1:0; }