mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-15 04:40:02 +01:00
Completed the addStep issue.
This commit is contained in:
23
dist/image-sequencer.js
vendored
23
dist/image-sequencer.js
vendored
@@ -184159,6 +184159,25 @@ ImageSequencer = function ImageSequencer(options) {
|
|||||||
|
|
||||||
// if in browser, prompt for an image
|
// if in browser, prompt for an image
|
||||||
if (options.imageSelect || options.inBrowser) addStep('image-select');
|
if (options.imageSelect || options.inBrowser) addStep('image-select');
|
||||||
|
// {
|
||||||
|
// console.log('adding step "image-select"');
|
||||||
|
// o = {};
|
||||||
|
// o.name = 'image-select';
|
||||||
|
// o.selector = 'ismod-image-select';
|
||||||
|
// o.container = o.container || options.selector;
|
||||||
|
//
|
||||||
|
// var module = modules['image-select'](o);
|
||||||
|
//
|
||||||
|
// steps.push(module);
|
||||||
|
//
|
||||||
|
// module.setup();
|
||||||
|
//
|
||||||
|
// // Pre-set the initial output behavior of the final step,
|
||||||
|
// // which will be changed if an additional step is added.
|
||||||
|
// module.options.output = function output(image) {
|
||||||
|
// if (module.options.ui && module.options.ui.display) module.options.ui.display(image);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
else if (options.imageUrl) loadImage(imageUrl);
|
else if (options.imageUrl) loadImage(imageUrl);
|
||||||
|
|
||||||
// soon, detect local or URL?
|
// soon, detect local or URL?
|
||||||
@@ -184198,6 +184217,9 @@ ImageSequencer = function ImageSequencer(options) {
|
|||||||
if (previousStep) {
|
if (previousStep) {
|
||||||
// connect output of last step to input of this step
|
// connect output of last step to input of this step
|
||||||
previousStep.options.output = function output(image) {
|
previousStep.options.output = function output(image) {
|
||||||
|
if (sequencer.steps[0].options.initial_image) {
|
||||||
|
options.initial_image = sequencer.steps[0].options.initial_image;
|
||||||
|
}
|
||||||
log('running module "' + name + '"');
|
log('running module "' + name + '"');
|
||||||
// display the image in any available ui
|
// display the image in any available ui
|
||||||
if (previousStep.options.ui && previousStep.options.ui.display) previousStep.options.ui.display(image);
|
if (previousStep.options.ui && previousStep.options.ui.display) previousStep.options.ui.display(image);
|
||||||
@@ -184409,6 +184431,7 @@ module.exports = function ImageSelect(options) {
|
|||||||
// this module is unique because it creates the image
|
// this module is unique because it creates the image
|
||||||
function draw(image) {
|
function draw(image) {
|
||||||
el.html(image);
|
el.html(image);
|
||||||
|
options.initial_image = image;
|
||||||
if (options.output) options.output(image);
|
if (options.output) options.output(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
$('.add-step').click(function(e) {
|
$('.add-step').click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
sequencer.addStep($('.select-module').val());
|
sequencer.addStep($('.select-module').val());
|
||||||
sequencer.run(sequencer.initial_image); // later we might only run this step, if we can fetch the image output from the previous
|
sequencer.run(sequencer.options.initial_image); // later we might only run this step, if we can fetch the image output from the previous
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,25 @@ ImageSequencer = function ImageSequencer(options) {
|
|||||||
|
|
||||||
// if in browser, prompt for an image
|
// if in browser, prompt for an image
|
||||||
if (options.imageSelect || options.inBrowser) addStep('image-select');
|
if (options.imageSelect || options.inBrowser) addStep('image-select');
|
||||||
|
// {
|
||||||
|
// console.log('adding step "image-select"');
|
||||||
|
// o = {};
|
||||||
|
// o.name = 'image-select';
|
||||||
|
// o.selector = 'ismod-image-select';
|
||||||
|
// o.container = o.container || options.selector;
|
||||||
|
//
|
||||||
|
// var module = modules['image-select'](o);
|
||||||
|
//
|
||||||
|
// steps.push(module);
|
||||||
|
//
|
||||||
|
// module.setup();
|
||||||
|
//
|
||||||
|
// // Pre-set the initial output behavior of the final step,
|
||||||
|
// // which will be changed if an additional step is added.
|
||||||
|
// module.options.output = function output(image) {
|
||||||
|
// if (module.options.ui && module.options.ui.display) module.options.ui.display(image);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
else if (options.imageUrl) loadImage(imageUrl);
|
else if (options.imageUrl) loadImage(imageUrl);
|
||||||
|
|
||||||
// soon, detect local or URL?
|
// soon, detect local or URL?
|
||||||
@@ -52,6 +71,9 @@ ImageSequencer = function ImageSequencer(options) {
|
|||||||
if (previousStep) {
|
if (previousStep) {
|
||||||
// connect output of last step to input of this step
|
// connect output of last step to input of this step
|
||||||
previousStep.options.output = function output(image) {
|
previousStep.options.output = function output(image) {
|
||||||
|
if (sequencer.steps[0].options.initial_image) {
|
||||||
|
options.initial_image = sequencer.steps[0].options.initial_image;
|
||||||
|
}
|
||||||
log('running module "' + name + '"');
|
log('running module "' + name + '"');
|
||||||
// display the image in any available ui
|
// display the image in any available ui
|
||||||
if (previousStep.options.ui && previousStep.options.ui.display) previousStep.options.ui.display(image);
|
if (previousStep.options.ui && previousStep.options.ui.display) previousStep.options.ui.display(image);
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ module.exports = function ImageSelect(options) {
|
|||||||
// this module is unique because it creates the image
|
// this module is unique because it creates the image
|
||||||
function draw(image) {
|
function draw(image) {
|
||||||
el.html(image);
|
el.html(image);
|
||||||
|
options.initial_image = image;
|
||||||
if (options.output) options.output(image);
|
if (options.output) options.output(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user