Changeset 8676 for lang/gauche/oldtype
- Timestamp:
- 04/02/08 22:06:22 (5 years ago)
- Location:
- lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype
- Files:
-
- 3 modified
-
format.scm (modified) (3 diffs)
-
oldtype.kahua (modified) (6 diffs)
-
util.kahua (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/format.scm
r7811 r8676 158 158 ;; (lineno . LINENO) 159 159 ;; (latest-rate . NUMBER) 160 ;; (rev . COMMIT_REVISION_NUMBER) 161 ;; (commit-utc . COMMIT_UTC_SECONDS) 160 162 ;; ) 161 163 ;; (TAG … … 200 202 (car ann-of-line))) 201 203 '((index . 5)))) 204 (rev (if ann-of-line 205 (car ann-of-line) 206 #f)) 207 (info-of-line (if rev 208 (assq-ref top rev) 209 #f)) 210 (commit-utc (if info-of-line 211 (assq-ref (assq-ref (car info-of-line) 'date) 'utc) 212 0)) 202 213 (latest-rate (assq-ref line-alist 'index))) 203 214 … … 219 230 (committer . ,(if ann-of-line 220 231 (assq-ref (cadr ann-of-line) 'user) 221 'oldtype))) 232 'oldtype)) 233 (rev . ,rev) 234 (commit-utc . ,commit-utc) 235 ) 222 236 ,@(rec (sxml:content sxml) hctx))) 223 237 ((a) -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/oldtype.kahua
r8607 r8676 78 78 ;; utility : internal sxml format to highger-order-tag 79 79 (define (sxml->higher-order-tag wikiname sxmls page-src) 80 (define _nbsp "\u00a0")81 (define (space->nbsp string)82 (regexp-replace-all #/ / string _nbsp))83 80 (let1 is-w3m (eq? 'w3m (oldtype-user-agent)) 84 81 (div/ … … 109 106 (td/ "committer") 110 107 (td/ (assq-ref param 'committer))) 108 (tr/ 109 (td/ "commit date") 110 (td/ (string-append (oldtype:utc->date-string (assq-ref param 'commit-utc)) 111 (oldtype:space->nbsp (oldtype:utc->ago-string (assq-ref param 'commit-utc)))))) 112 (tr/ 113 (td/ "commit revision") 114 (td/ (assq-ref param 'rev))) 111 115 (tr/ 112 116 (td/ "original-src") … … 138 142 ((4) (oldtype:icon-image 'new4)) 139 143 (else (if is-w3m 140 ( space->nbsp " ")144 (oldtype:space->nbsp " ") 141 145 (oldtype:icon-image 'new5)))))))) 142 146 (_rest … … 169 173 (type "text") 170 174 (value (assq-ref param 'orig)))) 171 ( space->nbsp " ")175 (oldtype:space->nbsp " ") 172 176 (input/ (@/ 173 177 (type "button") … … 192 196 (oldtype:icon-image 'ul1) (node-set (rec arg))))) 193 197 ((pre-ul2) `(,@(span/ 194 _nbsp198 (oldtype:space->nbsp " ") 195 199 (oldtype:icon-image 'ul2) (node-set (rec arg))))) 196 200 ((pre-ul3) `(,@(span/ 197 _nbsp _nbsp201 (oldtype:space->nbsp " ") 198 202 (oldtype:icon-image 'ul3) (node-set (rec arg))))) 199 203 ((pre-ol1) `(,@(span/ 200 204 (oldtype:icon-image 'ol1) (node-set (rec arg))))) 201 205 ((pre-ol2) `(,@(span/ 202 _nbsp206 (oldtype:space->nbsp " ") 203 207 (oldtype:icon-image 'ol2) (node-set (rec arg))))) 204 208 ((pre-ol3) `(,@(span/ 205 _nbsp _nbsp209 (oldtype:space->nbsp " ") 206 210 (oldtype:icon-image 'ol3) (node-set (rec arg))))) 207 211 ((h1) `(,@(h1/ (@/ (id "h1")) (node-set (rec arg))))) … … 236 240 (cons 237 241 (if string? 238 ( space->nbsp other)242 (oldtype:space->nbsp other) 239 243 other) 240 244 (rec rest))))))))) -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/util.kahua
r8607 r8676 14 14 (define (oldtype:static-image-path) 15 15 (string-append "/kahua/" (kahua-worker-type) "/staticimg/")) 16 17 (define (oldtype:space->nbsp string) 18 (define _nbsp "\u00a0") 19 (regexp-replace-all #/ / string _nbsp)) 16 20 17 21 … … 220 224 221 225 226 ;; 227 ;; Convert utc seconds to "2008-03-20 09:36 PM (+0900)" 228 ;; 229 (define (oldtype:utc->date-string utc) 230 (if utc 231 (let1 d (time-utc->date 232 (seconds->time 233 utc)) 234 (string-append (date->string d "~Y-~m-~d ~I:~M ~p (~z)"))) 235 "*NoDateInformation*")) 236 237 ;; 238 ;; Convert utc seconds to " (10 seconds ago)" 239 ;; 240 (define (oldtype:utc->ago-string utc) 241 (if utc 242 (string-append 243 (format "~18,,,' @a" 244 (string-append 245 "(" 246 (how-long-since utc) 247 " ago)"))) 248 "*NoDateInformation*")) 249 250 251 222 252 (define (oldtype:format-macro expr) 223 253 (let ((command (car expr)) … … 298 328 ((timestamp) 299 329 (if (< 0 len) 300 (let* ((_utc (car arg)) 301 (d (time-utc->date 302 (seconds->time 303 (string->number 304 _utc))))) 305 (text/ (string-append (date->string d "~Y-~m-~d ~I:~M ~p (~z)")))) 330 (let1 _utc (car arg) 331 (text/ (oldtype:utc->date-string (string->number _utc)))) 306 332 (p/ "!!Error : No argument ##(timestamp UTC) command"))) 307 333 … … 311 337 (let1 _utc (car arg) 312 338 (text/ 313 (format "(~a ago)" 314 (string-append 315 (how-long-since 316 (string->number 317 _utc)))))) 339 (oldtype:space->nbsp 340 (oldtype:utc->ago-string (string->number _utc))))) 318 341 (p/ "!!Error : No argument ##(since UTC) command"))) 319 342
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)