FIX: ensures backwards compatibility with stable

FIX: ensures backwards compatibility with stable

diff --git a/javascripts/discourse/connectors/below-footer/custom-footer.js b/javascripts/discourse/connectors/below-footer/custom-footer.js
deleted file mode 100644
index 00fa1e9..0000000
--- a/javascripts/discourse/connectors/below-footer/custom-footer.js
+++ /dev/null
@@ -1,103 +0,0 @@
-import { dasherize } from "@ember/string";
-
-export default {
-  setupComponent(args, component) {
-    try {
-      const splitLinkSections = settings.Link_sections.split("|");
-      const splitLinks = settings.Links.split("|");
-      const splitSmallLinks = settings.Small_links.split("|");
-      const splitSocialLinks = settings.Social_links.split("|");
-
-      const linkArray = [];
-      const sectionsArray = [];
-      const smallLinksArray = [];
-      const socialLinksArray = [];
-
-      splitLinks.forEach(link => {
-        const fragments = link.split(",").map(fragment => fragment.trim());
-        const parent = fragments[0].toLowerCase();
-        const text = fragments[1];
-        const className = dasherize(text).toLowerCase();
-        const href = fragments[2];
-        const target = fragments[3] === "blank" ? "_blank" : "";
-        const title = fragments[4];
-
-        const linkItem = {
-          parent,
-          text,
-          className,
-          href,
-          target,
-          title
-        };
-        linkArray.push(linkItem);
-      });
-
-      splitLinkSections.forEach(section => {
-        const fragments = section.split(",").map(fragment => fragment.trim());
-        const parentFor = fragments[0].toLowerCase();
-        const text = fragments[0];
-        const className = dasherize(text).toLowerCase();
-        const title = fragments[1];
-        const childLinks = linkArray.filter(link => link.parent === parentFor);
-
-        const listItem = {
-          parentFor,
-          text,
-          className,
-          childLinks
-        };
-        sectionsArray.push(listItem);
-      });
-
-      splitSocialLinks.forEach(link => {
-        const fragments = link.split(",").map(fragment => fragment.trim());
-        const text = fragments[0];
-        const className = dasherize(text).toLowerCase();
-        const title = fragments[1];
-        const href = fragments[2];
-        const target = fragments[3] === "blank" ? "_blank" : "";
-        const icon = fragments[4].toLowerCase();
-
-        const socialLinkItem = {
-          text,
-          className,
-          title,
-          href,
-          target,
-          icon
-        };
-        socialLinksArray.push(socialLinkItem);
-      });
-
-      splitSmallLinks.forEach(link => {
-        const fragments = link.split(",").map(fragment => fragment.trim());
-        const text = fragments[0];
-        const className = dasherize(text).toLowerCase();
-        const href = fragments[1];
-        const target = fragments[2] === "blank" ? "_blank" : "";
-
-        const smallLinkItem = {
-          text,
-          className,
-          href,
-          target
-        };
-        smallLinksArray.push(smallLinkItem);
-      });
-
-      this.setProperties({
-        mainHeading: settings.Heading,
-        blurb: settings.Blurb,
-        linkSections: sectionsArray,
-        smallLinks: smallLinksArray,
-        socialLinks: socialLinksArray
-      });
-    } catch (error) {
-      console.error(error);
-      console.error(
-        "There's an issue in the Easy Footer Component. Check if your settings are entered correctly"
-      );
-    }
-  }
-};
diff --git a/javascripts/discourse/connectors/below-footer/custom-footer.js.es6 b/javascripts/discourse/connectors/below-footer/custom-footer.js.es6
new file mode 100644
index 0000000..06c6a90
--- /dev/null
+++ b/javascripts/discourse/connectors/below-footer/custom-footer.js.es6
@@ -0,0 +1,105 @@
+// Used instead of dasherize for backwards compatibility with stable
+const getClassName = text => {
+  return text.toLowerCase().replace(/\s/g, "-");
+};
+
+export default {
+  setupComponent(args, component) {
+    try {
+      const splitLinkSections = settings.Link_sections.split("|");
+      const splitLinks = settings.Links.split("|");
+      const splitSmallLinks = settings.Small_links.split("|");
+      const splitSocialLinks = settings.Social_links.split("|");
+
+      const linkArray = [];
+      const sectionsArray = [];
+      const smallLinksArray = [];
+      const socialLinksArray = [];
+
+      splitLinks.forEach(link => {
+        const fragments = link.split(",").map(fragment => fragment.trim());
+        const parent = fragments[0].toLowerCase();
+        const text = fragments[1];
+        const className = getClassName(text);
+        const href = fragments[2];
+        const target = fragments[3] === "blank" ? "_blank" : "";
+        const title = fragments[4];
+
+        const linkItem = {
+          parent,
+          text,
+          className,
+          href,
+          target,
+          title
+        };
+        linkArray.push(linkItem);
+      });
+
+      splitLinkSections.forEach(section => {
+        const fragments = section.split(",").map(fragment => fragment.trim());
+        const parentFor = fragments[0].toLowerCase();
+        const text = fragments[0];
+        const className = getClassName(text);
+        const title = fragments[1];
+        const childLinks = linkArray.filter(link => link.parent === parentFor);
+
+        const listItem = {
+          text,
+          className,
+          childLinks
+        };
+        sectionsArray.push(listItem);
+      });
+
+      splitSocialLinks.forEach(link => {
+        const fragments = link.split(",").map(fragment => fragment.trim());
+        const text = fragments[0];
+        const className = getClassName(text);
+        const title = fragments[1];
+        const href = fragments[2];
+        const target = fragments[3] === "blank" ? "_blank" : "";
+        const icon = fragments[4].toLowerCase();
+
+        const socialLinkItem = {
+          text,
+          className,
+          title,
+          href,
+          target,
+          icon
+        };
+        socialLinksArray.push(socialLinkItem);
+      });
+
+      splitSmallLinks.forEach(link => {
+        const fragments = link.split(",").map(fragment => fragment.trim());
+        const text = fragments[0];
+        const className = getClassName(text);
+        const href = fragments[1];
+        const target = fragments[2] === "blank" ? "_blank" : "";
+
+        const smallLinkItem = {
+          text,
+          className,
+          href,
+          target
+        };
+        smallLinksArray.push(smallLinkItem);
+      });
+
+      this.setProperties({
+        mainHeading: settings.Heading,
+        blurb: settings.Blurb,
+        linkSections: sectionsArray,
+        smallLinks: smallLinksArray,
+        socialLinks: socialLinksArray
+      });
+    } catch (error) {
+      console.error(error);
+      console.error(
+        "There's an issue in the Easy Footer Component. Check if your settings are entered correctly"
+      );
+    }
+  }
+};

GitHub sha: 5b5f6d5879fbcb5593fe65bb7fc3161b0ced7b82