Play Logging Bookmarklet: Code Repository
Jesse C
United States
Paradise
California
flag msg tools
badge
Avatar
mbmbmbmbmb
Recommend
12 
 Thumb up
11.00
 tip
 Hide
On 2016-04-20 the new BGG game page redesign was launched, here's how it has affected this utility:

v1.x - v3.x: These versions relied entirely on BGG's play logging GUI to function. They do not work with with the new site design and I don't plan on updating them. They should however still work via Search pages and your Collections page. Just click in the "Your Plays" cell on one of those pages to open the classic BGG play logging dialog, then click the bookmarklet as before.

v4.x: This was a short-lived version before I changed where the settings and other data was saved. I have no plans on updating this either but again it will probably work from the older pages in BGG.

v5.x: I am currently working on the 5.x version of "SPLU", it is at v5.5.3 as of April 2016. SPLU 5.x can be launched from any of the "classic" (home page, subscriptions, geeklist, etc.) BGG pages, it doesn't rely on the old play logging interface at all. Unfortunately, this version also don't work on the new game pages yet. There are 2 issues that I am facing:
- First is that I need to remove all of the code that relied upon BGG's code. This includes the Calendar, Search box, and probably other things. I have a Beta version in the works that is closer to being compatible and should be released soon.
- Second is that a popular way of launching SPLU 5.x was from a QuickBar link. This meant that you didn't have to create the bookmarklet on every browser you wanted to use it with. Unfortunately one of the changes with the new UI is to block JavaScript from running from the QuickBar. This is nothing I can control so to run SPLU on the new pages will require using a bookmarklet.

The first post in this thread generally has the latest links for v5.x:
https://boardgamegeek.com/thread/1056287/

-----

Note that most of the code and information here is out of date and I'm just leaving it for historical purposes.

I am going to use this GeekList to hold the code for my project to try and make entering game plays easier.

The goal of this project is to enhance the existing "Record a Play" function on the BGG site to make logging plays easier and faster without the need for external hosts or apps. To do this I am using "bookmarklets" which look like a normal browser bookmark. When clicked, however, they will execute some JavaScript code in your local browser which will add the enhancements.

Kataclysm has created a tutorial that covers the creation of the bookmarklets that are used to execute the code. It also covers how to edit the original version of the code to your needs.

All feedback is appreciated, most of the discussion should probably stick to this thread. The following code I provide free for anyone to use and make their own changes to, a credit to me would be nice if you make a better version

Note: My code will never ask for your password or any personal information beyond a name, username, and other public data normally gathered when recording a play. If someone sets up a bookmarklet or sends you customized code that does ask for private information please let me know.

UPDATES:
12/10/2014 - SPLU v4.0 is released, see the 3rd item in the geeklist.
4/7/2014 - Fixed bug in expansion logging and changed how expansion data is pulled.
12/4/2013 - Added Expansion logging. Also, Snipt seems to goofing up so get files from my DropBox share below.
11/30/2013 - Now has an Import/Export function which can bring in player and location data from Friendless' site.
10/26/2013 - I will go with snipt.org to post my code as it's easy to post the code, update it, and for everyone to copy it. See the items below for links.
10/22/2013 - Currently there are errors in the code below due to a BGG posting filter that is probably meant as a safety feature. I am looking in to how/where to post the code without it being altered.
Your Tags: Add tags
Popular Tags: [View All]
  • [+] Dice rolls
1. Board Game: Outside the Scope of BGG [Average Rating:6.74 Overall Rank:2692]
Jesse C
United States
Paradise
California
flag msg tools
badge
Avatar
mbmbmbmbmb
Original edition:

Note: I am basically not updating this version any longer.

This code allows for a bookmarklet to automatically add players and fill in their names, usernames, and the location. Basically you make a preset for common game play situations where you play with the same people in the same location. You can still add and delete players with the usual play logging interface.

Features:
- Enter plays from the search or collections pages by clicking the "My Plays" box and then the bookmarklet.
- Enter plays from a game's specific page by clicking the bookmarklet or clicking "Record a Play" then the bookmarklet.
- Fills in your preset players and location information.

