@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);
      }
    }
  }
Exemple #2
0
 @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(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 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);
  }
 @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));
 }
Exemple #6
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);
    }
  }
 /**
  * @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$
 }
 @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);
   PackageResourceReference resourceReference =
       new PackageResourceReference(getClass(), "follow.js");
   response.render(JavaScriptHeaderItem.forReference(resourceReference, "twitterFollow"));
 }
 @Override
 public List<HeaderItem> getDependencies() {
   return Dependencies.combine(
       super.getDependencies(),
       JavaScriptHeaderItem.forReference(
           ABaseWebApplication.get().getJavaScriptLibrarySettings().getJQueryReference()));
 }
  @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 Iterable<? extends HeaderItem> getDependencies() {
    List<HeaderItem> dependencies = Lists.newArrayList(super.getDependencies());
    dependencies.add(JavaScriptHeaderItem.forReference(BootstrapJavaScriptReference.INSTANCE));

    return dependencies;
  }
  @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
 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()));
 }
 /**
  * Specify that charts.js depends on Google JS APIs and Wicket WebSocket JavaScript
  *
  * @return a list of dependencies
  */
 @Override
 public List<HeaderItem> getDependencies() {
   final List<HeaderItem> dependencies = new ArrayList<HeaderItem>();
   dependencies.add(
       JavaScriptHeaderItem.forReference(
           new UrlResourceReference(Url.parse("https://www.google.com/jsapi"))));
   return dependencies;
 }
 @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"));
}
 @Override
 public List<HeaderItem> getDependencies() {
   List<HeaderItem> dependencies = new ArrayList<>();
   Iterable<? extends HeaderItem> superDeps = super.getDependencies();
   for (HeaderItem dep : superDeps) {
     dependencies.add(dep);
   }
   dependencies.add(
       JavaScriptHeaderItem.forReference(
           Application.get().getJavaScriptLibrarySettings().getWicketAjaxReference()));
   return dependencies;
 }
 @Override
 public Iterable<? extends HeaderItem> getDependencies() {
   final ResourceReference backingLibraryReference;
   if (Application.exists()) {
     backingLibraryReference =
         Application.get().getJavaScriptLibrarySettings().getJQueryReference();
   } else {
     backingLibraryReference = JQueryResourceReference.get();
   }
   return Dependencies.combine(
       super.getDependencies(), JavaScriptHeaderItem.forReference(backingLibraryReference));
 }
  @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 List<HeaderItem> getDependencies() {
   List<HeaderItem> dependencies = new ArrayList<>();
   for (Iterator<? extends HeaderItem> iterator = super.getDependencies().iterator();
       iterator.hasNext(); ) {
     HeaderItem headerItem = iterator.next();
     dependencies.add(headerItem);
   }
   dependencies.add(
       JavaScriptHeaderItem.forReference(
           Application.get().getJavaScriptLibrarySettings().getJQueryReference()));
   return dependencies;
 }
Exemple #23
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))));
  }
 @Override
 public Iterable<? extends HeaderItem> getDependencies() {
   return Dependencies.combine(
       super.getDependencies(),
       JavaScriptHeaderItem.forReference(Bootstrap.getSettings().getJsResourceReference()));
 }
 @Override
 public void renderHead(Component component, IHeaderResponse response) {
   super.renderHead(component, response);
   response.render(JavaScriptHeaderItem.forReference(INSTANCE));
 }
Exemple #27
0
 /**
  * @param response
  * @param resource
  */
 private void addJavascriptReference(IHeaderResponse response, String resource) {
   response.render(
       JavaScriptHeaderItem.forReference(
           new JavaScriptResourceReference(YavBehavior.class, resource)));
 }
 @Override
 public void renderHead(final IHeaderResponse response) {
   response.render(JavaScriptHeaderItem.forReference(this));
 }
 @Override
 public List<HeaderItem> getDependencies() {
   List<HeaderItem> dependencies = super.getDependencies();
   dependencies.add(JavaScriptHeaderItem.forReference(new DataTablesJsReference()));
   return dependencies;
 }
Exemple #30
0
 @Override
 public void renderHead(IHeaderResponse response) {
   super.renderHead(response);
   response.render(JavaScriptHeaderItem.forUrl(JQUERYSCRIPT));
 }