fewieden / MagicMirror-Hackathon

Hackathon for the MagicMirror² project and 3rd party modules. https://forum.magicmirror.builders/topic/9298/magicmirror-hackathon-2018
4 stars 0 forks source link

[MMM-NFL] Config option to reverse teams #16

Closed fewieden closed 5 years ago

fewieden commented 5 years ago

Details can be found here https://github.com/fewieden/MMM-NFL/issues/22

justjim1220 commented 5 years ago

this is done by changing the order of the code in this section of the js file:

` appendDataRow(data, appendTo) { if (!this.config.focus_on || this.config.focus_on.indexOf(data.h) !== -1 || this.config.focus_on.indexOf(data.v) !== -1) { const row = document.createElement('span'); row.classList.add('row');

        const awayLogo = document.createElement('td');
        awayLogo.appendChild(this.createIcon(data.v, true));
        row.appendChild(awayLogo);

        const awayTeam = document.createElement('td');
        awayTeam.classList.add('align-right');
        const awayTeamSpan = document.createElement('span');
        awayTeamSpan.innerHTML =  "<font color=#0000ff>&nbsp;&nbsp;" + data.v + "</font>";
        awayTeam.appendChild(awayTeamSpan);
        this.appendBallPossession(data, false, awayTeam);
        row.appendChild(awayTeam);

        const awayScore = document.createElement('td');
        awayScore.innerHTML = "<font color=#ffff00>&nbsp;&nbsp;" + data.vs + "</font>";
        row.appendChild(awayScore);

        const vs = document.createElement('td');
        vs.setAttribute('style', 'font color:#FF0000');
        vs.innerHTML = "<font color=#ffffff>&nbsp;&nbsp; @ &nbsp;&nbsp;</font>";
        row.appendChild(vs);

        const homeScore = document.createElement('td');
        homeScore.innerHTML = "<font color=#ffff00>" + data.hs + "&nbsp;&nbsp;</font>";
        row.appendChild(homeScore);

        const homeTeam = document.createElement('td');
        homeTeam.classList.add('align-left');
        this.appendBallPossession(data, true, homeTeam);
        const homeTeamSpan = document.createElement('span');
        homeTeamSpan.innerHTML = "<font color=#0000ff>" + data.h + "&nbsp;&nbsp;</font>";
        homeTeam.appendChild(homeTeamSpan);
        row.appendChild(homeTeam);

        const homeLogo = document.createElement('td');
        homeLogo.appendChild(this.createIcon(data.h));
        row.appendChild(homeLogo);

` I have not yet figured out how to do a pull request to add this to the master or develop branches.

If you can give me a step-by-step instructions I will do the pr for it...

justjim1220 commented 5 years ago

https://github.com/fewieden/MMM-NFL/pull/24