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

Import/Export Templates #11

Closed
neocotic opened this issue Jul 26, 2011 · 2 comments
Closed

Import/Export Templates #11

neocotic opened this issue Jul 26, 2011 · 2 comments

Comments

@neocotic
Copy link
Member

Allow users to import/export both official and user-generated templates. JSON is probably the safest option but investigation is required as to whether or not Chrome allows file uploads or if copy-paste system should be used. Regardless, the system must allow multiple templates to be imported/exported at one time. Also, it is vital that the system is future-proof and is probably wise to include the extension version from the beginning should it be required further down the line.

When importing care should be taken to ensure name conflicts are resolved if/when they occur, always favoring the existing template. This could be done by attempting to append a number (starting from 1) to the name until an available alternative is found. The availability check should include any templates added previously in the import job in case the JSON includes duplicate templates.

Full validation should be carried out on the imported templates once completed. Imports should not be persisted automatically and should only be if/when the user clicks the "Save & Close" button.

@ghost ghost assigned neocotic Jul 26, 2011
@neocotic
Copy link
Member Author

neocotic commented Aug 1, 2011

This has been implemented in my last commit but still requires intensive testing and the code needs cleaned up (as does a lot of code in options.js).

Important Points

  • Any imports that change existing templates only change the existing template's values if they are valid
  • Any imports that could override predefined templates only have their non-protected values changed
  • A Save As... exists on the Export popup but handles differently depending on whether or not the user is in offline mode
    • Online: Sends the export string to my server API and forces a download of the text file (suggesting the file name export.json)
    • Offline: Attempts to force a download of the export string as a text file but cannot suggest a file name or type (may be confusing)
  • User can always select which template(s) they wish to import/export

Over time I will determine whether or not the Save As... setup is workable and safe.

@neocotic
Copy link
Member Author

neocotic commented Aug 2, 2011

This has now been implemented and I'm happy with it so far. I'm sure any/all bugs will be picked up by users with normal use. May test offline Save As... functionality is triggered as expected (when there's no internet connection) so really just need to test window.navigator.onLine === false when offline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant