<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title><!--{$UUDEV_PAGE_TITLE}--></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/ubb.css" rel="stylesheet"/>
<script src="js/ajaxupload.js" charset="utf-8"></script>
<script>
	$(document).ready(function(){
		new AjaxUpload($("#uploadfile"), {
			action: 'index.php?r=Upload.file',
			name: 'upload',
			onSubmit: function(file, ext){
				//if (!(ext && /^(rar|zip|doc|wps|pdf|ppt|docx|pptx|xls|xlsx|jpg|png|jpeg|gif)$/i.test(ext))) {
					//alert(ext + '文件格式不支持 ，请重新上传！');
					//return false;
				//}
				
				this.disable();
				$("#uploadfile").html('<img src="images/ajax.gif"/>');
			},
			onComplete: function(file, response){
				var data = eval('(' + response + ')');
				if (data.flag == 1) {
					$("#file-url").val(data.name);
				}else {
					alert("文件上传失败");
				}
				$("#uploadfile").html('上传文件');
				this.enable();
			}
		});
		
		$(".portlet").css({height:'100%'});
	});
</script>
</head>
<body>
<div class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" style="hight:auto;">
<div class="portlet-header ui-widget-header"><span class="ui-icon ui-icon-circle-arrow-s" style="float:right;"></span>上传文件</div>
<div class="portlet-content" style="display: block;padding:10px;">
	<div class="panel-body">
		<div style=" padding-bottom:10px;">
		文件地址：<input type="text" name="file-url" id="file-url" class="file-url" style="width:300px"/><span id="uploadfile" class="button" style="margin-left:5px; text-decoration:underline; cursor:pointer;">上传文件</span>
		</div>
		<fieldset style="padding-left:10px;-moz-border-radius:8px;">
			<legend style="padding:0px 3px;">文件管理</legend>
			<div class="">
				<iframe id="managerframe" style="width:100%;height:auto;border:0px;" frameborder="0" src="./index.php?r=Upload.managerFile" ></iframe>
			</div>
		</fieldset>
	</div>
	<div class="panel-bottom">
		<button class="but5font insertBtn" role="button" aria-disabled="false"><span class="ui-button-text">插入</span></button>
		<button class="but5font cancelBtn" role="button" aria-disabled="false"><span class="ui-button-text">取消</span></button>
	</div>
</div>
</div>
</body>
</html>