Jump to content


Photo

Lineup Alert Module


53 replies to this topic

#31 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,579 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 14 June 2015 - 03:23 PM

will start working on a script that will be handy for dynasty commissioners next , to track the taxi squad and IR , to give a warning on any IR violation or taxi squad violation


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#32 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,579 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 15 June 2015 - 06:12 PM

have one last task on this script , for leagues that allow a range of starting players (minimum starters differs from maximum starters) , the script isn't working , as it needs a dedicated sum to search the table cells

 

hooked82 is working on a fix , as i haven't been able to figure anything out myself


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#33 edytwinky

edytwinky

    Veteran

  • Members
  • PipPipPip
  • 178 posts

Posted 08 August 2015 - 08:33 AM

Great work TOS. 

 

Gotta question, is a team with a valid lineup supposed to show? I've been doing some testing and set a couple lineups and the team still comes up when a full lineup is set. None of the players are on BYE or listed as OUT or IR.



#34 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,579 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 08 August 2015 - 08:58 AM

Can't give any feedback without a link to your site

FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#35 edytwinky

edytwinky

    Veteran

  • Members
  • PipPipPip
  • 178 posts

Posted 08 August 2015 - 09:34 AM

Can't give any feedback without a link to your site

 

http://www10.myfanta...15/home/43771#0

 

Lineups have been temporarily set for all teams but some teams still show up as incomplete lineups.

 

 

Also shout out to Quickolas1 for all his help this past week.



#36 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,579 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 08 August 2015 - 09:58 AM

try recopying my script , yours doesn't match what i have posted/updated awhile ago


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#37 edytwinky

edytwinky

    Veteran

  • Members
  • PipPipPip
  • 178 posts

Posted 08 August 2015 - 10:02 AM

try recopying my script , yours doesn't match what i have posted/updated awhile ago

 

The script from the first post? I used the code from the first post in the thread. For some reason some teams show complete lineups and others don't.

 

<!-----  LOAD LINEUP ALERT SCRIPT  ------>

<script type="text/javascript">

  var donotcountBye = true; // SETTING TO FALSE WILL NOT ALERT IF A OWNER IS STARTING A BYE WEEK PLAYER
  var donotcountI   = true; // SETTING TO FALSE WILL NOT ALERT IF A OWNER IS STARTING A INJURED PLAYER
  var donotcountS   = true; // SETTING TO FALSE WILL NOT ALERT IF A OWNER IS STARTING A SUSPENDED PLAYER
  var donotcountO   = true; // SETTING TO FALSE WILL NOT ALERT IF A OWNER IS STARTING A PLAYER DEEMED OUT

//Add a span warning to players on bye and use this to acquire player status
$("td.player+td:contains('Bye')").prev().append("(<span class='warning'>B</span>)");

//Search each td.player cell from player status of out - suspended - bye - injured
var getPlayerStatus = function() {
    var Status = "td.player";
    if(donotcountI) {
        Status = Status + ":not(':has(.warning):contains(I)')";
    }
    if(donotcountS) {
        Status = Status + ":not(':has(.warning):contains(S)')";
    }
    if(donotcountO) {
        Status = Status + ":not(':has(.warning):contains(O)')";
    }
    if(donotcountBye) {
        Status = Status + ":not(':has(.warning):contains(B)')";
    }
    return Status;
}

  var RequiredStarters = 0;

  var clazz = {};

     
  $(document).ready(function () {

    //API request to get each leagues required starters
    $.ajax({
      type: "GET",
      url: location.protocol + '//' + window.location.hostname + '/%YEAR%/export?TYPE=league&L=%LEAGUEID%&W=&JSON=1'
      }).done(function (data) {
      RequiredStarters = data.league.starters.count;

       //Scrape DOM of options_06 page for the starting lineups
       $.get('http://%HOST%/%YEAR%/options?L=%LEAGUEID%&O=06', function (data) {
         $(data).find('td.two_column_layout .report').each(function (index, element) {
           if ($(this).find(getPlayerStatus()).length !== +RequiredStarters && $(this).attr("id") !== "InvalidLineup") {
              var target = $("#InvalidLineup").find("tbody");
                $(this).find("span a").each(function () {


              //This prevents duplicate team names or logos from appending for leagues using double and triple headers
              var className = this.className;
              if (clazz[className]) {
                 return
              }
              clazz[className] = true;

              //Create and format the newly appended table
              target.append("<tr class='oddtablerow'><td>" + $(this)[0].outerHTML + "</td><td class='lineupalert'><a class='lineuplink' href='http://%HOST%/%YEAR%/options?LEAGUE_ID=%LEAGUEID%&O=02&%FRANCHISEID%'>Submit Valid Lineup</a></td></tr>");
                });
           }
         });

              //Add a th to the newly created table to show if all teams have legal lineups if nothing is appended to the table
              var $lineuprow = $("#InvalidLineup tr");
                  if ($lineuprow.length == 1) {
                  $lineuprow.text("All Teams Have Valid Lineups").addClass("oddtablerow").wrapInner("<td class='noevent'></td>");
                  }
              });
    });
  });
