Jump to content


Photo

Submit Lineup V2 - MFL Scripts


11 replies to this topic

#1 theeohiostate

theeohiostate

    Veteran

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

Posted 09 October 2021 - 09:36 AM

Please use this thread to post all questions related to the Submit Lineup V2 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.

 

Once you have the script installed , go to your lineups page. There will be a button called "Custom Submission Form" at the bottom , click it to activate the custom lineups.

 

 

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";  

 

 

 

 

SUBMIT LINEUP V2 SCRIPT INSTALLATION (MFLScripts template users already have the script and css installed DO NOT INSTALL THIS)

Pace the following into any homepage message (Mark as a "Header" message). This lineup script converts the stock MFL lineup page into a custom mobile friendly version.

<script>
var load_lineups_submit_script = true; 	//Set to true to load custom lineup script
var lu_useDefaultAsPrimary = false;	//Set to true to use the MFL default lineup submission page until owner decides to click to use custom
var hideFantasySharks = false;	 	//Set to true to hide links to Fantasy Sharks
var hideOptionalMsg   = false;   	//Set to true to hide optional message input below lineup table
var hideLineupHint    = false;	 	//Set to true to hide the lineup "Hint" message below lineup table
var showWeatherPop    = true;	        //Set to false to remove the popup for the weather link
</script>

<script type="text/javascript" src="https://www.mflscripts.com/mfl-apps/lineups/submitV2/script.js"></script>

 

 

 

CSS

<style>
/*******************************************/


/* SUBMIT LINEUP FORM */


/*******************************************/

/* change color for the small arrow to left top side of previous starters player image */
#body_lineup.custom_lineup_body tr.previous_starter.player_row td.pphoto:before {
	font-size: 14px;
	height: 14px;
	width: 14px;
	background: #fff;
	text-align: center;
	border-radius: 50%;
	color: green
}


/* change locked player icon for Starting players games started */
#body_lineup.custom_lineup_body tr.locked_starter:after {
	color: green
}


/* change checkbox color for players you have selected to start */
#body_lineup.custom_lineup_body tr.current_starters_row:after {
	color: green
}


/* change text color for projected points */
#body_lineup.custom_lineup_body form td.proj-pts,
#body_lineup.custom_lineup_body form span.points_row .proj-pts {
	color: green
}


/* change text color for projected points header title */
#body_lineup.custom_lineup_body form tr.starters_pos_row+tr td.proj-pts:before {
	color: #263e68
}


/* change locked player icon for Bench players games started */
#body_lineup.custom_lineup_body tr.locked_bench:after {
	color: red
}


/* change background and text color for the small circle on player photos that shows injury designation */
#body_lineup.custom_lineup_body form td.inj b.warning {
	color: #fff;
	background: red
}


/* change background and text color error message displayed if too many or too few starters are selected */
#body_lineup.custom_lineup_body .starter_count .warning_minimum_error, 
#body_lineup.custom_lineup_body .starter_count .warning_maximum_error, 
.starter_count_sub.starter_count_sub_fail:before {
    background: red;
    color: #fff;
}


/* change arrow up color for players not select and on bench */
#body_lineup.custom_lineup_body tr.current_bench_row:after {
	color: red
}


/* change text color for players on bye shown in the matchup area */
#body_lineup.custom_lineup_body form td.weekly-opp .warning {
	color: red
}


/* color of checkbox on top of lock for locked started players */
#body_lineup.custom_lineup_body tr.previous_starter.locked_starter:before, #body_lineup.custom_lineup_body tr.previous_starter.locked_starter_game_over:before {
    color: #fff;
}


/* color of text "B" on top of lock for locked Benched players */
#body_lineup.custom_lineup_body tr.player_row.locked_bench:before, 
#body_lineup.custom_lineup_body tr.player_row.locked_bench_game_over:before {
    color: #fff;
}


/* color of font awesome icons in the submit button and custom button at bottom of page */
#body_lineup .form_buttons.default-btn:after,
#body_lineup .form_buttons:before {
	color: #fff
}


/* change background color circular player images */
#body_lineup.custom_lineup_body table td.pphoto img[src*="svg"],
#body_lineup.custom_lineup_body table tr.player_row td.pphoto img,
#body_lineup.custom_lineup_submission_body td.pphoto img {
    background: #e9ebf0;
}


/* change border color circular player images */
#body_lineup.custom_lineup_body table td.pphoto img,
#body_lineup.custom_lineup_submission_body td.pphoto img {
    border: 2px solid #263e68;
}


/* change background and text color for players rank box that shows at bottom of each players photo */
#body_lineup.custom_lineup_body form tr.player_row td.pos-rank {
    background: #263e68!important;
    color: #fff;
}


/* change bottom border color for each "th" table header for linep table */
.starters_pos_th {
	border-bottom: 3px solid #263e68
}


/* change bottom border color for each tablerow for linep table */
#body_lineup.custom_lineup_body form tr {
	border-bottom: 1px solid #ccc
}


/* change text color for weekly opponent matchups */
#body_lineup.custom_lineup_body form td.weekly-opp,
#body_lineup.custom_lineup_body form td.weekly-opp a,
.custom_lineup_submission_body tr.starter_totalsRow td {
	color: #cd2122
}


/* change background and color for drop down that displays as you scroll down page to show current starters */
.starter_count_reason_more, 
.starter_count_reason_less, 
#body_lineup.custom_lineup_body .links_nav a {
    color: #fff;
    background: #263e68;
}

