Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2 3 ... 9  All

Author Topic: Chrome Extension for f.ds!  (Read 113571 times)

0 Members and 1 Guest are viewing this topic.

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Chrome Extension for f.ds!
« on: June 03, 2015, 01:10:39 pm »
+37

Current version: 1.35

Not sure if this is the right place to put this, but here it is. Based on a suggestion by Kirian, I created a Chrome extension. This extension does 3 things:

1. Adds a "Card" button next to the other markup buttons when writing a post. This inserts the [card ] markup.

2. When you post a reply, the [card] markup will be automatically replaced with the [url ] markup, linking to the appropriate wiki page.

3. When you are viewing a post, URLs that link to a wiki card page will include an image popup when you hover over the link.

4. Adds buttons to insert various Dominion icons to your post. Courtesy of Gherald.

5. Adds an "Autolink cards" checkbox, which will change all card in a post to hover links.

You can install the extension here: https://chrome.google.com/webstore/detail/fds-extension/meaipheckolpooacmilbpnilakniolgi.

Version 1.1 update: Item #3 is done now!
Version 1.2 update: Added item #4.
Version 1.3 update: Added 0, *, and + cost symbols.
Version 1.4 update: Made rollover images smaller. Fixed position of rollover images (all images were at the left of the post even if the card link wasn't).
Version 1.5 update: Added 3*, 4*, 5*, and 6* icons. Fixed other icon sizes so that they are all the same.
Version 1.6 update: Fixed rollover image sizes for events.
Version 1.7 update: Added 2 new features/buttons! The "Card Image" button will insert the "cardImage" tag around your card. When you post this tag, your post will contain an image of the actual card from the wiki. Useful for asking a question about a card or writing an article about one. The other is a "Kingdom" button, which adds the "kingdom" tag. This will generate card images given a comma-delimited list of card and event names. Perfect for discussing a game.
Version 1.8 update: Just smaller card images.
Version 1.9 update: Fixed VP image link.
Version 1.10 update: Added image icons for debt costs. Added icon for . Added Landmarks and new events to the list of things that will be displayed landscape instead of portrait in the rollover.
Version 1.11 update: Added all new Landmarks and Events to the list of landscape rollover images. Added icons for and costs. Updated the behavior of the icon buttons! Now when you click a button, it will insert markup representing the cost. When you post, the markup will be replaced with the image links. Makes writing a post much cleaner. Also, you can insert costs without clicking the button, just by typing the correct markup. All markup includes "$", even VP and Potion, just to keep from any potential conflicts with existing markup.
Version 1.12 update: Added "Autolink" feature.
Version 1.13 update: Fixed "Autolink" feature - works on all cards now, and doesn't break when used on pages with existing links.
Version 1.14 update: Added new second edition cards and promo card. Made everything case insensitive so that you can link cards with the wrong capitalization.
Version 1.15 update: Added Nocturne support for auto-link. Also updated the way auto-link gets the list of cards so that in the future, adding new cards won't require a new update to the extension. Fixed bugs with rollover images for cards such as Horn of Plenty, Salt the Earth, etc. Made it so that "Inherited" auto-links to "Inheritance" just for fun.
Version 1.16 update: Fixed bug where rollovers were not working on regular linked (not auto-linked) cards.
Version 1.17 update: Behind-the-scenes updates to work with Firefox approval.
Version 1.18 update: Behind-the-scenes updates to work with Firefox approval.
Version 1.19 update: Add local storage for the "Autolink cards" setting, so that it will default to what you last selected.
Version 1.20 update: Fixed bug introduced in last version where new post features were missing.
Version 1.21 update: Fixed bug introduced in 1.17 where Autolink broke the ability to view post voters.
Version 1.22 update: Use case-sensitive matching for Autolink to reduce the number of false positives.
Version 1.23 update: Fixed a bug introduced in a recent update where cardImage and kingdom tags were not working.
Version 1.24 update: Fixed minor bug introduced in 1.23.
Version 1.25 update: Added rollover link for certain "shortcut" card names.
Version 1.26 update: Fixed bug where Boons wouldn't link if the full name was used.
Version 1.27 update: Fixed bug with Ill-Gotten Gains, and added BoM.
Version 1.28 update: Made autolink work with plurals.
Version 1.29 update: Made autolink ignore text inside spoiler tags.
Version 1.30 update: Fixes bug where autolink breaks post voting. Also now only autolinks up to 500 cards.
Version 1.31 update: Kingdom button now loads the Kingdom list from Woodcutter Logging Services if the text starts with a "#".
Version 1.32 update: Fixed bug caused by latest Chrome update.
Version 1.33 update: Updated nickname system to not rely on hard-coded names.
Version 1.34 update: Fixed autolink bug caused by permissions update. Removed Kingdom loading from Woodcutter logging.
Version 1.35 update: Added new button. Updated extension icons used in store and Chrome toolbar.
« Last Edit: March 21, 2020, 07:54:46 pm by GendoIkari »
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #1 on: June 03, 2015, 01:18:04 pm »
0

Now I need some help from the wiki experts (Wero?). It looks like the actual card images are stored in various subfolders. Is there a way that I can actually know the URL of a given card, based just on the card name? Basically I want to add the same thing the wiki currently has; the image rollovers for card names. But I don't see how I can do that unless I can know the exact URL of an image.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

werothegreat

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8172
  • Shuffle iT Username: werothegreat
  • Let me tell you a secret...
  • Respect: +9624
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #2 on: June 03, 2015, 01:28:38 pm »
0

The image is stored on the wiki as 'Card_Name.jpg', which the wiki is able to use to find the proper address for it.  The images themselves are listed under more complicated addresses, so outside of the wiki, I'm not sure if this is possible.
Logged
Contrary to popular belief, I do not run the wiki all on my own.  There are plenty of other people who are actively editing.  Go bother them!

Check out this fantasy epic adventure novel I wrote, the Broken Globe!  http://www.amazon.com/Broken-Globe-Tyr-Chronicles-Book-ebook/dp/B00LR1SZAS/

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #3 on: June 03, 2015, 01:41:47 pm »
0

The image is stored on the wiki as 'Card_Name.jpg', which the wiki is able to use to find the proper address for it.  The images themselves are listed under more complicated addresses, so outside of the wiki, I'm not sure if this is possible.

Yeah that's what I was worried about. I could technically copy and host all the images somewhere else; all in the same directory, but that's a lot of work.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

werothegreat

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8172
  • Shuffle iT Username: werothegreat
  • Let me tell you a secret...
  • Respect: +9624
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #4 on: June 03, 2015, 01:58:54 pm »
0

The image is stored on the wiki as 'Card_Name.jpg', which the wiki is able to use to find the proper address for it.  The images themselves are listed under more complicated addresses, so outside of the wiki, I'm not sure if this is possible.

Yeah that's what I was worried about. I could technically copy and host all the images somewhere else; all in the same directory, but that's a lot of work.

Is there a way to just link to the file page on the wiki?  That's what the wiki itself does.
Logged
Contrary to popular belief, I do not run the wiki all on my own.  There are plenty of other people who are actively editing.  Go bother them!

Check out this fantasy epic adventure novel I wrote, the Broken Globe!  http://www.amazon.com/Broken-Globe-Tyr-Chronicles-Book-ebook/dp/B00LR1SZAS/

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #5 on: June 03, 2015, 02:18:41 pm »
0

The image is stored on the wiki as 'Card_Name.jpg', which the wiki is able to use to find the proper address for it.  The images themselves are listed under more complicated addresses, so outside of the wiki, I'm not sure if this is possible.

Yeah that's what I was worried about. I could technically copy and host all the images somewhere else; all in the same directory, but that's a lot of work.

Is there a way to just link to the file page on the wiki?  That's what the wiki itself does.

If you look at the markup for the rollover links; they actually link to  the image itself; not the file page. Linking to the file page wouldn't show just the card image itself. Though I might be able to datamine the file page to find the actual image link.

Hey, sort of related, what is this? http://wiki.dominionstrategy.com/images/thumb/0/0c/Storybook.jpg/155px-Storybook.jpg

Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Voltaire

  • Jester
  • *****
  • Offline Offline
  • Posts: 957
  • flavor text
  • Respect: +1097
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #6 on: June 03, 2015, 02:24:08 pm »
0

Looks like it's from the Fairytale fan expansion listed on BGG. Why it gets special status, no idea.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #7 on: June 03, 2015, 02:27:13 pm »
+1

I need a post with a bunch of card links to test out the ability to do rollover links. So this is it.

Market, Grand Market, Rats, Fishing Village, Island, Fool's Gold, Band of Misfits.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

michaeljb

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1422
  • Shuffle iT Username: michaeljb
  • Respect: +2113
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #8 on: June 03, 2015, 02:40:24 pm »
+2

This page lets you enter a file name, then it redirects you to the full path.

It makes a request to a URL that looks like this:

http://wiki.dominionstrategy.com/index.php?title=Special%3AFilePath&file=Artificer.jpg

Maybe you could script something to hit that URL for each card name and save the map of card names to URLs? Or the extension could make the request behind the scenes to get the URL whenever a user hovers. My gut reaction is that it'd be better to just generate the map of URLs needed.
Logged
🚂 Give 18xx games a chance 🚂

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #9 on: June 03, 2015, 03:05:10 pm »
+1


http://wiki.dominionstrategy.com/index.php?title=Special%3AFilePath&file=Artificer.jpg


This link alone is perfect! Thanks a bunch! Ok, new version has been uploaded, fully works now!
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #10 on: June 03, 2015, 03:11:25 pm »
0

If anyone wants to make a Firefox version, just let me know and I'll give you the code. I don't feel like actually learning how to do that.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

werothegreat

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8172
  • Shuffle iT Username: werothegreat
  • Let me tell you a secret...
  • Respect: +9624
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #11 on: June 03, 2015, 03:12:15 pm »
0

I've got the "card" button in the reply box, but no rollover image.
Logged
Contrary to popular belief, I do not run the wiki all on my own.  There are plenty of other people who are actively editing.  Go bother them!

Check out this fantasy epic adventure novel I wrote, the Broken Globe!  http://www.amazon.com/Broken-Globe-Tyr-Chronicles-Book-ebook/dp/B00LR1SZAS/

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #12 on: June 03, 2015, 03:15:27 pm »
0

I've got the "card" button in the reply box, but no rollover image.

Yeah, version 1.1, which includes the rollovers, is publishing now; Google says it can take up to an hour. You'll just need to update whenever it's available.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Kirian

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 7096
  • Shuffle iT Username: Kirian
  • An Unbalanced Equation
  • Respect: +9411
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #13 on: June 03, 2015, 03:17:15 pm »
+1

If anyone wants to make a Firefox version, just let me know and I'll give you the code. I don't feel like actually learning how to do that.

Alas, I use FF but I also have no idea how to do that.
Logged
Kirian's Law of f.DS jokes:  Any sufficiently unexplained joke is indistinguishable from serious conversation.

liopoil

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2587
  • Respect: +2479
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #14 on: June 03, 2015, 03:17:33 pm »
+1

Feature request: Coin icons like the ones Gherald has.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #15 on: June 03, 2015, 03:25:23 pm »
+2

Feature request: Coin icons like the ones Gherald has.

Should be simple enough. Will be super easy if I can get the script from Gherald.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

michaeljb

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1422
  • Shuffle iT Username: michaeljb
  • Respect: +2113
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #16 on: June 03, 2015, 03:27:22 pm »
0


http://wiki.dominionstrategy.com/index.php?title=Special%3AFilePath&file=Artificer.jpg


This link alone is perfect! Thanks a bunch! Ok, new version has been uploaded, fully works now!

Sweet! I was worried you'd have to work around the fact that it's a redirect or something.
Logged
🚂 Give 18xx games a chance 🚂

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #17 on: June 03, 2015, 03:56:19 pm »
+1


http://wiki.dominionstrategy.com/index.php?title=Special%3AFilePath&file=Artificer.jpg


This link alone is perfect! Thanks a bunch! Ok, new version has been uploaded, fully works now!

Sweet! I was worried you'd have to work around the fact that it's a redirect or something.

So was I! At first I thought that the request to that URL would return the proper URL, so I was doing an AJAX call to get the data from that URL, thinking that data would be the actual URL I needed. Finally I realized that even though it redirects to the other URL, the actual data returned when you request that first URL is still the image I was looking for, so I could just set the src of my image to that URL directly.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #18 on: June 03, 2015, 04:42:29 pm »
0

Ok, Gherald sent me his script. Version 1.2 is being published now. It includes a better UI for the "Card" button, and Gherald's buttons for the Dominion icons.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #19 on: June 03, 2015, 04:46:46 pm »
0

Is it a good idea to automatically transform card names into wiki links with image rollovers? Or would that just be annoying?
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Donald X.

  • Dominion Designer
  • *****
  • Offline Offline
  • Posts: 6352
  • Respect: +25650
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #20 on: June 03, 2015, 05:57:42 pm »
0

2. When you post a reply, the [card] markup will be automatically replaced with the [url ] markup, linking to the appropriate wiki page.
This could probably be done for everyone via the forum software - use the auto-filter. the opening tag you want turns into the url beginning; then there's the card name; then you auto-filter the closing tag into the file type and closing url tag.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9698
  • Respect: +10736
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #21 on: June 03, 2015, 07:25:46 pm »
+2

2. When you post a reply, the [card] markup will be automatically replaced with the [url ] markup, linking to the appropriate wiki page.
This could probably be done for everyone via the forum software - use the auto-filter. the opening tag you want turns into the url beginning; then there's the card name; then you auto-filter the closing tag into the file type and closing url tag.

Oh I know. You can also customize the forum software pretty easily to add custom buttons like what #1 and #4 do. But probably only Theory can do those things; this was just a quick way I could help out.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Jimmmmm

  • Torturer
  • *****
  • Online Online
  • Posts: 1762
  • Shuffle iT Username: Jimmmmm
  • Respect: +2017
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #22 on: June 03, 2015, 07:36:18 pm »
+1

King's Court




Seems to work. This is great, thanks!
Logged

liopoil

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2587
  • Respect: +2479
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #23 on: June 03, 2015, 07:37:55 pm »
+1

Watchtower - Action -

AWESOME!
Logged

belugawhale

  • Moneylender
  • ****
  • Offline Offline
  • Posts: 159
  • Something.
  • Respect: +212
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #24 on: June 03, 2015, 07:51:31 pm »
+1

Testing
Logged
removed by user
Pages: [1] 2 3 ... 9  All
 

Page created in 0.057 seconds with 20 queries.