Collection of themes/skins for the Fossil SCM. Public write access, just make an account.

⌈⌋ branch:  Fossil Skins Extra


Check-in [5608fdba7e]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:GitHub-style template, implements language-bar using `fx_stats` table, includes th1x.tcl, requires fossil-search-table.php being run beforehand.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | statherian
Files: files | file ages | folders
SHA1: 5608fdba7efdaa81dfaa8355f21bc1eec371834d
User & Date: mario 2014-03-16 23:32:57
Context
2014-03-16
23:34
Add ui::last_commit, ui::recent_files, fix while{} function, and makes ui::stats populate plain string vars now instead. check-in: a1fc36a666 user: mario tags: trunk
23:32
GitHub-style template, implements language-bar using `fx_stats` table, includes th1x.tcl, requires fossil-search-table.php being run beforehand. check-in: 5608fdba7e user: mario tags: trunk, statherian
2014-03-15
01:31
http://chiselapp.com/user/elucidata/repository/html5-skin/ check-in: d8d5e798d2 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added github.txt.

































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
# The "skin" configuration exported from
# repository "/home/mario/fossil.d/skins/../fossil-skins.fossil"
# on 2014-03-16 23:30:38
config /config 8499
1395012511 'css' value '     /* fonts */
     @import url(http://fonts.googleapis.com/css?family=Viga);
     @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700);

     /* no body spacing */
     html, body {
        border: 0; padding: 0; margin: 0;
        background: #fefefe;
        font: normal normal 400 10pt/16pt Arial,sans-serif;
     }
     html, * {
        box-sizing: border-box; 
     }
     /* general text settings */
     body, article, p {
        color: #333;
        line-height: 135%;
     }

     /* layout features */
     .width-container {
        padding-left: 15% !important;
        padding-right: 15% !important; 
     }
     .text-shadow {
        text-shadow: 0px 1px 0px #888;
     }

     /* menu layout */
     #menu-header, #submenu-header, #project-header, #fossil-footer {
        width: 100%;
        height: 50pt;
        padding: 10pt;
        padding-top: 14pt;
        border-bottom: 1px solid #dfdfdf;
        display: block;
        clear: both;
        vertical-align: middle;
     }
     #menu-header h1 {
        font-family: Viga;
        font-weight: 700;
        display: inline;
        font-size: 23pt;
        color: #333;
        margin: 3pt 20pt 0 0;
        float: left;
     }
     /* search bar */
     #menu-header input, #menu-header select {
        display: inline;
        margin: 0;
        padding: 1pt;
        border: 1px solid #aaa;
     }
     #menu-header select {
        border: 1px solid #ccc;
        background: #f3f3f3;
        color: #555;
        font-weight: 100;
        font-size: 10pt;
        padding: 2pt;
        margin: 0;
     }
     /* menu links */
     #menu-header a {
        color: #444;
        font-size: 11pt;
        font-weight: 600;
        padding: 7pt;
     }

     /* buttons */
     #menu-header a.button {
        top: 2pt;
        border-radius: 5px;
        font-weight: 700;
        padding: 6pt 10pt;
        position: relative;
     }
     .button.green {
        border: 1px solid #493;
        background: #7e5 linear-gradient(180deg,#8e7,#593);
        color: #fff !important;
     }
     .button.green:hover {
        background: #5c3 linear-gradient(180deg,#6d5,#482);
     }
     .button.white {
        border: 1px solid #ddd;
        background: #eee;
        background: linear-gradient(180deg,#fff,#ddd);
        color: #333;
     }
     .button.white:hover, .submenu .label:hover {
        background: #ccc linear-gradient(180deg,#eee,#ccc);
     }
     .button.red {
        border: 1px solid #d97;
        background: #fdc;
        background: linear-gradient(180deg,#fdc,#eba);
        color: #333;
     }
     .button.red:hover {
        background: #eba linear-gradient(180deg,#ecb,#c97);
     }
     .download.button {
        display: block;
        padding: 4pt 10pt;
        border-radius: 4px;
        margin-top: 10pt;
     }
     .branch.button {
        font-family: sans-serif;
        padding: 2pt 6pt;
        border-radius: 4px;
     }
     
     /* fossil action buttons */
     .submenu a.label {
        padding: 2px 3pt;
        border-radius: 3px;
        border: 1px solid #d7d7d7;
        background: #fff linear-gradient(0deg, #eee 0%, #fff 20%);
        color: #333;
     }
     main .submenu {
        float: right;
        position: relative;
        top: -40px;
     }

     /* links */
     a {
        text-decoration: none;
        color: #57c;
     }

     /* project info */
     #project-header a {
        font-size: 16pt;
        color: #48c;
        font-weight: 100;
     }
     #public-prefix {
        font-size: 13pt;
        font-weight: 100;
        color: #ccc;
        position: relative;
        left: -53pt;
        top: 5pt;
     }
     #project-header .share-button {
        padding: 3pt 6pt;
        font-weight: 600;
        border: 1px solid #ddd;
        border-radius: 4px 0 0 4px;
        background: #eee;
        background:linear-gradient(180deg,#fff,#e7e7e7);
        color: #222;
     }
     #project-header .share-button a {
        font-size: 12pt;
     }
     #project-header .share-button-number {
        padding: 3pt 6pt;
        border: 1px solid #ddd;
        border-left: 0;
        border-radius: 0 4px 4px 0;
        background: #fcfcfc;
        color: #444;
     }

     /* project main pane */
     #project-content {
        font-size: 12.25pt;
        padding-top: 16pt;
        color: #666;
        width: 82%;  /************** layout *************/
     }
     #project-stats {
        margin-top: 10pt;
        border: 1px solid #ccc;
        border-radius: 4pt;
        height: 48px;
        overflow: hidden;
        background: #fcfcfc;
        font-family: sans-serif;
     }
     #project-stats-alternate {
        height: 32px;
        text-align: center;
        overflow: hidden;
     }
     #project-stats-alternate div {
        height: 32px;
        padding: 5pt;
     }
     #project-stats-alternate a {
        padding: 1pt 25pt;
        color: #999;
     }
     #project-stats-alternate a b {
        color: #111;
     }

     /* language color graph */
     #language-bar {
        width: 100% !important;
        height: 15px !important;
        border-radius: 0 0 4pt 4pt;
        background: #999;
        padding: 0;
        margin: 0;
     }
     #language-bar span:first-child {
        border-radius: 0 0 0 4pt;
     }
     #language-bar span:last-child {
        border-radius: 0 0 4pt 0;
     }

     /* sidebar */
     #function-sidebar {
        width: 15%;
        float: right;   /************** layout *************/
        overflow: hidden;
     }
     #function-sidebar ul {
        padding: 0;
        margin: 20pt 0 0 0;
     }
     #function-sidebar li {
        border-left: 1px solid #ececec;
        box-shadow: #f4f4f4 4px 0 0 0 inset;
        display: block;
        border-bottom: 1px solid #fcfcfc;
        list-stype-type: none;
        margin: 0;
        padding: 8pt 20pt;
     }
     #function-sidebar li.current, #function-sidebar li a[href="current_page"] {
        border: 0;
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
        border-right: 3px solid #b53;
        box-shadow: #f7f7f7 0 3px 0 0 inset;
     }
     #function-sidebar li:hover {
        background: linear-gradient(90deg, #bbb 0%, #eee 2%, #f7f7f7 15%, #fff 50%);
     }
     #function-sidebar li a b {
        color: #333;
     }
     
     /* file list box */
     #recent-files {
        border: 1px solid #edf;
        box-shadow: #f0f4f8 0 0 6px 4px;
        padding: 0;
     }
     #recent-files table {
        background: #f7f8f9;
        width: 100%;
        margin: 0; padding: 0; border-spacing: 0;
        border-collapse: collapse;
     }
     #recent-files tr {
        width: 100%;
        border-bottom: 1px solid #e4e8ea;
        font-size: 90%;
        padding: 0 !important; margin: 0 !important;
     }
     #recent-files th {
        padding: 5pt;
        text-align: left;
        font-weight: 300;
        background: #dee;
        border-bottom: 1px solid #f3f5f7;
     }
     #recent-files td {
        padding: 5pt;
        text-align: left;
     }
     
     /* actual fossil content (wiki/timeline/files/etc.) */
     main {
        display: block;
        min-height: 500pt;
        border: 1px solid #eee;
        box-shadow: #f7f7f7 0 0 5px 3px;
     }
     main h2.page-title {
        display: block;
        margin: 0;
        padding: 9pt;
        background: #eee;
        background: linear-gradient(180deg, #fff 0%, #fcfcfc 33%, #f7f7f7 75%, #ebebeb 100%);
     }

     /* end */
     #fossil-footer {
        margin-top: 30pt;
        border-top: 1px solid #eee;
        height: 175pt;
     }
     #fossil-footer .button {
        padding: 3pt 6pt;
        border-radius: 2pt;
     }


     /* have different layout on frontpage than elsewhere */
                     .optional { display: none; }
     body.page-index .optional { display: inherit; }
                     #function-sidebar { width: 6%; }
     body.page-index #function-sidebar { width: 15%; }
                     #project-content { width: 91%; }
     body.page-index #project-content { width: 82%; }


