diff --git a/dist/image-sequencer.js b/dist/image-sequencer.js index fd1964a0..d0d1e024 100644 --- a/dist/image-sequencer.js +++ b/dist/image-sequencer.js @@ -184151,6 +184151,7 @@ ImageSequencer = function ImageSequencer(options) { options = options || {}; options.inBrowser = options.inBrowser || typeof window !== 'undefined'; if (options.inBrowser) options.ui = options.ui || require('./UserInterface'); + options.sequencer_counter = 0; options.initialImage = ""; var image, @@ -184165,7 +184166,13 @@ ImageSequencer = function ImageSequencer(options) { function addStep(name, o) { console.log('adding step "' + name + '"'); + if (!(options.instanceName) && this != window) + for(var variable in window) + if(window[variable] == this) + options.instanceName = variable; + o = o || {}; + o.id = options.sequencer_counter++; //Gives a Unique ID to each step o.name = o.name || name; o.selector = o.selector || 'ismod-' + name; o.container = o.container || options.selector; @@ -184177,7 +184184,9 @@ ImageSequencer = function ImageSequencer(options) { function defaultSetupModule() { if (options.ui) module.options.ui = options.ui({ selector: o.selector, - title: module.options.title + title: module.options.title, + id: o.id, + instanceName: options.instanceName }); } @@ -184218,6 +184227,17 @@ ImageSequencer = function ImageSequencer(options) { } + function removeStep (id) { + for (i=0;i
'); + options.uniqueSelector = options.uniqueSelector || options.selector + '-' + options.random; + $(options.container).append('
'); options.el = options.el || $('.' + options.uniqueSelector); createLabel(options.el); @@ -184299,7 +184325,7 @@ module.exports = function UserInterface(options) { //function move() {} function createLabel(el) { - if (options.title) el.prepend('

' + options.title + '

'); + if (options.title) el.prepend('

' + options.title + '

'); } return { diff --git a/src/ImageSequencer.js b/src/ImageSequencer.js index fa34eacb..8ec4caf9 100644 --- a/src/ImageSequencer.js +++ b/src/ImageSequencer.js @@ -5,6 +5,7 @@ ImageSequencer = function ImageSequencer(options) { options = options || {}; options.inBrowser = options.inBrowser || typeof window !== 'undefined'; if (options.inBrowser) options.ui = options.ui || require('./UserInterface'); + options.sequencer_counter = 0; options.initialImage = ""; var image, @@ -19,7 +20,13 @@ ImageSequencer = function ImageSequencer(options) { function addStep(name, o) { console.log('adding step "' + name + '"'); + if (!(options.instanceName) && this != window) + for(var variable in window) + if(window[variable] == this) + options.instanceName = variable; + o = o || {}; + o.id = options.sequencer_counter++; //Gives a Unique ID to each step o.name = o.name || name; o.selector = o.selector || 'ismod-' + name; o.container = o.container || options.selector; @@ -31,7 +38,9 @@ ImageSequencer = function ImageSequencer(options) { function defaultSetupModule() { if (options.ui) module.options.ui = options.ui({ selector: o.selector, - title: module.options.title + title: module.options.title, + id: o.id, + instanceName: options.instanceName }); } @@ -72,6 +81,17 @@ ImageSequencer = function ImageSequencer(options) { } + function removeStep (id) { + for (i=0;i
'); + options.uniqueSelector = options.uniqueSelector || options.selector + '-' + options.random; + $(options.container).append('
'); options.el = options.el || $('.' + options.uniqueSelector); createLabel(options.el); @@ -24,7 +25,7 @@ module.exports = function UserInterface(options) { //function move() {} function createLabel(el) { - if (options.title) el.prepend('

' + options.title + '

'); + if (options.title) el.prepend('

' + options.title + '

'); } return {