{"action":"created","issue":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6338","repository_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium","labels_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6338/labels{/name}","comments_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6338/comments","events_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6338/events","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/issues/6338","id":305595266,"number":6338,"title":"Consistent boilerplate code in Sandcastle demos","user":{"login":"lilleyse","id":915398,"avatar_url":"https://avatars2.githubusercontent.com/u/915398?v=4","gravatar_id":"","url":"https://api.github.com/users/lilleyse","html_url":"https://github.com/lilleyse","followers_url":"https://api.github.com/users/lilleyse/followers","following_url":"https://api.github.com/users/lilleyse/following{/other_user}","gists_url":"https://api.github.com/users/lilleyse/gists{/gist_id}","starred_url":"https://api.github.com/users/lilleyse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lilleyse/subscriptions","organizations_url":"https://api.github.com/users/lilleyse/orgs","repos_url":"https://api.github.com/users/lilleyse/repos","events_url":"https://api.github.com/users/lilleyse/events{/privacy}","received_events_url":"https://api.github.com/users/lilleyse/received_events","type":"User","site_admin":false},"labels":[{"id":36420606,"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/labels/beginner","name":"beginner","color":"3b8334","default":false},{"id":626787120,"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/labels/category%20-%20sandcastle","name":"category - sandcastle","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-15T15:14:58Z","updated_at":"2018-03-27T13:06:50Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Some Sandcastle examples use outdated or inconsistent boilerplate code. This can be fixed be clicking the `Save As` button in each demo and replacing the code.\r\n\r\nThis would make a good beginner issue.\r\n\r\nMore details and an example from @emackey in https://github.com/AnalyticalGraphicsInc/cesium/pull/6337/\r\n\r\n> The other changes here are just from re-saving the demo directly from a Sandcastle instance. Would be great to have an intern go through and re-save all the demos at some point, so the boilerplate code all matches what Sandcastle produces (or write a build script to do it)."},"comment":{"url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/comments/376517734","html_url":"https://github.com/AnalyticalGraphicsInc/cesium/issues/6338#issuecomment-376517734","issue_url":"https://api.github.com/repos/AnalyticalGraphicsInc/cesium/issues/6338","id":376517734,"user":{"login":"emackey","id":1235080,"avatar_url":"https://avatars2.githubusercontent.com/u/1235080?v=4","gravatar_id":"","url":"https://api.github.com/users/emackey","html_url":"https://github.com/emackey","followers_url":"https://api.github.com/users/emackey/followers","following_url":"https://api.github.com/users/emackey/following{/other_user}","gists_url":"https://api.github.com/users/emackey/gists{/gist_id}","starred_url":"https://api.github.com/users/emackey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emackey/subscriptions","organizations_url":"https://api.github.com/users/emackey/orgs","repos_url":"https://api.github.com/users/emackey/repos","events_url":"https://api.github.com/users/emackey/events{/privacy}","received_events_url":"https://api.github.com/users/emackey/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T13:06:50Z","updated_at":"2018-03-27T13:06:50Z","author_association":"MEMBER","body":"@srwiseman Thanks for the offer!  The Sandcastle system has a \"Save\" functionality built-in, and the way it works is a little unorthodox.  You can write or modify some Sandcastle code directly in your web browser, testing it with F8 and using the integrated Cesium docs etc., and then when you're done, you click \"Save As\" from the top toolbar.  Sandcastle offers you a button \"Save HTML file...\" and you end up \"downloading\" your own code from the client-side-only web page.\r\n\r\nBut you end up downloading more than just your own code.  Sandcastle attaches some boilerplate HTML and JS, called the Sandcastle \"Bucket.\"  This means that what you've downloaded is not just a loose snipped of JavaScript, it's a full HTML file with your code embedded in a script tag.  The resulting file can be (and should be) saved directly to the Sandcastle gallery folder.  The saved HTML can be viewed as a stand-alone page right from there (although it still needs to be hosted, not just read from the filesystem there).  The next time you run the Cesium build, it will find the new save and sweep it into the Sandcastle Gallery listing, so it can be loaded back into Sandcastle right from the gallery bar.\r\n\r\nHere are some known problems:\r\n\r\n* The Sandcastle \"Bucket\" does change every so often, and when it does, ideally every gallery demo that exists should be updated to the new bucket code.  Typically the old ones still load fine, so no one bothers to update them.  A manual load-then-save from Sandcastle itself will cause the bucket code to be reset to the current contents.\r\n\r\n* Sometimes, well-meaning developers actually try to modify or whitespace-format the saved gallery HTML directly, like in some kind of text editor or other horrible app that isn't official Sandcastle.  Savages, I tell you.\r\n\r\nSo, what's needed is a build script that will run some of the load & save code from Sandcastle.  It would, one at a time, import each gallery demo, use the Sandcastle load code to strip away the bucket code that was saved into the demo itself, and then use Sandcastle save code to add a copy of the current bucket back to the loaded demo.  The result can then be saved back to the gallery in-place, overwriting the previous version.\r\n\r\nWith this script, one could make a change to the actual bucket, and then the script would rip through the entire collection of Sandcastle demos and update the bucket code in each of them.\r\n\r\nCriteria for success is:  I should be able to load any demo from the gallery, click \"Save As\", and save the demo back over itself, and *git should say that nothing has changed.*  We worked hard to make Sandcastle capable of round-trips with no changes per trip, but it only works when the thing being loaded has the correct bucket code."}}
{"actor":{"display_login":"emackey"}}