Merge git://factorcode.org/git/factor
commit
b15f88f0b8
|
@ -20,7 +20,7 @@ crossref off
|
|||
{ "linux-ppc" "ppc/linux" }
|
||||
{ "macosx-ppc" "ppc/macosx" }
|
||||
{ "arm" "arm" }
|
||||
} at "/bootstrap.factor" 3append parse-file
|
||||
} at "/bootstrap.factor" 3append parse-file
|
||||
|
||||
"resource:core/bootstrap/layouts/layouts.factor" parse-file
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ SYMBOL: generic-1
|
|||
[
|
||||
generic-1 T{ combination-1 } define-generic
|
||||
|
||||
[ ] <method> object \ generic-1 define-method
|
||||
[ ] object \ generic-1 define-method
|
||||
] with-compilation-unit
|
||||
|
||||
[ ] [
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
USING: help.markup help.syntax generic.math generic.standard
|
||||
words classes definitions kernel alien combinators sequences
|
||||
math ;
|
||||
math quotations ;
|
||||
IN: generic
|
||||
|
||||
ARTICLE: "method-order" "Method precedence"
|
||||
|
@ -154,7 +154,7 @@ HELP: with-methods
|
|||
$low-level-note ;
|
||||
|
||||
HELP: define-method
|
||||
{ $values { "method" "an instance of " { $link method } } { "class" class } { "generic" generic } }
|
||||
{ $values { "method" quotation } { "class" class } { "generic" generic } }
|
||||
{ $description "Defines a method. This is the runtime equivalent of " { $link POSTPONE: M: } "." } ;
|
||||
|
||||
HELP: implementors
|
||||
|
|
|
@ -39,11 +39,6 @@ TUPLE: method loc def ;
|
|||
: <method> ( def -- method )
|
||||
{ set-method-def } \ method construct ;
|
||||
|
||||
M: f method-def ;
|
||||
M: f method-loc ;
|
||||
M: quotation method-def ;
|
||||
M: quotation method-loc drop f ;
|
||||
|
||||
: method ( class generic -- method/f )
|
||||
"methods" word-prop at ;
|
||||
|
||||
|
@ -55,7 +50,7 @@ PREDICATE: pair method-spec
|
|||
|
||||
: sort-methods ( assoc -- newassoc )
|
||||
[ keys sort-classes ] keep
|
||||
[ dupd at method-def 2array ] curry map ;
|
||||
[ dupd at method-def ] curry { } map>assoc ;
|
||||
|
||||
: methods ( word -- assoc )
|
||||
"methods" word-prop sort-methods ;
|
||||
|
@ -72,18 +67,19 @@ TUPLE: check-method class generic ;
|
|||
inline
|
||||
|
||||
: define-method ( method class generic -- )
|
||||
>r bootstrap-word r> check-method
|
||||
>r >r <method> r> bootstrap-word r> check-method
|
||||
[ set-at ] with-methods ;
|
||||
|
||||
! Definition protocol
|
||||
M: method-spec where
|
||||
dup first2 method method-loc [ ] [ second where ] ?if ;
|
||||
dup first2 method [ method-loc ] [ second where ] ?if ;
|
||||
|
||||
M: method-spec set-where first2 method set-method-loc ;
|
||||
|
||||
M: method-spec definer drop \ M: \ ; ;
|
||||
|
||||
M: method-spec definition first2 method method-def ;
|
||||
M: method-spec definition
|
||||
first2 method dup [ method-def ] when ;
|
||||
|
||||
: forget-method ( class generic -- )
|
||||
check-method [ delete-at ] with-methods ;
|
||||
|
|
|
@ -39,8 +39,8 @@ TUPLE: no-math-method left right generic ;
|
|||
\ no-math-method construct-boa throw ;
|
||||
|
||||
: applicable-method ( generic class -- quot )
|
||||
over method method-def
|
||||
[ ] [ [ no-math-method ] curry [ ] like ] ?if ;
|
||||
over method
|
||||
[ method-def ] [ [ no-math-method ] curry [ ] like ] ?if ;
|
||||
|
||||
: object-method ( generic -- quot )
|
||||
object bootstrap-word applicable-method ;
|
||||
|
|
|
@ -54,6 +54,8 @@ M: pair (bitfield-quot) ( spec -- quot )
|
|||
|
||||
\ bitfield [ bitfield-quot ] 1 define-transform
|
||||
|
||||
\ flags [ flags [ ] curry ] 1 define-transform
|
||||
|
||||
! Tuple operations
|
||||
: [get-slots] ( slots -- quot )
|
||||
[ [ 1quotation , \ keep , ] each \ drop , ] [ ] make ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2006, 2007 Daniel Ehrenberg.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: math kernel sequences sbufs vectors
|
||||
namespaces ;
|
||||
namespaces unicode.syntax ;
|
||||
IN: io.encodings
|
||||
|
||||
TUPLE: encode-error ;
|
||||
|
@ -17,6 +17,9 @@ SYMBOL: begin
|
|||
: decoded ( buf ch -- buf ch state )
|
||||
over push 0 begin ;
|
||||
|
||||
: push-replacement ( buf -- buf ch state )
|
||||
UNICHAR: replacement-character decoded ;
|
||||
|
||||
: finish-decoding ( buf ch state -- str )
|
||||
begin eq? [ decode-error ] unless drop "" like ;
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
USING: tools.test io.utf16 ;
|
||||
USING: tools.test io.utf16 arrays unicode.syntax ;
|
||||
|
||||
[ { CHAR: x } ] [ { 0 CHAR: x } decode-utf16be >array ] unit-test
|
||||
[ { HEX: 1D11E } ] [ { HEX: D8 HEX: 34 HEX: DD HEX: 1E } decode-utf16be >array ] unit-test
|
||||
[ { BIN: 11011111 CHAR: q } decode-utf16be >array ] unit-test-fails
|
||||
[ { BIN: 11011011 CHAR: x BIN: 11011011 CHAR: x } decode-utf16be >array ] unit-test-fails
|
||||
[ { UNICHAR: replacement-character } ] [ { BIN: 11011111 CHAR: q } decode-utf16be >array ] unit-test
|
||||
[ { UNICHAR: replacement-character } ] [ { BIN: 11011011 CHAR: x BIN: 11011011 CHAR: x } decode-utf16be >array ] unit-test
|
||||
|
||||
[ B{ 0 120 216 52 221 30 } ] [ { CHAR: x HEX: 1d11e } encode-utf16be >array ] unit-test
|
||||
[ B{ 0 120 216 52 221 30 } ] [ { CHAR: x HEX: 1d11e } encode-utf16be ] unit-test
|
||||
|
||||
[ { CHAR: x } ] [ { CHAR: x 0 } decode-utf16le >array ] unit-test
|
||||
[ { 119070 } ] [ { HEX: 34 HEX: D8 HEX: 1E HEX: DD } decode-utf16le >array ] unit-test
|
||||
[ { 0 BIN: 11011111 } decode-utf16le >array ] unit-test-fails
|
||||
[ { 0 BIN: 11011011 0 0 } decode-utf16le >array ] unit-test-fails
|
||||
[ { UNICHAR: replacement-character } ] [ { 0 BIN: 11011111 } decode-utf16le >array ] unit-test
|
||||
[ { UNICHAR: replacement-character } ] [ { 0 BIN: 11011011 0 0 } decode-utf16le >array ] unit-test
|
||||
|
||||
[ B{ 120 0 52 216 30 221 } ] [ { CHAR: x HEX: 1d11e } encode-utf16le >array ] unit-test
|
||||
[ B{ 120 0 52 216 30 221 } ] [ { CHAR: x HEX: 1d11e } encode-utf16le ] unit-test
|
||||
|
|
|
@ -8,6 +8,9 @@ SYMBOL: double
|
|||
SYMBOL: quad1
|
||||
SYMBOL: quad2
|
||||
SYMBOL: quad3
|
||||
SYMBOL: ignore
|
||||
|
||||
: do-ignore ( -- ch state ) 0 ignore ;
|
||||
|
||||
: append-nums ( byte ch -- ch )
|
||||
8 shift bitor ;
|
||||
|
@ -19,21 +22,22 @@ SYMBOL: quad3
|
|||
dup -3 shift BIN: 11011 number= [
|
||||
dup BIN: 00000100 bitand zero?
|
||||
[ BIN: 11 bitand quad1 ]
|
||||
[ decode-error ] if
|
||||
[ drop do-ignore ] if
|
||||
] [ double ] if ;
|
||||
|
||||
: handle-quad2be ( byte ch -- ch )
|
||||
: handle-quad2be ( byte ch -- ch state )
|
||||
swap dup -2 shift BIN: 110111 number= [
|
||||
>r 2 shift r> BIN: 11 bitand bitor
|
||||
] [ decode-error ] if ;
|
||||
>r 2 shift r> BIN: 11 bitand bitor quad3
|
||||
] [ 2drop do-ignore ] if ;
|
||||
|
||||
: (decode-utf16be) ( buf byte ch state -- buf ch state )
|
||||
{
|
||||
{ begin [ drop begin-utf16be ] }
|
||||
{ double [ end-multibyte ] }
|
||||
{ quad1 [ append-nums quad2 ] }
|
||||
{ quad2 [ handle-quad2be quad3 ] }
|
||||
{ quad2 [ handle-quad2be ] }
|
||||
{ quad3 [ append-nums HEX: 10000 + decoded ] }
|
||||
{ ignore [ 2drop push-replacement ] }
|
||||
} case ;
|
||||
|
||||
: decode-utf16be ( seq -- str )
|
||||
|
@ -43,13 +47,13 @@ SYMBOL: quad3
|
|||
swap dup -3 shift BIN: 11011 = [
|
||||
dup BIN: 100 bitand 0 number=
|
||||
[ BIN: 11 bitand 8 shift bitor quad2 ]
|
||||
[ decode-error ] if
|
||||
[ 2drop push-replacement ] if
|
||||
] [ end-multibyte ] if ;
|
||||
|
||||
: handle-quad3le ( buf byte ch -- buf ch state )
|
||||
swap dup -2 shift BIN: 110111 = [
|
||||
BIN: 11 bitand append-nums HEX: 10000 + decoded
|
||||
] [ decode-error ] if ;
|
||||
] [ 2drop push-replacement ] if ;
|
||||
|
||||
: (decode-utf16le) ( buf byte ch state -- buf ch state )
|
||||
{
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
USING: io.utf8 tools.test strings ;
|
||||
USING: io.utf8 tools.test strings arrays unicode.syntax ;
|
||||
|
||||
[ { BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 11111111 } decode-utf8 ] unit-test-fails
|
||||
[ { UNICHAR: replacement-character } ] [ { BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 11111111 } decode-utf8 >array ] unit-test
|
||||
|
||||
[ { BIN: 101111111000000111111 } ] [ { BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 } decode-utf8 ] unit-test
|
||||
[ { BIN: 101111111000000111111 } ] [ { BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 } decode-utf8 >array ] unit-test
|
||||
|
||||
[ "x" ] [ "x" decode-utf8 >string ] unit-test
|
||||
|
||||
[ { BIN: 11111000000 } ] [ { BIN: 11011111 BIN: 10000000 } decode-utf8 ] unit-test
|
||||
[ { BIN: 11111000000 } ] [ { BIN: 11011111 BIN: 10000000 } decode-utf8 >array ] unit-test
|
||||
|
||||
[ { BIN: 10000000 } decode-utf8 ] unit-test-fails
|
||||
[ { UNICHAR: replacement-character } ] [ { BIN: 10000000 } decode-utf8 >array ] unit-test
|
||||
|
||||
[ { BIN: 1111000000111111 } ] [ { BIN: 11101111 BIN: 10000000 BIN: 10111111 } decode-utf8 ] unit-test
|
||||
[ { BIN: 1111000000111111 } ] [ { BIN: 11101111 BIN: 10000000 BIN: 10111111 } decode-utf8 >array ] unit-test
|
||||
|
||||
[ B{ BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 BIN: 11101111 BIN: 10000000 BIN: 10111111 BIN: 11011111 BIN: 10000000 CHAR: x } ]
|
||||
[ { BIN: 101111111000000111111 BIN: 1111000000111111 BIN: 11111000000 CHAR: x } encode-utf8 ] unit-test
|
||||
|
|
|
@ -14,10 +14,10 @@ SYMBOL: quad3
|
|||
: starts-2? ( char -- ? )
|
||||
-6 shift BIN: 10 number= ;
|
||||
|
||||
: append-nums ( bottom top -- num )
|
||||
over starts-2?
|
||||
[ 6 shift swap BIN: 111111 bitand bitor ]
|
||||
[ decode-error ] if ;
|
||||
: append-nums ( buf bottom top state-out -- buf num state )
|
||||
>r over starts-2?
|
||||
[ 6 shift swap BIN: 111111 bitand bitor r> ]
|
||||
[ r> 3drop push-replacement ] if ;
|
||||
|
||||
: begin-utf8 ( buf byte -- buf ch state )
|
||||
{
|
||||
|
@ -25,20 +25,20 @@ SYMBOL: quad3
|
|||
{ [ dup -5 shift BIN: 110 number= ] [ BIN: 11111 bitand double ] }
|
||||
{ [ dup -4 shift BIN: 1110 number= ] [ BIN: 1111 bitand triple ] }
|
||||
{ [ dup -3 shift BIN: 11110 number= ] [ BIN: 111 bitand quad ] }
|
||||
{ [ t ] [ decode-error ] }
|
||||
{ [ t ] [ drop push-replacement ] }
|
||||
} cond ;
|
||||
|
||||
: end-multibyte ( buf byte ch -- buf ch state )
|
||||
append-nums decoded ;
|
||||
f append-nums [ decoded ] unless* ;
|
||||
|
||||
: (decode-utf8) ( buf byte ch state -- buf ch state )
|
||||
{
|
||||
{ begin [ drop begin-utf8 ] }
|
||||
{ double [ end-multibyte ] }
|
||||
{ triple [ append-nums triple2 ] }
|
||||
{ triple [ triple2 append-nums ] }
|
||||
{ triple2 [ end-multibyte ] }
|
||||
{ quad [ append-nums quad2 ] }
|
||||
{ quad2 [ append-nums quad3 ] }
|
||||
{ quad [ quad2 append-nums ] }
|
||||
{ quad2 [ quad3 append-nums ] }
|
||||
{ quad3 [ end-multibyte ] }
|
||||
} case ;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
! Copyright (C) 2007 Slava Pestov.
|
||||
! Copyright (C) 2007, 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: arrays kernel math sequences words ;
|
||||
IN: math.bitfields
|
||||
|
@ -13,3 +13,6 @@ M: pair (bitfield) ( value accum pair -- newaccum )
|
|||
|
||||
: bitfield ( values... bitspec -- n )
|
||||
0 [ (bitfield) ] reduce ;
|
||||
|
||||
: flags ( values -- n )
|
||||
0 [ dup word? [ execute ] when bitor ] reduce ;
|
||||
|
|
|
@ -18,10 +18,6 @@ HELP: ch>ascii-escape
|
|||
{ $values { "ch" "a character" } { "str" string } }
|
||||
{ $description "Converts a character to an escape code." } ;
|
||||
|
||||
HELP: ch>unicode-escape
|
||||
{ $values { "ch" "a character" } { "str" string } }
|
||||
{ $description "Converts a character to a Unicode escape code (" { $snippet "\\u123456"} ")." } ;
|
||||
|
||||
HELP: unparse-ch
|
||||
{ $values { "ch" "a character" } }
|
||||
{ $description "Adds the character to the sequence being constructed (see " { $link "namespaces-make" } "). If the character can appear in a string literal, it is added directly, otherwise an escape code is added." } ;
|
||||
|
|
|
@ -58,17 +58,17 @@ M: f pprint* drop \ f pprint-word ;
|
|||
! Strings
|
||||
: ch>ascii-escape ( ch -- str )
|
||||
H{
|
||||
{ CHAR: \e CHAR: \\e }
|
||||
{ CHAR: \n CHAR: \\n }
|
||||
{ CHAR: \r CHAR: \\r }
|
||||
{ CHAR: \t CHAR: \\t }
|
||||
{ CHAR: \0 CHAR: \\0 }
|
||||
{ CHAR: \\ CHAR: \\\\ }
|
||||
{ CHAR: \" CHAR: \\\" }
|
||||
{ CHAR: \e CHAR: e }
|
||||
{ CHAR: \n CHAR: n }
|
||||
{ CHAR: \r CHAR: r }
|
||||
{ CHAR: \t CHAR: t }
|
||||
{ CHAR: \0 CHAR: 0 }
|
||||
{ CHAR: \\ CHAR: \\ }
|
||||
{ CHAR: \" CHAR: \" }
|
||||
} at ;
|
||||
|
||||
: unparse-ch ( ch -- )
|
||||
dup ch>ascii-escape [ ] [ ] ?if , ;
|
||||
dup ch>ascii-escape [ "\\" % ] [ ] ?if , ;
|
||||
|
||||
: do-string-limit ( str -- trimmed )
|
||||
string-limit get [
|
||||
|
|
|
@ -21,9 +21,9 @@ IN: temporary
|
|||
[ "hello\\backslash" unparse ]
|
||||
unit-test
|
||||
|
||||
[ "\"\\u123456\"" ]
|
||||
[ "\u123456" unparse ]
|
||||
unit-test
|
||||
! [ "\"\\u123456\"" ]
|
||||
! [ "\u123456" unparse ]
|
||||
! unit-test
|
||||
|
||||
[ "\"\\e\"" ]
|
||||
[ "\e" unparse ]
|
||||
|
|
|
@ -10,7 +10,7 @@ TUPLE: slot-spec type name offset reader writer ;
|
|||
C: <slot-spec> slot-spec
|
||||
|
||||
: define-typecheck ( class generic quot -- )
|
||||
<method> over define-simple-generic -rot define-method ;
|
||||
over define-simple-generic -rot define-method ;
|
||||
|
||||
: define-slot-word ( class slot word quot -- )
|
||||
rot >fixnum add* define-typecheck ;
|
||||
|
|
|
@ -91,5 +91,3 @@ unit-test
|
|||
"\udeadbe" clone
|
||||
CHAR: \u123456 over clone set-first
|
||||
] unit-test
|
||||
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ IN: bootstrap.syntax
|
|||
f set-word
|
||||
location >r
|
||||
scan-word bootstrap-word scan-word
|
||||
[ parse-definition <method> -rot define-method ] 2keep
|
||||
[ parse-definition -rot define-method ] 2keep
|
||||
2array r> remember-definition
|
||||
] define-syntax
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2006, 2007 Slava Pestov
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: arrays kernel math cocoa cocoa.messages cocoa.classes
|
||||
sequences ;
|
||||
sequences math.bitfields ;
|
||||
IN: cocoa.windows
|
||||
|
||||
: NSBorderlessWindowMask 0 ; inline
|
||||
|
@ -15,10 +15,12 @@ IN: cocoa.windows
|
|||
: NSBackingStoreBuffered 2 ; inline
|
||||
|
||||
: standard-window-type
|
||||
{
|
||||
NSTitledWindowMask
|
||||
NSClosableWindowMask bitor
|
||||
NSMiniaturizableWindowMask bitor
|
||||
NSResizableWindowMask bitor ; inline
|
||||
NSClosableWindowMask
|
||||
NSMiniaturizableWindowMask
|
||||
NSResizableWindowMask
|
||||
} flags ; inline
|
||||
|
||||
: <NSWindow> ( rect -- window )
|
||||
NSWindow -> alloc swap
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
USING: assocs html.parser kernel math sequences strings ;
|
||||
USING: assocs html.parser kernel math sequences strings unicode.categories
|
||||
unicode.case ;
|
||||
IN: html.parser.analyzer
|
||||
|
||||
: remove-blank-text ( vector -- vector' )
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
USING: arrays html.parser.utils hashtables io kernel
|
||||
namespaces prettyprint quotations
|
||||
sequences splitting state-parser strings ;
|
||||
sequences splitting state-parser strings unicode.categories unicode.case ;
|
||||
IN: html.parser
|
||||
|
||||
TUPLE: tag name attributes text matched? closing? ;
|
||||
|
|
|
@ -14,3 +14,5 @@ IN: temporary
|
|||
[ "hello world" ] [ "hello world%x" url-decode ] unit-test
|
||||
[ "hello%20world" ] [ "hello world" url-encode ] unit-test
|
||||
[ "%20%21%20" ] [ " ! " url-encode ] unit-test
|
||||
|
||||
[ "\u001234hi\u002045" ] [ "\u001234hi\u002045" url-encode url-decode ] unit-test
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2003, 2007 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: hashtables io kernel math namespaces math.parser assocs
|
||||
sequences strings splitting ascii ;
|
||||
sequences strings splitting ascii io.utf8 ;
|
||||
IN: http
|
||||
|
||||
: header-line ( line -- )
|
||||
|
@ -22,16 +22,13 @@ IN: http
|
|||
over digit? or
|
||||
swap "/_-." member? or ; foldable
|
||||
|
||||
: push-utf8 ( string -- )
|
||||
1string encode-utf8 [ CHAR: % , >hex 2 CHAR: 0 pad-left % ] each ;
|
||||
|
||||
: url-encode ( str -- str )
|
||||
[
|
||||
[
|
||||
dup url-quotable? [
|
||||
,
|
||||
] [
|
||||
CHAR: % , >hex 2 CHAR: 0 pad-left %
|
||||
] if
|
||||
] each
|
||||
] "" make ;
|
||||
[ [
|
||||
dup url-quotable? [ , ] [ push-utf8 ] if
|
||||
] each ] "" make ;
|
||||
|
||||
: url-decode-hex ( index str -- )
|
||||
2dup length 2 - >= [
|
||||
|
@ -58,7 +55,7 @@ IN: http
|
|||
] if ;
|
||||
|
||||
: url-decode ( str -- str )
|
||||
[ 0 swap url-decode-iter ] "" make ;
|
||||
[ 0 swap url-decode-iter ] "" make decode-utf8 ;
|
||||
|
||||
: hash>query ( hash -- str )
|
||||
[ [ url-encode ] 2apply "=" swap 3append ] { } assoc>map
|
||||
|
|
|
@ -25,7 +25,7 @@ M: template-lexer skip-word
|
|||
{
|
||||
{ [ 2dup nth CHAR: " = ] [ drop 1+ ] }
|
||||
{ [ 2dup swap tail-slice "%>" head? ] [ drop 2 + ] }
|
||||
{ [ t ] [ [ blank? ] skip ] }
|
||||
{ [ t ] [ f skip ] }
|
||||
} cond
|
||||
] change-column ;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ TUPLE: buffer size ptr fill pos ;
|
|||
dup buffer-ptr free f swap set-buffer-ptr ;
|
||||
|
||||
: buffer-reset ( n buffer -- )
|
||||
[ set-buffer-fill ] keep 0 swap set-buffer-pos ;
|
||||
0 swap { set-buffer-fill set-buffer-pos } set-slots ;
|
||||
|
||||
: buffer-consume ( n buffer -- )
|
||||
[ buffer-pos + ] keep
|
||||
|
|
|
@ -116,6 +116,15 @@ HELP: run-detached
|
|||
"The output value can be passed to " { $link wait-for-process } " to get an exit code."
|
||||
} ;
|
||||
|
||||
HELP: kill-process
|
||||
{ $values { "process" process } }
|
||||
{ $description "Kills a running process. Does nothing if the process has already exited." } ;
|
||||
|
||||
HELP: kill-process*
|
||||
{ $values { "handle" "a process handle" } }
|
||||
{ $contract "Kills a running process." }
|
||||
{ $notes "User code should call " { $link kill-process } " intead." } ;
|
||||
|
||||
HELP: process
|
||||
{ $class-description "A class representing an active or finished process."
|
||||
$nl
|
||||
|
@ -166,6 +175,8 @@ $nl
|
|||
"The following words are used to launch processes:"
|
||||
{ $subsection run-process }
|
||||
{ $subsection run-detached }
|
||||
"Stopping processes:"
|
||||
{ $subsection kill-process }
|
||||
"Redirecting standard input and output to a pipe:"
|
||||
{ $subsection <process-stream> }
|
||||
{ $subsection with-process-stream }
|
||||
|
|
|
@ -84,6 +84,11 @@ HOOK: run-process* io-backend ( desc -- handle )
|
|||
: run-detached ( desc -- process )
|
||||
>descriptor H{ { +detached+ t } } union run-process ;
|
||||
|
||||
HOOK: kill-process* io-backend ( handle -- )
|
||||
|
||||
: kill-process ( process -- )
|
||||
process-handle [ kill-process* ] when* ;
|
||||
|
||||
HOOK: process-stream* io-backend ( desc -- stream process )
|
||||
|
||||
TUPLE: process-stream process ;
|
||||
|
|
|
@ -1,11 +1,39 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: io.backend kernel continuations ;
|
||||
USING: io.backend kernel continuations namespaces sequences
|
||||
assocs hashtables sorting arrays ;
|
||||
IN: io.monitor
|
||||
|
||||
<PRIVATE
|
||||
|
||||
TUPLE: monitor queue closed? ;
|
||||
|
||||
: check-monitor ( monitor -- )
|
||||
monitor-closed? [ "Monitor closed" throw ] when ;
|
||||
|
||||
: (monitor) ( delegate -- monitor )
|
||||
H{ } clone {
|
||||
set-delegate
|
||||
set-monitor-queue
|
||||
} monitor construct ;
|
||||
|
||||
HOOK: fill-queue io-backend ( monitor -- assoc )
|
||||
|
||||
: changed-file ( changed path -- )
|
||||
namespace [ append ] change-at ;
|
||||
|
||||
: dequeue-change ( assoc -- path changes )
|
||||
delete-any prune natural-sort >array ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
HOOK: <monitor> io-backend ( path recursive? -- monitor )
|
||||
|
||||
HOOK: next-change io-backend ( monitor -- path changes )
|
||||
: next-change ( monitor -- path changed )
|
||||
dup check-monitor
|
||||
dup monitor-queue dup assoc-empty? [
|
||||
drop dup fill-queue over set-monitor-queue next-change
|
||||
] [ nip dequeue-change ] if ;
|
||||
|
||||
SYMBOL: +add-file+
|
||||
SYMBOL: +remove-file+
|
||||
|
|
|
@ -29,7 +29,7 @@ SYMBOL: log-stream
|
|||
|
||||
: with-log-file ( file quot -- )
|
||||
>r <file-appender> r>
|
||||
[ with-log-stream ] with-disposal ; inline
|
||||
[ with-log-stream ] curry with-disposal ; inline
|
||||
|
||||
: with-log-stdio ( quot -- )
|
||||
stdio get swap with-log-stream ;
|
||||
|
@ -47,11 +47,11 @@ SYMBOL: log-stream
|
|||
dup log-client
|
||||
[ swap with-stream ] 2curry concurrency:spawn drop ; inline
|
||||
|
||||
: accept-loop ( server quot -- server quot )
|
||||
: accept-loop ( server quot -- )
|
||||
[ swap accept with-client ] 2keep accept-loop ; inline
|
||||
|
||||
: server-loop ( server quot -- )
|
||||
[ accept-loop ] compose with-disposal ; inline
|
||||
[ accept-loop ] curry with-disposal ; inline
|
||||
|
||||
: spawn-server ( addrspec quot -- )
|
||||
"Waiting for connections on " pick unparse append
|
||||
|
|
|
@ -14,9 +14,9 @@ TUPLE: io-task port callbacks ;
|
|||
|
||||
: io-task-fd io-task-port port-handle ;
|
||||
|
||||
: <io-task> ( port continuation class -- task )
|
||||
>r 1vector io-task construct-boa r> construct-delegate ;
|
||||
inline
|
||||
: <io-task> ( port continuation/f class -- task )
|
||||
>r [ 1vector ] [ V{ } clone ] if* io-task construct-boa
|
||||
r> construct-delegate ; inline
|
||||
|
||||
TUPLE: input-task ;
|
||||
|
||||
|
@ -104,8 +104,21 @@ M: integer close-handle ( fd -- )
|
|||
: handle-io-task ( mx task -- )
|
||||
dup do-io-task [ pop-callbacks ] [ 2drop ] if ;
|
||||
|
||||
: handle-timeout ( mx task -- )
|
||||
"Timeout" over io-task-port report-error pop-callbacks ;
|
||||
: handle-timeout ( port mx assoc -- )
|
||||
>r swap port-handle r> delete-at* [
|
||||
"I/O operation cancelled" over io-task-port report-error
|
||||
pop-callbacks
|
||||
] [
|
||||
2drop
|
||||
] if ;
|
||||
|
||||
: cancel-io-tasks ( port mx -- )
|
||||
2dup
|
||||
dup mx-reads handle-timeout
|
||||
dup mx-writes handle-timeout ;
|
||||
|
||||
M: unix-io cancel-io ( port -- )
|
||||
mx get-global cancel-io-tasks ;
|
||||
|
||||
! Readers
|
||||
: reader-eof ( reader -- )
|
||||
|
@ -165,7 +178,7 @@ M: port port-flush ( port -- )
|
|||
dup buffer-empty? [ drop ] [ (wait-to-write) ] if ;
|
||||
|
||||
M: unix-io io-multiplex ( ms -- )
|
||||
mx get-global wait-for-events ;
|
||||
expire-timeouts mx get-global wait-for-events ;
|
||||
|
||||
M: unix-io init-stdio ( -- )
|
||||
0 1 handle>duplex-stream io:stdio set-global
|
||||
|
@ -181,7 +194,7 @@ TUPLE: mx-port mx ;
|
|||
TUPLE: mx-task ;
|
||||
|
||||
: <mx-task> ( port -- task )
|
||||
f io-task construct-boa mx-task construct-delegate ;
|
||||
f mx-task <io-task> ;
|
||||
|
||||
M: mx-task do-io-task
|
||||
io-task-port mx-port-mx 0 swap wait-for-events f ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2005, 2007 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: io.backend io.nonblocking io.unix.backend io.files io
|
||||
unix kernel math continuations ;
|
||||
unix kernel math continuations math.bitfields ;
|
||||
IN: io.unix.files
|
||||
|
||||
: read-flags O_RDONLY ; inline
|
||||
|
@ -12,7 +12,7 @@ IN: io.unix.files
|
|||
M: unix-io <file-reader> ( path -- stream )
|
||||
open-read <reader> ;
|
||||
|
||||
: write-flags O_WRONLY O_CREAT O_TRUNC bitor bitor ; inline
|
||||
: write-flags { O_WRONLY O_CREAT O_TRUNC } flags ; inline
|
||||
|
||||
: open-write ( path -- fd )
|
||||
write-flags file-mode open dup io-error ;
|
||||
|
@ -20,7 +20,7 @@ M: unix-io <file-reader> ( path -- stream )
|
|||
M: unix-io <file-writer> ( path -- stream )
|
||||
open-write <writer> ;
|
||||
|
||||
: append-flags O_WRONLY O_APPEND O_CREAT bitor bitor ; inline
|
||||
: append-flags { O_WRONLY O_APPEND O_CREAT } flags ; inline
|
||||
|
||||
: open-append ( path -- fd )
|
||||
append-flags file-mode open dup io-error
|
||||
|
|
|
@ -57,7 +57,8 @@ MEMO: 'arguments' ( -- parser )
|
|||
: setup-redirection ( -- )
|
||||
+stdin+ get read-flags 0 redirect
|
||||
+stdout+ get write-flags 1 redirect
|
||||
+stderr+ get write-flags 2 redirect ;
|
||||
+stderr+ get dup +stdout+ get eq?
|
||||
[ 1 2 dup2 ] [ write-flags 2 redirect ] if ;
|
||||
|
||||
: spawn-process ( -- )
|
||||
[
|
||||
|
@ -74,6 +75,9 @@ M: unix-io run-process* ( desc -- pid )
|
|||
[ spawn-process ] [ ] with-fork <process>
|
||||
] with-descriptor ;
|
||||
|
||||
M: unix-io kill-process* ( pid -- )
|
||||
SIGTERM kill io-error ;
|
||||
|
||||
: open-pipe ( -- pair )
|
||||
2 "int" <c-array> dup pipe zero?
|
||||
[ 2 c-int-array> ] [ drop f ] if ;
|
||||
|
|
|
@ -1,15 +1,141 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel io.backend io.monitor io.monitor.private io.files
|
||||
io.buffers io.nonblocking io.unix.backend io.unix.select
|
||||
io.unix.launcher unix.linux.inotify assocs namespaces threads
|
||||
continuations init math alien.c-types alien ;
|
||||
IN: io.unix.linux
|
||||
USING: io.backend io.unix.backend io.unix.launcher io.unix.select
|
||||
namespaces kernel assocs unix.process init ;
|
||||
|
||||
TUPLE: linux-io ;
|
||||
|
||||
INSTANCE: linux-io unix-io
|
||||
|
||||
TUPLE: linux-monitor path wd callback ;
|
||||
|
||||
: <linux-monitor> ( path wd -- monitor )
|
||||
f (monitor) {
|
||||
set-linux-monitor-path
|
||||
set-linux-monitor-wd
|
||||
set-delegate
|
||||
} linux-monitor construct ;
|
||||
|
||||
TUPLE: inotify watches ;
|
||||
|
||||
: watches ( -- assoc ) inotify get-global inotify-watches ;
|
||||
|
||||
: wd>monitor ( wd -- monitor ) watches at ;
|
||||
|
||||
: wd>path ( wd -- path ) wd>monitor linux-monitor-path ;
|
||||
|
||||
: <inotify> ( -- port )
|
||||
H{ } clone
|
||||
inotify_init dup io-error inotify <buffered-port>
|
||||
{ set-inotify-watches set-delegate } inotify construct ;
|
||||
|
||||
: inotify-fd inotify get-global port-handle ;
|
||||
|
||||
: (add-watch) ( path mask -- wd )
|
||||
inotify-fd -rot inotify_add_watch dup io-error ;
|
||||
|
||||
: check-existing ( wd -- )
|
||||
watches key? [
|
||||
"Cannot open multiple monitors for the same file" throw
|
||||
] when ;
|
||||
|
||||
: add-watch ( path mask -- monitor )
|
||||
dupd (add-watch)
|
||||
dup check-existing
|
||||
[ <linux-monitor> dup ] keep watches set-at ;
|
||||
|
||||
: remove-watch ( monitor -- )
|
||||
dup linux-monitor-wd watches delete-at
|
||||
linux-monitor-wd inotify-fd swap inotify_rm_watch io-error ;
|
||||
|
||||
M: linux-io <monitor> ( path recursive? -- monitor )
|
||||
drop IN_CHANGE_EVENTS add-watch ;
|
||||
|
||||
: notify-callback ( assoc monitor -- )
|
||||
linux-monitor-callback dup
|
||||
[ schedule-thread-with ] [ 2drop ] if ;
|
||||
|
||||
M: linux-io fill-queue ( monitor -- assoc )
|
||||
dup linux-monitor-callback [
|
||||
"Cannot wait for changes on the same file from multiple threads" throw
|
||||
] when
|
||||
[ swap set-linux-monitor-callback stop ] callcc1
|
||||
swap check-monitor ;
|
||||
|
||||
M: linux-monitor dispose ( monitor -- )
|
||||
dup check-monitor
|
||||
t over set-monitor-closed?
|
||||
H{ } over notify-callback
|
||||
remove-watch ;
|
||||
|
||||
: ?flag ( n mask symbol -- n )
|
||||
pick rot bitand 0 > [ , ] [ drop ] if ;
|
||||
|
||||
: parse-action ( mask -- changed )
|
||||
[
|
||||
IN_CREATE +add-file+ ?flag
|
||||
IN_DELETE +remove-file+ ?flag
|
||||
IN_DELETE_SELF +remove-file+ ?flag
|
||||
IN_MODIFY +modify-file+ ?flag
|
||||
IN_ATTRIB +modify-file+ ?flag
|
||||
IN_MOVED_FROM +rename-file+ ?flag
|
||||
IN_MOVED_TO +rename-file+ ?flag
|
||||
IN_MOVE_SELF +rename-file+ ?flag
|
||||
drop
|
||||
] { } make ;
|
||||
|
||||
: parse-file-notify ( buffer -- changed path )
|
||||
{
|
||||
inotify-event-wd
|
||||
inotify-event-name
|
||||
inotify-event-mask
|
||||
} get-slots
|
||||
parse-action -rot alien>char-string >r wd>path r> path+ ;
|
||||
|
||||
: events-exhausted? ( i buffer -- ? )
|
||||
buffer-fill >= ;
|
||||
|
||||
: inotify-event@ ( i buffer -- alien )
|
||||
buffer-ptr <displaced-alien> ;
|
||||
|
||||
: next-event ( i buffer -- i buffer )
|
||||
2dup inotify-event@
|
||||
inotify-event-len "inotify-event" heap-size +
|
||||
swap >r + r> ;
|
||||
|
||||
: wd>queue ( wd -- queue )
|
||||
inotify-event-wd wd>monitor monitor-queue ;
|
||||
|
||||
: parse-file-notifications ( i buffer -- )
|
||||
2dup events-exhausted? [ 2drop ] [
|
||||
2dup inotify-event@ dup inotify-event-wd wd>queue
|
||||
[ parse-file-notify changed-file ] bind
|
||||
next-event parse-file-notifications
|
||||
] if ;
|
||||
|
||||
: read-notifications ( port -- )
|
||||
dup refill drop
|
||||
0 over parse-file-notifications
|
||||
0 swap buffer-reset ;
|
||||
|
||||
TUPLE: inotify-task ;
|
||||
|
||||
: <inotify-task> ( port -- task )
|
||||
f inotify-task <input-task> ;
|
||||
|
||||
: init-inotify ( mx -- )
|
||||
<inotify>
|
||||
dup inotify set-global
|
||||
<inotify-task> swap register-io-task ;
|
||||
|
||||
M: inotify-task do-io-task ( task -- )
|
||||
io-task-port read-notifications f ;
|
||||
|
||||
M: linux-io init-io ( -- )
|
||||
<select-mx> mx set-global ;
|
||||
<select-mx> mx set-global ; ! init-inotify ;
|
||||
|
||||
T{ linux-io } set-io-backend
|
||||
|
||||
|
|
|
@ -48,10 +48,10 @@ TUPLE: CreateProcess-args
|
|||
} get-slots CreateProcess win32-error=0/f ;
|
||||
|
||||
: escape-argument ( str -- newstr )
|
||||
[ [ dup CHAR: " = [ CHAR: \\ , ] when , ] each ] "" make ;
|
||||
CHAR: \s over member? [ "\"" swap "\"" 3append ] when ;
|
||||
|
||||
: join-arguments ( args -- cmd-line )
|
||||
" " join ;
|
||||
[ escape-argument ] map " " join ;
|
||||
|
||||
: app-name/cmd-line ( -- app-name cmd-line )
|
||||
+command+ get [
|
||||
|
@ -118,11 +118,22 @@ TUPLE: CreateProcess-args
|
|||
: inherited-stderr ( args -- handle )
|
||||
drop STD_ERROR_HANDLE GetStdHandle ;
|
||||
|
||||
: duplicate-handle ( handle -- handle )
|
||||
GetCurrentProcess
|
||||
swap
|
||||
GetCurrentProcess
|
||||
f <void*> [
|
||||
0
|
||||
TRUE
|
||||
DUPLICATE_SAME_ACCESS
|
||||
DuplicateHandle win32-error=0/f
|
||||
] keep *void* ;
|
||||
|
||||
: redirect-stderr ( args -- handle )
|
||||
+stderr+ get
|
||||
dup +stdout+ eq? [
|
||||
drop
|
||||
CreateProcess-args-lpStartupInfo
|
||||
CreateProcess-args-lpStartupInfo duplicate-handle
|
||||
STARTUPINFO-hStdOutput
|
||||
] [
|
||||
GENERIC_WRITE CREATE_ALWAYS redirect
|
||||
|
@ -162,6 +173,10 @@ M: windows-io run-process* ( desc -- handle )
|
|||
] with-descriptor
|
||||
] with-destructors ;
|
||||
|
||||
M: windows-io kill-process* ( handle -- )
|
||||
PROCESS_INFORMATION-hProcess
|
||||
255 TerminateProcess win32-error=0/f ;
|
||||
|
||||
: dispose-process ( process-information -- )
|
||||
#! From MSDN: "Handles in PROCESS_INFORMATION must be closed
|
||||
#! with CloseHandle when they are no longer needed."
|
||||
|
|
|
@ -3,12 +3,10 @@
|
|||
USING: alien.c-types destructors io.windows
|
||||
io.windows.nt.backend kernel math windows windows.kernel32
|
||||
windows.types libc assocs alien namespaces continuations
|
||||
io.monitor io.nonblocking io.buffers io.files io sequences
|
||||
hashtables sorting arrays combinators ;
|
||||
io.monitor io.monitor.private io.nonblocking io.buffers io.files
|
||||
io sequences hashtables sorting arrays combinators ;
|
||||
IN: io.windows.nt.monitor
|
||||
|
||||
TUPLE: monitor path recursive? queue closed? ;
|
||||
|
||||
: open-directory ( path -- handle )
|
||||
FILE_LIST_DIRECTORY
|
||||
share-mode
|
||||
|
@ -22,23 +20,26 @@ TUPLE: monitor path recursive? queue closed? ;
|
|||
dup add-completion
|
||||
f <win32-file> ;
|
||||
|
||||
TUPLE: win32-monitor path recursive? ;
|
||||
|
||||
: <win32-monitor> ( path recursive? port -- monitor )
|
||||
(monitor) {
|
||||
set-win32-monitor-path
|
||||
set-win32-monitor-recursive?
|
||||
set-delegate
|
||||
} win32-monitor construct ;
|
||||
|
||||
M: windows-nt-io <monitor> ( path recursive? -- monitor )
|
||||
[
|
||||
>r dup open-directory monitor <buffered-port> r> {
|
||||
set-monitor-path
|
||||
set-delegate
|
||||
set-monitor-recursive?
|
||||
} monitor construct
|
||||
over open-directory win32-monitor <buffered-port>
|
||||
<win32-monitor>
|
||||
] with-destructors ;
|
||||
|
||||
: check-closed ( monitor -- )
|
||||
port-type closed eq? [ "Monitor closed" throw ] when ;
|
||||
|
||||
: begin-reading-changes ( monitor -- overlapped )
|
||||
dup port-handle win32-file-handle
|
||||
over buffer-ptr
|
||||
pick buffer-size
|
||||
roll monitor-recursive? 1 0 ?
|
||||
roll win32-monitor-recursive? 1 0 ?
|
||||
FILE_NOTIFY_CHANGE_ALL
|
||||
0 <uint>
|
||||
(make-overlapped)
|
||||
|
@ -49,6 +50,7 @@ M: windows-nt-io <monitor> ( path recursive? -- monitor )
|
|||
[
|
||||
dup begin-reading-changes
|
||||
swap [ save-callback ] 2keep
|
||||
dup check-monitor ! we may have closed it...
|
||||
get-overlapped-result
|
||||
] with-port-timeout
|
||||
] with-destructors ;
|
||||
|
@ -63,30 +65,19 @@ M: windows-nt-io <monitor> ( path recursive? -- monitor )
|
|||
{ [ t ] [ +modify-file+ ] }
|
||||
} cond nip ;
|
||||
|
||||
: changed-file ( directory buffer -- changed path )
|
||||
: parse-file-notify ( directory buffer -- changed path )
|
||||
{
|
||||
FILE_NOTIFY_INFORMATION-FileName
|
||||
FILE_NOTIFY_INFORMATION-FileNameLength
|
||||
FILE_NOTIFY_INFORMATION-Action
|
||||
} get-slots >r memory>u16-string path+ r> parse-action swap ;
|
||||
} get-slots parse-action 1array -rot
|
||||
memory>u16-string path+ ;
|
||||
|
||||
: (changed-files) ( directory buffer -- )
|
||||
2dup changed-file namespace [ swap add ] change-at
|
||||
2dup parse-file-notify changed-file
|
||||
dup FILE_NOTIFY_INFORMATION-NextEntryOffset dup zero?
|
||||
[ 3drop ] [ swap <displaced-alien> (changed-files) ] if ;
|
||||
|
||||
: changed-files ( directory buffer len -- assoc )
|
||||
M: windows-nt-io fill-queue ( monitor -- assoc )
|
||||
dup win32-monitor-path over buffer-ptr rot read-changes
|
||||
[ zero? [ 2drop ] [ (changed-files) ] if ] H{ } make-assoc ;
|
||||
|
||||
: fill-queue ( monitor -- )
|
||||
dup monitor-path over buffer-ptr pick read-changes
|
||||
changed-files
|
||||
swap set-monitor-queue ;
|
||||
|
||||
M: windows-nt-io next-change ( monitor -- path changes )
|
||||
dup check-closed
|
||||
dup monitor-queue dup assoc-empty? [
|
||||
drop dup fill-queue next-change
|
||||
] [
|
||||
nip delete-any prune natural-sort >array
|
||||
] if ;
|
||||
|
|
|
@ -5,7 +5,7 @@ io.buffers io.files io.nonblocking io.sockets io.binary
|
|||
io.sockets.impl windows.errors strings io.streams.duplex kernel
|
||||
math namespaces sequences windows windows.kernel32
|
||||
windows.shell32 windows.types windows.winsock splitting
|
||||
continuations ;
|
||||
continuations math.bitfields ;
|
||||
IN: io.windows
|
||||
|
||||
TUPLE: windows-nt-io ;
|
||||
|
@ -31,8 +31,11 @@ M: windows-io normalize-directory ( string -- string )
|
|||
"\\" ?tail drop "\\*" append ;
|
||||
|
||||
: share-mode ( -- fixnum )
|
||||
FILE_SHARE_READ FILE_SHARE_WRITE bitor
|
||||
FILE_SHARE_DELETE bitor ; foldable
|
||||
{
|
||||
FILE_SHARE_READ
|
||||
FILE_SHARE_WRITE
|
||||
FILE_SHARE_DELETE
|
||||
} flags ; foldable
|
||||
|
||||
: default-security-attributes ( -- obj )
|
||||
"SECURITY_ATTRIBUTES" <c-object>
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Eduardo Cavazos
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
USING: kernel quotations arrays sequences sequences.private macros ;
|
||||
|
||||
IN: macros.zoo
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
! MACRO: narray ( n -- quot )
|
||||
! dup [ f <array> ] curry
|
||||
! swap <reversed> [
|
||||
! [ swap [ set-nth-unsafe ] keep ] curry
|
||||
! ] map concat append ;
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
! MACRO: map-call-with ( quots -- )
|
||||
! [ [ [ keep ] curry ] map concat ] keep length [ nip narray ] curry compose ;
|
||||
|
||||
! MACRO: map-call-with2 ( quots -- )
|
||||
! dup >r
|
||||
! [ [ 2dup >r >r ] swap append [ r> r> ] append ] map concat
|
||||
! [ 2drop ] append
|
||||
! r> length [ narray ] curry append ;
|
||||
|
||||
! MACRO: map-exec-with ( words -- ) [ 1quotation ] map [ map-call-with ] curry ;
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
! Conceptual implementation:
|
||||
|
||||
! : pcall ( seq quots -- seq ) [ call ] 2map ;
|
||||
|
||||
! MACRO: pcall ( quots -- )
|
||||
! [ [ unclip ] swap append ] map
|
||||
! [ [ r> swap add >r ] append ] map
|
||||
! concat
|
||||
! [ { } >r ] swap append ! pre
|
||||
! [ drop r> ] append ; ! post
|
|
@ -1,11 +1,11 @@
|
|||
! Copyright (C) 2005, 2007 Slava Pestov.
|
||||
! Copyright (C) 2005, 2008 Slava Pestov.
|
||||
! Portions copyright (C) 2007 Eduardo Cavazos.
|
||||
! Portions copyright (C) 2008 Joe Groff.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien alien.c-types continuations kernel libc math macros
|
||||
namespaces math.vectors math.constants math.functions
|
||||
math.parser opengl.gl opengl.glu combinators arrays sequences
|
||||
splitting words byte-arrays ;
|
||||
splitting words byte-arrays assocs ;
|
||||
IN: opengl
|
||||
|
||||
: coordinates [ first2 ] 2apply ;
|
||||
|
@ -233,7 +233,8 @@ TUPLE: sprite loc dim dim2 dlist texture ;
|
|||
dup sprite-dlist delete-dlist
|
||||
sprite-texture delete-texture ;
|
||||
|
||||
: free-sprites ( sprites -- ) [ [ free-sprite ] when* ] each ;
|
||||
: free-sprites ( sprites -- )
|
||||
[ nip [ free-sprite ] when* ] assoc-each ;
|
||||
|
||||
: with-translation ( loc quot -- )
|
||||
GL_MODELVIEW [ >r gl-translate r> call ] do-matrix ; inline
|
||||
|
|
|
@ -100,7 +100,7 @@ M: ebnf (generate-parser) ( ast -- id )
|
|||
DEFER: 'rhs'
|
||||
|
||||
: 'non-terminal' ( -- parser )
|
||||
CHAR: a CHAR: z range repeat1 [ >string <ebnf-non-terminal> ] action ;
|
||||
CHAR: a CHAR: z range "-" token [ first ] action 2array choice repeat1 [ >string <ebnf-non-terminal> ] action ;
|
||||
|
||||
: 'terminal' ( -- parser )
|
||||
"'" token hide [ CHAR: ' = not ] satisfy repeat1 "'" token hide 3array seq [ first >string <ebnf-terminal> ] action ;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Chris Double
|
|
@ -1 +0,0 @@
|
|||
Chris Double
|
|
@ -1,120 +0,0 @@
|
|||
! Copyright (C) 2005 Chris Double, Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
!
|
||||
! An interface to the sqlite database. Tested against sqlite v3.1.3.
|
||||
! Remeber to pass the following to factor:
|
||||
! -libraries:sqlite=libsqlite3.so
|
||||
!
|
||||
! Not all functions have been wrapped yet. Only those directly involving
|
||||
! executing SQL calls and obtaining results.
|
||||
!
|
||||
IN: sqlite.lib
|
||||
USING: alien compiler kernel math namespaces sequences strings alien.syntax
|
||||
system combinators ;
|
||||
|
||||
<<
|
||||
"sqlite" {
|
||||
{ [ win32? ] [ "sqlite3.dll" ] }
|
||||
{ [ macosx? ] [ "/usr/lib/libsqlite3.dylib" ] }
|
||||
{ [ unix? ] [ "libsqlite3.so" ] }
|
||||
} cond "cdecl" add-library
|
||||
>>
|
||||
|
||||
! Return values from sqlite functions
|
||||
: SQLITE_OK 0 ; inline ! Successful result
|
||||
: SQLITE_ERROR 1 ; inline ! SQL error or missing database
|
||||
: SQLITE_INTERNAL 2 ; inline ! An internal logic error in SQLite
|
||||
: SQLITE_PERM 3 ; inline ! Access permission denied
|
||||
: SQLITE_ABORT 4 ; inline ! Callback routine requested an abort
|
||||
: SQLITE_BUSY 5 ; inline ! The database file is locked
|
||||
: SQLITE_LOCKED 6 ; inline ! A table in the database is locked
|
||||
: SQLITE_NOMEM 7 ; inline ! A malloc() failed
|
||||
: SQLITE_READONLY 8 ; inline ! Attempt to write a readonly database
|
||||
: SQLITE_INTERRUPT 9 ; inline ! Operation terminated by sqlite_interrupt()
|
||||
: SQLITE_IOERR 10 ; inline ! Some kind of disk I/O error occurred
|
||||
: SQLITE_CORRUPT 11 ; inline ! The database disk image is malformed
|
||||
: SQLITE_NOTFOUND 12 ; inline ! (Internal Only) Table or record not found
|
||||
: SQLITE_FULL 13 ; inline ! Insertion failed because database is full
|
||||
: SQLITE_CANTOPEN 14 ; inline ! Unable to open the database file
|
||||
: SQLITE_PROTOCOL 15 ; inline ! Database lock protocol error
|
||||
: SQLITE_EMPTY 16 ; inline ! (Internal Only) Database table is empty
|
||||
: SQLITE_SCHEMA 17 ; inline ! The database schema changed
|
||||
: SQLITE_TOOBIG 18 ; inline ! Too much data for one row of a table
|
||||
: SQLITE_CONSTRAINT 19 ; inline ! Abort due to contraint violation
|
||||
: SQLITE_MISMATCH 20 ; inline ! Data type mismatch
|
||||
: SQLITE_MISUSE 21 ; inline ! Library used incorrectly
|
||||
: SQLITE_NOLFS 22 ; inline ! Uses OS features not supported on host
|
||||
: SQLITE_AUTH 23 ; inline ! Authorization denied
|
||||
: SQLITE_FORMAT 24 ; inline ! Auxiliary database format error
|
||||
: SQLITE_RANGE 25 ; inline ! 2nd parameter to sqlite3_bind out of range
|
||||
: SQLITE_NOTADB 26 ; inline ! File opened that is not a database file
|
||||
|
||||
: sqlite-error-messages ( -- seq ) {
|
||||
"Successful result"
|
||||
"SQL error or missing database"
|
||||
"An internal logic error in SQLite"
|
||||
"Access permission denied"
|
||||
"Callback routine requested an abort"
|
||||
"The database file is locked"
|
||||
"A table in the database is locked"
|
||||
"A malloc() failed"
|
||||
"Attempt to write a readonly database"
|
||||
"Operation terminated by sqlite_interrupt()"
|
||||
"Some kind of disk I/O error occurred"
|
||||
"The database disk image is malformed"
|
||||
"(Internal Only) Table or record not found"
|
||||
"Insertion failed because database is full"
|
||||
"Unable to open the database file"
|
||||
"Database lock protocol error"
|
||||
"(Internal Only) Database table is empty"
|
||||
"The database schema changed"
|
||||
"Too much data for one row of a table"
|
||||
"Abort due to contraint violation"
|
||||
"Data type mismatch"
|
||||
"Library used incorrectly"
|
||||
"Uses OS features not supported on host"
|
||||
"Authorization denied"
|
||||
"Auxiliary database format error"
|
||||
"2nd parameter to sqlite3_bind out of range"
|
||||
"File opened that is not a database file"
|
||||
} ;
|
||||
|
||||
: SQLITE_ROW 100 ; inline ! sqlite_step() has another row ready
|
||||
: SQLITE_DONE 101 ; inline ! sqlite_step() has finished executing
|
||||
|
||||
! Return values from the sqlite3_column_type function
|
||||
: SQLITE_INTEGER 1 ; inline
|
||||
: SQLITE_FLOAT 2 ; inline
|
||||
: SQLITE_TEXT 3 ; inline
|
||||
: SQLITE_BLOB 4 ; inline
|
||||
: SQLITE_NULL 5 ; inline
|
||||
|
||||
! Values for the 'destructor' parameter of the 'bind' routines.
|
||||
: SQLITE_STATIC 0 ; inline
|
||||
: SQLITE_TRANSIENT -1 ; inline
|
||||
|
||||
TYPEDEF: void sqlite3
|
||||
TYPEDEF: void sqlite3_stmt
|
||||
|
||||
LIBRARY: sqlite
|
||||
FUNCTION: int sqlite3_open ( char* filename, void* ppDb ) ;
|
||||
FUNCTION: int sqlite3_close ( sqlite3* pDb ) ;
|
||||
FUNCTION: int sqlite3_prepare ( sqlite3* pDb, char* zSql, int nBytes, void* ppStmt, void* pzTail ) ;
|
||||
FUNCTION: int sqlite3_finalize ( sqlite3_stmt* pStmt ) ;
|
||||
FUNCTION: int sqlite3_reset ( sqlite3_stmt* pStmt ) ;
|
||||
FUNCTION: int sqlite3_step ( sqlite3_stmt* pStmt ) ;
|
||||
FUNCTION: int sqlite3_last_insert_rowid ( sqlite3* pStmt ) ;
|
||||
FUNCTION: int sqlite3_bind_blob ( sqlite3_stmt* pStmt, int index, void* ptr, int len, int destructor ) ;
|
||||
FUNCTION: int sqlite3_bind_int ( sqlite3_stmt* pStmt, int index, int n ) ;
|
||||
FUNCTION: int sqlite3_bind_null ( sqlite3_stmt* pStmt, int n ) ;
|
||||
FUNCTION: int sqlite3_bind_text ( sqlite3_stmt* pStmt, int index, char* text, int len, int destructor ) ;
|
||||
FUNCTION: int sqlite3_bind_parameter_index ( sqlite3_stmt* pStmt, char* name ) ;
|
||||
FUNCTION: int sqlite3_column_count ( sqlite3_stmt* pStmt ) ;
|
||||
FUNCTION: void* sqlite3_column_blob ( sqlite3_stmt* pStmt, int col ) ;
|
||||
FUNCTION: int sqlite3_column_bytes ( sqlite3_stmt* pStmt, int col ) ;
|
||||
FUNCTION: char* sqlite3_column_decltype ( sqlite3_stmt* pStmt, int col ) ;
|
||||
FUNCTION: int sqlite3_column_int ( sqlite3_stmt* pStmt, int col ) ;
|
||||
FUNCTION: int sqlite3_column_name ( sqlite3_stmt* pStmt, int col ) ;
|
||||
FUNCTION: char* sqlite3_column_text ( sqlite3_stmt* pStmt, int col ) ;
|
||||
FUNCTION: int sqlite3_column_type ( sqlite3_stmt* pStmt, int col ) ;
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
! Copyright (C) 2006 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help help.syntax help.markup ;
|
||||
IN: sqlite
|
||||
|
||||
HELP: sqlite-open
|
||||
{ $values { "filename" "path to sqlite database" }
|
||||
{ "db" "the database object" }
|
||||
}
|
||||
{ $description "Opens the sqlite3 database." }
|
||||
{ $see-also sqlite-close sqlite-last-insert-rowid } ;
|
||||
|
||||
HELP: sqlite-close
|
||||
{ $values { "db" "the database object" }
|
||||
}
|
||||
{ $description "Closes the sqlite3 database." }
|
||||
{ $see-also sqlite-open sqlite-last-insert-rowid } ;
|
||||
|
||||
HELP: sqlite-last-insert-rowid
|
||||
{ $values { "db" "the database object" }
|
||||
{ "rowid" "the row number of the last insert" }
|
||||
}
|
||||
{ $description "Returns the number of the row of the last statement inserted into the database." }
|
||||
{ $see-also sqlite-open sqlite-close } ;
|
||||
|
||||
HELP: sqlite-prepare
|
||||
{ $values { "db" "the database object" }
|
||||
{ "sql" "the SQL statement as a string" }
|
||||
{ "statement" "the prepared SQL statement" }
|
||||
}
|
||||
{ $description "Internally compiles the SQL statement ready to be run by sqlite. The statement is executed and the results iterated over using " { $link sqlite-each } " and " { $link sqlite-map } ". The SQL statement can use named parameters which are later bound to values using " { $link sqlite-bind-text } " and " { $link sqlite-bind-text-by-name } "." }
|
||||
{ $see-also sqlite-open sqlite-close } ;
|
||||
|
||||
HELP: sqlite-bind-text
|
||||
{ $values { "statement" "a prepared SQL statement" }
|
||||
{ "index" "the index of the bound parameter in the SQL statement" }
|
||||
{ "text" "the string value to bind to that column" }
|
||||
|
||||
}
|
||||
{ $description "Binds the text to a parameter in the SQL statement. The parameter to be bound is identified by the index given and the indexes start from one." }
|
||||
{ $examples { $code "\"people.db\" sqlite-open\n\"select * from people where name=?\" sqlite-prepare\n1 \"chris\" sqlite-bind-text" } }
|
||||
{ $see-also sqlite-bind-text-by-name } ;
|
||||
|
||||
HELP: sqlite-bind-text-by-name
|
||||
{ $values { "statement" "a prepared SQL statement" }
|
||||
{ "name" "the name of the bound parameter in the SQL statement" }
|
||||
{ "text" "the string value to bind to that column" }
|
||||
|
||||
}
|
||||
{ $description "Binds the text to a parameter in the SQL statement. The parameter to be bound is identified by the given name." }
|
||||
{ $examples { $code "\"people.db\" sqlite-open\n\"select * from people where name=:name\" sqlite-prepare\n\"name\" \"chris\" sqlite-bind-text" } }
|
||||
{ $see-also sqlite-bind-text } ;
|
||||
|
||||
HELP: sqlite-finalize
|
||||
{ $values { "statement" "a prepared SQL statement" }
|
||||
}
|
||||
{ $description "Clean up all resources related to a statement. Once called the statement cannot be used again. All statements must be finalized before closing the database." }
|
||||
{ $see-also sqlite-close sqlite-prepare } ;
|
||||
|
||||
HELP: sqlite-reset
|
||||
{ $values { "statement" "a prepared SQL statement" }
|
||||
}
|
||||
{ $description "Reset a statement so it can be called again, possibly with different bound parameters." }
|
||||
{ $see-also sqlite-bind-text sqlite-bind-text-by-name } ;
|
||||
|
||||
HELP: column-count
|
||||
{ $values { "statement" "a prepared SQL statement" } { "int" "the number of columns" } }
|
||||
{ $description "Return the number of columns in each row of the result set of the given statement." }
|
||||
{ $see-also column-text sqlite-each sqlite-map } ;
|
||||
|
||||
HELP: column-text
|
||||
{ $values { "statement" "a prepared SQL statement" } { "index" "column number indexed from zero" } { "string" "column value" }
|
||||
}
|
||||
{ $description "Return the value of the given column, indexed from zero, as a string." }
|
||||
{ $see-also column-count sqlite-each sqlite-map } ;
|
||||
|
||||
HELP: sqlite-each
|
||||
{ $values { "statement" "a prepared SQL statement" } { "quot" "A quotation with stack effect ( statement -- )" }
|
||||
}
|
||||
{ $description "Executes the SQL statement and for each returned row calls the qutotation passing the statement on the stack. The quotation can use " { $link column-text } " to get result values for that row." }
|
||||
{ $see-also column-count column-text sqlite-map } ;
|
||||
|
||||
HELP: sqlite-map
|
||||
{ $values { "statement" "a prepared SQL statement" } { "quot" "A quotation with stack effect ( statement -- value )" } { "seq" "a new sequence" }
|
||||
}
|
||||
{ $description "Executes the SQL statement and for each returned row calls the qutotation passing the statement on the stack. The quotation can use " { $link column-text } " to get result values for that row. The quotation should leave a value on the stack which gets collected and returned in the resulting sequence." }
|
||||
{ $see-also column-count column-text sqlite-each } ;
|
|
@ -1,69 +0,0 @@
|
|||
! Copyright (C) 2005 Chris Double.
|
||||
!
|
||||
! Redistribution and use in source and binary forms, with or without
|
||||
! modification, are permitted provided that the following conditions are met:
|
||||
!
|
||||
! 1. Redistributions of source code must retain the above copyright notice,
|
||||
! this list of conditions and the following disclaimer.
|
||||
!
|
||||
! 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
! this list of conditions and the following disclaimer in the documentation
|
||||
! and/or other materials provided with the distribution.
|
||||
!
|
||||
! THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
! INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
! FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
! DEVELOPERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
! SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
! OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
! WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
! OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
! ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
!
|
||||
! Test the sqlite interface
|
||||
!
|
||||
! Create a test database like follows:
|
||||
!
|
||||
! sqlite3 test.db < test.txt
|
||||
!
|
||||
! Then run this file.
|
||||
USE: sqlite
|
||||
USE: kernel
|
||||
USE: io
|
||||
USE: io.files
|
||||
USE: prettyprint
|
||||
|
||||
: test.db "libs/sqlite/test.db" resource-path ;
|
||||
|
||||
: show-people ( statement -- )
|
||||
dup 0 column-text write " from " write 1 column-text . ;
|
||||
|
||||
: run-test ( -- )
|
||||
test.db sqlite-open
|
||||
dup "select * from test" sqlite-prepare
|
||||
dup [ show-people ] sqlite-each
|
||||
sqlite-finalize
|
||||
sqlite-close ;
|
||||
|
||||
: find-person ( name -- )
|
||||
test.db sqlite-open ! name db
|
||||
dup "select * from test where name=?" sqlite-prepare ! name db stmt
|
||||
[ rot 1 swap sqlite-bind-text ] keep ! db stmt
|
||||
[ [ 1 column-text . ] sqlite-each ] keep
|
||||
sqlite-finalize
|
||||
sqlite-close ;
|
||||
|
||||
: find-all ( -- )
|
||||
test.db sqlite-open ! db
|
||||
dup "select * from test" sqlite-prepare ! db stmt
|
||||
[ [ [ 0 column-text ] keep 1 column-text curry ] sqlite-map ] keep
|
||||
sqlite-finalize
|
||||
swap sqlite-close ;
|
||||
|
||||
: run-test2 ( -- )
|
||||
test.db sqlite-open
|
||||
dup "select * from test" sqlite-prepare
|
||||
dup [ show-people ] ;
|
||||
|
||||
run-test
|
|
@ -1,127 +0,0 @@
|
|||
! Copyright (C) 2005 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
!
|
||||
! An interface to the sqlite database. Tested against sqlite v3.0.8.
|
||||
!
|
||||
! Not all functions have been wrapped yet. Only those directly involving
|
||||
! executing SQL calls and obtaining results.
|
||||
!
|
||||
IN: sqlite
|
||||
USING: alien compiler kernel namespaces sequences strings sqlite.lib
|
||||
alien.c-types continuations ;
|
||||
|
||||
TUPLE: sqlite-error n message ;
|
||||
SYMBOL: db
|
||||
|
||||
! High level sqlite routines
|
||||
: sqlite-check-result ( result -- )
|
||||
#! Check the result from a sqlite call is ok. If it is
|
||||
#! return, otherwise throw an error.
|
||||
dup SQLITE_OK = [
|
||||
drop
|
||||
] [
|
||||
dup sqlite-error-messages nth
|
||||
\ sqlite-error construct-boa throw
|
||||
] if ;
|
||||
|
||||
: sqlite-open ( filename -- db )
|
||||
#! Open the database referenced by the filename and return
|
||||
#! a handle to that database. An error is thrown if the database
|
||||
#! failed to open.
|
||||
"void*" <c-object> [ sqlite3_open sqlite-check-result ] keep *void* ;
|
||||
|
||||
: sqlite-close ( db -- )
|
||||
#! Close the given database
|
||||
sqlite3_close sqlite-check-result ;
|
||||
|
||||
: sqlite-last-insert-rowid ( db -- rowid )
|
||||
#! Return the rowid of the last insert
|
||||
sqlite3_last_insert_rowid ;
|
||||
|
||||
: sqlite-prepare ( db sql -- statement )
|
||||
#! Prepare a SQL statement. Returns the statement which
|
||||
#! can have values bound to parameters or simply executed.
|
||||
#! TODO: Support multiple statements in the SQL string.
|
||||
dup length "void*" <c-object> "void*" <c-object>
|
||||
[ sqlite3_prepare sqlite-check-result ] 2keep
|
||||
drop *void* ;
|
||||
|
||||
: sqlite-bind-text ( statement index text -- )
|
||||
#! Bind the text to the parameterized value in the statement.
|
||||
dup length SQLITE_TRANSIENT sqlite3_bind_text sqlite-check-result ;
|
||||
|
||||
: sqlite-bind-parameter-index ( statement name -- index )
|
||||
sqlite3_bind_parameter_index ;
|
||||
|
||||
: sqlite-bind-text-by-name ( statement name text -- )
|
||||
>r dupd sqlite-bind-parameter-index r> sqlite-bind-text ;
|
||||
|
||||
: sqlite-finalize ( statement -- )
|
||||
#! Clean up all resources related to a statement. Once called
|
||||
#! the statement cannot be used. All statements must be finalized
|
||||
#! before closing the database.
|
||||
sqlite3_finalize sqlite-check-result ;
|
||||
|
||||
: sqlite-reset ( statement -- )
|
||||
#! Reset a statement so it can be called again, possibly with
|
||||
#! different parameters.
|
||||
sqlite3_reset sqlite-check-result ;
|
||||
|
||||
: column-count ( statement -- int )
|
||||
#! Given a prepared statement, return the number of
|
||||
#! columns in each row of the result set of that statement.
|
||||
sqlite3_column_count ;
|
||||
|
||||
: column-text ( statement index -- string )
|
||||
#! Return the value of the given column, indexed
|
||||
#! from zero, as a string.
|
||||
sqlite3_column_text ;
|
||||
|
||||
: step-complete? ( step-result -- bool )
|
||||
#! Return true if the result of a sqlite3_step is
|
||||
#! such that the iteration has completed (ie. it is
|
||||
#! SQLITE_DONE). Throw an error if an error occurs.
|
||||
dup SQLITE_ROW = [
|
||||
drop f
|
||||
] [
|
||||
dup SQLITE_DONE = [
|
||||
drop t
|
||||
] [
|
||||
sqlite-check-result t
|
||||
] if
|
||||
] if ;
|
||||
|
||||
: sqlite-each ( statement quot -- )
|
||||
#! Execute the SQL statement, and call the quotation for
|
||||
#! each row returned from executing the statement with the
|
||||
#! statement on the top of the stack.
|
||||
over sqlite3_step step-complete? [
|
||||
2drop
|
||||
] [
|
||||
[ call ] 2keep sqlite-each
|
||||
] if ; inline
|
||||
|
||||
! For comparison, here is the linrec implementation of sqlite-each
|
||||
! [ drop sqlite3_step step-complete? ]
|
||||
! [ 2drop ]
|
||||
! [ 2dup 2slip ]
|
||||
! [ ] linrec ;
|
||||
|
||||
DEFER: (sqlite-map)
|
||||
|
||||
: (sqlite-map) ( statement quot seq -- )
|
||||
pick sqlite3_step step-complete? [
|
||||
2nip
|
||||
] [
|
||||
>r 2dup call r> swap add (sqlite-map)
|
||||
] if ;
|
||||
|
||||
: sqlite-map ( statement quot -- seq )
|
||||
{ } (sqlite-map) ;
|
||||
|
||||
: with-sqlite ( path quot -- )
|
||||
[
|
||||
>r sqlite-open db set r>
|
||||
[ db get sqlite-close ] [ ] cleanup
|
||||
] with-scope ;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
create table test (name varchar(30), address varchar(30));
|
||||
insert into test values('John', 'America');
|
||||
insert into test values('Jane', 'New Zealand');
|
|
@ -1 +0,0 @@
|
|||
Chris Double
|
|
@ -1,131 +0,0 @@
|
|||
! Copyright (C) 2006 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help sqlite help.syntax help.markup ;
|
||||
IN: sqlite.tuple-db
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-loading" } "Loading"
|
||||
"The quickest way to get up and running with this library is to use the vocabulary:"
|
||||
{ $code "USING: sqlite sqlite.tuple-db ;\n" }
|
||||
"Some simple tests can be run to check that everything is working ok:"
|
||||
{ $code "\"libs/sqlite\" test-module" } ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-usage" } "Basic Usage"
|
||||
"This library can be used for storing simple Factor tuples in a sqlite database. In its current form the tuples must not contain references to other tuples and should not have a delegate set."
|
||||
$nl
|
||||
"This document will use the following tuple for demonstration purposes:"
|
||||
{ $code "TUPLE: person name surname phone ;" }
|
||||
"The sqlite database to store tuples must be created, or an existing one opened. This is done using the " { $link sqlite-open } " word. If the database does not exist then it is created. The examples in this document store the database pointer in a variable called 'db':"
|
||||
{ $code "SYMBOL: db\n\"example.db\" sqlite-open db set-global" } ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-mappings" } "Tuple Mappings"
|
||||
"Each tuple has a 'mapping' tuple associated with it. The 'mapping' stores information about what table the tuple will be stored in, the datatypes of the tuple slots, etc. A mapping must be created before a tuple can be stored in a database. A default mapping is easily created using " { $link default-mapping } ". Given the tuple class, this will use reflection to get the slots of it, assume that all slots are of database type 'text', and store the tuple objects in a table with the same name as the tuple."
|
||||
$nl
|
||||
"The following shows how to create the default mapping for the 'person' tuple, and how to register that mapping so the 'tuple-db' system can know how to handle 'person' instances:"
|
||||
{ $code "person default-mapping set-mapping" } ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-create" } "Creating the table"
|
||||
"The table used to store tuple instances may need to be created. This can be done manually using the external sqlite program or via " { $link create-tuple-table } ":"
|
||||
{ $code "db get person create-tuple-table" }
|
||||
"The SQL used to create the table is produced internally by " { $link create-sql } ". This is a generic word dispatched on the mapping object, and could be specialised if needed. If you wish to see the SQL used to create the table, use the following code:"
|
||||
{ $code "person get-mapping create-sql .\n => \"create table person (name text,surname text,phone text);\"" } ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-insert" } "Inserting instances"
|
||||
"The " { $link insert-tuple } " word will store instances of a tuple into the database table defined by its mapping object:"
|
||||
{ $code "db get \"John\" \"Smith\" \"123-456-789\" <person> insert-tuple" }
|
||||
{ $link insert-tuple } " internally uses the " { $link insert-sql } " word to produce the SQL used to store the tuple. Like " { $link create-sql } ", it is a generic word specialized on the mapping object. You can call it directly to see what SQL is generated:"
|
||||
{ $code "person get-mapping insert-sql .\n => \"insert into person values(:name,:surname,:phone);\"" }
|
||||
"Notice that the SQL uses named parameters. These parameters are bound to the values stored in the tuple object when the SQL is compiled. This helps prevent SQL injection techniques."
|
||||
$nl
|
||||
"When " { $link insert-sql } " is run, it adds a delegate to the tuple being stored. The delegate is of type 'persistent' and holds the row id of the tuple in its 'key' slot. This way the exact record can be updated or retrieved later. The following demonstates this fact:"
|
||||
{ $code "\"Mandy\" \"Jones\" \"987-654-321\" <person> dup .\n => T{ person f \"Mandy\" \"Jones\" \"987-654-321\" }\ndb get over insert-tuple .\n => T{ person T{ persistent ... 2 } \"Mandy\" \"Jones\" \"987-654-321\" }" }
|
||||
"The '2' in the above example is the row id of the record inserted. We can go into the 'sqlite' command and view this record:"
|
||||
{ $code " $ sqlite3 example.db\n SQLite version 3.0.8\n Enter \".help\" for instructions\n sqlite> select ROWID,* from person;\n 1|John|Smith|123-456-789\n 2|Mandy|Jones|987-654-321\n sqlite>" } ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-finding" } "Finding instances"
|
||||
"The " { $link find-tuples } " word is used to return tuples populated with data already existing in the database. As well as the database objcet, it takes a tuple that should be populated only with the fields that should be matched in the database. All fields you do not wish to match against should be set to 'f':"
|
||||
{ $code "db get f \"Smith\" f <person> find-tuples .\n => { T{ person # \"John\" \"Smith\" \"123-456-789\" } }\ndb get \"Mandy\" f f <person> find-tuples .\n => { T{ person # \"Mandy\" \"Jones\" \"987-654-321\" } }\ndb get \"Joe\" f f <person> find-tuples .\n => { }" }
|
||||
"Notice that if no matching tuples are found then an empty sequence is returned. The returned tuples also have their delegate set to 'persistent' with the correct row id set as the key. This can be used to later update the tuples with new information and store them in the database." ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-updating" } "Updating instances"
|
||||
"Given a tuple that has the 'persistent' delegate with the row id set as the key, you can update this specific record using " { $link update-tuple } ":"
|
||||
{ $code "db get f \"Smith\" f <person> find-tuples dup .\n => { T{ person # \"John\" \"Smith\" \"123-456-789\" } }\nfirst { \"999-999-999\" swap set-person-phone ] keep dup .\n => T{ person T{ persistent f # \"1\" } \"John\" \"Smith\" \"999-999-999\" ...\n db get swap update-tuple" }
|
||||
"Using the 'sqlite' command from the system shell you can see the record was updated:"
|
||||
{ $code " $ sqlite3 example.db\n SQLite version 3.0.8\n Enter \".help\" for instructions\n sqlite> select ROWID,* from person;\n 1|John|Smith|999-999-999\n 2|Mandy|Jones|987-654-321\n sqlite>" } ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-inserting-or-updating" } "Inserting or Updating instances"
|
||||
"The " { $link save-tuple } " word can be used to insert a tuple if it has not already been stored in the database, or update it if it already exists. Whether to insert or update is decided by the existance of the 'persistent' delegate:"
|
||||
{ $code "\"Mary\" \"Smith\" \"111-111-111\" <person> dup .\n => T{ person f \"Mary\" \"Smith\" \"111-111-111\" }\n! This will insert the tuple\ndb get over save-tuple dup .\n => T{ person T{ persistent f # \"3\" } \"Mary\" \"Smith\" \"111-111-111\" ...\n[ \"222-222-222\" swap set-person-phone ] keep dup .\n => T{ person T{ persistent f # \"3\" } \"Mary\" \"Smith\" \"222-222-222\" ...\n! This will update the tuple\ndb get over save-tuple .\n => T{ person T{ persistent f # \"3\" } \"Mary\" \"Smith\" \"222-222-222\" ..." } ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-deleting" } "Deleting instances"
|
||||
"Given a tuple with the delegate set to 'persistent' (ie. One already stored in the database) you can delete it from the database with " { $link delete-tuple } ":"
|
||||
{ $code "db get f \"Smith\" f <person> find-tuples [ db get swap delete-tuple ] each" } ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db-closing" } "Closing the database"
|
||||
"It's important to close the sqlite database when you've finished using it. The word for this is " { $link sqlite-close } ":"
|
||||
{ $code "db get sqlite-close" } ;
|
||||
|
||||
ARTICLE: { "sqlite" "tuple-db" } "Tuple Database Library"
|
||||
"The version of sqlite required by this library is version 3 or greater. This library allows storing Factor tuples in a sqlite database. It provides words to create, read update and delete these entries as well as simple searching."
|
||||
$nl
|
||||
"The library is in a very early state and is likely to change quite a bit in the near future. Its most notable omission is it cannot currently handle relationships between tuples."
|
||||
{ $subsection { "sqlite" "tuple-db-loading" } }
|
||||
{ $subsection { "sqlite" "tuple-db-usage" } }
|
||||
{ $subsection { "sqlite" "tuple-db-mappings" } }
|
||||
{ $subsection { "sqlite" "tuple-db-create" } }
|
||||
{ $subsection { "sqlite" "tuple-db-insert" } }
|
||||
{ $subsection { "sqlite" "tuple-db-finding" } }
|
||||
{ $subsection { "sqlite" "tuple-db-updating" } }
|
||||
{ $subsection { "sqlite" "tuple-db-inserting-or-updating" } }
|
||||
{ $subsection { "sqlite" "tuple-db-deleting" } }
|
||||
{ $subsection { "sqlite" "tuple-db-closing" } }
|
||||
;
|
||||
|
||||
HELP: default-mapping
|
||||
{ $values { "class" "symbol for the tuple class" }
|
||||
{ "mapping" "a mapping object" }
|
||||
}
|
||||
{ $description "Given a tuple class, create a default mappings object. This is used to associate field names in the tuple with SQL statement field names, etc." }
|
||||
{ $see-also { "sqlite" "tuple-db" } set-mapping } ;
|
||||
|
||||
HELP: set-mapping
|
||||
{ $values { "mapping" "a mapping object" }
|
||||
}
|
||||
{ $description "Store a database mapping so that the tuple-db system knows how to store instances of the tuple in the database." }
|
||||
{ $see-also { "sqlite" "tuple-db" } default-mapping } ;
|
||||
|
||||
HELP: create-tuple-table
|
||||
{ $values { "db" "a database object" } { "class" "symbol for the tuple class" }
|
||||
}
|
||||
{ $description "Create the database table to store intances of the given tuple." }
|
||||
{ $see-also { "sqlite" "tuple-db" } default-mapping get-mapping } ;
|
||||
|
||||
HELP: insert-tuple
|
||||
{ $values { "db" "a database object" } { "tuple" "an instance of a tuple" }
|
||||
}
|
||||
{ $description "Insert the tuple instance into the database. It is assumed that this tuple does not currently exist in the database." }
|
||||
{ $see-also { "sqlite" "tuple-db" } insert-tuple update-tuple find-tuples delete-tuple save-tuple } ;
|
||||
|
||||
HELP: find-tuples
|
||||
{ $values { "db" "a database object" } { "tuple" "an instance of a tuple" } { "seq" "a sequence of tuples" } }
|
||||
{ $description "Return a sequence of all tuples in the database that match the tuple provided as a template. All fields in the tuple must match the entries in the database, except for those set to 'f'." }
|
||||
{ $see-also { "sqlite" "tuple-db" } insert-tuple update-tuple find-tuples delete-tuple save-tuple } ;
|
||||
|
||||
HELP: update-tuple
|
||||
{ $values { "db" "a database object" } { "tuple" "an instance of a tuple" }
|
||||
}
|
||||
{ $description "Update the database record for this tuple instance. The tuple must have previously been obtained from the database, or inserted into it. It must have a delegate of 'persistent' with the key field set (which is done by the find and insert operations)." }
|
||||
{ $see-also { "sqlite" "tuple-db" } insert-tuple update-tuple find-tuples delete-tuple save-tuple } ;
|
||||
|
||||
HELP: save-tuple
|
||||
{ $values { "db" "a database object" } { "tuple" "an instance of a tuple" }
|
||||
}
|
||||
{ $description "Insert or Update the tuple instance depending on whether it has a persistent delegate." }
|
||||
{ $see-also { "sqlite" "tuple-db" } insert-tuple update-tuple find-tuples delete-tuple save-tuple } ;
|
||||
|
||||
HELP: delete-tuple
|
||||
{ $values { "db" "a database object" } { "tuple" "an instance of a tuple" }
|
||||
}
|
||||
{ $description "Delete this tuple instance from the database. The tuple must have previously been obtained from the database, or inserted into it. It must have a delegate of 'persistent' with the key field set (which is done by the find and insert operations)." }
|
||||
{ $see-also { "sqlite" "tuple-db" } insert-tuple update-tuple find-tuples delete-tuple save-tuple } ;
|
||||
|
||||
ABOUT: { "sqlite" "tuple-db" }
|
|
@ -1,39 +0,0 @@
|
|||
! Copyright (C) 2005 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
|
||||
IN: temporary
|
||||
USING: io io.files kernel sequences namespaces
|
||||
hashtables sqlite sqlite.tuple-db math words tools.test ;
|
||||
|
||||
TUPLE: testdata one two ;
|
||||
|
||||
C: <testdata> testdata
|
||||
|
||||
testdata default-mapping set-mapping
|
||||
|
||||
"libs/sqlite/test.db" resource-path [
|
||||
|
||||
db get testdata create-tuple-table
|
||||
|
||||
[ "two" { } ] [
|
||||
db get "one" "two" <testdata> insert-tuple
|
||||
db get "one" f <testdata> find-tuples
|
||||
first [ testdata-two ] keep
|
||||
db get swap delete-tuple
|
||||
db get "one" f <testdata> find-tuples
|
||||
] unit-test
|
||||
|
||||
[ "junk" ] [
|
||||
db get "one" "two" <testdata> insert-tuple
|
||||
db get "one" f <testdata> find-tuples
|
||||
first
|
||||
"junk" over set-testdata-two
|
||||
db get swap update-tuple
|
||||
db get "one" f <testdata> find-tuples
|
||||
first [ testdata-two ] keep
|
||||
db get swap delete-tuple
|
||||
] unit-test
|
||||
|
||||
db get testdata drop-tuple-table
|
||||
] with-sqlite
|
||||
|
|
@ -1,270 +0,0 @@
|
|||
! Copyright (C) 2005 Chris Double.
|
||||
!
|
||||
! A tuple that is persistent has its delegate set as 'persistent'.
|
||||
! 'persistent' holds the numeric rowid for that tuple in its table.
|
||||
IN: sqlite.tuple-db
|
||||
USING: io kernel sequences namespaces slots classes slots.private
|
||||
assocs math words generic sqlite math.parser ;
|
||||
|
||||
! Each slot in a tuple that is storable in the database has
|
||||
! an instance of a db-field object the gives the name of the
|
||||
! database table and slot number in the tuple object of that field.
|
||||
TUPLE: db-field name bind-name slot type ;
|
||||
|
||||
C: <db-field> db-field
|
||||
|
||||
! The mapping tuple holds information on how the slots of
|
||||
! a tuple are mapped to the fields of a sqlite database.
|
||||
TUPLE: mapping tuple table fields one-to-one one-to-many ;
|
||||
|
||||
C: <mapping> mapping
|
||||
|
||||
: sanitize ( string -- string )
|
||||
#! Convert a string so it can be used as a table or field name.
|
||||
clone
|
||||
H{ { CHAR: - CHAR: _ } { CHAR: ? CHAR: p } }
|
||||
over substitute ;
|
||||
|
||||
: tuple-fields ( class -- seq )
|
||||
#! Given a tuple class return a list of the fields
|
||||
#! within that tuple. Ignores the delegate field.
|
||||
"slots" word-prop 1 tail [
|
||||
[ slot-spec-name sanitize dup ":" swap append ] keep
|
||||
slot-spec-offset
|
||||
"text"
|
||||
<db-field>
|
||||
] map ;
|
||||
|
||||
: default-mapping ( class -- mapping )
|
||||
#! Given a tuple class, create a default mappings object. It assumes
|
||||
#! there are no one-to-one or one-to-many relationships.
|
||||
dup [ word-name sanitize ] keep tuple-fields f f <mapping> ;
|
||||
|
||||
! The mappings variable holds a hashtable mapping the tuple symbol
|
||||
! to the mapping object, describing how that tuple is stored
|
||||
! in the database.
|
||||
SYMBOL: mappings
|
||||
|
||||
: init-mappings ( -- )
|
||||
H{ } mappings set-global ;
|
||||
|
||||
: get-mappings ( -- hashtable )
|
||||
mappings get-global ;
|
||||
|
||||
: set-mapping ( mapping -- )
|
||||
#! Store a database mapping so that the persistence system
|
||||
#! knows how to store instances of the relevant tuple in the database.
|
||||
dup mapping-tuple get-mappings set-at ;
|
||||
|
||||
: get-mapping ( class -- mapping )
|
||||
#! Return the database mapping for the given tuple class.
|
||||
get-mappings at ;
|
||||
|
||||
! The 'persistent' tuple will be set to the delegate of any tuple
|
||||
! instance stored in the database. It contains the database key
|
||||
! of the row in the database table for the instance or 'f' if it has
|
||||
! not yet been stored in the database. It also contains the 'mapping'
|
||||
! object used to translate the fields of the tuple to the database fields.
|
||||
TUPLE: persistent mapping key ;
|
||||
: <persistent> ( tuple -- persistent )
|
||||
persistent construct-empty
|
||||
>r class get-mapping r>
|
||||
[ set-persistent-mapping ] keep ;
|
||||
|
||||
: make-persistent ( tuple -- tuple )
|
||||
#! Convert the tuple into something that can be stored
|
||||
#! into a database by setting its delegate to 'persistent'.
|
||||
[ <persistent> ] keep
|
||||
[ set-delegate ] keep ;
|
||||
|
||||
|
||||
: comma-fields ( mapping quot -- string )
|
||||
#! Given a mapping, call quot on each field in
|
||||
#! the mapping. The contents of quot should call ',' or '%'
|
||||
#! to generate output. The output of each quot call
|
||||
#! seperated by commas is returned as a string. 'quot' should be
|
||||
#! stack effect ( field -- ).
|
||||
>r mapping-fields r> [ "" make ] curry map "," join ; inline
|
||||
|
||||
GENERIC: create-sql ( mapping -- string )
|
||||
M: mapping create-sql ( mapping -- string )
|
||||
#! Return the SQL used to create a table for storing this type of tuple.
|
||||
[
|
||||
"create table " % dup mapping-table %
|
||||
" (" %
|
||||
[ dup db-field-name % " " % db-field-type % ] comma-fields %
|
||||
");" %
|
||||
] "" make ;
|
||||
|
||||
GENERIC: drop-sql ( mapping -- string )
|
||||
M: mapping drop-sql ( mapping -- string )
|
||||
#! Return the SQL used to drop the table for storing this type of tuple.
|
||||
[
|
||||
"drop table " % mapping-table % ";" %
|
||||
] "" make ;
|
||||
|
||||
GENERIC: insert-sql ( mapping -- string )
|
||||
M: mapping insert-sql ( mapping -- string )
|
||||
#! Return the SQL used to insert a tuple into a table
|
||||
[
|
||||
"insert into " % dup mapping-table %
|
||||
" values(" %
|
||||
[ db-field-bind-name % ] comma-fields %
|
||||
");" %
|
||||
] "" make ;
|
||||
|
||||
GENERIC: delete-sql ( mapping -- string )
|
||||
M: mapping delete-sql ( mapping -- string )
|
||||
#! Return the SQL used to delete a tuple from a table
|
||||
[
|
||||
"delete from " % mapping-table %
|
||||
" where ROWID=:rowid;" %
|
||||
] "" make ;
|
||||
|
||||
GENERIC: update-sql ( mapping -- string )
|
||||
M: mapping update-sql ( mapping -- string )
|
||||
#! Return the SQL used to update the tuple
|
||||
[
|
||||
"update " % dup mapping-table %
|
||||
" set " %
|
||||
[ dup db-field-name % "=" % db-field-bind-name % ] comma-fields %
|
||||
" where ROWID=:rowid;" %
|
||||
] "" make ;
|
||||
|
||||
GENERIC: select-sql ( tuple mapping -- select )
|
||||
M: mapping select-sql ( tuple mapping -- select )
|
||||
#! Return the SQL used to select a series of tuples from the database. It
|
||||
#! will select based on only the filled in fields of the tuple (ie. all non-f).
|
||||
[
|
||||
"select ROWID,* from " % dup mapping-table %
|
||||
mapping-fields [ ! tuple field
|
||||
swap over db-field-slot slot ! field value
|
||||
[
|
||||
[ dup db-field-name % "=" % db-field-bind-name % ] "" make
|
||||
] [
|
||||
drop f
|
||||
] if
|
||||
] with map [ ] subset dup length 0 > [
|
||||
" where " %
|
||||
" and " join %
|
||||
] [
|
||||
drop
|
||||
] if
|
||||
";" %
|
||||
] "" make ;
|
||||
|
||||
: execute-update-sql ( db string -- )
|
||||
#! Execute the SQL, which should contain a database update
|
||||
#! statement (update, insert, create, etc). Ignore the result.
|
||||
sqlite-prepare dup [ drop ] sqlite-each sqlite-finalize ;
|
||||
|
||||
: create-tuple-table ( db class -- )
|
||||
#! Create the table for the tuple class.
|
||||
get-mapping create-sql execute-update-sql ;
|
||||
|
||||
: drop-tuple-table ( db class -- )
|
||||
#! Create the table for the tuple class.
|
||||
get-mapping drop-sql execute-update-sql ;
|
||||
|
||||
: bind-for-insert ( statement tuple -- )
|
||||
#! Bind the fields in the tuple to the fields in the
|
||||
#! prepared insert statement.
|
||||
dup class get-mapping mapping-fields [ ! statement tuple field
|
||||
[ db-field-slot slot ] keep ! statement value field
|
||||
db-field-bind-name swap ! statement name value
|
||||
>r dupd r> sqlite-bind-text-by-name
|
||||
] with each drop ;
|
||||
|
||||
: bind-for-select ( statement tuple -- )
|
||||
#! Bind the fields in the tuple to the fields in the
|
||||
#! prepared select statement.
|
||||
dup class get-mapping mapping-fields [ ! statement tuple field
|
||||
[ db-field-slot slot ] keep ! statement value field
|
||||
over [
|
||||
db-field-bind-name swap ! statement name value
|
||||
>r dupd r> sqlite-bind-text-by-name
|
||||
] [
|
||||
2drop
|
||||
] if
|
||||
] with each drop ;
|
||||
|
||||
: bind-for-update ( statement tuple -- )
|
||||
#! Bind the fields in the tuple to the fields in the
|
||||
#! prepared update statement.
|
||||
2dup bind-for-insert
|
||||
>r ":rowid" r> persistent-key sqlite-bind-text-by-name ;
|
||||
|
||||
: bind-for-delete ( statement tuple -- )
|
||||
#! Bind the fields in the tuple to the fields in the
|
||||
#! prepared delete statement.
|
||||
>r ":rowid" r> persistent-key sqlite-bind-text-by-name ;
|
||||
|
||||
: (insert-tuple) ( db tuple -- )
|
||||
#! Insert this tuple instance into the database. Note that
|
||||
#! it inserts only this instance, and not any one-to-one or
|
||||
#! one-to-many fields.
|
||||
dup class get-mapping insert-sql ! db tuple sql
|
||||
swapd sqlite-prepare swap ! statement tuple
|
||||
dupd bind-for-insert ! statement
|
||||
dup [ drop ] sqlite-each
|
||||
sqlite-finalize ;
|
||||
|
||||
: insert-tuple ( db tuple -- )
|
||||
#! Insert this tuple instance into the database and
|
||||
#! update the rowid of the insert in the tuple.
|
||||
[ (insert-tuple) ] 2keep
|
||||
>r sqlite-last-insert-rowid number>string r> make-persistent set-persistent-key ;
|
||||
|
||||
: update-tuple ( db tuple -- )
|
||||
#! Update this tuple instance in the database. The tuple should have
|
||||
#! a delegate of 'persistent' with the key field set.
|
||||
dup class get-mapping update-sql ! db tuple sql
|
||||
swapd sqlite-prepare swap ! statement tuple
|
||||
dupd bind-for-update ! statement
|
||||
dup [ drop ] sqlite-each
|
||||
sqlite-finalize ;
|
||||
|
||||
: save-tuple ( db tuple -- )
|
||||
#! Insert or Update the tuple instance depending on whether it
|
||||
#! has a persistent delegate.
|
||||
dup delegate [ update-tuple ] [ insert-tuple ] if ;
|
||||
|
||||
: delete-tuple ( db tuple -- )
|
||||
#! Delete this tuple instance from the database. The tuple should have
|
||||
#! a delegate of 'persistent' with the key field set.
|
||||
dup class get-mapping delete-sql ! db tuple sql
|
||||
swapd sqlite-prepare swap ! statement tuple
|
||||
dupd bind-for-delete ! statement
|
||||
dup [ drop ] sqlite-each
|
||||
sqlite-finalize ;
|
||||
|
||||
: restore-tuple ( statement tuple -- tuple )
|
||||
#! Using 'tuple' as a template, clone it and
|
||||
#! return the clone with fields set to the values from the
|
||||
#! database.
|
||||
clone dup class get-mapping mapping-fields 1 swap
|
||||
[ ! statement tuple index field )
|
||||
over 1+ >r ! statement tuple index field r: index+1
|
||||
db-field-slot >r ! statement tuple index r: index+1 slot
|
||||
pick swap column-text ! statement tuple value r: index+1 slot
|
||||
over r> set-slot r> ! statement tuple index+1
|
||||
] each ! statement tuple index
|
||||
drop make-persistent swap 0 column-text swap [ set-persistent-key ] keep ;
|
||||
|
||||
: find-tuples ( db tuple -- seq )
|
||||
#! Return a sequence of all tuples in the database that
|
||||
#! match the tuple provided as a template. All fields in the
|
||||
#! tuple must match the entries in the database, except for
|
||||
#! those set to 'f'.
|
||||
dup class get-mapping dupd select-sql ! db tuple sql
|
||||
swapd sqlite-prepare swap ! statement tuple
|
||||
2dup bind-for-select ! statement tuple
|
||||
[
|
||||
over [ ! tuple statement
|
||||
over restore-tuple ,
|
||||
] sqlite-each
|
||||
] { } make nip ! statement tuple accum
|
||||
swap sqlite-finalize ;
|
||||
|
||||
|
||||
get-mappings [ init-mappings ] unless
|
|
@ -1 +0,0 @@
|
|||
Eduardo Cavazos
|
|
@ -1,14 +0,0 @@
|
|||
USING: math arrays sequences kernel splitting strings ;
|
||||
IN: strings.lib
|
||||
|
||||
! : char>digit ( c -- i ) 48 - ;
|
||||
|
||||
! : string>digits ( s -- seq ) [ char>digit ] { } map-as ;
|
||||
|
||||
! : >Upper ( str -- str )
|
||||
! dup empty? [
|
||||
! unclip ch>upper 1string swap append
|
||||
! ] unless ;
|
||||
|
||||
! : >Upper-dashes ( str -- str )
|
||||
! "-" split [ >Upper ] map "-" join ;
|
|
@ -1 +0,0 @@
|
|||
collections
|
|
@ -1,8 +1,7 @@
|
|||
<<<<<<< HEAD:extra/tar/tar.factor
|
||||
USING: combinators io io.files io.streams.duplex
|
||||
io.streams.string kernel math math.parser continuations
|
||||
namespaces pack prettyprint sequences strings system ;
|
||||
USING: hexdump tools.interpreter ;
|
||||
namespaces pack prettyprint sequences strings system
|
||||
hexdump tools.interpreter ;
|
||||
IN: tar
|
||||
|
||||
: zero-checksum 256 ;
|
||||
|
|
|
@ -36,13 +36,13 @@ M: font hashcode* drop font hashcode* ;
|
|||
|
||||
: close-freetype ( -- )
|
||||
global [
|
||||
open-fonts [ values [ close-font ] each f ] change
|
||||
open-fonts [ [ drop close-font ] assoc-each f ] change
|
||||
freetype [ FT_Done_FreeType f ] change
|
||||
] bind ;
|
||||
|
||||
M: freetype-renderer free-fonts ( world -- )
|
||||
dup world-handle select-gl-context
|
||||
world-fonts values [ second free-sprites ] each ;
|
||||
world-fonts [ nip second free-sprites ] assoc-each ;
|
||||
|
||||
: ttf-name ( font style -- name )
|
||||
2array H{
|
||||
|
@ -100,7 +100,7 @@ SYMBOL: dpi
|
|||
swap set-font-height ;
|
||||
|
||||
: <font> ( handle -- font )
|
||||
V{ } clone
|
||||
H{ } clone
|
||||
{ set-font-handle set-font-widths } font construct
|
||||
dup init-font ;
|
||||
|
||||
|
@ -119,7 +119,7 @@ M: freetype-renderer open-font ( font -- open-font )
|
|||
: char-width ( open-font char -- w )
|
||||
over font-widths [
|
||||
dupd load-glyph glyph-hori-advance ft-ceil
|
||||
] cache-nth nip ;
|
||||
] cache nip ;
|
||||
|
||||
M: freetype-renderer string-width ( open-font string -- w )
|
||||
0 -rot [ char-width + ] with each ;
|
||||
|
@ -175,7 +175,7 @@ M: freetype-renderer string-height ( open-font string -- h )
|
|||
[ bitmap>texture ] keep [ init-sprite ] keep ;
|
||||
|
||||
: draw-char ( open-font char sprites -- )
|
||||
[ dupd <char-sprite> ] cache-nth nip
|
||||
[ dupd <char-sprite> ] cache nip
|
||||
sprite-dlist glCallList ;
|
||||
|
||||
: (draw-string) ( open-font sprites string loc -- )
|
||||
|
@ -186,7 +186,7 @@ M: freetype-renderer string-height ( open-font string -- h )
|
|||
] do-enabled ;
|
||||
|
||||
: font-sprites ( open-font world -- pair )
|
||||
world-fonts [ open-font V{ } clone 2array ] cache ;
|
||||
world-fonts [ open-font H{ } clone 2array ] cache ;
|
||||
|
||||
M: freetype-renderer draw-string ( font string loc -- )
|
||||
>r >r world get font-sprites first2 r> r> (draw-string) ;
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
USING: arrays assocs combinators continuations documents
|
||||
ui.tools.workspace hashtables io io.styles kernel math
|
||||
math.vectors models namespaces parser prettyprint quotations
|
||||
sequences strings threads listener tuples ui.commands ui.gadgets
|
||||
ui.gadgets.editors ui.gadgets.presentations ui.gadgets.worlds
|
||||
ui.gestures definitions ;
|
||||
sequences sequences.lib strings threads listener tuples
|
||||
ui.commands ui.gadgets ui.gadgets.editors
|
||||
ui.gadgets.presentations ui.gadgets.worlds ui.gestures
|
||||
definitions ;
|
||||
IN: ui.tools.interactor
|
||||
|
||||
TUPLE: interactor
|
||||
|
@ -97,7 +98,7 @@ M: interactor model-changed
|
|||
[ set-interactor-continuation stop ] curry callcc1 ;
|
||||
|
||||
M: interactor stream-readln
|
||||
[ interactor-yield ] keep interactor-finish first ;
|
||||
[ interactor-yield ] keep interactor-finish ?first ;
|
||||
|
||||
: interactor-call ( quot interactor -- )
|
||||
dup interactor-busy? [
|
||||
|
|
|
@ -77,7 +77,7 @@ M: listener-operation invoke-command ( target command -- )
|
|||
[ [ run-file ] each ] curry call-listener
|
||||
] if ;
|
||||
|
||||
: com-EOF ( listener -- )
|
||||
: com-end ( listener -- )
|
||||
listener-gadget-input interactor-eof ;
|
||||
|
||||
: clear-output ( listener -- )
|
||||
|
@ -154,7 +154,7 @@ listener-gadget "toolbar" f {
|
|||
{ f restart-listener }
|
||||
{ T{ key-down f f "CLEAR" } clear-output }
|
||||
{ T{ key-down f { C+ } "CLEAR" } clear-stack }
|
||||
{ T{ key-down f { C+ } "d" } com-EOF }
|
||||
{ T{ key-down f { C+ } "d" } com-end }
|
||||
{ T{ key-down f f "F1" } listener-help }
|
||||
} define-command-map
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@ math math.vectors namespaces prettyprint sequences strings
|
|||
vectors words windows.kernel32 windows.gdi32 windows.user32
|
||||
windows.opengl32 windows.messages windows.types
|
||||
windows.nt windows threads timers libc combinators continuations
|
||||
command-line shuffle opengl ui.render unicode.case ascii ;
|
||||
command-line shuffle opengl ui.render unicode.case ascii
|
||||
math.bitfields ;
|
||||
IN: ui.windows
|
||||
|
||||
TUPLE: windows-ui-backend ;
|
||||
|
@ -370,7 +371,7 @@ M: windows-ui-backend (close-window)
|
|||
class-name-ptr get-global
|
||||
pick GetClassInfoEx zero? [
|
||||
"WNDCLASSEX" heap-size over set-WNDCLASSEX-cbSize
|
||||
CS_HREDRAW CS_VREDRAW bitor CS_OWNDC bitor over set-WNDCLASSEX-style
|
||||
{ CS_HREDRAW CS_VREDRAW CS_OWNDC } flags over set-WNDCLASSEX-style
|
||||
ui-wndproc over set-WNDCLASSEX-lpfnWndProc
|
||||
0 over set-WNDCLASSEX-cbClsExtra
|
||||
0 over set-WNDCLASSEX-cbWndExtra
|
||||
|
@ -387,7 +388,7 @@ M: windows-ui-backend (close-window)
|
|||
make-adjusted-RECT
|
||||
>r class-name-ptr get-global f r>
|
||||
>r >r >r ex-style r> r>
|
||||
WS_CLIPSIBLINGS WS_CLIPCHILDREN bitor style bitor
|
||||
{ WS_CLIPSIBLINGS WS_CLIPCHILDREN style } flags
|
||||
CW_USEDEFAULT dup r>
|
||||
get-RECT-dimensions
|
||||
f f f GetModuleHandle f CreateWindowEx dup win32-error=0/f ;
|
||||
|
|
|
@ -59,9 +59,3 @@ IN: unix.linux.ifreq
|
|||
swap <int> over set-struct-ifreq-ifr-ifru
|
||||
|
||||
AF_INET SOCK_DGRAM 0 socket SIOCSIFMETRIC rot ioctl drop ;
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
USING: words quotations sequences math macros ;
|
||||
|
||||
MACRO: flags ( seq -- ) 0 swap [ execute bitor ] each 1quotation ;
|
|
@ -0,0 +1,57 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax math math.bitfields ;
|
||||
IN: unix.linux.inotify
|
||||
|
||||
C-STRUCT: inotify-event
|
||||
{ "int" "wd" } ! watch descriptor
|
||||
{ "uint" "mask" } ! watch mask
|
||||
{ "uint" "cookie" } ! cookie to synchronize two events
|
||||
{ "uint" "len" } ! length (including nulls) of name
|
||||
{ "char[0]" "name" } ! stub for possible name
|
||||
;
|
||||
|
||||
: IN_ACCESS HEX: 1 ; inline ! File was accessed
|
||||
: IN_MODIFY HEX: 2 ; inline ! File was modified
|
||||
: IN_ATTRIB HEX: 4 ; inline ! Metadata changed
|
||||
: IN_CLOSE_WRITE HEX: 8 ; inline ! Writtable file was closed
|
||||
: IN_CLOSE_NOWRITE HEX: 10 ; inline ! Unwrittable file closed
|
||||
: IN_OPEN HEX: 20 ; inline ! File was opened
|
||||
: IN_MOVED_FROM HEX: 40 ; inline ! File was moved from X
|
||||
: IN_MOVED_TO HEX: 80 ; inline ! File was moved to Y
|
||||
: IN_CREATE HEX: 100 ; inline ! Subfile was created
|
||||
: IN_DELETE HEX: 200 ; inline ! Subfile was deleted
|
||||
: IN_DELETE_SELF HEX: 400 ; inline ! Self was deleted
|
||||
: IN_MOVE_SELF HEX: 800 ; inline ! Self was moved
|
||||
|
||||
: IN_UNMOUNT HEX: 2000 ; inline ! Backing fs was unmounted
|
||||
: IN_Q_OVERFLOW HEX: 4000 ; inline ! Event queued overflowed
|
||||
: IN_IGNORED HEX: 8000 ; inline ! File was ignored
|
||||
|
||||
: IN_CLOSE IN_CLOSE_WRITE IN_CLOSE_NOWRITE bitor ; inline ! close
|
||||
: IN_MOVE IN_MOVED_FROM IN_MOVED_TO bitor ; inline ! moves
|
||||
|
||||
: IN_ONLYDIR HEX: 1000000 ; inline ! only watch the path if it is a directory
|
||||
: IN_DONT_FOLLOW HEX: 2000000 ; inline ! don't follow a sym link
|
||||
: IN_MASK_ADD HEX: 20000000 ; inline ! add to the mask of an already existing watch
|
||||
: IN_ISDIR HEX: 40000000 ; inline ! event occurred against dir
|
||||
: IN_ONESHOT HEX: 80000000 ; inline ! only send event once
|
||||
|
||||
: IN_CHANGE_EVENTS
|
||||
{
|
||||
IN_MODIFY IN_ATTRIB IN_MOVED_FROM
|
||||
IN_MOVED_TO IN_DELETE IN_CREATE IN_DELETE_SELF
|
||||
IN_MOVE_SELF
|
||||
} flags ; foldable
|
||||
|
||||
: IN_ALL_EVENTS
|
||||
{
|
||||
IN_ACCESS IN_MODIFY IN_ATTRIB IN_CLOSE_WRITE
|
||||
IN_CLOSE_NOWRITE IN_OPEN IN_MOVED_FROM
|
||||
IN_MOVED_TO IN_DELETE IN_CREATE IN_DELETE_SELF
|
||||
IN_MOVE_SELF
|
||||
} flags ; foldable
|
||||
|
||||
FUNCTION: int inotify_init ( ) ;
|
||||
FUNCTION: int inotify_add_watch ( int fd, char* name, uint mask ) ;
|
||||
FUNCTION: int inotify_rm_watch ( int fd, uint wd ) ;
|
|
@ -168,9 +168,10 @@ FUNCTION: time_t time ( time_t* t ) ;
|
|||
FUNCTION: int unlink ( char* path ) ;
|
||||
FUNCTION: int utimes ( char* path, timeval[2] times ) ;
|
||||
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! wait and waitpid
|
||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
: SIGKILL 9 ; inline
|
||||
: SIGTERM 15 ; inline
|
||||
|
||||
FUNCTION: int kill ( pid_t pid, int sig ) ;
|
||||
|
||||
! Flags for waitpid
|
||||
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
! Copyright (C) 2007 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: help.markup help.syntax webapps.article-manager.database ;
|
||||
IN: webapps.article-manager
|
||||
|
||||
ARTICLE: { "article-manager" "loading" } "Loading Article Manager"
|
||||
"To start an instance of the article-manager furnace application:"
|
||||
{ $example "\"webapps.article-manager\" run" }
|
||||
"The article-manager database needs to be opened before it can be accessed."
|
||||
{ $example "open-db" } ;
|
||||
|
||||
ARTICLE: { "article-manager" "security" } "Article Manager Security"
|
||||
"To setup an article manager site you need to authenticate under the basic-authentication realm called \"article-manager-site\". To add and edit articles you need to authenticate under the realm \"article-manager-article\". The following sets up an 'admin' user under these two realms with a password of 'password'."
|
||||
{ $example "H{ { \"admin\" \"5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8\" } } \"article-manager-site\" add-realm\nH{ { \"admin\" \"5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8\" } } \"article-manager-article\" add-realm " }
|
||||
"Multiple users can be added with different passwords under these realms." ;
|
||||
|
||||
ARTICLE: { "article-manager" "setup" } "Article Manager Setup"
|
||||
"A site must first be setup before it can be accessed by the user. This can be access via the URL " { $url "http://site-name/responder/article-manager/setup-site/" } "\n\n"
|
||||
"The 'hostname' is the hostname portion of the URL used to access the site. The 'title' is what appears in the title bar. 'footer' appears at the bottom of the pages in the site and can be used for a copyright notice, etc. 'Introduction' Should be Wiky code and will appear on the first index page of the site. 'HTML' will be appended to every page just before the closing of the 'body' HTML tag. It can be used to put HTML for counters, user tracking, etc.\n\n"
|
||||
"The 'Ad Block' sections are used for entering HTML and Javascript code for ads that will appear in the article pages. 'Ad Block 1' appears in the left hand navigation area underneat the menu and above the 'tags' list. The other two ad blocks appear at the top of articles randomly split between either no ad and one of those two blocks." ;
|
||||
|
||||
ARTICLE: { "article-manager" "articles" } "Adding or Editing Articles"
|
||||
"Articles are added or edited using the URL " { $url "http://site-name/responder/article-manager/edit-article/article-name" } ". This will bring up a form with information about the article.\n\n'Publication Date' is the date you want to appear next to the article. You can click the button next to it to select it using a popup calendar. 'Title' is the title of the article.\n\n'Status' can be 'Draft' or 'Published'. 'Draft' articles do not appear in the main index page or list of tags. They can still be accessed via the direct URL however. Note that editing an existing article will default this to 'Draft' automatically, so you'll need to change it back to 'Published' if you want it to appear.\n\n'Tags' is a space-separated list of tag names that can be used for finding articles.\n\n'Body' is the text of the article. It is in Wiky format and shows a preview below it. For more on the Wiky syntax see " { $url "http://goessner.net/articles/wiky/WikyBox.html" } " or Google for 'Wikybox'."
|
||||
;
|
||||
|
||||
ARTICLE: { "article-manager" "article-manager" } "Article Manager"
|
||||
"The article-manager is a Furnace application used to manage and display a tagged set of articles. Each instance of the article-manager responder can run multiple sites containing different articles. Follow these instructions to set up an article manager instance."
|
||||
{ $subsection { "article-manager" "loading" } }
|
||||
{ $subsection { "article-manager" "security" } }
|
||||
{ $subsection { "article-manager" "setup" } }
|
||||
{ $subsection { "article-manager" "articles" } } ;
|
||||
|
||||
ABOUT: { "article-manager" "article-manager" }
|
|
@ -1,165 +0,0 @@
|
|||
! Copyright (C) 2007 Chris Double. All Rights Reserved.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
!
|
||||
USING: kernel furnace sqlite.tuple-db webapps.article-manager.database
|
||||
sequences namespaces math arrays assocs quotations io.files
|
||||
http.server http.basic-authentication http.server.responders
|
||||
webapps.file html html.elements io ;
|
||||
IN: webapps.article-manager
|
||||
|
||||
: current-site ( -- site )
|
||||
host get-site* ;
|
||||
|
||||
: render-titled-page* ( model body-template head-template title -- )
|
||||
[
|
||||
[ render-component ] swap [ <title> write </title> f rot render-component ] curry html-document
|
||||
] serve-html ;
|
||||
|
||||
TUPLE: template-args arg1 ;
|
||||
|
||||
C: <template-args> template-args
|
||||
|
||||
: setup-site ( -- )
|
||||
"article-manager-site" [
|
||||
current-site "setup-site" "edit-head" "Setup Site" render-titled-page*
|
||||
] with-basic-authentication ;
|
||||
|
||||
\ setup-site { } define-action
|
||||
|
||||
: site-index ( -- )
|
||||
host get-site [
|
||||
current-site "index" "head" pick site-title render-titled-page*
|
||||
] [
|
||||
"404" "Unknown Site" httpd-error
|
||||
] if ;
|
||||
|
||||
! An action called 'site-index'
|
||||
\ site-index { } define-action
|
||||
|
||||
: requested-article-path ( action -- url )
|
||||
length "responder-url" get length 1 + + "request" get swap tail ;
|
||||
|
||||
: requested-article-url ( action -- url )
|
||||
requested-article-path CHAR: / over index dup [
|
||||
head
|
||||
] [
|
||||
drop
|
||||
] if ;
|
||||
|
||||
: requested-article-filename ( action -- url )
|
||||
requested-article-path CHAR: / over last-index 1+ tail ;
|
||||
|
||||
: tag ( -- )
|
||||
current-site
|
||||
"tag" requested-article-url host swap get-tag dup >r
|
||||
2array <template-args> "tag" "head" r> tag-title render-titled-page* ;
|
||||
|
||||
! An action for tags
|
||||
\ tag { } define-action
|
||||
|
||||
: article ( -- )
|
||||
current-site
|
||||
"article" requested-article-url host swap article-by-url dup >r
|
||||
2array <template-args>
|
||||
"article" "head" r> article-title render-titled-page* ;
|
||||
|
||||
! An action for articles
|
||||
\ article { } define-action
|
||||
|
||||
|
||||
: edit-article ( -- )
|
||||
"article-manager-article" [
|
||||
"edit-article" requested-article-url host swap article-by-url*
|
||||
"edit-article" "edit-head" "Edit" render-titled-page*
|
||||
] with-basic-authentication ;
|
||||
|
||||
! An action for articles
|
||||
\ edit-article { } define-action
|
||||
|
||||
: update-article ( pubdate title status tags body url -- )
|
||||
"article-manager-article" [
|
||||
host swap article-by-url*
|
||||
[ set-article-body ] keep
|
||||
[ set-article-tags ] keep
|
||||
[ set-article-status ] keep
|
||||
[ set-article-title ] keep
|
||||
[ set-article-pubdate ] keep
|
||||
[ save-article ] keep
|
||||
article-url "responder-url" get "article/" rot 3append "/" append permanent-redirect
|
||||
] with-basic-authentication ;
|
||||
|
||||
|
||||
\ update-article { { "pubdate" } { "title" } { "status" } { "tags" } { "body" } { "url" } } define-action
|
||||
|
||||
: update-article-link ( -- link )
|
||||
"responder-url" get "update-article" append ;
|
||||
|
||||
: remove-article ( url -- )
|
||||
"article-manager-article" [
|
||||
host swap article-by-url [ remove-article ] when*
|
||||
"responder-url" get permanent-redirect
|
||||
] with-basic-authentication ;
|
||||
|
||||
\ remove-article { { "url" } } define-action
|
||||
|
||||
: update-site ( ad3 ad2 ad1 html title intro footer hostname -- )
|
||||
"article-manager-site" [
|
||||
dup get-site*
|
||||
[ set-site-hostname ] keep
|
||||
[ set-site-footer ] keep
|
||||
[ set-site-intro ] keep
|
||||
[ set-site-title ] keep
|
||||
[ set-site-html ] keep
|
||||
[ set-site-ad1 ] keep
|
||||
[ set-site-ad2 ] keep
|
||||
[ set-site-ad3 ] keep
|
||||
get-db swap save-tuple
|
||||
"responder-url" get permanent-redirect
|
||||
] with-basic-authentication ;
|
||||
|
||||
|
||||
\ update-site { { "ad3" } { "ad2" } { "ad1" } { "html" } { "title" } { "intro" } { "footer" } { "hostname" } } define-action
|
||||
|
||||
: update-site-link ( -- link )
|
||||
"responder-url" get "update-site" append ;
|
||||
|
||||
|
||||
SYMBOL: redirections
|
||||
|
||||
: redirector ( url quot -- )
|
||||
over redirections get H{ } or at dup [
|
||||
2nip permanent-redirect
|
||||
] [
|
||||
drop call
|
||||
] if ;
|
||||
|
||||
: install-redirector ( hash responder host -- )
|
||||
vhost [ responder ] bind [
|
||||
"post" get [ redirector ] curry "post" set
|
||||
"get" get [ redirector ] curry "get" set
|
||||
redirections set
|
||||
] bind ;
|
||||
|
||||
: get-redirections ( responder host -- hash )
|
||||
vhost [ responder ] bind [ redirections get ] bind ;
|
||||
|
||||
: article-manager-web-app ( -- )
|
||||
! Create the web app, providing access
|
||||
! under '/responder/article-manager' which calls the
|
||||
! 'site-index' action.
|
||||
"article-manager" "site-index" "extra/webapps/article-manager/furnace/" web-app
|
||||
|
||||
! An URL to the javascript and css resource files
|
||||
"article-manager-resources" [
|
||||
[
|
||||
"extra/webapps/article-manager/resources/" resource-path "doc-root" set
|
||||
file-responder
|
||||
] with-scope
|
||||
] add-simple-responder ;
|
||||
|
||||
MAIN: article-manager-web-app
|
||||
|
||||
! Just for testing. Password is 'password'
|
||||
! H{ { "admin" "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8" } } "article-manager-site" add-realm
|
||||
! H{ { "admin" "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8" } } "article-manager-article" add-realm
|
||||
|
|
@ -1 +0,0 @@
|
|||
Chris Double
|
|
@ -1 +0,0 @@
|
|||
Chris Double
|
|
@ -1,118 +0,0 @@
|
|||
! Copyright (C) 2007 Chris Double. All Rights Reserved.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
!
|
||||
USING: kernel sqlite sqlite.tuple-db io.files sequences splitting
|
||||
hashtables ;
|
||||
IN: webapps.article-manager.database
|
||||
|
||||
TUPLE: site hostname title intro footer html ad1 ad2 ad3 ;
|
||||
|
||||
C: <site> site
|
||||
|
||||
TUPLE: article hostname url pubdate title status body tags ;
|
||||
|
||||
C: <article> article
|
||||
|
||||
TUPLE: tag hostname name title description ;
|
||||
|
||||
C: <tag> tag
|
||||
|
||||
site default-mapping set-mapping
|
||||
article default-mapping set-mapping
|
||||
tag default-mapping set-mapping
|
||||
|
||||
: db ( -- object )
|
||||
{ f } ;
|
||||
|
||||
: set-db ( value -- )
|
||||
0 db set-nth ;
|
||||
|
||||
|
||||
: get-db ( -- value )
|
||||
0 db nth ;
|
||||
|
||||
: db-filename ( -- name )
|
||||
"extra/webapps/article-manager/article-manager.db" resource-path ;
|
||||
|
||||
: open-db ( -- )
|
||||
get-db [ sqlite-close ] when*
|
||||
db-filename exists? [
|
||||
db-filename sqlite-open set-db
|
||||
] [
|
||||
db-filename sqlite-open dup set-db
|
||||
dup article create-tuple-table
|
||||
dup site create-tuple-table
|
||||
tag create-tuple-table
|
||||
] if ;
|
||||
|
||||
: close-db ( -- )
|
||||
get-db [ sqlite-close ] when*
|
||||
f set-db ;
|
||||
|
||||
: all-sites ( -- sites )
|
||||
get-db f f f f f f f f <site> find-tuples ;
|
||||
|
||||
: get-site ( hostname -- site )
|
||||
f f f f f f f <site> get-db swap find-tuples dup empty? [
|
||||
drop f
|
||||
] [
|
||||
first
|
||||
] if ;
|
||||
|
||||
: get-site* ( hostname -- site )
|
||||
f f f f f f f <site> dup get-db swap find-tuples dup empty? [
|
||||
drop site-hostname dup "" "" "" "" "" "" <site>
|
||||
] [
|
||||
nip first
|
||||
] if ;
|
||||
|
||||
: get-tag ( hostname name -- tag )
|
||||
f f <tag> dup get-db swap find-tuples dup empty? [
|
||||
drop
|
||||
[ dup tag-name swap set-tag-title ] keep
|
||||
[ "" swap set-tag-description ] keep
|
||||
] [
|
||||
nip first
|
||||
] if ;
|
||||
|
||||
: add-article ( article -- )
|
||||
get-db swap insert-tuple ;
|
||||
|
||||
: remove-article ( article -- )
|
||||
get-db swap delete-tuple ;
|
||||
|
||||
: save-article ( article -- )
|
||||
get-db swap save-tuple ;
|
||||
|
||||
: all-articles ( hostname -- seq )
|
||||
f f f "published" f f <article> get-db swap find-tuples ;
|
||||
|
||||
: article-by-url ( hostname url -- article )
|
||||
f f f f f <article> get-db swap find-tuples dup empty? [
|
||||
drop f
|
||||
] [
|
||||
first
|
||||
] if ;
|
||||
|
||||
: article-by-url* ( hostname url -- article )
|
||||
f f f f f <article> dup get-db swap find-tuples dup empty? [
|
||||
drop
|
||||
[ "" swap set-article-pubdate ] keep
|
||||
[ "" swap set-article-title ] keep
|
||||
[ "draft" swap set-article-status ] keep
|
||||
[ "" swap set-article-body ] keep
|
||||
[ "" swap set-article-tags ] keep
|
||||
] [
|
||||
nip first
|
||||
] if ;
|
||||
|
||||
: tags-for-article ( article -- seq )
|
||||
article-tags " " split [ empty? not ] subset ;
|
||||
|
||||
: all-tags ( hostname -- seq )
|
||||
all-articles [ tags-for-article ] map concat prune ;
|
||||
|
||||
: articles-for-tag ( tag -- seq )
|
||||
[ tag-name ] keep tag-hostname all-articles [
|
||||
tags-for-article member?
|
||||
] with subset ;
|
|
@ -1,13 +0,0 @@
|
|||
<% USING: kernel io http.server namespaces sequences math html.elements random furnace webapps.article-manager webapps.article-manager.database html.elements ; %>
|
||||
<div id="banner"><h1><% "arg1" get second article-title write %></h1></div>
|
||||
<% "navigation" render-template %>
|
||||
<div id="article">
|
||||
<% 100 random 25 > [ "arg1" get first 100 random 50 > [ site-ad2 ] [ site-ad3 ] if write-html ] when %>
|
||||
<% "arg1" get second article-body write-html %>
|
||||
|
||||
<h1>Tags</h1>
|
||||
<% "arg1" get second tags-for-article <template-args> "tags" render-component %>
|
||||
</div>
|
||||
<p class="footer"></p>
|
||||
<p id="copyright"><% "arg1" get first site-footer write %></p>
|
||||
<% "arg1" get first site-html write-html %>
|
|
@ -1,41 +0,0 @@
|
|||
<% USING: kernel io namespaces furnace webapps.article-manager html.elements ; %>
|
||||
<script type="text/javascript">
|
||||
function transformWiky() {
|
||||
var wiky = $('#wiky').get(0).value;
|
||||
var html = Wiky.toHtml(wiky);
|
||||
$('#html').get(0).value = html;
|
||||
$('#preview').html(html);
|
||||
}
|
||||
function transformHtml() {
|
||||
var html = $('#preview').get(0).innerHTML;
|
||||
var wiky = Wiky.toWiki(html);
|
||||
$('#wiky').get(0).value = wiky;
|
||||
$('#html').get(0).value = html;
|
||||
}
|
||||
</script>
|
||||
<form method="post" action="<% update-article-link write %>">
|
||||
<table>
|
||||
<tr><td>URL:</td><td><input type="hidden" name="url" value="<% "url" get write %>"/><input type="text" name="readonlyurl" disabled="disabled" value="<% "url" get write %>"/></td></tr>
|
||||
<tr><td>Publication Date:</td><td><input id="pubdate" type="text" name="pubdate" value="<% "pubdate" get write %>"/> <button id="calendar">[c]</button></td></tr>
|
||||
<tr><td>Title:</td><td><input type="text" name="title" value="<% "title" get write %>"/></td></tr>
|
||||
<tr><td>Status:</td><td><select name="status">
|
||||
<option value="draft">Draft</option>
|
||||
<option value="published">Published</option>
|
||||
</td></tr>
|
||||
<tr><td>Tags:</td><td><input type="text" name="tags" value="<% "tags" get write %>"/></td></tr>
|
||||
<tr><td>Body:</td><td><textarea id='wiky' onkeyup="transformWiky();" rows="10" cols="80" name="wiky"></textarea></td></tr>
|
||||
<tr><td>Preview:</td><td><input id="html" type='hidden' name="body" value=""/><div id="preview"><% "body" get write-html %></div></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" name="post" value="Post"/></td></tr>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
transformHtml();
|
||||
Calendar.setup(
|
||||
{
|
||||
inputField: "pubdate",
|
||||
ifFormat : "%Y/%m/%d %H:%M",
|
||||
showsTime : true,
|
||||
timeFormat: "24",
|
||||
button: "calendar"
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/style.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/wiky.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/wiky.lang.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/wiky.math.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/jscalendar-1.0/calendar-win2k-1.css"/>
|
||||
<script type="text/javascript" src="/responder/article-manager-resources/jquery.js"></script>
|
||||
<script type="text/javascript" src="/responder/article-manager-resources/wiky.js"></script>
|
||||
<script type="text/javascript" src="/responder/article-manager-resources/wiky.lang.js"></script>
|
||||
<script type="text/javascript" src="/responder/article-manager-resources/wiky.math.js"></script>
|
||||
<script type="text/javascript" src="/responder/article-manager-resources/jscalendar-1.0/calendar.js"></script>
|
||||
<script type="text/javascript" src="/responder/article-manager-resources/jscalendar-1.0/lang/calendar-en.js"></script>
|
||||
<script type="text/javascript" src="/responder/article-manager-resources/jscalendar-1.0/calendar-setup.js"></script>
|
|
@ -1,4 +0,0 @@
|
|||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/style.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/wiky.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/wiky.lang.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/wiky.math.css"/>
|
|
@ -1,32 +0,0 @@
|
|||
<% USING: kernel sequences furnace webapps.article-manager webapps.article-manager.database io namespaces http.server sorting html.elements math ; %>
|
||||
<html>
|
||||
<head>
|
||||
<title><% "title" get write %></title>
|
||||
<link rel="stylesheet" type="text/css" href="/responder/article-manager-resources/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="banner"><h1><% "title" get write %></h1></div>
|
||||
<% "navigation" render-template %>
|
||||
<div id="article">
|
||||
<% "intro" get write-html %>
|
||||
<h1>Recent Articles</h1>
|
||||
<ul>
|
||||
<% host all-articles [ >r article-pubdate r> article-pubdate swap <=> ] sort [ %>
|
||||
<li><a href="article/<% dup article-url write "/" write %>"><% dup article-title write %></a> (<% article-pubdate write %>)</li>
|
||||
<% ] each %>
|
||||
</ul>
|
||||
|
||||
<h1>Tags</h1>
|
||||
<p>The information in this site is 'tagged'. By searching or
|
||||
selecting one of the tags below you can find information about
|
||||
that area. A search facility will be added soon
|
||||
but in the meantime, Google is likely to provide
|
||||
reasonable results.
|
||||
</p>
|
||||
<% host all-tags <template-args> "tags" render-component %>
|
||||
</div>
|
||||
<p class="footer"></p>
|
||||
<p id="copyright"><% "footer" get write %></p>
|
||||
<% "html" get write-html %>
|
||||
</body>
|
||||
</html>
|
|
@ -1,9 +0,0 @@
|
|||
<% USING: kernel furnace webapps.article-manager webapps.article-manager.database io namespaces http.server html.elements ; %>
|
||||
<div id="navigation">
|
||||
<ul>
|
||||
<li><a href="<% "responder-url" get write %>">Home</a></li>
|
||||
</ul>
|
||||
<% current-site site-ad1 write-html %>
|
||||
<h1>Tags</h1>
|
||||
<% host all-tags <template-args> "tags" render-component %>
|
||||
</div>
|
|
@ -1,33 +0,0 @@
|
|||
<% USING: kernel io namespaces furnace webapps.article-manager html.elements ; %>
|
||||
<script type="text/javascript">
|
||||
function transformWiky() {
|
||||
var wiky = $('#wiky').get(0).value;
|
||||
var html = Wiky.toHtml(wiky);
|
||||
$('#html').get(0).value = html;
|
||||
$('#preview').html(html);
|
||||
}
|
||||
function transformHtml() {
|
||||
var html = $('#preview').get(0).innerHTML;
|
||||
var wiky = Wiky.toWiki(html);
|
||||
$('#wiky').get(0).value = wiky;
|
||||
$('#html').get(0).value = html;
|
||||
}
|
||||
</script>
|
||||
<h1>Setup New Site</h1>
|
||||
<form method="post" action="<% update-site-link write %>">
|
||||
<table>
|
||||
<tr><td>Hostname:</td><td><input type="text" name="hostname" value="<% "hostname" get write %>"/></td></tr>
|
||||
<tr><td>Title:</td><td><input type="text" name="title" value="<% "title" get write %>"/></td></tr>
|
||||
<tr><td>footer:</td><td><input type="text" name="footer" value="<% "footer" get write %>"/></td></tr>
|
||||
<tr><td>Introduction:</td><td><textarea id='wiky' onkeyup="transformWiky();" rows="10" cols="80"></textarea></td></tr>
|
||||
<tr><td>Preview:</td><td><input id="html" type="hidden" name="intro" value=""/><div id="preview"><% "intro" get write-html %></div></td></tr>
|
||||
<tr><td>HTML:</td><td><textarea name="html" rows="10" cols="80"><% "html" get write %></textarea></td></tr>
|
||||
<tr><td>Ad Block 1:</td><td><textarea name="ad1" rows="10" cols="80"><% "ad1" get write %></textarea></td></tr>
|
||||
<tr><td>Ad Block 2:</td><td><textarea name="ad2" rows="10" cols="80"><% "ad2" get write %></textarea></td></tr>
|
||||
<tr><td>Ad Block 3:</td><td><textarea name="ad3" rows="10" cols="80"><% "ad3" get write %></textarea></td></tr>
|
||||
<tr><td colspan="2"><input type="submit" name="post" value="Post"/></td></tr>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
transformHtml();
|
||||
</script>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<% USING: kernel io http.server namespaces sequences math html furnace webapps.article-manager.database webapps.article-manager html.elements ; %>
|
||||
|
||||
<div id="banner"><h1><% "arg1" get second tag-title write %></h1></div>
|
||||
<% "navigation" render-component %>
|
||||
<div id="article">
|
||||
<h1><% "arg1" get second tag-title write %></h1>
|
||||
<% "arg1" get second tag-description write-html %>
|
||||
<ul>
|
||||
<% "arg1" get second articles-for-tag [ %>
|
||||
<li><a href="<% "responder-url" get write "article/" write dup article-url write "/" write %>"><% dup article-title write %></a> (<% article-pubdate write %>)</li></a></li>
|
||||
<% ] each %>
|
||||
</ul>
|
||||
</div>
|
||||
<p class="footer"></p>
|
||||
<p id="copyright"><% "arg1" get first site-footer write %></p>
|
||||
<% "arg1" get first site-html write-html %>
|
|
@ -1,6 +0,0 @@
|
|||
<% USING: kernel namespaces sequences webapps.article-manager.database io sorting ; %>
|
||||
<ul>
|
||||
<% "arg1" get [ <=> ] sort [ %>
|
||||
<li><a href="<% "responder-url" get write "tag/" write dup write "/" write %>"><% write %></a></li>
|
||||
<% ] each %>
|
||||
</ul>
|
|
@ -1,18 +0,0 @@
|
|||
! Copyright (C) 2007 Chris Double. All Rights Reserved.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
!
|
||||
REQUIRES: libs/furnace libs/sqlite libs/basic-authentication ;
|
||||
|
||||
PROVIDE: apps/article-manager
|
||||
{
|
||||
+files+ {
|
||||
"article-manager-db.factor"
|
||||
"article-manager.factor"
|
||||
"article-manager.facts"
|
||||
}
|
||||
} {
|
||||
+tests+ {
|
||||
}
|
||||
}
|
||||
{ +help+ { "article-manager" "article-manager" } }
|
||||
;
|
File diff suppressed because one or more lines are too long
|
@ -1,232 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
div.calendar { position: relative; }
|
||||
|
||||
.calendar, .calendar table {
|
||||
border: 1px solid #556;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #eef;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center; /* They are the navigation buttons */
|
||||
padding: 2px; /* Make the buttons seem like they're pressing */
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: #778 url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold; /* Pressing it will take you to the current date */
|
||||
text-align: center;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
background: #778;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
background: #bdf;
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #556;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #a66;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
background-color: #aaf;
|
||||
color: #000;
|
||||
border: 1px solid #04f;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
background-color: #77c;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
color: #456;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #bbb;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #fbb;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #bdf;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #def;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #eef;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
background: #def;
|
||||
padding: 1px 3px 1px 1px;
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
background: #cde;
|
||||
padding: 2px 2px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
border: 1px solid #000;
|
||||
padding: 1px 3px 1px 1px;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #a66;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { /* Cell showing selected date */
|
||||
font-weight: bold;
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
text-align: center;
|
||||
background: #556;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
background: #fff;
|
||||
color: #445;
|
||||
border-top: 1px solid #556;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
background: #aaf;
|
||||
border: 1px solid #04f;
|
||||
color: #000;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
background: #77c;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 4em;
|
||||
cursor: default;
|
||||
border: 1px solid #655;
|
||||
background: #def;
|
||||
color: #000;
|
||||
font-size: 90%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #acf;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
border-top: 1px solid #46a;
|
||||
border-bottom: 1px solid #46a;
|
||||
background: #eef;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #000;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #f4f0e8;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #889;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #667;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
|
@ -1,236 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
div.calendar { position: relative; }
|
||||
|
||||
.calendar, .calendar table {
|
||||
border: 1px solid #206A9B;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #F1F8FC;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center; /* They are the navigation buttons */
|
||||
padding: 2px; /* Make the buttons seem like they're pressing */
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: #007ED1 url(menuarrow2.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold; /* Pressing it will take you to the current date */
|
||||
text-align: center;
|
||||
background: #000;
|
||||
color: #fff;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.calendar thead tr { /* Row <TR> containing navigation buttons */
|
||||
background: #007ED1;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
background: #C7E1F3;
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #206A9B;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #a66;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
background-color: #34ABFA;
|
||||
color: #000;
|
||||
border: 1px solid #016DC5;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
background-color: #006AA9;
|
||||
border: 1px solid #008AFF;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
color: #456;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #bbb;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #fbb;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #C7E1F3;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #def;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #F1F8FC;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
background: #def;
|
||||
padding: 1px 3px 1px 1px;
|
||||
border: 1px solid #8FC4E8;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
background: #cde;
|
||||
padding: 2px 2px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
border: 1px solid #000;
|
||||
padding: 1px 3px 1px 1px;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #a66;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { /* Cell showing selected date */
|
||||
font-weight: bold;
|
||||
color: #D50000;
|
||||
}
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
text-align: center;
|
||||
background: #206A9B;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
background: #000;
|
||||
color: #fff;
|
||||
border-top: 1px solid #206A9B;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
background: #B8DAF0;
|
||||
border: 1px solid #178AEB;
|
||||
color: #000;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
background: #006AA9;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 4em;
|
||||
cursor: default;
|
||||
border: 1px solid #655;
|
||||
background: #def;
|
||||
color: #000;
|
||||
font-size: 90%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #34ABFA;
|
||||
border-top: 1px solid #46a;
|
||||
border-bottom: 1px solid #46a;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
border-top: 1px solid #46a;
|
||||
border-bottom: 1px solid #46a;
|
||||
background: #F1F8FC;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #000;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #E3F0F9;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #889;
|
||||
font-weight: bold;
|
||||
background-color: #F1F8FC;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #267DB7;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: red;
|
||||
background-color: #000;
|
||||
color: #A5FF00;
|
||||
}
|
|
@ -1,225 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
div.calendar { position: relative; }
|
||||
|
||||
.calendar, .calendar table {
|
||||
border: 1px solid #655;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #ffd;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center; /* They are the navigation buttons */
|
||||
padding: 2px; /* Make the buttons seem like they're pressing */
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: #edc url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold; /* Pressing it will take you to the current date */
|
||||
text-align: center;
|
||||
background: #654;
|
||||
color: #fed;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
background: #edc;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #655;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
background-color: #faa;
|
||||
color: #000;
|
||||
border: 1px solid #f40;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
background-color: #c77;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
background: #fed;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #bbb;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #fbb;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #fed;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #ddf;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #efe;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
background: #ffe;
|
||||
padding: 1px 3px 1px 1px;
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
background: #ddc;
|
||||
padding: 2px 2px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
border: 1px solid #000;
|
||||
padding: 1px 3px 1px 1px;
|
||||
background: #fea;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { font-weight: bold; }
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
text-align: center;
|
||||
background: #988;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
border-top: 1px solid #655;
|
||||
background: #dcb;
|
||||
color: #840;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
background: #faa;
|
||||
border: 1px solid #f40;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
background: #c77;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 4em;
|
||||
cursor: default;
|
||||
border: 1px solid #655;
|
||||
background: #ffe;
|
||||
color: #000;
|
||||
font-size: 90%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #fc8;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
border-top: 1px solid #a64;
|
||||
border-bottom: 1px solid #a64;
|
||||
background: #fee;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #a88;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #fed;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #988;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #866;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
|
@ -1,229 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
div.calendar { position: relative; }
|
||||
|
||||
.calendar, .calendar table {
|
||||
border: 1px solid #565;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #efe;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center; /* They are the navigation buttons */
|
||||
padding: 2px; /* Make the buttons seem like they're pressing */
|
||||
background: #676;
|
||||
color: #fff;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: #676 url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold; /* Pressing it will take you to the current date */
|
||||
text-align: center;
|
||||
padding: 2px;
|
||||
background: #250;
|
||||
color: #efa;
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #565;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #a66;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
background-color: #afa;
|
||||
color: #000;
|
||||
border: 1px solid #084;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
background-color: #7c7;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
background: #dfb;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
color: #564;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #bbb;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #fbb;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #8a8;
|
||||
background: #dfb;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #dfd;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #efe;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
background: #efd;
|
||||
padding: 1px 3px 1px 1px;
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
background: #dec;
|
||||
padding: 2px 2px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
border: 1px solid #000;
|
||||
padding: 1px 3px 1px 1px;
|
||||
background: #f8fff8;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #a66;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { font-weight: bold; color: #0a0; }
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
text-align: center;
|
||||
background: #565;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
padding: 2px;
|
||||
background: #250;
|
||||
color: #efa;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
background: #afa;
|
||||
border: 1px solid #084;
|
||||
color: #000;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
background: #7c7;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 4em;
|
||||
cursor: default;
|
||||
border: 1px solid #565;
|
||||
background: #efd;
|
||||
color: #000;
|
||||
font-size: 90%;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #af8;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
border-top: 1px solid #6a4;
|
||||
border-bottom: 1px solid #6a4;
|
||||
background: #efe;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #8a8;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #dfb;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #898;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #686;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
|
@ -1,200 +0,0 @@
|
|||
/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/
|
||||
* ---------------------------------------------------------------------------
|
||||
*
|
||||
* The DHTML Calendar
|
||||
*
|
||||
* Details and latest version at:
|
||||
* http://dynarch.com/mishoo/calendar.epl
|
||||
*
|
||||
* This script is distributed under the GNU Lesser General Public License.
|
||||
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* This file defines helper functions for setting up the calendar. They are
|
||||
* intended to help non-programmers get a working calendar on their site
|
||||
* quickly. This script should not be seen as part of the calendar. It just
|
||||
* shows you what one can do with the calendar, while in the same time
|
||||
* providing a quick and simple method for setting it up. If you need
|
||||
* exhaustive customization of the calendar creation process feel free to
|
||||
* modify this code to suit your needs (this is recommended and much better
|
||||
* than modifying calendar.js itself).
|
||||
*/
|
||||
|
||||
// $Id: calendar-setup.js,v 1.25 2005/03/07 09:51:33 mishoo Exp $
|
||||
|
||||
/**
|
||||
* This function "patches" an input field (or other element) to use a calendar
|
||||
* widget for date selection.
|
||||
*
|
||||
* The "params" is a single object that can have the following properties:
|
||||
*
|
||||
* prop. name | description
|
||||
* -------------------------------------------------------------------------------------------------
|
||||
* inputField | the ID of an input field to store the date
|
||||
* displayArea | the ID of a DIV or other element to show the date
|
||||
* button | ID of a button or other element that will trigger the calendar
|
||||
* eventName | event that will trigger the calendar, without the "on" prefix (default: "click")
|
||||
* ifFormat | date format that will be stored in the input field
|
||||
* daFormat | the date format that will be used to display the date in displayArea
|
||||
* singleClick | (true/false) wether the calendar is in single click mode or not (default: true)
|
||||
* firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc.
|
||||
* align | alignment (default: "Br"); if you don't know what's this see the calendar documentation
|
||||
* range | array with 2 elements. Default: [1900, 2999] -- the range of years available
|
||||
* weekNumbers | (true/false) if it's true (default) the calendar will display week numbers
|
||||
* flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID
|
||||
* flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar)
|
||||
* disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar
|
||||
* onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay)
|
||||
* onClose | function that gets called when the calendar is closed. [default]
|
||||
* onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar.
|
||||
* date | the date that the calendar will be initially displayed to
|
||||
* showsTime | default: false; if true the calendar will include a time selector
|
||||
* timeFormat | the time format; can be "12" or "24", default is "12"
|
||||
* electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close
|
||||
* step | configures the step of the years in drop-down boxes; default: 2
|
||||
* position | configures the calendar absolute position; default: null
|
||||
* cache | if "true" (but default: "false") it will reuse the same calendar object, where possible
|
||||
* showOthers | if "true" (but default: "false") it will show days from other months too
|
||||
*
|
||||
* None of them is required, they all have default values. However, if you
|
||||
* pass none of "inputField", "displayArea" or "button" you'll get a warning
|
||||
* saying "nothing to setup".
|
||||
*/
|
||||
Calendar.setup = function (params) {
|
||||
function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
|
||||
|
||||
param_default("inputField", null);
|
||||
param_default("displayArea", null);
|
||||
param_default("button", null);
|
||||
param_default("eventName", "click");
|
||||
param_default("ifFormat", "%Y/%m/%d");
|
||||
param_default("daFormat", "%Y/%m/%d");
|
||||
param_default("singleClick", true);
|
||||
param_default("disableFunc", null);
|
||||
param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined
|
||||
param_default("dateText", null);
|
||||
param_default("firstDay", null);
|
||||
param_default("align", "Br");
|
||||
param_default("range", [1900, 2999]);
|
||||
param_default("weekNumbers", true);
|
||||
param_default("flat", null);
|
||||
param_default("flatCallback", null);
|
||||
param_default("onSelect", null);
|
||||
param_default("onClose", null);
|
||||
param_default("onUpdate", null);
|
||||
param_default("date", null);
|
||||
param_default("showsTime", false);
|
||||
param_default("timeFormat", "24");
|
||||
param_default("electric", true);
|
||||
param_default("step", 2);
|
||||
param_default("position", null);
|
||||
param_default("cache", false);
|
||||
param_default("showOthers", false);
|
||||
param_default("multiple", null);
|
||||
|
||||
var tmp = ["inputField", "displayArea", "button"];
|
||||
for (var i in tmp) {
|
||||
if (typeof params[tmp[i]] == "string") {
|
||||
params[tmp[i]] = document.getElementById(params[tmp[i]]);
|
||||
}
|
||||
}
|
||||
if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) {
|
||||
alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");
|
||||
return false;
|
||||
}
|
||||
|
||||
function onSelect(cal) {
|
||||
var p = cal.params;
|
||||
var update = (cal.dateClicked || p.electric);
|
||||
if (update && p.inputField) {
|
||||
p.inputField.value = cal.date.print(p.ifFormat);
|
||||
if (typeof p.inputField.onchange == "function")
|
||||
p.inputField.onchange();
|
||||
}
|
||||
if (update && p.displayArea)
|
||||
p.displayArea.innerHTML = cal.date.print(p.daFormat);
|
||||
if (update && typeof p.onUpdate == "function")
|
||||
p.onUpdate(cal);
|
||||
if (update && p.flat) {
|
||||
if (typeof p.flatCallback == "function")
|
||||
p.flatCallback(cal);
|
||||
}
|
||||
if (update && p.singleClick && cal.dateClicked)
|
||||
cal.callCloseHandler();
|
||||
};
|
||||
|
||||
if (params.flat != null) {
|
||||
if (typeof params.flat == "string")
|
||||
params.flat = document.getElementById(params.flat);
|
||||
if (!params.flat) {
|
||||
alert("Calendar.setup:\n Flat specified but can't find parent.");
|
||||
return false;
|
||||
}
|
||||
var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect);
|
||||
cal.showsOtherMonths = params.showOthers;
|
||||
cal.showsTime = params.showsTime;
|
||||
cal.time24 = (params.timeFormat == "24");
|
||||
cal.params = params;
|
||||
cal.weekNumbers = params.weekNumbers;
|
||||
cal.setRange(params.range[0], params.range[1]);
|
||||
cal.setDateStatusHandler(params.dateStatusFunc);
|
||||
cal.getDateText = params.dateText;
|
||||
if (params.ifFormat) {
|
||||
cal.setDateFormat(params.ifFormat);
|
||||
}
|
||||
if (params.inputField && typeof params.inputField.value == "string") {
|
||||
cal.parseDate(params.inputField.value);
|
||||
}
|
||||
cal.create(params.flat);
|
||||
cal.show();
|
||||
return false;
|
||||
}
|
||||
|
||||
var triggerEl = params.button || params.displayArea || params.inputField;
|
||||
triggerEl["on" + params.eventName] = function() {
|
||||
var dateEl = params.inputField || params.displayArea;
|
||||
var dateFmt = params.inputField ? params.ifFormat : params.daFormat;
|
||||
var mustCreate = false;
|
||||
var cal = window.calendar;
|
||||
if (dateEl)
|
||||
params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt);
|
||||
if (!(cal && params.cache)) {
|
||||
window.calendar = cal = new Calendar(params.firstDay,
|
||||
params.date,
|
||||
params.onSelect || onSelect,
|
||||
params.onClose || function(cal) { cal.hide(); });
|
||||
cal.showsTime = params.showsTime;
|
||||
cal.time24 = (params.timeFormat == "24");
|
||||
cal.weekNumbers = params.weekNumbers;
|
||||
mustCreate = true;
|
||||
} else {
|
||||
if (params.date)
|
||||
cal.setDate(params.date);
|
||||
cal.hide();
|
||||
}
|
||||
if (params.multiple) {
|
||||
cal.multiple = {};
|
||||
for (var i = params.multiple.length; --i >= 0;) {
|
||||
var d = params.multiple[i];
|
||||
var ds = d.print("%Y%m%d");
|
||||
cal.multiple[ds] = d;
|
||||
}
|
||||
}
|
||||
cal.showsOtherMonths = params.showOthers;
|
||||
cal.yearStep = params.step;
|
||||
cal.setRange(params.range[0], params.range[1]);
|
||||
cal.params = params;
|
||||
cal.setDateStatusHandler(params.dateStatusFunc);
|
||||
cal.getDateText = params.dateText;
|
||||
cal.setDateFormat(dateFmt);
|
||||
if (mustCreate)
|
||||
cal.create();
|
||||
cal.refresh();
|
||||
if (!params.position)
|
||||
cal.showAtElement(params.button || params.displayArea || params.inputField, params.align);
|
||||
else
|
||||
cal.showAt(params.position[0], params.position[1]);
|
||||
return false;
|
||||
};
|
||||
|
||||
return cal;
|
||||
};
|
|
@ -1,21 +0,0 @@
|
|||
/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/
|
||||
* ---------------------------------------------------------------------------
|
||||
*
|
||||
* The DHTML Calendar
|
||||
*
|
||||
* Details and latest version at:
|
||||
* http://dynarch.com/mishoo/calendar.epl
|
||||
*
|
||||
* This script is distributed under the GNU Lesser General Public License.
|
||||
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
|
||||
*
|
||||
* This file defines helper functions for setting up the calendar. They are
|
||||
* intended to help non-programmers get a working calendar on their site
|
||||
* quickly. This script should not be seen as part of the calendar. It just
|
||||
* shows you what one can do with the calendar, while in the same time
|
||||
* providing a quick and simple method for setting it up. If you need
|
||||
* exhaustive customization of the calendar creation process feel free to
|
||||
* modify this code to suit your needs (this is recommended and much better
|
||||
* than modifying calendar.js itself).
|
||||
*/
|
||||
Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&¶ms.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;};
|
|
@ -1,251 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
.calendar {
|
||||
position: relative;
|
||||
display: none;
|
||||
border: 1px solid;
|
||||
border-color: #fff #000 #000 #fff;
|
||||
font-size: 11px;
|
||||
cursor: default;
|
||||
background: Window;
|
||||
color: WindowText;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
.calendar table {
|
||||
border: 1px solid;
|
||||
border-color: #fff #000 #000 #fff;
|
||||
font-size: 11px;
|
||||
cursor: default;
|
||||
background: Window;
|
||||
color: WindowText;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
border: 1px solid;
|
||||
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
|
||||
background: ButtonFace;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: ButtonFace url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold;
|
||||
padding: 1px;
|
||||
border: 1px solid #000;
|
||||
background: ActiveCaption;
|
||||
color: CaptionText;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid ButtonShadow;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
background: ButtonFace;
|
||||
color: ButtonText;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
border: 2px solid;
|
||||
padding: 0px;
|
||||
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
border-width: 1px;
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #aaa;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #faa;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid ButtonShadow;
|
||||
background: ButtonFace;
|
||||
color: ButtonText;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: Highlight;
|
||||
color: HighlightText;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
padding: 1px 3px 1px 1px;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
padding: 2px 2px 0px 2px;
|
||||
border: 1px solid;
|
||||
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing selected date */
|
||||
font-weight: bold;
|
||||
border: 1px solid;
|
||||
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
||||
padding: 2px 2px 0px 2px;
|
||||
background: ButtonFace;
|
||||
color: ButtonText;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
.calendar tbody td.disabled { color: GrayText; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
background: ButtonFace;
|
||||
padding: 1px;
|
||||
border: 1px solid;
|
||||
border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
|
||||
color: ButtonText;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
padding: 1px;
|
||||
background: #e4e0d8;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
width: 4em;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
cursor: default;
|
||||
border: 1px solid;
|
||||
border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
|
||||
background: Menu;
|
||||
color: MenuText;
|
||||
font-size: 90%;
|
||||
padding: 1px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
padding: 0px;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: Highlight;
|
||||
color: HighlightText;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid ButtonShadow;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: ButtonFace;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #889;
|
||||
font-weight: bold;
|
||||
background-color: Menu;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: Highlight;
|
||||
color: HighlightText;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
|
@ -1,239 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
div.calendar { position: relative; }
|
||||
|
||||
.calendar, .calendar table {
|
||||
border: 1px solid #655;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #ffd;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
filter:
|
||||
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#DDDCCC,EndColorStr=#FFFFFF);
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center; /* They are the navigation buttons */
|
||||
padding: 2px; /* Make the buttons seem like they're pressing */
|
||||
color:#363636;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: #edc url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold; /* Pressing it will take you to the current date */
|
||||
text-align: center;
|
||||
background: #654;
|
||||
color: #363636;
|
||||
padding: 2px;
|
||||
filter:
|
||||
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#ffffff,EndColorStr=#dddccc);
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
/*background: #3B86A0;*/
|
||||
color: #363636;
|
||||
font-weight: bold;
|
||||
filter:
|
||||
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#ffffff,EndColorStr=#3b86a0);
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #655;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
color: #363636;
|
||||
filter:
|
||||
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#DDDCCC,EndColorStr=#FFFFFF);
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
background-color: #ffcc86;
|
||||
color: #000;
|
||||
border: 1px solid #b59345;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
background-color: #c77;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
background: #fed;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #aaa;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #faa;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #fed;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #ddf;
|
||||
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #efe;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
background: #ffe;
|
||||
padding: 1px 3px 1px 1px;
|
||||
border: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
background: #ddc;
|
||||
padding: 2px 2px 0px 2px;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
border: 1px solid #000;
|
||||
padding: 1px 3px 1px 1px;
|
||||
background: #fea;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { font-weight: bold; }
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
text-align: center;
|
||||
background: #988;
|
||||
color: #000;
|
||||
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
border-top: 1px solid #655;
|
||||
background: #dcb;
|
||||
color: #363636;
|
||||
font-weight: bold;
|
||||
filter:
|
||||
progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr=#FFFFFF,EndColorStr=#DDDCCC);
|
||||
}
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
background: #faa;
|
||||
border: 1px solid #f40;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
background: #c77;
|
||||
padding: 2px 0px 0px 2px;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 4em;
|
||||
cursor: default;
|
||||
border: 1px solid #655;
|
||||
background: #ffe;
|
||||
color: #000;
|
||||
font-size: smaller;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.combo .label,
|
||||
.combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.combo .hilite {
|
||||
background: #fc8;
|
||||
}
|
||||
|
||||
.combo .active {
|
||||
border-top: 1px solid #a64;
|
||||
border-bottom: 1px solid #a64;
|
||||
background: #fee;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #a88;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #fed;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #988;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #866;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
|
@ -1,271 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
.calendar {
|
||||
position: relative;
|
||||
display: none;
|
||||
border-top: 2px solid #fff;
|
||||
border-right: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
border-left: 2px solid #fff;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #d4d0c8;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
.calendar table {
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #d4d0c8;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: transparent url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold;
|
||||
padding: 1px;
|
||||
border: 1px solid #000;
|
||||
background: #848078;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #000;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
background: #f4f0e8;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
border-top: 2px solid #fff;
|
||||
border-right: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
border-left: 2px solid #fff;
|
||||
padding: 0px;
|
||||
background-color: #e4e0d8;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
background-color: #c4c0b8;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #aaa;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #faa;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #f4f0e8;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #e4e0d8;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #d4d0c8;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
padding: 1px 3px 1px 1px;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
padding: 2px 2px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing selected date */
|
||||
font-weight: bold;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
padding: 2px 2px 0px 2px;
|
||||
background: #e4e0d8;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
background: #f4f0e8;
|
||||
padding: 1px;
|
||||
border: 1px solid #000;
|
||||
background: #848078;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
padding: 1px;
|
||||
background: #e4e0d8;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
width: 4em;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
cursor: default;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
background: #e4e0d8;
|
||||
font-size: 90%;
|
||||
padding: 1px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
background: #c4c0b8;
|
||||
padding: 0px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #048;
|
||||
color: #fea;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #000;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #f4f0e8;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #889;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #766;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
|
@ -1,271 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
.calendar {
|
||||
position: relative;
|
||||
display: none;
|
||||
border-top: 2px solid #fff;
|
||||
border-right: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
border-left: 2px solid #fff;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #d4c8d0;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
.calendar table {
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #d4c8d0;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: transparent url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold;
|
||||
padding: 1px;
|
||||
border: 1px solid #000;
|
||||
background: #847880;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #000;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
background: #f4e8f0;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
border-top: 2px solid #fff;
|
||||
border-right: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
border-left: 2px solid #fff;
|
||||
padding: 0px;
|
||||
background-color: #e4d8e0;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
background-color: #c4b8c0;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #aaa;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #faa;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #f4e8f0;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #e4d8e0;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #d4c8d0;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
padding: 1px 3px 1px 1px;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
padding: 2px 2px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing selected date */
|
||||
font-weight: bold;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
padding: 2px 2px 0px 2px;
|
||||
background: #e4d8e0;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
background: #f4e8f0;
|
||||
padding: 1px;
|
||||
border: 1px solid #000;
|
||||
background: #847880;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
padding: 1px;
|
||||
background: #e4d8e0;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
width: 4em;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
cursor: default;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
background: #e4d8e0;
|
||||
font-size: 90%;
|
||||
padding: 1px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
background: #d4c8d0;
|
||||
padding: 0px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #408;
|
||||
color: #fea;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #000;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #f4f0e8;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #889;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #766;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
|
@ -1,265 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
.calendar {
|
||||
position: relative;
|
||||
display: none;
|
||||
border-top: 2px solid #fff;
|
||||
border-right: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
border-left: 2px solid #fff;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #c8d0d4;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
.calendar table {
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #c8d0d4;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: transparent url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold;
|
||||
padding: 1px;
|
||||
border: 1px solid #000;
|
||||
background: #788084;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #000;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
background: #e8f0f4;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
border-top: 2px solid #fff;
|
||||
border-right: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
border-left: 2px solid #fff;
|
||||
padding: 0px;
|
||||
background-color: #d8e0e4;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
background-color: #b8c0c4;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #aaa;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #faa;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #e8f4f0;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #d8e4e0;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #c8d4d0;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
padding: 1px 3px 1px 1px;
|
||||
border: 1px solid;
|
||||
border-color: #fff #000 #000 #fff;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
padding: 2px 2px 0px 2px;
|
||||
border: 1px solid;
|
||||
border-color: #000 #fff #fff #000;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing selected date */
|
||||
font-weight: bold;
|
||||
padding: 2px 2px 0px 2px;
|
||||
border: 1px solid;
|
||||
border-color: #000 #fff #fff #000;
|
||||
background: #d8e0e4;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
background: #e8f0f4;
|
||||
padding: 1px;
|
||||
border: 1px solid #000;
|
||||
background: #788084;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
padding: 1px;
|
||||
background: #d8e0e4;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
width: 4em;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
cursor: default;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
background: #d8e0e4;
|
||||
font-size: 90%;
|
||||
padding: 1px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
background: #c8d0d4;
|
||||
padding: 0px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #048;
|
||||
color: #aef;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #000;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #e8f0f4;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #889;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #667;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
|
@ -1,271 +0,0 @@
|
|||
/* The main calendar widget. DIV containing a table. */
|
||||
|
||||
.calendar {
|
||||
position: relative;
|
||||
display: none;
|
||||
border-top: 2px solid #fff;
|
||||
border-right: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
border-left: 2px solid #fff;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #c8d4d0;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
.calendar table {
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
font-size: 11px;
|
||||
color: #000;
|
||||
cursor: default;
|
||||
background: #c8d4d0;
|
||||
font-family: tahoma,verdana,sans-serif;
|
||||
}
|
||||
|
||||
/* Header part -- contains navigation buttons and day names. */
|
||||
|
||||
.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
.calendar .nav {
|
||||
background: transparent url(menuarrow.gif) no-repeat 100% 100%;
|
||||
}
|
||||
|
||||
.calendar thead .title { /* This holds the current "month, year" */
|
||||
font-weight: bold;
|
||||
padding: 1px;
|
||||
border: 1px solid #000;
|
||||
background: #788480;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar thead .headrow { /* Row <TR> containing navigation buttons */
|
||||
}
|
||||
|
||||
.calendar thead .daynames { /* Row <TR> containing the day names */
|
||||
}
|
||||
|
||||
.calendar thead .name { /* Cells <TD> containing the day names */
|
||||
border-bottom: 1px solid #000;
|
||||
padding: 2px;
|
||||
text-align: center;
|
||||
background: #e8f4f0;
|
||||
}
|
||||
|
||||
.calendar thead .weekend { /* How a weekend day name shows in header */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar thead .hilite { /* How do the buttons in header appear when hover */
|
||||
border-top: 2px solid #fff;
|
||||
border-right: 2px solid #000;
|
||||
border-bottom: 2px solid #000;
|
||||
border-left: 2px solid #fff;
|
||||
padding: 0px;
|
||||
background-color: #d8e4e0;
|
||||
}
|
||||
|
||||
.calendar thead .active { /* Active (pressed) buttons in header */
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
background-color: #b8c4c0;
|
||||
}
|
||||
|
||||
/* The body part -- contains all the days in month. */
|
||||
|
||||
.calendar tbody .day { /* Cells <TD> containing month days dates */
|
||||
width: 2em;
|
||||
text-align: right;
|
||||
padding: 2px 4px 2px 2px;
|
||||
}
|
||||
.calendar tbody .day.othermonth {
|
||||
font-size: 80%;
|
||||
color: #aaa;
|
||||
}
|
||||
.calendar tbody .day.othermonth.oweekend {
|
||||
color: #faa;
|
||||
}
|
||||
|
||||
.calendar table .wn {
|
||||
padding: 2px 3px 2px 2px;
|
||||
border-right: 1px solid #000;
|
||||
background: #e8f4f0;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td {
|
||||
background: #d8e4e0;
|
||||
}
|
||||
|
||||
.calendar tbody .rowhilite td.wn {
|
||||
background: #c8d4d0;
|
||||
}
|
||||
|
||||
.calendar tbody td.hilite { /* Hovered cells <TD> */
|
||||
padding: 1px 3px 1px 1px;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
}
|
||||
|
||||
.calendar tbody td.active { /* Active (pressed) cells <TD> */
|
||||
padding: 2px 2px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
.calendar tbody td.selected { /* Cell showing selected date */
|
||||
font-weight: bold;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
padding: 2px 2px 0px 2px;
|
||||
background: #d8e4e0;
|
||||
}
|
||||
|
||||
.calendar tbody td.weekend { /* Cells showing weekend days */
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.calendar tbody td.today { /* Cell showing today date */
|
||||
font-weight: bold;
|
||||
color: #00f;
|
||||
}
|
||||
|
||||
.calendar tbody .disabled { color: #999; }
|
||||
|
||||
.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The footer part -- status bar and "Close" button */
|
||||
|
||||
.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
|
||||
}
|
||||
|
||||
.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
|
||||
background: #e8f4f0;
|
||||
padding: 1px;
|
||||
border: 1px solid #000;
|
||||
background: #788480;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar tfoot .hilite { /* Hover style for buttons in footer */
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
padding: 1px;
|
||||
background: #d8e4e0;
|
||||
}
|
||||
|
||||
.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
|
||||
padding: 2px 0px 0px 2px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
/* Combo boxes (menus that display months/years for direct selection) */
|
||||
|
||||
.calendar .combo {
|
||||
position: absolute;
|
||||
display: none;
|
||||
width: 4em;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
cursor: default;
|
||||
border-top: 1px solid #fff;
|
||||
border-right: 1px solid #000;
|
||||
border-bottom: 1px solid #000;
|
||||
border-left: 1px solid #fff;
|
||||
background: #d8e4e0;
|
||||
font-size: 90%;
|
||||
padding: 1px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.calendar .combo .label,
|
||||
.calendar .combo .label-IEfix {
|
||||
text-align: center;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.calendar .combo .label-IEfix {
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.calendar .combo .active {
|
||||
background: #c8d4d0;
|
||||
padding: 0px;
|
||||
border-top: 1px solid #000;
|
||||
border-right: 1px solid #fff;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-left: 1px solid #000;
|
||||
}
|
||||
|
||||
.calendar .combo .hilite {
|
||||
background: #048;
|
||||
color: #aef;
|
||||
}
|
||||
|
||||
.calendar td.time {
|
||||
border-top: 1px solid #000;
|
||||
padding: 1px 0px;
|
||||
text-align: center;
|
||||
background-color: #e8f0f4;
|
||||
}
|
||||
|
||||
.calendar td.time .hour,
|
||||
.calendar td.time .minute,
|
||||
.calendar td.time .ampm {
|
||||
padding: 0px 3px 0px 4px;
|
||||
border: 1px solid #889;
|
||||
font-weight: bold;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time .ampm {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.calendar td.time .colon {
|
||||
padding: 0px 2px 0px 3px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.calendar td.time span.hilite {
|
||||
border-color: #000;
|
||||
background-color: #667;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.calendar td.time span.active {
|
||||
border-color: #f00;
|
||||
background-color: #000;
|
||||
color: #0f0;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,39 +0,0 @@
|
|||
// ** I18N Afrikaans
|
||||
Calendar._DN = new Array
|
||||
("Sondag",
|
||||
"Maandag",
|
||||
"Dinsdag",
|
||||
"Woensdag",
|
||||
"Donderdag",
|
||||
"Vrydag",
|
||||
"Saterdag",
|
||||
"Sondag");
|
||||
Calendar._MN = new Array
|
||||
("Januarie",
|
||||
"Februarie",
|
||||
"Maart",
|
||||
"April",
|
||||
"Mei",
|
||||
"Junie",
|
||||
"Julie",
|
||||
"Augustus",
|
||||
"September",
|
||||
"Oktober",
|
||||
"November",
|
||||
"Desember");
|
||||
|
||||
// tooltips
|
||||
Calendar._TT = {};
|
||||
Calendar._TT["TOGGLE"] = "Verander eerste dag van die week";
|
||||
Calendar._TT["PREV_YEAR"] = "Vorige jaar (hou vir keuselys)";
|
||||
Calendar._TT["PREV_MONTH"] = "Vorige maand (hou vir keuselys)";
|
||||
Calendar._TT["GO_TODAY"] = "Gaan na vandag";
|
||||
Calendar._TT["NEXT_MONTH"] = "Volgende maand (hou vir keuselys)";
|
||||
Calendar._TT["NEXT_YEAR"] = "Volgende jaar (hou vir keuselys)";
|
||||
Calendar._TT["SEL_DATE"] = "Kies datum";
|
||||
Calendar._TT["DRAG_TO_MOVE"] = "Sleep om te skuif";
|
||||
Calendar._TT["PART_TODAY"] = " (vandag)";
|
||||
Calendar._TT["MON_FIRST"] = "Vertoon Maandag eerste";
|
||||
Calendar._TT["SUN_FIRST"] = "Display Sunday first";
|
||||
Calendar._TT["CLOSE"] = "Close";
|
||||
Calendar._TT["TODAY"] = "Today";
|
|
@ -1,101 +0,0 @@
|
|||
// Calendar ALBANIAN language
|
||||
//author Rigels Gordani rige@hotmail.com
|
||||
|
||||
// ditet
|
||||
Calendar._DN = new Array
|
||||
("E Diele",
|
||||
"E Hene",
|
||||
"E Marte",
|
||||
"E Merkure",
|
||||
"E Enjte",
|
||||
"E Premte",
|
||||
"E Shtune",
|
||||
"E Diele");
|
||||
|
||||
//ditet shkurt
|
||||
Calendar._SDN = new Array
|
||||
("Die",
|
||||
"Hen",
|
||||
"Mar",
|
||||
"Mer",
|
||||
"Enj",
|
||||
"Pre",
|
||||
"Sht",
|
||||
"Die");
|
||||
|
||||
// muajt
|
||||
Calendar._MN = new Array
|
||||
("Janar",
|
||||
"Shkurt",
|
||||
"Mars",
|
||||
"Prill",
|
||||
"Maj",
|
||||
"Qeshor",
|
||||
"Korrik",
|
||||
"Gusht",
|
||||
"Shtator",
|
||||
"Tetor",
|
||||
"Nentor",
|
||||
"Dhjetor");
|
||||
|
||||
// muajte shkurt
|
||||
Calendar._SMN = new Array
|
||||
("Jan",
|
||||
"Shk",
|
||||
"Mar",
|
||||
"Pri",
|
||||
"Maj",
|
||||
"Qes",
|
||||
"Kor",
|
||||
"Gus",
|
||||
"Sht",
|
||||
"Tet",
|
||||
"Nen",
|
||||
"Dhj");
|
||||
|
||||
// ndihmesa
|
||||
Calendar._TT = {};
|
||||
Calendar._TT["INFO"] = "Per kalendarin";
|
||||
|
||||
Calendar._TT["ABOUT"] =
|
||||
"Zgjedhes i ores/dates ne DHTML \n" +
|
||||
"\n\n" +"Zgjedhja e Dates:\n" +
|
||||
"- Perdor butonat \xab, \xbb per te zgjedhur vitin\n" +
|
||||
"- Perdor butonat" + String.fromCharCode(0x2039) + ", " +
|
||||
String.fromCharCode(0x203a) +
|
||||
" per te zgjedhur muajin\n" +
|
||||
"- Mbani shtypur butonin e mousit per nje zgjedje me te shpejte.";
|
||||
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
||||
"Zgjedhja e kohes:\n" +
|
||||
"- Kliko tek ndonje nga pjeset e ores per ta rritur ate\n" +
|
||||
"- ose kliko me Shift per ta zvogeluar ate\n" +
|
||||
"- ose cliko dhe terhiq per zgjedhje me te shpejte.";
|
||||
|
||||
Calendar._TT["PREV_YEAR"] = "Viti i shkuar (prit per menune)";
|
||||
Calendar._TT["PREV_MONTH"] = "Muaji i shkuar (prit per menune)";
|
||||
Calendar._TT["GO_TODAY"] = "Sot";
|
||||
Calendar._TT["NEXT_MONTH"] = "Muaji i ardhshem (prit per menune)";
|
||||
Calendar._TT["NEXT_YEAR"] = "Viti i ardhshem (prit per menune)";
|
||||
Calendar._TT["SEL_DATE"] = "Zgjidh daten";
|
||||
Calendar._TT["DRAG_TO_MOVE"] = "Terhiqe per te levizur";
|
||||
Calendar._TT["PART_TODAY"] = " (sot)";
|
||||
|
||||
// "%s" eshte dita e pare e javes
|
||||
// %s do te zevendesohet me emrin e dite
|
||||
Calendar._TT["DAY_FIRST"] = "Trego te %s te paren";
|
||||
|
||||
|
||||
Calendar._TT["WEEKEND"] = "0,6";
|
||||
|
||||
Calendar._TT["CLOSE"] = "Mbyll";
|
||||
Calendar._TT["TODAY"] = "Sot";
|
||||
Calendar._TT["TIME_PART"] = "Kliko me (Shift-)ose terhiqe per te ndryshuar
|
||||
vleren";
|
||||
|
||||
// date formats
|
||||
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
|
||||
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
|
||||
|
||||
Calendar._TT["WK"] = "Java";
|
||||
Calendar._TT["TIME"] = "Koha:";
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
// ** I18N
|
||||
|
||||
// Calendar BG language
|
||||
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
|
||||
// Translator: Valentin Sheiretsky, <valio@valio.eu.org>
|
||||
// Encoding: Windows-1251
|
||||
// Distributed under the same terms as the calendar itself.
|
||||
|
||||
// For translators: please use UTF-8 if possible. We strongly believe that
|
||||
// Unicode is the answer to a real internationalized world. Also please
|
||||
// include your contact information in the header, as can be seen above.
|
||||
|
||||
// full day names
|
||||
Calendar._DN = new Array
|
||||
("Íåäåëÿ",
|
||||
"Ïîíåäåëíèê",
|
||||
"Âòîðíèê",
|
||||
"Ñðÿäà",
|
||||
"×åòâúðòúê",
|
||||
"Ïåòúê",
|
||||
"Ñúáîòà",
|
||||
"Íåäåëÿ");
|
||||
|
||||
// Please note that the following array of short day names (and the same goes
|
||||
// for short month names, _SMN) isn't absolutely necessary. We give it here
|
||||
// for exemplification on how one can customize the short day names, but if
|
||||
// they are simply the first N letters of the full name you can simply say:
|
||||
//
|
||||
// Calendar._SDN_len = N; // short day name length
|
||||
// Calendar._SMN_len = N; // short month name length
|
||||
//
|
||||
// If N = 3 then this is not needed either since we assume a value of 3 if not
|
||||
// present, to be compatible with translation files that were written before
|
||||
// this feature.
|
||||
|
||||
// short day names
|
||||
Calendar._SDN = new Array
|
||||
("Íåä",
|
||||
"Ïîí",
|
||||
"Âòî",
|
||||
"Ñðÿ",
|
||||
"×åò",
|
||||
"Ïåò",
|
||||
"Ñúá",
|
||||
"Íåä");
|
||||
|
||||
// full month names
|
||||
Calendar._MN = new Array
|
||||
("ßíóàðè",
|
||||
"Ôåâðóàðè",
|
||||
"Ìàðò",
|
||||
"Àïðèë",
|
||||
"Ìàé",
|
||||
"Þíè",
|
||||
"Þëè",
|
||||
"Àâãóñò",
|
||||
"Ñåïòåìâðè",
|
||||
"Îêòîìâðè",
|
||||
"Íîåìâðè",
|
||||
"Äåêåìâðè");
|
||||
|
||||
// short month names
|
||||
Calendar._SMN = new Array
|
||||
("ßíó",
|
||||
"Ôåâ",
|
||||
"Ìàð",
|
||||
"Àïð",
|
||||
"Ìàé",
|
||||
"Þíè",
|
||||
"Þëè",
|
||||
"Àâã",
|
||||
"Ñåï",
|
||||
"Îêò",
|
||||
"Íîå",
|
||||
"Äåê");
|
||||
|
||||
// tooltips
|
||||
Calendar._TT = {};
|
||||
Calendar._TT["INFO"] = "Èíôîðìàöèÿ çà êàëåíäàðà";
|
||||
|
||||
Calendar._TT["ABOUT"] =
|
||||
"DHTML Date/Time Selector\n" +
|
||||
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
|
||||
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
|
||||
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
|
||||
"\n\n" +
|
||||
"Date selection:\n" +
|
||||
"- Use the \xab, \xbb buttons to select year\n" +
|
||||
"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
|
||||
"- Hold mouse button on any of the above buttons for faster selection.";
|
||||
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
||||
"Time selection:\n" +
|
||||
"- Click on any of the time parts to increase it\n" +
|
||||
"- or Shift-click to decrease it\n" +
|
||||
"- or click and drag for faster selection.";
|
||||
|
||||
Calendar._TT["PREV_YEAR"] = "Ïðåäíà ãîäèíà (çàäðúæòå çà ìåíþ)";
|
||||
Calendar._TT["PREV_MONTH"] = "Ïðåäåí ìåñåö (çàäðúæòå çà ìåíþ)";
|
||||
Calendar._TT["GO_TODAY"] = "Èçáåðåòå äíåñ";
|
||||
Calendar._TT["NEXT_MONTH"] = "Ñëåäâàù ìåñåö (çàäðúæòå çà ìåíþ)";
|
||||
Calendar._TT["NEXT_YEAR"] = "Ñëåäâàùà ãîäèíà (çàäðúæòå çà ìåíþ)";
|
||||
Calendar._TT["SEL_DATE"] = "Èçáåðåòå äàòà";
|
||||
Calendar._TT["DRAG_TO_MOVE"] = "Ïðåìåñòâàíå";
|
||||
Calendar._TT["PART_TODAY"] = " (äíåñ)";
|
||||
|
||||
// the following is to inform that "%s" is to be the first day of week
|
||||
// %s will be replaced with the day name.
|
||||
Calendar._TT["DAY_FIRST"] = "%s êàòî ïúðâè äåí";
|
||||
|
||||
// This may be locale-dependent. It specifies the week-end days, as an array
|
||||
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
|
||||
// means Monday, etc.
|
||||
Calendar._TT["WEEKEND"] = "0,6";
|
||||
|
||||
Calendar._TT["CLOSE"] = "Çàòâîðåòå";
|
||||
Calendar._TT["TODAY"] = "Äíåñ";
|
||||
Calendar._TT["TIME_PART"] = "(Shift-)Click èëè drag çà äà ïðîìåíèòå ñòîéíîñòòà";
|
||||
|
||||
// date formats
|
||||
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
|
||||
Calendar._TT["TT_DATE_FORMAT"] = "%A - %e %B %Y";
|
||||
|
||||
Calendar._TT["WK"] = "Ñåäì";
|
||||
Calendar._TT["TIME"] = "×àñ:";
|
|
@ -1,123 +0,0 @@
|
|||
// ** I18N
|
||||
|
||||
// Calendar big5-utf8 language
|
||||
// Author: Gary Fu, <gary@garyfu.idv.tw>
|
||||
// Encoding: utf8
|
||||
// Distributed under the same terms as the calendar itself.
|
||||
|
||||
// For translators: please use UTF-8 if possible. We strongly believe that
|
||||
// Unicode is the answer to a real internationalized world. Also please
|
||||
// include your contact information in the header, as can be seen above.
|
||||
|
||||
// full day names
|
||||
Calendar._DN = new Array
|
||||
("星期日",
|
||||
"星期一",
|
||||
"星期二",
|
||||
"星期三",
|
||||
"星期四",
|
||||
"星期五",
|
||||
"星期六",
|
||||
"星期日");
|
||||
|
||||
// Please note that the following array of short day names (and the same goes
|
||||
// for short month names, _SMN) isn't absolutely necessary. We give it here
|
||||
// for exemplification on how one can customize the short day names, but if
|
||||
// they are simply the first N letters of the full name you can simply say:
|
||||
//
|
||||
// Calendar._SDN_len = N; // short day name length
|
||||
// Calendar._SMN_len = N; // short month name length
|
||||
//
|
||||
// If N = 3 then this is not needed either since we assume a value of 3 if not
|
||||
// present, to be compatible with translation files that were written before
|
||||
// this feature.
|
||||
|
||||
// short day names
|
||||
Calendar._SDN = new Array
|
||||
("日",
|
||||
"一",
|
||||
"二",
|
||||
"三",
|
||||
"四",
|
||||
"五",
|
||||
"六",
|
||||
"日");
|
||||
|
||||
// full month names
|
||||
Calendar._MN = new Array
|
||||
("一月",
|
||||
"二月",
|
||||
"三月",
|
||||
"四月",
|
||||
"五月",
|
||||
"六月",
|
||||
"七月",
|
||||
"八月",
|
||||
"九月",
|
||||
"十月",
|
||||
"十一月",
|
||||
"十二月");
|
||||
|
||||
// short month names
|
||||
Calendar._SMN = new Array
|
||||
("一月",
|
||||
"二月",
|
||||
"三月",
|
||||
"四月",
|
||||
"五月",
|
||||
"六月",
|
||||
"七月",
|
||||
"八月",
|
||||
"九月",
|
||||
"十月",
|
||||
"十一月",
|
||||
"十二月");
|
||||
|
||||
// tooltips
|
||||
Calendar._TT = {};
|
||||
Calendar._TT["INFO"] = "關於";
|
||||
|
||||
Calendar._TT["ABOUT"] =
|
||||
"DHTML Date/Time Selector\n" +
|
||||
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
|
||||
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
|
||||
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
|
||||
"\n\n" +
|
||||
"日期選擇方法:\n" +
|
||||
"- 使用 \xab, \xbb 按鈕可選擇年份\n" +
|
||||
"- 使用 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 按鈕可選擇月份\n" +
|
||||
"- 按住上面的按鈕可以加快選取";
|
||||
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
||||
"時間選擇方法:\n" +
|
||||
"- 點擊任何的時間部份可增加其值\n" +
|
||||
"- 同時按Shift鍵再點擊可減少其值\n" +
|
||||
"- 點擊並拖曳可加快改變的值";
|
||||
|
||||
Calendar._TT["PREV_YEAR"] = "上一年 (按住選單)";
|
||||
Calendar._TT["PREV_MONTH"] = "下一年 (按住選單)";
|
||||
Calendar._TT["GO_TODAY"] = "到今日";
|
||||
Calendar._TT["NEXT_MONTH"] = "上一月 (按住選單)";
|
||||
Calendar._TT["NEXT_YEAR"] = "下一月 (按住選單)";
|
||||
Calendar._TT["SEL_DATE"] = "選擇日期";
|
||||
Calendar._TT["DRAG_TO_MOVE"] = "拖曳";
|
||||
Calendar._TT["PART_TODAY"] = " (今日)";
|
||||
|
||||
// the following is to inform that "%s" is to be the first day of week
|
||||
// %s will be replaced with the day name.
|
||||
Calendar._TT["DAY_FIRST"] = "將 %s 顯示在前";
|
||||
|
||||
// This may be locale-dependent. It specifies the week-end days, as an array
|
||||
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
|
||||
// means Monday, etc.
|
||||
Calendar._TT["WEEKEND"] = "0,6";
|
||||
|
||||
Calendar._TT["CLOSE"] = "關閉";
|
||||
Calendar._TT["TODAY"] = "今日";
|
||||
Calendar._TT["TIME_PART"] = "點擊or拖曳可改變時間(同時按Shift為減)";
|
||||
|
||||
// date formats
|
||||
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
|
||||
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
|
||||
|
||||
Calendar._TT["WK"] = "週";
|
||||
Calendar._TT["TIME"] = "Time:";
|
|
@ -1,123 +0,0 @@
|
|||
// ** I18N
|
||||
|
||||
// Calendar big5 language
|
||||
// Author: Gary Fu, <gary@garyfu.idv.tw>
|
||||
// Encoding: big5
|
||||
// Distributed under the same terms as the calendar itself.
|
||||
|
||||
// For translators: please use UTF-8 if possible. We strongly believe that
|
||||
// Unicode is the answer to a real internationalized world. Also please
|
||||
// include your contact information in the header, as can be seen above.
|
||||
|
||||
// full day names
|
||||
Calendar._DN = new Array
|
||||
("星期日",
|
||||
"星期一",
|
||||
"星期二",
|
||||
"星期三",
|
||||
"星期四",
|
||||
"星期五",
|
||||
"星期六",
|
||||
"星期日");
|
||||
|
||||
// Please note that the following array of short day names (and the same goes
|
||||
// for short month names, _SMN) isn't absolutely necessary. We give it here
|
||||
// for exemplification on how one can customize the short day names, but if
|
||||
// they are simply the first N letters of the full name you can simply say:
|
||||
//
|
||||
// Calendar._SDN_len = N; // short day name length
|
||||
// Calendar._SMN_len = N; // short month name length
|
||||
//
|
||||
// If N = 3 then this is not needed either since we assume a value of 3 if not
|
||||
// present, to be compatible with translation files that were written before
|
||||
// this feature.
|
||||
|
||||
// short day names
|
||||
Calendar._SDN = new Array
|
||||
("日",
|
||||
"一",
|
||||
"二",
|
||||
"三",
|
||||
"四",
|
||||
"五",
|
||||
"六",
|
||||
"日");
|
||||
|
||||
// full month names
|
||||
Calendar._MN = new Array
|
||||
("一月",
|
||||
"二月",
|
||||
"三月",
|
||||
"四月",
|
||||
"五月",
|
||||
"六月",
|
||||
"七月",
|
||||
"八月",
|
||||
"九月",
|
||||
"十月",
|
||||
"十一月",
|
||||
"十二月");
|
||||
|
||||
// short month names
|
||||
Calendar._SMN = new Array
|
||||
("一月",
|
||||
"二月",
|
||||
"三月",
|
||||
"四月",
|
||||
"五月",
|
||||
"六月",
|
||||
"七月",
|
||||
"八月",
|
||||
"九月",
|
||||
"十月",
|
||||
"十一月",
|
||||
"十二月");
|
||||
|
||||
// tooltips
|
||||
Calendar._TT = {};
|
||||
Calendar._TT["INFO"] = "關於";
|
||||
|
||||
Calendar._TT["ABOUT"] =
|
||||
"DHTML Date/Time Selector\n" +
|
||||
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
|
||||
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
|
||||
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
|
||||
"\n\n" +
|
||||
"日期選擇方法:\n" +
|
||||
"- 使用 \xab, \xbb 按鈕可選擇年份\n" +
|
||||
"- 使用 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 按鈕可選擇月份\n" +
|
||||
"- 按住上面的按鈕可以加快選取";
|
||||
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
||||
"時間選擇方法:\n" +
|
||||
"- 點擊任何的時間部份可增加其值\n" +
|
||||
"- 同時按Shift鍵再點擊可減少其值\n" +
|
||||
"- 點擊並拖曳可加快改變的值";
|
||||
|
||||
Calendar._TT["PREV_YEAR"] = "上一年 (按住選單)";
|
||||
Calendar._TT["PREV_MONTH"] = "下一年 (按住選單)";
|
||||
Calendar._TT["GO_TODAY"] = "到今日";
|
||||
Calendar._TT["NEXT_MONTH"] = "上一月 (按住選單)";
|
||||
Calendar._TT["NEXT_YEAR"] = "下一月 (按住選單)";
|
||||
Calendar._TT["SEL_DATE"] = "選擇日期";
|
||||
Calendar._TT["DRAG_TO_MOVE"] = "拖曳";
|
||||
Calendar._TT["PART_TODAY"] = " (今日)";
|
||||
|
||||
// the following is to inform that "%s" is to be the first day of week
|
||||
// %s will be replaced with the day name.
|
||||
Calendar._TT["DAY_FIRST"] = "將 %s 顯示在前";
|
||||
|
||||
// This may be locale-dependent. It specifies the week-end days, as an array
|
||||
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
|
||||
// means Monday, etc.
|
||||
Calendar._TT["WEEKEND"] = "0,6";
|
||||
|
||||
Calendar._TT["CLOSE"] = "關閉";
|
||||
Calendar._TT["TODAY"] = "今日";
|
||||
Calendar._TT["TIME_PART"] = "點擊or拖曳可改變時間(同時按Shift為減)";
|
||||
|
||||
// date formats
|
||||
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
|
||||
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
|
||||
|
||||
Calendar._TT["WK"] = "週";
|
||||
Calendar._TT["TIME"] = "Time:";
|
|
@ -1,108 +0,0 @@
|
|||
// ** I18N
|
||||
|
||||
// Calendar pt-BR language
|
||||
// Author: Fernando Dourado, <fernando.dourado@ig.com.br>
|
||||
// Encoding: any
|
||||
// Distributed under the same terms as the calendar itself.
|
||||
|
||||
// For translators: please use UTF-8 if possible. We strongly believe that
|
||||
// Unicode is the answer to a real internationalized world. Also please
|
||||
// include your contact information in the header, as can be seen above.
|
||||
|
||||
// full day names
|
||||
Calendar._DN = new Array
|
||||
("Domingo",
|
||||
"Segunda",
|
||||
"Terça",
|
||||
"Quarta",
|
||||
"Quinta",
|
||||
"Sexta",
|
||||
"Sabádo",
|
||||
"Domingo");
|
||||
|
||||
// Please note that the following array of short day names (and the same goes
|
||||
// for short month names, _SMN) isn't absolutely necessary. We give it here
|
||||
// for exemplification on how one can customize the short day names, but if
|
||||
// they are simply the first N letters of the full name you can simply say:
|
||||
//
|
||||
// Calendar._SDN_len = N; // short day name length
|
||||
// Calendar._SMN_len = N; // short month name length
|
||||
//
|
||||
// If N = 3 then this is not needed either since we assume a value of 3 if not
|
||||
// present, to be compatible with translation files that were written before
|
||||
// this feature.
|
||||
|
||||
// short day names
|
||||
// [No changes using default values]
|
||||
|
||||
// full month names
|
||||
Calendar._MN = new Array
|
||||
("Janeiro",
|
||||
"Fevereiro",
|
||||
"Março",
|
||||
"Abril",
|
||||
"Maio",
|
||||
"Junho",
|
||||
"Julho",
|
||||
"Agosto",
|
||||
"Setembro",
|
||||
"Outubro",
|
||||
"Novembro",
|
||||
"Dezembro");
|
||||
|
||||
// short month names
|
||||
// [No changes using default values]
|
||||
|
||||
// tooltips
|
||||
Calendar._TT = {};
|
||||
Calendar._TT["INFO"] = "Sobre o calendário";
|
||||
|
||||
Calendar._TT["ABOUT"] =
|
||||
"DHTML Date/Time Selector\n" +
|
||||
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
|
||||
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
|
||||
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
|
||||
"\n\n" +
|
||||
"Translate to portuguese Brazil (pt-BR) by Fernando Dourado (fernando.dourado@ig.com.br)\n" +
|
||||
"Tradução para o português Brasil (pt-BR) por Fernando Dourado (fernando.dourado@ig.com.br)" +
|
||||
"\n\n" +
|
||||
"Selecionar data:\n" +
|
||||
"- Use as teclas \xab, \xbb para selecionar o ano\n" +
|
||||
"- Use as teclas " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para selecionar o mês\n" +
|
||||
"- Clique e segure com o mouse em qualquer botão para selecionar rapidamente.";
|
||||
|
||||
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
||||
"Selecionar hora:\n" +
|
||||
"- Clique em qualquer uma das partes da hora para aumentar\n" +
|
||||
"- ou Shift-clique para diminuir\n" +
|
||||
"- ou clique e arraste para selecionar rapidamente.";
|
||||
|
||||
Calendar._TT["PREV_YEAR"] = "Ano anterior (clique e segure para menu)";
|
||||
Calendar._TT["PREV_MONTH"] = "Mês anterior (clique e segure para menu)";
|
||||
Calendar._TT["GO_TODAY"] = "Ir para a data atual";
|
||||
Calendar._TT["NEXT_MONTH"] = "Próximo mês (clique e segure para menu)";
|
||||
Calendar._TT["NEXT_YEAR"] = "Próximo ano (clique e segure para menu)";
|
||||
Calendar._TT["SEL_DATE"] = "Selecione uma data";
|
||||
Calendar._TT["DRAG_TO_MOVE"] = "Clique e segure para mover";
|
||||
Calendar._TT["PART_TODAY"] = " (hoje)";
|
||||
|
||||
// the following is to inform that "%s" is to be the first day of week
|
||||
// %s will be replaced with the day name.
|
||||
Calendar._TT["DAY_FIRST"] = "Exibir %s primeiro";
|
||||
|
||||
// This may be locale-dependent. It specifies the week-end days, as an array
|
||||
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
|
||||
// means Monday, etc.
|
||||
Calendar._TT["WEEKEND"] = "0,6";
|
||||
|
||||
Calendar._TT["CLOSE"] = "Fechar";
|
||||
Calendar._TT["TODAY"] = "Hoje";
|
||||
Calendar._TT["TIME_PART"] = "(Shift-)Clique ou arraste para mudar o valor";
|
||||
|
||||
// date formats
|
||||
Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y";
|
||||
Calendar._TT["TT_DATE_FORMAT"] = "%d de %B de %Y";
|
||||
|
||||
Calendar._TT["WK"] = "sem";
|
||||
Calendar._TT["TIME"] = "Hora:";
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
// ** I18N
|
||||
|
||||
// Calendar CA language
|
||||
// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
|
||||
// Encoding: any
|
||||
// Distributed under the same terms as the calendar itself.
|
||||
|
||||
// For translators: please use UTF-8 if possible. We strongly believe that
|
||||
// Unicode is the answer to a real internationalized world. Also please
|
||||
// include your contact information in the header, as can be seen above.
|
||||
|
||||
// full day names
|
||||
Calendar._DN = new Array
|
||||
("Diumenge",
|
||||
"Dilluns",
|
||||
"Dimarts",
|
||||
"Dimecres",
|
||||
"Dijous",
|
||||
"Divendres",
|
||||
"Dissabte",
|
||||
"Diumenge");
|
||||
|
||||
// Please note that the following array of short day names (and the same goes
|
||||
// for short month names, _SMN) isn't absolutely necessary. We give it here
|
||||
// for exemplification on how one can customize the short day names, but if
|
||||
// they are simply the first N letters of the full name you can simply say:
|
||||
//
|
||||
// Calendar._SDN_len = N; // short day name length
|
||||
// Calendar._SMN_len = N; // short month name length
|
||||
//
|
||||
// If N = 3 then this is not needed either since we assume a value of 3 if not
|
||||
// present, to be compatible with translation files that were written before
|
||||
// this feature.
|
||||
|
||||
// short day names
|
||||
Calendar._SDN = new Array
|
||||
("Diu",
|
||||
"Dil",
|
||||
"Dmt",
|
||||
"Dmc",
|
||||
"Dij",
|
||||
"Div",
|
||||
"Dis",
|
||||
"Diu");
|
||||
|
||||
// full month names
|
||||
Calendar._MN = new Array
|
||||
("Gener",
|
||||
"Febrer",
|
||||
"Març",
|
||||
"Abril",
|
||||
"Maig",
|
||||
"Juny",
|
||||
"Juliol",
|
||||
"Agost",
|
||||
"Setembre",
|
||||
"Octubre",
|
||||
"Novembre",
|
||||
"Desembre");
|
||||
|
||||
// short month names
|
||||
Calendar._SMN = new Array
|
||||
("Gen",
|
||||
"Feb",
|
||||
"Mar",
|
||||
"Abr",
|
||||
"Mai",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Ago",
|
||||
"Set",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Des");
|
||||
|
||||
// tooltips
|
||||
Calendar._TT = {};
|
||||
Calendar._TT["INFO"] = "Sobre el calendari";
|
||||
|
||||
Calendar._TT["ABOUT"] =
|
||||
"DHTML Selector de Data/Hora\n" +
|
||||
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
|
||||
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
|
||||
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
|
||||
"\n\n" +
|
||||
"Sel.lecció de Dates:\n" +
|
||||
"- Fes servir els botons \xab, \xbb per sel.leccionar l'any\n" +
|
||||
"- Fes servir els botons " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " per se.lecciconar el mes\n" +
|
||||
"- Manté el ratolí apretat en qualsevol dels anteriors per sel.lecció ràpida.";
|
||||
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
||||
"Time selection:\n" +
|
||||
"- claca en qualsevol de les parts de la hora per augmentar-les\n" +
|
||||
"- o Shift-click per decrementar-la\n" +
|
||||
"- or click and arrastra per sel.lecció ràpida.";
|
||||
|
||||
Calendar._TT["PREV_YEAR"] = "Any anterior (Mantenir per menu)";
|
||||
Calendar._TT["PREV_MONTH"] = "Mes anterior (Mantenir per menu)";
|
||||
Calendar._TT["GO_TODAY"] = "Anar a avui";
|
||||
Calendar._TT["NEXT_MONTH"] = "Mes següent (Mantenir per menu)";
|
||||
Calendar._TT["NEXT_YEAR"] = "Any següent (Mantenir per menu)";
|
||||
Calendar._TT["SEL_DATE"] = "Sel.leccionar data";
|
||||
Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar per moure";
|
||||
Calendar._TT["PART_TODAY"] = " (avui)";
|
||||
|
||||
// the following is to inform that "%s" is to be the first day of week
|
||||
// %s will be replaced with the day name.
|
||||
Calendar._TT["DAY_FIRST"] = "Mostra %s primer";
|
||||
|
||||
// This may be locale-dependent. It specifies the week-end days, as an array
|
||||
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
|
||||
// means Monday, etc.
|
||||
Calendar._TT["WEEKEND"] = "0,6";
|
||||
|
||||
Calendar._TT["CLOSE"] = "Tanca";
|
||||
Calendar._TT["TODAY"] = "Avui";
|
||||
Calendar._TT["TIME_PART"] = "(Shift-)Click a arrastra per canviar el valor";
|
||||
|
||||
// date formats
|
||||
Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
|
||||
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
|
||||
|
||||
Calendar._TT["WK"] = "st";
|
||||
Calendar._TT["TIME"] = "Hora:";
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
calendar-cs-win.js
|
||||
language: Czech
|
||||
encoding: windows-1250
|
||||
author: Lubos Jerabek (xnet@seznam.cz)
|
||||
Jan Uhlir (espinosa@centrum.cz)
|
||||
*/
|
||||
|
||||
// ** I18N
|
||||
Calendar._DN = new Array('Neděle','Pondělí','Úterý','Středa','Čtvrtek','Pátek','Sobota','Neděle');
|
||||
Calendar._SDN = new Array('Ne','Po','Út','St','Čt','Pá','So','Ne');
|
||||
Calendar._MN = new Array('Leden','Únor','Březen','Duben','Květen','Červen','Červenec','Srpen','Září','Říjen','Listopad','Prosinec');
|
||||
Calendar._SMN = new Array('Led','Úno','Bře','Dub','Kvě','Črv','Čvc','Srp','Zář','Říj','Lis','Pro');
|
||||
|
||||
// tooltips
|
||||
Calendar._TT = {};
|
||||
Calendar._TT["INFO"] = "O komponentě kalendář";
|
||||
Calendar._TT["TOGGLE"] = "Změna prvního dne v týdnu";
|
||||
Calendar._TT["PREV_YEAR"] = "Předchozí rok (přidrž pro menu)";
|
||||
Calendar._TT["PREV_MONTH"] = "Předchozí měsíc (přidrž pro menu)";
|
||||
Calendar._TT["GO_TODAY"] = "Dnešní datum";
|
||||
Calendar._TT["NEXT_MONTH"] = "Další měsíc (přidrž pro menu)";
|
||||
Calendar._TT["NEXT_YEAR"] = "Další rok (přidrž pro menu)";
|
||||
Calendar._TT["SEL_DATE"] = "Vyber datum";
|
||||
Calendar._TT["DRAG_TO_MOVE"] = "Chyť a táhni, pro přesun";
|
||||
Calendar._TT["PART_TODAY"] = " (dnes)";
|
||||
Calendar._TT["MON_FIRST"] = "Ukaž jako první Pondělí";
|
||||
//Calendar._TT["SUN_FIRST"] = "Ukaž jako první Neděli";
|
||||
|
||||
Calendar._TT["ABOUT"] =
|
||||
"DHTML Date/Time Selector\n" +
|
||||
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
|
||||
"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
|
||||
"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." +
|
||||
"\n\n" +
|
||||
"Výběr datumu:\n" +
|
||||
"- Use the \xab, \xbb buttons to select year\n" +
|
||||
"- Použijte tlačítka " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " k výběru měsíce\n" +
|
||||
"- Podržte tlačítko myši na jakémkoliv z těch tlačítek pro rychlejší výběr.";
|
||||
|
||||
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
||||
"Výběr času:\n" +
|
||||
"- Klikněte na jakoukoliv z částí výběru času pro zvýšení.\n" +
|
||||
"- nebo Shift-click pro snížení\n" +
|
||||
"- nebo klikněte a táhněte pro rychlejší výběr.";
|
||||
|
||||
// the following is to inform that "%s" is to be the first day of week
|
||||
// %s will be replaced with the day name.
|
||||
Calendar._TT["DAY_FIRST"] = "Zobraz %s první";
|
||||
|
||||
// This may be locale-dependent. It specifies the week-end days, as an array
|
||||
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
|
||||
// means Monday, etc.
|
||||
Calendar._TT["WEEKEND"] = "0,6";
|
||||
|
||||
Calendar._TT["CLOSE"] = "Zavřít";
|
||||
Calendar._TT["TODAY"] = "Dnes";
|
||||
Calendar._TT["TIME_PART"] = "(Shift-)Klikni nebo táhni pro změnu hodnoty";
|
||||
|
||||
// date formats
|
||||
Calendar._TT["DEF_DATE_FORMAT"] = "d.m.yy";
|
||||
Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
|
||||
|
||||
Calendar._TT["WK"] = "wk";
|
||||
Calendar._TT["TIME"] = "Čas:";
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue