diff -urN orig/file/message-en.txt kai/file/message-en.txt --- orig/file/message-en.txt 2005-10-09 16:40:37.000000000 +0900 +++ kai/file/message-en.txt 2005-10-09 16:37:27.000000000 +0900 @@ -47,6 +47,7 @@ # thread anonymous<>anonymous last_article<>Go to the last article. +back<>Back to page. # note edit<>EDIT diff -urN orig/file/message-ja.txt kai/file/message-ja.txt --- orig/file/message-ja.txt 2005-10-09 16:40:37.000000000 +0900 +++ kai/file/message-ja.txt 2005-10-09 16:37:27.000000000 +0900 @@ -47,6 +47,7 @@ # thread anonymous<>名無しさん last_article<>最新の書き込み +back<>戻る # note edit<>編集 diff -urN orig/shingetsu/gateway.py kai/shingetsu/gateway.py --- orig/shingetsu/gateway.py 2005-10-09 16:40:37.000000000 +0900 +++ kai/shingetsu/gateway.py 2005-10-09 16:44:56.000000000 +0900 @@ -224,7 +224,7 @@ ' \n' + "\n" + - "\n" + + '\n' + '

\n' + ' ' + message["top"] + " |\n" + diff -urN orig/shingetsu/gateway_cgi.py kai/shingetsu/gateway_cgi.py --- orig/shingetsu/gateway_cgi.py 2005-10-09 16:40:37.000000000 +0900 +++ kai/shingetsu/gateway_cgi.py 2005-10-09 17:06:18.000000000 +0900 @@ -142,13 +142,31 @@ buf = self.escape(buf) return buf + def content_html_format(self, plain): + buf = plain.replace("
", "\n") + buf = self.escape(buf) + buf = re.sub(r"
", + "
\n ", + buf) + buf = re.sub(r"(>>)([0-9a-f]{8})", + self.res_anchor(r"\2") + r"\g<0>", + buf) + buf = re.sub(r"https?://[^\x00-\x20\"'()<>\[\]\x7F-\xFF]{2,}", + r'\g<0>', + buf) + buf = re.sub(r"\[\[(.*?)\]\]", + r"[[\1]]", + buf) + return buf + def print_rss(self): rss = RSS(encode = "UTF-8", title = self.message["logo"], parent = "http://" + self.environ["HTTP_HOST"], uri = "http://" + self.environ["HTTP_HOST"] + self.gateway_cgi + self.sep + "rss", - description = self.message["description"]) + description = self.message["description"], + content = "") cachelist = CacheList() now = int(time()) for cache in cachelist: @@ -158,12 +176,15 @@ last = cache.load_last() if last: desc = self.rss_html_format(last.get("body", "")) + cont = self.content_html_format(last.get("body", "")) else: desc = "" + cont = "" rss.append(path[1:], date = cache.stamp, title = title, - description = desc) + description = desc, + content = cont) self.stdout.write("Content-Type: text/xml; charset=UTF-8\n") try: diff -urN orig/shingetsu/rss.py kai/shingetsu/rss.py --- orig/shingetsu/rss.py 2005-10-09 16:40:37.000000000 +0900 +++ kai/shingetsu/rss.py 2005-10-09 16:35:50.000000000 +0900 @@ -37,9 +37,10 @@ title = "" link = "" description = "" + content = "" date = 0 # Seconds from 1970-01-01T00:00 - def __init__(self, link="", title="", date=0, description=""): + def __init__(self, link="", title="", date=0, description="", content=""): """Constructor.""" from xml.sax.saxutils import escape @@ -48,6 +49,7 @@ self.date = date self.title = escape(del_eos.sub('', title, 0)) self.description = escape(del_eos.sub('', description, 0)) + self.content = content class RSS(dict): """RSS. @@ -62,15 +64,17 @@ link = "" # URI of main page uri = "" # URI of RSS description = "" + content = "" def __init__(self, encode="utf-8", lang="en", title="", - parent="", link="", uri="", description=""): + parent="", link="", uri="", description="", content=""): """Constructor.""" self.encode = encode self.lang = lang self.title = title self.description = description + self.content = content self.parent = parent if parent and parent[-1] != "/": @@ -86,12 +90,12 @@ else: self.uri = parent + "rss.xml" - def append(self, link, title="", date=0, description="", abs=False): + def append(self, link, title="", date=0, description="", content="", abs=False): """Add an item.""" if not abs: link = self.parent + link - item = Item(link, title=title, date=date, description=description) + item = Item(link, title=title, date=date, description=description, content=content) self[link] = item def keys(self): @@ -113,6 +117,7 @@ buf += ' xmlns="http://purl.org/rss/1.0/"\n' buf += ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n' buf += ' xmlns:dc="http://purl.org/dc/elements/1.1/"\n' + buf += ' xmlns:content="http://purl.org/rss/1.0/modules/content/"\n' buf += ' xml:lang="' + rss.lang + '">\n' buf += '\n' buf += ' ' + rss.title + '\n' @@ -135,6 +140,8 @@ buf += ' ' + w3cdate + '\n' if f.description: buf += ' ' + f.description + '\n' + if f.content: + buf += ' ' + f.content + '

]]>\n' buf += '\n' buf += '\n' diff -urN orig/shingetsu/thread_cgi.py kai/shingetsu/thread_cgi.py --- orig/shingetsu/thread_cgi.py 2005-10-09 16:40:37.000000000 +0900 +++ kai/shingetsu/thread_cgi.py 2005-10-09 16:35:51.000000000 +0900 @@ -94,13 +94,19 @@ ' %s%s\n' % (self.res_anchor(record[-1].id[:8]), self.message["last_article"])) self.stdout.write('

