Jump to content


Photo

Tabbed/Dropdown Roster Script


This topic has been archived. This means that you cannot reply to this topic.
68 replies to this topic

#1 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,627 posts

Posted 24 October 2008 - 07:05 PM

I have had several people ask how to get the rosters in a tabbed format. I have pointed them to the script written by EyeoftheHawk but some are still having problems which is why I decided to make this script.

This script will create an app that will display your roster side by side with other rosters in your league.

The rosters can be selected either through tabs or a drop down box.

If you choose to use the tabbed format then you can either create nicknames for your franchises so they will squeeze into the tabs properly or use images.

This script does not use MFL default rosters but it uses rosters created through XML which allowed me to add a few things that I think people might like. Most notably the "recent news" icon similar to what you find in yahoo leagues.

Anyway here is the code that you would need to copy and paste to a home page message (with the advanced editor turned off)

This script as shown will display the drop down box. You should be able to read through the comments to see how to change it to a tabbed format.
<script language="JavaScript" type="text/javascript">
<!--
//Start tabbedRoster manually; either true or false
   var tabbedRosterClickToStart = false;

//Set to trade mode only (will hide the trade button as well)
   var tabbedRosterTradeModeOnly = false;

//Enable trade toggle button
   var tabbedRosterTradeToggle = true;

//Display contract/salary info; either true or false
   var displayTabbedRosterSalary = false;

//Display roster status for individual players; either true or false
   var displayTabbedRosterStatus = true;

//Set the commissioner franchise team ID
   var tabbedRosterDefaultTeam = '0003';

//Set the decimals for Fantasy Points display
   var tabbedRosterDecimals = 3;

//Use tabbed display; either true or false
//if set to false then drop down box will be shown
   var tabbedRosterTabDisplay = false;
  
//If you want to use names in your tabbed display then set it up here
   var tabbedRosterNames = new Object();  
   tabbedRosterNames[1] = 'LIO';  // Lions
   tabbedRosterNames[2] = 'BUZ';  // Buzzards
   tabbedRosterNames[3] = 'PIR';  // Pirates 
   tabbedRosterNames[4] = 'PAN';  // Panthers
//		 .
//		 .
//		etc. 

//If you want to use icons in your tabbed display then set it up here
//Leave these vars empty if you are using the names setup above
   var tabbedRosterIconURL = ''; // example: http://www.yoursite.com/icon
   var tabbedRosterIconExt = ''; // example: gif

//Set the font size to be used in the tabs
//Note: if you are using icons set this to be 2 greater than your image height
   var tabbedRosterTabHeight = 15; 

// -->
</script>



<style type='text/css'>

/* THIS IS THE TAB CONTENT CSS CODE */
.habTabbedRosterTabs {
  padding: 1px;
  font-weight: bold;
  list-style-type: none;
  text-align: left; 
}

.habTabbedRosterTabs li {
  display: inline;
  background-color: silver;
  border: 1px solid black;
  margin: 0;
  padding: 0;
  padding-left: 2px;
}

.habTabbedRosterTabs li a {
  text-decoration: none;
  padding: 1px;
}

.habTabbedRosterTabs li.selected {
  background-color: white;
  border-bottom: 2px solid white;
}

.habTabbedRosterTabContentStyle{ 
  border: 1px solid black;
  background-color: white;
  padding: 5px;
}


/* THIS IS THE DROPDOWN CSS */
.habTabbedRosterSelect {
  font-size: 11px;
  font-family: courier new,helvetica;
  font-weight: bold;	
  color: #00517b;
  background-color: silver;
}


/* THIS IS THE ROSTER TABLES CSS */
.RosterTabbedRoster {
 text-align: left;
 min-height: 400px;
 height: auto !important; /* For Safari & firefox */
 height: 400px; /* IE6 expands this if needed */
 vertical-align: top;
}

.habTabbedRoster td {
  padding-left: 5px;
  padding-right: 5px;
}

.habTabbedRoster th {
  border-right: 0px;
  border-left: 0px;
  height: auto;
  font-style: normal;
}


/* THIS IS THE DYNAMIC DRIVE CSS POPUP WINDOW CODE */
.dhtmlwindow{
  position: absolute;
  border: 2px solid black;
  visibility: hidden;
  background-color: white;
}

