mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-11 19:00:00 +01:00
[GCI] Standardised UI util code comments (#1344)
* standardise comments * small fix Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
This commit is contained in:
committed by
Jeffrey Warren
parent
d83703cf02
commit
1db650cdd7
@@ -1,3 +1,4 @@
|
|||||||
|
// Generate downscaled preview images for quick buttons.
|
||||||
function generatePreview(previewStepName, customValues, path, DomNode) {
|
function generatePreview(previewStepName, customValues, path, DomNode) {
|
||||||
var previewSequencer = ImageSequencer();
|
var previewSequencer = ImageSequencer();
|
||||||
function insertPreview(src) {
|
function insertPreview(src) {
|
||||||
@@ -52,8 +53,8 @@ function updatePreviews(src, DomNode) {
|
|||||||
var height = img.height;
|
var height = img.height;
|
||||||
var width = img.width;
|
var width = img.width;
|
||||||
|
|
||||||
let percentage = (80 / height) * 100; //take the min resize value that fits the preview area => (new-width/orig_ht) - '80 as the preview area has 80*80 dimension
|
let percentage = (80 / height) * 100; // Take the min resize value that fits the preview area => (new-width/orig_ht) - '80 as the preview area has 80*80 dimension.
|
||||||
percentage = Math.max((80 / width) * 100, percentage); // make sure that one dimension doesn't resize greater, leading distorting preview-area fitting
|
percentage = Math.max((80 / width) * 100, percentage); // Make sure that one dimension doesn't resize greater, leading distorting preview-area fitting.
|
||||||
percentage = Math.ceil(percentage);
|
percentage = Math.ceil(percentage);
|
||||||
|
|
||||||
var sequencer = ImageSequencer();
|
var sequencer = ImageSequencer();
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* @description Maps module input types to their respective html <input> tag types.
|
||||||
|
* @param {Object} inputInfo Object containing the type and optionally min/max for range type inputs.
|
||||||
|
*/
|
||||||
function mapHtmlTypes(inputInfo){
|
function mapHtmlTypes(inputInfo){
|
||||||
var htmlType;
|
var htmlType;
|
||||||
switch(inputInfo.type.toLowerCase()){
|
switch(inputInfo.type.toLowerCase()){
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @method $scope
|
* @method $scope
|
||||||
* @param {"DOMNode"} scope A DOM Node as the scope
|
* @param {"DOMNode"} scope A DOM Node as the scope
|
||||||
|
* @returns {Function} Constructor for the scopeSelector Object.
|
||||||
*/
|
*/
|
||||||
function $scope(scope) {
|
function $scope(scope) {
|
||||||
return function(queryString){
|
return function(queryString){
|
||||||
@@ -24,6 +25,7 @@ function $scope(scope) {
|
|||||||
/**
|
/**
|
||||||
* @method $scopeAll
|
* @method $scopeAll
|
||||||
* @param {"DOMNode"} scope A DOM Node as the scope
|
* @param {"DOMNode"} scope A DOM Node as the scope
|
||||||
|
* @returns {Function} Constructor for the scopeSelectorAll Object.
|
||||||
*/
|
*/
|
||||||
function $scopeAll(scope){
|
function $scopeAll(scope){
|
||||||
return function(queryString){
|
return function(queryString){
|
||||||
@@ -47,7 +49,8 @@ function $scopeAll(scope){
|
|||||||
/**
|
/**
|
||||||
* @method scopeSelector
|
* @method scopeSelector
|
||||||
* @description A scoped jQuery selector
|
* @description A scoped jQuery selector
|
||||||
* @param {"DOMNode"} scope DOM Node as the scope
|
* @param {"DOMNode"} scope A DOM Node as the scope
|
||||||
|
* @returns {Function}
|
||||||
*/
|
*/
|
||||||
function scopeSelector(scope){
|
function scopeSelector(scope){
|
||||||
return $scope(scope);
|
return $scope(scope);
|
||||||
@@ -56,7 +59,8 @@ function scopeSelector(scope){
|
|||||||
/**
|
/**
|
||||||
* @method scopeSelectorAll
|
* @method scopeSelectorAll
|
||||||
* @description A scoped jQuery multiple selector
|
* @description A scoped jQuery multiple selector
|
||||||
* @param {"DOMNode} scope DOM Node as the scope
|
* @param {"DOMNode} scope A DOM Node as the scope
|
||||||
|
* @returns {Function}
|
||||||
*/
|
*/
|
||||||
function scopeSelectorAll(scope){
|
function scopeSelectorAll(scope){
|
||||||
return $scopeAll(scope);
|
return $scopeAll(scope);
|
||||||
|
|||||||
Reference in New Issue
Block a user