Jump to content


Photo

Tabbed Rosters - MFL Scripts


103 replies to this topic

#1 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,325 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 14 December 2020 - 10:02 AM

Please use this thread to post all questions related to the Tabbed Rosters script.

 

ATTENTION - ANY AND ALL SCRIPTS REQUIRE TO HAVE THIS GLOBAL CACHE SCRIPT PLACED AS THE FIRST ITEM IN YOUR HEADER MESSAGE !!! The script builds a cache for local storage and indexedDB storage in your browser to limit the API call to the MFL Server.

You only need a single copy of this  ,do not add multiple times if using multiple scripts.

<script src="https://www.mflscripts.com/mfl-apps/global/cache.js"></script>

 

See troubleshooting section at very bottom of this post before submitting a question.

 

Before installing any scripts - please review this video tutorial on how to prepare your MyFantasyLeague site for customizations.

 

Access ALL of MFLScripts here.

 

example.jpg

 

 

Most if not all of our custom scripts require the addition of a font awesome library to be loaded into a homepage message that is marked as a "Header"  OR you can import the font awesome stylesheet into your main css file , it must be the very first line in your css file. Its likely if your using any of our scripts you already have a copy loaded, so please disregard and move onto the main script installation section.

 

 

Example 1 - inserting font awesome js file into a header message

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css"/>  

 

 

 

Example 2 - inserting font awesome into your main css file as first line in the stylesheet

@import "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css";  

 

 

 

 

TABBED ROSTERS SCRIPT INSTALLATION

Add or place the following into any "Footer" marked message. The script will replace the default MFL Rosters page with a custom tabbed roster/trade page. There are a few different settings to adjust to fit the need of your leagues.

 

This setting MUST be disabled to use this script

Player Links Launch Player Profile Popup? No
<script>
// THE FOLLOWING SETTING IN THE MFL SETUP CALLED "REPORTS AND SECURITY SETTINGS" MUST BE DISABLED OR THIS SCRIPT WILL NOT WORK.
// FIND "Player Links Launch Player Profile Popup?" and set to "No"


var tradeViewPermission = true;     // true = display trade button , false = hide trade button
// var tradeViewPermission must be set to true to set showTradesDefault to true , otherwise leave showTradesDefault as false
var showTradesDefault      = false;  // Set to ture to display the trades tab on page load , other wise set to false to show roster tab
var fid_commish         = "0004";   // enter 4 digit franchiseID of commissioners franchise , if commish has no franchise skip
var showNav             = false;     // true = mfl nav menu for weekly rosters and display grid , false = hide mfl nav menu
var showMFLdefaultBtn   = true;     // set to true to add button to click and show MFL default rosters page
var showAllstatus       = false;    // set to true always display roster IR - Taxi Squad and Assets on page load - then you can toggle to hide
var rosCapdisplay       = '4';	    // 0=icon; 1=logo; 2=name; 3=abbrev; 4=default appearance - set to display on roster table captions

                                    // If using contracts and/or salaries you MUST set leagueTypeNormal to false
var leagueTypeNormal    = true;     // set to true for none salary and/or contract leagues , false if using contracts or salaries

// IF LEAGUETYPENORMAL IS TRUE THEN SET THIS OTHERWISE IGNORE
var SetLeftColumnWidth  = 150;      // set width of icons/text names that toggle to display rosters - 200px should be max setting

// IF USING ICONS VERSE NAME THEN SET THIS OTHERWISE IGNORE
var SetCaptionIconWidth = 250;      // set width of icons in roster table captions

var RosterEnableMedia   = true;     // true = if your skin is using responsive design must set true , false = skin not using responsive css

// Show Trade calculator for sarlary and contrace leagues
var showCalculator      = false;     // set to true to add calculations to the trade section
var showTopCalculator   = false;     // set to true to display calculations at the top of your screen (useful for large rosters)
var calcHeaderName = 'Giving Away';  // Title for what your team is trading away or giving up in the trade
var hideTilClk = false; // Set to true to hide the calculations tables until player trade checkbox is clicked
</script>

