# HG changeset patch # User casties # Date 1352824414 -3600 # Node ID 83eeed69793f3cfb882a28858fcda7965f4a7ee5 # Parent 011905457a5f7549ed294d3b2905927eced570c0 new annotator layer for images. diff -r 011905457a5f -r 83eeed69793f SrvTxtUtils.py --- a/SrvTxtUtils.py Mon Nov 12 18:13:33 2012 +0100 +++ b/SrvTxtUtils.py Tue Nov 13 17:33:34 2012 +0100 @@ -11,7 +11,7 @@ import logging -srvTxtUtilsVersion = "1.5.1" +srvTxtUtilsVersion = "1.6" def getInt(number, default=0): """returns always an int (0 in case of problems)""" @@ -132,3 +132,32 @@ # call original method return ImageFile.index_html(self, REQUEST, RESPONSE) + +def getBrowserType(self): + """check the browsers request to find out the browser type""" + bt = {} + ua = self.REQUEST.get_header("HTTP_USER_AGENT") + bt['ua'] = ua + bt['isIE'] = False + bt['isN4'] = False + if string.find(ua, 'MSIE') > -1: + bt['isIE'] = True + else: + bt['isN4'] = (string.find(ua, 'Mozilla/4.') > -1) + + try: + nav = ua[string.find(ua, '('):] + ie = string.split(nav, "; ")[1] + if string.find(ie, "MSIE") > -1: + bt['versIE'] = string.split(ie, " ")[1] + except: pass + + bt['isMac'] = string.find(ua, 'Macintosh') > -1 + bt['isWin'] = string.find(ua, 'Windows') > -1 + bt['isIEWin'] = bt['isIE'] and bt['isWin'] + bt['isIEMac'] = bt['isIE'] and bt['isMac'] + bt['staticHTML'] = False + + return bt + + diff -r 011905457a5f -r 83eeed69793f documentViewer.py --- a/documentViewer.py Mon Nov 12 18:13:33 2012 +0100 +++ b/documentViewer.py Tue Nov 13 17:33:34 2012 +0100 @@ -40,67 +40,6 @@ return node -def browserCheck(self): - """check the browsers request to find out the browser type""" - bt = {} - ua = self.REQUEST.get_header("HTTP_USER_AGENT") - bt['ua'] = ua - bt['isIE'] = False - bt['isN4'] = False - bt['versFirefox']="" - bt['versIE']="" - bt['versSafariChrome']="" - bt['versOpera']="" - - if string.find(ua, 'MSIE') > -1: - bt['isIE'] = True - else: - bt['isN4'] = (string.find(ua, 'Mozilla/4.') > -1) - # Safari oder Chrome identification - try: - nav = ua[string.find(ua, '('):] - nav1=ua[string.find(ua,')'):] - nav2=nav1[string.find(nav1,'('):] - nav3=nav2[string.find(nav2,')'):] - ie = string.split(nav, "; ")[1] - ie1 =string.split(nav1, " ")[2] - ie2 =string.split(nav3, " ")[1] - ie3 =string.split(nav3, " ")[2] - if string.find(ie3, "Safari") >-1: - bt['versSafariChrome']=string.split(ie2, "/")[1] - except: pass - # IE identification - try: - nav = ua[string.find(ua, '('):] - ie = string.split(nav, "; ")[1] - if string.find(ie, "MSIE") > -1: - bt['versIE'] = string.split(ie, " ")[1] - except:pass - # Firefox identification - try: - nav = ua[string.find(ua, '('):] - nav1=ua[string.find(ua,')'):] - if string.find(ie1, "Firefox") >-1: - nav5= string.split(ie1, "/")[1] - logging.debug("FIREFOX: %s"%(nav5)) - bt['versFirefox']=nav5[0:3] - except:pass - #Opera identification - try: - if string.find(ua,"Opera") >-1: - nav = ua[string.find(ua, '('):] - nav1=nav[string.find(nav,')'):] - bt['versOpera']=string.split(nav1,"/")[2] - except:pass - - bt['isMac'] = string.find(ua, 'Macintosh') > -1 - bt['isWin'] = string.find(ua, 'Windows') > -1 - bt['isIEWin'] = bt['isIE'] and bt['isWin'] - bt['isIEMac'] = bt['isIE'] and bt['isMac'] - bt['staticHTML'] = False - - return bt - def getParentPath(path, cnt=1): """returns pathname shortened by cnt""" # make sure path doesn't end with / @@ -108,6 +47,7 @@ # split by /, shorten, and reassemble return '/'.join(path.split('/')[0:-cnt]) + ## ## documentViewer class ## @@ -144,6 +84,7 @@ layer_text_annotator = PageTemplateFile('zpt/layer_text_annotator', globals()) layer_text_gis = PageTemplateFile('zpt/layer_text_gis', globals()) layer_text_pundit = PageTemplateFile('zpt/layer_text_pundit', globals()) + layer_images_annotator = PageTemplateFile('zpt/layer_images_annotator', globals()) layer_index_extended = PageTemplateFile('zpt/layer_index_extended', globals()) # toc templates toc_thumbs = PageTemplateFile('zpt/toc_thumbs', globals()) @@ -160,7 +101,7 @@ docuviewer_css.index_html = refreshingImageFileIndexHtml docuviewer_ie_css = ImageFile('css/docuviewer_ie.css',globals()) # make docuviewer_ie_css refreshable for development - docuviewer_ie_css.index_html = refreshingImageFileIndexHtml + #docuviewer_ie_css.index_html = refreshingImageFileIndexHtml jquery_js = ImageFile('js/jquery.js',globals()) @@ -346,12 +287,6 @@ """returns dict with list of available layers per viewMode""" return self.availableLayers - def getBrowser(self): - """getBrowser the version of browser """ - bt = browserCheck(self) - logging.debug("BROWSER VERSION: %s"%(bt)) - return bt - def findDigilibUrl(self): """try to get the digilib URL from zogilib""" url = self.template.zogilib.getDLBaseUrl() diff -r 011905457a5f -r 83eeed69793f zpt/layer_images_annotator.zpt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/layer_images_annotator.zpt Tue Nov 13 17:33:34 2012 +0100 @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + +
+ + +
+ + + +
+

Annotator

+ +

+ User "". +

+ +
+ +

+ In group +
+ +

+
+

+ log in +

+
+ +
+ + + + diff -r 011905457a5f -r 83eeed69793f zpt/viewer_images.zpt --- a/zpt/viewer_images.zpt Mon Nov 12 18:13:33 2012 +0100 +++ b/zpt/viewer_images.zpt Tue Nov 13 17:33:34 2012 +0100 @@ -2,6 +2,8 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> @@ -27,6 +29,13 @@ 'scalerInsets' : {'x':300, 'y':100}\n };\n'''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"> + + + + + + +