<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>img upload</title>

	<link rel="stylesheet" href="/JuuluuApp/RIA/jquery-ui-1.8.20/core/themes/base/jquery.ui.all.css">
<link rel="stylesheet" href="/JuuluuApp/RIA/jquery-ui-1.8.20/core/demos/demos.css">
	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/jquery-1.7.2.js"></script>

	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.ui.core.js"></script>

	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.ui.widget.js"></script>

	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.ui.tabs.js"></script>

		<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/external/jquery.bgiframe-2.1.2.js"></script>

	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.ui.widget.js"></script>
	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.ui.mouse.js"></script>
	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.ui.draggable.js"></script>
	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.ui.position.js"></script>
	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.ui.resizable.js"></script>
	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.ui.dialog.js"></script>
	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.effects.core.js"></script>
	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.effects.blind.js"></script>
	<script src="/JuuluuApp/RIA/jquery-ui-1.8.20/core/ui/jquery.effects.explode.js"></script>


	<script>

	$(function() {

		$( "#tabs" ).tabs({

			event: "mouseover"

		});
		
		$( "#dialog_img1" ).dialog({
			autoOpen: false,
			show: "blind",
			hide: "explode"
		});
		$( "#dialog_img2" ).dialog({
			autoOpen: false,
			show: "blind",
			hide: "explode"
		});
		
		

		$( "#opener_img2" ).click(function() {
		FileUploadInit_config_img1();
			$( "#dialog_img1" ).dialog( "open" );
			return false;
		});
		
		$( "#opener_img1" ).click(function() {
			FileUploadInit_config_2();
			$( "#dialog_img2" ).dialog( "open" );
			return false;
		});

	});

	</script>

<style type="text/css">
<!--
#openDialogCms {
	position:absolute;
	left:257px;
	top:115px;
	width:424px;
	height:129px;
	z-index:1;
}
-->
</style>
<!-- uplaod js -->
<script language="javascript" src="/js/ajax.js"></script>
<script language="javascript" src="/storeFile/userUpload/upload.js"></script>

</head>

<body>

<div class="img_upload_dialog_wrap">

<div id="dialog_img1" title="上传图片">
	<p>
	<div id="content_imgUpload">
<script type="text/javascript">

//before upload call server config
function FileUploadInit_config_img1(){
var StoreSystemType="imgUpload";
var page_Div_TagName_update_js="msg" ;
var SaveIoType="Apache_StreamsCopy" ;
var Form_inputID="imgViewUrlPath" ;
var callbakFunction="setFilePathUPladed_img";
	var url="/storeFile/userUpload/fileUpload_init.jsp?StoreSystemType="+StoreSystemType +"&page_Div_TagName_update_js=" +page_Div_TagName_update_js+ "&SaveIoType="+SaveIoType+"&Form_inputID=" +Form_inputID+"&callbakFunction="+callbakFunction;
videoInit_ajax(url);
}
</script>
 

<form id="fileUplaodForm" name="fileUplaodForm" action="/store/web/UploadFileWebStoreServlet" method="post" ENCTYPE="multipart/form-data" target="hidden_frame"  onsubmit="return subUplaodFileForm()">

  <p>图片：
      <input name="fileUPlaod" type="file" size="30" maxlength="255">
      

    </input>
  </p>


  <p>

    <input type=submit value="上传"></input>
  </p>

     

</form>

   

<!-- -上传后，处理程序转到iframe     target="hidden_frame" target="_blank"  style="display:none"-->

<iframe name="hidden_frame"id="hidden_frame" style="display:none" ></iframe>

<!-- -显示消息 -->

<span id="msg"></span>  




<script type="text/javascript">    
var upladoisok=false;

function subUplaodFileForm( ){
	var formUpload=document.forms["fileUplaodForm"];
	if(formUpload==null){
		alert("Not find uplaod form ,name: fileUplaodForm.");
	}else{
	
				//window.open("/storeFile/userUpload/uploadProcessorWindow.jsp");
	//	window.open('/storeFile/userUpload/uploadProcessorWindow.jsp','uplaodwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');


		formUpload.submit();
			
		return false;
	}

}

function setFilePathUPladed(fileUploadedPath,msg)    

{    

    //document.getElementById("fileUPlaod").outerHTML = document.getElementById("fileUPlaod").outerHTML;    

    document.getElementById("msg").innerHTML = "<font color=red>"+msg+"</font>"; 

	//更新表单字段

	var filePath=   document.getElementById("imgViewUrlPath");

	filePath.value=fileUploadedPath;
	$( "#dialog_img1" ).dialog( "close" );

}    

