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

The following examples show how to use de.agilecoders.wicket.webjars.request.resource.WebjarsCssResourceReference. 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: MarkdownResourceReference.java    From onedev with MIT License 6 votes vote down vote up
@Override
public List<HeaderItem> getDependencies() {
	List<HeaderItem> dependencies = super.getDependencies();
	dependencies.add(JavaScriptHeaderItem.forReference(new CaretResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new AtWhoResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new CodeMirrorResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new TextareaCaretPositionResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new DoneEventsResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new CookiesResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new HotkeysResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new JQueryUIResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new HoverResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new PerfectScrollbarResourceReference()));
	dependencies.add(CssHeaderItem.forReference(new CommitStatusCssResourceReference()));

	dependencies.add(CssHeaderItem.forReference(
			new BaseDependentCssResourceReference(MarkdownResourceReference.class, "markdown.css")));
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/theme/eclipse.css")));
	return dependencies;
}
 
Example #2
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 #3
Source File: DashboardMenu.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(CssHeaderItem
            .forReference(new WebjarsCssResourceReference("hover/current/css/hover.css")));
}
 
Example #4
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 #5
Source File: TextDiffResourceReference.java    From onedev with MIT License 5 votes vote down vote up
@Override
public List<HeaderItem> getDependencies() {
	List<HeaderItem> dependencies = super.getDependencies();
	dependencies.add(JavaScriptHeaderItem.forReference(new HoverResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new SelectionPopoverResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new ClipboardResourceReference()));
	dependencies.add(JavaScriptHeaderItem.forReference(new ScrollIntoViewResourceReference()));
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference("codemirror/current/theme/eclipse.css")));
	dependencies.add(CssHeaderItem.forReference(new CssResourceReference(TextDiffPanel.class, "text-diff.css")));
	return dependencies;
}
 
Example #6
Source File: FontExtResourceReference.java    From onedev with MIT License 5 votes vote down vote up
@Override
public List<HeaderItem> getDependencies() {
	List<HeaderItem> dependencies = super.getDependencies();
	dependencies.add(CssHeaderItem.forReference(new WebjarsCssResourceReference(
			"font-awesome/current/css/font-awesome.min.css")));
	return dependencies;
}
 
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;
}
 
Example #8
Source File: BratAnnotationEditor.java    From webanno with Apache License 2.0 4 votes vote down vote up
@Override
public void renderHead(IHeaderResponse aResponse)
{
    super.renderHead(aResponse);

    // CSS
    aResponse.render(CssHeaderItem.forReference(BratCssVisReference.get()));
    aResponse.render(CssHeaderItem.forReference(BratCssUiReference.get()));
    aResponse.render(CssHeaderItem
            .forReference(new WebjarsCssResourceReference("animate.css/current/animate.css")));
            
    // Libraries
    aResponse.render(forReference(JQueryUILibrarySettings.get().getJavaScriptReference()));
    aResponse.render(forReference(JQuerySvgResourceReference.get()));
    aResponse.render(forReference(JQuerySvgDomResourceReference.get()));
    aResponse.render(forReference(JQueryJsonResourceReference.get()));
    aResponse.render(forReference(JQueryScrollbarWidthReference.get()));
    aResponse.render(forReference(JSONPatchResourceReference.get()));
    
    // BRAT helpers
    aResponse.render(forReference(BratConfigurationResourceReference.get()));
    aResponse.render(forReference(BratUtilResourceReference.get()));
    // aResponse.render(
    //    JavaScriptHeaderItem.forReference(BratAnnotationLogResourceReference.get()));
    
    // BRAT modules
    aResponse.render(forReference(BratDispatcherResourceReference.get()));
    aResponse.render(forReference(BratAjaxResourceReference.get()));
    aResponse.render(forReference(BratVisualizerResourceReference.get()));
    aResponse.render(forReference(BratVisualizerUiResourceReference.get()));
    aResponse.render(forReference(BratAnnotatorUiResourceReference.get()));
    // aResponse.render(
    //     JavaScriptHeaderItem.forReference(BratUrlMonitorResourceReference.get()));
    
    // When the page is re-loaded or when the component is added to the page, we need to 
    // initialize the brat stuff.
    StringBuilder js = new StringBuilder();
    js.append(bratInitCommand());
    js.append(bratLoadCollectionCommand());
    Optional<AjaxRequestTarget> target = RequestCycle.get().find(AjaxRequestTarget.class);
    if (!target.isPresent() && getModelObject().getProject() != null) {
        // If a document is already open, we also need to render the document. To avoid carrying
        // the data JSON around in the document header, we trigger brat to load the JSON in a
        // separate request
        js.append(bratRenderLaterCommand());
    }
    aResponse.render(OnDomReadyHeaderItem.forScript(js));
}