-
Notifications
You must be signed in to change notification settings - Fork 805
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
Export folders #756
Export folders #756
Conversation
var buf = ''; | ||
for (var i = 0, len = Storage.teams.length; i < len; i++) { | ||
var team = Storage.teams[i]; | ||
if ((folder.indexOf("/") && team.folder === folder.slice(0, -1)) || team.format === folder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
folder.indexOf("/")
and folder.slice(0, -1)
are weird things to do in an inner loop.
Not to mention folder.indexOf("/")
should probably be folder.slice(-1) === '/'
@Zarel is this good now? cleaned up messy if statement and squashed commits |
@@ -404,6 +409,8 @@ | |||
|
|||
if (window.nodewebkit) { | |||
buf += '<button name="revealFolder" class="button"><i class="fa fa-folder-open"></i> Reveal teams folder</button> <button name="reloadTeamsFolder" class="button"><i class="fa fa-refresh"></i> Reload teams files</button> <button name="backup" class="button"><i class="fa fa-upload"></i> Backup/Restore all teams</button>'; | |||
} else if (this.curFolder) { | |||
buf += '<button name="backup" class="button"><i class="fa fa-upload"></i> Backup all teams from this folder</button>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe still have a Backup all teams
button under it or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that would be ambiguous. This is fine.
Sounds good. Can you confirm you want it (and all your future contributions to Pokémon Showdown) released under the MIT license? |
MIT license is good |
I just realized that this doesn't work with the (uncategorized) or genN folders... should I remove the button from those or add more code to make it work. I don't see much reason to export those anyways... |
I'd say remove the button from those. |
I was sleep drunk when I slapped this together so it probably needs some cleaning up but it works...
not that I didn't add import to folder because you can just append it to restore all...