MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. Mystara
    3. Topics
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 4
    • Groups 0

    Topics

    • M

      Any way to access overall DOM?

      Watching Ignoring Scheduled Pinned Locked Moved Development
      4
      0 Votes
      4 Posts
      197 Views
      M
      @Mystara Not tested, only with my brain, so just idea. Get all the DOMs which has textContent. const els = document.querySelectorAll('*') for (let i = 0; i < els.length; i++) { const el = els[i] const children = el.childNodes let hasText = false for (let j = children.length; j--) { if (children[j].nodeType === 3 && children[j].nodeValue.trim().length) { hasText = true break } } if (hasText) { //This element has text content } } If it and its ancestors don’t have a background, apply your solution. // assume that already know target element let withoutBackground = true let node = targetElement while (node.parentElement) { // until document const styles = window.getComputedStyle(node) if (styles.backgroundColor === 'transparent' || ... ) { // Maybe backgroundImage should be checked too. // node has no background, so check the parent node = node.parentElement } else { withoutBackground = false break } } if (withoutBackground) { // the target element has no its own background. So you can apply your solution. } To improve : a caching strategy for a once checked node to skip would be better.) However, I’m not too fond of this approach, getComputedStyle is very expensive Rather, it would be better to propose a theme style guide as MagicMirror’s default coding rules.
    • M

      Moment Timezone has no data for GMT+abcd

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved Troubleshooting
      4
      0 Votes
      4 Posts
      751 Views
      M
      @sdetweil Thanks for looking. Classic Microsoft behaviour :)
    • M

      Unreliable sockets

      Watching Ignoring Scheduled Pinned Locked Moved Bug Hunt
      2
      0 Votes
      2 Posts
      407 Views
      S
      @mystara yes it’s possible for the socket to die without informing the application layer. I spent about a year debugging a hang on one of my modules in a similar situation. I added MMM-WatchDog, which also exhibited the same problem. in the end I replaced the networking w a google wifi cluster and have not seen the problem since. altho I could never trace down to a network failure. I don’t know if socket.io can inform the application layer of a problem. it does all kinds of recovery under the covers.
    • 1 / 1