Mercurial > hg > documentViewer
diff documentViewer.py @ 585:83eeed69793f
new annotator layer for images.
author | casties |
---|---|
date | Tue, 13 Nov 2012 17:33:34 +0100 |
parents | 011905457a5f |
children | 6000c7e24d8a |
line wrap: on
line diff
--- 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()