mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-14 12:19:58 +01:00
Patch for UI
This commit is contained in:
@@ -1,17 +1,20 @@
|
||||
/*
|
||||
* Default UI for each image-sequencer module
|
||||
*/
|
||||
module.exports = function UserInterface(UI,options) {
|
||||
module.exports = function UserInterface(newUI = {},options) {
|
||||
|
||||
var UI = newUI;
|
||||
|
||||
return function userInterface(identity) {
|
||||
|
||||
var UI = UI || {};
|
||||
identity.ui = options.ui;
|
||||
identity.inBrowser = options.inBrowser;
|
||||
|
||||
UI.onSetup = UI.onSetup || function() {
|
||||
if(options.ui == false) {
|
||||
UI.onSetup = UI.onSetup || function(identity) {
|
||||
if(identity.ui == false) {
|
||||
// No UI
|
||||
}
|
||||
else if(options.inBrowser) {
|
||||
else if(identity.inBrowser) {
|
||||
// Create and append an HTML Element
|
||||
console.log("Added Step \""+identity.stepName+"\" to \""+identity.imageName+"\".");
|
||||
}
|
||||
@@ -22,11 +25,11 @@ module.exports = function UserInterface(UI,options) {
|
||||
}
|
||||
}
|
||||
|
||||
UI.onDraw = UI.onDraw || function() {
|
||||
if (options.ui == false) {
|
||||
UI.onDraw = UI.onDraw || function(identity) {
|
||||
if (identity.ui == false) {
|
||||
// No UI
|
||||
}
|
||||
else if(options.inBrowser) {
|
||||
else if(identity.inBrowser) {
|
||||
// Overlay a loading spinner
|
||||
console.log("Drawing Step \""+identity.stepName+"\" on \""+identity.imageName+"\".");
|
||||
}
|
||||
@@ -36,11 +39,11 @@ module.exports = function UserInterface(UI,options) {
|
||||
}
|
||||
}
|
||||
|
||||
UI.onComplete = UI.onComplete || function(output) {
|
||||
if (options.ui == false) {
|
||||
UI.onComplete = UI.onComplete || function(identity,output) {
|
||||
if (identity.ui == false) {
|
||||
// No UI
|
||||
}
|
||||
else if(options.inBrowser) {
|
||||
else if(identity.inBrowser) {
|
||||
// Update the DIV Element
|
||||
// Hide the laoding spinner
|
||||
console.log("Drawn Step \""+identity.stepName+"\" on \""+identity.imageName+"\".");
|
||||
@@ -51,11 +54,11 @@ module.exports = function UserInterface(UI,options) {
|
||||
}
|
||||
}
|
||||
|
||||
UI.onRemove = UI.onRemove || function(callback) {
|
||||
if(options.ui == false){
|
||||
UI.onRemove = UI.onRemove || function(identity) {
|
||||
if(identity.ui == false){
|
||||
// No UI
|
||||
}
|
||||
else if(options.inBrowser) {
|
||||
else if(identity.inBrowser) {
|
||||
// Remove the DIV Element
|
||||
console.log("Removing Step \""+identity.stepName+"\" of \""+identity.imageName+"\".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user