de.agilecoders.wicket.webjars.request.resource.WebjarsJavaScriptResourceReference Java Examples

The following examples show how to use de.agilecoders.wicket.webjars.request.resource.WebjarsJavaScriptResourceReference. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChartPanel.java    From inception with Apache License 2.0 5 votes vote down vote up
@Override
public void renderHead(IHeaderResponse aResponse)
{
    super.renderHead(aResponse);

    // import Js
    aResponse.render(JavaScriptHeaderItem
            .forReference(new WebjarsJavaScriptResourceReference("c3/current/c3.js")));
    aResponse.render(JavaScriptHeaderItem
            .forReference(new WebjarsJavaScriptResourceReference("d3js/current/d3.js")));

    // import Css
    aResponse.render(
            CssHeaderItem.forReference(new WebjarsCssResourceReference("c3/current/c3.css")));

    aResponse.render(JavaScriptReferenceHeaderItem.forReference(
            getApplication().getJavaScriptLibrarySettings().getJQueryReference()));

    aResponse.render(JavaScriptHeaderItem.forReference(ChartJsReference.get()));
    
    String chartTriggerJavascript = String.join("\n",
            "$(document).ready(function(){", 
            "   $.ajax({",
            "       url:'" + chartAjaxBejavior.getCallbackUrl().toString() + "',",
            "       type:'post',",
            "       contentType:'application/json',",
            "       dataType:'json',",
            "       success : function(result){",
            "           updateLearningCurveDiagram(result)",
            "       }",
            "   })",
            "})");

    aResponse.render(JavaScriptContentHeaderItem.forScript(chartTriggerJavascript, null));
}
 
Example #2
Source File: TutorialFooterPanel.java    From inception with Apache License 2.0 5 votes vote down vote up
@Override
    public void renderHead(IHeaderResponse aResponse) {
        aResponse.render(JavaScriptHeaderItem.forReference(WebAnnoJavascriptReference.get()));
        
        //TODO move it back to web jars after latest release
        aResponse.render(JavaScriptHeaderItem.forReference(EnjoyHintJsReference.get()));
//        aResponse.render(JavaScriptHeaderItem
//                .forReference(new WebjarsJavaScriptResourceReference("enjoyhint/current/enjoyhint.js")));

        // Loading resources for the tour guide feature for the new users
        aResponse.render(JavaScriptHeaderItem.forReference(
                new WebjarsJavaScriptResourceReference("enjoyhint/current/jquery.enjoyhint.js")));
        aResponse.render(CssHeaderItem.forReference(
                new WebjarsCssResourceReference("enjoyhint/current/jquery.enjoyhint.css")));
        aResponse.render(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference(
                "jquery.scrollTo/current/jquery.scrollTo.js")));
        aResponse.render(JavaScriptHeaderItem.forReference(
                new WebjarsJavaScriptResourceReference("kinetic/current/kinetic.min.js")));

        aResponse.render(JavaScriptHeaderItem.forReference(TutorialJavascriptReference.get()));
        // add top-margin to next button to fix label and buttons overlapping
        aResponse.render(CssHeaderItem.forCSS(
                ".enjoyhint_next_btn{\n" +
                "  margin-top: 8px;\n" +
                "}",
                "enjoyhint"));
        // check if the tutorial will need to be run
        aResponse.render(OnLoadHeaderItem
                .forScript("setContextPath('" + context.getContextPath() + "');\n" +
                           "runRoutines();"));
    }
 
Example #3
Source File: ImageSidebar.java    From inception with Apache License 2.0 5 votes vote down vote up
@Override
public void renderHead(IHeaderResponse aResponse)
{
    super.renderHead(aResponse);
    
    aResponse.render(JavaScriptHeaderItem.forReference(
            new WebjarsJavaScriptResourceReference("color-thief/current/js/color-thief.js")));
    aResponse.render(OnDomReadyHeaderItem.forScript(colorScript()));
}
 
