Changeset 15903 for lang/gauche
- Timestamp:
- 07/16/08 22:58:57 (4 months ago)
- Location:
- lang/gauche/oldtype/trunk
- Files:
-
- 8 modified
-
Kahua/oldtype/oldtype/format.scm (modified) (1 diff)
-
Kahua/oldtype/oldtype/oldtype.css (modified) (1 diff)
-
Kahua/oldtype/oldtype/oldtype.kahua (modified) (2 diffs)
-
Kahua/oldtype/oldtype/svn.scm (modified) (3 diffs)
-
Kahua/oldtype/oldtype/util.kahua (modified) (2 diffs)
-
Kahua/oldtype/oldtype/util.scm (modified) (2 diffs)
-
bin/batch.sh (modified) (1 diff)
-
src/test.scm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/format.scm
r14311 r15903 109 109 ;; download link oldtype-mode.el source code 110 110 ((download-el) "[Download oldtype-mode.el now]") 111 ;; comment-data 112 ((comment-data) 113 (if (< 1 len) 114 (string-append (format "----< ~a >----" (uri-decode-string (car arg))) 115 "\n" 116 (uri-decode-string (cadr arg))) 117 (format "!!Error : comment-data format error for ##(comment-data user string) command"))) 118 ;; else 111 119 (else 112 (format " !!Error : no such macro \"~a\"!!" command)))))120 (format "[~a]" command))))) 113 121 114 122 -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/oldtype.css
r14648 r15903 681 681 color: white; 682 682 } 683 684 pre.comment { 685 margin-left: 0.5em; 686 font-size: medium; 687 padding-left: 0.5em; 688 margin-top: 1px; 689 margin-bottom: 1px; 690 } 691 692 table.comment { 693 width: 70%; 694 } -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/oldtype.kahua
r14618 r15903 14 14 (use oldtype.timeline) 15 15 (use oldtype.page) 16 (use oldtype.svn) 16 17 (use srfi-1) 17 18 (use srfi-19) 19 (use srfi-27) 18 20 (load "oldtype/version.kahua") 19 21 (load "oldtype/util.kahua") … … 259 261 ((h5) `(,@(h5/ (@/ (id "h5")) (node-set (rec arg))))) 260 262 ((h6) `(,@(h6/ (@/ (id "h6")) (node-set (rec arg)))))))) 261 ((wiki-macro) `(,@(oldtype:format-macro arg )))263 ((wiki-macro) `(,@(oldtype:format-macro arg oldtype-page))) 262 264 ((wiki-name) `(,@(oldtype:expand-wiki-name (car arg)))) 263 265 ((hr) (hr/)) -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/svn.scm
r15741 r15903 41 41 status 42 42 get-fullpath 43 save-text-list 43 44 <svn-work> 44 45 )) … … 107 108 (display str) 108 109 (if (string= "" str) 109 #f110 '("" "") 110 111 (string-split str #/[ ]+/)))))) 111 112 … … 121 122 122 123 124 (define-method save-text-list ((self <svn-work>) wikiname text-list) 125 (with-output-to-file (format "~a/edit/~a.ot" (get-fullpath self) wikiname) 126 (lambda () 127 (for-each 128 (lambda (str) 129 (display str) 130 (newline)) 131 text-list)))) 132 133 123 134 (provide "oldtype/svn") -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/util.kahua
r15232 r15903 230 230 (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.article_text.png")) 231 231 (alt "PLAIN")))) 232 ((comment) 233 (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.comment_blue.png")) 234 (alt "COMMENT")))) 235 ((double-comment) 236 (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.double_comment.png")) 237 (alt "DCOMMENT")))) 238 ((alert) 239 (img/ (@/ (src (string-append (oldtype:static-image-path) "icon.stop_round.png")) 240 (alt "ALERT")))) 232 241 (else 233 242 `(p/ ,(format "!!Error : no such icon-image \"~a\"!!" sym))))) 234 235 236 (define (oldtype:format-macro expr) 243 244 245 (define (oldtype:add-comment oldtype-page name comment) 246 (apply append 247 (map 248 (lambda (str) 249 (if (#/##\(comment\)/ str) 250 `( 251 ,(format "##(comment-data ~a ~a)" 252 (uri-encode-string name) 253 (uri-encode-string comment)) 254 ,str) 255 `(,str))) 256 (get-text-list oldtype-page)))) 257 258 259 (define (oldtype:format-macro expr oldtype-page) 237 260 (let ((command (car expr)) 238 261 (arg ;; symbol list to string list. … … 337 360 ;; input comment 338 361 ((comment) 339 (form/ (@/ (action ".")) 340 (table/ 341 (tr/ (th/ "Post a comment")) 342 (tr/ (td/ 343 "Name:" 344 (input/ 345 (@/ (type "text") (value "") (size 20))))) 346 (tr/ (td/ 347 (textarea/ 348 (@/ (cols 120) (rows 3))))) 349 (tr/ (td/ 350 (input/ (@/ (type "submit") (value "Submit comment")))))))) 362 (form/cont/ 363 (@@/ (cont 364 (entry-lambda (:keyword name comment) 365 (let1 nodes 366 (p/ 367 (oldtype:icon-image 'alert) 368 "Error: commit action missed.") 369 (if (or (> 1 (string-length name)) 370 (> 1 (string-length comment))) 371 (set! nodes (p/ 372 (oldtype:icon-image 'alert) 373 "Please input name and comment.")) 374 (let1 work (make <svn-work> 375 :url (oldtype:get-arguments 'svn) 376 :user (oldtype:get-arguments 'anon-user) 377 :pass (oldtype:get-arguments 'anon-pass) 378 :basepath (oldtype:workpath)) 379 (init work (string-append 380 (number->string (sys-time)) 381 "." 382 (number->string (random-integer 100)))) 383 (save-text-list work (name-of oldtype-page) 384 (oldtype:add-comment oldtype-page name comment)) 385 (let1 result (status work (name-of oldtype-page)) 386 (when (string=? "M" (car result)) 387 (begin 388 (commit work) 389 (set! nodes 390 (p/ 391 (oldtype:icon-image 'info) 392 "Thank you! Your comment was registered."))))))) 393 (standard-page 394 (name-of oldtype-page) 395 (br/) 396 (div/ 397 nodes 398 (p/ "Back to " (oldtype:expand-wiki-name (name-of oldtype-page)))) 399 "" 400 1))))) 401 (table/ (@/ (class "comment")) 402 (tr/ (th/ 403 (oldtype:icon-image 'double-comment) 404 "Post a comment")) 405 (tr/ (td/ 406 "Name:" 407 (input/ 408 (@/ (type "text") (name "name") (value "") (size 20))))) 409 (tr/ (td/ 410 (textarea/ 411 (@/ (cols 120) (rows 3) (name "comment"))))) 412 (tr/ (td/ 413 (input/ (@/ (type "submit") (value "Submit comment")))))))) 414 415 ;; display comment 416 ((comment-data) 417 (if (> 2 len) 418 (p/ "!!Error : No argument ##(comment-data user str) command") 419 (table/ (@/ (class "comment")) 420 (tr/ (th/ 421 (oldtype:icon-image 'comment) 422 (uri-decode-string (car arg)))) 423 (tr/ (td/ 424 (pre/ (@/ (class "comment")) 425 (uri-decode-string (cadr arg)))))))) 351 426 352 427 ;; no listing to !RecentChanges -
lang/gauche/oldtype/trunk/Kahua/oldtype/oldtype/util.scm
r14347 r15903 44 44 oldtype:get-string-of-today 45 45 oldtype:editpath 46 oldtype:workpath 46 47 oldtype:user-local 47 48 oldtype:user-backend … … 84 85 (sys-getenv "OT_SITE") 85 86 "/tmp/oldtype/edit")) 87 88 (define (oldtype:workpath) 89 (string-append 90 (sys-getenv "OT_SITE") 91 "/tmp/work")) 86 92 87 93 (define (oldtype:user-local) -
lang/gauche/oldtype/trunk/bin/batch.sh
r15285 r15903 38 38 #run-parts ${OT_HOME}/hook 39 39 echo -n [info] sleep... 40 sleep 540 sleep 1 41 41 echo wakeup 42 42 } -
lang/gauche/oldtype/trunk/src/test.scm
r15746 r15903 190 190 #t 191 191 (lambda () 192 (string? (init work "123"))))192 (string? (init work (number->string (sys-time)))))) 193 193 194 194 (test "status of wikiname (no changes)" 195 #f195 '("" "") 196 196 (lambda () 197 197 (status work "_kiyoka"))) … … 200 200 "M" 201 201 (lambda () 202 (sys-system (format "echo 'a' >> ~a/~a/~a" (get-fullpath work) "edit" "test.ot")) 202 (save-text-list work 203 "test" 204 '("UnitTest用ページ。" "----" "##(comment)")) 203 205 (car (status work "test")))) 204 206 205 207 (when 206 # f208 #t 207 209 (test "commit from work" 208 210 #t
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)