Check-in [add39a01c8]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Stackoverflow-skin with updated TH1X, slim #language-bar positioning |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
add39a01c846a01227f9fe63339e0ee7 |
User & Date: | mario 2014-03-17 15:03:42 |
Context
2014-03-17
| ||
18:46 | GitHub filebox now directly links to file artifacts. check-in: 164b689ad2 user: mario tags: trunk | |
15:03 | Stackoverflow-skin with updated TH1X, slim #language-bar positioning check-in: add39a01c8 user: mario tags: trunk | |
05:55 | GitHub theme with Unicode symbols and CSS fallback fonts; $current_page is now analyzed to influence stylesheet application. check-in: 6cee14e659 user: mario tags: trunk | |
Changes
Changes to so-skin.txt.
1 2 | # The "skin" configuration exported from # repository "/home/mario/fossil.d/canonic_autoloader.fossil" | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 | # The "skin" configuration exported from # repository "/home/mario/fossil.d/canonic_autoloader.fossil" # on 2014-03-17 15:00:05 config /config 7895 1395068394 'css' value '/* General settings for the entire page */ body { margin: 0ex 1ex; padding: 0px; background-color: white; font-family: sans-serif; } |
︙ | ︙ | |||
423 424 425 426 427 428 429 | color: #333; } .search-headline { font-size: 300%; color: #999; letter-spacing: 5pt; } | | > | > > > > > > > > > > | | | 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 | color: #333; } .search-headline { font-size: 300%; color: #999; letter-spacing: 5pt; } .search-excerpt mark { text-decoration: none; font-style: italic; font-weight: 700; color: #aa3322; } #language-bar { clear: both; position: relative; top: -2px; width: 100%; height: 5px; box-sizing: border-box; background: #eef; } ' config /config 2990 1395068013 'header' value '<html> <head> <base href="$baseurl/$current_page" /> <title>$<project_name>: $<title></title> <link rel=alternate type="application/rss+xml" title=Timeline href="$home/timeline.rss"> <link rel=stylesheet href="$home/style.css?default" type="text/css" media="screen"> <link rel="stylesheet" href="https://google-code-prettify.googlecode.com/svn/loader/prettify.css" type="text/css" media="screen"> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> |
︙ | ︙ | |||
472 473 474 475 476 477 478 | <input name="q" size="28" value="" placeholder="search"> <input type="hidden" name="as_sitesearch" value="$baseurl"> </form--> </div> </div> </header> | | | 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | <input name="q" size="28" value="" placeholder="search"> <input type="hidden" name="as_sitesearch" value="$baseurl"> </form--> </div> </div> </header> <div id=language-bar><th1>catch { ui::lang_stats } </th1></div> <div class="container logo-title-nav"> <a href="$home"><img id=logo src="$home/logo" alt="$<title>" align=left></a> <span class=title>$<project_name></span> <nav id=navlist class=mainmenu> <th1> |
︙ | ︙ | |||
538 539 540 541 542 543 544 | Skin inspired by <a href=//s.tk/so>Stackoverflow</a> </p> </footer> </body> </html> ' | | | | 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 | Skin inspired by <a href=//s.tk/so>Stackoverflow</a> </p> </footer> </body> </html> ' config /config 9097 1395068051 'th1-setup' value ' # ------------------------------------------------------------------- # Control structures # # ++ varname # ?: [if] {then} {else} |
︙ | ︙ | |||
594 595 596 597 598 599 600 | #-- foreach list # # foreach VAR "abc xyz 123" { puts "($VAR) " } # proc foreach {varname list code} { upvar 1 $varname val | | | | | 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 | #-- 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]]]; } } } |
︙ | ︙ | |||
671 672 673 674 675 676 677 | #-- 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] | | | 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 | #-- 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"]] } |
︙ | ︙ | |||
693 694 695 696 697 698 699 700 701 702 703 704 705 706 | # sql::allowed safe_string # ui::page_exists WikiPage # ui::file_exists file.name # # ui::search terms baseurl # ui::search_on_wiki # ui::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 | > | 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 | # 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 |
︙ | ︙ | |||
729 730 731 732 733 734 735 | # 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 { | | | 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 | # 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 <mark> </mark>] } # format result list html " <div class=search-result> <b>[htmlize $type]</b> <a href=[htmlize $path]>[htmlize $name]</a> <br> |
︙ | ︙ | |||
784 785 786 787 788 789 790 | } } #-- Ordered list of project statistics (will populate global $stats() array) proc ui::stats {} { uplevel 1 { query {SELECT | | | | > | | | < > | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | } } #-- 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 *, CAST(julianday(''now'')-mtime AS INT) 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 {} { set seen "" # 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, 70) AS comment, uuid, CAST(julianday(''now'')-mtime AS INT) 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 dir DESC, mtime DESC } { if {$dir && [str::contains $name $seen]} { continue } else { set seen "$name,$seen" } html " <tr><td>"; if {$dir > 0} { html "<a class=dir href=''tree?name=[htmlize $name]''><b class=glyph>📂</b> [htmlize $name]</a>"; } else { html "<a class=file href=''ci/$uuid?sbs=0''><b class=glyph>📄</b> [htmlize $name]</a>"; } html "</td> <td>[htmlize $comment]</td> <td>[htmlize $age] days ago</td></tr>\n"; } }' |