def resetJSRegistry(context): """Remove all resources from the JavaScript registry and add them from osha-jsregistry.xml""" portal = context.getSite() js_reg = portal.portal_javascripts js_reg.clearResources() return importResRegistry(context, 'portal_javascripts', 'OSHA Javascript registry', 'osha-jsregistry.xml')
def importBBBJSRegistry(context): """ Import deprecated javascript registry storage. Useful to clear or otherwise manage the pre-registry resource registration method. """ with overrideJSRegistryNodeAdapter(): return resourceregistry.importResRegistry( context, jsregistry._REG_ID, JS_REG_TITLE, JS_FILENAME)
def resetCSSRegistry(context): """Remove all resources from the Css registry and add them from cssregistry.xml """ portal = context.getSite() portal_css = getToolByName(portal, 'portal_css') portal_css.clearResources() return importResRegistry( context, 'portal_css', 'OSHA Css registry', 'cssregistry.xml' )
def reset_js_registry(context): """Remove all resources from the JavaScript registry and add them from jsregistry.xml. """ if context.readDataFile('tribuna.policy.setup_various.txt') is None: # Not our add-on return portal_js = api.portal.get_tool('portal_javascripts') portal_js.clearResources() return importResRegistry( context, 'portal_javascripts', 'Tribuna Javascript registry', 'jsregistry.xml' )
def reset_css_registry(context): """Remove all resources from the CSS registry and add them from cssregistry.xml. """ if context.readDataFile('tribuna.policy.setup_various.txt') is None: # Not our add-on return portal_css = api.portal.get_tool('portal_css') portal_css.clearResources() return importResRegistry( context, 'portal_css', 'Tribuna CSS registry', 'cssregistry.xml' )
def importSCSSRegistry(context): """ Import SCSS registry """ return importResRegistry(context, _REG_ID, _REG_TITLE, _FILENAME)
def importCoffeeRegistry(context): """ Import coffeescript registry. """ return importResRegistry(context, _REG_ID, _REG_TITLE, _FILENAME)