summaryrefslogtreecommitdiffabout
authorWojciech Polak <polak@gnu.org>2008-11-29 19:14:25 (GMT)
committer Wojciech Polak <polak@gnu.org>2008-11-29 19:14:25 (GMT)
commit69940b25ee56d951264b738f7e5452ae06fcf738 (patch) (side-by-side diff)
tree5e384c8d0eeab86eb5503f176708462847e8c6f4
parenteb37b0862bf3940dad577d2092af426665558104 (diff)
downloadwikitrans-69940b25ee56d951264b738f7e5452ae06fcf738.tar.gz
wikitrans-69940b25ee56d951264b738f7e5452ae06fcf738.tar.bz2
Image rendering change.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--wiki2html.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/wiki2html.py b/wiki2html.py
index 58195be..07a8879 100644
--- a/wiki2html.py
+++ b/wiki2html.py
@@ -76,11 +76,22 @@ class HtmlWikiMarkup (WikiMarkup):
ns = self.wiki_ns_name(qual)
if ns:
if ns == 'NS_IMAGE':
- return "<img src=\"%s\" alt=\"[ %s ]\" />" % \
- (self.image_base + '/' + \
- urllib.quote(tgt) + \
- '/250px-' + urllib.quote(tgt),
- text if text else arg)
+ targ = text.split ('|')
+ # FIXME
+ type = targ[0]
+ width = targ[1]
+ caption = targ[2]
+ intwidth = int (width[:-2])
+ return '<div class="thumb tright"><div class="thumbinner" style="width:%dpx;"><a href="%s" class="image" title="%s"><img alt="" src="%s" class="thumbimage" border="0"></a><div class="thumbcaption"><div class="magnify"><a href="%s" class="internal"><img src="/static/magnify-clip.png" alt="" width="15" height="11"></a></div>%s</div></div>' % \
+ ((intwidth + 2),
+ self.html_base % {'lang': self.lang} + arg,
+ '',
+ self.image_base + '/' + \
+ urllib.quote (tgt) + \
+ '/' + width + '-' + urllib.quote (tgt),
+ self.html_base % {'lang': self.lang} + arg,
+ caption
+ )
elif ns == 'NS_MEDIA':
tgt = self.media_base + '/' + tgt
else:

Return to:

Send suggestions and report system problems to the System administrator.