'
config /config 7544
1395009355 'header' value '<th1>
   if {[regexp {^(index|home)[?]?} $current_page]} {
      set pagecat "index"
   } else {
      set pagecat $current_page
   }
</th1>

<html>
<head>

  <title>$<project_name>: $<title></title>
  <base href="$<baseurl>/$current_page" />
  <meta http-equiv=Content-Type content="text/html; charset=UTF-8; version=5">
  <link rel=alternate type="application/rss+xml" title=Timeline href="$<baseurl>/timeline.rss">
  <link rel=stylesheet href="$<baseurl>/style.css?gitlike" type="text/css" media=screen>

  <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
  <link rel=stylesheet href="//google-code-prettify.googlecode.com/svn/loader/prettify.css" type="text/css" media="screen">

  <script language=JavaScript>
     function searchform_target(nm) {
        var form = $("#search_form");
        var baseurl = "$<baseurl>";
        form.find("input[name=as_sitesearch]").remove().parent();
        switch (nm) {
           case "fx_src": // utilize th1x and `fx_search` table
               form.attr("action", "wiki");
               form.find("input[name=q]").attr("name", "name");
               break;
           case "manual":
               baseurl = "http://www.fossil-scm.org/";
           case "google":
               form.attr("action", "https://google.com/search");
               form.find("input[name=name]").attr("name", "q");
               form.append("<input type=hidden name=as_sitesearch value=''" + baseurl + "''>");
               break;
        }
     }
  </script>