Bugs:
- Little error-handling so try not to click the bookmarklet more than once in a row. You can reset things by just reloading the page.
- Sometimes doesn't fill in all info. Try closing the Record a Play box and start over. See the tutorial for details on increasing the timeouts


Here's the code for what I am calling v1.5:
https://dl.dropboxusercontent.com/u/3633908/site/SPLUv1.5-Bo...

This was the last version of the original code before I started adding saved players and similar features.

Note that this no longer works via the game pages as BGG has updated their GUI. It still functions from the search and collections pages.
1 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Loading... | Locked Hide Show Unlock Lock Comment     View Previous {{limitCount(numprevitems_calculated,commentParams.showcount)}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}
{{error.message}}
{{comment.error.message}}
    View More Comments {{limitCount(numnextitems_calculated,commentParams.showcount)}} / {{numnextitems_calculated}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}
2. Board Game: Outside the Scope of BGG [Average Rating:6.74 Overall Rank:2692]
Jesse C
United States
Paradise
California
flag msg tools
badge
Avatar
mbmbmbmbmb
Second Edition:

This edition is different from the original in that it stores Name/Username pairs in your browser's local storage rather than in the bookmarklet itself. There is a "Manage My Players" bookmarklet that lets you add/edit/delete then save your list of users. Then there is a second bookmarklet that modifies the Record a Play dialog so you can add the players you saved earlier.

See kataclysm's new tutorial HERE

UPDATES:
4/7/2014 - Version 3.6
- Fixed expansion logging bug and changed way it gets expansion list to be more compatible.
12/4/2013 - Version 3.5
- Allows for logging plays for games and expansions in 1 dialog.
11/30/2013 - Version 3.1
- Import/Export feature
- Removed the "Add New Player" link from the original BGG Record Play dialog so it can't be clicked accidentally, use the "Other" player button.
- The Player Manager dialog now appears on the page relative to where you have scrolled, not forced at very top of page.
- The Player Manager dialog box is prettier.
- The player name buttons now use the username if the player name is blank.
10/26/2013 - Version 2
- Added some visual feedback when you click a players name to add them to a play.
- Allowed for clicking player names more quickly and it adding their names in the right places.
11/9/2013
- Added Colors for players
- Fixed bug with "other" player introduced in last update
- Added Locations
11/10/2013
- Fixed the Manage Players dialog not floating in Chrome and IOS
- Changed formatting on the Manage Players dialog


How to use:
- See Kataclysm's Tutorial
- Note: The Save button will save all the players info as-is so you only need to press it once when you are done.
- To close the box just hit "Close". Be careful to Save first, it doesn't auto-save.


Known issues:
- The Player Manager dialog no longer works in IE. There is a limit to the length of the bookmarklet code that IE allows and the code is now over twice as long. In general I would suggest using Firefox or Chrome.
- Clicking the "Manage My Players" bookmarklet twice in a row will break the dialog box. Reload the page to reset it.
- The Manage My Players dialog is ugly and stuck at the top of the page.
- On IOS and Chrome the Manage My Players dialog box is not green and is stuck at the bottom of the page, but it still seems to work.
- Sometimes the Record a Play dialog isn't modified when clicking the "Enhanced Dialog" bookmarklet. Close the dialog and try again.
- Clicking the "Add New Player" link will add a blank entry as normal but then if you click on one of your Player's names to add them it will fill the data into the wrong section. If I can modify the "playercount" variable BGG uses then I can handle this better. For now just use the "Other" player button.

ToDo:
- Add "presets" to mimic functionality of Original Edition
- Add Colors/Teams if user asks for it
- ???


Here are the "compressed" versions of the code ready for copying in to the bookmarklets:

Snipt is goofing up and cutting off some of the code. Use this link to download the files from DropBox:
https://dl.dropboxusercontent.com/u/3633908/site/DraggableLi...

Manage Players & Locations v3.1: http://snipt.org/Brih4
Enhanced Dialog v3.1: http://snipt.org/Brjb3
Enhanced Dialog v3.5 (With Expansion Logging): http://snipt.org/BuU3


