Exemple #1
0
  @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 component, IHeaderResponse response) {
    // Gets the library settings //
    JQueryLibrarySettings settings = getJQueryLibrarySettings();

    // jQuery Globalize resource reference //
    if (settings != null && settings.getJQueryGlobalizeReference() != null) {
      this.renderPriorityHeaderItem(
          JavaScriptHeaderItem.forReference(settings.getJQueryGlobalizeReference()), response);
    }

    // Additional resource references //
    for (ResourceReference reference : this.references) {
      if (reference instanceof CssResourceReference) {
        this.renderPriorityHeaderItem(CssHeaderItem.forReference(reference), response);
      }

      if (reference instanceof JavaScriptResourceReference) {
        this.renderPriorityHeaderItem(JavaScriptHeaderItem.forReference(reference), response);
      }
    }

    // Adds the statement //
    this.renderOnDomReadyScript(this.$(), response);
  }
 /**
  * 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(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) {
   super.renderHead(response);
   CssResourceReference cssResourceReference =
       new CssResourceReference(WicketWebApplication.class, "example.css");
   response.render(CssHeaderItem.forReference(cssResourceReference));
 }
 @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(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")));
 }
/**
 * Files to reference: <link rel="stylesheet" type="text/css" href="lib/css/bootstrap.min.css" />
 * <!-- Please use the newest Version of Bootstrap 3.0.X -->
 * <link rel="stylesheet" type="text/css" href="src/bootstrap3-wysihtml5.css" /> <link
 * rel="stylesheet" type="text/css" href="src/bootstrap3-wysihtml5-editor.css" /> <script
 * src="lib/js/jquery-1.11.1.min.js"></script> <script src="lib/js/bootstrap.min.js"></script>
 * <script src="lib/js/wysihtml5x-toolbar.min.js"></script> <script
 * src="src/bootstrap3-wysihtml5.min.js"></script>
 *
 * <p>https://github.com/Waxolunist/bootstrap3-wysihtml5-bower/
 *
 * @author rudi
 */
public class Bootstrap3Wysihtml5v2 {

  public static final CssReferenceHeaderItem WYSIWYG_COLOR_CSS =
      CssHeaderItem.forReference(
          new AfterBootstrapCssResourceReference(Bootstrap3Wysihtml5v2.class, "wysiwyg-color.css"));

  public static final CssReferenceHeaderItem BOOTSTRAP3_WYSIHTML5_MIN_CSS =
      CssHeaderItem.forReference(
          new AfterBootstrapCssResourceReference(
              Bootstrap3Wysihtml5v2.class, "bootstrap3-wysihtml5.min.css"));

  public static final JavaScriptHeaderItem BOOTSTRAP3_WYSIHTML5_MIN =
      JavaScriptHeaderItem.forReference(
          new AfterBootstrapJavaScriptResourceReference(
              Bootstrap3Wysihtml5v2.class, "bootstrap3-wysihtml5.min.js"));

  public static final JavaScriptHeaderItem BOOTSTRAP3_WYSIHTML5_ALL_MIN =
      JavaScriptHeaderItem.forReference(
          new AfterBootstrapJavaScriptResourceReference(
              Bootstrap3Wysihtml5v2.class, "bootstrap3-wysihtml5.all.min.js"));
}
Exemple #9
0
  @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)));
  }
Exemple #10
0
 protected void renderContentsCss(IHeaderResponse response, JSONObject editorConfig) {
   String contentsCss = "";
   try {
     contentsCss = editorConfig.getString(CKEditorConstants.CONFIG_CONTENTS_CSS);
     response.render(CssHeaderItem.forUrl(contentsCss));
   } catch (JSONException e) {
     log.warn(
         "Cannot render contents CSS '"
             + contentsCss
             + "', the default CKEditor CSS will be used instead",
         e);
   }
 }
Exemple #11
0
  @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 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))));
  }
Exemple #13
0
  /*
   * (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 final void renderHead(IHeaderResponse response) {
   response.render(CssHeaderItem.forReference(EHOUR_CSS));
   onRenderHead(response);
 }
Exemple #15
0
 @Override
 public void renderHead(IHeaderResponse response) {
   response.render(CssHeaderItem.forReference(CSS));
 }
Exemple #16
0
 @Override
 public void renderHead(Component component, IHeaderResponse response) {
   super.renderHead(component, response);
   response.render(JavaScriptHeaderItem.forReference(getLightboxJs()));
   response.render(CssHeaderItem.forReference(getLightboxCss()));
 }
 @Override
 public void renderHead(IHeaderResponse response) {
   super.renderHead(response);
   response.render(CssHeaderItem.forReference(Label_CSS));
 }
 @Override
 public void renderHead(final IHeaderResponse response) {
   response.render(CssHeaderItem.forReference(this));
 }