Dominion Strategy Forum

Please login or register.

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

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

0 Members and 1 Guest are viewing this topic.

GendoIkari

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

Current version: 1.14

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.
« Last Edit: September 27, 2016, 10:24: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: 6321
  • Respect: +6813
    • 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: 7727
  • Shuffle iT Username: werothegreat
  • Prepare to be boarded!
  • Respect: +8594
    • 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: 6321
  • Respect: +6813
    • 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: 7727
  • Shuffle iT Username: werothegreat
  • Prepare to be boarded!
  • Respect: +8594
    • 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: 6321
  • Respect: +6813
    • 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: +1090
    • 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: 6321
  • Respect: +6813
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #7 on: June 03, 2015, 02:27:13 pm »
0

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: 1364
  • Shuffle iT Username: michaeljb
  • Respect: +1957
    • 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

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6321
  • Respect: +6813
    • 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: 6321
  • Respect: +6813
    • 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: 7727
  • Shuffle iT Username: werothegreat
  • Prepare to be boarded!
  • Respect: +8594
    • 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: 6321
  • Respect: +6813
    • 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: 6869
  • Shuffle iT Username: Kirian
  • An Unbalanced Equation
  • Respect: +8853
    • 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: 2578
  • Respect: +2449
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #14 on: June 03, 2015, 03:17:33 pm »
0

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

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6321
  • Respect: +6813
    • 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: 1364
  • Shuffle iT Username: michaeljb
  • Respect: +1957
    • 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

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6321
  • Respect: +6813
    • 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: 6321
  • Respect: +6813
    • 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: 6321
  • Respect: +6813
    • 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: 4297
  • Respect: +16834
    • 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: 6321
  • Respect: +6813
    • 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
  • *****
  • Offline Offline
  • Posts: 1655
  • Shuffle iT Username: Jimmmmm
  • Respect: +1778
    • 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: 2578
  • Respect: +2449
    • View Profile
Re: Chrome Extension for f.ds!
« Reply #23 on: June 03, 2015, 07:37:55 pm »
0

Watchtower - Action -

AWESOME!
Logged

belugawhale

  • Moneylender
  • ****
  • Offline Offline
  • Posts: 150
  • Something.
  • Respect: +191
    • 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 ... 5  All
 

Page created in 0.094 seconds with 20 queries.