예제 #1
0
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')
예제 #2
0
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)
예제 #3
0
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'
    )
예제 #4
0
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'
    )
예제 #5
0
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'
    )
예제 #6
0
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)
예제 #8
0
def importSCSSRegistry(context):
    """
    Import SCSS registry
    """
    return importResRegistry(context, _REG_ID, _REG_TITLE, _FILENAME)