wdHtmlSchemas.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. var s = {
  2. attrs: {}
  3. }; // Simple tag, reused for a whole lot of tags
  4. var langs = "ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" ");
  5. var targets = ["_blank", "_self", "_top", "_parent"];
  6. var charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
  7. var methods = ["get", "post", "put", "delete"];
  8. var encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
  9. var media = ["all", "screen", "print", "embossed", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "speech",
  10. "3d-glasses", "resolution [>][<][=] [X]", "device-aspect-ratio: X/Y", "orientation:portrait",
  11. "orientation:landscape", "device-height: [X]", "device-width: [X]"];
  12. var wdHtmlSchemas = {
  13. 'wd:write': {
  14. attrs: {
  15. type: ["CMS", "UEditor", "upload", "radio", "treeTable"],
  16. value: null,
  17. format: null,
  18. miniDate: ["false", "true"],
  19. length: null,
  20. param: null,
  21. onPicked: null,
  22. minDateName: null,
  23. maxDataName: null,
  24. minDate: null,
  25. maxDate: null,
  26. callback: null,
  27. objectName: null,
  28. }
  29. },
  30. 'wd:iterate': {
  31. attrs: {
  32. id: null,
  33. name: null,
  34. }
  35. },
  36. 'wd:equal': {
  37. attrs: {
  38. leftValue: null,
  39. rightValue: null,
  40. }
  41. },
  42. 'wd:notEqual': {
  43. attrs: {
  44. leftValue: null,
  45. rightValue: null,
  46. }
  47. },
  48. 'wd:contains': {
  49. attrs: {
  50. valueList: null,
  51. value: null,
  52. }
  53. },
  54. 'wd:isNull': {
  55. attrs: {
  56. var: null,
  57. value: null,
  58. }
  59. },
  60. 'codebook:translate': {
  61. attrs: {
  62. name: null,
  63. value: null,
  64. property: null,
  65. }
  66. },
  67. a: {
  68. attrs: {
  69. href: null,
  70. ping: null,
  71. type: null,
  72. media: media,
  73. target: targets,
  74. hreflang: langs
  75. }
  76. },
  77. abbr: s,
  78. acronym: s,
  79. address: s,
  80. applet: s,
  81. area: {
  82. attrs: {
  83. alt: null,
  84. coords: null,
  85. href: null,
  86. target: null,
  87. ping: null,
  88. media: media,
  89. hreflang: langs,
  90. type: null,
  91. shape: ["default", "rect", "circle", "poly"]
  92. }
  93. },
  94. article: s,
  95. aside: s,
  96. audio: {
  97. attrs: {
  98. src: null,
  99. mediagroup: null,
  100. crossorigin: ["anonymous", "use-credentials"],
  101. preload: ["none", "metadata", "auto"],
  102. autoplay: ["", "autoplay"],
  103. loop: ["", "loop"],
  104. controls: ["", "controls"]
  105. }
  106. },
  107. b: s,
  108. base: {
  109. attrs: {
  110. href: null,
  111. target: targets
  112. }
  113. },
  114. basefont: s,
  115. bdi: s,
  116. bdo: s,
  117. big: s,
  118. blockquote: {
  119. attrs: {
  120. cite: null
  121. }
  122. },
  123. body: s,
  124. br: s,
  125. button: {
  126. attrs: {
  127. form: null,
  128. formaction: null,
  129. name: null,
  130. value: null,
  131. autofocus: ["", "autofocus"],
  132. disabled: ["", "autofocus"],
  133. formenctype: encs,
  134. formmethod: methods,
  135. formnovalidate: ["", "novalidate"],
  136. formtarget: targets,
  137. type: ["submit", "reset", "button"]
  138. }
  139. },
  140. canvas: {
  141. attrs: {
  142. width: null,
  143. height: null
  144. }
  145. },
  146. caption: s,
  147. center: s,
  148. cite: s,
  149. code: s,
  150. col: {
  151. attrs: {
  152. span: null
  153. }
  154. },
  155. colgroup: {
  156. attrs: {
  157. span: null
  158. }
  159. },
  160. command: {
  161. attrs: {
  162. type: ["command", "checkbox", "radio"],
  163. label: null,
  164. icon: null,
  165. radiogroup: null,
  166. command: null,
  167. title: null,
  168. disabled: ["", "disabled"],
  169. checked: ["", "checked"]
  170. }
  171. },
  172. data: {
  173. attrs: {
  174. value: null
  175. }
  176. },
  177. datagrid: {
  178. attrs: {
  179. disabled: ["", "disabled"],
  180. multiple: ["", "multiple"]
  181. }
  182. },
  183. datalist: {
  184. attrs: {
  185. data: null
  186. }
  187. },
  188. dd: s,
  189. del: {
  190. attrs: {
  191. cite: null,
  192. datetime: null
  193. }
  194. },
  195. details: {
  196. attrs: {
  197. open: ["", "open"]
  198. }
  199. },
  200. dfn: s,
  201. dir: s,
  202. div: s,
  203. dl: s,
  204. dt: s,
  205. em: s,
  206. embed: {
  207. attrs: {
  208. src: null,
  209. type: null,
  210. width: null,
  211. height: null
  212. }
  213. },
  214. eventsource: {
  215. attrs: {
  216. src: null
  217. }
  218. },
  219. fieldset: {
  220. attrs: {
  221. disabled: ["", "disabled"],
  222. form: null,
  223. name: null
  224. }
  225. },
  226. figcaption: s,
  227. figure: s,
  228. font: s,
  229. footer: s,
  230. form: {
  231. attrs: {
  232. action: null,
  233. name: null,
  234. "accept-charset": charsets,
  235. autocomplete: ["on", "off"],
  236. enctype: encs,
  237. method: methods,
  238. novalidate: ["", "novalidate"],
  239. target: targets
  240. }
  241. },
  242. frame: s,
  243. frameset: s,
  244. h1: s,
  245. h2: s,
  246. h3: s,
  247. h4: s,
  248. h5: s,
  249. h6: s,
  250. head: {
  251. attrs: {},
  252. children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
  253. },
  254. header: s,
  255. hgroup: s,
  256. hr: s,
  257. html: {
  258. attrs: {
  259. manifest: null
  260. },
  261. children: ["head", "body"]
  262. },
  263. i: s,
  264. iframe: {
  265. attrs: {
  266. src: null,
  267. srcdoc: null,
  268. name: null,
  269. width: null,
  270. height: null,
  271. sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
  272. seamless: ["", "seamless"]
  273. }
  274. },
  275. img: {
  276. attrs: {
  277. alt: null,
  278. src: null,
  279. ismap: null,
  280. usemap: null,
  281. width: null,
  282. height: null,
  283. crossorigin: ["anonymous", "use-credentials"]
  284. }
  285. },
  286. input: {
  287. attrs: {
  288. alt: null,
  289. dirname: null,
  290. form: null,
  291. formaction: null,
  292. height: null,
  293. list: null,
  294. max: null,
  295. maxlength: null,
  296. min: null,
  297. name: null,
  298. pattern: null,
  299. placeholder: null,
  300. size: null,
  301. src: null,
  302. step: null,
  303. value: null,
  304. width: null,
  305. accept: ["audio/*", "video/*", "image/*"],
  306. autocomplete: ["on", "off"],
  307. autofocus: ["", "autofocus"],
  308. checked: ["", "checked"],
  309. disabled: ["", "disabled"],
  310. formenctype: encs,
  311. formmethod: methods,
  312. formnovalidate: ["", "novalidate"],
  313. formtarget: targets,
  314. multiple: ["", "multiple"],
  315. readonly: ["", "readonly"],
  316. required: ["", "required"],
  317. type: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month",
  318. "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio",
  319. "file", "submit", "image", "reset", "button"]
  320. }
  321. },
  322. ins: {
  323. attrs: {
  324. cite: null,
  325. datetime: null
  326. }
  327. },
  328. kbd: s,
  329. keygen: {
  330. attrs: {
  331. challenge: null,
  332. form: null,
  333. name: null,
  334. autofocus: ["", "autofocus"],
  335. disabled: ["", "disabled"],
  336. keytype: ["RSA"]
  337. }
  338. },
  339. label: {
  340. attrs: {
  341. "for": null,
  342. form: null
  343. }
  344. },
  345. legend: s,
  346. li: {
  347. attrs: {
  348. value: null
  349. }
  350. },
  351. link: {
  352. attrs: {
  353. href: null,
  354. type: null,
  355. hreflang: langs,
  356. media: media,
  357. sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
  358. }
  359. },
  360. map: {
  361. attrs: {
  362. name: null
  363. }
  364. },
  365. mark: s,
  366. menu: {
  367. attrs: {
  368. label: null,
  369. type: ["list", "context", "toolbar"]
  370. }
  371. },
  372. meta: {
  373. attrs: {
  374. content: null,
  375. charset: charsets,
  376. name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
  377. "http-equiv": ["content-language", "content-type", "default-style", "refresh"]
  378. }
  379. },
  380. meter: {
  381. attrs: {
  382. value: null,
  383. min: null,
  384. low: null,
  385. high: null,
  386. max: null,
  387. optimum: null
  388. }
  389. },
  390. nav: s,
  391. noframes: s,
  392. noscript: s,
  393. object: {
  394. attrs: {
  395. data: null,
  396. type: null,
  397. name: null,
  398. usemap: null,
  399. form: null,
  400. width: null,
  401. height: null,
  402. typemustmatch: ["", "typemustmatch"]
  403. }
  404. },
  405. ol: {
  406. attrs: {
  407. reversed: ["", "reversed"],
  408. start: null,
  409. type: ["1", "a", "A", "i", "I"]
  410. }
  411. },
  412. optgroup: {
  413. attrs: {
  414. disabled: ["", "disabled"],
  415. label: null
  416. }
  417. },
  418. option: {
  419. attrs: {
  420. disabled: ["", "disabled"],
  421. label: null,
  422. selected: ["", "selected"],
  423. value: null
  424. }
  425. },
  426. output: {
  427. attrs: {
  428. "for": null,
  429. form: null,
  430. name: null
  431. }
  432. },
  433. p: s,
  434. param: {
  435. attrs: {
  436. name: null,
  437. value: null
  438. }
  439. },
  440. pre: s,
  441. progress: {
  442. attrs: {
  443. value: null,
  444. max: null
  445. }
  446. },
  447. q: {
  448. attrs: {
  449. cite: null
  450. }
  451. },
  452. rp: s,
  453. rt: s,
  454. ruby: s,
  455. s: s,
  456. samp: s,
  457. script: {
  458. attrs: {
  459. type: ["text/javascript"],
  460. src: null,
  461. async: ["", "async"],
  462. defer: ["", "defer"],
  463. charset: charsets
  464. }
  465. },
  466. section: s,
  467. select: {
  468. attrs: {
  469. form: null,
  470. name: null,
  471. size: null,
  472. autofocus: ["", "autofocus"],
  473. disabled: ["", "disabled"],
  474. multiple: ["", "multiple"]
  475. }
  476. },
  477. small: s,
  478. source: {
  479. attrs: {
  480. src: null,
  481. type: null,
  482. media: null
  483. }
  484. },
  485. span: s,
  486. strike: s,
  487. strong: s,
  488. style: {
  489. attrs: {
  490. type: ["text/css"],
  491. media: media,
  492. scoped: null
  493. }
  494. },
  495. sub: s,
  496. summary: s,
  497. sup: s,
  498. table: s,
  499. tbody: s,
  500. td: {
  501. attrs: {
  502. colspan: null,
  503. rowspan: null,
  504. headers: null
  505. }
  506. },
  507. textarea: {
  508. attrs: {
  509. dirname: null,
  510. form: null,
  511. maxlength: null,
  512. name: null,
  513. placeholder: null,
  514. rows: null,
  515. cols: null,
  516. autofocus: ["", "autofocus"],
  517. disabled: ["", "disabled"],
  518. readonly: ["", "readonly"],
  519. required: ["", "required"],
  520. wrap: ["soft", "hard"]
  521. }
  522. },
  523. tfoot: s,
  524. th: {
  525. attrs: {
  526. colspan: null,
  527. rowspan: null,
  528. headers: null,
  529. scope: ["row", "col", "rowgroup", "colgroup"]
  530. }
  531. },
  532. thead: s,
  533. time: {
  534. attrs: {
  535. datetime: null
  536. }
  537. },
  538. title: s,
  539. tr: s,
  540. track: {
  541. attrs: {
  542. src: null,
  543. label: null,
  544. "default": null,
  545. kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
  546. srclang: langs
  547. }
  548. },
  549. tt: s,
  550. u: s,
  551. ul: s,
  552. "var": s,
  553. video: {
  554. attrs: {
  555. src: null,
  556. poster: null,
  557. width: null,
  558. height: null,
  559. crossorigin: ["anonymous", "use-credentials"],
  560. preload: ["auto", "metadata", "none"],
  561. autoplay: ["", "autoplay"],
  562. mediagroup: ["movie"],
  563. muted: ["", "muted"],
  564. controls: ["", "controls"]
  565. }
  566. },
  567. wbr: s
  568. };
  569. function getHtmlSchemas() {
  570. return JSON.parse(JSON.stringify(wdHtmlSchemas));
  571. }