Example #4
Source File: ModeUrlResourceReference.java    From onedev with MIT License 5 votes vote down vote up
@Override
public List<HeaderItem> getDependencies() {
	List<HeaderItem> dependencies = super.getDependencies();
	WebjarsJavaScriptResourceReference metaReference = new WebjarsJavaScriptResourceReference("codemirror/current/mode/meta.js");
	String modeBase = StringUtils.substringBeforeLast(RequestCycle.get().urlFor(metaReference, new PageParameters()).toString(), "/");
	dependencies.add(OnDomReadyHeaderItem.forScript("CodeMirror.modeURL = '" + modeBase + "/%N/%N.js';"));		
	return dependencies;
}
 
Example #5
Source File: BasePage.java    From wicket-spring-boot with Apache License 2.0 5 votes vote down vote up
@Override
public void renderHead(IHeaderResponse response) {
	super.renderHead(response);
	
	response.render(JavaScriptHeaderItem.forReference(getApplication().getJavaScriptLibrarySettings().getJQueryReference()));
	response.render(JavaScriptHeaderItem.forReference(getApplication().getJavaScriptLibrarySettings().getWicketEventReference()));
	response.render(JavaScriptHeaderItem.forReference(getApplication().getJavaScriptLibrarySettings().getWicketAjaxReference()));
	
	String bootstrapPrefixPath = "bootstrap/current";
	response.render(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference(bootstrapPrefixPath + "/js/bootstrap.js")));
	response.render(CssHeaderItem.forReference(new WebjarsJavaScriptResourceReference(bootstrapPrefixPath + "/css/bootstrap.css")));
}
 
Example #6
Source File: BasePage.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
private void addBootstrapDatepicker(IHeaderResponse response) {
	response.render(CssHeaderItem.forReference(BOOTSTRAP_DATE_PICKER_CSS));
	response.render(JavaScriptHeaderItem.forReference(BOOTSTRAP_DATE_PICKER_JS));
	String language = getLocale().getLanguage();
	if (!language.equals(Locale.ENGLISH.getLanguage())) {
		response.render(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference(
				String.format(BOOTSTRAP_DATEPICKER_LOCALE, language))));
	}
}
 
Example #7
Source File: CodeMirrorResourceReference.java    From onedev with MIT License 4 votes vote down vote up
@Override
public List<HeaderItem> getDependencies() {
	List<HeaderItem> dependencies = super.getDependencies();
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/lib/codemirror.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/mode/overlay.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/mode/simple.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/mode/multiplex.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/edit/matchbrackets.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/dialog/dialog.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/fold/foldcode.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/fold/foldgutter.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/fold/brace-fold.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/fold/xml-fold.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/fold/markdown-fold.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/fold/comment-fold.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/search/searchcursor.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/search/search.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/search/matchesonscrollbar.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new BaseDependentResourceReference(CodeMirrorResourceReference.class, "matchesonscrollbar2.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/selection/active-line.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/scroll/annotatescrollbar.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/display/fullscreen.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/selection/mark-selection.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/addon/hint/show-hint.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new BaseDependentResourceReference(CodeMirrorResourceReference.class, "annotatescrollbar2.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new BaseDependentResourceReference(CodeMirrorResourceReference.class, "simplescrollbars.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new BaseDependentResourceReference(CodeMirrorResourceReference.class, "gotoline.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new BaseDependentResourceReference(CodeMirrorResourceReference.class, "identifier-highlighter.js"))); 
	dependencies.add(JavaScriptHeaderItem.forReference(new BaseDependentResourceReference(CodeMirrorResourceReference.class, "loadmode.js"))); 
	dependencies.add(JavaScriptHeaderItem.forReference(new WebjarsJavaScriptResourceReference("codemirror/current/mode/meta.js")));
	dependencies.add(JavaScriptHeaderItem.forReference(new ModeUrlResourceReference()));
	
	dependencies.add(JavaScriptHeaderItem.forReference(new HotkeysResourceReference()));
	
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/lib/codemirror.css")));
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/theme/eclipse.css")));
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/addon/dialog/dialog.css")));
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/addon/fold/foldgutter.css")));
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/addon/scroll/simplescrollbars.css")));
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/addon/search/matchesonscrollbar.css")));
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/addon/display/fullscreen.css")));
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/addon/hint/show-hint.css")));
	dependencies.add(CssHeaderItem.forReference(new BaseDependentCssResourceReference(CodeMirrorResourceReference.class, "codemirror.css")));

	return dependencies;
}