Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow to Import showdown from GET parameters #629

Merged
merged 4 commits into from
Jul 25, 2024

Conversation

arleypadua
Copy link
Contributor

@arleypadua arleypadua commented Jul 12, 2024

PR Description: Import showdown directly from the URL

Overview

Recently I started writing a web-based version of a save editing app (PKHeX Web). This change allows importing Pokemon data directly from PKHeX Web (or any other app) using a base64-encoded URL parameter named import

Changes Made

- Decodes a base64-encoded string from the `import` URL parameter.
- Sets the decoded string as the value of the text area for importing Pokemon data.

Purpose

Facilitates seamless integration between any external app and the Pokemon calculator. Allows users to transfer Pokemon data (party or box) from PKHeX Web to the calculator, streamlining their workflow.

Example

The following URL:

https://calc.pokemonshowdown.com/index.html?import=VG90b2RpbGUgKE0pCklWczogMjIgSFAgLyAyMiBBdGsgLyAyMiBEZWYgLyA4IFNwQSAvIDI4IFNwRCAvIDIgU3BlCkVWczogOSBIUCAvIDEgU3BEIC8gNiBTcGUKQWJpbGl0eTogVG9ycmVudApMZXZlbDogMTAKTWlsZCBOYXR1cmUKLSBTY3JhdGNoCi0gTGVlcgotIFdhdGVyIEd1bgotIFJhZ2UKCkhvb3Rob290IChNKQpJVnM6IDIzIEhQIC8gMTUgQXRrIC8gOCBEZWYgLyAyOSBTcEEgLyAxNCBTcEQgLyA2IFNwZQpBYmlsaXR5OiBLZWVuIEV5ZQpMZXZlbDogMwpOYXVnaHR5IE5hdHVyZQotIFRhY2tsZQotIEdyb3dsCi0gRm9yZXNpZ2h0

Would render

Screenshot_20240713-025948

@AustinXII
Copy link
Member

Thanks! Would you be able to fix the tests?

@arleypadua
Copy link
Contributor Author

Thanks! Would you be able to fix the tests?

Thanks, I guess lint was complaining about the use of let as a unknown token.

Switched to use the plain old var, hope it fixes the issue

@thejetou
Copy link
Collaborator

Hello, there are still some build errors, but these should be easy to fix. You can run tests locally btw (npm run test).

This should be ready-to-merge once the build errors are fixed.

@arleypadua
Copy link
Contributor Author

Hello, there are still some build errors, but these should be easy to fix. You can run tests locally btw (npm run test).

This should be ready-to-merge once the build errors are fixed.

Whops, my bad.. as I'm on holidays, I thought that that was the only issue and ended up fixing on my phone.

Will find some time later this week to properly run it locally and fix everything ✌🏼

@arleypadua
Copy link
Contributor Author

Thanks again @AustinXII @thejetou

Fixed all lint issues on the latest commit and tests are running green ✅

image

@thejetou thejetou merged commit b2beae4 into smogon:master Jul 25, 2024
2 checks passed
@thejetou
Copy link
Collaborator

For what it's worth, the commit you pushed did not include the linter fixes but I decided to just fix it myself instead.

Thanks.

@arleypadua
Copy link
Contributor Author

Thanks a lot, don't know what happened since it fixed and passed locally.

Maybe I overlooked something. Thanks anyway

@arleypadua arleypadua deleted the patch-1 branch July 25, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants