MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    How to load a <script> src = " " </script> into my mirror?

    Development
    4
    35
    18061
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cowboysdude
      cowboysdude Module Developer @nbrenn last edited by

      @nbrenn I believe you can do it with a classid…

      var gameTemp = document.createElement("div");
                     gameTemp.classList.add("gametemp");
      

      Then add it your css file:

      .MMM-NFLweather .gametemp {
          color: #10B1C8;
      }
      
      strawberry 3.141 1 Reply Last reply Reply Quote 1
      • strawberry 3.141
        strawberry 3.141 Project Sponsor Module Developer @cowboysdude last edited by

        @cowboysdude this will not work for images

        therefore you have to add a filter -webkit-filter: grayscale(100%);

        Please create a github issue if you need help, so I can keep track

        cowboysdude 1 Reply Last reply Reply Quote 2
        • cowboysdude
          cowboysdude Module Developer @strawberry 3.141 last edited by cowboysdude

          @strawberry-3.141 Yeap you’re right… he wanted greyscale… ok got it!

          nbrenn 1 Reply Last reply Reply Quote 1
          • nbrenn
            nbrenn @cowboysdude last edited by

            @cowboysdude @strawberry-3-141

            I’m having trouble getting my icon to load. My getDom looks like the following:

            getDom: function() {
            		var wrapper = document.createElement("div");
            
            		if (!this.loaded) {
            			wrapper.innerHTML = this.translate("Loading...");
            			wrapper.className = "dimmed light small";
            			return wrapper;
            		}
            		wrapper.className = "datafeed";		
            		var myLogo = document.createElement("span");
            			var myIcon = document.createElement("img");
            			myLogo.classList.add("myLogo");		
            			myIcon.src = this.file("my_logo.png");
            			myLogo.appendChild(myIcon);
            		wrapper.appendChild(myLogo);
            		
            		wrapper.innerHTML = "Today, your sum is " + this.sum ;
            		return wrapper;
            	},
            
            strawberry 3.141 1 Reply Last reply Reply Quote 0
            • strawberry 3.141
              strawberry 3.141 Project Sponsor Module Developer @nbrenn last edited by

              @nbrenn

              you are overwriting the innerhtml of the wrapper

              Please create a github issue if you need help, so I can keep track

              1 Reply Last reply Reply Quote 0
              • 1
              • 2
              • 3
              • 4
              • 4 / 4
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy