Show
Ignore:
Timestamp:
04/20/08 13:56:23 (5 years ago)
Author:
kiyoka
Message:

Supported tooltip and user icon feature.

Location:
lang/gauche/oldtype/trunk
Files:
3 added
4 modified

Legend:

Unmodified
Added
Removed
  • lang/gauche/oldtype/trunk/Kahua/oldtype/Makefile

    r8607 r9976  
    3737TEST_DIR    = $(PWD) 
    3838SCRIPTFILES = $(package)/$(package).kahua $(package)/version.kahua $(package)/util.kahua $(package)/format.scm $(package)/kahualib.scm $(package)/parse.scm $(package)/util.scm $(package)/pasttime.scm 
    39 STATICFILES = $(package)/$(package).css $(package)/staticimg/*.png $(package)/*.el $(package)/import/*.js $(package)/$(package).js 
     39STATICFILES = $(package)/$(package).css $(package)/staticimg/*.png $(package)/*.el $(package)/import/*.js $(package)/import/*.css $(package)/$(package).js 
    4040 
    4141SOURCEDIR   = $(package) 
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/oldtype.js

    r7811 r9976  
    77var dropOutTime   = 1500; // ms 
    88 
     9// for In-place edit 
    910function otEditStart( bodyId ) { 
    1011    if( 'none' == $(bodyId + ':editarea').getStyle( 'display' )) { 
     
    2627} 
    2728 
     29// for tooltips.js 
     30function setup_tooltips( ) { 
     31    $$("body .help").each( function(input) { 
     32        new Tooltip(input, {backgroundColor: "#FC9", borderColor: "#C96",  
     33                            textColor: "#000", textShadowColor: "#FFF"}); 
     34    }); 
     35} 
  • lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/oldtype.kahua

    r9585 r9976  
    5454  (if (eq? 'w3m (oldtype-user-agent)) 
    5555      (br/) 
    56       (node-set/ 
    57        (text/ "Click to jump:") 
    58        (map/ 
    59          (lambda (x) 
    60            (let ((name  (car x)) 
    61                  (param (cadr x))) 
    62              (case name 
    63                ((div) 
    64                 (let ((latest-rate (assq-ref param 'latest-rate)) 
    65                       (id          (assq-ref param 'lineno))) 
    66                   (a/ (@/ (href  (format "#~d" id))) 
    67                       (case latest-rate 
    68                         ((0)  (oldtype:icon-image 'vline0)) 
    69                         ((1)  (oldtype:icon-image 'vline1)) 
    70                         ((2)  (oldtype:icon-image 'vline2)) 
    71                         ((3)  (oldtype:icon-image 'vline3)) 
    72                         ((4)  (oldtype:icon-image 'vline4)) 
    73                         (else (oldtype:icon-image 'vline5))))))))) 
    74          sxmls)))) 
     56      (map/ 
     57       (lambda (x) 
     58         (let ((name  (car x)) 
     59               (param (cadr x))) 
     60           (case name 
     61             ((div) 
     62              (let ((latest-rate (assq-ref param 'latest-rate)) 
     63                    (id          (assq-ref param 'lineno))) 
     64                (a/ (@/ (href  (format "#~d" id)) 
     65                        (title "Click to jump") 
     66                        (class "help")) 
     67                    (case latest-rate 
     68                      ((0)  (oldtype:icon-image 'vline0)) 
     69                      ((1)  (oldtype:icon-image 'vline1)) 
     70                      ((2)  (oldtype:icon-image 'vline2)) 
     71                      ((3)  (oldtype:icon-image 'vline3)) 
     72                      ((4)  (oldtype:icon-image 'vline4)) 
     73                      (else (oldtype:icon-image 'vline5))))))))) 
     74       sxmls))) 
    7575 
    7676   
     
    127127                                                                (string-append orig "\n")) 
    128128                                                            (string-append orig "\n"))) 
    129                                                       page-src))) 
    130                                                    "" 
    131                                                    ))))) 
     129                                                      page-src)))) 
     130                                                  "" 
     131                                                  )))) 
    132132                                         (node-set 
    133                                           (list 
    134                                            (if is-w3m 
    135                                                (text/ "info") 
    136                                                (oldtype:icon-image 'info)) 
    137                                            (case (assq-ref param 'latest-rate) 
    138                                              ((0)  (oldtype:icon-image 'new0)) 
    139                                              ((1)  (oldtype:icon-image 'new1)) 
    140                                              ((2)  (oldtype:icon-image 'new2)) 
    141                                              ((3)  (oldtype:icon-image 'new3)) 
    142                                              ((4)  (oldtype:icon-image 'new4)) 
    143                                              (else (if is-w3m 
    144                                                        (oldtype:space->nbsp "  ") 
    145                                                        (oldtype:icon-image 'new5)))))))) 
     133                                          (let ((date-message (string-append 
     134                                                               (oldtype:utc->ago-string (assq-ref param 'commit-utc)) "  " 
     135                                                               "date:" 
     136                                                               (oldtype:utc->date-string (assq-ref param 'commit-utc)))) 
     137                                                (person-message (symbol->string (assq-ref param 'committer)))) 
     138                                            (list 
     139                                             (span/ (@/ (title date-message) 
     140                                                        (class "help")) 
     141                                                    (case (assq-ref param 'latest-rate) 
     142                                                      ((0)  (oldtype:icon-image 'new0)) 
     143                                                      ((1)  (oldtype:icon-image 'new1)) 
     144                                                      ((2)  (oldtype:icon-image 'new2)) 
     145                                                      ((3)  (oldtype:icon-image 'new3)) 
     146                                                      ((4)  (oldtype:icon-image 'new4)) 
     147                                                      (else (if is-w3m 
     148                                                                (oldtype:space->nbsp "  ") 
     149                                                                (oldtype:icon-image 'new5))))) 
     150                                             (let1 committer-str (symbol->string (assq-ref param 'committer)) 
     151                                                   (a/ (@/ (href 
     152                                                            (oldtype:gen-page-path committer-str))) 
     153                                                       (span/ 
     154                                                        (@/ (class "help") 
     155                                                            (title person-message)) 
     156                                                        (img/ 
     157                                                         (@/  
     158                                                          (class "icon") 
     159                                                          (src 
     160                                                           (string-append 
     161                                                            (oldtype:static-image-path) "../img/" committer-str ".png")))))))))))) 
    146162                               (_rest 
    147163                                (node-set (rec (cdr arg))))) 
     
    155171                                          (style "float: none;")) 
    156172                                         (div/ (@/ (style "position: absolute; left: 2em; font-size: small;")) 
    157                                                _first 
    158                                                (oldtype:expand-wiki-name (symbol->string (assq-ref param 'committer)))) 
     173                                               _first) 
    159174                                         (if (oldtype:is-editable wikiname) 
    160175                                             (div/ (@/ (style "padding-left:  5em;") 
     
    246261 
    247262(define (standard-page wikiname barcode nodes first-line) 
    248   (html/ (head/ (title/ (string-append wikiname first-line)) 
     263  (html/ (head/ (title/ (string-append wikiname " / " first-line)) 
    249264                (link/ (@/ (rel "stylesheet") (type "text/css") 
    250265                           (href (string-append "/kahua/" (kahua-worker-type) "/oldtype.css")))) 
     266                (link/ (@/ (rel "stylesheet") (type "text/css") 
     267                           (href (string-append "/kahua/" (kahua-worker-type) "/import/tooltips.css")))) 
    251268                (script/ (@/ (src (string-append "/kahua/" (kahua-worker-type) "/import/prototype.js"))      (type "text/javascript"))) 
    252269                (script/ (@/ (src (string-append "/kahua/" (kahua-worker-type) "/import/scriptaculous.js"))  (type "text/javascript"))) 
     270                (script/ (@/ (src (string-append "/kahua/" (kahua-worker-type) "/import/tooltips.js"))       (type "text/javascript"))) 
    253271                (script/ (@/ (src (string-append "/kahua/" (kahua-worker-type) "/oldtype.js"))               (type "text/javascript")))) 
    254272         (body/ 
     273          (@/ (onload "setup_tooltips();")) 
    255274          (div/ (@/ (class "header")) 
    256275                (div/ (@/ (style "float: left;")) 
     
    289308   (filter 
    290309    (lambda (x) 
    291       (not (#/^[ ]*$/ x))) 
     310      (not (or 
     311            (#/^[ ]*$/ x) 
     312            (#/^[ ]*##/ x)))) 
    292313    page-src))) 
    293314 
  • lang/gauche/oldtype/trunk/bin/ot_RecentChanges

    r8607 r9976  
    1313fi 
    1414 
     15echo "RecentChanges of OldType contents." >  ${OT_EDITHOME}/edit/!RecentChanges.ot.tmp 
     16echo "----"                               >> ${OT_EDITHOME}/edit/!RecentChanges.ot.tmp 
    1517_svn t --xml info ${lst} | ${OT_HOME}/src/oldtype_svninfo shell | while read line 
    1618do 
     
    2022      echo "- ##(timestamp ${commit_utc}) ##(since ${commit_utc}): [[${name}]] by ([[${commit_author}]])" 
    2123  fi 
    22 done | sort -r | head -${DISPLAY_LINES} > ${OT_EDITHOME}/edit/!RecentChanges.ot.tmp 
     24done | sort -r | head -${DISPLAY_LINES} >> ${OT_EDITHOME}/edit/!RecentChanges.ot.tmp 
    2325if [ -s ${OT_EDITHOME}/edit/!RecentChanges.ot.tmp ]; then 
    2426  /bin/mv -f ${OT_EDITHOME}/edit/!RecentChanges.ot.tmp ${OT_EDITHOME}/edit/!RecentChanges.ot