@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); if (getApplication().getConfigurationType() == RuntimeConfigurationType.DEPLOYMENT) { long startupTime = startupBean.getStartupTime(); String suffix = "?" + startupTime; response.render(JavaScriptHeaderItem.forUrl("static/all.js" + suffix)); response.render(CssHeaderItem.forUrl("static/all.css" + suffix)); } else { response.render(JavaScriptHeaderItem.forUrl("wro/lib.js")); response.render(CssHeaderItem.forUrl("wro/lib.css")); response.render(CssHeaderItem.forUrl("wro/app.css")); response.render(JavaScriptHeaderItem.forUrl("js/welcome.js")); response.render(JavaScriptHeaderItem.forUrl("js/main.js")); response.render(JavaScriptHeaderItem.forUrl("js/controllers.js")); response.render(JavaScriptHeaderItem.forUrl("js/directives.js")); response.render(JavaScriptHeaderItem.forUrl("js/filters.js")); response.render(JavaScriptHeaderItem.forUrl("js/services.js")); } if (StringUtils.isNotBlank(settings.getGoogleAnalyticsTrackingCode())) { Map<String, Object> vars = Maps.newHashMap(); vars.put("trackingCode", settings.getGoogleAnalyticsTrackingCode()); WicketUtils.loadJS(response, BasePage.class, "analytics", vars); } }
@Override public void renderHead(Component c, IHeaderResponse pResponse) { String script = getCallbackName() + " = function () { " + getCallbackScript() + " }"; pResponse.render(OnDomReadyHeaderItem.forScript(script)); pResponse.render(JavaScriptHeaderItem.forReference(IMAGE_UPLOAD_JS_RESOURCE)); pResponse.render(CssHeaderItem.forReference(IMAGE_UPLOAD_CSS_RESOURCE)); }
@Override public void renderHead(IHeaderResponse response) { ResourceReference jQueryReference = this.application.getJavaScriptLibrarySettings().getJQueryReference(); response.render(JavaScriptHeaderItem.forReference(jQueryReference)); response.render(JavaScriptHeaderItem.forUrl("js/bootstrap.js", "bootstrap-js")); }
@Override public void renderHead(Component component, IHeaderResponse headerResponse) { super.renderHead(component, headerResponse); headerResponse.render(JavaScriptHeaderItem.forReference(JS)); headerResponse.render(OnDomReadyHeaderItem.forScript(createScript(component))); }
@Override public void renderHead(IHeaderResponse response) { // includes jquery, required by the placeholder plugin (wicket only include jquery if he need // it) response.render( new PriorityHeaderItem( JavaScriptHeaderItem.forReference( getApplication().getJavaScriptLibrarySettings().getJQueryReference()))); List<HeaderContribution> cssContribs = getGeoServerApplication().getBeansOfType(HeaderContribution.class); for (HeaderContribution csscontrib : cssContribs) { try { if (csscontrib.appliesTo(this)) { PackageResourceReference ref = csscontrib.getCSS(); if (ref != null) { response.render(CssReferenceHeaderItem.forReference(ref)); } ref = csscontrib.getJavaScript(); if (ref != null) { response.render(JavaScriptHeaderItem.forReference(ref)); } ref = csscontrib.getFavicon(); } } catch (Throwable t) { LOGGER.log(Level.WARNING, "Problem adding header contribution", t); } } }
@Override public void renderHead(IHeaderResponse response) { response.render(JavaScriptHeaderItem.forReference(WidgetJavaScriptResourceReference.get())); response.render( JavaScriptHeaderItem.forReference(ProgressBarJavaScriptResourceReference.get())); response.render(OnDomReadyHeaderItem.forScript(statement().render())); }
@Override public void renderHead(Component c, IHeaderResponse response) { super.renderHead(c, response); // Don't pass an id, since every EditableComponent will have its own // submit script: response.render(JavaScriptHeaderItem.forScript(createSaveScript(), null)); response.render(JavaScriptHeaderItem.forScript(createCancelScript(), null)); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render( JavaScriptHeaderItem.forReference( new JavaScriptResourceReference(AddCommentPanel.class, "AddCommentPanel.js"))); response.render( CssHeaderItem.forReference( new CssResourceReference(CommentAndVotePanel.class, "CommentAndVotePanel.css"))); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render( CssHeaderItem.forReference( new CssResourceReference(ServiceActionsPanel.class, "ServiceActionsPanel.css"))); response.render( JavaScriptHeaderItem.forReference(DropdownAutoOpenJavaScriptReference.instance())); response.render(OnDomReadyHeaderItem.forScript("$('.dropdown-toggle').dropdownHover();")); }
@Override public void renderHead(final IHeaderResponse response) { super.renderHead(response); response.render(CssHeaderItem.forReference(CKEDITOR_PANEL_CSS)); response.render(JavaScriptUrlReferenceHeaderItem.forReference(getCKEditorJsReference())); response.render(JavaScriptUrlReferenceHeaderItem.forReference(CKEDITOR_PANEL_JS)); JSONObject editorConfig = getConfigurationForEditor(); renderContentsCss(response, editorConfig); response.render(OnDomReadyHeaderItem.forScript(getJavaScriptForEditor(editorConfig))); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); JavaScriptUrlReferenceHeaderItem item = new JavaScriptUrlReferenceHeaderItem( "http://cdn.ckeditor.com/4.5.9/full/ckeditor.js", "ckeditor", false, "UTF-8", ""); response.render(item); String javascript = "CKEDITOR.replace( '" + getMarkupId(true) + "', {toolbar: [[ 'Bold', 'Italic','Underline' ],['TextColor', 'BGColor','SpecialChar' ]]})"; response.render(OnDomReadyHeaderItem.forScript(javascript)); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); // We need carousel response.render(JavaScriptHeaderItem.forReference(OwlCarouselResourceReference.get())); // Add carousel Javascript PackageTextTemplate tt = new PackageTextTemplate(getClass(), "RecentGamesPanel.js"); HashMap<String, String> args = new HashMap<String, String>(); args.put("carouselId", carousel.getMarkupId()); response.render(OnDomReadyHeaderItem.forScript(tt.asString(args))); }
@Override public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); if (hasBeenRendered == false) { hasBeenRendered = true; response.render( OnDomReadyHeaderItem.forScript(String.format("window.name='%s'", windowName))); } response.render( OnLoadHeaderItem.forScript( "setTimeout(function() {" + getCallbackScript().toString() + "}, 30);")); }
@Override public void renderHead(final IHeaderResponse response) { super.renderHead(response); final String version = ServerConfigurationService.getString("portal.cdn.version", ""); response.render( CssHeaderItem.forUrl( String.format("/gradebookng-tool/styles/gradebook-settings.css?version=%s", version))); response.render( JavaScriptHeaderItem.forUrl( String.format("/gradebookng-tool/scripts/gradebook-settings.js?version=%s", version))); }
@Override public void renderHead(final IHeaderResponse response) { super.renderHead(response); response.render( JavaScriptReferenceHeaderItem.forReference( Application.get().getJavaScriptLibrarySettings().getJQueryReference())); response.render( StringHeaderItem.forString(WicketUtils.getCssForFavicon(getUrl("/favicon.ico")))); if (WebConfiguration.isDevelopmentMode() == true) { response.render( CssReferenceHeaderItem.forUrl( "mobile/jquery.mobile/jquery.mobile-" + JQUERY_MOBILE_VERSION + ".css")); } else { response.render( CssReferenceHeaderItem.forUrl( "mobile/jquery.mobile/jquery.mobile-" + JQUERY_MOBILE_VERSION + ".min.css")); } response.render(CssReferenceHeaderItem.forUrl("mobile/projectforge.css")); response.render(JavaScriptReferenceHeaderItem.forUrl("mobile/jquery.mobile/myconfig.js")); if (WebConfiguration.isDevelopmentMode() == true) { // response.renderJavaScriptReference("mobile/jquery.mobile/myconfig.js"); response.render( JavaScriptReferenceHeaderItem.forUrl( "mobile/jquery.mobile/jquery.mobile-" + JQUERY_MOBILE_VERSION + ".js")); } else { // response.renderJavaScriptReference("mobile/jquery.mobile/myconfig.js"); response.render( JavaScriptReferenceHeaderItem.forUrl( "mobile/jquery.mobile/jquery.mobile-" + JQUERY_MOBILE_VERSION + ".min.js")); } }
@Override public void renderHead(final Component component, final IHeaderResponse response) { super.renderHead(component, response); response.render(CssHeaderItem.forReference(BootstrapPrettifyCssReference.INSTANCE)); References.renderWithFilter( Bootstrap.getSettings(), response, JavaScriptHeaderItem.forReference(BootstrapPrettifyJavaScriptReference.INSTANCE)); response.render( OnDomReadyHeaderItem.forScript(createInitializerScript(component.getMarkupId(true)))); }
/** * First render the body of the component. And if it is the header component of a Page (compared * to a Panel or Border), then get the header sections from all component in the hierarchy and * render them as well. */ @Override public final void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) { // We are able to automatically add <head> to the page if it is // missing. But we only want to add it, if we have content to be // written to its body. Thus we first write the output into a // StringResponse and if not empty, we copy it to the original // web response. // Temporarily replace the web response with a String response final Response webResponse = getResponse(); try { // Create a (string) response for all headers contributed by any component on the Page. final StringResponse response = new StringResponse(); getRequestCycle().setResponse(response); IHeaderResponse headerResponse = getHeaderResponse(); if (!response.equals(headerResponse.getResponse())) { getRequestCycle().setResponse(headerResponse.getResponse()); } // Render the header sections of all components on the page AbstractHeaderRenderStrategy.get() .renderHeader(this, new HeaderStreamState(markupStream, openTag), getPage()); // Close the header response before rendering the header container itself // See https://issues.apache.org/jira/browse/WICKET-3728 headerResponse.close(); // Cleanup extraneous CR and LF from the response CharSequence output = getCleanResponse(response); // Automatically add <head> if necessary if (output.length() > 0) { if (renderOpenAndCloseTags()) { webResponse.write("<head>"); } webResponse.write(output); if (renderOpenAndCloseTags()) { webResponse.write("</head>"); } } } finally { // Restore the original response getRequestCycle().setResponse(webResponse); } }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render( OnDomReadyHeaderItem.forScript( "window.setTimeout(function() {" + aab.getCallbackScript() + "} , 500);")); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); PackageResourceReference resourceReference = new PackageResourceReference(getClass(), "follow.js"); response.render(JavaScriptHeaderItem.forReference(resourceReference, "twitterFollow")); }
@Override public void renderHead(final Component component, final IHeaderResponse headerResponse) { super.renderHead(component, headerResponse); headerResponse.render( OnDomReadyHeaderItem.forScript(createInitializerScript(component, config))); }
/** * @see * jabara.it_inoculation_questions.web.ui.page.ItInoculationQuestionsWebPageBase#renderHead(org.apache.wicket.markup.head.IHeaderResponse) */ @Override public void renderHead(final IHeaderResponse pResponse) { super.renderHead(pResponse); addPageCssReference(pResponse); pResponse.render( JavaScriptHeaderItem.forUrl("http://code.jquery.com/jquery-1.9.1.min.js")); // $NON-NLS-1$ }
/** * Method renderHead, that allow to use CSS to render the page. * * @param response IHeaderResponse * @see org.apache.wicket.markup.html.IHeaderContributor#renderHead(IHeaderResponse) */ @Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render( CssHeaderItem.forReference( new CssResourceReference(SharedAlbums.class, "SharedAlbums.css"))); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); CssResourceReference cssResourceReference = new CssResourceReference(WicketWebApplication.class, "example.css"); response.render(CssHeaderItem.forReference(cssResourceReference)); }
@Override protected void renderHead(IHeaderResponse response, Class<?> cls) { super.renderHead(response, IsisBlobOrClobPanelAbstract.class); // don't use the subclass // also include JQuery response.render( JavaScriptHeaderItem.forReference( Application.get().getJavaScriptLibrarySettings().getJQueryReference())); }
/* * (non-Javadoc) * * @see org.apache.wicket.behavior.AbstractBehavior#renderHead(org.apache.wicket * .markup.html.IHeaderResponse) */ @Override public void renderHead(Component c, IHeaderResponse response) { super.renderHead(c, response); response.render( CssHeaderItem.forReference( new PackageResourceReference(YavBehavior.class, "style/yav-style.css"))); addJavascriptReference(response, "yav.js"); addJavascriptReference(response, "yav-config.js"); addJavascriptReference(response, "util.js"); // Add an onload contributor that will call a function which is defined // during onComponentTag method call which is processed after the head // is rendered (warning, not compliant with XHTML 1.0 Strict DTD) response.render(OnLoadHeaderItem.forScript("yavInit()")); }
@Override public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); response.render( JavaScriptHeaderItem.forScript( "function onClickAlert(text)\n {\n alert(text);\n }\n", getClass().getName())); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render( new JavaScriptContentHeaderItem( "window.addEventListener('hashchange', function() { scrollBy(0, -50) })", "hashchange", null)); }
@Override public void renderHead(final Component component, final IHeaderResponse response) { super.renderHead(component, response); if (component.isEnabledInHierarchy()) { CharSequence js = getCallbackScript(component); response.render(OnDomReadyHeaderItem.forScript(js.toString())); } }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); response.render( OnLoadHeaderItem.forScript( String.format( "addTextAreaMapper('%s', '%s');", this.container.getMarkupId(), this.textarea.getMarkupId()))); }
@Override public final void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); final String id = component.getMarkupId(); String initJS = String.format( "wicketbox.stretch('%s','%s',{leading: '%s', center: '%s', trailing: '%s'});", id, orientation, leadingSelector, centerSelector, trailingSelector); response.render(OnDomReadyHeaderItem.forScript(initJS)); }