Manage Players & Locations v2: http://snipt.org/BaZi2
Enhanced Dialog v2: http://snipt.org/Bafu9
Manage Players: http://snipt.org/Ajfhi7
Enhanced Dialog: http://snipt.org/Ajfhj5


If you want to see the "uncompressed" version of the code you can see it here:

Manage Players & Location code v3.1: http://snipt.org/Brig5
The Enhanced Dialog code v3.1: http://snipt.org/Brja1
The Enhanced Dialog code v3.5 (With Expansion Logging): http://snipt.org/edit/BuT5

The Manage Players & Locations code v2: http://snipt.org/BaZh2
The Enhanced Dialog code v2: http://snipt.org/BaZj7
The Manage Players code: http://snipt.org/Ajfhf0
The Enhanced Dialog code: http://snipt.org/Ajfhg3
2 
 Thumb up
 tip
 Hide
  • [+] Dice rolls
Loading... | Locked Hide Show Unlock Lock Comment     View Previous {{limitCount(numprevitems_calculated,commentParams.showcount)}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}
{{error.message}}
{{comment.error.message}}
    View More Comments {{limitCount(numnextitems_calculated,commentParams.showcount)}} / {{numnextitems_calculated}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}
3. Board Game: Outside the Scope of BGG [Average Rating:6.74 Overall Rank:2692]
Jesse C
United States
Paradise
California
flag msg tools
badge
Avatar
mbmbmbmbmb
SPLU v4.0!

My wife nicknamed the project "the Splendiferous Play-Logging Utility" so that is the new name.

This new version completely eliminates the use of the BGG play logging window. Now from any BGG page you can click the bookmarklet and log game plays for any game you want. Check out some of the features new and old:

Features:
- Run the bookmarklet from ANY BGG page, not just the game's page or your collections.
- Log plays for any and multiple games without reloading the page by searching for the title or selecting it from your favorites.
- A favorites list to help quickly select those hard to search for games.
- Expansion logging from the same submit button as the main game.
- Hide any field you don't use to save screen space.
- Player data is shown in a grid view to minimize scrolling.
- Uses your player and locations lists from previous versions.
- A Duplicate feature so you can log a play for another game with the same players already entered.

This is the first public release version so there could be bugs but we have been working on it for several months and tested it pretty thoroughly.

Be aware that this version is MUCH larger than the 3.x versions. 3.6 was around 9KB and the Players & Locations Manager around 10KB. SPLU 4.0 is over 64KB and still uses the same P&L Manager.

I've tested it in Firefox and Chrome in Windows and Chrome on Android. If you get it working in other browsers please let me know. There is a bug/feature in FF you need to work around that is explained in the download link at the bottom. It won't work in IE due to length limits for URLs.

Here is the link to the announcement with a screen shot:
http://www.boardgamegeek.com/article/17702841#17702841

Here is the link to the code itself on my DropBox site:
https://dl.dropboxusercontent.com/u/3633908/site/DraggableLi...

It has been updated to 4.0.6 which makes the code small enough for Firefox not to freak out and some other features and bug fixes.

ToDo:
- Code cleanup, I will try to make it smaller if I can.
- Build-in P&L Manager functionality in to same window?
3 
 Thumb up
6.00
 tip
 Hide
  • [+] Dice rolls
Loading... | Locked Hide Show Unlock Lock Comment     View Previous {{limitCount(numprevitems_calculated,commentParams.showcount)}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}
{{error.message}}
{{comment.error.message}}
    View More Comments {{limitCount(numnextitems_calculated,commentParams.showcount)}} / {{numnextitems_calculated}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}
Loading... | Locked Hide Show Unlock Lock Comment     View Previous {{limitCount(numprevitems_calculated,commentParams.showcount)}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}
{{error.message}}
{{comment.error.message}}
    View More Comments {{limitCount(numnextitems_calculated,commentParams.showcount)}} / {{numnextitems_calculated}} 1 « Pg. {{commentParams.pageid}} » {{data.config.endpage}}
Front Page | Welcome | Contact | Privacy Policy | Terms of Service | Advertise | Support BGG | Feeds RSS
Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.