Skip to content

Commit

Permalink
Merge pull request #1010 from waterbearlang/example
Browse files Browse the repository at this point in the history
Set up to load example gists
  • Loading branch information
dethe committed Feb 21, 2015
2 parents 3723842 + ef23d3b commit 042bea0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion js/app.js
Expand Up @@ -106,7 +106,18 @@ function handleFileButton(evt){
Event.on(document.body, 'ui:click', '.open-files', handleFileButton);

function handleExampleButton(evt){
window.alert('No current examples or templates available. Check back later!');
var fileModel = nanoModal("Load an example program.",
{overlayClose: true, // Can't close the modal by clicking on the overlay.
buttons: [{
text: "Waterbear in Space",
handler: function(modal) {
_gaq.push(['_trackEvent', 'Tutorial', 'WaterbearInSpace']);
File.getScriptFromGistId('e06514193419705e6224');
modal.hide();
}
}]
});
fileModel.show();
}

Event.on(document.body, 'ui:click', '.open-example', handleExampleButton);
Expand Down
1 change: 1 addition & 0 deletions js/file.js
Expand Up @@ -239,6 +239,7 @@
createDownloadUrl: createDownloadUrl,
clearScripts: clearScripts,
loadScriptsFromGistId: loadScriptsFromGistId,
getScriptFromGistId: getScriptFromGistId,
loadScriptsFromExample: loadScriptsFromExample,
loadScriptsFromFilesystem: loadScriptsFromFilesystem,
loadCurrentScripts: loadCurrentScripts,
Expand Down

0 comments on commit 042bea0

Please sign in to comment.