@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(Slider.this.input.getMarkupId()).append("').on('change', function() { "); statements.append("jQuery('#").append(Slider.this.label.getMarkupId()).append("').slider('value', jQuery(this).val()); "); //change the slider value (+slide) statements.append("} );"); return String.format("jQuery(function() { %s });", statements); } };
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(lower.getMarkupId()).append("').on('change', function() { "); statements.append("jQuery('#").append(label.getMarkupId()).append("').slider('values', 0, jQuery(this).val()); "); //change the slider value (+slide) statements.append("} );"); return String.format("jQuery(function() { %s });", statements); } };
/** * @see org.projectforge.web.wicket.flowlayout.ComponentWrapperPanel#getComponentOutputId() */ @Override public String getComponentOutputId() { projektAsStringLabel.setOutputMarkupId(true); return projektAsStringLabel.getMarkupId(); }
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(upper.getMarkupId()).append("').on('change', function() { "); statements.append("jQuery('#").append(label.getMarkupId()).append("').slider('values', 1, jQuery(this).val()); "); //change the slider value (+slide) statements.append("} );"); return String.format("jQuery(function() { %s });", statements); } };
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(upper.getMarkupId()).append("').on('change', function() { "); statements.append(" jQuery('#").append(label.getMarkupId()).append("').slider('values', 1, jQuery(this).val()); "); // change the slider value (+slide) statements.append("});"); return statements.toString(); } };
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(Slider.this.input.getMarkupId()).append("').on('change', function() { "); statements.append(" jQuery('#").append(Slider.this.label.getMarkupId()).append("').slider('value', jQuery(this).val()); "); //change the slider value (+slide) statements.append("});"); return statements.toString(); } };
@Override protected String $() { StringBuilder statements = new StringBuilder(); statements.append("jQuery('#").append(lower.getMarkupId()).append("').on('change', function() { "); statements.append(" jQuery('#").append(label.getMarkupId()).append("').slider('values', 0, jQuery(this).val()); "); // change the slider value (+slide) statements.append("});"); return statements.toString(); } };
private void create(AjaxRequestTarget aTarget, String payload) throws JsonParseException, JsonMappingException, IOException { Annotation anno = JSONUtil.getObjectMapper().readValue(payload, Annotation.class); if (anno.getRanges().isEmpty()) { // Spurious creation event that is to be ignored. return; } String json = toJson(anno); // Since we cannot pass the JSON directly to Brat, we attach it to the HTML // element into which AnnotatorJS governs. In our modified annotator-full.js, we pick it // up from there and then pass it on to AnnotatorJS to do the rendering. aTarget.prependJavaScript("Wicket.$('" + vis.getMarkupId() + "').temp = " + json + ";"); }
private void create(AjaxRequestTarget aTarget, String payload) throws JsonParseException, JsonMappingException, IOException { Annotation anno = JSONUtil.getObjectMapper().readValue(payload, Annotation.class); if (anno.getRanges().isEmpty()) { // Spurious creation event that is to be ignored. return; } String json = toJson(anno); // Since we cannot pass the JSON directly to Brat, we attach it to the HTML // element into which AnnotatorJS governs. In our modified annotator-full.js, we pick it // up from there and then pass it on to AnnotatorJS to do the rendering. aTarget.prependJavaScript("Wicket.$('" + vis.getMarkupId() + "').temp = " + json + ";"); }
@Override public void renderHead(IHeaderResponse response) { super.renderHead(response); try (PackageTextTemplate packageTextTemplate = new PackageTextTemplate(getClass(), "PortletRichTextPanel.js")) { final Map<String, String> params = new HashMap<>(); params.put("label", (String) label.getDefaultModel().getObject()); params.put("htmlContainer", htmlContent.getMarkupId()); params.put("hiddenInput", hiddenInput.getMarkupId()); params.put("hash", hash); params.put("html", HTML_NEW_TAB); packageTextTemplate.interpolate(params); response.render(JavaScriptHeaderItem.forScript(packageTextTemplate.getString(), hash)); } catch (IOException e) { getLogger().error(e.getMessage(), e); } }
@Override protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("onclick", "window.open('" + getURL() + "', '_blank" + htmlContent.getMarkupId() + "');"); }
/** * Constructor * @param id the markup id * @param model the {@link IModel} * @param label {@link Label} on which the current slide value will be displayed */ public AbstractSlider(String id, IModel<T> model, Label label) { super(id, model); label.setDefaultModel(model); label.setOutputMarkupId(true); this.setLabelId(label.getMarkupId()); }
/** * Constructor * * @param id the markup id * @param model the {@link IModel} * @param label {@link Label} on which the current slide value will be displayed */ public AbstractSlider(String id, IModel<T> model, Label label) { super(id, model); label.setDefaultModel(model); label.setOutputMarkupId(true); this.setLabelId(label.getMarkupId()); }
protected void appendHTML(final AjaxRequestTarget target, final Label component, final String html) { if (html == null) return; // update the component's model object for the case when the page is refreshed using F5 component.setEscapeModelStrings(false); final IModel<?> model = component.getDefaultModel(); if (model == null) component.setDefaultModelObject(html); else component.setDefaultModelObject(model.toString() + html); // escape backslashes for JavaScript final String escapedHTML = html.replaceAll("\\\\", "\"); target.appendJavascript("" + // "var target = document.getElementById('" + component.getMarkupId() + "');" + // "target.innerHTML += '" + escapedHTML + "';" + // "target.scrollTop = target.scrollHeight" // ); } }
protected void appendHTML(final AjaxRequestTarget target, final Label component, final String html) { Args.notNull(target, "target"); Args.notNull(component, "component"); if (html == null) return; // update the component's model object for the case when the page is refreshed using F5 component.setEscapeModelStrings(false); final IModel<?> model = component.getDefaultModel(); component.setDefaultModelObject(model == null || model.getObject() == null ? html : model.getObject() + html); // escape backslashes for JavaScript final String escapedHTML = html.replaceAll("\\\\", "\"); target.appendJavaScript("" + // "var target = document.getElementById('" + component.getMarkupId() + "');" + // "target.innerHTML += '" + escapedHTML + "';" + // "target.scrollTop = target.scrollHeight" // ); } }
protected Component createHeaderComponent(String id) { BootstrapModalDefaultHeader header = new BootstrapModalDefaultHeader(id, title); getBorder().add(new AttributeModifier( "aria-labelledby", header.getTitleLabel().getMarkupId())); return header; } protected abstract Component createBodyComponent(String id);
@Override public void onClick() { throw new RestartResponseException(new RichTextNewTabPage(label.getDefaultModelObject().toString(), isReadOnlyMode(), PortletRichTextPanel.this.ctx.getViewSupplier(SViewByRichTextNewTab.class), hiddenInput, htmlContent.getMarkupId())); }
/** * Instantiates a new {@link LabeledLabelPanel}. * * @param id * the id * @param model * the model * @param labelModel * the label model */ public LabeledLabelPanel(final String id, final IModel<T> model, final IModel<String> labelModel) { super(id, model); setOutputMarkupId(true); add(viewableLabel = newViewableLabel("viewableLabel", model)); final String markupId = viewableLabel.getMarkupId(); add(label = newLabel("label", markupId, labelModel)); }
/** * Instantiates a new {@link LabeledLabelPanel}. * * @param id * the id * @param model * the model * @param labelModel * the label model */ public LabeledLabelPanel(final String id, final IModel<T> model, final IModel<String> labelModel) { super(id, model); setOutputMarkupId(true); add(viewableLabel = newViewableLabel("viewableLabel", model)); final String markupId = viewableLabel.getMarkupId(); add(label = newLabel("label", markupId, labelModel)); }
aTarget.prependJavaScript("Wicket.$('" + vis.getMarkupId() + "').temp = " + json + ";");