.starter_count_reason_more:hover, 
.starter_count_reason_less:hover, 
#body_lineup.custom_lineup_body .links_nav a:hover {
    color: #fff;
    background: #cd2122;
}


/* change background and color for drop down button that displays as you scroll down page to show current starters */
.starter_count_sub {
    border: 3px solid #cd2122;
    background: #263e68;
    box-shadow: 0 0 0.6rem rgb(45 45 45 / 50%);
    color: #fff;
    border-top: 0;
}

#body_lineup p.form_buttons.buttonDisabledContainer:before {
	opacity: .5;
	pointer-events: none;
}

#body_lineup.custom_lineup_body caption {
	text-align: left!important
}

.locked_bench,
.locked_starter {
	cursor: default!important
}






/*******************************************/


/* SUBMIT LINEUP POPUP WEATHER */


/*******************************************/

#weather-wrapper .current-conditions-place {
	color: #263e68
}

#weather-wrapper .as_close_btn {
	background: red;
	border-color: red;
	color: #fff;
}

#weather-wrapper .as_close_btn:hover {
	background: #000;
	border-color: #000;
	color: #fff
}

#popup-weather-wrapper #popup-weather-container {
	background: #fff;
}

.kickoff-conditions-temp,
.current-conditions-temp {
	color: #263e68
}

.current-conditions-header .current-conditions-text,
.kickoff-conditions-header .kickoff-conditions-text {
	color: #000
}

.current-conditions-wrapper,
.kickoff-conditions-wrapper {
	border: 0!important;
	border-radius: 0!important;
}

.kickoff-conditions-wrapper {
	border-top: 10px solid #ccc!important;
	border-radius: 0!important;
}
</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.


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 theeohiostate

theeohiostate

    Veteran

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

Posted 09 October 2021 - 10:18 AM

All provided MFL table column information , aside of the news link is shown in this new lineups script at all times

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 !!


#3 theeohiostate

theeohiostate

    Veteran

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

Posted 16 October 2021 - 04:28 PM

add new var for a popup weather , MFL links the weather to another website and you have to leave the page , we got a weather API and import that current and gametime weather so you can view without leaving the page

 

new var added

var showWeatherPop    = true;	        //Set to false to remove the popup for the weather link

 

css to change background color of the popup table

/* popup weather background color */
#popup-weather-wrapper #popup-weather-container{background:#fff}

 

 

example weather popup

 

example2.jpg


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 UFFLCommish

UFFLCommish

    Veteran

  • Members
  • PipPipPip
  • 530 posts
  • Gender:Male
  • Location:TN

Posted 16 October 2021 - 08:19 PM

Thanks TOS. Works great.

 

Can you provide the css to remove the shading?

 

screenshot7.png

 

League ID: 26088

 

I inspected the element and can't figure out if it's caused by the HawkBlue css or some custom css.

 

Thanks!



#5 theeohiostate

theeohiostate

    Veteran

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

Posted 16 October 2021 - 08:40 PM

.eventablerow td {    background-color: #E9EEF4;}
 
as soon as i click on inspector for the cells , i see this
 
i added css in the script to remove that css in those base mfl skins

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 UFFLCommish

UFFLCommish

    Veteran

  • Members
  • PipPipPip
  • 530 posts
  • Gender:Male
  • Location:TN

Posted 16 October 2021 - 08:50 PM

I'm using Google Chrome and don't see that when I right click and Inspect. I'll try Firefox instead.

 

I added the css you provided for the script and it's not overriding the base or skin css which provides the background color for the odd and even rows.

 

Script still works just fine. Just would look better without the background colors.

 

Anyway, thanks for replying.



#7 theeohiostate

theeohiostate

    Veteran

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

Posted 16 October 2021 - 09:28 PM

should be fine now


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 UFFLCommish

UFFLCommish

    Veteran

  • Members
  • PipPipPip
  • 530 posts
  • Gender:Male
  • Location:TN

Posted 16 October 2021 - 10:33 PM

Thank you.



#9 theeohiostate

theeohiostate

    Veteran

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

Posted 16 October 2021 - 10:36 PM

Had to make some changes to cancel out TD background coloring
I updated the css in first post so you will need to re copy and apply your coloring for a few items

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 theeohiostate

theeohiostate

    Veteran

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

Posted 19 October 2021 - 09:05 PM

we have replaced all the MFL player headshots with new headshots that are higher quality and transparent backgrounds

 

nothing is needed on your end , the script is updated , we will be adding these new images to the player popup bio as well


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 !!


#11 BobA

BobA

    Veteran

  • Members
  • PipPipPip
  • 869 posts
  • Gender:Male
  • Location:Houston, Texas

  • 2021 MFL: 44355

Posted 20 October 2021 - 07:42 AM

TOS...should there be a <style> at the top of the CSS? The script went off the rails for me until I just took a guess and added it at the top.

 

-signed,

-The Last Guy Who Should Be Making Suggestions.


2021 League Home

 

The Ed Hughes Football League, Since 1980
2021...Our 42nd Season!! 


----------
"Yes, well, everybody in Casablanca has problems. Yours may work out." -Rick Blaine


#12 theeohiostate

theeohiostate

    Veteran

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

Posted 20 October 2021 - 08:28 AM

yes , updated


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 !!




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users