Fixed all HTML operations

This commit is contained in:
n1474335 2018-07-15 13:25:44 +01:00
parent ab44100312
commit 651ca6cf5d
13 changed files with 62 additions and 52 deletions

View file

@ -47,9 +47,10 @@ class Diff extends Operation {
"value": true
},
{
"name": "Ignore whitespace (relevant for word and line)",
"name": "Ignore whitespace",
"type": "boolean",
"value": false
"value": false,
"hint": "Relevant for word and line"
}
];
}

View file

@ -113,7 +113,7 @@ CMYK: ${cmyk}
document.getElementById('input-text').value = 'rgba(' +
color.r + ', ' + color.g + ', ' + color.b + ', ' + color.a + ')';
window.app.autoBake();
});
}).children(".colorpicker").removeClass('dropdown-menu');
</script>`;
}

View file

@ -7,7 +7,6 @@
import Operation from "../Operation";
import moment from "moment-timezone";
import {DATETIME_FORMATS, FORMAT_EXAMPLES} from "../lib/DateTime";
import OperationError from "../errors/OperationError";
/**
* Parse DateTime operation
@ -60,7 +59,7 @@ class ParseDateTime extends Operation {
date = moment.tz(input, inputFormat, inputTimezone);
if (!date || date.format() === "Invalid date") throw Error;
} catch (err) {
throw new OperationError(`Invalid format.\n\n${FORMAT_EXAMPLES}`);
return `Invalid format.\n\n${FORMAT_EXAMPLES}`;
}
output += "Date: " + date.format("dddd Do MMMM YYYY") +

View file

@ -152,7 +152,7 @@ class ToTable extends Operation {
// If the first row is a header then put it in <thead> with <th> cells.
if (firstRowHeader) {
const row = tableData.shift();
output += "<thead>";
output += "<thead class='thead-light'>";
output += outputRow(row, "th");
output += "</thead>";
}

View file

@ -68,7 +68,7 @@ class TranslateDateTimeFormat extends Operation {
date = moment.tz(input, inputFormat, inputTimezone);
if (!date || date.format() === "Invalid date") throw Error;
} catch (err) {
throw new OperationError(`Invalid format.\n\n${FORMAT_EXAMPLES}`);
return `Invalid format.\n\n${FORMAT_EXAMPLES}`;
}
return date.tz(outputTimezone).format(outputFormat);