12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- var reorder = 0;
- function loadUpload(i,e,key,upload,assets)
- {
- e.uploadify({
- 'formData' : {'key' : key},
- 'swf' : assets + 'uploadify.swf',
- 'buttonText' : '选择文件',
- 'uploader' : upload,
- 'cancelImg' : assets + 'image/uploadify-cancel.png',
- 'width':'160',//选择文件按钮的宽度
- 'height':'160',//选择文件按钮的高度
- 'buttonText' : '',
- //'buttonClass' : 'update',
- 'onUploadSuccess':function(file,data,response)
- {
- console.info(data);
- var data = eval('('+data+')');
- if(data.status)
- {
- var value = e.attr('v');
- if(value.indexOf('mul') != -1 && $(value).length)
- {
- var img = '<img src="'+data.url+'" width="">';
- $(value).eq(reorder).html(img);
- $("#content").val($("#content").val() + "<br />" + img);
- reorder++;
- if(reorder > 5)
- {
- reorder = 0;
- }
- }
- else
- {
- jQuery("#"+file.id).find('.data').html('上传完毕');
- jQuery("#"+file.id).hide();
- jQuery('#'+value).val(data.url);
- jQuery('#show_'+value).attr('style','background:url("'+data.url+'") no-repeat;background-size:contain;');
- var img = '<img src="'+data.url+'" width="">';
- var vv = '';
- $(".img_value").each(function()
- {
- if($(this).val())
- {
- vv += '<img src="'+data.url+'" width=""><br />';
- }
- });
- //alert(vv);
- $("#content").val(vv);
-
- }
- }
- else
- {
- jQuery("#"+file.id).find('.data').html("<font color='red'>"+data.message+"</font>");
- return false;
- }
- }
- });
- }
- if(jQuery.browser.msie){
- SWFUpload.prototype.getFlashHTML = function () {
- return ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
- '<param name="wmode" value="', this.settings.button_window_mode , '" />',
- '<param name="movie" value="', this.settings.flash_url, '" />',
- '<param name="quality" value="high" />',
- '<param name="menu" value="false" />',
- '<param name="allowScriptAccess" value="always" />',
- '<param name="flashvars" value="' + this.getFlashVars() + '" />',
- '</object>'].join("");
- }
- }
|