From 9304c64934a4cd371e8990522e6dbfd83ea0967b Mon Sep 17 00:00:00 2001 From: Andy Nguyen Date: Fri, 14 Feb 2020 00:09:41 -0800 Subject: [PATCH] add support for the deck sort order as a parameter for direct linking --- README.md | 1 + js/decklist/main.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 8ef253e..a09ca97 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Interested in directly linking to [decklist.org](https://www.decklist.org) for y - **`deckdesigner`**: designer of the deck (e.g. CubeApril) - **`deckmain`**: the deck itself; this can be in any format the website understands (use `%0A` for newlines) - **`deckside`**: the side itself; this can be in any format the website understands (use `%0A` for newlines) +- **`decksort`**: change the order of the cards in the mainboard and sideboard (choices: `alphabetical`, `cmc`, `color`, `numeric`, `original`, `type`, defaults to `color`) - **`disableediting`**: prevent users from editing the fields above - **`logo`**: please contact [april@pokeinthe.io](mailto:april@pokeinthe.io), if you'd like to replace the DCI logo diff --git a/js/decklist/main.js b/js/decklist/main.js index fcc3e89..b80d0fa 100644 --- a/js/decklist/main.js +++ b/js/decklist/main.js @@ -141,6 +141,11 @@ function parseGET() { if ($._GET[ 'uploadURL' ] !== undefined) { $('#upload').css('display', 'inline-block'); } + + // process the decksort param, if present + if ($._GET['decksort'] !== undefined) { + $('#sort-' + $._GET['decksort']).click(); + } } // Detect if there is PDF support for the autopreview