wordimage.html
2.6 KB
<!doctypehtml><title></title><meta content="text/html;charset=utf-8"http-equiv=Content-Type><script src=../internal.js></script><style>.wrapper{width:600px;padding:10px;height:352px;overflow:hidden;position:relative;border-bottom:1px solid #d7d7d7}.localPath input{float:left;width:350px;line-height:20px;height:20px}#clipboard{float:left;width:70px;height:30px}.description{color:#06c;margin-top:2px;width:450px;height:45px;float:left;line-height:22px}#upload{width:100px;height:30px;float:right;margin:10px 2px 0 0;cursor:pointer}#msg{width:140px;height:30px;line-height:25px;float:left;color:red}</style><div class=wrapper><div class=localPath><input id=localPath readonly><div id=clipboard></div><div id=msg></div></div><div id=flashContainer></div><div><div id=upload style=display:none><img id=uploadBtn></div><div class=description><span style=color:red><var id=lang_resave></var>: </span><var id=lang_step></var></div></div></div><script src=tangram.js></script><script src=wordimage.js></script><script>editor.setOpt({wordImageFieldName:"upfile",compressSide:0,maxImageSideLength:900});var imageUrls=[],selectedImageCount=0,optImageUrl=editor.getActionUrl(editor.getOpt("imageActionName")),optImageFieldName=editor.getOpt("imageFieldName"),optImageCompressBorder=editor.getOpt("imageCompressEnable")?editor.getOpt("imageCompressBorder"):null,maxSize=editor.getOpt("imageMaxSize")/1024,extension=editor.getOpt("imageAllowFiles").join(";").replace(/\./g,"*."),params=utils.serializeParam(editor.queryCommandValue("serverparam"))||"",urlWidthParams=optImageUrl+(-1==optImageUrl.indexOf("?")?"?":"&")+params;utils.domReady(function(){var flashOptions={container:"flashContainer",url:urlWidthParams,ext:editor.queryCommandValue("serverParam")||{},fileType:'{"description":"'+lang.fileType+'", "extension":"'+extension+'"}',flashUrl:"imageUploader.swf",width:600,height:272,gridWidth:120,gridHeight:120,picWidth:100,picHeight:100,uploadDataFieldName:optImageFieldName,picDescFieldName:"pictitle",maxSize:maxSize,compressSize:1,maxNum:32,compressSide:0,compressLength:optImageCompressBorder},callbacks={selectFileCallback:function(e){(selectedImageCount+=e.length)&&(baidu.g("upload").style.display=""),dialog.buttons[0].setDisabled(!0)},deleteFileCallback:function(e){(selectedImageCount-=e.length)||(baidu.g("upload").style.display="none",dialog.buttons[0].setDisabled(!1))},uploadCompleteCallback:function(data){try{var info=eval("("+data.info+")");info&&imageUrls.push(info),selectedImageCount--}catch(e){}},uploadErrorCallback:function(e){console&&console.log(e)},allCompleteCallback:function(){dialog.buttons[0].setDisabled(!1)}};wordImage.init(flashOptions,callbacks)})</script>