\n
\n') - for rec in record: - self.print_record(cache, rec) + for num, rec in enumerate(record): + self.print_record(cache, num, rec) + if record: + self.stdout.write( + '

\n' + + ' %s\n' % (self.message["back"])) + self.stdout.write('

\n') self.print_form(cache) self.remove_file_form(cache) self.footer() - def print_record(self, cache, rec): + def print_record(self, cache, num, rec): + num = num + 1 stamp = self.localtime(rec["stamp"]) if ("name" in rec) and (rec["name"] != ""): name = rec["name"] @@ -127,12 +133,85 @@ if "attach" in rec: attach_file = rec.attach_path() attach_size = int(rec.attach_size(attach_file) / 1024) - attach = ' ' + \ - rec["stamp"] + '.' + suffix + '' + \ - " (" + str(attach_size) + self.message["kb"] + ")\n" + if "jpg" in suffix: + attachN = ' ' + \ + rec["stamp"] + '.' + suffix + '' + \ + " (" + str(attach_size) + self.message["kb"] + ")
\n" + \ + '' + "\n" + attachN = ' ' + \ + rec["stamp"] + '.' + suffix + '' + \ + " (" + str(attach_size) + self.message["kb"] + ")
\n" + \ + '
' + \ + '' + \ + '
' + "\n" + attach = ' ' + \ + rec["stamp"] + '.' + suffix + '' + \ + " (" + str(attach_size) + self.message["kb"] + ")
\n" + \ + '' + "\n" + attachN = ' ' + \ + rec["stamp"] + '.' + suffix + '' + \ + " (" + str(attach_size) + self.message["kb"] + ")
\n" + \ + '' + \ + '' + "\n" + else: + attach = ' ' + \ + rec["stamp"] + '.' + suffix + '' + \ + " (" + str(attach_size) + self.message["kb"] + ")\n" sign = "" if "pubkey" in rec: @@ -151,10 +230,11 @@ ' ' + - '%s\n' % (rec["id"][:8], rec["id"][:8]) + + '%s' % num + ' ' + name + "" + mail + sign + "\n" + ' ' + stamp + "\n" + + '%s\n' % (rec["id"][:8], rec["id"][:8]) + attach + " \n" + '
\n' % rec["id"][:8] + diff -urN orig/www/default.css kai/www/default.css --- orig/www/default.css 2005-10-09 16:40:37.000000000 +0900 +++ kai/www/default.css 2005-10-09 16:36:42.000000000 +0900 @@ -8,8 +8,58 @@ .name { color: green; font-weight: bold; } .sign { color: red; } .head { text-align: right; } +.back { text-align: right; } table { border-collapse: collapse; } td { border: 1px solid #ccc; padding: 5px 5px 5px 1em; text-align: right; } .popup { background-color: #aff; } + +#pic a{ + background-color: #FFFFFF; + left: 10px; + position: relative; + top: 10px; + width: 135px; +} + +#pic a .large { + border: 0px; + display: block; + height: 1px; + left: -1px; + position: absolute; + top: -1px; + width: 1px; +} + +#pic a img { + border: 0; +} + +#pic a.p1, #pic a.p1:visited { + background: #FFFFFF; + border: 0 solid #000000; + display: block; + left: 0; + text-decoration: none; + top: 0; + width: 135px; + height: auto; +} + +#pic a.p1:hover { + background-color: #FFFFFF; + color: #000000; + text-decoration: none; +} + +#pic a.p1:hover .large { + border: 0 solid #000000; + display: block; + height: auto; + left: 150px; + position: absolute; + top: -60px; + width: auto; +} diff -urN orig/www/tools.js kai/www/tools.js --- orig/www/tools.js 2005-10-09 16:40:37.000000000 +0900 +++ kai/www/tools.js 2005-10-09 16:36:42.000000000 +0900 @@ -83,3 +83,56 @@ pop.visibility = "hidden"; } } + +var imgPop = null; +var d = document; +var ie = d.selection ? 1 : 0; +var moz = (d.getSelection && !window.opera) ? 1 : 0; + +function getScrollY(){ + if(d.documentElement && typeof d.documentElement.scrollTop != "undefined"){ + return d.documentElement.scrollTop; + } else if(d.body && typeof d.body.scrollTop != "undefined"){ + return d.body.scrollTop; + } else if(typeof window.pageYOffset != "undefined"){ + return window.pageYOffset; + } + return 0; +} + +imagePop = function (e, path){ + if(imgPop==null){ + imgPop = d.createElement("IMG"); + imgPop.src = path; + with (imgPop.style){ + position = "absolute"; + left = "150px"; + top = Math.round(getScrollY() + 30) + "px"; + margin = "0"; + zIndex = 1000; + display = "none"; + } + d.body.appendChild(imgPop); + if(imgPop.complete){ + imgPop.style.display = "block"; + } else window.status = "reading image..."; + imgPop.onload = function(){imgPop.style.display="block"; window.status="";} + } +} + +function hideimagePop(e, path) { + d.body.removeChild(imgPop); + imgPop=null; +} + +function _(){ + var _onload = window.onload; + if (typeof(window.onload) != "function"){ + window.onload = function(){if(moz) hackFirefoxToolTip()}; + } else { + window.onload = function(){ + _onload(); + if(moz) hackFirefoxToolTip(); + } + } +}_();