-
Notifications
You must be signed in to change notification settings - Fork 1
/
ridgerunner.diff
14176 lines (14127 loc) · 509 KB
/
ridgerunner.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/admin_parser.php b/admin_parser.php
new file mode 100644
index 0000000..24d56b5
--- /dev/null
+++ b/admin_parser.php
@@ -0,0 +1,474 @@
+<?php
+
+/**
+ * Copyright (C) 2008-2010 FluxBB
+ * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
+ * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
+ */
+
+// Tell header.php to use the admin template
+define('PUN_ADMIN_CONSOLE', 1);
+
+define('PUN_ROOT', dirname(__FILE__).'/');
+require PUN_ROOT.'include/common.php';
+require PUN_ROOT.'include/common_admin.php';
+
+
+if ($pun_user['g_id'] != PUN_ADMIN)
+ message($lang_common['No permission']);
+
+// Load the admin_parser.php language file
+require PUN_ROOT.'lang/'.$admin_language.'/admin_parser.php';
+
+// This is where the parser data lives and breathes.
+$cache_file = PUN_ROOT.'cache/cache_parser_data.php';
+
+// If RESET button pushed, or no cache file, re-compile master bbcode source file.
+if (isset($_POST['reset']) || !file_exists($cache_file)) {
+ require_once(PUN_ROOT.'include/bbcd_source.php');
+ require_once(PUN_ROOT.'include/bbcd_compile.php');
+ redirect('admin_parser.php', $lang_admin_parser['reset_success']);
+}
+
+// Load the current BBCode $pd array from include/parser_data.inc.php.
+require_once($cache_file); // Fetch $pd compiled global regex data.
+$bbcd = $pd['bbcd']; // Local scratch copy of $bbcd.
+$smilies = $pd['smilies']; // Local scratch copy of $smilies.
+$config = $pd['config']; // Local scratch copy of $config.
+$syntaxes = $pd['syntaxes']; // Local scratch copy of $syntaxes.
+$count = count($bbcd);
+
+if (isset($_POST['form_sent']))
+{
+ confirm_referrer('admin_parser.php');
+
+ // Upload new smiley image to img/smilies
+ if (isset($_POST['upload']) && isset($_FILES['new_smiley']) && isset($_FILES['new_smiley']['error'])) {
+ $f =& $_FILES['new_smiley'];
+ switch($f['error']) {
+ case 0: // 0: Successful upload.
+ $name = str_replace(' ', '_', $f['name']); // Convert spaces to underscoree.
+ $name = preg_replace('/[^\w\-.]/S', '', $name); // Weed out all unsavory filename chars.
+ if (preg_match('/^[\w\-.]++$/', $name)) { // If we have a valid filename?
+ if (preg_match('%^image/%', $f['type'])) { // If we have an image file type?
+ if ($f['size'] > 0 && $f['size'] <= $pun_config['o_avatars_size']) {
+ if (move_uploaded_file($f['tmp_name'], PUN_ROOT .'img/smilies/'. $name)) {
+ redirect('admin_parser.php', $lang_admin_parser['upload success']);
+ } else
+ { // Error #1: 'Smiley upload failed. Unable to move to smiley folder.'.
+ message($lang_admin_parser['upload_err_1']);
+ }
+ } else
+ { // Error #2: 'Smiley upload failed. File is too big.'
+ message($lang_admin_parser['upload_err_2']);
+ }
+ } else
+ { // Error #3: 'Smiley upload failed. File type is not an image.'.
+ message($lang_admin_parser['upload_err_3']);
+ }
+ } else
+ { // Error #4: 'Smiley upload failed. Bad filename.'
+ message($lang_admin_parser['upload_err_4']);
+ }
+ break;
+ case 1: // case 1 similar to case 2 so fall through...
+ case 2: message($lang_admin_parser['upload_err_2']); // File exceeds MAX_FILE_SIZE.
+ case 3: message($lang_admin_parser['upload_err_5']); // File only partially uploaded.
+// case 4: break; // No error. Normal response when this form element left empty
+ case 4: message($lang_admin_parser['upload_err_6']); // No filename.
+ case 6: message($lang_admin_parser['upload_err_7']); // No temp folder.
+ case 7: message($lang_admin_parser['upload_err_8']); // Cannot write to disk.
+ default: message($lang_admin_parser['upload_err_9']); // Generic/unknown error
+ }
+ }
+
+ // Set new $config values:
+ if (isset($_POST['config'])) {
+ $pcfg =& $_POST['config'];
+
+ if (isset($pcfg['textile'])) {
+ if ($pcfg['textile'] == '1') $config['textile'] = TRUE;
+ else $config['textile'] = FALSE;
+ }
+ if (isset($pcfg['quote_links'])) {
+ if ($pcfg['quote_links'] == '1') $config['quote_links'] = TRUE;
+ else $config['quote_links'] = FALSE;
+ }
+ if (isset($pcfg['quote_imgs'])) {
+ if ($pcfg['quote_imgs'] == '1') $config['quote_imgs'] = TRUE;
+ else $config['quote_imgs'] = FALSE;
+ }
+ if (isset($pcfg['valid_imgs'])) {
+ if ($pcfg['valid_imgs'] == '1') $config['valid_imgs'] = TRUE;
+ else $config['valid_imgs'] = FALSE;
+ }
+ if (isset($pcfg['click_imgs'])) {
+ if ($pcfg['click_imgs'] == '1') $config['click_imgs'] = TRUE;
+ else $config['click_imgs'] = FALSE;
+ }
+ if (isset($pcfg['syntax_style']) &&
+ file_exists(PUN_ROOT .'bin/'. $pcfg['syntax_style'])) {
+ $config['syntax_style'] = $pcfg['syntax_style'];
+ }
+ if (isset($pcfg['max_size']) && preg_match('/^\d++$/', $pcfg['max_size'])) {
+ $config['max_size'] = (int)$pcfg['max_size'];
+ }
+ if (isset($pcfg['max_width']) && preg_match('/^\d++$/', $pcfg['max_width'])) {
+ $config['max_width'] = (int)$pcfg['max_width']; // Limit default to maximum.
+ if ($config['def_width'] > $config['max_width']) $config['def_width'] = $config['max_width'];
+ }
+ if (isset($pcfg['max_height']) && preg_match('/^\d++$/', $pcfg['max_height'])) {
+ $config['max_height'] = (int)$pcfg['max_height']; // Limit default to maximum.
+ if ($config['def_height'] > $config['max_height']) $config['def_height'] = $config['max_height'];
+ }
+ if (isset($pcfg['def_width']) && preg_match('/^\d++$/', $pcfg['def_width'])) {
+ $config['def_width'] = (int)$pcfg['def_width']; // Limit default to maximum.
+ if ($config['def_width'] > $config['max_width']) $config['def_width'] = $config['max_width'];
+ }
+ if (isset($pcfg['def_height']) && preg_match('/^\d++$/', $pcfg['def_height'])) {
+ $config['def_height'] = (int)$pcfg['def_height']; // Limit default to maximum.
+ if ($config['def_height'] > $config['max_height']) $config['def_height'] = $config['max_height'];
+ }
+ if (isset($pcfg['smiley_size']) && preg_match('/^\s*+(\d++)\s*+%?+\s*+$/', $pcfg['smiley_size'], $m)) {
+ $config['smiley_size'] = (int)$m[1]; // Limit default to maximum.
+ }
+ }
+ // Set new $bbcd values:
+ foreach($bbcd as $tagname => $tagdata) {
+ if ($tagname == '_ROOT_') continue; // Skip last pseudo-tag
+ $tag =& $bbcd[$tagname];
+ if(isset($_POST[$tagname.'_in_post'])) {
+ if ($_POST[$tagname.'_in_post'] == '1') $tag['in_post'] = TRUE;
+ else $tag['in_post'] = FALSE;
+ }
+ if(isset($_POST[$tagname.'_in_sig'])) {
+ if ($_POST[$tagname.'_in_sig'] == '1') $tag['in_sig'] = TRUE;
+ else $tag['in_sig'] = FALSE;
+ }
+ if(isset($_POST[$tagname.'_depth_max']) && preg_match('/^\d++$/', $_POST[$tagname.'_depth_max'])) {
+ $tag['depth_max'] = (int)$_POST[$tagname.'_depth_max'];
+ }
+ }
+ // Set new $smilies values:
+ if (isset($_POST['smiley_text']) && is_array($_POST['smiley_text']) &&
+ isset($_POST['smiley_file']) && is_array($_POST['smiley_file']) &&
+ count($_POST['smiley_text']) === count($_POST['smiley_file'])) {
+ $stext =& $_POST['smiley_text'];
+ $sfile =& $_POST['smiley_file'];
+ $len = count($stext);
+ $good = '';
+ $smilies = array();
+ for ($i = 0; $i < $len; ++$i) { // Loop through all posted smileys.
+ if ($stext[$i] && $sfile !== 'select new file') {
+ $smilies[$stext[$i]] = array('file' => $sfile[$i]);
+// message(sprintf("New smiley: \"%s\" = %s\n", $stext[$i], $sfile[$i]));
+ }
+ }
+ }
+
+ require_once("include/bbcd_compile.php"); // Compile $bbcd and save into $pd['bbcd']
+ redirect('admin_parser.php', $lang_admin_parser['save_success']);
+}
+
+$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Parser']);
+define('PUN_ACTIVE_PAGE', 'admin');
+require PUN_ROOT.'header.php';
+
+generate_admin_menu('parser');
+
+?>
+ <div class="blockform">
+ <h2><span><?php echo $lang_admin_parser['Parser head'] ?></span></h2>
+ <div class="box">
+ <form method="post" action="admin_parser.php" enctype="multipart/form-data">
+ <p class="submittop">
+ <input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" />
+ <input type="submit" name="reset" value="<?php echo $lang_admin_parser['reset defaults'] ?>" />
+ </p>
+ <div class="inform">
+ <input type="hidden" name="form_sent" value="1" />
+ <fieldset>
+ <legend><?php echo $lang_admin_parser['Config subhead'] ?></legend>
+ <div class="infldset">
+ <table class="aligntop" cellspacing="0">
+
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['syntax style'] ?></th>
+ <td colspan="2">
+ <select name="config[syntax_style]">
+<?php
+ $shcss_files = get_shcss();
+ $oldfile = $config['syntax_style'];
+?>
+<?php
+ foreach($shcss_files as $file) {
+ if ($file === $oldfile) {
+ echo("\t\t\t\t\t\t\t\t\t\t\t<option selected=\"selected\">" . $file . "</option>\n");
+ } else {
+ echo("\t\t\t\t\t\t\t\t\t\t\t<option>" . $file . "</option>\n");
+ }
+ }
+?>
+ </select>
+ </td>
+ <td><span><?php echo $lang_admin_parser['syntax style help'] ?></span></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['textile'] ?></th>
+ <td colspan="2">
+ <input type="radio" name="config[textile]" value="1"<?php if ($config['textile']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['Yes'] ?></strong> <input type="radio" name="config[textile]" value="0"<?php if (!$config['textile']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['No'] ?></strong>
+ </td>
+ <td>
+ <span><?php echo $lang_admin_parser['textile help'] ?></span>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['quote_links'] ?></th>
+ <td colspan="2">
+ <input type="radio" name="config[quote_links]" value="1"<?php if ($config['quote_links']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['Yes'] ?></strong> <input type="radio" name="config[quote_links]" value="0"<?php if (!$config['quote_links']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['No'] ?></strong>
+ </td>
+ <td>
+ <span><?php echo $lang_admin_parser['quote_links help'] ?></span>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['quote_imgs'] ?></th>
+ <td colspan="2">
+ <input type="radio" name="config[quote_imgs]" value="1"<?php if ($config['quote_imgs']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['Yes'] ?></strong> <input type="radio" name="config[quote_imgs]" value="0"<?php if (!$config['quote_imgs']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['No'] ?></strong>
+ </td>
+ <td>
+ <span><?php echo $lang_admin_parser['quote_imgs help'] ?></span>
+ </td>
+ </tr>
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['click_imgs'] ?></th>
+ <td colspan="2">
+ <input type="radio" name="config[click_imgs]" value="1"<?php if ($config['click_imgs']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['Yes'] ?></strong> <input type="radio" name="config[click_imgs]" value="0"<?php if (!$config['click_imgs']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['No'] ?></strong>
+ </td>
+ <td>
+ <span><?php echo $lang_admin_parser['click_imgs help'] ?></span>
+ </td>
+ </tr>
+
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['valid_imgs'] ?></th>
+ <td colspan="2">
+ <input type="radio" name="config[valid_imgs]" value="1"<?php if ($config['valid_imgs']) echo ' checked="checked"'; if (!ini_get('allow_url_fopen')) echo(' disabled="disabled" title="'. htmlspecialchars($lang_admin_parser['unavailable']) .'"'); ?> /> <strong><?php echo $lang_admin_common['Yes'] ?></strong>
+ <input type="radio" name="config[valid_imgs]" value="0"<?php if (!$config['valid_imgs']) echo ' checked="checked"'; if (!ini_get('allow_url_fopen')) echo(' disabled="disabled" title="'. htmlspecialchars($lang_admin_parser['unavailable']) .'"'); ?> /> <strong><?php echo $lang_admin_common['No'] ?></strong>
+ </td>
+ <td><?php echo $lang_admin_parser['valid_imgs help'] ?></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['max_size'] ?></th>
+ <td colspan="2">
+ <input type="text" name="config[max_size]" size="10" maxlength="8" value="<?php echo($config['max_size'])?>"<?php if (!ini_get('allow_url_fopen')) echo(' disabled="disabled" title="'. htmlspecialchars($lang_admin_parser['unavailable']) .'"'); ?> />
+ </td>
+ <td><span><?php echo $lang_admin_parser['max_size help'] ?></span></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['def_xy'] ?></th>
+ <td>
+ <input type="text" name="config[def_width]" size="5" maxlength="5" value="<?php echo $config['def_width'] ?>" /> X:Width
+ </td>
+ <td>
+ <input type="text" name="config[def_height]" size="5" maxlength="5" value="<?php echo $config['def_height'] ?>" /> Y:Height
+ </td>
+ <td>
+ <span><?php echo $lang_admin_parser['def_xy help'] ?></span>
+ </td>
+ </tr>
+
+
+
+
+
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['max_xy'] ?></th>
+ <td>
+ <input type="text" name="config[max_width]" size="5" maxlength="5" value="<?php echo $config['max_width'] ?>" /> X:Width
+ </td>
+ <td>
+ <input type="text" name="config[max_height]" size="5" maxlength="5" value="<?php echo $config['max_height'] ?>" /> Y:Height
+ </td>
+ <td><?php echo $lang_admin_parser['max_xy help'] ?></td>
+ </tr>
+
+ <tr>
+ <th scope="row"><?php echo $lang_admin_parser['smiley_size'] ?></th>
+ <td colspan=2>
+ <input type="text" name="config[smiley_size]" size="5" maxlength="5" value="<?php echo $config['smiley_size'] .'%' ?>" />
+ </td>
+ <td>
+ <span><?php echo $lang_admin_parser['smiley_size help'] ?></span>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ </fieldset>
+ </div>
+ <div class="inform">
+ <fieldset>
+ <legend><?php echo $lang_admin_parser['Smilies subhead'] ?></legend>
+ <div class="infldset">
+ <table cellspacing="0">
+ <thead>
+ <tr>
+ <th scope="col"><?php echo $lang_admin_parser['smiley_text_label'] ?></th>
+ <th scope="col"><?php echo $lang_admin_parser['smiley_file_label'] ?></th>
+ <th scope="col">:)</th>
+ </tr>
+ </thead>
+ <tbody>
+<?php
+ $smiley_files = get_smiley_files();
+ $i = -1;
+ foreach($smilies as $key => $value) {
+ $i++;
+ $oldfile = $value['file'];
+?>
+ <tr>
+ <td><input type="text" name="smiley_text[<?php echo($i); ?>]" value="<?php echo(pun_htmlspecialchars($key)); ?>" size="20" maxlength="80" /></td>
+ <td>
+ <select name="smiley_file[<?php echo($i); ?>]">
+<?php
+ foreach($smiley_files as $file) {
+ if ($file === $oldfile) {
+ echo("\t\t\t\t\t\t\t\t\t\t\t<option selected=\"selected\">" . $file . "</option>\n");
+ } else {
+ echo("\t\t\t\t\t\t\t\t\t\t\t<option>" . $file . "</option>\n");
+ }
+ }
+?>
+ </select>
+ </td>
+ <td>
+ <?php echo($value['html']); ?>
+ </td>
+ </tr>
+<?php
+ }
+?>
+ <tr>
+ <td><input type="text" name="smiley_text[<?php echo(++$i); ?>]" value="" size="20" maxlength="80" /><br />New smiley text</td>
+ <td>
+ <select name="smiley_file[<?php echo($i); ?>]">
+ <option selected="selected">select new file</option>
+<?php
+ foreach($smiley_files as $file) {
+ echo("\t\t\t\t\t\t\t\t\t\t\t<option>" . $file . "</option>\n");
+ }
+?>
+ </select><br />New smiley image
+ </td>
+ <td></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php echo($lang_admin_parser['smiley_upload']); ?></th>
+ <?php if (ini_get('file_uploads')) { ?>
+ <td><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $pun_config['o_avatars_size'] ?>" />
+ <input type="file" name="new_smiley" id="upload_smiley" /></td>
+ <td><input type="submit" name="upload" value="<?php echo($lang_admin_parser['upload_button']); ?>" /></td>
+<?php } else { ?>
+ <td colspan="2"><?php echo($lang_admin_parser['upload_off']); ?></td>
+<?php } ?>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </fieldset>
+ </div>
+
+
+
+
+
+
+ <div class="inform">
+ <fieldset>
+ <legend><?php echo $lang_admin_parser['BBCodes subhead'] ?></legend>
+ <div class="infldset">
+ <table cellspacing="0">
+ <thead>
+ <tr>
+ <th class="tcl" scope="col"><?php echo $lang_admin_parser['tagname_label'] ?></th>
+ <th class="tc3" scope="col"><?php echo $lang_admin_parser['in_post_label'] ?></th>
+ <th class="hidehead" scope="col"><?php echo $lang_admin_parser['in_sig_label'] ?></th>
+ <th class="tc2" scope="col"><?php echo $lang_admin_parser['depth_max'] ?></th>
+ </tr>
+ </thead>
+ <tbody>
+<?php
+foreach($bbcd as $tagname => $tagdata) {
+ if ($tagname == '_ROOT_') continue; // Skip last pseudo-tag
+ $title = isset($lang_admin_parser['tag_summary'][$tagname]) ?
+ $lang_admin_parser['tag_summary'][$tagname] : '';
+
+/*
+ <th class="tc2" scope="col"><?php echo $lang_admin_parser['tagtype_label'] ?></th>
+
+ <td>
+ <select name="<?php echo($tagname); ?>_type">
+ <option<?php if ($tagdata['tag_type'] == 'ghost') echo( ' selected="selected"'); ?>>Ghost</option>
+ <option<?php if ($tagdata['tag_type'] == 'normal') echo( ' selected="selected"'); ?>>Normal</option>
+ <option<?php if ($tagdata['tag_type'] == 'atomic') echo( ' selected="selected"'); ?>>Atomic</option>
+ <option<?php if ($tagdata['tag_type'] == 'hidden') echo( ' selected="selected"'); ?>>Hidden</option>
+ </select>
+ </td>
+*/
+ ?>
+ <tr>
+ <th scope="row" title="<?php echo($title); ?>"><?php echo('['. $tagname .']') ?></th>
+ <td>
+ <input type="radio" name="<?php echo($tagname) ?>_in_post" value="1"<?php if ($bbcd[$tagname]['in_post']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['Yes'] ?></strong> <input type="radio" name="<?php echo($tagname) ?>_in_post" value="0"<?php if (!$bbcd[$tagname]['in_post']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['No'] ?></strong>
+ </td>
+ <td>
+ <input type="radio" name="<?php echo($tagname) ?>_in_sig" value="1"<?php if ($bbcd[$tagname]['in_sig']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['Yes'] ?></strong> <input type="radio" name="<?php echo($tagname) ?>_in_sig" value="0"<?php if (!$bbcd[$tagname]['in_sig']) echo ' checked="checked"' ?> /> <strong><?php echo $lang_admin_common['No'] ?></strong>
+ </td>
+ <td>
+ <input type="text" size="10" name="<?php echo($tagname) ?>_depth_max" value="<?php echo($bbcd[$tagname]['depth_max']); ?>" <?php if ($tagdata['html_type'] === 'inline' || $tagdata['tag_type'] === 'hidden') echo(' disabled="disabled" style="display: none;"'); ?> />
+ </td>
+ </tr>
+<?php } ?>
+ </tbody>
+ </table>
+ </div>
+ </fieldset>
+ </div>
+
+
+ <p class="submitend">
+ <input type="submit" name="save" value="<?php echo $lang_admin_common['Save changes'] ?>" />
+ <input type="submit" name="reset" value="<?php echo $lang_admin_parser['reset defaults'] ?>" />
+ </p>
+ </form>
+ </div>
+ </div>
+ <div class="clearer"></div>
+</div>
+<?php
+
+// Helper function returns array of smiley image files
+// stored in the img/smilies directory.
+function get_smiley_files() {
+ $imgfiles = array();
+ $filelist = scandir(PUN_ROOT.'img/smilies');
+ foreach($filelist as $file) {
+ if (preg_match('/\.(?:png|gif|jpe?g)$/', $file))
+ $imgfiles[] = $file;
+ }
+ return $imgfiles;
+}
+
+// Helper function returns array of syntax highlighter CSS files
+// stored in the img/smilies directory.
+function get_shcss() {
+ $cssfiles = array();
+ $filelist = scandir(PUN_ROOT.'bin');
+ foreach($filelist as $file) {
+ if (preg_match('/^sh(.*)\.css$/i', $file)) $cssfiles[] = $file;
+ }
+ return $cssfiles;
+}
+
+require PUN_ROOT.'footer.php';
diff --git a/bbcd_bootstrap.php b/bbcd_bootstrap.php
new file mode 100644
index 0000000..e9a2103
--- /dev/null
+++ b/bbcd_bootstrap.php
@@ -0,0 +1,11 @@
+<?php // parser_compile bootstrap
+define('PUN_ROOT', dirname(__FILE__).'/');
+function get_base_url($str) {
+ return 'http://localhost/forums/fluxbb_dev';
+// return 'http://localhost';
+}
+$lang_common = array('wrote' => 'wrote:');
+require_once(PUN_ROOT.'include/bbcd_source.php'); // fetch loose $bbcd array.
+// Compile $bbcd and save in include/parser_data.inc.php
+require_once(PUN_ROOT.'include/bbcd_compile.php');
+?>
diff --git a/bin/DynamicRegexHighlighter.js b/bin/DynamicRegexHighlighter.js
new file mode 100644
index 0000000..6d73194
--- /dev/null
+++ b/bin/DynamicRegexHighlighter.js
@@ -0,0 +1,360 @@
+/* <![CDATA[ */
+/* File: DynamicRegexHighlighter.js
+ * Version: 20100921_2200
+ * Copyright: (c) 2010 Jeff Roberson - http://jmrware.com
+ * MIT License: http://www.opensource.org/licenses/mit-license.php
+ *
+ * Summary: This script provides web page dynamic highlighting of regular
+ * expressions enclosed within HTML elements marked up with class="regex"
+ * or class="regex_x". ("regex_x is for "x" free spacing mode regexes).
+ *
+ * Usage: See example page: DynamicRegexHighlighter.html
+ *
+ * Global variables:
+ * reAutoLoad = true; // If true, will prepare all elements on document load.
+ *
+ * Global functions:
+ * reHighlightElement() // Process an element containing a regex.
+ * rePutElemContents() // Write text to element's innerHTML.
+ * reGetElemsByKlassNames() // Get child elements having specified classes.
+ * reHideHtmlSpecialChars() // Convert "&<>" to &, < and >.
+ * reAddLoadEventFirst() // Add function to head of window.onload chain.
+ * reAddLoadEvent() // Add function to end of window.onload chain.
+ * reAddUnloadEvent() // Add function to end of window.onunload chain.
+ */
+(function() { // Don't bother with first indentation level of source code.
+// Pseudo-static private closure variables:
+var re_elems; // Node list of DOM elements having class "regex" or "regex_x".
+// Compile and cache non-trivial/frequently used regular expressions:
+var re_class = {}; // Regex cache for reGetElemsByKlassNames().
+// re_1_cmt: Match character classes, comment groups, HTML tags, and comments.
+var re_1_cmt = /([^[(#<\\]+(?:\\[^<][^[(#<\\]*)*|(?:\\[^<][^[(#<\\]*)+)|(\[\^?)(\]?[^[\]\\]*(?:\\[\S\s][^[\]\\]*)*(?:\[(?::\^?\w+:\])?[^[\]\\]*(?:\\[\S\s][^[\]\\]*)*)*)\]((?:<\/?\w+\b[^>]*>)*)((?:(?:[?*+]|\{\d+(?:,\d*)?\})[+?]?)?)|(\((?!\?#))|(\(\?#[^)]*\))|((?:<\/?\w+\b[^>]*>)+)|(#.*)/g;
+// re_1_nocmt: Match character classes and comment groups (no comments).
+var re_1_nocmt = /([^[(\\]+(?:\\[\S\s][^[(\\]*)*|(?:\\[\S\s][^[(\\]*)+)|(\[\^?)(\]?[^[\]\\]*(?:\\[\S\s][^[\]\\]*)*(?:\[(?::\^?\w+:\])?[^[\]\\]*(?:\\[\S\s][^[\]\\]*)*)*)\]((?:<\/?\w+\b[^>]*>)*)((?:(?:[?*+]|\{\d+(?:,\d*)?\})[+?]?)?)|(\((?!\?#))|(\(\?#[^)]*\))/g;
+// re_2: Match inner (non-nested) PCRE syntax regex groups.
+var re_2 = /\((\?(?:[:|>=!]|>|<[=!]|<[=!]|P?<\w+>|P?<\w+>|'\w+'|(?=<span[^>]*>()|\((?:[+\-]?\d+|<\w+>|<\w+>|'\w+'|R&\w+|R&\w+|\w+)\)|(?:R|(?:-?[iJmsUx])+|[+\-]?\d+|&\w+|&\w+|P>\w+|P>\w+|P=\w+)(?=\))))?([^()]*)\)((?:<\/?\w+\b[^>]*>)*)((?:(?:[?*+]|\{\d+(?:,\d*)?\})[+?]?)?)/g;
+// re_escapedgroupdelims: Convert escaped group delimiter chars to HTML entities.
+var re_escapedgroupdelims = /([^\\]+(?:\\[^()|][^\\]*)*|(?:\\[^()|][^\\]*)+)|\\([()|])/g;
+// re_open_html_tag: Match HTML opening tag with at least one attribute.
+var re_open_html_tag = /<(\w+\b(?:\s+[\w\-.:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[\w\-.:]+))?)+\s*\/?)>/g;
+// re_over and re_out: Used by reOnmouseover and reOnmouseout event handlers.
+var re_over = /\bregex_hl\b/;
+var re_out = /\s*\bregex_hl\b/;
+
+// Global variables:
+window.reAutoLoad = true; // If true, will prepare all elements on document load.
+
+// Global exported functions:
+window.reHighlightElement = function(elem) {
+ var cc_cnt = 0; // [character classes].
+ var cmt_cnt = 0; // # comments.
+ var cmtgrp_cnt = 0; // (?# comment groups).
+ var grp_cnt = 0; // (?: PCRE groups).
+ var brgrp_cnt = 0; // (?|(branch)|(reset)) groups.
+ var capgrp_cnt = 0; // (capture groups).
+ var text; // Element contents string.
+ var spans; // Node list of span elements.
+ var span_cnt; // Count of spans in regex element.
+ var span; // Current DOM span node.
+ var title; // Current node's title attribute.
+ var sibs; // Array of sibling span nodes.
+ var sib_cnt; // Count of sibling span nodes.
+ var str; // Temp string.
+ var el; // Temp node element.
+ var i, j; // Loop indexes.
+ var re_drh_title = /^(?:[cnmbgp]\d+$|[oe]$)/; // Match marked inserted span title.
+// Phase 1: - Markup character classes, comments and comment groups
+// and hide any enclosed regex delimiters as HTML entities.
+ var callback1 = function(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9) {
+ if (m1) { // Group 1: Everything else. (includes HTML tags for nocmt case).
+ // Hide any/all escaped "()|" delimiters - convert to HTML entities.
+ return m1.replace(re_escapedgroupdelims,
+ function(m0, m1, m2) {
+ if (m1) return m1;
+ return {'(': '\\(', ')': '\\)', '|': '\\|'}[m2];
+ } );
+ }
+ if (m2) { // Groups 2,3,4,5: [character class] (delim, contents, HTML, quantifier).
+ ++cc_cnt;
+ // Let m1 = common return prefix string.
+ m1 = '<span title="c' + cc_cnt + '">' + m2 + '<\/span>' + reHideDelims(m3) + '<span title="c' + cc_cnt + '">]';
+ if (m4 && m5) { // If there is an HTML tag between "]" and quantifier, wrap each separately.
+ return m1 + '<\/span>' + m4 + '<span title="c' + cc_cnt + '">' + m5 + '<\/span>';
+ } else if (m4) { // There is an HTML tag but no quantifier. Append it to the end.
+ return m1 + '<\/span>' + m4;
+ } else { // No HTML tag. Wrap end "]" together with any quantifier.
+ return m1 + m5 + '<\/span>';
+ }
+ }
+ if (m6) return m6; // Group 6: Opening "(" (non comment group).
+ if (m7) { // Group 7: (?# comment group).
+ ++cmtgrp_cnt;
+ return '<span title="n' + cmtgrp_cnt + '">' + reHideDelims(m7) + '<\/span>';
+ }
+ if (m8) return m8; // Group 8: HTML <open> and <\/close> tags.
+ if (m9) { // Group 9: # comment.
+ ++cmt_cnt;
+ return '<span title="m' + cmt_cnt + '">' + reHideDelims(m9) + '<\/span>';
+ }
+ };
+// Phase 2: - Markup matching parentheses and pipe OR symbols from inside out
+// and hide their regex delimiters as HTML entities.
+ var callback2 = function(m0, m1, m2, m3, m4) {
+ var gtype; // "bnn", "gnn", or "pnn".
+ if (m1) { // Non-zero for special group types.
+ if (m1 == "?|") {
+ brgrp_cnt++;
+ gtype = "b" + brgrp_cnt;
+ } else {
+ grp_cnt++;
+ gtype = "g" + grp_cnt;
+ }
+ m1 = reHideDelims(m1);
+ } else { // Numbered capture group.
+ capgrp_cnt++;
+ gtype = "p" + capgrp_cnt;
+ m1 = "";
+ }
+ // Markup/hide all ORs (?:between | parentheses).
+ m2 = m2.replace(/\|/g, '<span title="' + gtype + '">|<\/span>');
+ // Let m1 = common return prefix string.
+ m1 = '<span title="' + gtype + '">(' + m1 + '<\/span>' + m2 + '<span title="' + gtype + '">)';
+ if (m3 && m4) { // HTML tag between ")" and quantifier. Wrap each separately.
+ return m1 + '<\/span>' + m3 + '<span title="' + gtype + '">' + m4 + '<\/span>';
+ } else if (m3) { // HTML tag but no quantifier. Append it to the end.
+ return m1 + '<\/span>' + m3;
+ } else { // No HTML tag. Wrap end ")" together with any quantifier.
+ return m1 + m4 + '<\/span>';
+ }
+ };
+// Process DOM element having class: "regex" or "regex_x".
+ text = elem.innerHTML;
+ if (text.length === 0) return elem;
+ // Hide any/all "<>()|[]" troublemakers from within HTML opening tags.
+ text = text.replace(re_open_html_tag,
+ function(m0, m1) {
+ return "<" + m1.replace(/[<>()|[\]]/g,
+ function(m0) {return {"<": "<", ">": ">", "(": "(",
+ ")": ")", "|": "|", "[": "[", "]": "]" }[m0];
+ } ) + ">";
+ } ); // I am beginning to really appreciate the power of Javascript!
+ if (/\bregex_x\b/.test(elem.className)) { // Phase 1.
+ text = text.replace(re_1_cmt, callback1);
+ } else {
+ text = text.replace(re_1_nocmt, callback1);
+ }
+ while (text.search(re_2) != -1) { // Phase 2.
+ text = text.replace(re_2, callback2);
+ }
+ // Markup global/outermost | OR alternatives.
+ text = text.replace(/\|/g, '<span title="o">|<\/span>');
+ // Any parentheses left at this point represent errors.
+ text = text.replace(/[()]/g, '<span class="regex_err" title="e">$&<\/span>');
+ // Reflow the document with the new markup.
+ elem = rePutElemContents(elem, text); // With PRE's, this is a bit tricky.
+// Phase 3: Add highlighting mouse event handlers.
+ capgrp_cnt = 0; // Reset capture group number.
+ brgrp_cnt = 0; // Reset branch reset group count.
+ spans = elem.getElementsByTagName('span');
+ span_cnt = spans.length;
+ for (i = 0; i < span_cnt; i++) {
+ span = spans[i];
+ if (!span.sibs && re_drh_title.test(span.title)) {
+ sibs = []; // Gather array of all sibling spans.
+ title = span.title;
+ for (j = 0; j < span_cnt; j++) {
+ el = spans[j];
+ if (!el.sibs && el.title == title) {
+ sibs.push(el);
+ }
+ }
+ sib_cnt = sibs.length;
+ for (j = 0; j < sib_cnt; j++) {
+ el = sibs[j]; // Loop through sibling spans.
+ el.sibs = sibs; // Store sibs array each node.
+ el.removeAttribute("title");
+ el.onmouseover = reOnMouseover;
+ el.onmouseout = reOnMouseout;
+ }
+ if (title.charAt(0) == "b") {
+ brgrp_cnt++;
+ } else if (title.charAt(0) == "p") {
+ capgrp_cnt++;
+ str = "Capture group";
+ // If there are no (?|(branch)(reset)) groups yet, then
+ // we know the capture group number. Otherwise we don't.
+ if (brgrp_cnt === 0) str += " $" + capgrp_cnt;
+ for (j = 0; j < sib_cnt; j++) {
+ sibs[j].title = str;
+ }
+ } else if (title == "e") {
+ for (j = 0; j < sib_cnt; j++) {
+ sibs[j].title = "Error: Unbalanced parentheses";
+ }
+ }
+ }
+ }
+ sibs = null;
+ return elem;
+};
+window.rePutElemContents = function(elem, text) {
+ if (navigator.userAgent.indexOf('MSIE') != -1) { // IE.
+ // IE does not respect PRE's whitespace when writing innerHTML.
+ // We use outerHTML instead, which replaces the old node with
+ // a new one (the old one goes to DOM limbo). We find the new
+ // one by using a non-empty node ID attribute.
+ if (elem.nodeName == 'PRE') {
+ var m = elem.outerHTML.match(/^(<PRE[^>]*)>/i);
+ var id = elem.id; // ID value to be restored.
+ var idfind = id; // Non-empty ID for getElementById().
+ if (id.length > 0) { // Case 1: Element has ID.
+ elem.outerHTML = m[1] + '>' + text + '<\/PRE>';
+ } else { // Case 2: No ID.
+ idfind = "xREx"; // Set non-empty ID so we can find it.
+ elem.outerHTML = m[1] + ' id="xREx">' + text + '<\/PRE>';
+ }
+ elem = document.getElementById(idfind);
+ elem.id = id; // Restore original ID.
+ } else {
+ elem.innerHTML = text; // IE non PRE.
+ }
+ } else { // Not IE.
+ // See: http://blog.stevenlevithan.com/archives/faster-than-innerhtml
+ var el_new = elem.cloneNode(false);
+ el_new.innerHTML = text;
+ elem.parentNode.replaceChild(el_new, elem);
+ elem = el_new;
+ el_new = null;
+ }
+ return elem;
+};
+window.reGetElemsByKlassNames = function(base_el /*, class1[, class2[, class3...]] */) {
+ var nk = arguments.length - 1; // Count of passed classes.
+ if (nk < 1) return null;
+ var elems = base_el.getElementsByTagName('*');
+ var str = "(?:^|\\s)(?:"; // Assemble regex to find any passed class.
+ for (var i = 1; i < nk; i++) str += arguments[i] + "(?:$|\\s)|";
+ str += arguments[i] + "(?:$|\\s))"; // Append OR to all but last.
+ if (!re_class[str]) re_class[str] = new RegExp(str,"i"); // Cache regexes.
+ var re = re_class[str];
+ var kl_els = [];
+ var n = elems.length;
+ for (i = 0; i < n; i++) {
+ var el = elems[i];
+ if (el.className && re.test(el.className)) {
+ kl_els.push(el);
+ }
+ }
+ return kl_els;
+};
+window.reHideHtmlSpecialChars = function(text) {
+ return text.replace(/[&<>]/g,
+ function(m0) {return {"&": "&", "<": "<", ">": ">"}[m0];});
+};
+window.reAddLoadEventFirst = function(newf) {
+ if (typeof(window.onload) != 'function') {
+ window.onload = newf;
+ } else {
+ var oldf = window.onload;
+ window.onload = function() {
+ newf();
+ oldf();
+ };
+ }
+};
+window.reAddLoadEvent = function(newf) {
+ if (typeof(window.onload) != 'function') {
+ window.onload = newf;
+ } else {
+ var oldf = window.onload;
+ window.onload = function() {
+ oldf();
+ newf();
+ };
+ }
+};
+window.reAddUnloadEvent = function(newf) {
+ if (typeof(window.onunload) != 'function') {
+ window.onunload = newf;
+ } else {
+ var oldf = window.onunload;
+ window.onunload = function() {
+ oldf();
+ newf();
+ };
+ }
+};
+// Local support functions:
+function reHideDelims(text) {
+ return text.replace(/[()|]/g,
+ function(m0) {return {"(": "(", ")": ")", "|": "|"}[m0];});
+}
+function reOnMouseover() { // Add "regex_hl" class to all siblings.
+ if (this.sibs) {
+ for (var i = 0, n = this.sibs.length; i < n; i++) {
+ var el = this.sibs[i];
+ if (!el.className) el.className = "regex_hl";
+ else if (!re_over.test(el.className)) el.className += " regex_hl";
+ }
+ }
+}
+function reOnMouseout() { // Remove "regex_hl" class from all siblings.
+ if (this.sibs) {
+ for (var i = 0, n = this.sibs.length; i < n; i++) {
+ var el = this.sibs[i];
+ if (el.className) el.className = el.className.replace(re_out, "");
+ }
+ }
+}
+function rePrepareAllMarkup() {
+ if (re_elems.length === 0) { // Done? Clear status and exit.
+ window.status = "";
+ return;
+ }
+ var start = +new Date(); // For UI responsiveness, limit
+ do { // consecutive runtime to 50ms.
+ reHighlightElement(re_elems.shift());
+ } while (re_elems.length > 0 && (+new Date - start < 50));
+ setTimeout(rePrepareAllMarkup, 25); // Give up CPU for UI thread.
+}
+function reOnload() {
+ if (!reAutoLoad) return; // No autoload? Exit now.
+ re_elems = reGetElemsByKlassNames(document, 'regex', 'regex_x');
+ if (re_elems.length > 0) {
+ window.status = "Marking up " + re_elems.length + " regex elements...";
+ setTimeout(rePrepareAllMarkup, 0);
+ }
+}
+function reOnunload() {
+ // Remove references to avoid IE memory leaks.
+ re_elems = reGetElemsByKlassNames(document, 'regex', 'regex_x');
+ var spans, span;
+ for (var i = 0, n = re_elems.length; i < n; i++) {
+ spans = re_elems[i].getElementsByTagName('span');
+ re_elems[i] = null;
+ for (var j = 0, m = spans.length; j < m; j++) {
+ span = spans[j];
+ if (span.sibs) {
+ span.sibs = null;
+ span.onmouseover = null;
+ span.onmouseout = null;
+ }
+ }
+ }
+ // Null out pseudo-static private closure variables.
+ re_elems = re_class = re_1_cmt = re_1_nocmt = re_2 = null;
+ re_escapedgroupdelims = re_open_html_tag = re_over = re_out = null;
+
+ // Null out globals.
+ window.reAutoLoad = window.reHighlightElement = window.rePutElemContents = null;
+ window.reGetElemsByKlassNames = window.reHideHtmlSpecialChars = null;
+ window.reAddLoadEventFirst = window.reAddLoadEvent = null;
+ window.reAddUnloadEvent = window.reAutoLoad = null;
+}
+// Load/unload only if we have needed DOM methods.
+if (document.getElementById && document.getElementsByTagName) {
+ reAddLoadEvent(reOnload);
+ reAddUnloadEvent(reOnunload);
+}
+})();
+/* ]]> */
diff --git a/bin/shBrushAS3.js b/bin/shBrushAS3.js
new file mode 100644
index 0000000..8aa3ed2
--- /dev/null
+++ b/bin/shBrushAS3.js
@@ -0,0 +1,59 @@
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/SyntaxHighlighter
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
+ *
+ * @version
+ * 3.0.83 (July 02 2010)
+ *
+ * @copyright
+ * Copyright (C) 2004-2010 Alex Gorbatchev.
+ *
+ * @license
+ * Dual licensed under the MIT and GPL licenses.
+ */
+;(function()
+{
+ // CommonJS
+ typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
+
+ function Brush()
+ {
+ // Created by Peter Atoria @ http://iAtoria.com
+
+ var inits = 'class interface function package';
+
+ var keywords = '-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' +
+ 'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' +
+ 'extends false final finally flash_proxy for get if implements import in include Infinity ' +
+ 'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' +
+ 'Null Number Object object_proxy override parseFloat parseInt private protected public ' +
+ 'return set static String super switch this throw true try typeof uint undefined unescape ' +
+ 'use void while with'
+ ;
+
+ this.regexList = [
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
+ { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
+ { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
+ { regex: new RegExp(this.getKeywords(inits), 'gm'), css: 'color3' }, // initializations
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
+ { regex: new RegExp('var', 'gm'), css: 'variable' }, // variable
+ { regex: new RegExp('trace', 'gm'), css: 'color1' } // trace
+ ];
+
+ this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
+ };
+
+ Brush.prototype = new SyntaxHighlighter.Highlighter();
+ Brush.aliases = ['actionscript3', 'as3'];
+
+ SyntaxHighlighter.brushes.AS3 = Brush;
+
+ // CommonJS
+ typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
+})();
diff --git a/bin/shBrushAppleScript.js b/bin/shBrushAppleScript.js
new file mode 100644
index 0000000..d40bbd7
--- /dev/null
+++ b/bin/shBrushAppleScript.js
@@ -0,0 +1,75 @@
+/**
+ * SyntaxHighlighter
+ * http://alexgorbatchev.com/SyntaxHighlighter
+ *
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
+ * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
+ *
+ * @version
+ * 3.0.83 (July 02 2010)
+ *
+ * @copyright
+ * Copyright (C) 2004-2010 Alex Gorbatchev.
+ *
+ * @license
+ * Dual licensed under the MIT and GPL licenses.
+ */
+;(function()
+{
+ // CommonJS
+ typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
+
+ function Brush()
+ {
+ // AppleScript brush by David Chambers
+ // http://davidchambersdesign.com/
+ var keywords = 'after before beginning continue copy each end every from return get global in local named of set some that the then times to where whose with without';
+ var ordinals = 'first second third fourth fifth sixth seventh eighth ninth tenth last front back middle';
+ var specials = 'activate add alias AppleScript ask attachment boolean class constant delete duplicate empty exists false id integer list make message modal modified new no paragraph pi properties quit real record remove rest result reveal reverse run running save string true word yes';
+
+ this.regexList = [
+
+ { regex: /(--|#).*$/gm,
+ css: 'comments' },
+
+ { regex: /\(\*(?:[\s\S]*?\(\*[\s\S]*?\*\))*[\s\S]*?\*\)/gm, // support nested comments
+ css: 'comments' },
+
+ { regex: /"[\s\S]*?"/gm,
+ css: 'string' },
+
+ { regex: /(?:,|:|¬|'s\b|\(|\)|\{|\}|«|\b\w*»)/g,
+ css: 'color1' },
+
+ { regex: /(-)?(\d)+(\.(\d)?)?(E\+(\d)+)?/g, // numbers
+ css: 'color1' },
+
+ { regex: /(?:&(amp;|gt;|lt;)?|=|� |>|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g,
+ css: 'color2' },
+
+ { regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g,
+ css: 'keyword' },
+
+ { regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals
+ css: 'keyword' },
+
+ { regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g,
+ css: 'color3' },
+
+ { regex: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g,
+ css: 'color3' },
+
+ { regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' },
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
+ { regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' }
+ ];
+ };