<!-- MFL TABBED ROSTER-TRADE JS FILE -->
<script src="https://www.mflscripts.com/mfl-apps/rosters/script.js"></script>

 

 

 

 

 

 

Optional CSS for league that use text names and do not use mini banners / icons for their franchises.

<!-- IF USING TEXT NAMES AND NO ICONS THEN ADD THIS CSS AND CHANGE COLORS AS YOU SEE FIT - not required but some style to wrap around text names looks a bit better -->
<style>
#roster_column_left a{
  background:#263e68;/*change bg color to what you want*/
  color:#fff;/*change font color to what you want*/
  display:block;
  line-height:20px;
  border-radius:5px;
  white-space:nowrap;
  padding:0 3px;
  margin:0 0 3px 0;
  text-decoration:none;
  text-align: center;
}
#roster_column_left a:hover{
  background:#cd2122;/*change hover bg color to what you want*/
  color:#fff;/*change hover font color to what you want*/
}
</style>

 

 

 

Optional CSS for use of the Trade Review addon

<!-- CSS TO STYLE TO TRADE REVIEW ADDON -->

<style>
#MFLroster tr.total_salary_row th,
    tr.tradedifference td {
    color:#fff
}
#MFLroster tr.total_salary_row th {
    background:#600;
    color:#fff
}
#MFLroster tr.salary_cap_row th {
    background:#060;
    color:#fff
}
#MFLroster .savingsreview {
    background: var(--site-bg-image-one,#222)!important;
    border-top:4px solid var(--accent-dark,var(--accent,#777))
}
</style>

 

 

TROUBLESHOOTING TIPS

 

1. Make sure to review the help video to check your league settings are setup so customized scripts can be used.

 

2. Recopy the code above and try again. Be sure your advanced editor is turned off.

 

3. Right click mouse on your page where script displays and click "Inspect Element" . In the browsers new popup window that displays , click on the "Console" tab. Now click on the "Errors" section. Here you will find a list of any errors that have occurred. Many errors our self explanatory and you can address yourself. If your error is showing cross site  CORS has been blocked , then you need to check every CSS, JS and IMAGE file on your site and be sure they all are using https  url and not http. Another error that appears could be "too many requests" , this happens when you refresh your site many times and MFL blocks your IP for 15 minutes for submitting too many API request. If thats the case , just wait 15-20 minutes and try again.

 

4. Check out the MFL Menu > Help section. We have added a new link here called "Manage Cache". By default we are caching the API files for our script in the browsers local storage. If you script isn't updating , you can force an update by clicking "Clear Local Storage". The next link is called "Enable IndexedDB" , this link is only meant to be used for owner that are getting the "Too Many Requests" error because there are using several scripts on several different MFL leagues that use the same serverID. Click this if needed more storage.

 

5. If the above wasn't any help , then post a question and we will do our best to help when the time allows.

 

 

Optional CSS for league that use text names and do not use mini banners / icons for their franchises.


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#2 Game Time

Game Time

    Veteran

  • Members
  • PipPipPip
  • 819 posts
  • Gender:Male

  • 2021 MFL: 59644

Posted 02 January 2021 - 09:32 PM

love this script..... is there anyway to have contracts displayed instead of bye... just curious as contracts are much more important in our league (especially for trading) than the bye weeks.......


Formerly of Nitrografixx... still do freelance graphic work.. Message me if needing work done!


#3 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,325 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 02 January 2021 - 09:41 PM

contracts do display until screen size goes down

 

check the css using developer you can hide or unhide whichever column you want


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#4 Game Time

Game Time

    Veteran

  • Members
  • PipPipPip
  • 819 posts
  • Gender:Male

  • 2021 MFL: 59644

Posted 03 January 2021 - 07:34 AM

will do thanks.... is there any way to just switch the bye and contract columns around...  I don't really want to get rid of any it is just on phones the first 2 columns only show (pts and bye).... if I could switch bye and contract around that may do what I'm looking for too... Just a thought, not a big deal....


Formerly of Nitrografixx... still do freelance graphic work.. Message me if needing work done!


#5 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,325 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 03 January 2021 - 08:23 AM

the roster script doesn't create the rosters , the rosters report is actually a clone of the MFL Module "Rosters"  , so anything on that MFL module can be displayed , you can hide bye and show contracts

 

 

To hide "BYE" and show "CONTRACT" 

 

just add/change css , you can click on the columns in developer and see what is happening 

 

here is the css you need to add to reshow contract column and then to hide bye

 

@media only screen and (max-width: 62.5em){
  #roster .contractyear {
    display: table-cell;
  }
  #roster .week {
    display: none;
  }
}

 


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#6 Game Time

