ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
HFile_javascript.php
Go to the documentation of this file.
1<?php
2$BEAUT_PATH = realpath(".") . "/Services/COPage/syntax_highlight/php";
3if (!isset($BEAUT_PATH)) {
4 return;
5}
6require_once("$BEAUT_PATH/Beautifier/HFile.php");
7 class HFile_javascript extends HFile
8 {
9 public function HFile_javascript()
10 {
11 $this->HFile();
12 /*************************************/
13 // Beautifier Highlighting Configuration File
14 // JavaScript
15 /*************************************/
16 // Flags
17
18 $this->nocase = "0";
19 $this->notrim = "0";
20 $this->perl = "0";
21
22 // Colours
23
24 $this->colours = array("blue", "purple", "gray");
25 $this->quotecolour = "blue";
26 $this->blockcommentcolour = "green";
27 $this->linecommentcolour = "green";
28
29 // Indent Strings
30
31 $this->indent = array("{");
32 $this->unindent = array("}");
33
34 // String characters and delimiters
35
36 $this->stringchars = array();
37 $this->delimiters = array("~", "!", "@", "%", "^", "&", "*", "(", ")", "-", "+", "=", "|", "\\", "/", "{", "}", "[", "]", ":", ";", "\"", "'", "<", ">", " ", ",", " ", ".", "?");
38 $this->escchar = "";
39
40 // Comment settings
41
42 $this->linecommenton = array("//");
43 $this->blockcommenton = array("/*");
44 $this->blockcommentoff = array("*/");
45
46 // Keywords (keyword mapping to colour number)
47
48 $this->keywords = array(
49 "abstract" => "1",
50 "byte" => "1",
51 "case" => "1",
52 "catch" => "1",
53 "char" => "1",
54 "class" => "1",
55 "const" => "1",
56 "continue" => "1",
57 "default" => "1",
58 "delete" => "1",
59 "do" => "1",
60 "double" => "1",
61 "else" => "1",
62 "extends" => "1",
63 "false" => "1",
64 "final" => "1",
65 "finally" => "1",
66 "float" => "1",
67 "for" => "1",
68 "function" => "1",
69 "goto" => "1",
70 "if" => "1",
71 "implements" => "1",
72 "import" => "1",
73 "in" => "1",
74 "instanceof" => "1",
75 "int" => "1",
76 "interface" => "1",
77 "long" => "1",
78 "native" => "1",
79 "new" => "1",
80 "null" => "1",
81 "package" => "1",
82 "private" => "1",
83 "protected" => "1",
84 "public" => "1",
85 "reset" => "2",
86 "return" => "1",
87 "short" => "1",
88 "static" => "1",
89 "super" => "1",
90 "switch" => "1",
91 "synchronized" => "1",
92 "this" => "1",
93 "throw" => "1",
94 "transient" => "1",
95 "true" => "1",
96 "try" => "1",
97 "var" => "1",
98 "void" => "1",
99 "while" => "1",
100 "with" => "1",
101 "$n" => "2",
102 "above" => "2",
103 "abs" => "2",
104 "acos" => "2",
105 "action" => "2",
106 "activeElement" => "2",
107 "alert" => "2",
108 "alinkColor" => "2",
109 "all" => "2",
110 "altKey" => "2",
111 "anchor" => "2",
112 "anchors" => "2",
113 "appCodeName" => "2",
114 "applets" => "2",
115 "apply" => "2",
116 "appName" => "2",
117 "appVersion" => "2",
118 "arguments" => "2",
119 "arity" => "2",
120 "asin" => "2",
121 "assign" => "2",
122 "atan" => "2",
123 "atan2" => "2",
124 "atob" => "2",
125 "availHeight" => "2",
126 "availLeft" => "2",
127 "availTop" => "2",
128 "availWidth" => "2",
129 "back" => "2",
130 "background" => "2",
131 "below" => "2",
132 "bgColor" => "2",
133 "big" => "2",
134 "blink" => "2",
135 "blur" => "2",
136 "bold" => "2",
137 "border" => "2",
138 "borderWidths" => "2",
139 "bottom" => "2",
140 "btoa" => "2",
141 "button" => "2",
142 "call" => "2",
143 "callee" => "2",
144 "caller" => "2",
145 "cancelBubble" => "2",
146 "captureEvents" => "2",
147 "ceil" => "2",
148 "charAt" => "2",
149 "charCodeAt" => "2",
150 "charset" => "2",
151 "checked" => "2",
152 "children" => "2",
153 "classes" => "2",
154 "className" => "2",
155 "clear" => "2",
156 "clearInterval" => "2",
157 "clearTimeout" => "2",
158 "click" => "2",
159 "clientInformation" => "2",
160 "clientX" => "2",
161 "clientY" => "2",
162 "close" => "2",
163 "closed" => "2",
164 "colorDepth" => "2",
165 "compile" => "2",
166 "complete" => "2",
167 "concat" => "2",
168 "confirm" => "2",
169 "constructir" => "2",
170 "contains" => "2",
171 "contextual" => "2",
172 "cookie" => "2",
173 "cos" => "2",
174 "crypto" => "2",
175 "ctrlKey" => "2",
176 "current" => "2",
177 "data" => "2",
178 "defaultCharset" => "2",
179 "defaultChecked" => "2",
180 "defaultSelected" => "2",
181 "defaultStatus" => "2",
182 "defaultValue" => "2",
183 "description" => "2",
184 "disableExternalCapture" => "2",
185 "disablePrivilege" => "2",
186 "document" => "2",
187 "domain" => "2",
188 "E" => "2",
189 "element" => "2",
190 "FromPoint" => "2",
191 "elements" => "2",
192 "embeds" => "2",
193 "enabledPlugin" => "2",
194 "enableExternalCapture" => "2",
195 "enablePrivilege" => "2",
196 "encoding" => "2",
197 "escape" => "2",
198 "eval" => "2",
199 "event" => "2",
200 "exec" => "2",
201 "exp" => "2",
202 "expando" => "2",
203 "fgColor" => "2",
204 "fileName" => "2",
205 "find" => "2",
206 "fixed" => "2",
207 "floor" => "2",
208 "focus" => "2",
209 "fontColor" => "2",
210 "fontSize" => "2",
211 "form" => "2",
212 "forms" => "2",
213 "forward" => "2",
214 "frames" => "2",
215 "fromCharCode" => "2",
216 "fromElement" => "2",
217 "getAttribute" => "2",
218 "get" => "2",
219 "getClass" => "2",
220 "getDate" => "2",
221 "getDay" => "2",
222 "getFullYear" => "2",
223 "getHours" => "2",
224 "getMember" => "2",
225 "getMilliseconds" => "2",
226 "getMinutes" => "2",
227 "getMonth" => "2",
228 "getSeconds" => "2",
229 "getSelection" => "2",
230 "getSlot" => "2",
231 "getTime" => "2",
232 "getTimezoneOffset" => "2",
233 "getUTCDate" => "2",
234 "getUTCDay" => "2",
235 "getUTCFullYear" => "2",
236 "getUTCHours" => "2",
237 "getUTCMilliseconds" => "2",
238 "getUTCMinutes" => "2",
239 "getUTCMonth" => "2",
240 "getUTCSeconds" => "2",
241 "getWindow" => "2",
242 "getYear" => "2",
243 "global" => "2",
244 "go" => "2",
245 "HandleEvent" => "2",
246 "hash" => "2",
247 "hidden" => "2",
248 "history" => "2",
249 "home" => "2",
250 "host" => "2",
251 "hostName" => "2",
252 "href" => "2",
253 "hspace" => "2",
254 "id" => "2",
255 "ids" => "2",
256 "ignoreCase" => "2",
257 "images" => "2",
258 "index" => "2",
259 "indexOf" => "2",
260 "inner" => "2",
261 "Height" => "2",
262 "innerHTML" => "2",
263 "innerText" => "2",
264 "innerWidth" => "2",
265 "insertAdjacentHTML" => "2",
266 "insertAdjacentText" => "2",
267 "isFinite" => "2",
268 "isNAN" => "2",
269 "italics" => "2",
270 "java" => "2",
271 "javaEnabled" => "2",
272 "join" => "2",
273 "keyCode" => "2",
274 "lang" => "2",
275 "language" => "2",
276 "lastIndex" => "2",
277 "lastIndexOf" => "2",
278 "lastMatch" => "2",
279 "lastModified" => "2",
280 "lastParen" => "2",
281 "layers" => "2",
282 "layerX" => "2",
283 "layerY" => "2",
284 "left" => "2",
285 "leftContext" => "2",
286 "length" => "2",
287 "link" => "2",
288 "linkColor" => "2",
289 "Links" => "2",
290 "LN10" => "2",
291 "LN2" => "2",
292 "load" => "2",
293 "location" => "2",
294 "locationBar" => "2",
295 "log" => "2",
296 "LOG10E" => "2",
297 "LOG2E" => "2",
298 "lowsrc" => "2",
299 "margins" => "2",
300 "match" => "2",
301 "max" => "2",
302 "MAX_VALUE" => "2",
303 "menubar" => "2",
304 "method" => "2",
305 "mimeTypes" => "2",
306 "min" => "2",
307 "MIN_VALUE" => "2",
308 "modifiers" => "2",
309 "moveAbove" => "2",
310 "moveBelow" => "2",
311 "moveBy" => "2",
312 "moveTo" => "2",
313 "moveToAbsolute" => "2",
314 "multiline" => "2",
315 "name" => "2",
316 "NaN" => "2",
317 "navigate" => "2",
318 "navigator" => "2",
319 "NEGATIVE_INFINITY" => "2",
320 "netscape" => "2",
321 "next" => "2",
322 "offscreenBuffering" => "2",
323 "offset" => "2",
324 "offsetHeight" => "2",
325 "offsetLeft" => "2",
326 "offsetParent" => "2",
327 "offsetTop" => "2",
328 "offsetWidth" => "2",
329 "offsetX" => "2",
330 "offsetY" => "2",
331 "onabort" => "2",
332 "onblur" => "2",
333 "onchange" => "2",
334 "onclick" => "2",
335 "ondblclick" => "2",
336 "ondragdrop" => "2",
337 "onerror" => "2",
338 "onfocus" => "2",
339 "onHelp" => "2",
340 "onkeydown" => "2",
341 "onkeypress" => "2",
342 "onkeyup" => "2",
343 "onload" => "2",
344 "onmousedown" => "2",
345 "onmousemove" => "2",
346 "onmouseout" => "2",
347 "onmouseover" => "2",
348 "onmouseup" => "2",
349 "onmove" => "2",
350 "onreset" => "2",
351 "onresize" => "2",
352 "onsubmit" => "2",
353 "onunload" => "2",
354 "open" => "2",
355 "opener" => "2",
356 "options" => "2",
357 "outerHeight" => "2",
358 "outerHTML" => "2",
359 "outerText" => "2",
360 "outerWidth" => "2",
361 "paddings" => "2",
362 "pageX" => "2",
363 "pageXOffset" => "2",
364 "pageY" => "2",
365 "pageYOffset" => "2",
366 "parent" => "2",
367 "parentElement" => "2",
368 "parentLayer" => "2",
369 "parentWindow" => "2",
370 "parse" => "2",
371 "parseFloat" => "2",
372 "parseInt" => "2",
373 "pathname" => "2",
374 "personalbar" => "2",
375 "PI" => "2",
376 "pixelDepth" => "2",
377 "platform" => "2",
378 "plugins" => "2",
379 "pop" => "2",
380 "port" => "2",
381 "POSITIVE_INFINITY" => "2",
382 "pow" => "2",
383 "preference" => "2",
384 "previous" => "2",
385 "print" => "2",
386 "prompt" => "2",
387 "protocol" => "2",
388 "prototype" => "2",
389 "push" => "2",
390 "random" => "2",
391 "readyState" => "2",
392 "reason" => "2",
393 "referrer" => "2",
394 "refresh" => "2",
395 "releaseEvents" => "2",
396 "reload" => "2",
397 "removeAttribute" => "2",
398 "removeMember" => "2",
399 "replace" => "2",
400 "resizeBy" => "2",
401 "resizeTo" => "2",
402 "returnValue" => "2",
403 "reverse" => "2",
404 "right" => "2",
405 "rightcontext" => "2",
406 "screenX" => "2",
407 "screenY" => "2",
408 "scroll" => "2",
409 "scrollbars" => "2",
410 "scrollBy" => "2",
411 "scrollIntoView" => "2",
412 "scrollTo" => "2",
413 "search" => "2",
414 "select" => "2",
415 "selected" => "2",
416 "selectedIndex" => "2",
417 "self" => "2",
418 "setAttribute" => "2",
419 "setDay" => "2",
420 "setFullYear" => "2",
421 "setHotkeys" => "2",
422 "setHours" => "2",
423 "setInterval" => "2",
424 "setMember" => "2",
425 "setMilliseconds" => "2",
426 "setMinutes" => "2",
427 "setMonth" => "2",
428 "setResizable" => "2",
429 "setSeconds" => "2",
430 "setSlot" => "2",
431 "setTime" => "2",
432 "setTimeout" => "2",
433 "setUTCDate" => "2",
434 "setUTCFullYear" => "2",
435 "setUTCHours" => "2",
436 "setUTCMillseconds" => "2",
437 "setUTCMinutes" => "2",
438 "setUTCMonth" => "2",
439 "setUTCSeconds" => "2",
440 "setYear" => "2",
441 "setZOptions" => "2",
442 "shift" => "2",
443 "shiftKey" => "2",
444 "siblingAbove" => "2",
445 "siblingBelow" => "2",
446 "signText" => "2",
447 "sin" => "2",
448 "slice" => "2",
449 "smallsort" => "2",
450 "source" => "2",
451 "sourceIndex" => "2",
452 "splice" => "2",
453 "split" => "2",
454 "sqrt" => "2",
455 "SQRT1_2" => "2",
456 "SQRT2" => "2",
457 "src" => "2",
458 "srcElement" => "2",
459 "srcFilter" => "2",
460 "status" => "2",
461 "statusbar" => "2",
462 "stop" => "2",
463 "strike" => "2",
464 "style" => "2",
465 "sub" => "2",
466 "submit" => "2",
467 "substr" => "2",
468 "substring" => "2",
469 "suffixes" => "2",
470 "sun" => "2",
471 "sup" => "2",
472 "systemLanguage" => "2",
473 "tagName" => "2",
474 "tags" => "2",
475 "taint" => "2",
476 "taintEnabled" => "2",
477 "tan" => "2",
478 "target" => "2",
479 "test" => "2",
480 "text" => "2",
481 "title" => "2",
482 "toElement" => "2",
483 "toGMTString" => "2",
484 "toLocaleString" => "2",
485 "toLowerCase" => "2",
486 "toolbar" => "2",
487 "top" => "2",
488 "toString" => "2",
489 "toUpperCase" => "2",
490 "toUTCString" => "2",
491 "TYPE" => "2",
492 "type" => "2",
493 "typeOf" => "2",
494 "unescape" => "2",
495 "unshift" => "2",
496 "untaint" => "2",
497 "unwatch" => "2",
498 "userAgent" => "2",
499 "userLanguage" => "2",
500 "UTC" => "2",
501 "value" => "2",
502 "valueOf" => "2",
503 "visibility" => "2",
504 "vlinkColor" => "2",
505 "vspace" => "2",
506 "watch" => "2",
507 "which" => "2",
508 "width" => "2",
509 "window" => "2",
510 "write" => "2",
511 "writeln" => "2",
512 "x" => "2",
513 "y" => "2",
514 "zIndex" => "2",
515 "Anchor" => "3",
516 "Applet" => "3",
517 "Area" => "3",
518 "Arguments" => "3",
519 "Array" => "3",
520 "Boolean" => "3",
521 "Button" => "3",
522 "Checkbox" => "3",
523 "Crypto" => "3",
524 "Date" => "3",
525 "Document" => "3",
526 "Element" => "3",
527 "Event" => "3",
528 "FileUpload" => "3",
529 "Form" => "3",
530 "Frame" => "3",
531 "Function" => "3",
532 "Hidden" => "3",
533 "History" => "3",
534 "HTMLElement" => "3",
535 "Image" => "3",
536 "Infinity" => "3",
537 "Input" => "3",
538 "JavaArray" => "3",
539 "JavaClass" => "3",
540 "JavaObject" => "3",
541 "JavaPackage" => "3",
542 "JSObject" => "3",
543 "Layer" => "3",
544 "Link" => "3",
545 "Math" => "3",
546 "MimeType" => "3",
547 "Navigator" => "3",
548 "Number" => "3",
549 "Object" => "3",
550 "Option" => "3",
551 "Packages" => "3",
552 "Password" => "3",
553 "Plugin" => "3",
554 "PrivilegeManager" => "3",
555 "Random" => "3",
556 "RegExp" => "3",
557 "Screen" => "3",
558 "Select" => "3",
559 "String" => "3",
560 "Submit" => "3",
561 "Text" => "3",
562 "Textarea" => "3",
563 "URL" => "3",
564 "Window" => "3");
565
566 // Special extensions
567
568 // Each category can specify a PHP function that returns an altered
569 // version of the keyword.
570
571
572
573 $this->linkscripts = array(
574 "1" => "donothing",
575 "2" => "donothing",
576 "3" => "donothing");
577 }
578
579
580 public function donothing($keywordin)
581 {
582 return $keywordin;
583 }
584 }
$BEAUT_PATH
An exception for terminatinating execution or to throw for unit testing.