Search in sources :

Example 1 with CustomJSComponent

use of org.olat.core.gui.components.htmlheader.jscss.CustomJSComponent in project OpenOLAT by OpenOLAT.

the class BaseFullWebappController method addThemeJS.

/**
 * adds the theme custom js-code to the mainVc
 */
private void addThemeJS() {
    Theme currentTheme = getWindowControl().getWindowBackOffice().getWindow().getGuiTheme();
    if (currentTheme.hasCustomJS()) {
        String relPath = currentTheme.getRelPathToCustomJS();
        CustomJSComponent customJS = new CustomJSComponent("customThemejs", new String[] { relPath });
        if (isLogDebugEnabled()) {
            logDebug("injecting custom javascript from current OLAT-Theme", relPath);
        }
        // no need to wrap in panel, will never change
        mainVc.put(customJS.getComponentName(), customJS);
    }
}
Also used : Theme(org.olat.core.gui.themes.Theme) CustomJSComponent(org.olat.core.gui.components.htmlheader.jscss.CustomJSComponent)

Example 2 with CustomJSComponent

use of org.olat.core.gui.components.htmlheader.jscss.CustomJSComponent in project openolat by klemens.

the class BaseFullWebappController method addThemeJS.

/**
 * adds the theme custom js-code to the mainVc
 */
private void addThemeJS() {
    Theme currentTheme = getWindowControl().getWindowBackOffice().getWindow().getGuiTheme();
    if (currentTheme.hasCustomJS()) {
        String relPath = currentTheme.getRelPathToCustomJS();
        CustomJSComponent customJS = new CustomJSComponent("customThemejs", new String[] { relPath });
        if (isLogDebugEnabled()) {
            logDebug("injecting custom javascript from current OLAT-Theme", relPath);
        }
        // no need to wrap in panel, will never change
        mainVc.put(customJS.getComponentName(), customJS);
    }
}
Also used : Theme(org.olat.core.gui.themes.Theme) CustomJSComponent(org.olat.core.gui.components.htmlheader.jscss.CustomJSComponent)

Aggregations

CustomJSComponent (org.olat.core.gui.components.htmlheader.jscss.CustomJSComponent)2 Theme (org.olat.core.gui.themes.Theme)2