constants.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /* Copyright 2020 Mozilla Foundation
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. const Border = Object.freeze({
  16. s: "solid",
  17. d: "dashed",
  18. b: "beveled",
  19. i: "inset",
  20. u: "underline",
  21. });
  22. const Cursor = Object.freeze({
  23. visible: 0,
  24. hidden: 1,
  25. delay: 2,
  26. });
  27. const Display = Object.freeze({
  28. visible: 0,
  29. hidden: 1,
  30. noPrint: 2,
  31. noView: 3,
  32. });
  33. const Font = Object.freeze({
  34. Times: "Times-Roman",
  35. TimesB: "Times-Bold",
  36. TimesI: "Times-Italic",
  37. TimesBI: "Times-BoldItalic",
  38. Helv: "Helvetica",
  39. HelvB: "Helvetica-Bold",
  40. HelvI: "Helvetica-Oblique",
  41. HelvBI: "Helvetica-BoldOblique",
  42. Cour: "Courier",
  43. CourB: "Courier-Bold",
  44. CourI: "Courier-Oblique",
  45. CourBI: "Courier-BoldOblique",
  46. Symbol: "Symbol",
  47. ZapfD: "ZapfDingbats",
  48. KaGo: "HeiseiKakuGo-W5-UniJIS-UCS2-H",
  49. KaMi: "HeiseiMin-W3-UniJIS-UCS2-H",
  50. });
  51. const Highlight = Object.freeze({
  52. n: "none",
  53. i: "invert",
  54. p: "push",
  55. o: "outline",
  56. });
  57. const Position = Object.freeze({
  58. textOnly: 0,
  59. iconOnly: 1,
  60. iconTextV: 2,
  61. textIconV: 3,
  62. iconTextH: 4,
  63. textIconH: 5,
  64. overlay: 6,
  65. });
  66. const ScaleHow = Object.freeze({
  67. proportional: 0,
  68. anamorphic: 1,
  69. });
  70. const ScaleWhen = Object.freeze({
  71. always: 0,
  72. never: 1,
  73. tooBig: 2,
  74. tooSmall: 3,
  75. });
  76. const Style = Object.freeze({
  77. ch: "check",
  78. cr: "cross",
  79. di: "diamond",
  80. ci: "circle",
  81. st: "star",
  82. sq: "square",
  83. });
  84. const Trans = Object.freeze({
  85. blindsH: "BlindsHorizontal",
  86. blindsV: "BlindsVertical",
  87. boxI: "BoxIn",
  88. boxO: "BoxOut",
  89. dissolve: "Dissolve",
  90. glitterD: "GlitterDown",
  91. glitterR: "GlitterRight",
  92. glitterRD: "GlitterRightDown",
  93. random: "Random",
  94. replace: "Replace",
  95. splitHI: "SplitHorizontalIn",
  96. splitHO: "SplitHorizontalOut",
  97. splitVI: "SplitVerticalIn",
  98. splitVO: "SplitVerticalOut",
  99. wipeD: "WipeDown",
  100. wipeL: "WipeLeft",
  101. wipeR: "WipeRight",
  102. wipeU: "WipeUp",
  103. });
  104. const ZoomType = Object.freeze({
  105. none: "NoVary",
  106. fitP: "FitPage",
  107. fitW: "FitWidth",
  108. fitH: "FitHeight",
  109. fitV: "FitVisibleWidth",
  110. pref: "Preferred",
  111. refW: "ReflowWidth",
  112. });
  113. const GlobalConstants = Object.freeze({
  114. IDS_GREATER_THAN: "Invalid value: must be greater than or equal to % s.",
  115. IDS_GT_AND_LT:
  116. "Invalid value: must be greater than or equal to % s " +
  117. "and less than or equal to % s.",
  118. IDS_LESS_THAN: "Invalid value: must be less than or equal to % s.",
  119. IDS_INVALID_MONTH: "** Invalid **",
  120. IDS_INVALID_DATE:
  121. "Invalid date / time: please ensure that the date / time exists.Field",
  122. IDS_INVALID_DATE2: " should match format ",
  123. IDS_INVALID_VALUE: "The value entered does not match the format of the field",
  124. IDS_AM: "am",
  125. IDS_PM: "pm",
  126. IDS_MONTH_INFO:
  127. "January[1] February[2] March[3] April[4] May[5] " +
  128. "June[6] July[7] August[8] September[9] October[10] " +
  129. "November[11] December[12] Sept[9] Jan[1] Feb[2] Mar[3] " +
  130. "Apr[4] Jun[6] Jul[7] Aug[8] Sep[9] Oct[10] Nov[11] Dec[12]",
  131. IDS_STARTUP_CONSOLE_MSG: "** ^ _ ^ **",
  132. RE_NUMBER_ENTRY_DOT_SEP: ["[+-]?\\d*\\.?\\d*"],
  133. RE_NUMBER_COMMIT_DOT_SEP: [
  134. // -1.0 or -1
  135. "[+-]?\\d+(\\.\\d+)?",
  136. // -.1
  137. "[+-]?\\.\\d+",
  138. // -1.
  139. "[+-]?\\d+\\.",
  140. ],
  141. RE_NUMBER_ENTRY_COMMA_SEP: ["[+-]?\\d*,?\\d*"],
  142. RE_NUMBER_COMMIT_COMMA_SEP: [
  143. // -1,0 or -1
  144. "[+-]?\\d+([.,]\\d+)?",
  145. // -,1
  146. "[+-]?[.,]\\d+",
  147. // -1,
  148. "[+-]?\\d+[.,]",
  149. ],
  150. RE_ZIP_ENTRY: ["\\d{0,5}"],
  151. RE_ZIP_COMMIT: ["\\d{5}"],
  152. RE_ZIP4_ENTRY: ["\\d{0,5}(\\.|[- ])?\\d{0,4}"],
  153. RE_ZIP4_COMMIT: ["\\d{5}(\\.|[- ])?\\d{4}"],
  154. RE_PHONE_ENTRY: [
  155. // 555-1234 or 408 555-1234
  156. "\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}",
  157. // (408
  158. "\\(\\d{0,3}",
  159. // (408) 555-1234
  160. // (allow the addition of parens as an afterthought)
  161. "\\(\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}",
  162. // (408 555-1234
  163. "\\(\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}",
  164. // 408) 555-1234
  165. "\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}",
  166. // international
  167. "011(\\.|[- \\d])*",
  168. ],
  169. RE_PHONE_COMMIT: [
  170. // 555-1234
  171. "\\d{3}(\\.|[- ])?\\d{4}",
  172. // 408 555-1234
  173. "\\d{3}(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}",
  174. // (408) 555-1234
  175. "\\(\\d{3}\\)(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}",
  176. // international
  177. "011(\\.|[- \\d])*",
  178. ],
  179. RE_SSN_ENTRY: ["\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"],
  180. RE_SSN_COMMIT: ["\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"],
  181. });
  182. export {
  183. Border,
  184. Cursor,
  185. Display,
  186. Font,
  187. GlobalConstants,
  188. Highlight,
  189. Position,
  190. ScaleHow,
  191. ScaleWhen,
  192. Style,
  193. Trans,
  194. ZoomType,
  195. };