Kilg.us – Fantasy Stat Tracker …Tracker

A blog about the development of Kilg.us – The Fantasy Baseball Stat Tracker

Posts Tagged ‘remove player’

Remove Player Glitch Resolved

Sunday, March 21st, 2010

When clicking on the red “X” associated with a player on a team page, Kilg.us is supposed to prompt you to confirm that you wish to remove the player from your roster then, if you accept, actually perform the removal. Due to a duplication of the class name associated with the red “X”, a duplicate prompt was being generated. Upon acceptance of both prompts, the proper player removal was being performed. This duplicate prompt has been removed.

The duplicate prompt was being generated for the first player in the table from which you tried to remove someone. For example, if you tried to remove an outfielder from your team, you would be asked “Are you sure you wish to remove OUTFIELDER X from TEAMNAME’s roster?”. This is correct behavior. After clicking “OK”, though, you would be given the same prompt for your catcher (or whichever player was at the top of the table): “Are you sure you wish to remove CATCHER Y from TEAMNAME’s roster?”. This shouldn’t happen. If you had nonetheless accepted that prompt, Kilg.us would have properly removed the player you wanted to remove and not altered the other. If you declined that second prompt, though, the player you originally requested to have removed would not be removed.

This was happening because a class used to identify the red “X” button was duplicated onto the table-cell containing that button. I have updated the script so it is more specific in where it is looking for that class. This prevents the duplicate prompt from being generated and returns us to the proper flow to remove players.

Add Players to your Team

Wednesday, March 17th, 2010

Players are added and removed individually from each of your teams. Kilg.us doesn’t try to enforce any specific league rules for when players can be added or removed from teams. You can do so at any time.

Find a Player

To find a player to add to your roster, you must first navigate to your team page. Across just below your team’s name there is a series of links including “Add Player”. Clicking this link will take you to the page to search for and add a player.

On the Add Player screen you will see a group of search fields in the right column. As their labels describe, you can search for players based on first name, last name, and position.

Kilg.us doesn’t use Lucene search for player searching yet (it does for friend searching), but this functionality will be added later in 2010.

Add Player page with result for a search on "Young"

Add Player page with result for a search on "Young"

All of the search fields you direct string matches. This means they will find sub-strings within longer names, but won’t find variations on the terms you entered. So, a last-name search for “you” will return “Young” and “Youkilis” but not “Lyon”. If your search doesn’t return the player you were expecting, trying using a shorter string of characters.

Review a Player’s Stats

After you have some search results returned, you can check out the stats of the players in the list. Clicking on a player’s name will open a layer that shows the player’s picture, total season stats, and a link to the player’s MLB.com profile page.

Add Player page displaying Michael Young player layer

Add Player page displaying Michael Young player layer

Add a Player

To add a player to your team, click on the green “plus” sign (+) next to his name. This will bring up a prompt to confirm that you wish to add the player to your team. If you accept, the player will be added to your team. This is handled by an AJAX request which means the page won’t need to reload. A new prompt will appear once the player has been added.

You can add as many players to your team as you would like in this session.

Activating your Player

After being added to your team, your new player will be placed on your bench. This means his stats won’t be counted when your team’s stats are calculated. To activate the player, click the gray-bars handle to the left of the player’s name on your team page and drag him above the “Bench” bar. To return him to the bench, just drag and drop him below the “Bench” bar.

Players riding the pine on a Team page

Players riding the pine on a Team page

Remove a Player

If you have added a player to your team accidentally or just want to remove someone, you can do so at any time. On your team page, there is a red “X” icon on the right end of each player’s stat line. Clicking this icon will prompt you to confirm that you wish to remove the player from the team. If you confirm, the page will reload and the player will be removed.

You can always add a player back to your team by using the same process described above for adding a player.

Two Days of Updates

Thursday, April 2nd, 2009

I quit working too late last night to post about the updates, so I’ll cover a couple days’ work now.

The biggest visible change was an update to the top site navigation. Previously, after logging-in, if you visited the home page or Tracker blog, there was no way to return to the system without logging-in again. Obviously, that was inconvenient. The home page and blog now both recognize an authenticated session and will display a new navigation link (that exists throughout the site now) to visit the Dashboard. This will get you back “into” Kilg.us without needing to log-in again.

