JS -- Add few missing constants in global scope

- these constants are available in pdfium implementation too
 - fix error code in aform.js
This commit is contained in:
Calixte Denizet 2021-01-11 17:19:24 +01:00
parent 631bada0df
commit 8e6bec6e2e
4 changed files with 138 additions and 20 deletions

View file

@ -122,11 +122,82 @@ const ZoomType = Object.freeze({
refW: "ReflowWidth",
});
const GlobalConstants = Object.freeze({
IDS_GREATER_THAN: "Invalid value: must be greater than or equal to % s.",
IDS_GT_AND_LT:
"Invalid value: must be greater than or equal to % s " +
"and less than or equal to % s.",
IDS_LESS_THAN: "Invalid value: must be less than or equal to % s.",
IDS_INVALID_MONTH: "** Invalid **",
IDS_INVALID_DATE:
"Invalid date / time: please ensure that the date / time exists.Field",
IDS_INVALID_DATE2: " should match format ",
IDS_INVALID_VALUE: "The value entered does not match the format of the field",
IDS_AM: "am",
IDS_PM: "pm",
IDS_MONTH_INFO:
"January[1] February[2] March[3] April[4] May[5] " +
"June[6] July[7] August[8] September[9] October[10] " +
"November[11] December[12] Sept[9] Jan[1] Feb[2] Mar[3] " +
"Apr[4] Jun[6] Jul[7] Aug[8] Sep[9] Oct[10] Nov[11] Dec[12]",
IDS_STARTUP_CONSOLE_MSG: "** ^ _ ^ **",
RE_NUMBER_ENTRY_DOT_SEP: ["[+-]?\\d*\\.?\\d*"],
RE_NUMBER_COMMIT_DOT_SEP: [
// -1.0 or -1
"[+-]?\\d+(\\.\\d+)?",
// -.1
"[+-]?\\.\\d+",
// -1.
"[+-]?\\d+\\.",
],
RE_NUMBER_ENTRY_COMMA_SEP: ["[+-]?\\d*,?\\d*"],
RE_NUMBER_COMMIT_COMMA_SEP: [
// -1,0 or -1
"[+-]?\\d+([.,]\\d+)?",
// -,1
"[+-]?[.,]\\d+",
// -1,
"[+-]?\\d+[.,]",
],
RE_ZIP_ENTRY: ["\\d{0,5}"],
RE_ZIP_COMMIT: ["\\d{5}"],
RE_ZIP4_ENTRY: ["\\d{0,5}(\\.|[- ])?\\d{0,4}"],
RE_ZIP4_COMMIT: ["\\d{5}(\\.|[- ])?\\d{4}"],
RE_PHONE_ENTRY: [
// 555-1234 or 408 555-1234
"\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}",
// (408
"\\(\\d{0,3}",
// (408) 555-1234
// (allow the addition of parens as an afterthought)
"\\(\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}",
// (408 555-1234
"\\(\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}",
// 408) 555-1234
"\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}",
// international
"011(\\.|[- \\d])*",
],
RE_PHONE_COMMIT: [
// 555-1234
"\\d{3}(\\.|[- ])?\\d{4}",
// 408 555-1234
"\\d{3}(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}",
// (408) 555-1234
"\\(\\d{3}\\)(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}",
// international
"011(\\.|[- \\d])*",
],
RE_SSN_ENTRY: ["\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"],
RE_SSN_COMMIT: ["\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"],
});
export {
Border,
Cursor,
Display,
Font,
GlobalConstants,
Highlight,
Position,
ScaleHow,