function setFilePathUPladed_img(inputId,fileUploadedPath,msg)    

{    

    //document.getElementById("fileUPlaod").outerHTML = document.getElementById("fileUPlaod").outerHTML;    

    document.getElementById("msg").innerHTML = "<font color=red>"+msg+"</font>"; 

	//更新表单字段

	var filePath=   document.getElementById(inputId);

	filePath.value=fileUploadedPath;
	$( "#dialog_img1" ).dialog( "close" );

} 

</script>
</div>
	</p>
</div>

<div id="dialog_img2" title="上传图片">
	<p>

<div id="content_upload_video">



<form id="fileUplaodForm_video" name="fileUplaodForm_video" action="/store/web/UploadFileWebStoreServlet" method="post" ENCTYPE="multipart/form-data" target="hidden_frame_video"  onsubmit="return subUplaodFileForm_video()">

<!-- config -->

	

  <p>图片2：
      <input id="fileUPlaod_video" name="fileUPlaod_video" type="file" size="30" maxlength="255">
  </p>


  <p>

    <input type=submit value="上传"></input>
    </p>

     

</form>

   

<!-- -上传后，处理程序转到iframe     target="hidden_frame" target="_blank"  style="display:none"-->

<iframe name="hidden_frame_video"id="hidden_frame_video" style="display:none" ></iframe>

<!-- -显示消息 -->

<span id="msg_video"></span>  


<script type="text/javascript">   

//config 
//before upload call server config
function FileUploadInit_config_2(){
//alert("config 2");
var StoreSystemType="imgUpload";
var page_Div_TagName_update_js="msg_video" ;
var SaveIoType="Apache_StreamsCopy" ;
var Form_inputID="imgViewUrlPath_2" ;
var callbakFunction="setFilePathUPladed_Form_input";
	var url="/storeFile/userUpload/fileUpload_init.jsp?StoreSystemType="+StoreSystemType +"&page_Div_TagName_update_js=" +page_Div_TagName_update_js+ "&SaveIoType="+SaveIoType+"&Form_inputID=" +Form_inputID+"&callbakFunction="+callbakFunction;
videoInit_ajax(url);

}

function subUplaodFileForm_video( ){
	var formUpload=document.forms["fileUplaodForm_video"];
	if(formUpload==null){
		alert("Not find uplaod form ,name: fileUplaodForm_video.");
	}else{
	
				//window.open("/storeFile/userUpload/uploadProcessorWindow.jsp");
		/**window.open('/storeFile/userUpload/uploadProcessorWindow.jsp','uplaodwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no');
**/

		formUpload.submit();
			
		return false;
	}

}

function setFilePathUPladed_Form_input(Form_inputID,fileUploadedPath,msg)    

{    

    //document.getElementById("fileUPlaod").outerHTML = document.getElementById("fileUPlaod").outerHTML;    

    document.getElementById("msg_video").innerHTML = "<font color=red>"+msg+"</font>"; 

	//更新表单字段

	var filePath=   document.getElementById(Form_inputID);
		if(filePath!=null){
			filePath.value=fileUploadedPath;
		}else{
			alert("not find form input element :"+Form_inputID);
		}

	$( "#dialog_img2" ).dialog( "close" );

}    
function setFilePathUPladed_video(fileUploadedPath,msg)    

{    

    //document.getElementById("fileUPlaod").outerHTML = document.getElementById("fileUPlaod").outerHTML;    

    document.getElementById("msg_video").innerHTML = "<font color=red>"+msg+"</font>"; 

	//更新表单字段

	var filePath=   document.getElementById("VideoFilePath");

	if(filePath!=null){
			filePath.value=fileUploadedPath;
		}else{
			alert("not find form input element :"+Form_inputID);
		}

}   


</script>


</div></p>
</div>

图片路径:
<input type=text  name="imgViewUrlPath" size="60" maxlength="255"/>
<button id="opener_img2">上传图片</button>

<br/>

<span class="formElementLable">图片路径2:</span>
<input id="imgViewUrlPath_2" name="imgViewUrlPath_2" type="text" size="60"  maxlength="255" onblur="updateFileType()"/>
<button id="opener_img1">上传图片</button>

</div>
<!-- end img uplpad wrap -->


<!-- end uplaod -->
</body>
</html>
