mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-17 13:50:04 +01:00
major restructuring, ui code separation and sequential processing
This commit is contained in:
26
src/UserInterface.js
Normal file
26
src/UserInterface.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Default UI for ImageBoard
|
||||
*/
|
||||
module.exports = function UserInterface(options) {
|
||||
|
||||
options = options || {};
|
||||
options.container = options.container || ".panels";
|
||||
|
||||
// method to create a UI for a given module
|
||||
function create(o) {
|
||||
o.random = o.random || parseInt(Math.random() * (new Date()).getTime() / 1000000);
|
||||
o.uniqueSelector = o.uniqueSelector || o.selector + '-' + o.random;
|
||||
$(options.container).append('<div class="panel ' + o.selector + ' ' + o.uniqueSelector + '"></div>');
|
||||
o.el = o.el || $('.' + o.uniqueSelector);
|
||||
return {
|
||||
el: o.el,
|
||||
uniqueSelector: o.uniqueSelector,
|
||||
selector: o.selector
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
create: create
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user