...
|
...
|
@@ -11,7 +11,7 @@ var file_upload_limit = 6; |
|
|
$.fn.extend({
|
|
|
qupload: function(options) {
|
|
|
writeProgressHtml();
|
|
|
initSwfUpload($(this).attr('id'), options);
|
|
|
initSwfUpload.call(this, $(this).attr('id'), options);
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -35,6 +35,8 @@ function setUploadStatus(uploadNum, totalUploadNum) { |
|
|
|
|
|
// 初始化swf
|
|
|
function initSwfUpload(btnId, options) {
|
|
|
var that = this;
|
|
|
|
|
|
// 上传成功的回调函数
|
|
|
var uploadSuccessCallBack = null;
|
|
|
if (options.uploadSuccessed != undefined) {
|
...
|
...
|
@@ -65,15 +67,15 @@ function initSwfUpload(btnId, options) { |
|
|
// 当前已经上传的张数
|
|
|
var curUploadedNum = 0;
|
|
|
|
|
|
this.options = options;
|
|
|
that.options = options;
|
|
|
|
|
|
var numTest = 0;
|
|
|
|
|
|
var errmsg_box = this.options.errmsg_box;
|
|
|
var errmsg_box = that.options.errmsg_box;
|
|
|
|
|
|
// 设置默认值函数
|
|
|
function setDefaultValue(optionName, optionValue) {
|
|
|
this.options[optionName] = options[optionName] == undefined ? optionValue
|
|
|
that.options[optionName] = options[optionName] == undefined ? optionValue
|
|
|
: options[optionName];
|
|
|
}
|
|
|
|
...
|
...
|
@@ -98,16 +100,16 @@ function initSwfUpload(btnId, options) { |
|
|
setDefaultValue('button_cursor', '-2');
|
|
|
|
|
|
var settings = {
|
|
|
flash_url: this.options.flash_url,
|
|
|
upload_url: this.options.upload_url,
|
|
|
file_post_name: this.options.file_post_name,
|
|
|
flash_url: that.options.flash_url,
|
|
|
upload_url: that.options.upload_url,
|
|
|
file_post_name: that.options.file_post_name,
|
|
|
|
|
|
// post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
|
|
|
file_size_limit: this.options.file_size_limit,
|
|
|
file_types: this.options.file_types,
|
|
|
file_types_description: this.options.file_types_description,
|
|
|
file_upload_limit: this.options.file_upload_limit,
|
|
|
file_queue_limit: this.options.file_queue_limit,
|
|
|
file_size_limit: that.options.file_size_limit,
|
|
|
file_types: that.options.file_types,
|
|
|
file_types_description: that.options.file_types_description,
|
|
|
file_upload_limit: that.options.file_upload_limit,
|
|
|
file_queue_limit: that.options.file_queue_limit,
|
|
|
prevent_swf_caching: false,
|
|
|
preserve_relative_urls: false,
|
|
|
custom_settings: {
|
...
|
...
|
@@ -116,16 +118,16 @@ function initSwfUpload(btnId, options) { |
|
|
debug: false,
|
|
|
|
|
|
// Button settings
|
|
|
button_image_url: this.options.button_image_url,
|
|
|
button_width: this.options.button_width,
|
|
|
button_height: this.options.button_height,
|
|
|
button_image_url: that.options.button_image_url,
|
|
|
button_width: that.options.button_width,
|
|
|
button_height: that.options.button_height,
|
|
|
button_placeholder_id: btnId,
|
|
|
button_text: this.options.button_text,
|
|
|
button_text_style: this.options.button_text_style,
|
|
|
button_text_left_padding: this.options.button_text_left_padding,
|
|
|
button_text_top_padding: this.options.button_text_top_padding,
|
|
|
button_window_mode: this.options.button_window_mode,
|
|
|
button_cursor: this.options.button_cursor,
|
|
|
button_text: that.options.button_text,
|
|
|
button_text_style: that.options.button_text_style,
|
|
|
button_text_left_padding: that.options.button_text_left_padding,
|
|
|
button_text_top_padding: that.options.button_text_top_padding,
|
|
|
button_window_mode: that.options.button_window_mode,
|
|
|
button_cursor: that.options.button_cursor,
|
|
|
|
|
|
// The event handler functions are defined in handlers.js
|
|
|
file_dialog_start_handler: fileDialogStart,
|
...
|
...
|
@@ -138,8 +140,8 @@ function initSwfUpload(btnId, options) { |
|
|
upload_success_handler: uploadSuccess,
|
|
|
upload_complete_handler: uploadComplete,
|
|
|
queue_complete_handler: queueComplete,
|
|
|
button_action: this.options.button_action,
|
|
|
post_params: this.options.post_params
|
|
|
button_action: that.options.button_action,
|
|
|
post_params: that.options.post_params
|
|
|
};
|
|
|
|
|
|
var swfu = new SWFUpload(settings);
|
...
|
...
|
|