Game Time

    Veteran

  • Members
  • PipPipPip
  • 819 posts
  • Gender:Male

  • 2021 MFL: 59644

Posted 03 January 2021 - 08:48 AM

thank you again!


Formerly of Nitrografixx... still do freelance graphic work.. Message me if needing work done!


#7 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,325 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 21 January 2021 - 07:21 AM

If you have this script installed and your not using our custom template , see changes below 

 

 

1. Find the homepage message where you currently have the rosters script installed. Delete the message contents and save it.

 

2. If you have the rosters displaying on a tab on your homepage , delete it. The new version will not function

 

3. Open up a message that you have marked as a footer , or create a new homepage message and mark it as a footer , then copy the below script , adjust the var settings to fit your league and save the message.

<script>
var tradeViewPermission = true;     // true = display trade button , false = hide trade button
var fid_commish         = "0004";   // enter 4 digit franchiseID of commissioners franchise , if commish has no franchise skip
var showNav             = false;     // true = mfl nav menu for weekly rosters and display grid , false = hide mfl nav menu
var showMFLdefaultBtn   = true;     // set to true to add button to click and show MFL default rosters page
var showAllstatus       = false;    // set to true always display roster IR - Taxi Squad and Assets on page load - then you can toggle to hide

                                    // If using contracts and/or salaries you MUST set leagueTypeNormal to false
var leagueTypeNormal    = true;     // set to true for none salary and/or contract leagues , false if using contracts or salaries

// IF LEAGUETYPENORMAL IS TRUE THEN SET THIS OTHERWISE IGNORE
var SetLeftColumnWidth  = 150;      // set width of icons/text names that toggle to display rosters - 200px should be max setting

// IF USING ICONS VERSE NAME THEN SET THIS OTHERWISE IGNORE
var SetCaptionIconWidth = 250;      // set width of icons in roster table captions

var RosterEnableMedia   = true;     // true = if your skin is using responsive design must set true , false = skin not using responsive css
</script>

<!-- MFL TABBED ROSTER-TRADE JS FILE -->
<script src="https://www.mflscripts.com/mfl-apps/rosters/script.js"></script>

 

Now you can click on the Rosters link in the menu and view the new rosters script which replaces the MFL default rosters page. If you have any custom links or images on your site that are pointing to the old roster homepage message , then redirect them to the MFL Rosters page.

 

The reason for the script update is speed and performance. Half as many API calls are needed , page loads 5-10 times faster for rosters


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#8 Agent575

Agent575

    Veteran

  • Members
  • PipPipPip
  • 333 posts
  • Gender:Male

Posted 02 February 2021 - 04:38 PM

So there's no longer a way to have this on a tab like we have done in the past?

Or the teams vertically on the left versus scrolling across the top?

Not seeing draft picks as an option when trade is enabled.

Not seeing BBID dollars either.


signaturerosterwarspresident.jpg
advertisingeternals.jpg
signaturemyfantasygraphics.jpg

#9 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,325 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 02 February 2021 - 05:50 PM

this replaces MFL rosters page , so no option to add on homepage tabs which was a very bad idea to start with

 