The other big functional change is on the Add Player page. After receiving a report that adding a player was causing an alert in Firefox, I dug in to see what was happening. Unfortunately the alert was simply a slow script notice, not an actual error. What I ultimately determined was that the cumulative stat bubbles that I added the other day were causing an odd JQuery loop when the page is unloaded. Rather than trying to dig into JQuery to see what the problem was, I determined it could be alleviated by reducing the number of instances of the stat bubbles on the page. So the Add Player page now features pagination! Search results will be displayed 50 at a time with pagination links at the bottom of the page. This leads to quicker load times of the page, as well, so it seems like an improvement all-round.

Complicating the new Add Player pagination is the position filter. That filter literally filters down the players shown on the page, based on position.  All it really does is turn off the display of players that don’t match the filter. So, previously, changing the filter to a specific position would cause a display of all players at that position. Now, changing the filter will only show the players among the currently displayed 50 that match. This seems confusing to me, so I think I will need to re-write how it works.

On a non-visible vein, I’ve incorporated the functionality to allow Users to view other Users’ teams. This is a precursor to the social-stat-tracking concept I’ve been discussing. There is no interface to share your teams with other Users yet–the relationship has to be manually set in the database. There is a new relationship type, though. Originally a team only had one User related to it: the Owner who had total control to do anything with the team they wished. Now there is a Viewer User type. This User type can only view the team. They cannot change the team name, delete the team, add players, remove players, bench players, or change the team’s stats. I’m hoping to waste a good chunk of time this weekend working on social-stat-tracking. With a lot of luck, I’ll have something working by opening day.

On a reality-strikes front: the iPhone web app won’t be ready for opening day. Once life settles down a bit, I’ll try to get back to it later this Spring or Summer.

Search for Players

Friday, May 23rd, 2008

I found a little time to work on the Fantasy Stat Tracker this morning and put it to use adding functionality to search through players when adding a player to your team. Previously the Add Player function offered a laundry list of every player in the application. By using your browser’s built-in search function it wasn’t too difficult to find the player you were looking for–but it wasn’t ideal. You can now search by first and/or last name as well as filter results by position. By default, the Add Player page still provides the laundry list, should that be an effective mechanism for you.

Player searches are performed via a Post back to the Add Player page, meaning a round-trip to the server each time you search. Filtering by position, though, is handled on the fly. For some reason, the first time you filter by a position the application takes a few seconds before updating the list. After the first round, though, it happens almost instantaneously.

I also fixed a bug that was introduced last week when I added links to the player detail pages on MLB.com. I had originally built the display to pop-up a JavaScript alert when you requested to Remove a player from your team. That alert read the content of the table cell holding the player’s name. After adding in the link to the MLB.com page, this caused the alert to display a string of HTML/JavaScript instead of just the player’s name. I updated it to look within the anchor element for the player’s name so the alert pops-up with just the player’s name again.

Roster Manipulation

Friday, May 9th, 2008

With the new flexible architecture, I made a lot of progress on the Fantasy Stat Tracker today. First at hand was to programatically populate the Players table in the database. This is handled with a pretty simple PHP script that I intend to schedule to run nightly on the server to ensure that as new players come into the league, they are available in the Stat Tracker. Just a few minutes ago as I was wrapping up for the night I realized, however, that the source I’m using to get the player list is out of date. I noticed this when trying to add Jesse Carlson to my team. He’s not listed as a player…and Frank Thomas is still listed as a member of the Blue Jays. Obviously I’ll need to look around for a better, up-to-date, player list.

Today I also built out the first drafts of adding players to, and removing from, a team roster. When viewing your team, each player has a red “X” alongside their stats. Clicking that icon opens a confirmation prompt and leads to removing the player from the team roster. Players are added by visiting a massive list of all players, then clicking on the player’s name. I’ll flesh out that interface to allow sorting of players (positions, names, leagues, teams) to make it easier to find the player you wish to add to your team.

Now that it’s possible to add players to a roster, it will be possible to build new teams, so I think my next task will be a workflow to create a new team. Following that will finally be the workflow to sign up for an account! Stay tuned! Soon you’ll be able to sign up to use the Fantasy Stat Tracker to follow your teams!