.drag-handle{ /*CSS for Drag Handle*/
  padding: 1px;
  text-indent: 3px;
  font: bold 14px Arial;
  background-color: #CA0000;
  color: white;
  cursor: move;
  overflow: hidden;
  width: auto;
  filter:progid:DXImageTransform.Microsoft.alpha(opacity=100);
  -moz-opacity: 1;
  opacity: 1;
}

.drag-handle .drag-controls{ /*CSS for controls (min, close etc) within Drag Handle*/
  position: absolute;
  right: 1px;
  top: 2px;
  cursor: hand;
  cursor: pointer;
}

* html .drag-handle{ /*IE6 and below CSS hack. Width must be set to 100% in order for opaque title bar to render*/
  width: 100%;
}


.drag-contentarea{ /*CSS for Content Display Area div*/
  border-top: 1px solid brown;
  background-color: white;
  color: black;
  height: 150px;
  padding: 2px;
  overflow: auto;
}

.drag-statusarea{ /*CSS for Status Bar div (includes resizearea)*/
  border-top: 1px solid gray;
  background-color: #F8F8F8;
  height: 13px; /*height of resize image*/
}


.drag-resizearea{ /*CSS for Resize Area itself*/
  float: right;
  width: 13px; /*width of resize image*/
  height: 13px; /*height of resize image*/
  cursor: nw-resize;
  font-size: 0;
}

</style>


<script type="text/javascript" src="http://www.habman.com/mfl/apps/js/habman_common.js"></script>
<script type="text/javascript" src="http://www.habman.com/mfl/apps/js/tabbedrosters.js"></script>


<script type="text/javascript" src="http://www.habman.com/mfl/apps/js/dhtmlwindow/dhtmlwindow.js">

