How to use the scrivito.isInPlaceEditingActive function in scrivito

To help you get started, we’ve selected a few scrivito examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Scrivito / scrivito_example_app_js / src / Components / InPlaceEditingPlaceholder.js View on Github external
const InPlaceEditingPlaceholder = ({ children, center, block }) => {
  if (!Scrivito.isInPlaceEditingActive()) {
    return null;
  }

  const innerSpan = <span style="{placeholderCss}">{children}</span>;

  if (center) {
    return <div>{innerSpan}</div>;
  }

  if (block) {
    return <div>{innerSpan}</div>;
  }

  return innerSpan;
};
github Scrivito / scrivito_example_app_js / src / Widgets / ImageWidget / ImageWidgetComponent.js View on Github external
Scrivito.provideComponent("ImageWidget", ({ widget }) =&gt; {
  let image = (
    
  );

  const link = widget.get("link");
  if (link &amp;&amp; !Scrivito.isInPlaceEditingActive()) {
    image = {image};
  }

  if (["center", "right"].includes(widget.get("alignment"))) {
    return <div>{image}</div>;
  }

  return image;
});
github Scrivito / scrivito_example_app_js / src / Widgets / TestimonialSliderWidget / TestimonialSliderWidgetComponent.js View on Github external
const AddTestimonial = ({ widget }) =&gt; {
  if (!Scrivito.isInPlaceEditingActive()) {
    return null;
  }

  return (
    <div>
      <a style="{placeholderCss}" href="#"> {
          e.preventDefault();
          e.stopPropagation();
          const newTestimonials = [
            ...widget.get("testimonials"),
            new TestimonialWidget({}),
          ];</a></div>
github Scrivito / scrivito_example_app_js / src / Widgets / VideoWidget / VideoWidgetComponent.js View on Github external
Scrivito.provideComponent("VideoWidget", ({ widget }) =&gt; {
  const videoUrl = urlFromBinary(widget.get("source"));

  if (!videoUrl &amp;&amp; !Scrivito.isInPlaceEditingActive()) {
    return null;
  }

  const posterUrl = urlFromBinary(widget.get("poster"));
  const src = posterUrl ? videoUrl : `${videoUrl}#t=0.01`;

  let style = {};
  if (Scrivito.isInPlaceEditingActive() &amp;&amp; !videoUrl &amp;&amp; !posterUrl) {
    style = videoPlaceholder;
  }

  return (
    
  );
});
github Scrivito / scrivito_example_app_js / src / Widgets / TableWidget / TableWidgetComponent.js View on Github external
({ widget, title, attribute, maxRows }) =&gt; {
    if (!Scrivito.isInPlaceEditingActive()) {
      return null;
    }

    const currentRows = widget.get(attribute);
    if (maxRows &amp;&amp; currentRows.length &gt;= maxRows) {
      return null;
    }

    return (
      
        
          <div>
            <a style="{placeholderCss}" href="#"> {</a></div>
github Scrivito / scrivito_example_app_js / src / Objs / Job / JobComponent.js View on Github external
const JobValidThrough = Scrivito.connect(({ page }) =&gt; {
  const validThrough = page.get("validThrough");
  if (!validThrough) {
    if (!Scrivito.isInPlaceEditingActive()) {
      return null;
    }

    return (
      <h2>
        <i title="date" aria-hidden="true">{" "}
        <span>Valid through: </span>
        
          
            Click to select expire at.
          
        
      </i></h2><i title="date" aria-hidden="true">
    );
  }
</i>
github Scrivito / scrivito_example_app_js / src / Widgets / VideoWidget / VideoWidgetComponent.js View on Github external
Scrivito.provideComponent("VideoWidget", ({ widget }) =&gt; {
  const videoUrl = urlFromBinary(widget.get("source"));

  if (!videoUrl &amp;&amp; !Scrivito.isInPlaceEditingActive()) {
    return null;
  }

  const posterUrl = urlFromBinary(widget.get("poster"));
  const src = posterUrl ? videoUrl : `${videoUrl}#t=0.01`;

  let style = {};
  if (Scrivito.isInPlaceEditingActive() &amp;&amp; !videoUrl &amp;&amp; !posterUrl) {
    style = videoPlaceholder;
  }

  return (

scrivito

Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.

LGPL-3.0
Latest version published 5 days ago

Package Health Score

68 / 100
Full package analysis