Skip to content

Commit

Permalink
ability to set image via url hash (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren authored Nov 5, 2018
1 parent 5f57123 commit a17d1a6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ window.onload = function() {
// UI for the overall demo:
var ui = DefaultHtmlSequencerUi(sequencer);

sequencer.loadImage("images/tulips.png", ui.onLoad);
// find any `src` parameters in URL hash and attempt to source image from them and run the sequencer
if (getUrlHashParameter('src')) {
sequencer.loadImage(getUrlHashParameter('src'), ui.onLoad);
} else {
sequencer.loadImage("images/tulips.png", ui.onLoad);
}

$("#addStep select").on("change", ui.selectNewStepUi);
$("#addStep #add-step-btn").on("click", ui.addStepUi);
Expand Down Expand Up @@ -115,7 +120,6 @@ window.onload = function() {
}
});


// image selection and drag/drop handling from examples/lib/imageSelection.js
sequencer.setInputStep({
dropZoneSelector: "#dropzone",
Expand Down

0 comments on commit a17d1a6

Please sign in to comment.