alterm4nn/ChronoZoom — pull request #1341 by NeilCresswell (2014-07-22 18:40:44+00:00)
Title: Ability to Copy and Paste Timelines

This is now fully functional but has a few rough edges remaining, which are being looked into.

Copy icon on any timeline (next to favorites once you're logged in) can be used to copy any timeline, including all descendant timelines and all related exhibits and exhibit content items. Timelines are copied to the client machine's localStorage, so they can then be imported, including on a different log in if desired or multiple times. The export can be maintained indefinitely until the user's cache is cleared.

Import icon appears when the user is logged in and when an export is located in localStorage which matches the same database schema at the time of export. Imports are only permitted if the imported timeline will fit within the date bounds of the target timeline to import into, and if the user has appropriate permissions on the target timeline.

Rough edges remaining:
* Paste icon doesn't automatically appear after copy. (Need to refresh browser.)
* Copied content doesn't automatically appear after paste. (Need to refresh browser.)
* Paste icon not yet hidden if user doesn't have edit rights.

This has been written so that the storage mechanism could be enhanced to include the option to store to a file, which would give the users a chance to do personal backups or to transfer data to a different server. If you'd like to grab a personal copy in the meantime, this is typically easy to do with your browser's developer tools (typically F12.) e.g. For Chrome F12, Resources, Local Storage, double click on the ExportedTimelines value to copy, then you can paste into a text file. You should also copy off the ExportedSchemaVersion.

Validation is limited, but timelines are only imported as complete timelines. (All or nothing.)