aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
author藍挺瑋 <lantw44@gmail.com>2012-12-21 09:52:09 +0800
committerLAN-TW <lantw44@gmail.com>2012-12-21 09:52:09 +0800
commit024f6e82e68b9e862387ec541dd4ab4328d9df9c (patch)
treefa4475e16eae807d7340d77d0cb483b6d8baaf5e /js
parent65b3e824ddc24ec7dc7bad883426ec88b1bcf39d (diff)
downloadinccalendar-024f6e82e68b9e862387ec541dd4ab4328d9df9c.tar.gz
inccalendar-024f6e82e68b9e862387ec541dd4ab4328d9df9c.tar.zst
inccalendar-024f6e82e68b9e862387ec541dd4ab4328d9df9c.zip
NTU CEIBA 解析支援,但網頁部份尚未實作(仍在測試中,可能修改 API)
繳交日期之後會改成字串,因為其實只有期限比較重要而已......
Diffstat (limited to 'js')
-rw-r--r--js/imnc.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/js/imnc.js b/js/imnc.js
index db86053..9cfecf8 100644
--- a/js/imnc.js
+++ b/js/imnc.js
@@ -1,3 +1,5 @@
+var imnc_filecontent;
+
function imnc_init(){
status_bar_clear();
document.getElementById("imstepforminit").style.display = "none";
@@ -8,3 +10,41 @@ function imnc_deinit(){
document.getElementById("imstepforminit").style.display = "block";
document.getElementById("imntuceibainfo").style.display = "none";
}
+
+function imnc_argok(){
+ status_bar_clear();
+ if(document.getElementById("nclogin").checked){
+ imnc_login();
+ }else if(document.getElementById("ncupload").checked){
+ imnc_upload();
+ }else{
+ status_bar_warning("請至少選取一種資料取得方式!");
+ }
+}
+
+function imnc_upload(){
+ var fileldobj;
+ var filereader;
+ fileldobj = document.getElementById("ncfile");
+ if(window.FileReader){ /* 支援 HTML5 File API 的話 */
+ if(fileldobj.files.length <= 0){
+ status_bar_warning("請選擇檔案!");
+ return;
+ }
+ filereader = new FileReader();
+ filereader.onloadend = function(evt){
+ imnc_filecontent = evt.target.result;
+ imnc_upload_send();
+ }
+ filereader.readAsText(fileldobj.files[0], 'Big5');
+ }else{
+ status_bar_warning("抱歉,尚未支援您的瀏覽器");
+ return;
+ }
+}
+
+function imnc_upload_send(){
+ var rq;
+ rq = create_xmlhttp_object();
+
+}