Пример #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(IHeaderResponse response) {
   super.renderHead(response);
   CssResourceReference cssResourceReference =
       new CssResourceReference(WicketWebApplication.class, "example.css");
   response.render(CssHeaderItem.forReference(cssResourceReference));
 }
 @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"));
   }
 }
Пример #4
0
 @Override
 public void renderHead(IHeaderResponse response) {
   super.renderHead(response);
   response.render(
       OnDomReadyHeaderItem.forScript(
           "window.setTimeout(function() {" + aab.getCallbackScript() + "} , 500);"));
 }
 @Override
 protected void onInitialize() {
   super.onInitialize();
   Form<Void> form = new Form<Void>("form");
   form.add(createMonetaryField("amount"));
   add(form);
 }
Пример #6
0
 @Override
 protected void onInitialize() {
   super.onInitialize();
   add(new BookmarkablePageLink<Void>("homePageLink", getApplication().getHomePage()));
   final IDataProvider<TxnTypeEntity> dataProvider = dataProviderProvider.get();
   add(new TxnTypeDataView("types", 0, dataProvider));
 }
Пример #7
0
  @Override
  protected void onInitialize() {
    super.onInitialize();

    TextField<String> userinput = new TextField<String>("userinput", Model.of(""));
    userinput.add(
        new AjaxFormSubmitBehavior("onchange") {
          private static final long serialVersionUID = 1L;

          @Override
          protected void onSubmit(AjaxRequestTarget target) {}

          @Override
          protected void onError(AjaxRequestTarget target) {}

          @Override
          protected IAjaxCallDecorator getAjaxCallDecorator() {
            super.getAjaxCallDecorator();
            return new MyAjaxCallDecorator();
          }
        });

    Form<Void> form = new Form<Void>("form");
    add(form);

    form.add(userinput);

    AjaxRequestTarget.get();
    getPageParameters();
  }
 @Override
 public void renderHead(IHeaderResponse response) {
   super.renderHead(response);
   response.renderCSSReference(CSS_1);
   response.renderCSSReference(CSS_2);
   response.renderCSSReference(CSS_PRINT_1, "print");
   response.renderCSSReference(CSS_PRINT_2, "print");
 }
Пример #9
0
 @Override
 protected void onConfigure() {
   super.onConfigure();
   AuthenticatedWebApplication app = (AuthenticatedWebApplication) Application.get();
   if (!AuthenticatedWebSession.get().isSignedIn()) {
     app.restartResponseAtSignInPage();
   }
 }
Пример #10
0
 public BaseUsersPage add(final Component child) {
   // Add children of the page to the page's border component
   if (border == null) {
     // Create border and add it to the page
     border = new UsersBorder();
     super.add(border);
   }
   border.add(child);
   return this;
 }
Пример #11
0
  @Override
  public void onEvent(IEvent<?> event) {
    super.onEvent(event);

    if (event.getPayload() instanceof WebSocketPushPayload) {
      WebSocketPushPayload wsEvent = (WebSocketPushPayload) event.getPayload();
      wsEvent.getHandler().add(btn.setVisible(true));
      wsEvent.getHandler().appendJavaScript("console.log('javascript executed');");
    }
  }
Пример #12
0
  @Override
  public void renderHead(IHeaderResponse response) {
    super.renderHead(response);
    Bootstrap.renderHead(response);

    //        String locale = getSession().getLocale().toString();
    //        response.render(new
    // JavaScriptUrlReferenceHeaderItem("/js/feedback/feedback-"+locale+".js", "feedback", true,
    // null, null));
  }
 @Override
 protected void onBeforeRender() {
   super.onBeforeRender();
   if (topButtonsRendered == false) {
     topButtonsRendered = true;
     addTopLeftButton();
     addTopCenter();
     addTopRightButton();
   }
   alreadySubmitted = false;
 }
Пример #14
0
 @Override
 public void renderHead(IHeaderResponse response) {
   super.renderHead(response);
   response.renderCSSReference(
       new PackageResourceReference(AbstractBasePage.class, "styles/base.css"), "all");
 }
 @Override
 public void renderHead(IHeaderResponse response) {
   super.renderHead(response);
   response.renderJavaScript("someJS()", "js");
 }
Пример #16
0
 @Override
 protected void onBeforeRender() {
   _message = "onBeforeRender called";
   super.onBeforeRender();
 }
Пример #17
0
  @Override
  public void renderHead(final IHeaderResponse response) {
    super.renderHead(response);

    response.render(CssReferenceHeaderItem.forReference(CSS));
  }
Пример #18
0
 @Override
 protected void configureResponse(WebResponse response) {
   super.configureResponse(response);
   response.setStatus(HttpServletResponse.SC_FORBIDDEN);
 }
Пример #19
0
 @Override
 public void renderHead(IHeaderResponse response) {
   super.renderHead(response);
   response.renderCSSReference(CSS);
 }
Пример #20
0
 @Override
 protected void onBeforeRender() {
   super.onBeforeRender();
   setupPage(pageTitle);
 }
Пример #21
0
 @Override
 protected void setHeaders(WebResponse response) {
   super.setHeaders(response);
   // Protection against ClickJacking, prevents the page from being rendered in an iframe element
   response.setHeader("X-Frame-Options", "deny");
 }
Пример #22
0
 @Override
 public void renderHead(IHeaderResponse response) {
   super.renderHead(response);
   Bootstrap.renderHead(response);
 }