-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 and export Sandcastle examples using Gists #3795
Import and export Sandcastle examples using Gists #3795
Conversation
|
Can we use the standard share icon? @ggetz can advise on what we used for the website. And perhaps use the GitHub icon for import gist if their terms of use allow it. |
Share icons are usually represented by http://fortawesome.github.io/Font-Awesome/icon/share-square-o/ or http://fortawesome.github.io/Font-Awesome/icon/share-alt/ |
Okay I will try to find a |
I've made some changes. All I need to do now is to not auto run code on page load. If you click import gist the code does not auto run, but if you enter a url with the query parameter for a gist the code will run automatically, which could cause security issues. I'm trying to figure out a fix for this. |
Fixed auto run problem. @pjcozzi one last thing I think. We discussed having a header when we share an example in the GitHub Gist (like the Cesium version and stuff like that). What if someone imports a Gist, with the header. Tweaks the code and then creates a new gist. That gist will have a double header. Is it worth fixing this (with an easy if) or should we not include the header? If we want the header what should it include besides the Cesium version? |
History works for gists, but not for other sandcastle examples. Working on that fix now. |
@@ -119,3 +119,17 @@ The 16 x 16px icons in these sprites are action and object type images which can | |||
.dijitRtl .dijitDisabled .dijitIconError { | |||
background-image: url('images/commonIconsObjActDisabled_rtl.png'); /* Contains both object and action icons as a sprite image for the disabled state. These would be used by buttons and menus. */ | |||
} | |||
|
|||
.gitHubIcon { |
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.
This file is part of Dojo, which is a third-party library. Do not modify it. There's probably a .css file in the Apps/Sandcastle
directory you can use. If not, @emackey will know.
Do we need to update https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md#example-applications for either of the new icons? |
Merge in master. There is probably a trivial conflict in CHANGES.md. |
I don't know what you mean. |
It would be OK to have a running history log, but the gist is already backed by a git repo. I was thinking to include the Cesium version and save date/time, which could be useful if there is a breaking API change in Cesium. However, why not start with no header at all, and then let's see if we actually need it. |
I am looking into if we need to updated https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md#example-applications. And do so if needed.
History is not working correctly. This has been an issue for a little while now. I think the best thing to do would be to create a new HTML file and have the link to the gist open that. I will get this change out before lunch so you can review. |
From the font awesome website.
As for the GitHub icon I don't think we need to document that either. From the GitHub page.
The above is permitted |
Let's still include them just for attribution. |
I have browser history working 90%. I will be talking with @emackey tomorrow to discuss my approach and help me out. |
I now believe bowser history is 100% working. I think this is ready for a look! |
As discussed offline with @emackey. Right now when you navigate to a exported sandcastle example the code does not auto run for security reasons. However since cesiumjs.org does not hold any user account info we think that we can allow the code from the gist to auto run. Does anyone anyone else see a security issue here? |
I can't think of a good reason not to auto-run the code. Also, I discussed with @TomPed a bit offline, but I think the share button should probably pop up a modal with the link filed in rather than have that weird empty text field it has right now. The modal could also let the user know that further edits to the code will not be reflected in the link (which is non-obvious right now). |
I've revamped the importing. Check it out. |
If there are no security concerns, auto-run is OK with me. @TomPed is there anything else before we merge this? Does anyone else want to review this? |
I will make that change now. I will also make some changes with the error handling. And do one final "user test". |
Made the changes that I wanted. If anyone else would take a look, that'd be great! |
Can the "Share" dialog appear right under the toolbar button instead of in the center of the page? Have you tried the share workflow for a few different apps? I know we discussed not wanting to create the GitHub gist when they first click the toolbar button, but this feels awkward to me. For example, shouldn't the "Get Link" button grey or go away once the link is shown? Should we auto select-all? Should just clicking in the text box create the link? What is simple and painful for the user? |
Fun idea: could be cool to write a Chrome plugin that can open a GitHub gist in Sandcastle. Total overkill right now. |
Let's not add it yet, but I wonder if long-term, we'll want a link to the GitHub gist from Sandcastle, e.g., https://gist.github.com/anonymous/7d67199111d68c6a6eceef8d0369192e, for comments and revision history. |
Did you test sharing when your offline? Is there a reasonable error message? |
Works great! Just those comments. |
Okay so I've changed how sharing works. I think that this is very easy to use and similar to how a few websites share. Also you will notice if you don't change code after sharing and try to share again the same link will be in the textbox. @pjcozzi what do you think? |
Made error messages reasonable when offline. |
This is all good with me. Does anyone else want to review before I merge? |
Thanks again @TomPed! |
Fixes #3702, #2152
Things to do: