MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    1. Home
    2. skyfall
    MagicMirror² v2.20.0 is available! For more information about this release, check out this topic.
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 6
    • Best 1
    • Controversial 0
    • Groups 0

    skyfall

    @skyfall

    1
    Reputation
    1
    Profile views
    6
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    skyfall Unfollow Follow

    Best posts made by skyfall

    • RE: Three module issues from a new user

      I’ve figured it out!

      Like the original post, I’m working with Calendar module. I wanted to understand why we could write, say symbol: “cloud” instead of having to declare the full “fas fa-fw fa-cloud” to invoke the symbol.

      I went into /modules/default/calendar/calendar.js and noticed the following section of code:

      const symbols = this.symbolsForEvent(event);
                                      symbols.forEach((s, index) => {
                                              const symbol = document.createElement("span");
                                              symbol.className = "fas fa-fw fa-" + s;
                                              if (index > 0) {
                                                      symbol.style.paddingLeft = "5px";
                                              }
                                              symbolWrapper.appendChild(symbol);
                                      });
                                      eventWrapper.appendChild(symbolWrapper);
                              } else if (this.config.timeFormat === "dateheaders") {
                                      const blankCell = document.createElement("td");
                                      blankCell.innerHTML = "   ";
                                      eventWrapper.appendChild(blankCell);
                              }
      

      calendar.js is hardcoding the fas (solid) font family in, not allowing us to invoke a family like fab (brands). setting the line:

      symbol.className = "fas fa-fw fa-" + s;
      

      to just:

      symbol.className = s;
      

      forces us to redeclare every symbol in config.js from “cloud” to “fas fa-fw fa-cloud”, but we can now access all available FA icons.

      And so, I get my leaf 🙂

      6f18f2a7-0b58-4f38-bcf8-994695134f0c-Screen Shot 2022-04-28 at 17.37.44.png Screen Shot 2022-04-28 at 17.37.44

      posted in Troubleshooting
      S
      skyfall

    Latest posts made by skyfall

    • RE: Three module issues from a new user

      Yeah, there’s a few things to try and we can make it work without breaking default notation

      I think one thing to keep in mind is MM seems to refer to them as “fab” instead of fa-brands; not sure where that translation happens.

      I did see some of the commits from January that initially addresses this. I’m mobile right now so I don’t have the references, but it looked like this convention is used in more places than just calendar. Should be the same fix for all instances though.

      I’ll experiment with it a bit too when I sit down to look.

      posted in Troubleshooting
      S
      skyfall
    • RE: Three module issues from a new user

      I was using https://fontawesome.com/icons/canadian-maple-leaf?s=brands for example

      I was thinking about how to fix this without breaking too; could just be an else if statement checking to see if it starts with “fab” or “fal”, otherwise keeping the fas hardcode. Would let us declare other families and keep the shorthand for the default fas configuration.

      posted in Troubleshooting
      S
      skyfall
    • RE: Three module issues from a new user

      I’ve figured it out!

      Like the original post, I’m working with Calendar module. I wanted to understand why we could write, say symbol: “cloud” instead of having to declare the full “fas fa-fw fa-cloud” to invoke the symbol.

      I went into /modules/default/calendar/calendar.js and noticed the following section of code:

      const symbols = this.symbolsForEvent(event);
                                      symbols.forEach((s, index) => {
                                              const symbol = document.createElement("span");
                                              symbol.className = "fas fa-fw fa-" + s;
                                              if (index > 0) {
                                                      symbol.style.paddingLeft = "5px";
                                              }
                                              symbolWrapper.appendChild(symbol);
                                      });
                                      eventWrapper.appendChild(symbolWrapper);
                              } else if (this.config.timeFormat === "dateheaders") {
                                      const blankCell = document.createElement("td");
                                      blankCell.innerHTML = "   ";
                                      eventWrapper.appendChild(blankCell);
                              }
      

      calendar.js is hardcoding the fas (solid) font family in, not allowing us to invoke a family like fab (brands). setting the line:

      symbol.className = "fas fa-fw fa-" + s;
      

      to just:

      symbol.className = s;
      

      forces us to redeclare every symbol in config.js from “cloud” to “fas fa-fw fa-cloud”, but we can now access all available FA icons.

      And so, I get my leaf 🙂

      6f18f2a7-0b58-4f38-bcf8-994695134f0c-Screen Shot 2022-04-28 at 17.37.44.png Screen Shot 2022-04-28 at 17.37.44

      posted in Troubleshooting
      S
      skyfall
    • RE: Three module issues from a new user

      @sdetweil I think we’re on to something here. I’m embarassed but I did notice my dependencies were out of date. I was running FA 5.13.3. Reinstalled and reverified and now running 6.1.1. However, when invoking ‘canadian-maple-leaf’ for example, it’s now showing a broken icon symbol versus nothing!

      Screen Shot 2022-04-28 at 17.11.45.png

      Screen Shot 2022-04-28 at 17.11.51.png

      I did also notice it isn’t loading the .woff2 file for the brands fonts, even though it is in the correct directory.

      posted in Troubleshooting
      S
      skyfall
    • RE: Three module issues from a new user

      @sdetweil I don’t think so, I’ve been looking into it and it is included in all.min.css; that’s where the other ones get imported from. Maybe we’re not invoking it properly since the FA 4->6 upgrade that happened in January?

      posted in Troubleshooting
      S
      skyfall
    • RE: Three module issues from a new user

      Hi all, was working on the same thing.

      Some icons I wanted to use are in brands, and can’t figure out how to invoke it properly. Tried adding imports in fontawesome.css for it, but no go. Anyone know how/why brands wont work? They are considered free use.

      posted in Troubleshooting
      S
      skyfall