koipa_edu_2025-1/src/main/webapp/innorix/gnexam/setLanguage.html
2023-07-18 15:40:15 +09:00

74 lines
3.2 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../innorix.css">
<script src="../innorix.js"></script>
<script>
var control = new Object();
/*
방법 1 )
innorix.setLanguage('ko'); // 한/영설정 [en,ko]
*/
innorix.setLanguage('ko');
window.onload = function() {
// 파일전송 컨트롤 생성
control = innorix.create({
el: '#fileControl', // 컨트롤 출력 HTML 객체 ID
transferMode: 'both', // 업로드, 다운로드 혼합사용
installUrl: '../install/install.html', // Agent 설치 페이지
progressTitle: '파일 전송 창 제목', // 전송창 타이틀 출력 문구, 기본값 : WP
uploadUrl: './upload.jsp' // 업로드 URL
//, controlLang: 'ko' // 방법 2 ) 한글 출력, 기본값 : en
});
/*
INNORIX WP는 영어 메시지를 기본으로 출력하며 설정을 통해 한글로 출력이 가능하게 됩니다.
두 방법 중 선택해서 적용하시면 되겠습니다. 방법 1을 권장드립니다.
방법 1 ) 컨트롤 생성 전에(innorix.create전에) 선언해주어야 합니다.
innorix.setLanguage
- innorix.setLanguage('ko'); (한글출력)
- innorix.setLanguage('en'); (영문출력)
방법 2 )
controlLang
- 'en' (기본값, 영문출력)
- 'ko' (한글출력)
*/
// 업로드 완료 이벤트
control.on('uploadComplete', function (p) {
console.log(p.files);
var f = p.files;
var r = "Upload complete\n\n";
for (var i = 0; i < f.length; i++ ) {
r += f[i].controlId + " " + f[i].clientFileName + " " + f[i].fileSize + "\n";
}
alert(r);
var files = JSON.stringify(f);
var innoJquery = innorix._load("innoJquery");
innoJquery('form#f_write').append('<input type="hidden" name="files" id="files" value=\'' + files + '\' />');
//innoJquery('form#f_write').submit();
});
};
</script>
</head>
<body>
<a href="../gnIndex.html">&larr; 예제 목록</a><br /><br />
<form action="result.jsp" id="f_write" name="f_write" method="post">
test1 : <input type="text" name="test1" />
</form><br />
<div id="fileControl"></div><br/>
<input type="button" value="멀티 파일 추가" onclick="control.openFileDialog();"/>
<input type="button" value="단일 파일 추가" onclick="control.openFileDialogSingle();"/>
<input type="button" value="업로드" onclick="control.upload();"/>
</body>
</html>