How to use the @lrnwebcomponents/haxcms-elements/lib/core/haxcms-site-store.js.store.activeItem function in @lrnwebcomponents/haxcms-elements

To help you get started, we’ve selected a few @lrnwebcomponents/haxcms-elements 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 elmsln / lrnwebcomponents / elements / haxor-slevin / haxor-slevin.es6.js View on Github external
autorun(reaction => {
      this.activeTitle = toJS(store.activeTitle);
      this.shareUrl = document.location.href;
      this.shareMsg = this.activeTitle + " " + this.shareUrl;
      if (varGet(store.activeItem, "metadata.fields.subtitle", false)) {
        this.subtitle = store.activeItem.metadata.fields.subtitle;
      } else {
        this.subtitle = false;
      }
      // look for image on the post and make it the pin share
      if (varGet(store.activeItem, "metadata.fields.images.0.src", false)) {
        this.activeImage = store.activeItem.metadata.fields.images[0].src;
      }
      this.__disposer.push(reaction);
    });
  }
github elmsln / lrnwebcomponents / elements / haxor-slevin / src / haxor-slevin.js View on Github external
autorun(reaction => {
      this.activeTitle = toJS(store.activeTitle);
      this.shareUrl = document.location.href;
      this.shareMsg = this.activeTitle + " " + this.shareUrl;
      if (varGet(store.activeItem, "metadata.fields.subtitle", false)) {
        this.subtitle = store.activeItem.metadata.fields.subtitle;
      } else {
        this.subtitle = false;
      }
      // look for image on the post and make it the pin share
      if (varGet(store.activeItem, "metadata.fields.images.0.src", false)) {
        this.activeImage = store.activeItem.metadata.fields.images[0].src;
      }
      this.__disposer.push(reaction);
    });
  }
github elmsln / lrnwebcomponents / elements / haxor-slevin / haxor-slevin.es6.js View on Github external
autorun(reaction => {
      this.activeTitle = toJS(store.activeTitle);
      this.shareUrl = document.location.href;
      this.shareMsg = this.activeTitle + " " + this.shareUrl;
      if (varGet(store.activeItem, "metadata.fields.subtitle", false)) {
        this.subtitle = store.activeItem.metadata.fields.subtitle;
      } else {
        this.subtitle = false;
      }
      // look for image on the post and make it the pin share
      if (varGet(store.activeItem, "metadata.fields.images.0.src", false)) {
        this.activeImage = store.activeItem.metadata.fields.images[0].src;
      }
      this.__disposer.push(reaction);
    });
  }
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / site / site-print-button.js View on Github external
async print(e) {
    // now dynamic import the footer so we don't bloat all other page loads
    import("@lrnwebcomponents/haxcms-elements/lib/ui-components/layout/site-footer.js");
    const type = this.type;
    let content = "";
    if (type === "page") {
      // oh there you are
      content = `
      <h1>${store.activeItem.title}</h1>
      <div>${store.activeItemContent}</div>`;
    } else if (type === "parent") {
      // everything from the parent of this page, down
      const result = store.computeItems(
        1,
        100,
        store.activeId,
        "parent",
        store.routerManifest,
        true
      );
      for (var i in result) {
        content += await fetch("pages/" + result[i].location + "/index.html")
          .then(function(response) {
            return response.text();
          })
github elmsln / lrnwebcomponents / elements / haxor-slevin / src / haxor-slevin.js View on Github external
autorun(reaction => {
      this.activeTitle = toJS(store.activeTitle);
      this.shareUrl = document.location.href;
      this.shareMsg = this.activeTitle + " " + this.shareUrl;
      if (varGet(store.activeItem, "metadata.fields.subtitle", false)) {
        this.subtitle = store.activeItem.metadata.fields.subtitle;
      } else {
        this.subtitle = false;
      }
      // look for image on the post and make it the pin share
      if (varGet(store.activeItem, "metadata.fields.images.0.src", false)) {
        this.activeImage = store.activeItem.metadata.fields.images[0].src;
      }
      this.__disposer.push(reaction);
    });
  }
github elmsln / lrnwebcomponents / elements / haxor-slevin / haxor-slevin.js View on Github external
autorun(reaction => {
      this.activeTitle = toJS(store.activeTitle);
      this.shareUrl = document.location.href;
      this.shareMsg = this.activeTitle + " " + this.shareUrl;
      if (varGet(store.activeItem, "metadata.fields.subtitle", false)) {
        this.subtitle = store.activeItem.metadata.fields.subtitle;
      } else {
        this.subtitle = false;
      }
      // look for image on the post and make it the pin share
      if (varGet(store.activeItem, "metadata.fields.images.0.src", false)) {
        this.activeImage = store.activeItem.metadata.fields.images[0].src;
      }
      this.__disposer.push(reaction);
    });
  }
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / active-item / site-share-widget.js View on Github external
autorun(reaction => {
      if (store.activeItem) {
        this.activeItem = toJS(store.activeItem);
      }
      this.__disposer.push(reaction);
    });
  }
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / active-item / site-git-corner.js View on Github external
autorun(reaction => {
      if (store.activeItem) {
        this.activeGitFileLink =
          varGet(store.manifest, "metadata.site.git.publicRepoUrl", "") +
          store.activeItem.location;
      }
      this.__disposer.push(reaction);
    });
  }
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / core / haxcms-site-editor.js View on Github external
autorun(reaction => {
      this.activeItem = toJS(store.activeItem);
      this.__disposer.push(reaction);
    });
    window.SimpleToast.requestAvailability();
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / active-item / site-share-widget.js View on Github external
autorun(reaction => {
      if (store.activeItem) {
        this.activeItem = toJS(store.activeItem);
      }
      this.__disposer.push(reaction);
    });
  }

@lrnwebcomponents/haxcms-elements

HAX CMS series of elements to provide a full on CMS

Apache-2.0
Latest version published 5 months ago

Package Health Score

69 / 100
Full package analysis

Popular @lrnwebcomponents/haxcms-elements functions