<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: h5upload.tpl.php 160 2015-10-03 07:03:08Z along $
#
#	Copyright (C) 2008-2016 PHPDisk Team. All Rights Reserved.
#
##
#-->
<link href="images/h5upload.css" rel="stylesheet" type="text/css">
<div id="h5box" style="margin-left:10px;">
	<div id="i_select_files"></div>

	<div id="i_stream_files_queue"></div>
	
	<div style="margin-top:5px">
	
	<div style=" float:left">
	</div>
	<div style="float:right"><span style="color:#0000ff" id="up_tips"></span> <button onClick="javascript:h5upload.upload();" style='padding:5px;'>开始上传</button> <button onClick="javascript:h5upload.stop();" style='padding:5px;'>暂停上传</button> <button onClick="javascript:h5upload.cancel();" style='padding:5px;'>取消上传</button></div>
	
</div>
<div class="clear"></div>
	<br>
	<div id="i_stream_message_container" class="stream-main-upload-box" style="overflow: auto;height:200px; display:none">
	</div>
<br>
</div>

<script type="text/javascript">
if (typeof(Worker) === "undefined"){    
	$('#h5box').html("<span class=\"txtred\">您的浏览器不支持HTML5，请升级您的浏览器再使用大文件浏览器上传功能。</span>");  
} 
$(document).ready(function(){
	$('#b_upload').mouseover(function(){$('#b_upload img').css({'border':'1px solid #ccc','background-color':'#F1F1F1'})}).mouseout(function(){$('#b_upload img').css({'border':'1px solid #fff','background-color':'#fff'})});
});
</script>
<script type="text/javascript" src="includes/js/h5upload.js"></script>
<script type="text/javascript">
	var config = {
		browseFileId : "i_select_files",
		browseFileBtn : "<input type='button' style='padding:5px;' value='选择文件' />",
		dragAndDropArea: "i_select_files", 
		dragAndDropTips: "<span style='font-size:14px;'>您也可以把文件(文件夹)拖拽到这里上传</span>",
		filesQueueId : "i_stream_files_queue",
		filesQueueHeight : 200,
		messagerId : "i_stream_message_container",
		multipleFiles: true,
		autoUploading: false,
		autoRemoveCompleted : true, 
		maxSize: {#get_h5_max_filesize($uid);#},
//		retryCount : 5,
		postVarsPerFile : { 
			uid: "{$uid}",
			folder_id:{$folder_id}
		},
		tokenURL : "rc_upload.php?action=super_upload&task=tk", 
		uploadURL : "rc_upload.php?action=super_upload&task=up",
		simLimit: 100,
		<!--#if($h5_upload_ext){#-->
		extFilters: [{$h5_upload_ext}], 
		<!--#}#-->
//		onSelect: function(list) {},
		onMaxSizeExceed: function(size, limited, name) {alert(' 您的权限是最大单个文件支持{#str_replace(" ","",get_size(get_h5_max_filesize($uid),"B",0));#}')}, 
//		onFileCountExceed: function(selected, limit) {alert('onFileCountExceed')},
		onExtNameMismatch: function(file, filters) {alert(file.name+' 文件类型不允许上传！')},
//		onCancel : function(file) {alert('Canceled:  ' + file.name)},
		onComplete: function(file) {$('#up_tips').html($('#up_tips').html()+file.name+' 上传成功 ');setTimeout(function(){$('#up_tips').hide()},5000)}
//		onQueueComplete: function() {alert('onQueueComplete')}, 
//		onUploadError: function(status, msg) {alert('onUploadError')}
	};
	var h5upload = new Stream(config);
</script>
