ability to set image via url hash (#455)

This commit is contained in:
Jeffrey Warren
2018-11-05 12:10:20 -05:00
committed by GitHub
parent 5f57123503
commit a17d1a6ccd

View File

@@ -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);
@@ -115,7 +120,6 @@ window.onload = function() {
}
});
// image selection and drag/drop handling from examples/lib/imageSelection.js
sequencer.setInputStep({
dropZoneSelector: "#dropzone",