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

Implement sharing/Deep links #19

Open
jvacek opened this issue Apr 16, 2018 · 5 comments
Open

Implement sharing/Deep links #19

jvacek opened this issue Apr 16, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@jvacek
Copy link

jvacek commented Apr 16, 2018

Being able to encode the first input into the url and the subsequent processes would be nifty when trying to share something. Otherwise you have to resort to screenshots which can get cumbersome seeing as things roll off to the side. Generating a screenshot would achieve the same desired effect but this might be a bit painful to do.

@ffraenz ffraenz self-assigned this Apr 16, 2018
@ffraenz
Copy link
Member

ffraenz commented Apr 16, 2018

The possibility of sharing a custom pipe (subsequent bricks / processes) was planned since the beginning of v4 development. The basic functionality is already implemented. However, the share UI and the backend are not ready yet.

In the meantime, you can use the following endpoint to link to a custom pipe:
https://cryptii.com/open?pipe=pipe_data

Replace pipe_data by an URL encoded JSON string describing the pipe's content. This feature is not documented yet, but you may derive the way it works from the structure below:

{
  "items": [
    { "name": "text" },
    {
      "name": "rot13",
      "settings": { "variant": "rot47" }
    },
    { "name": "text" }
  ],
  "content": {
    "data": "Hello World"
  }
}

Does that work for you? I'll leave this issue open until the share feature is fully implemented and ready. Thank's for your feedback!

@ffraenz
Copy link
Member

ffraenz commented Jul 27, 2018

Quick update: You can now serialize a pipe from the browser dev tools like this:

JSON.stringify(cryptii.App.getInstance().getPipe().serialize())

Send the resulting string via the pipe parameter to the /open endpoint and the same configuration will be rendered. Of course this is just experimental, the UI and back-end is still work in progress.

@fadookie
Copy link

Awesome! That share button would be great, but this will do for now.

Here's a console snippet to build the full share URL:

'https://cryptii.com/open?pipe=' + encodeURIComponent(JSON.stringify(cryptii.App.getInstance().getPipe().serialize()))

@ffraenz
Copy link
Member

ffraenz commented Apr 6, 2019

Hi folks! I deployed the new backend service with support for publishing own translation pipes. The user interface for publishing and sharing is still in the works. In the meantime you can throw the following statement into the dev tools console to publish the current pipe and to get a share link for it:

cryptii.App.getInstance().getPipe()
  .store().then(url => console.log('Share link: ' + url))

As this feature is not stable, yet, I can't guarantee that the share links will stay forever. Please keep that in mind. If you encounter issues or have feedback, please let me know in this thread.

Bonus tip: The upcoming UI will allow for a custom pipe title and description. You can replicate this with following statement:

cryptii.App.getInstance().getPipe()
  .setTitle('Norway Enigma "Norenigma": Simulate and encrypt online')
  .setDescription('In 1945, immediately after WWII, some captured Enigma-I machines…')
  .store().then(url => console.log('Share link: ' + url))

@ffraenz ffraenz pinned this issue Jun 24, 2019
@ffraenz ffraenz linked a pull request Mar 20, 2020 that will close this issue
@ffraenz
Copy link
Member

ffraenz commented Nov 16, 2022

Hi! I'd like to let you know that we are discontinuing the creation of deep links via the cryptii API. Existing shares created in the past will still work. I'm planning to add share links via URL fragments (hash at the end of the URL) in the future. I'll let you know when it's ready.

In the meantime, head over to the successor project ciphereditor where we already implemented a sharing & loading mechanism.

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

Successfully merging a pull request may close this issue.

3 participants