2 if (typeof exports
== "object" && typeof module
== "object") // CommonJS
3 mod(require("../../lib/codemirror"));
4 else if (typeof define
== "function" && define
.amd
) // AMD
5 define(["../../lib/codemirror"], mod
);
6 else // Plain browser env
8 })(function(CodeMirror
) {
11 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(" ");
12 var targets
= ["_blank", "_self", "_top", "_parent"];
13 var charsets
= ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
14 var methods
= ["get", "post", "put", "delete"];
15 var encs
= ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
16 var media
= ["all", "screen", "print", "embossed", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "speech",
17 "3d-glasses", "resolution [>][<][=] [X]", "device-aspect-ratio: X/Y", "orientation:portrait",
18 "orientation:landscape", "device-height: [X]", "device-width: [X]"];
19 var s
= { attrs
: {} }; // Simple tag, reused for a whole lot of tags
24 href
: null, ping
: null, type
: null,
36 alt
: null, coords
: null, href
: null, target
: null, ping
: null,
37 media
: media
, hreflang
: langs
, type
: null,
38 shape
: ["default", "rect", "circle", "poly"]
45 src
: null, mediagroup
: null,
46 crossorigin
: ["anonymous", "use-credentials"],
47 preload
: ["none", "metadata", "auto"],
48 autoplay
: ["", "autoplay"],
50 controls
: ["", "controls"]
54 base
: { attrs
: { href
: null, target
: targets
} },
59 blockquote
: { attrs
: { cite
: null } },
64 form
: null, formaction
: null, name
: null, value
: null,
65 autofocus
: ["", "autofocus"],
66 disabled
: ["", "autofocus"],
69 formnovalidate
: ["", "novalidate"],
71 type
: ["submit", "reset", "button"]
74 canvas
: { attrs
: { width
: null, height
: null } },
79 col
: { attrs
: { span
: null } },
80 colgroup
: { attrs
: { span
: null } },
83 type
: ["command", "checkbox", "radio"],
84 label
: null, icon
: null, radiogroup
: null, command
: null, title
: null,
85 disabled
: ["", "disabled"],
86 checked
: ["", "checked"]
89 data
: { attrs
: { value
: null } },
90 datagrid
: { attrs
: { disabled
: ["", "disabled"], multiple
: ["", "multiple"] } },
91 datalist
: { attrs
: { data
: null } },
93 del
: { attrs
: { cite
: null, datetime
: null } },
94 details
: { attrs
: { open
: ["", "open"] } },
101 embed
: { attrs
: { src
: null, type
: null, width
: null, height
: null } },
102 eventsource
: { attrs
: { src
: null } },
103 fieldset
: { attrs
: { disabled
: ["", "disabled"], form
: null, name
: null } },
110 action
: null, name
: null,
111 "accept-charset": charsets
,
112 autocomplete
: ["on", "off"],
115 novalidate
: ["", "novalidate"],
121 h1
: s
, h2
: s
, h3
: s
, h4
: s
, h5
: s
, h6
: s
,
124 children
: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
130 attrs
: { manifest
: null },
131 children
: ["head", "body"]
136 src
: null, srcdoc
: null, name
: null, width
: null, height
: null,
137 sandbox
: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
138 seamless
: ["", "seamless"]
143 alt
: null, src
: null, ismap
: null, usemap
: null, width
: null, height
: null,
144 crossorigin
: ["anonymous", "use-credentials"]
149 alt
: null, dirname
: null, form
: null, formaction
: null,
150 height
: null, list
: null, max
: null, maxlength
: null, min
: null,
151 name
: null, pattern
: null, placeholder
: null, size
: null, src
: null,
152 step
: null, value
: null, width
: null,
153 accept
: ["audio/*", "video/*", "image/*"],
154 autocomplete
: ["on", "off"],
155 autofocus
: ["", "autofocus"],
156 checked
: ["", "checked"],
157 disabled
: ["", "disabled"],
160 formnovalidate
: ["", "novalidate"],
162 multiple
: ["", "multiple"],
163 readonly
: ["", "readonly"],
164 required
: ["", "required"],
165 type
: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month",
166 "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio",
167 "file", "submit", "image", "reset", "button"]
170 ins
: { attrs
: { cite
: null, datetime
: null } },
174 challenge
: null, form
: null, name
: null,
175 autofocus
: ["", "autofocus"],
176 disabled
: ["", "disabled"],
180 label
: { attrs
: { "for": null, form
: null } },
182 li
: { attrs
: { value
: null } },
185 href
: null, type
: null,
188 sizes
: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
191 map
: { attrs
: { name
: null } },
193 menu
: { attrs
: { label
: null, type
: ["list", "context", "toolbar"] } },
198 name
: ["viewport", "application-name", "author", "description", "generator", "keywords"],
199 "http-equiv": ["content-language", "content-type", "default-style", "refresh"]
202 meter
: { attrs
: { value
: null, min
: null, low
: null, high
: null, max
: null, optimum
: null } },
208 data
: null, type
: null, name
: null, usemap
: null, form
: null, width
: null, height
: null,
209 typemustmatch
: ["", "typemustmatch"]
212 ol
: { attrs
: { reversed
: ["", "reversed"], start
: null, type
: ["1", "a", "A", "i", "I"] } },
213 optgroup
: { attrs
: { disabled
: ["", "disabled"], label
: null } },
214 option
: { attrs
: { disabled
: ["", "disabled"], label
: null, selected
: ["", "selected"], value
: null } },
215 output
: { attrs
: { "for": null, form
: null, name
: null } },
217 param
: { attrs
: { name
: null, value
: null } },
219 progress
: { attrs
: { value
: null, max
: null } },
220 q
: { attrs
: { cite
: null } },
228 type
: ["text/javascript"],
230 async
: ["", "async"],
231 defer
: ["", "defer"],
238 form
: null, name
: null, size
: null,
239 autofocus
: ["", "autofocus"],
240 disabled
: ["", "disabled"],
241 multiple
: ["", "multiple"]
245 source
: { attrs
: { src
: null, type
: null, media
: null } },
261 td
: { attrs
: { colspan
: null, rowspan
: null, headers
: null } },
264 dirname
: null, form
: null, maxlength
: null, name
: null, placeholder
: null,
265 rows
: null, cols
: null,
266 autofocus
: ["", "autofocus"],
267 disabled
: ["", "disabled"],
268 readonly
: ["", "readonly"],
269 required
: ["", "required"],
270 wrap
: ["soft", "hard"]
274 th
: { attrs
: { colspan
: null, rowspan
: null, headers
: null, scope
: ["row", "col", "rowgroup", "colgroup"] } },
276 time
: { attrs
: { datetime
: null } },
281 src
: null, label
: null, "default": null,
282 kind
: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
292 src
: null, poster
: null, width
: null, height
: null,
293 crossorigin
: ["anonymous", "use-credentials"],
294 preload
: ["auto", "metadata", "none"],
295 autoplay
: ["", "autoplay"],
296 mediagroup
: ["movie"],
297 muted
: ["", "muted"],
298 controls
: ["", "controls"]
305 accesskey
: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
307 contenteditable
: ["true", "false"],
309 dir
: ["ltr", "rtl", "auto"],
310 draggable
: ["true", "false", "auto"],
311 dropzone
: ["copy", "move", "link", "string:", "file:"],
318 itemscope
: ["itemscope"],
321 spellcheck
: ["true", "false"],
323 tabindex
: ["1", "2", "3", "4", "5", "6", "7", "8", "9"],
325 translate
: ["yes", "no"],
327 rel
: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"]
329 function populate(obj
) {
330 for (var attr
in globalAttrs
) if (globalAttrs
.hasOwnProperty(attr
))
331 obj
.attrs
[attr
] = globalAttrs
[attr
];
335 for (var tag
in data
) if (data
.hasOwnProperty(tag
) && data
[tag
] != s
)
338 CodeMirror
.htmlSchema
= data
;
339 function htmlHint(cm
, options
) {
340 var local
= {schemaInfo
: data
};
341 if (options
) for (var opt
in options
) local
[opt
] = options
[opt
];
342 return CodeMirror
.hint
.xml(cm
, local
);
344 CodeMirror
.registerHelper("hint", "html", htmlHint
);