</script>



<!-----  LINEUP ALERT HTML  ------>

<table class="homepagemodule report" id="InvalidLineup" align="center" cellspacing="1">
    <caption><span>LINEUP ALERT</span></caption>
    <tbody>
        <tr> <th colspan="2">The Following Teams Have Invalid Lineups</th></tr>
    </tbody>
</table>



<!-----  LINEUP ALERT CSS EDIT TO PERSONAL APPEARANCE   ------>

<style>
#InvalidLineup td a.lineuplink {
     text-decoration:none;
     text-align:center;
     background: none repeat scroll 0px 0px #FFF;
     border-radius: 5px;
     border: 1px solid rgba(38, 62, 104, 0.4);
     box-shadow: 0px 0px 13px 1px rgba(38, 62, 104, 0.2) inset;
     padding:0 5px;
     line-height:25px;
}

#InvalidLineup td.lineupalert  {
     background:rgba(255,0,0,.1);
     text-align:center;
     width:50%;
}

#InvalidLineup td.noevent  {
     background:none;
     text-align:center;;
}
</style>


#38 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,579 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 08 August 2015 - 10:18 AM

test loading this library instead of that version you have

 

replace this

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 

 

 

with this

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 

 

 

 

 

if that doesn't work , you need to duplicate your league , remove all the HPM's , all css , and just install the lineup script to see if it works , then add your HPM's back 1 by 1 until conflict appears


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#39 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,579 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 08 August 2015 - 10:25 AM

make sure you get the full url in the script , i viewed the source and it only grabbed partial url

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 

FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#40 edytwinky

edytwinky

    Veteran

  • Members
  • PipPipPip
  • 178 posts

Posted 08 August 2015 - 10:35 AM

make sure you get the full url in the script , i viewed the source and it only grabbed partial url

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 

 

Gave it a whirl with the above script replacement. No dice. Its so weird how it works for some teams and others it doesn't.

 

Oh well. It's a very nice script. I just don't have the time to duplicate everything. Thanks for the assistance though.



#41 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,579 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 08 August 2015 - 03:02 PM

updated version loaded on first post , i do not know if MFL changed some HTML on the options_06 page , but this was working fine in about a month ago , and then stopped due to an HTML difference . Working fine now again though...


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#42 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,579 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 08 August 2015 - 03:15 PM

posted again , here is script i'm using to show this during the season and not in the offseason. Just paste below the IR / Lineup module scripts in same HPM

 

<!-----  SHOW IR AND SUBMIT LINEUP MODULES ONLY DURING NFL SEASON ------>

<script type="text/javascript">
$(document).ready(function () {

  var findDate      = new Date();

  var displayModule = new Date("September 7,2015"); //SET STARTING DATE YOU WANT TO DISPLAY MODULES

  var hideModule    = new Date("January 4,2016");   //SET ENDING DATE YOU WANT TO REMOVE MODULES

  if(findDate > displayModule && findDate < hideModule) {
  } else {
    $("#InvalidLineup").remove();
    $("#IRviolations").remove();
  }

});
</script> 

FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/


#43 quickolas1

quickolas1

    Veteran

  • Members
  • PipPipPip
  • 958 posts
  • Gender:Male

Posted 12 August 2016 - 12:33 PM

Instead of giving a background color to the table data (td) for the Starting Lineup and IR Alert modules, replacing with this simple line will work perfectly to color all the even table rows:

 

#InvalidLineup tr:nth-child(even) {background: #eee; }

#IRviolation tr:nth-child(even) {background: #eee; }

 

You want the table data (td) to be transparent or just not coded at all so the row background-color takes precedence.

I picked to background-color the even rows because if you have a table header (th) in the report/module, that's technically the first row.

Or I guess you could code it for all the odd rows and then call out the table header separately.

Or do all of the above if you want a distracting rainbow color-scheme like some of you seem to love (a web design no-no).

 

~~~~~

 

This also means the HTML is unnecessarily bulky in every single league with every row being assigned an even or odd class by MFL.

<tr class="eventablerow">

<tr class="oddtablerow">

You can just call it out using the CSS nth-child.



#44 Screaming Eagle

Screaming Eagle

    Veteran

  • Members
  • PipPipPip
  • 321 posts
  • Gender:Male
  • Location:Denver

Posted 01 June 2017 - 12:59 PM

There are a lot of buttons for "submit valid lineup." Is there a way to only show 1 button, maybe as a reportfooter, and only displayed for the teams that are invalid?
Gridiron Tavern, the best IDP league available.

#45 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 3,579 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 06 June 2017 - 06:46 PM

There are a lot of buttons for "submit valid lineup." Is there a way to only show 1 button, maybe as a reportfooter, and only displayed for the teams that are invalid?

 

 

adjusting the script now with var to show single button as report footer or buttons by each team name/icon

 

also adding var to show module at all times or only show during the NFL season


FREE Player Cuts Collection
https://www.nitrogra...om/player-cuts/




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users