diff options
author | huang-jinjie <pizza159630@gmail.com> | 2012-12-25 13:12:30 +0800 |
---|---|---|
committer | huang-jinjie <pizza159630@gmail.com> | 2012-12-25 13:12:30 +0800 |
commit | af6d6fef6ad2ffec708b0efeab7c633312506fe3 (patch) | |
tree | 94b447cd9573e2e456a33838a003ca400e0341f7 | |
parent | 584b2158ea8a0f281a3fd1bddadc010fec693bf6 (diff) | |
download | inccalendar-af6d6fef6ad2ffec708b0efeab7c633312506fe3.tar.gz inccalendar-af6d6fef6ad2ffec708b0efeab7c633312506fe3.tar.zst inccalendar-af6d6fef6ad2ffec708b0efeab7c633312506fe3.zip |
change fetchgooglecal.py title
list.js tetxt => text
-rw-r--r-- | gcal/fetchgooglecal.py | 11 | ||||
-rw-r--r-- | js/imgc.js | 1 | ||||
-rw-r--r-- | js/list.js | 16 |
3 files changed, 17 insertions, 11 deletions
diff --git a/gcal/fetchgooglecal.py b/gcal/fetchgooglecal.py index a42e130..0e03a62 100644 --- a/gcal/fetchgooglecal.py +++ b/gcal/fetchgooglecal.py @@ -40,7 +40,7 @@ class FetchGoogleCal (webapp2.RequestHandler) : date = starttime[0].split ('-') for i in range (0, len (date)) : - date[i] = unicode (date[i]) + date[i] = unicode (date[i], "utf-8") year = int (date[0]) month = int (date[1]) @@ -52,7 +52,7 @@ class FetchGoogleCal (webapp2.RequestHandler) : else : time = starttime[1].split (':') for i in range (0, len (time)) : - time[i] = unicode (time[i]) + time[i] = unicode (time[i], "utf-8") hour = int (time[0]) minute = int (time[1]) @@ -64,9 +64,14 @@ class FetchGoogleCal (webapp2.RequestHandler) : minute = minute ) + if event.title.text : + title = unicode (event.title.text, "utf-8") + else : + title = u"沒有標題" + newcalevent = CalEvent ( db.Key.from_path('user', guserid.email()), - title = unicode (event.title.text), + title = title, begin = begintime, datafrom = 'google' ) @@ -1,4 +1,5 @@ function imgcal_init () { + alert ("function not implemented"); $.ajax ({ type : "GET", url : "/gcal/fetchgooglecal", @@ -22,12 +22,12 @@ function setneweventform () { $ ("#" + "newevent" + "date").html ("<input type = 'text' id = 'input" + "newevent" + "year' size = '2' maxlength = '4' onkeyup = 'inputkeyup (this.id);' /> 年"); //size = 2 因為size是算中文字 $ ("#" + "newevent" + "date").append ("<input type = 'text' id = 'input" + "newevent" + "month' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 月"); $ ("#" + "newevent" + "date").append ("<input type = 'text' id = 'input" + "newevent" + "date' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 日"); - $ ("#" + "newevent" + "time").html ("<input type = 'tetxt' id = 'input" + "newevent" + "hour' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 時 <br />"); - $ ("#" + "newevent" + "time").append ("<input type = 'tetxt' id = 'input" + "newevent" + "minute' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 分"); - $ ("#" + "newevent" + "title").html ("<input type = 'tetxt' id = 'input" + "newevent" + "title' size = '40' />"); + $ ("#" + "newevent" + "time").html ("<input type = 'text' id = 'input" + "newevent" + "hour' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 時 <br />"); + $ ("#" + "newevent" + "time").append ("<input type = 'text' id = 'input" + "newevent" + "minute' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 分"); + $ ("#" + "newevent" + "title").html ("<input type = 'text' id = 'input" + "newevent" + "title' size = '40' />"); $ ("#" + "newevent" + "content").html ("<div> 活動內容: </div><textarea id = 'input" + "newevent" + "content" + "'></textarea><br />"); $ ("#input" + "newevent" + "content").attr ({"rows":"5", "cols":"100"}); - $ ("#" + "newevent" + "content").append ("提醒:<input type = 'tetxt' id = 'input" + "newevent" + "remind' size = '1' maxlength = '4' /> 分鐘前 "); + $ ("#" + "newevent" + "content").append ("提醒:<input type = 'text' id = 'input" + "newevent" + "remind' size = '1' maxlength = '4' /> 分鐘前 "); $ ("#" + "newevent" + "content").append ("資料來源: " + "include <行事曆.h>" + " "); $ ("#" + "newevent" + "content").append ("<input type = 'button' value = '確認' class = 'okbutton' onclick = 'updateevent (\"" + "newevent" + "\"); resumeeditbutton ();' />"); $ ("#" + "newevent" + "content").append ("<input type = 'button' value = '取消' class = 'okbutton' onclick = 'cancelupdateevent (\"" + "newevent" + "\"); resumeeditbutton ();' />"); @@ -717,12 +717,12 @@ function editevent (eventid) { $ ("#" + eventid + "date").html ("<input type = 'text' id = 'input" + eventid + "year' size = '2' maxlength = '4' onkeyup = 'inputkeyup (this.id);' /> 年"); //size = 2 因為size是算中文字 $ ("#" + eventid + "date").append ("<input type = 'text' id = 'input" + eventid + "month' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 月"); $ ("#" + eventid + "date").append ("<input type = 'text' id = 'input" + eventid + "date' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 日"); - $ ("#" + eventid + "time").html ("<input type = 'tetxt' id = 'input" + eventid + "hour' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 時 <br />"); - $ ("#" + eventid + "time").append ("<input type = 'tetxt' id = 'input" + eventid + "minute' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 分"); - $ ("#" + eventid + "title").html ("<input type = 'tetxt' id = 'input" + eventid + "title' size = '40' />"); + $ ("#" + eventid + "time").html ("<input type = 'text' id = 'input" + eventid + "hour' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 時 <br />"); + $ ("#" + eventid + "time").append ("<input type = 'text' id = 'input" + eventid + "minute' size = '1' maxlength = '2' onkeyup = 'inputkeyup (this.id);' /> 分"); + $ ("#" + eventid + "title").html ("<input type = 'text' id = 'input" + eventid + "title' size = '40' />"); $ ("#" + eventid + "content").html ("<div> 活動內容: </div><textarea id = 'input" + eventid + "content" + "'></textarea><br />"); $ ("#input" + eventid + "content").attr ({"rows":"5", "cols":"100"}); - $ ("#" + eventid + "content").append ("提醒:<input type = 'tetxt' id = 'input" + eventid + "remind' size = '1' maxlength = '4' /> 分鐘前 "); + $ ("#" + eventid + "content").append ("提醒:<input type = 'text' id = 'input" + eventid + "remind' size = '1' maxlength = '4' /> 分鐘前 "); if (thisevent["datafrom"] == "native") { datafrom = "include <行事曆.h>"; } |