Jump to content


Photo

Franchise Names Formatting

LuckyDog Sports

15 replies to this topic

#1 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,655 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 01 October 2020 - 04:56 AM

Okay, I admit it - I'm stuck ("Not again, Mitch!")

 

I've tried numerous iterations of the classes and ids to change the color of a franchise name's text and haven't found the right combination.

 

Anybody willing to help me out and tell me the correct code? (I thought I saw a thread on this awhile back, but can't find it)

 

If you are asking why - I want to highlight the teams in each division with a different color in the US of A, i.e, Stars = Blue, Stripes = Red.


ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "


#2 theeohiostate

theeohiostate

    Veteran

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

Posted 01 October 2020 - 09:36 AM

there is no one size fits all to do this , will have to be individually styled for every single team , here is a start , this will get Franchise10 to color red in standings and in live scoring page

 

a.franchise_0010,a.franchise_0010:link,a.franchise_0010:visited,div[onclick*="0010"]{color:red}

 

to add another just duplicate and change all id_00

/* FRANCHISE 01 */  a.franchise_0001,a.franchise_0001:link,a.franchise_0001:visited,div[onclick*="0001"],
/* FRANCHISE 02 */  a.franchise_0002,a.franchise_0002:link,a.franchise_0002:visited,div[onclick*="0002"]
{color:red} 

 

Could parse the API to find all teams in each division or conference and setup variables to add css in designated areas for each division or conference team names but i have no time to mess around with that



#3 theeohiostate

theeohiostate

    Veteran

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

Posted 01 October 2020 - 10:09 AM

Here is your full All Play league css

 

/* STIPES DIVISION TEAM NAMES */
a[class*="00"],a[class*="00"]:link,a[class*="00"]:visited,div[onclick*="00"]
{color:green!important;font-weight:bold} 

/* STARS DIVISION TEAM NAMES */
/* FRANCHISE 01 */  a.franchise_0001,a.franchise_0001:link,a.franchise_0001:visited,div[onclick*="0001"],
/* FRANCHISE 05 */  a.franchise_0005,a.franchise_0005:link,a.franchise_0005:visited,div[onclick*="0005"],
/* FRANCHISE 07 */  a.franchise_0007,a.franchise_0007:link,a.franchise_0007:visited,div[onclick*="0007"],
/* FRANCHISE 09 */  a.franchise_0009,a.franchise_0009:link,a.franchise_0009:visited,div[onclick*="0009"],
/* FRANCHISE 10 */  a.franchise_0010,a.franchise_0010:link,a.franchise_0010:visited,div[onclick*="0010"],
/* FRANCHISE 11 */  a.franchise_0011,a.franchise_0011:link,a.franchise_0011:visited,div[onclick*="0011"],
/* FRANCHISE 12 */  a.franchise_0012,a.franchise_0012:link,a.franchise_0012:visited,div[onclick*="0012"],
/* FRANCHISE 15 */  a.franchise_0015,a.franchise_0015:link,a.franchise_0015:visited,div[onclick*="0015"],
/* FRANCHISE 17 */  a.franchise_0017,a.franchise_0017:link,a.franchise_0017:visited,div[onclick*="0017"],
/* FRANCHISE 18 */  a.franchise_0018,a.franchise_0018:link,a.franchise_0018:visited,div[onclick*="0018"],
/* FRANCHISE 20 */  a.franchise_0020,a.franchise_0020:link,a.franchise_0020:visited,div[onclick*="0020"],
/* FRANCHISE 21 */  a.franchise_0021,a.franchise_0021:link,a.franchise_0021:visited,div[onclick*="0021"],
/* FRANCHISE 23 */  a.franchise_0023,a.franchise_0023:link,a.franchise_0023:visited,div[onclick*="0023"],
/* FRANCHISE 27 */  a.franchise_0027,a.franchise_0027:link,a.franchise_0027:visited,div[onclick*="0027"],
/* FRANCHISE 30 */  a.franchise_0030,a.franchise_0030:link,a.franchise_0030:visited,div[onclick*="0030"],
/* FRANCHISE 31 */  a.franchise_0031,a.franchise_0031:link,a.franchise_0031:visited,div[onclick*="0030"],
/* FRANCHISE 33 */  a.franchise_0033,a.franchise_0033:link,a.franchise_0033:visited,div[onclick*="0033"]
{color:blue!important;font-weight:bold}  


#4 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,655 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 02 October 2020 - 04:09 AM

Works good, but after visiting the franchise page the franchise text color goes to red.

 

What needs to be added to the Stars Division code so it remains it original color - I changed it to #263E68?

 

The Stripes Division defaults to red.


ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "


#5 theeohiostate

theeohiostate

    Veteran

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

Posted 02 October 2020 - 05:21 AM

you didnt use the css i created , insert the css i made and change colors as you want. Your css is duplicating franchise names that are not in proper divisions.

 

 

/* STIPES DIVISION TEAM NAMES */
a[class*="00"],a[class*="00"]:link,a[class*="00"]:visited,div[onclick*="00"]
{color:green!important;font-weight:bold} 

/* STARS DIVISION TEAM NAMES */
/* FRANCHISE 01 */  a.franchise_0001,a.franchise_0001:link,a.franchise_0001:visited,div[onclick*="0001"],
/* FRANCHISE 05 */  a.franchise_0005,a.franchise_0005:link,a.franchise_0005:visited,div[onclick*="0005"],
/* FRANCHISE 07 */  a.franchise_0007,a.franchise_0007:link,a.franchise_0007:visited,div[onclick*="0007"],
/* FRANCHISE 09 */  a.franchise_0009,a.franchise_0009:link,a.franchise_0009:visited,div[onclick*="0009"],
/* FRANCHISE 10 */  a.franchise_0010,a.franchise_0010:link,a.franchise_0010:visited,div[onclick*="0010"],
/* FRANCHISE 11 */  a.franchise_0011,a.franchise_0011:link,a.franchise_0011:visited,div[onclick*="0011"],
/* FRANCHISE 12 */  a.franchise_0012,a.franchise_0012:link,a.franchise_0012:visited,div[onclick*="0012"],
/* FRANCHISE 15 */  a.franchise_0015,a.franchise_0015:link,a.franchise_0015:visited,div[onclick*="0015"],
/* FRANCHISE 17 */  a.franchise_0017,a.franchise_0017:link,a.franchise_0017:visited,div[onclick*="0017"],
/* FRANCHISE 18 */  a.franchise_0018,a.franchise_0018:link,a.franchise_0018:visited,div[onclick*="0018"],
/* FRANCHISE 20 */  a.franchise_0020,a.franchise_0020:link,a.franchise_0020:visited,div[onclick*="0020"],
/* FRANCHISE 21 */  a.franchise_0021,a.franchise_0021:link,a.franchise_0021:visited,div[onclick*="0021"],
/* FRANCHISE 23 */  a.franchise_0023,a.franchise_0023:link,a.franchise_0023:visited,div[onclick*="0023"],
/* FRANCHISE 27 */  a.franchise_0027,a.franchise_0027:link,a.franchise_0027:visited,div[onclick*="0027"],
/* FRANCHISE 30 */  a.franchise_0030,a.franchise_0030:link,a.franchise_0030:visited,div[onclick*="0030"],
/* FRANCHISE 31 */  a.franchise_0031,a.franchise_0031:link,a.franchise_0031:visited,div[onclick*="0030"],
/* FRANCHISE 33 */  a.franchise_0033,a.franchise_0033:link,a.franchise_0033:visited,div[onclick*="0033"]
{color:blue!important;font-weight:bold}  


#6 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,655 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 02 October 2020 - 09:57 AM

By bad.  I thought I had to add coding for the other division.  Works great when I pay attention . :rolleyes: :blink:  :D

 

Muy agradecido


ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "


#7 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,655 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 18 October 2020 - 04:28 AM

Can you take this one-step further?

 

While the above code works great for reports with franchise links there are reports that show a franchise name without a link.  i.e., Live Scoring.

 

I've tried different classes / ids, i.e., ".fname", ".franchise_xxxx", franchise_namexxxx", et al and nothing at this point gets the job done.

 

What's the class / id combinations that I need to change the franchise name's to either red (#ff0000) or blue (#263e68) for all reports without a franchise link?

 

Thanks - Mitch


ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "


#8 theeohiostate

theeohiostate

    Veteran

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

Posted 18 October 2020 - 07:06 AM

there is no way to target those names as MFL has no classes in the table , only way to do this is to build an array with the specific names for teams in each division , example below

 

// ADD COLOR FOR DIVISION ONE HERE
$("#livescoring_summary td:first-of-type").css("color", "green");

// PLACE ALL TEAM NAMES IN DIVISION TWO HERE - IF TEAM HAS AN APOSTROPHE OR COMMA YOU MUST ESCAPE IT WITH FORWARD SLASH BEFORE AND AFTER
var array = ['Brute Squad', 'Wild Cardz' , '404 - Owner Not Found' , 'Rima\'\s Bears' , 'Devastation\,\ Inc.'];

// EDIT COLOR FOR DIVISION TWO NAMES
$(array).each(function () {
    $("#livescoring_summary td:contains(" + this + ")").css("color", "red"); // EDIT COLOR FOR ALL DIVISION TWO TEAMS HERE
});


#9 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,655 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 18 October 2020 - 10:03 AM

Thanks - I couldn't figure out why and it was so obvious once you said there wasn't a class for the team name.

 

I'll add the script above to my header scripts.


ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "


#10 theeohiostate

theeohiostate

    Veteran

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

Posted 18 October 2020 - 10:09 AM

Thanks - I couldn't figure out why and it was so obvious once you said there wasn't a class for the team name.

 

I'll add the script above to my header scripts.

 

 

takes less then a second to figure out a elements class

 

right click on element and inspect if has a class or not 



#11 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,655 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 19 October 2020 - 04:06 AM

I knew that, but I wasn't astute enuf to pick up on it.  :blink: .  
 
Not tell me what I've done wrong.  The below code I've inserted in my header HPM ain't working.  Probably a typo that I can't see??  Or something else?
 

<script>
// ADD COLOR FOR DIVISION ONE HERE
$("#livescoring_summary td:first-of-type").css("color", "red");

// PLACE ALL TEAM NAMES IN DIVISION TWO HERE - IF TEAM HAS AN APOSTROPHE OR COMMA YOU MUST ESCAPE IT WITH FORWARD SLASH BEFORE AND AFTER
var array = [
'Angry Leprechauns' , 'The Rock In The Middle' , 'Crooklyn Elite' , 'Rima\'\s  Bears'  , 'Wild Cardz' , 'Dano\'\s 3rd Stringers' , 'Irish Cowboy' , 'Pink Cadillacs' , 'theeohiostate' , 
'Red Shirt Squad' , 'Urban Legends' , 'Drunken Moose' , 'Plug Uglies' , 'Two Dogs' , '404 - Owner Not Found' , 'Urban League' , 'Big Red Machine'];

// EDIT COLOR FOR DIVISION TWO NAMES
$(array).each(function () {
    $("#livescoring_summary td:contains(" + this + ")").css("color", "blue"); // EDIT COLOR FOR ALL DIVISION TWO TEAMS HERE
});
</script>

 

Thanks Agin & Agin & Agin

 

https://www51.myfant...20/home/79291#5


ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "


#12 theeohiostate

theeohiostate

    Veteran

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

Posted 19 October 2020 - 04:38 AM

I knew that, but I wasn't astute enuf to pick up on it.  :blink: .  
 
Not tell me what I've done wrong.  The below code I've inserted in my header HPM ain't working.  Probably a typo that I can't see??  Or something else?
 

<script>
// ADD COLOR FOR DIVISION ONE HERE
$("#livescoring_summary td:first-of-type").css("color", "red");

// PLACE ALL TEAM NAMES IN DIVISION TWO HERE - IF TEAM HAS AN APOSTROPHE OR COMMA YOU MUST ESCAPE IT WITH FORWARD SLASH BEFORE AND AFTER
var array = [
'Angry Leprechauns' , 'The Rock In The Middle' , 'Crooklyn Elite' , 'Rima\'\s  Bears'  , 'Wild Cardz' , 'Dano\'\s 3rd Stringers' , 'Irish Cowboy' , 'Pink Cadillacs' , 'theeohiostate' , 
'Red Shirt Squad' , 'Urban Legends' , 'Drunken Moose' , 'Plug Uglies' , 'Two Dogs' , '404 - Owner Not Found' , 'Urban League' , 'Big Red Machine'];

// EDIT COLOR FOR DIVISION TWO NAMES
$(array).each(function () {
    $("#livescoring_summary td:contains(" + this + ")").css("color", "blue"); // EDIT COLOR FOR ALL DIVISION TWO TEAMS HERE
});
</script>

 

Thanks Agin & Agin & Agin

 

https://www51.myfant...20/home/79291#5

 

 

what you have is fine , i'd guess you have marked as a header , try marking as footer and if that doesn't work , then wrap in a document ready 

 

$( document ).ready(function() {
    // ENTER SCRIPT HERE
});


#13 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,655 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 19 October 2020 - 06:07 AM

It tried the above code in a footer - nada

 

I then put the below code in a separate header and then a separate footer and still a no-go.  Anything else I should try?

 

<script>
$( document ).ready(function() {

// ADD COLOR FOR DIVISION ONE HERE
$("#livescoring_summary td:first-of-type").css("color", "red");

// PLACE ALL TEAM NAMES IN DIVISION TWO HERE - IF TEAM HAS AN APOSTROPHE OR COMMA YOU MUST ESCAPE IT WITH FORWARD SLASH BEFORE AND AFTER
var array = [
'Angry Leprechauns' , 'The Rock In The Middle' , 'Crooklyn Elite' , 'Rima\'\s  Bears'  , 'Wild Cardz' , 'Dano\'\s 3rd Stringers' , 'Irish Cowboy' , 'Pink Cadillacs' , 'theeohiostate' , 'Red Shirt Squad' , 'Urban Legends' , 'Drunken Moose'  'Plug Uglies' , 'Two Dogs' , '404 - Owner Not Found' , 'Urban League' , 'Big Red Machine'];

// EDIT COLOR FOR DIVISION TWO NAMES
$(array).each(function () {
    $("#livescoring_summary td:contains(" + this + ")").css("color", "blue"); // EDIT COLOR FOR ALL DIVISION TWO TEAMS HERE
});

});

</script>

ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "


#14 theeohiostate

theeohiostate

    Veteran

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

Posted 19 October 2020 - 06:51 AM

your forgot a comma between 2 of the names on the one you just posted and it was there on the first one

 

 

, 'Drunken Moose'  'Plug Uglies' ,

no comma between above to franchis names

 

 

Here is script that works - if you open your console - all this info is right there for you to fix easily - it shows where the mistake is at

$( document ).ready(function() {

// ADD COLOR FOR DIVISION ONE HERE
$("#livescoring_summary td:first-of-type").css("color", "red");

// PLACE ALL TEAM NAMES IN DIVISION TWO HERE - IF TEAM HAS AN APOSTROPHE OR COMMA YOU MUST ESCAPE IT WITH FORWARD SLASH BEFORE AND AFTER
var array = [
'Angry Leprechauns' , 'The Rock In The Middle' , 'Crooklyn Elite' , 'Rima\'\s  Bears'  , 'Wild Cardz' , 'Dano\'\s 3rd Stringers' , 'Irish Cowboy' , 'Pink Cadillacs' , 'theeohiostate' , 'Red Shirt Squad' , 'Urban Legends' , 'Drunken Moose' , 'Plug Uglies' , 'Two Dogs' , '404 - Owner Not Found' , 'Urban League' , 'Big Red Machine'];

// EDIT COLOR FOR DIVISION TWO NAMES
$(array).each(function () {
    $("#livescoring_summary td:contains(" + this + ")").css("color", "blue"); // EDIT COLOR FOR ALL DIVISION TWO TEAMS HERE
});

});


#15 UCanCallMeMitch

UCanCallMeMitch

    Veteran

  • Members
  • PipPipPip
  • 3,655 posts
  • Gender:Male
  • Location:Colorado

  • 2020 MFL: 29346

Posted 19 October 2020 - 10:51 AM

You are so funny  :lol: .  You should know by now that I'm a dunce when it comes to scripts dunce_boy.png

 

I can look at the below until blue in the face and never know what the problem is.  Yes, its still not working with your latest code in a header

cameratag.min.js:6941 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
(anonymous) @ cameratag.min.js:6941
279291:104 A parser-blocking, cross site (i.e. different eTLD+1) script, https://sb.scorecardresearch.com/beacon.js, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message. See https://www.chromestatus.com/feature/5718547946799104 for more details.
(anonymous) @ 79291:104
79291:801 Uncaught SyntaxError: Unexpected end of input
jquery.min.js:2 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
send @ jquery.min.js:2
79291#0:1 Failed to decode downloaded font: https://fonts.googleapis.com/css?family=Kaushan+Script
79291#0:1 OTS parsing error: invalid version tag
79291#0:1 Failed to decode downloaded font: https://fonts.googleapis.com/css?family=Kaushan+Script
79291#0:1 OTS parsing error: invalid version tag
79291#0:1 Failed to decode downloaded font: https://fonts.googleapis.com/css?family=Kaushan+Script
79291#0:1 OTS parsing error: invalid version tag

And can I understand if you have had enuf of me and chalk me as a lost cause.

 

P.S.  You still have commissioner abilities in the league.  


ldsportslogoindex_32x32.png  LuckyDog Sports 
" Fantasy Fun For Football Fanatics "




Reply to this topic



  



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users