Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
e => {
// validate availability
store.cmsSiteEditorAvailability();
store.cmsSiteEditor.instance.jwt = this.jwt;
store.cmsSiteEditor.instance.method = "GET";
store.cmsSiteEditor.instance.saveNodePath =
window.appSettings.saveNodePath;
store.cmsSiteEditor.instance.saveManifestPath =
window.appSettings.saveManifestPath;
store.cmsSiteEditor.instance.saveOutlinePath =
window.appSettings.saveOutlinePath;
store.cmsSiteEditor.instance.getNodeFieldsPath =
window.appSettings.getNodeFieldsPath;
store.cmsSiteEditor.instance.getSiteFieldsPath =
window.appSettings.getSiteFieldsPath;
store.cmsSiteEditor.instance.createNodePath =
window.appSettings.createNodePath;
store.cmsSiteEditor.instance.deleteNodePath =
window.appSettings.deleteNodePath;
connect(element, injector) {
window.addEventListener(
"haxcms-active-item-changed",
this._activeItemUpdate.bind(element)
);
window.addEventListener(
"haxcms-edit-mode-changed",
this._globalEditChanged.bind(element)
);
window.addEventListener(
"haxcms-trigger-update",
this._triggerUpdate.bind(element)
);
// inject the tools to allow for an authoring experience
// ensuring they are loaded into the correct theme
store.cmsSiteEditorAvailability();
store.cmsSiteEditor.instance.appElement = element;
store.cmsSiteEditor.instance.appendTarget = injector;
store.cmsSiteEditor.instance.appendTarget.appendChild(
store.cmsSiteEditor.instance
);
}
/**
e => {
// if we don't have appSettings by this point
// it means we don't actually have a backend / directions
// this would be a published state or a state where
// there is no actual backend to bother confiring with
// possibly a user navigated to a site that doesn't
// have JWT credentials but isn't actually published
// we also need this here because PHP is the assumed
// fallback backend
if (window.appSettings) {
store.cmsSiteEditorAvailability();
store.cmsSiteEditor.instance.jwt = this.jwt;
store.cmsSiteEditor.instance.saveNodePath =
window.appSettings.saveNodePath;
store.cmsSiteEditor.instance.saveManifestPath =
window.appSettings.saveManifestPath;
store.cmsSiteEditor.instance.saveOutlinePath =
window.appSettings.saveOutlinePath;
store.cmsSiteEditor.instance.getNodeFieldsPath =
window.appSettings.getNodeFieldsPath;
store.cmsSiteEditor.instance.getSiteFieldsPath =
window.appSettings.getSiteFieldsPath;
store.cmsSiteEditor.instance.getFormToken =
window.appSettings.getFormToken;
store.cmsSiteEditor.instance.publishSitePath =
window.appSettings.publishSitePath;
store.cmsSiteEditor.instance.syncSitePath =
disconnect(element) {
window.removeEventListener(
"haxcms-active-item-changed",
this._activeItemUpdate.bind(element)
);
window.removeEventListener(
"haxcms-edit-mode-changed",
this._globalEditChanged.bind(element)
);
window.removeEventListener(
"haxcms-trigger-update",
this._triggerUpdate.bind(element)
);
// need to unplug this so that the new theme can pick it up.
document.body.appendChild(store.cmsSiteEditorAvailability());
}
/**
e => {
// if we don't have appSettings by this point
// it means we don't actually have a backend / directions
// this would be a published state or a state where
// there is no actual backend to bother confiring with
// possibly a user navigated to a site that doesn't
// have JWT credentials but isn't actually published
// we also need this here because PHP is the assumed
// fallback backend
if (window.appSettings) {
store.cmsSiteEditorAvailability();
store.cmsSiteEditor.instance.jwt = this.jwt;
store.cmsSiteEditor.instance.saveNodePath =
window.appSettings.saveNodePath;
store.cmsSiteEditor.instance.saveManifestPath =
window.appSettings.saveManifestPath;
store.cmsSiteEditor.instance.saveOutlinePath =
window.appSettings.saveOutlinePath;
store.cmsSiteEditor.instance.getNodeFieldsPath =
window.appSettings.getNodeFieldsPath;
store.cmsSiteEditor.instance.getSiteFieldsPath =
window.appSettings.getSiteFieldsPath;
store.cmsSiteEditor.instance.getFormToken =
window.appSettings.getFormToken;
store.cmsSiteEditor.instance.publishSitePath =
window.appSettings.publishSitePath;
store.cmsSiteEditor.instance.syncSitePath =
e => {
store.cmsSiteEditorAvailability();
store.cmsSiteEditor.instance.jwt = this.jwt;
store.cmsSiteEditor.instance.appStore = appstore;
},
e => {