--- documentViewer/MpdlXmlTextServer.py 2010/06/18 14:08:46 1.5 +++ documentViewer/MpdlXmlTextServer.py 2010/08/11 10:17:46 1.7 @@ -96,7 +96,7 @@ class MpdlXmlTextServer(SimpleItem): hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_lemma_New'%(selfurl)) l.setAttributeNS(None, 'target', '_blank') l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;") - l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') + l.setAttributeNS(None, 'onClick', 'popupWin.focus();') pagedivs = pagedom.xpath("//div[@class='queryResultMorphExpansion']") return serializeNode(pagenode) if (queryType=="ftIndex")or(queryType=="ftIndexMorph"): @@ -113,12 +113,12 @@ class MpdlXmlTextServer(SimpleItem): hrefNode.nodeValue = href.replace('../lt/lex.xql','%s/template/head_main_voc'%selfurl) l.setAttributeNS(None, 'target', '_blank') l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;") - l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') + l.setAttributeNS(None, 'onClick', 'popupWin.focus();') if href.startswith('../lt/lemma.xql'): hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_lemma'%selfurl) l.setAttributeNS(None, 'target', '_blank') l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;") - l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') + l.setAttributeNS(None, 'onClick', 'popupWin.focus();') return serializeNode(pagenode) return "no text here" @@ -176,6 +176,13 @@ class MpdlXmlTextServer(SimpleItem): if len(pagedivs) > 0: pagenode = pagedivs[0] return serializeNode(pagenode) + if mode == "gis": + # first div contains text + pagedivs = pagedom.xpath("/div") + if len(pagedivs) > 0: + pagenode = pagedivs[0] + return serializeNode(pagenode) + if mode == "pureXml": # first div contains text pagedivs = pagedom.xpath("/div") @@ -203,13 +210,13 @@ class MpdlXmlTextServer(SimpleItem): # add target l.setAttributeNS(None, 'target', '_blank') l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=700, scrollbars=1'); return false;") - l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') + l.setAttributeNS(None, 'onClick', 'popupWin.focus();') if href.startswith('lt/lemma.xql'): selfurl = self.absolute_url() hrefNode.nodeValue = href.replace('lt/lemma.xql','%s/template/head_main_lemma'%selfurl) l.setAttributeNS(None, 'target', '_blank') l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=700, scrollbars=1'); return false;") - l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') + l.setAttributeNS(None, 'onClick', 'popupWin.focus();') if href.startswith('#note-'): hrefNode.nodeValue = href.replace('#note-',"?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s#note-"%(url,viewMode,tocMode,tocPN,pn)) return serializeNode(pagenode)