# HG changeset patch # User casties # Date 1350575589 -7200 # Node ID 9251719154a35ebc7e5fa10db7156544c5282a44 # Parent b2c7e272e0752b54b7b817d4bce4151291f8696f toc with list of handwritten notes. diff -r b2c7e272e075 -r 9251719154a3 MpiwgXmlTextServer.py --- a/MpiwgXmlTextServer.py Wed Oct 17 16:36:13 2012 +0200 +++ b/MpiwgXmlTextServer.py Thu Oct 18 17:53:09 2012 +0200 @@ -159,7 +159,6 @@ pages[pn] = page docinfo['pageNumbers'] = pages - logging.debug("got pageNumbers=%s"%repr(pages)) # toc elif lt == 'toc' or lt == 'figures' or lt == 'handwritten': @@ -295,6 +294,11 @@ if punditMode: self._addPunditAttributes(pagediv, pageinfo, docinfo) + + # TODO: move empty page text + ep = dom.find(".//div[@class='emptyPage']") + if ep is not None: + pagediv.append(ep) s = serialize(pagediv) logging.debug("getTextPage done in %s"%(datetime.now()-startTime)) @@ -544,18 +548,11 @@ if start is None: start = (pn - 1) * size - #fullresult = ET.fromstring(resultxml) - #fullresult = resultxml - #logging.debug("resultxml=%s"%repr(resultxml)) - if resultxml is not None: # paginate first = start-1 last = first+size tocdivs = resultxml[first:last] - #del fullresult[:first] - #del fullresult[len:] - #tocdivs = fullresult toc = ET.Element('div', attrib={'class':'queryResultPage'}) for div in tocdivs: @@ -620,6 +617,7 @@ last = first + size tocs = fulltoc[first:last] tp = '
' + label = {'figures': 'Figure', 'handwritten': 'Handwritten note'}.get(mode, 'Item') for toc in tocs: pageurl = self.getLink('pn', toc['pn']) tp += '
' @@ -627,7 +625,7 @@ if content: tp += '
[%s] %s
'%(toc['level-string'], toc['content']) else: - tp += '
[Figure %s]
'%(toc['level-string']) + tp += '
[%s %s]
'%(label, toc['level-string']) if toc.get('no', None): tp += ''%(pageurl, toc['pn'], toc['no']) @@ -658,8 +656,7 @@ return pt() def manage_addMpiwgXmlTextServer(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/interface/",timeout=40,RESPONSE=None): -#def manage_addMpiwgXmlTextServer(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de:30030/mpdl/interface/",timeout=40,RESPONSE=None): - """add zogiimage""" + """add MpiwgXmlTextServer""" newObj = MpiwgXmlTextServer(id=id,title=title,serverUrl=serverUrl,timeout=timeout) self.Destination()._setObject(id, newObj) if RESPONSE is not None: diff -r b2c7e272e075 -r 9251719154a3 css/docuviewer.css --- a/css/docuviewer.css Wed Oct 17 16:36:13 2012 +0200 +++ b/css/docuviewer.css Thu Oct 18 17:53:09 2012 +0200 @@ -98,7 +98,7 @@ -o-transform: rotate(270deg); -o-transform-origin: top left; left: 7px; - top: 32em; + top: 34em; width: 40em; padding: 0px; } @@ -268,27 +268,6 @@ margin-top: 0.5em; margin-bottom: 0.25em; } -/* normalization forms * -div.col.main div.content.text div.text.orig span.w span.reg, -div.col.main div.content.text div.text.orig span.w span.norm { - display: none; -} -div.col.main div.content.text div.text.reg span.w span.orig, -div.col.main div.content.text div.text.reg span.w span.norm { - display: none; -} -div.col.main div.content.text div.text.norm span.w span.orig, -div.col.main div.content.text div.text.norm span.w span.reg { - display: none; -} -/* dictionary forms * -div.col.main div.content.text div.text.plain span.w a.dictionary { - display: none; -} -div.col.main div.content.text div.text.dict span.w span.nodictionary { - display: none; -} -*/ /* page break */ div.col.main div.content.text span.pb span.n, div.col.main div.content.text span.pb span.o { @@ -314,6 +293,20 @@ /* font-size: 70%; vertical-align: super; */ } +/* handwritten */ +div.col.main div.content.text span.handwritten { + display: block; + /* float: left; */ + margin-top: 0.5em; + margin-bottom: 0.5em; + padding: 5px; + border: 1px dashed silver; +} +div.col.main div.content.text span.handwritten span.figureNum { + display: none; + /* font-size: 70%; + vertical-align: super; */ +} /* figure */ div.col.main div.content.text span.figure { display: block; diff -r b2c7e272e075 -r 9251719154a3 documentViewer.py --- a/documentViewer.py Wed Oct 17 16:36:13 2012 +0200 +++ b/documentViewer.py Thu Oct 18 17:53:09 2012 +0200 @@ -149,6 +149,7 @@ toc_text = PageTemplateFile('zpt/toc_text', globals()) toc_figures = PageTemplateFile('zpt/toc_figures', globals()) toc_concordance = PageTemplateFile('zpt/toc_concordance', globals()) + toc_handwritten = PageTemplateFile('zpt/toc_handwritten', globals()) toc_none = PageTemplateFile('zpt/toc_none', globals()) # other templates common_template = PageTemplateFile('zpt/common_template', globals()) diff -r b2c7e272e075 -r 9251719154a3 zpt/common_template.zpt --- a/zpt/common_template.zpt Wed Oct 17 16:36:13 2012 +0200 +++ b/zpt/common_template.zpt Thu Oct 18 17:53:09 2012 +0200 @@ -112,6 +112,9 @@
  • Concordance
  • +
  • Notes
  • Figures
  • diff -r b2c7e272e075 -r 9251719154a3 zpt/toc_handwritten.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/toc_handwritten.zpt Thu Oct 18 17:53:09 2012 +0200 @@ -0,0 +1,27 @@ + + + + + + +
    +
    + +
    +

    Table of handwritten notes

    +
    + +
    +
    +
    + +
    +
    +
    + + +