From a17d1a6ccd78e91043d823b134722c80a61ea491 Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Mon, 5 Nov 2018 12:10:20 -0500 Subject: [PATCH] ability to set image via url hash (#455) --- examples/demo.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/demo.js b/examples/demo.js index 29a312ff..1a901da9 100644 --- a/examples/demo.js +++ b/examples/demo.js @@ -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",