MCPcopy Create free account
hub / github.com/TruthHun/BookStack / def

Function def

static/editor.md/lib/codemirror/mode/clike/clike.js:258–275  ·  view source on GitHub ↗
(mimes, mode)

Source from the content-addressed store, hash-verified

256 }
257
258 function def(mimes, mode) {
259 if (typeof mimes == "string") mimes = [mimes];
260 var words = [];
261 function add(obj) {
262 if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
263 words.push(prop);
264 }
265 add(mode.keywords);
266 add(mode.builtin);
267 add(mode.atoms);
268 if (words.length) {
269 mode.helperType = mimes[0];
270 CodeMirror.registerHelper("hintWords", mimes[0], words);
271 }
272
273 for (var i = 0; i < mimes.length; ++i)
274 CodeMirror.defineMIME(mimes[i], mode);
275 }
276
277 def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
278 name: "clike",

Callers 1

clike.jsFile · 0.70

Calls 1

addFunction · 0.70

Tested by

no test coverage detected