Mercurial > hg > documentViewer
changeset 74:5c9837484085
marks
author | dwinter |
---|---|
date | Tue, 04 Nov 2008 21:36:51 +0100 |
parents | 0f534c12cc9e |
children | 9673218e155b |
files | documentViewer.py zpt/image_main.zpt zpt/viewer_main.zpt |
diffstat | 3 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/documentViewer.py Tue Nov 04 21:23:49 2008 +0100 +++ b/documentViewer.py Tue Nov 04 21:36:51 2008 +0100 @@ -139,7 +139,7 @@ return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode) security.declareProtected('View','index_html') - def index_html(self,mode,url,viewMode="auto",start=None,pn=1): + def index_html(self,mode,url,viewMode="auto",start=None,pn=1,mk=None): ''' view it @param mode: defines how to access the document behind url @@ -167,9 +167,14 @@ else: viewMode="images" - return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode) + return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,marks=self.generateMarks(mk)) - + def generateMarks(self,mk): + ret="" + for m in mk: + ret+="mk=%s"%mk + return ret + def getLink(self,param=None,val=None): """link to documentviewer with parameter param set to val""" params=self.REQUEST.form.copy()
--- a/zpt/image_main.zpt Tue Nov 04 21:23:49 2008 +0100 +++ b/zpt/image_main.zpt Tue Nov 04 21:36:51 2008 +0100 @@ -1,4 +1,4 @@ <tal:block tal:define="docinfo options/docinfo; pageinfo options/pageinfo; mode python:options.get('viewMode','images')"> - <iframe tal:condition="python:mode=='images'" height="100%" width="100%" tal:attributes="src string:${here/imageViewerUrl}fn=${docinfo/imagePath}&pn=${pageinfo/current}"/> + <iframe tal:condition="python:mode=='images'" height="100%" width="100%" tal:attributes="src string:${here/imageViewerUrl}fn=${docinfo/imagePath}&pn=${pageinfo/current}${options/marks}"/> <iframe tal:condition="python:mode=='text'" height="100%" width="100%" tal:attributes="src string:${here/textViewerUrl}fn=${docinfo/textURL}&pn=${pageinfo/current}&lang=${docinfo/lang}"/> </tal:block>
--- a/zpt/viewer_main.zpt Tue Nov 04 21:23:49 2008 +0100 +++ b/zpt/viewer_main.zpt Tue Nov 04 21:36:51 2008 +0100 @@ -12,7 +12,7 @@ <tal:block replace="structure python:here.template.thumbs_main(docinfo=docinfo,pageinfo=pageinfo)" /> </td> <td width="100%" valign="top"> - <tal:block tal:content="structure python:here.template.image_main(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode)" /> + <tal:block tal:content="structure python:here.template.image_main(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=mk)" /> </td> </tr> </table>