Search in sources :

Example 1 with JavaScriptLibrarySettings

use of org.apache.wicket.settings.JavaScriptLibrarySettings in project wicket by apache.

the class CoreLibrariesContributor method contribute.

/**
 * Contributes the backing library plus the implementation of Wicket.Event.
 *
 * @param application
 *            the application instance
 * @param response
 *            the current header response
 */
public static void contribute(final Application application, final IHeaderResponse response) {
    JavaScriptLibrarySettings jsLibrarySettings = application.getJavaScriptLibrarySettings();
    ResourceReference wicketAjaxReference = jsLibrarySettings.getWicketAjaxReference();
    response.render(JavaScriptHeaderItem.forReference(wicketAjaxReference));
}
Also used : JavaScriptLibrarySettings(org.apache.wicket.settings.JavaScriptLibrarySettings) ResourceReference(org.apache.wicket.request.resource.ResourceReference)

Example 2 with JavaScriptLibrarySettings

use of org.apache.wicket.settings.JavaScriptLibrarySettings in project wicket by apache.

the class OnDomReadyHeaderItem method getDependencies.

@Override
public List<HeaderItem> getDependencies() {
    JavaScriptLibrarySettings ajaxSettings = Application.get().getJavaScriptLibrarySettings();
    ResourceReference wicketAjaxReference = ajaxSettings.getWicketAjaxReference();
    List<HeaderItem> dependencies = super.getDependencies();
    dependencies.add(JavaScriptHeaderItem.forReference(wicketAjaxReference));
    return dependencies;
}
Also used : JavaScriptLibrarySettings(org.apache.wicket.settings.JavaScriptLibrarySettings) ResourceReference(org.apache.wicket.request.resource.ResourceReference)

Example 3 with JavaScriptLibrarySettings

use of org.apache.wicket.settings.JavaScriptLibrarySettings in project wicket by apache.

the class CoreLibrariesContributor method contributeAjax.

/**
 * Contributes the Ajax backing library plus wicket-event.js and wicket-ajax.js implementations.
 * Additionally if Ajax debug is enabled then wicket-ajax-debug.js implementation is also added.
 *
 * @param application
 *            the application instance
 * @param response
 *            the current header response
 */
public static void contributeAjax(final Application application, final IHeaderResponse response) {
    JavaScriptLibrarySettings jsLibrarySettings = application.getJavaScriptLibrarySettings();
    final DebugSettings debugSettings = application.getDebugSettings();
    if (debugSettings.isAjaxDebugModeEnabled()) {
        response.render(JavaScriptHeaderItem.forReference(jsLibrarySettings.getWicketAjaxDebugReference()));
        response.render(JavaScriptHeaderItem.forScript("Wicket.Ajax.DebugWindow.enabled=true;", "wicket-ajax-debug-enable"));
    } else {
        ResourceReference wicketAjaxReference = jsLibrarySettings.getWicketAjaxReference();
        response.render(JavaScriptHeaderItem.forReference(wicketAjaxReference));
    }
}
Also used : DebugSettings(org.apache.wicket.settings.DebugSettings) JavaScriptLibrarySettings(org.apache.wicket.settings.JavaScriptLibrarySettings) ResourceReference(org.apache.wicket.request.resource.ResourceReference)

Example 4 with JavaScriptLibrarySettings

use of org.apache.wicket.settings.JavaScriptLibrarySettings in project wicket by apache.

the class OnEventHeaderItem method getDependencies.

@Override
public List<HeaderItem> getDependencies() {
    JavaScriptLibrarySettings ajaxSettings = Application.get().getJavaScriptLibrarySettings();
    ResourceReference wicketAjaxReference = ajaxSettings.getWicketAjaxReference();
    List<HeaderItem> dependencies = super.getDependencies();
    dependencies.add(JavaScriptHeaderItem.forReference(wicketAjaxReference));
    return dependencies;
}
Also used : JavaScriptLibrarySettings(org.apache.wicket.settings.JavaScriptLibrarySettings) ResourceReference(org.apache.wicket.request.resource.ResourceReference)

Example 5 with JavaScriptLibrarySettings

use of org.apache.wicket.settings.JavaScriptLibrarySettings in project wicket by apache.

the class OnLoadHeaderItem method getDependencies.

@Override
public List<HeaderItem> getDependencies() {
    JavaScriptLibrarySettings ajaxSettings = Application.get().getJavaScriptLibrarySettings();
    ResourceReference wicketAjaxReference = ajaxSettings.getWicketAjaxReference();
    List<HeaderItem> dependencies = super.getDependencies();
    dependencies.add(JavaScriptHeaderItem.forReference(wicketAjaxReference));
    return dependencies;
}
Also used : JavaScriptLibrarySettings(org.apache.wicket.settings.JavaScriptLibrarySettings) ResourceReference(org.apache.wicket.request.resource.ResourceReference)

Aggregations

ResourceReference (org.apache.wicket.request.resource.ResourceReference)5 JavaScriptLibrarySettings (org.apache.wicket.settings.JavaScriptLibrarySettings)5 DebugSettings (org.apache.wicket.settings.DebugSettings)1