vertial and horizontal team icons still exist but not if you have a contracts / salary league as they have too many columns

 

draft pics and BBID dollars are displayed on the trades tabs area at bottom with a show/hide link 


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#10 StevenB14

StevenB14

    Veteran

  • Members
  • PipPipPip
  • 76 posts

Posted 03 February 2021 - 10:16 AM

This is great. Having it replace the default rosters page is much better.



#11 Agent575

Agent575

    Veteran

  • Members
  • PipPipPip
  • 333 posts
  • Gender:Male

Posted 04 February 2021 - 10:07 AM

this replaces MFL rosters page , so no option to add on homepage tabs which was a very bad idea to start with

 

vertial and horizontal team icons still exist but not if you have a contracts / salary league as they have too many columns

 

draft pics and BBID dollars are displayed on the trades tabs area at bottom with a show/hide link 


Understood.  Thanks.

 

I saw the show/hide option for IR and TS players but I'm definetly not getting draft picks and BBID and not see what is preventing it from working.

https://www65.myfant...ns?L=38933&O=07

Guessing without being logged in that's not gonna help you much.

 

 

Is there a way to have the default setting to SHOW instead of HIDE?


signaturerosterwarspresident.jpg
advertisingeternals.jpg
signaturemyfantasygraphics.jpg

#12 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,325 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 04 February 2021 - 11:05 AM

ya its impossible to see without access

 

pm me your username and password so i can login , i dont have logic setup to do show by default

 

you can use css to display table-row and table cell on the classes with an !important , and they will all show


All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#13 Agent575

Agent575

    Veteran

  • Members
  • PipPipPip
  • 333 posts
  • Gender:Male

Posted 04 February 2021 - 11:39 AM

ya its impossible to see without access

 

pm me your username and password so i can login , i dont have logic setup to do show by default

 

you can use css to display table-row and table cell on the classes with an !important , and they will all show


I figured it out.  The coding in the CSS for the rosters tab we had was the culprit.  I removed this and the ability to see picks and BBID is now there.  Thanks

 

/*  =================ROSTER TAB
============================================================ */
.assetsCollapsed td{display:table-cell!important;}
.assets th{visibility:hidden;font-size:0;}
.assets th a{display:none;}
.assets th:before{content:"Draft Picks";visibility:visible;font-size:14px;background:#3c312f;display:block;color:#fff}

#homepagecolumns #MFLroster table {border: none;}
#homepagecolumns #MFLroster caption {visibility: hidden;}
#homepagecolumns #MFLroster caption a {visibility: visible;}


 


signaturerosterwarspresident.jpg
advertisingeternals.jpg
signaturemyfantasygraphics.jpg

#14 theeohiostate

theeohiostate

    Veteran

  • Members
  • PipPipPip
  • 4,325 posts
  • Gender:Male
  • Location:O-H-I-O

Posted 04 February 2021 - 12:07 PM

added var to display all IR , Taxi Squad and Assets on page load , then you can toggle to hide / show them

 

var showAllstatus       = false;    // set to true always display roster IR - Taxi Squad and Assets on page load - then you can toggle to hide

All the scripts I post were created by Habman , with some small contributions from myself. The man has done an outstanding job giving the community a variety of options to enhance the site. Thank you sir !!


#15 DA-G-GURU

DA-G-GURU

    Veteran

  • Members
  • PipPipPip
  • 1,208 posts
  • Gender:Male
  • Location:DAGrafixDesigns.com

  • 2021 MFL: 15387

Posted 04 February 2021 - 12:47 PM

added var to display all IR , Taxi Squad and Assets on page load , then you can toggle to hide / show them

 

var showAllstatus       = false;    // set to true always display roster IR - Taxi Squad and Assets on page load - then you can toggle to hide


This is what we spoke on yesterday isnt it?

 

If you toggle to hide (as user) does the script cookie that to remember?


Simply The Best in Grafix and CSS webdesign since 2005

www.dagrafixdesigns.com

---------------
Twitter @DA_Sticks



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users