</head>
<body
   class="page-$pagecat"
   onLoad="
      $(''code,pre'').addClass(''prettyprint'');
      $.getScript(''//google-code-prettify.googlecode.com/svn/loader/run_prettify.js?autoload=true'')
   "
>

  <footer id=menu-header class=width-container>
      <h1>Fossil</h1>
      <form id=search_form action=wiki method=get style=display:inline>
        <select>
           <option onClick="searchform_target(''fx_src'')">This repository
           <option onClick="searchform_target(''google'')">via Google
           <option onClick="searchform_target(''manual'')">Fossil help
        </select>
        <input type=search name=name placeholder="Search through files and wiki" size=30>
      </form>
      <a href=#>Explore</a>
      <a href=#>Features</a>
      <a href=#>Enterprise</a>
      <a href=#>Blog</a>
      <span style=float:right>
        <th1>
            if {[hascap s]} { html {<a href=setup class="button red text-shadow">Admin</a>}
            } else { html {<a href=setup class="button green text-shadow">Sign up</a>} }
        </th1>
        <a href=login class="button white text-shadow"><th1>if {[info exists login]} { puts $login } else { puts "Sign in" }</th1></a>
      </span>
  </footer>


  <footer id=project-header class=width-container>
      <span style=position:absolute><span id=public-prefix>PUBLIC&nbsp;</span></span>
      <img src=https://fossil.include-once.org/fossil-icon.png align=middle height=32 width=32>
      <a href="../..">example.org</a> / <a href=index><b>$project_name</b></a>
      <span style="float:right;">
         <span class=share-button id=share-button onclick="$(''#share-button>span'').toggle(''75'')">&#9733; Star<span style=display:none>&nbsp;
           <a href="https://plus.google.com/share?url=$baseurl" title=google+>g+</a> &middot;
           <a href="https://www.facebook.com/sharer/sharer.php?u=$baseurl" title=facebook>fb</a> &middot;
           <a href="https://twitter.com/intent/tweet?url=$baseurl" title=twitter>tw</a> &middot;
           <a href="http://reddit.com/submit?url=$baseurl" title=reddit>rd</a> &middot;
           <a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=$baseurl" title=linkedin>in</a> &middot;
           <a href="https://www.stumbleupon.com/submit?url=$baseurl" title=stumbleupon>su</a> &middot;
           <a href="https://del.icio.us/post?url=$baseurl" title=delicious>dl</a>
         </span></span><span class=share-button-number><img src="http://api.include-once.org/links/social.img.php?url=http://reddit.com/" align=middle valign=middle></span>
         <span class=share-button>&#9988; Fork</span><span class=share-button-number>1</span>
      </span>
  </footer>
  

  <section id=main-content class=width-container>
  
    <aside id=function-sidebar>
       <ul>
          <li style=padding:5pt>
          <li class=current><a href=tree>  <b>&lt;&gt;</b>  <span class=optional> Code </span></a>
          <li><a href=reportlist title=Tickets>  <b>!</b>   <span class=optional> Issues </span></a>
          <li><a href=wcontent title=Wiki>       <b>#</b>   <span class=optional> Wiki </span></a>
          <li><a href=timeline title=Time>       <b>~</b>   <span class=optional> Pulse </span></a>
          <li><a href=reports title=Graphs>      <b>=</b>   <span class=optional> Graphs </span></a>
          <li><a href=taglist title=Tags>        <b>/</b>   <span class=optional> Tags </span></a>
          <li style=padding:3pt>
       </ul>
       <p class=optional>
          <b>HTTP</b>S sync URL<br>
          <input type=url size=15 value="$<baseurl>/xfer" style="border: 1px solid #ddd; border-radius: 3px" onClick="select()"><br>
          <a class="download button white text-shadow" href="$<baseurl>/zip/$<project_name>.zip?uuid=trunk">➱&nbsp;Download ZIP</a>
          <a class="download button white text-shadow" href="$<baseurl>/zip/$<project_name>.tgz?uuid=trunk">➱&nbsp;Download TGZ</a>
       </p>
    </aside>

    <section id=project-content>
       <article class=optional>
          This project does this and that. Please check out the tickets, then make a sync request and whathaveyou!
       </article>
       
       <section id=project-stats class=optional>
  <th1>set stats_checkins [set stats_branches [set stats_releases [set stats_developers 0]]] ; catch { ui::stats } </th1>
           <div id=project-stats-alternate>
               <div>
                  <a href="timeline?y=ci">◶ <b>$stats_checkins</b> commits</a>
                  <a href=brlist>         ⎇  <b>$stats_branches</b> branches</a>
                  <a href=taglist>        ⌫  <b>$stats_releases</b> releases</a>
                  <a href="timeline?u=*"> ♙ <b>$stats_developers</b> developers</a>
               </div>
               <div>
                  <a href=#><b>100%</b> open source</a>
               </div>
           </div>
           <div onclick="$(''#project-stats-alternate div:eq(0)'').toggle(''slow'')" id=language-bar><th1> ui::lang_stats </th1></div>
       </section>

       <br class=optional>
       <section id=branch-info>
         <a class="branch button green" href=diff>⌈⌋</a>
         <a class="branch button white" href=brlist>⎇  <small>branch:</small> <b>trunk</b></a>
         &nbsp;<a href=index><b>$project_name</b></a>
       </section>

       <br class=optional>
       <section id=recent-files class=optional>
         <table>
            <colgroup><col style="width:25%"><col style="width:60%"><col style="width:15%"></colgroup>
            <tbody><th1>catch {
               ui::last_commit
               ui::recent_files
            }</th1></tbody>
         </table>
       </section>


       <br>
       <main>
          <h2 class=page-title>$title</h2>
          <article style=padding:7pt>
<th1>catch { ui::search_on_wiki }</th1>



'
config /config 1942
1395012544 'footer' value '             <br><br><br>


          </article>
       </main>

    </section>

  </section>




  <section class=width-container>
    <footer id=fossil-footer>
        <p><a href=http://fossil-scm.org/>Fossil</a> version <tt>$release_version</tt> | Manifest: $manifest_version | Manifest date: $manifest_date
        </p>
        <p>
           <a class="button green" href=login>Account</a>
           <a class="button white" href=Index>Index</a>
        </p>
           <a class="button red" href=setup>Setup</a>
           <a href=setup_ulist>Users</a> /
           <a href=setup_access>Access</a> /
           <a href=setup_config>Config</a> /
           <a href=setup_timeline>Timeline</a> /
           <a href=setup_editcss>CSS</a> /
           <a href=setup_header>Header</a> /
           <a href=setup_footer>Footer</a> /
           <a href=rcvfromlist>Log</a> /
           <a href=admin_sql>SQL</a> /
           <a href=stat>Stats</a>
        </p>
        <p>
           <a class="button white" href=wiki>Wiki</a>
           <a href=wcontent>All Pages</a> /
           <a href=timeline?y=w>Recent Changes</a> /
           <a href=wikinew>New Page</a> /
           <a href=eventedit>New Event</a> /
           <a href=modreq>Moderation</a>
        </p>
        <p>
           <a class="button white" href="tree?ci=tip">Files</a>
           <a class="button white" href=zip/trunk.zip?uuid=trunk>ZIP</a>
           <a class="button white" href=tarball/trunk.zip?uuid=trunk>TGZ</a>
           <a class="button white" href=timeline>Timeline</a>
           <a class="button white" href=brlist>Branches</a>
           <a class="button white" href=taglist>Tags</a>
           <a class="button white" href=reportlist>Tickets</a>
           <a class="button white" href=reports>Reports</a>
        </p>
        
    </footer>
  </section>

</body>
</html>
'
config /config 8913
1395008681 'th1-setup' value '


# -------------------------------------------------------------------
# Control structures
#
#   ++ varname
#   ?: [if] {then} {else}
#   isset varname
#   eq str1 str2
#
#   while {cond} {code}
#   foreach varname {list} {code}
#   switch value { val1 {code1} val2 {code2} ... }
#



#-- Pre-increment  [++ varname]
proc ++ {varname} {
   upvar 1 $varname i
   return [uplevel 1 "set {$varname} [expr 1+$i]"]
}


#-- ternary / if-shorthand (cond/then/else may be literals, or {[expressions]} themselves)
proc ?: {cond then else} {
   uplevel 1 "if {$cond} { return $then; } else { return $else; }"
}


#-- info exists shorthand
proc isset {varname} {
   return [uplevel 1 "info exists {$varname}"]
}


#-- string equality shorthand
proc eq {str1 str2} {
   return [expr {$str1 eq $str2}]
}


#-- while loop
proc while {condition code} {
   return [uplevel 1 "for {} {$condition} {} {$code}"]
}


#-- foreach list
#
# foreach VAR "abc xyz 123" { puts "($VAR) " }
#
proc foreach {varname list code} {
   upvar 1 $varname val
   for {set i 0}  {$i < [llength $list]}  {++ i} {
      set val [lindex $list $i]
      uplevel 1 "$code"
   }
}


#-- A switch statement.
#
# switch "val" {
#        "cmp1" {code1}
#        "cmp2" {code2}
#        "cmp3" {code3}
#   {{default}} {codeN}
# }
#
proc switch {compare_value val_code_pairs} {
   set len [llength $val_code_pairs]
   # loop over compare values + code pairs
   for  {set n 0}  {$n < $len}  {++ n} {
      set cmp [lindex $val_code_pairs $n];
      if {[expr $cmp eq $compare_value || $cmp eq {{default}} ]} {
         return [uplevel 1 [lindex $val_code_pairs [++ n]]];
      }
   }
}






# -------------------------------------------------------------------
# String functions
#
#   str::contains needle haystack
#   str::next needle haystack startindex
#   str::wrap haystack needle addbefore addafter
#


   
#-- returns true if string contained in another string
proc str::contains {needle haystack} {
   return [expr {-1 != [string first $needle $haystack]}]
}


#-- wrapper for [string first ...] to support startindex
proc str::next {search content start} {
   # cut out $content at $start before searching
   set p [string first $search [string range $content $start [string length $content]]]
   if [expr $p>=0] {
      set p [expr $start+$p]
   }
   return $p
}


#-- enclose string in e.g. html tags
proc str::wrap {content search before after} {
   set len [string length $search]
   set p 0
   while {[expr [set p [str::next $search $content $p]]>=0]} {
      set content "[string range $content 0 [expr $p-1]]$before$search$after[string range $content [expr $p+$len] 2000]";
      set p [expr $p+[string length "$before+$search+$after"]]; # skip a little further
   }
   return $content
}


#-- Split string into list on delimiter character
# (basically just turns delimiter into space)
#
proc str::explode {delim str} {
   set r ""
   set len [string length $str]
   while {-1 != [set p [string first $delim $str]]} {
      set r "$r [string range $str 0 [expr $p-1]]"
      set str [string range $str [++ p] $len]
   }
   return [list [string trim "$r $str"]]
}   






# -------------------------------------------------------------------
# User Interface utility code
#
#   sql::allowed safe_string
#   ui::page_exists WikiPage
#   ui::file_exists file.name
#
#   ui::search terms baseurl
#   ui::search_on_wiki   
#   ui::stats
#   ui::lang_stats
#



#-- Whitelist permissible characters for SQL context
# * A workaround for the lack of SQL escaping here (or the new query API branch)
# * Used in LIKE context, so ? and % are not allowed
# * And '' and \ or " not included in the whitelist for obvious reasons.
proc sql::allowed {str} {
   return [regexp {^[a-zA-Z0-9 !$&/(){}=<>,.;:-_+#*@]+$} $str]
}


#-- Search function
# * Requires fossil-search.php to build the according table
#   (reading from the raw blobs is impossible) as cronjob
# * And a patched `fossil` binary src/report.c to allow
#   SELECTs on the `search` table.
proc ui::search {terms baseurl} {

   # cleanup $terms
   if [sql::allowed $terms] {
   
      # prepare search query
      set WHERE "1"
      foreach search $terms {
         set WHERE "$WHERE AND content LIKE ''%$search%''"
      }

      # perform search
      query "SELECT path, type, name, content FROM fx_search WHERE $WHERE" {

         # conent excerpt and highlighting      
         set p [string first $terms $content]
         set excerpt [string range $content [expr $p-50] [expr $p+450]]
         foreach search $terms {
            set excerpt [str::wrap "$excerpt" $search <ins> </ins>]
         }
      
         # format result list
         html "
         <div class=search-result>
            <b>[htmlize $type]</b>
            <a href=[htmlize $path]>[htmlize $name]</a> <br>
            <span class=search-link><a href=[htmlize $path]>$baseurl/[htmlize $path]</a></span> <br>
            <small class=search-excerpt>$excerpt</small>
         </div>\n";
      }
   }
}


#-- Check for existence of wiki page
proc ui::page_exists {name} {
   if [sql::allowed $name] {
      query "SELECT 1 FROM tag WHERE tagname = ''wiki-$name''" {
         return 1
      }
   }
   return 0
}


#-- Check if file exists in repository
proc ui::file_exists {name} {
   if [sql::allowed $name] {
      query "SELECT 1 FROM filename WHERE name = ''$name''" {
         return 1
      }
   }
   return 0
}


#-- Call ui::search on non-existant wiki pages
# * We can get $<title> as search terms
#   (no way to access query string parameters otherwise)
# * But this is also convenient, as it doubles as wiki page search
proc ui::search_on_wiki {} {
   upvar 1  title title  baseurl baseurl  current_page current_page
   if [expr {[regexp {^wiki[?]name=} $current_page] && ! [ui::page_exists $title]}] {
      html "<h2 class=search-headline>Search</h2>";
      ui::search $title $baseurl
      html "<br><br><br><br>"
   }
}


#-- Ordered list of project statistics (will populate global $stats() array)
proc ui::stats {} {
   uplevel 1 { query {SELECT
     (SELECT count(objid) FROM event WHERE type=''ci'' LIMIT 1) AS `stats_checkins`,
     (SELECT count(name) FROM filename LIMIT 1) AS `stats_files`,
     (SELECT count(status) FROM ticket LIMIT 1) AS `stats_tickets`,
     (SELECT count(DISTINCT user) FROM event LIMIT 1) AS `stats_developers`,
     (SELECT count(DISTINCT value) FROM tagxref WHERE tagid=8) AS `stats_branches`,
     (SELECT count(tagname) FROM tag WHERE tagname LIKE ''sym-%'') AS `stats_tags`,
     (SELECT count(tagname) FROM tag WHERE tagname REGEXP ''^sym[\\-\\w_.]+\\d+\\.\\d+'') AS `stats_releases`
   } {} }
}


#-- Language/Content statistics (outputs colored bar graph)
proc ui::lang_stats {} {
   # fetch $lang(js/...), $lang_color(js), $lang_list, $total_size
   query {SELECT name, value FROM fx_stats ORDER by VALUE DESC} {
      set $name $value
   }
   # output color bar for language proportions
   #html "<div class=language-bar style=''width:100%; height:3pt; box-sizing:border-box;''>"
   foreach name $lang_list {
      set percent "[expr $lang($name)*100]%"
      html "<span class=code-rate-$name style=''height:100%; width:$percent; display:inline-block; background-color:#$lang_color($name)'' title=''$percent $name''></span>";
   }
   #html "</div>";
}



#-- print two table rows for last commit
proc ui::last_commit {} {
   query {SELECT *, round(julianday(''now'')-mtime) AS age, substr(comment,0,199) AS msg, substr(uuid, 0, 10) AS short_uuid
          FROM event JOIN blob ON blob.rid=event.objid
          WHERE type=''ci'' ORDER BY mtime DESC LIMIT 1
   } {
      html "  <tr><th colspan=3>$msg</th></tr>";
      html "  <tr><th colspan=3 style=background:#fff><a href=''timeline?u=$user'' class=user>$user</a> authored $age days ago
            <span style=float:right>last checkin <a href=''ci/$uuid''>$short_uuid</a></span></th></tr>";
   }
}


#-- outputs table rows containing top-level filenames and recent checkin comments
proc ui::recent_files {} {

   # files
   query {
       SELECT DISTINCT
             instr(name, ''/'') as dir,
             (CASE instr(name,''/'') WHEN 0 THEN name
              ELSE substr(name,0,instr(name, ''/'')) END) AS name,
             substr(comment, 0, 50) AS comment,
             uuid,
             round(julianday(''now'')-mtime) AS age
       FROM filename
       JOIN mlink ON filename.fnid=mlink.fnid
       JOIN event ON mlink.mid=event.objid
       JOIN blob ON blob.rid=event.objid
       GROUP BY name ORDER BY mtime
   } {
      html "               <tr><td>";
      if {$dir > 0} {
          html "<a class=dir href=''tree?name=[htmlize $name]''>[htmlize $name]</a>";
      } else {
          html "<a class=file href=''ci/$uuid?sbs=0''>[htmlize $name]</a>";
      }
      html "</td> <td>[htmlize $comment]</td> <td>[htmlize $age] days ago</td></tr>\n";
   }
}'