# $Id$ # $URL$ websiteConfig = configs[ 'website'] availabilityConfig = configs['availability'] drilldownConfig = configs['drilldown'] def readJavascriptConfig(): # BE AWARE The python configread converts all keys to lowercase! sysconfig = {} sysconfig ['minCoverWidth'] = int (websiteConfig.get('minCoverWidth' , section = 'behavior', default="16")) collectionList = {} sysconfig ['depotCollectionList'] = availabilityConfig.getList('collectionList', section = 'collections' ) sysconfig ['depotExceptionList'] = availabilityConfig.getList('exceptionList', section = 'collections' ) sysconfig ['pub'] = websiteConfig.getSectionDict(section = 'publishers') sysconfig ['translateHash'] = websiteConfig.getSectionDict(section = 'javascriptTranslationTable') sysconfig ['availabilityGroups'] = websiteConfig.getSectionDict(section = 'javascriptAvailabilityGroups') sysconfig ['translateHash' ] ['less'] = drilldownConfig.get('less', section = 'facets') sysconfigJSON = dumps(sysconfig) # any.spit(sysconfig) return base64.b64encode(sysconfigJSON) def main(*args, **kwargs): # sysconfig = base64.b64encode('{"productId":12345678,"price":24.5,"inStock":true,"bananas":null}') sysconfig = readJavascriptConfig() yield """ """ yield """%s""" % websiteConfig.get('applicationName',section='userFeedback', default='Beter Zoeken en Vinden') yield """ """ % { 'sysconfig':sysconfig } useHighSlide = websiteConfig.get('useHighSlide', section='behavior') if (useHighSlide == 'True'): yield """ """ yield """""" # The onLoad-javascript 'document.forms[0].query.focus()' points to # an input field with 'name=query' inside a form with 'name="searchForm' yield """ """ yield """
""" yield """
"""