/***********************************************
* DHTML Window Widget- &copy; Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

Let me know of any issues.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#2 Ogre

Ogre

    Veteran

  • Members
  • PipPipPip
  • 179 posts

Posted 24 October 2008 - 07:20 PM

thanks a lot, works great for me, did you get my PM Habman? I am using your starters app and for some reason it is still showing the starters for week 7. Can I modify it to switch to the upcoming week on wednesday's?

I got a feeling it is somewhere in here but really have no idea
function getHabStarters() {
  if(completedWeek == liveScoringWeek)
   var weekNum = completedWeek;
  else
   var weekNum = completedWeek + 1;
  if(weekNum==0) weekNum = 1;
  var matchupArray = new Array();
  matchupArray = makeSyncHttpRequest(habBaseURL+"/"+year+"/export?TYPE=weeklyResults&L="+league_id+"&W="+weekNum+"&rand=" + Math.random() , 'parseHabWeeklyResultsXML','weeklyResults',true);
  doStartersTable(matchupArray,weekNum);


#3 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,627 posts

Posted 24 October 2008 - 07:48 PM

thanks a lot, works great for me, did you get my PM Habman? I am using your starters app and for some reason it is still showing the starters for week 7. Can I modify it to switch to the upcoming week on wednesday's?

I got a feeling it is somewhere in here but really have no idea

Try doing a CTRL-F5. I modified the script so it will show the new week. If you want to make it change over on Wednesday then I will have to add more code. Try it like this for now.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#4 habman

habman

    Veteran

  • Members
  • PipPipPip
  • 2,627 posts

Posted 27 October 2008 - 02:49 PM

I have added a "trade view" toggle button to this app so when viewing the rosters you can click on the button and checkboxes will appear beside the player names. You can then check the player(s) that you want to involve in the trade, hit the propose button and the trade will be offered to your opponent.

The trade button is hidden from guests so you will have to put the app on your own site or a test site to see it in action.
My MFL scripts . . . . . . . . http://www.habman.com/mfl/

#5 posty

posty

    Veteran

  • Members
  • PipPipPip
  • 413 posts

Posted 28 October 2008 - 09:10 AM

I have added a "trade view" toggle button to this app so when viewing the rosters you can click on the button and checkboxes will appear beside the player names. You can then check the player(s) that you want to involve in the trade, hit the propose button and the trade will be offered to your opponent.

The trade button is hidden from guests so you will have to put the app on your own site or a test site to see it in action.


Sweet addition...

#6 Ogre

Ogre

    Veteran

  • Members
  • PipPipPip
  • 179 posts

Posted 28 October 2008 - 10:55 AM

I am not worthy~!

#7 jaypopsu

jaypopsu

    Veteran

  • Members
  • PipPipPip
  • 661 posts

Posted 15 March 2009 - 08:46 AM

Hey Hab,

Is this module functional still? I put it on a test site, with no other scripts and it's not pulling roster info:

http://www17.myfanta...2009/home/51477

It just sits on loading data. This is something I'd definitely want to use in my new site.

Thanks,
JP
Got Championship Anticiperection? | milfleague.com

#8 Rod's Dawgs

Rod's Dawgs

    Veteran

  • Members
  • PipPipPip
  • 497 posts

Posted 11 June 2009 - 12:04 PM

Habman,

Great apps that you are providing. I am adding some to both of my leagues this year.

I just added the roster script (within the communication tab) but I do not see the trade toggle that you talked about.

So far I have only added it to league 12183

Any ideas?

Thanks in advance
Rodney Huebner
Owner/Coach Rod's Dawgs (NNFFL)
Owner/Coach Maniacs (JAFFL)
Commissioner Jax No Name Fantasy Football League (NNFFL)
Commissioner Jax Auction Fantasy Football League (JAFFL)

#9 Rod's Dawgs

Rod's Dawgs

    Veteran

  • Members
  • PipPipPip
  • 497 posts

Posted 09 July 2009 - 05:15 PM

Habman,

Great apps that you are providing. I am adding some to both of my leagues this year.

I just added the roster script (within the communication tab) but I do not see the trade toggle that you talked about.

So far I have only added it to league 12183

Any ideas?

Thanks in advance


Bump. Anyone else having this problem?
Rodney Huebner
Owner/Coach Rod's Dawgs (NNFFL)
Owner/Coach Maniacs (JAFFL)
Commissioner Jax No Name Fantasy Football League (NNFFL)
Commissioner Jax Auction Fantasy Football League (JAFFL)

#10 norm

norm

    Veteran

  • Members
  • PipPipPip
  • 720 posts

Posted 24 August 2009 - 10:39 AM

Habman,

Great apps that you are providing. I am adding some to both of my leagues this year.

I just added the roster script (within the communication tab) but I do not see the trade toggle that you talked about.

So far I have only added it to league 12183

Any ideas?

Thanks in advance


Bump. Anyone else having this problem?

i dont see trade toggle either

#11 Ram

Ram

    Veteran

  • Members
  • PipPipPip
  • 53 posts

Posted 24 August 2009 - 01:03 PM

It seems to only be on the Tabbed view.

#12 bneuman

bneuman

    Veteran

  • Members
  • PipPipPip
  • 94 posts

Posted 31 August 2009 - 08:42 AM

This script does not use MFL default rosters but it uses rosters created through XML which allowed me to add a few things that I think people might like. Most notably the "recent news" icon similar to what you find in yahoo leagues.


I click on the "recent news" icon and nothing happens... on the other hand I do have the "trade button"! :rolleyes: Anyone know when Habman is coming back?

#13 dig

dig

    Member

  • Members
  • PipPip
  • 26 posts

Posted 02 September 2009 - 09:25 AM

I only seem to be able to get "Loading Data . . . Please wait."

When I fill out the script in the message setup and hit "Update Message" it seems to work but when I go into the site and try to use it nothing will load.

Any ideas?

#14 jmqrsq

jmqrsq

    Veteran

  • Members
  • PipPipPip
  • 51 posts

Posted 03 September 2009 - 08:01 AM

http://www10.myfanta...2009/home/14931

I cant seem to get the script to look like the rest of the modules with the skin i am using. Can anyone tell me whats wrong? Its basically not the same border or line spacing as the skin i am using. can anyone help please?!?!?

#15 dig

dig

    Member

  • Members
  • PipPip
  • 26 posts

Posted 03 September 2009 - 09:41 AM

http://www10.myfanta...2009/home/14931

I cant seem to get the script to look like the rest of the modules with the skin i am using. Can anyone tell me whats wrong? Its basically not the same border or line spacing as the skin i am using. can anyone help please?!?!?


did you change anything in the script to get it to work? im still getting "loading data"