mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-11 19:00:00 +01:00
Fix Average module editing the UI from the source (#1469)
* Fix Average module editing the UI from the source * requested changes * Delete demo.js * cleanup Co-authored-by: Harsh Khandeparkar <34770591+HarshKhandeparkar@users.noreply.github.com> Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
This commit is contained in:
committed by
Jeffrey Warren
parent
b0ddea012a
commit
5ae545904d
@@ -31,13 +31,13 @@ window.onload = function () {
|
||||
};
|
||||
|
||||
versionManagement.getLatestVersionNumber(function(versionNumber) {
|
||||
console.log("The latest NPM version number for Image Sequencer (from GitHub) is v" + versionNumber);
|
||||
console.log('The latest NPM version number for Image Sequencer (from GitHub) is v' + versionNumber);
|
||||
});
|
||||
console.log("The local version number for Image Sequencer is v" + versionManagement.getLocalVersionNumber());
|
||||
console.log('The local version number for Image Sequencer is v' + versionManagement.getLocalVersionNumber());
|
||||
|
||||
function displayVersionNumber() {
|
||||
$('#version-number-text').text("Image Sequencer v" + versionManagement.getLocalVersionNumber());
|
||||
$('#version-number-top-right').text("v" + versionManagement.getLocalVersionNumber());
|
||||
$('#version-number-text').text('Image Sequencer v' + versionManagement.getLocalVersionNumber());
|
||||
$('#version-number-top-right').text('v' + versionManagement.getLocalVersionNumber());
|
||||
}
|
||||
displayVersionNumber();
|
||||
|
||||
@@ -349,4 +349,4 @@ window.onload = function () {
|
||||
} else {
|
||||
insertPreview.updatePreviews('images/tulips.png', document.querySelector('#addStep'));
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -42,8 +42,8 @@ module.exports = function Average(options, UI) {
|
||||
// report back and store average in metadata:
|
||||
options.step.metadata.averages = sum;
|
||||
|
||||
// TODO: refactor into a new "display()" method as per https://github.com/publiclab/image-sequencer/issues/242
|
||||
if (options.step.inBrowser && options.step.ui) $(options.step.ui).find('.details').append('<p><b>Averages</b> (r, g, b, a): ' + sum.join(', ') + '</p>');
|
||||
if (options.step.average === undefined) options.step.average = '';
|
||||
options.step.average += 'rgba(' + sum.join(', ') + ')';
|
||||
return pixels;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,5 +3,11 @@
|
||||
"description": "Average all pixel color",
|
||||
"inputs": {
|
||||
},
|
||||
"outputs": {
|
||||
"average": {
|
||||
"type": "string",
|
||||
"desc": "The average value of all the pixels."
|
||||
}
|
||||
},
|
||||
"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#average-module"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user