home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / sunbird / chrome / calendar.jar < prev    next >
PKZip Archive  |  2007-05-23  |  1.4 MB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: PKZip Archive (archive/zip).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert PKZip Archive (archive/zip) magic Supported
66% dexvert JAR Archive (archive/jar) ext Supported
100% file Zip archive data, made by v2.3 UNIX, extract using at least v1.0, last modified, last modified Sun, Feb 25 2005 12:46:22, uncompressed size 8765, method=store default
99% file Zip archive, with extra data prepended default
98% file data default
48% TrID Sweet Home 3D design (generic) default (weak)
32% TrID Mozilla Archive Format (gen) default (weak)
18% TrID ZIP compressed archive default
100% dexmagic PrintFox/Pagefox WEAK default
100% siegfried x-fmt/263 ZIP Format default
100% lsar Zip default
100% gt2 ZIP Archiv gefunden (Auflistung ist deaktiviert) default
100% detectItEasy Archive: Zip(1.0)[100.0%,126 files] default
100% binwalkID Zip archive data, at least v1.0 to extract, compressed size: 8765, uncompressed size: 8765, name: content/calendar/attachFile.js default
100% xdgMime application/zip default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 4b 03 04 0a 00 00 00 | 00 00 cb 65 59 32 95 e9 |PK......|...eY2..|
|00000010| d7 b7 3d 22 00 00 3d 22 | 00 00 1e 00 00 00 63 6f |..="..="|......co|
|00000020| 6e 74 65 6e 74 2f 63 61 | 6c 65 6e 64 61 72 2f 61 |ntent/ca|lendar/a|
|00000030| 74 74 61 63 68 46 69 6c | 65 2e 6a 73 2f 2a 20 2d |ttachFil|e.js/* -|
|00000040| 2a 2d 20 4d 6f 64 65 3a | 20 43 2b 2b 3b 20 74 61 |*- Mode:| C++; ta|
|00000050| 62 2d 77 69 64 74 68 3a | 20 34 3b 20 69 6e 64 65 |b-width:| 4; inde|
|00000060| 6e 74 2d 74 61 62 73 2d | 6d 6f 64 65 3a 20 6e 69 |nt-tabs-|mode: ni|
|00000070| 6c 3b 20 63 2d 62 61 73 | 69 63 2d 6f 66 66 73 65 |l; c-bas|ic-offse|
|00000080| 74 3a 20 34 20 2d 2a 2d | 0a 20 2a 20 2a 2a 2a 2a |t: 4 -*-|. * ****|
|00000090| 2a 20 42 45 47 49 4e 20 | 4c 49 43 45 4e 53 45 20 |* BEGIN |LICENSE |
|000000a0| 42 4c 4f 43 4b 20 2a 2a | 2a 2a 2a 0a 20 2a 20 56 |BLOCK **|***. * V|
|000000b0| 65 72 73 69 6f 6e 3a 20 | 4d 50 4c 20 31 2e 31 2f |ersion: |MPL 1.1/|
|000000c0| 47 50 4c 20 32 2e 30 2f | 4c 47 50 4c 20 32 2e 31 |GPL 2.0/|LGPL 2.1|
|000000d0| 0a 20 2a 0a 20 2a 20 54 | 68 65 20 63 6f 6e 74 65 |. *. * T|he conte|
|000000e0| 6e 74 73 20 6f 66 20 74 | 68 69 73 20 66 69 6c 65 |nts of t|his file|
|000000f0| 20 61 72 65 20 73 75 62 | 6a 65 63 74 20 74 6f 20 | are sub|ject to |
|00000100| 74 68 65 20 4d 6f 7a 69 | 6c 6c 61 20 50 75 62 6c |the Mozi|lla Publ|
|00000110| 69 63 20 4c 69 63 65 6e | 73 65 20 56 65 72 73 69 |ic Licen|se Versi|
|00000120| 6f 6e 0a 20 2a 20 31 2e | 31 20 28 74 68 65 20 22 |on. * 1.|1 (the "|
|00000130| 4c 69 63 65 6e 73 65 22 | 29 3b 20 79 6f 75 20 6d |License"|); you m|
|00000140| 61 79 20 6e 6f 74 20 75 | 73 65 20 74 68 69 73 20 |ay not u|se this |
|00000150| 66 69 6c 65 20 65 78 63 | 65 70 74 20 69 6e 20 63 |file exc|ept in c|
|00000160| 6f 6d 70 6c 69 61 6e 63 | 65 20 77 69 74 68 0a 20 |omplianc|e with. |
|00000170| 2a 20 74 68 65 20 4c 69 | 63 65 6e 73 65 2e 20 59 |* the Li|cense. Y|
|00000180| 6f 75 20 6d 61 79 20 6f | 62 74 61 69 6e 20 61 20 |ou may o|btain a |
|00000190| 63 6f 70 79 20 6f 66 20 | 74 68 65 20 4c 69 63 65 |copy of |the Lice|
|000001a0| 6e 73 65 20 61 74 0a 20 | 2a 20 68 74 74 70 3a 2f |nse at. |* http:/|
|000001b0| 2f 77 77 77 2e 6d 6f 7a | 69 6c 6c 61 2e 6f 72 67 |/www.moz|illa.org|
|000001c0| 2f 4d 50 4c 2f 0a 20 2a | 0a 20 2a 20 53 6f 66 74 |/MPL/. *|. * Soft|
|000001d0| 77 61 72 65 20 64 69 73 | 74 72 69 62 75 74 65 64 |ware dis|tributed|
|000001e0| 20 75 6e 64 65 72 20 74 | 68 65 20 4c 69 63 65 6e | under t|he Licen|
|000001f0| 73 65 20 69 73 20 64 69 | 73 74 72 69 62 75 74 65 |se is di|stribute|
|00000200| 64 20 6f 6e 20 61 6e 20 | 22 41 53 20 49 53 22 20 |d on an |"AS IS" |
|00000210| 62 61 73 69 73 2c 0a 20 | 2a 20 57 49 54 48 4f 55 |basis,. |* WITHOU|
|00000220| 54 20 57 41 52 52 41 4e | 54 59 20 4f 46 20 41 4e |T WARRAN|TY OF AN|
|00000230| 59 20 4b 49 4e 44 2c 20 | 65 69 74 68 65 72 20 65 |Y KIND, |either e|
|00000240| 78 70 72 65 73 73 20 6f | 72 20 69 6d 70 6c 69 65 |xpress o|r implie|
|00000250| 64 2e 20 53 65 65 20 74 | 68 65 20 4c 69 63 65 6e |d. See t|he Licen|
|00000260| 73 65 0a 20 2a 20 66 6f | 72 20 74 68 65 20 73 70 |se. * fo|r the sp|
|00000270| 65 63 69 66 69 63 20 6c | 61 6e 67 75 61 67 65 20 |ecific l|anguage |
|00000280| 67 6f 76 65 72 6e 69 6e | 67 20 72 69 67 68 74 73 |governin|g rights|
|00000290| 20 61 6e 64 20 6c 69 6d | 69 74 61 74 69 6f 6e 73 | and lim|itations|
|000002a0| 20 75 6e 64 65 72 20 74 | 68 65 0a 20 2a 20 4c 69 | under t|he. * Li|
|000002b0| 63 65 6e 73 65 2e 0a 20 | 2a 0a 20 2a 20 54 68 65 |cense.. |*. * The|
|000002c0| 20 4f 72 69 67 69 6e 61 | 6c 20 43 6f 64 65 20 69 | Origina|l Code i|
|000002d0| 73 20 4d 6f 7a 69 6c 6c | 61 20 43 6f 6d 6d 75 6e |s Mozill|a Commun|
|000002e0| 69 63 61 74 6f 72 20 63 | 6c 69 65 6e 74 20 63 6f |icator c|lient co|
|000002f0| 64 65 2c 20 72 65 6c 65 | 61 73 65 64 0a 20 2a 20 |de, rele|ased. * |
|00000300| 4d 61 72 63 68 20 33 31 | 2c 20 31 39 39 38 2e 0a |March 31|, 1998..|
|00000310| 20 2a 0a 20 2a 20 54 68 | 65 20 49 6e 69 74 69 61 | *. * Th|e Initia|
|00000320| 6c 20 44 65 76 65 6c 6f | 70 65 72 20 6f 66 20 74 |l Develo|per of t|
|00000330| 68 65 20 4f 72 69 67 69 | 6e 61 6c 20 43 6f 64 65 |he Origi|nal Code|
|00000340| 20 69 73 0a 20 2a 20 4e | 65 74 73 63 61 70 65 20 | is. * N|etscape |
|00000350| 43 6f 6d 6d 75 6e 69 63 | 61 74 69 6f 6e 73 20 43 |Communic|ations C|
|00000360| 6f 72 70 6f 72 61 74 69 | 6f 6e 2e 0a 20 2a 20 50 |orporati|on.. * P|
|00000370| 6f 72 74 69 6f 6e 73 20 | 63 72 65 61 74 65 64 20 |ortions |created |
|00000380| 62 79 20 74 68 65 20 49 | 6e 69 74 69 61 6c 20 44 |by the I|nitial D|
|00000390| 65 76 65 6c 6f 70 65 72 | 20 61 72 65 20 43 6f 70 |eveloper| are Cop|
|000003a0| 79 72 69 67 68 74 20 28 | 43 29 20 31 39 39 38 2d |yright (|C) 1998-|
|000003b0| 31 39 39 39 0a 20 2a 20 | 74 68 65 20 49 6e 69 74 |1999. * |the Init|
|000003c0| 69 61 6c 20 44 65 76 65 | 6c 6f 70 65 72 2e 20 41 |ial Deve|loper. A|
|000003d0| 6c 6c 20 52 69 67 68 74 | 73 20 52 65 73 65 72 76 |ll Right|s Reserv|
|000003e0| 65 64 2e 0a 20 2a 0a 20 | 2a 20 43 6f 6e 74 72 69 |ed.. *. |* Contri|
|000003f0| 62 75 74 6f 72 28 73 29 | 3a 0a 20 2a 0a 20 2a 20 |butor(s)|:. *. * |
|00000400| 41 6c 74 65 72 6e 61 74 | 69 76 65 6c 79 2c 20 74 |Alternat|ively, t|
|00000410| 68 65 20 63 6f 6e 74 65 | 6e 74 73 20 6f 66 20 74 |he conte|nts of t|
|00000420| 68 69 73 20 66 69 6c 65 | 20 6d 61 79 20 62 65 20 |his file| may be |
|00000430| 75 73 65 64 20 75 6e 64 | 65 72 20 74 68 65 20 74 |used und|er the t|
|00000440| 65 72 6d 73 20 6f 66 0a | 20 2a 20 65 69 74 68 65 |erms of.| * eithe|
|00000450| 72 20 74 68 65 20 47 4e | 55 20 47 65 6e 65 72 61 |r the GN|U Genera|
|00000460| 6c 20 50 75 62 6c 69 63 | 20 4c 69 63 65 6e 73 65 |l Public| License|
|00000470| 20 56 65 72 73 69 6f 6e | 20 32 20 6f 72 20 6c 61 | Version| 2 or la|
|00000480| 74 65 72 20 28 74 68 65 | 20 22 47 50 4c 22 29 2c |ter (the| "GPL"),|
|00000490| 20 6f 72 0a 20 2a 20 74 | 68 65 20 47 4e 55 20 4c | or. * t|he GNU L|
|000004a0| 65 73 73 65 72 20 47 65 | 6e 65 72 61 6c 20 50 75 |esser Ge|neral Pu|
|000004b0| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 20 56 65 72 |blic Lic|ense Ver|
|000004c0| 73 69 6f 6e 20 32 2e 31 | 20 6f 72 20 6c 61 74 65 |sion 2.1| or late|
|000004d0| 72 20 28 74 68 65 20 22 | 4c 47 50 4c 22 29 2c 0a |r (the "|LGPL"),.|
|000004e0| 20 2a 20 69 6e 20 77 68 | 69 63 68 20 63 61 73 65 | * in wh|ich case|
|000004f0| 20 74 68 65 20 70 72 6f | 76 69 73 69 6f 6e 73 20 | the pro|visions |
|00000500| 6f 66 20 74 68 65 20 47 | 50 4c 20 6f 72 20 74 68 |of the G|PL or th|
|00000510| 65 20 4c 47 50 4c 20 61 | 72 65 20 61 70 70 6c 69 |e LGPL a|re appli|
|00000520| 63 61 62 6c 65 20 69 6e | 73 74 65 61 64 0a 20 2a |cable in|stead. *|
|00000530| 20 6f 66 20 74 68 6f 73 | 65 20 61 62 6f 76 65 2e | of thos|e above.|
|00000540| 20 49 66 20 79 6f 75 20 | 77 69 73 68 20 74 6f 20 | If you |wish to |
|00000550| 61 6c 6c 6f 77 20 75 73 | 65 20 6f 66 20 79 6f 75 |allow us|e of you|
|00000560| 72 20 76 65 72 73 69 6f | 6e 20 6f 66 20 74 68 69 |r versio|n of thi|
|00000570| 73 20 66 69 6c 65 20 6f | 6e 6c 79 0a 20 2a 20 75 |s file o|nly. * u|
|00000580| 6e 64 65 72 20 74 68 65 | 20 74 65 72 6d 73 20 6f |nder the| terms o|
|00000590| 66 20 65 69 74 68 65 72 | 20 74 68 65 20 47 50 4c |f either| the GPL|
|000005a0| 20 6f 72 20 74 68 65 20 | 4c 47 50 4c 2c 20 61 6e | or the |LGPL, an|
|000005b0| 64 20 6e 6f 74 20 74 6f | 20 61 6c 6c 6f 77 20 6f |d not to| allow o|
|000005c0| 74 68 65 72 73 20 74 6f | 0a 20 2a 20 75 73 65 20 |thers to|. * use |
|000005d0| 79 6f 75 72 20 76 65 72 | 73 69 6f 6e 20 6f 66 20 |your ver|sion of |
|000005e0| 74 68 69 73 20 66 69 6c | 65 20 75 6e 64 65 72 20 |this fil|e under |
|000005f0| 74 68 65 20 74 65 72 6d | 73 20 6f 66 20 74 68 65 |the term|s of the|
|00000600| 20 4d 50 4c 2c 20 69 6e | 64 69 63 61 74 65 20 79 | MPL, in|dicate y|
|00000610| 6f 75 72 0a 20 2a 20 64 | 65 63 69 73 69 6f 6e 20 |our. * d|ecision |
|00000620| 62 79 20 64 65 6c 65 74 | 69 6e 67 20 74 68 65 20 |by delet|ing the |
|00000630| 70 72 6f 76 69 73 69 6f | 6e 73 20 61 62 6f 76 65 |provisio|ns above|
|00000640| 20 61 6e 64 20 72 65 70 | 6c 61 63 65 20 74 68 65 | and rep|lace the|
|00000650| 6d 20 77 69 74 68 20 74 | 68 65 20 6e 6f 74 69 63 |m with t|he notic|
|00000660| 65 0a 20 2a 20 61 6e 64 | 20 6f 74 68 65 72 20 70 |e. * and| other p|
|00000670| 72 6f 76 69 73 69 6f 6e | 73 20 72 65 71 75 69 72 |rovision|s requir|
|00000680| 65 64 20 62 79 20 74 68 | 65 20 47 50 4c 20 6f 72 |ed by th|e GPL or|
|00000690| 20 74 68 65 20 4c 47 50 | 4c 2e 20 49 66 20 79 6f | the LGP|L. If yo|
|000006a0| 75 20 64 6f 20 6e 6f 74 | 20 64 65 6c 65 74 65 0a |u do not| delete.|
|000006b0| 20 2a 20 74 68 65 20 70 | 72 6f 76 69 73 69 6f 6e | * the p|rovision|
|000006c0| 73 20 61 62 6f 76 65 2c | 20 61 20 72 65 63 69 70 |s above,| a recip|
|000006d0| 69 65 6e 74 20 6d 61 79 | 20 75 73 65 20 79 6f 75 |ient may| use you|
|000006e0| 72 20 76 65 72 73 69 6f | 6e 20 6f 66 20 74 68 69 |r versio|n of thi|
|000006f0| 73 20 66 69 6c 65 20 75 | 6e 64 65 72 0a 20 2a 20 |s file u|nder. * |
|00000700| 74 68 65 20 74 65 72 6d | 73 20 6f 66 20 61 6e 79 |the term|s of any|
|00000710| 20 6f 6e 65 20 6f 66 20 | 74 68 65 20 4d 50 4c 2c | one of |the MPL,|
|00000720| 20 74 68 65 20 47 50 4c | 20 6f 72 20 74 68 65 20 | the GPL| or the |
|00000730| 4c 47 50 4c 2e 0a 20 2a | 0a 20 2a 20 2a 2a 2a 2a |LGPL.. *|. * ****|
|00000740| 2a 20 45 4e 44 20 4c 49 | 43 45 4e 53 45 20 42 4c |* END LI|CENSE BL|
|00000750| 4f 43 4b 20 2a 2a 2a 2a | 2a 20 2a 2f 0a 0a 2f 2a |OCK ****|* */../*|
|00000760| 2a 0a 20 2a 20 49 6e 20 | 6f 72 64 65 72 20 74 6f |*. * In |order to|
|00000770| 20 64 69 73 74 69 6e 67 | 75 69 73 68 20 63 6c 65 | disting|uish cle|
|00000780| 61 72 6c 79 20 67 6c 6f | 62 61 6c 73 20 74 68 61 |arly glo|bals tha|
|00000790| 74 20 61 72 65 20 69 6e | 69 74 69 61 6c 69 7a 65 |t are in|itialize|
|000007a0| 64 20 6f 6e 63 65 20 77 | 68 65 6e 20 6a 73 20 6c |d once w|hen js l|
|000007b0| 6f 61 64 20 28 73 74 61 | 74 69 63 20 67 6c 6f 62 |oad (sta|tic glob|
|000007c0| 61 6c 73 29 20 61 6e 64 | 20 74 68 6f 73 65 20 74 |als) and| those t|
|000007d0| 68 61 74 20 6e 65 65 64 | 20 74 6f 20 62 65 20 0a |hat need| to be .|
|000007e0| 20 2a 20 69 6e 69 74 69 | 61 6c 69 7a 65 20 65 76 | * initi|alize ev|
|000007f0| 65 72 79 20 74 69 6d 65 | 20 61 20 63 6f 6d 70 6f |ery time| a compo|
|00000800| 73 65 20 77 69 6e 64 6f | 77 20 6f 70 65 6e 20 28 |se windo|w open (|
|00000810| 67 6c 6f 62 61 6c 73 29 | 2c 20 49 20 28 64 75 63 |globals)|, I (duc|
|00000820| 61 72 72 6f 7a 29 20 68 | 61 76 65 20 64 65 63 69 |arroz) h|ave deci|
|00000830| 64 65 64 20 74 6f 20 70 | 72 65 66 69 78 20 62 79 |ded to p|refix by|
|00000840| 20 73 2e 2e 2e 20 74 68 | 65 20 73 74 61 74 69 63 | s... th|e static|
|00000850| 20 6f 6e 65 20 61 6e 64 | 0a 20 2a 20 62 79 20 67 | one and|. * by g|
|00000860| 2e 2e 2e 20 74 68 65 20 | 6f 74 68 65 72 20 6f 6e |... the |other on|
|00000870| 65 2e 20 50 6c 65 61 73 | 65 20 74 72 79 20 74 6f |e. Pleas|e try to|
|00000880| 20 63 6f 6e 74 69 6e 75 | 65 20 61 6e 64 20 72 65 | continu|e and re|
|00000890| 70 65 63 74 20 74 68 69 | 73 20 72 75 6c 65 20 69 |pect thi|s rule i|
|000008a0| 6e 20 74 68 65 20 66 75 | 74 75 72 65 2e 20 54 68 |n the fu|ture. Th|
|000008b0| 61 6e 6b 73 2e 0a 20 2a | 2f 0a 2f 2a 2a 0a 20 2a |anks.. *|/./**. *|
|000008c0| 20 73 74 61 74 69 63 20 | 67 6c 6f 62 61 6c 73 2c | static |globals,|
|000008d0| 20 6e 65 65 64 20 74 6f | 20 62 65 20 69 6e 69 74 | need to| be init|
|000008e0| 69 61 6c 69 7a 65 64 20 | 6f 6e 6c 79 20 6f 6e 63 |ialized |only onc|
|000008f0| 65 0a 20 2a 2f 0a 76 61 | 72 20 73 50 72 65 66 73 |e. */.va|r sPrefs|
|00000900| 20 3d 20 6e 75 6c 6c 3b | 0a 76 61 72 20 73 50 72 | = null;|.var sPr|
|00000910| 65 66 42 72 61 6e 63 68 | 49 6e 74 65 72 6e 61 6c |efBranch|Internal|
|00000920| 20 3d 20 6e 75 6c 6c 3b | 0a 0a 63 6f 6e 73 74 20 | = null;|..const |
|00000930| 6b 43 6f 6d 70 6f 73 65 | 41 74 74 61 63 68 44 69 |kCompose|AttachDi|
|00000940| 72 50 72 65 66 4e 61 6d | 65 20 3d 20 22 6d 61 69 |rPrefNam|e = "mai|
|00000950| 6c 2e 63 6f 6d 70 6f 73 | 65 2e 61 74 74 61 63 68 |l.compos|e.attach|
|00000960| 2e 64 69 72 22 3b 0a 0a | 2f 2f 20 46 69 72 73 74 |.dir";..|// First|
|00000970| 20 67 65 74 20 74 68 65 | 20 70 72 65 66 65 72 65 | get the| prefere|
|00000980| 6e 63 65 73 20 73 65 72 | 76 69 63 65 0a 74 72 79 |nces ser|vice.try|
|00000990| 20 7b 0a 20 76 61 72 20 | 70 72 65 66 53 65 72 76 | {. var |prefServ|
|000009a0| 69 63 65 20 3d 20 43 6f | 6d 70 6f 6e 65 6e 74 73 |ice = Co|mponents|
|000009b0| 2e 63 6c 61 73 73 65 73 | 5b 22 40 6d 6f 7a 69 6c |.classes|["@mozil|
|000009c0| 6c 61 2e 6f 72 67 2f 70 | 72 65 66 65 72 65 6e 63 |la.org/p|referenc|
|000009d0| 65 73 2d 73 65 72 76 69 | 63 65 3b 31 22 5d 0a 20 |es-servi|ce;1"]. |
|000009e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000009f0| 20 20 20 20 20 20 20 20 | 20 20 2e 67 65 74 53 65 | | .getSe|
|00000a00| 72 76 69 63 65 28 43 6f | 6d 70 6f 6e 65 6e 74 73 |rvice(Co|mponents|
|00000a10| 2e 69 6e 74 65 72 66 61 | 63 65 73 2e 6e 73 49 50 |.interfa|ces.nsIP|
|00000a20| 72 65 66 53 65 72 76 69 | 63 65 29 3b 0a 20 73 50 |refServi|ce);. sP|
|00000a30| 72 65 66 73 20 3d 20 70 | 72 65 66 53 65 72 76 69 |refs = p|refServi|
|00000a40| 63 65 2e 67 65 74 42 72 | 61 6e 63 68 28 6e 75 6c |ce.getBr|anch(nul|
|00000a50| 6c 29 3b 0a 20 73 50 72 | 65 66 42 72 61 6e 63 68 |l);. sPr|efBranch|
|00000a60| 49 6e 74 65 72 6e 61 6c | 20 3d 20 73 50 72 65 66 |Internal| = sPref|
|00000a70| 73 2e 51 75 65 72 79 49 | 6e 74 65 72 66 61 63 65 |s.QueryI|nterface|
|00000a80| 28 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 69 6e 74 65 |(Compone|nts.inte|
|00000a90| 72 66 61 63 65 73 2e 6e | 73 49 50 72 65 66 42 72 |rfaces.n|sIPrefBr|
|00000aa0| 61 6e 63 68 32 29 3b 0a | 7d 0a 63 61 74 63 68 20 |anch2);.|}.catch |
|00000ab0| 28 65 78 29 20 7b 0a 20 | 64 75 6d 70 28 22 66 61 |(ex) {. |dump("fa|
|00000ac0| 69 6c 65 64 20 74 6f 20 | 70 72 65 66 65 72 65 6e |iled to |preferen|
|00000ad0| 63 65 73 20 73 65 72 76 | 69 63 65 73 5c 6e 22 29 |ces serv|ices\n")|
|00000ae0| 3b 0a 7d 0a 0a 66 75 6e | 63 74 69 6f 6e 20 47 65 |;.}..fun|ction Ge|
|00000af0| 74 4c 61 73 74 41 74 74 | 61 63 68 44 69 72 65 63 |tLastAtt|achDirec|
|00000b00| 74 6f 72 79 28 29 0a 7b | 0a 20 20 76 61 72 20 6c |tory().{|. var l|
|00000b10| 61 73 74 44 69 72 65 63 | 74 6f 72 79 3b 0a 0a 20 |astDirec|tory;.. |
|00000b20| 20 74 72 79 20 7b 0a 20 | 20 20 20 6c 61 73 74 44 | try {. | lastD|
|00000b30| 69 72 65 63 74 6f 72 79 | 20 3d 20 73 50 72 65 66 |irectory| = sPref|
|00000b40| 73 2e 67 65 74 43 6f 6d | 70 6c 65 78 56 61 6c 75 |s.getCom|plexValu|
|00000b50| 65 28 6b 43 6f 6d 70 6f | 73 65 41 74 74 61 63 68 |e(kCompo|seAttach|
|00000b60| 44 69 72 50 72 65 66 4e | 61 6d 65 2c 20 43 6f 6d |DirPrefN|ame, Com|
|00000b70| 70 6f 6e 65 6e 74 73 2e | 69 6e 74 65 72 66 61 63 |ponents.|interfac|
|00000b80| 65 73 2e 6e 73 49 4c 6f | 63 61 6c 46 69 6c 65 29 |es.nsILo|calFile)|
|00000b90| 3b 0a 20 20 7d 0a 20 20 | 63 61 74 63 68 20 28 65 |;. }. |catch (e|
|00000ba0| 78 29 20 7b 0a 20 20 20 | 20 2f 2f 20 74 68 69 73 |x) {. | // this|
|00000bb0| 20 77 69 6c 6c 20 66 61 | 69 6c 20 74 68 65 20 66 | will fa|il the f|
|00000bc0| 69 72 73 74 20 74 69 6d | 65 20 77 65 20 61 74 74 |irst tim|e we att|
|00000bd0| 61 63 68 20 61 20 66 69 | 6c 65 0a 20 20 20 20 2f |ach a fi|le. /|
|00000be0| 2f 20 61 73 20 77 65 20 | 77 6f 6e 27 74 20 68 61 |/ as we |won't ha|
|00000bf0| 76 65 20 61 20 70 72 65 | 66 20 76 61 6c 75 65 2e |ve a pre|f value.|
|00000c00| 0a 20 20 20 20 6c 61 73 | 74 44 69 72 65 63 74 6f |. las|tDirecto|
|00000c10| 72 79 20 3d 20 6e 75 6c | 6c 3b 0a 20 20 7d 0a 0a |ry = nul|l;. }..|
|00000c20| 20 20 72 65 74 75 72 6e | 20 6c 61 73 74 44 69 72 | return| lastDir|
|00000c30| 65 63 74 6f 72 79 3b 0a | 7d 0a 0a 2f 2f 20 61 74 |ectory;.|}..// at|
|00000c40| 74 61 63 68 65 64 4c 6f | 63 61 6c 46 69 6c 65 20 |tachedLo|calFile |
|00000c50| 6d 75 73 74 20 62 65 20 | 61 20 6e 73 49 4c 6f 63 |must be |a nsILoc|
|00000c60| 61 6c 46 69 6c 65 0a 66 | 75 6e 63 74 69 6f 6e 20 |alFile.f|unction |
|00000c70| 53 65 74 4c 61 73 74 41 | 74 74 61 63 68 44 69 72 |SetLastA|ttachDir|
|00000c80| 65 63 74 6f 72 79 28 61 | 74 74 61 63 68 65 64 4c |ectory(a|ttachedL|
|00000c90| 6f 63 61 6c 46 69 6c 65 | 29 0a 7b 0a 20 20 74 72 |ocalFile|).{. tr|
|00000ca0| 79 20 7b 0a 20 20 20 20 | 76 61 72 20 66 69 6c 65 |y {. |var file|
|00000cb0| 20 3d 20 61 74 74 61 63 | 68 65 64 4c 6f 63 61 6c | = attac|hedLocal|
|00000cc0| 46 69 6c 65 2e 51 75 65 | 72 79 49 6e 74 65 72 66 |File.Que|ryInterf|
|00000cd0| 61 63 65 28 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 69 |ace(Comp|onents.i|
|00000ce0| 6e 74 65 72 66 61 63 65 | 73 2e 6e 73 49 46 69 6c |nterface|s.nsIFil|
|00000cf0| 65 29 3b 0a 20 20 20 20 | 76 61 72 20 70 61 72 65 |e);. |var pare|
|00000d00| 6e 74 20 3d 20 66 69 6c | 65 2e 70 61 72 65 6e 74 |nt = fil|e.parent|
|00000d10| 2e 51 75 65 72 79 49 6e | 74 65 72 66 61 63 65 28 |.QueryIn|terface(|
|00000d20| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|00000d30| 66 61 63 65 73 2e 6e 73 | 49 4c 6f 63 61 6c 46 69 |faces.ns|ILocalFi|
|00000d40| 6c 65 29 3b 0a 20 20 20 | 20 0a 20 20 20 20 73 50 |le);. | . sP|
|00000d50| 72 65 66 73 2e 73 65 74 | 43 6f 6d 70 6c 65 78 56 |refs.set|ComplexV|
|00000d60| 61 6c 75 65 28 6b 43 6f | 6d 70 6f 73 65 41 74 74 |alue(kCo|mposeAtt|
|00000d70| 61 63 68 44 69 72 50 72 | 65 66 4e 61 6d 65 2c 20 |achDirPr|efName, |
|00000d80| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|00000d90| 66 61 63 65 73 2e 6e 73 | 49 4c 6f 63 61 6c 46 69 |faces.ns|ILocalFi|
|00000da0| 6c 65 2c 20 70 61 72 65 | 6e 74 29 3b 0a 20 20 7d |le, pare|nt);. }|
|00000db0| 0a 20 20 63 61 74 63 68 | 20 28 65 78 29 20 7b 0a |. catch| (ex) {.|
|00000dc0| 20 20 20 20 64 75 6d 70 | 28 22 65 72 72 6f 72 3a | dump|("error:|
|00000dd0| 20 53 65 74 4c 61 73 74 | 41 74 74 61 63 68 44 69 | SetLast|AttachDi|
|00000de0| 72 65 63 74 6f 72 79 20 | 66 61 69 6c 65 64 3a 20 |rectory |failed: |
|00000df0| 22 20 2b 20 65 78 20 2b | 20 22 5c 6e 22 29 3b 0a |" + ex +| "\n");.|
|00000e00| 20 20 7d 0a 7d 0a 0a 66 | 75 6e 63 74 69 6f 6e 20 | }.}..f|unction |
|00000e10| 41 74 74 61 63 68 46 69 | 6c 65 28 29 0a 7b 0a 20 |AttachFi|le().{. |
|00000e20| 20 76 61 72 20 63 75 72 | 72 65 6e 74 41 74 74 61 | var cur|rentAtta|
|00000e30| 63 68 6d 65 6e 74 20 3d | 20 22 22 3b 0a 20 20 0a |chment =| "";. .|
|00000e40| 20 20 2f 2f 47 65 74 20 | 66 69 6c 65 20 75 73 69 | //Get |file usi|
|00000e50| 6e 67 20 6e 73 49 46 69 | 6c 65 50 69 63 6b 65 72 |ng nsIFi|lePicker|
|00000e60| 20 61 6e 64 20 63 6f 6e | 76 65 72 74 20 74 6f 20 | and con|vert to |
|00000e70| 55 52 4c 0a 20 20 74 72 | 79 20 7b 0a 20 20 20 20 |URL. tr|y {. |
|00000e80| 20 20 76 61 72 20 6e 73 | 49 46 69 6c 65 50 69 63 | var ns|IFilePic|
|00000e90| 6b 65 72 20 3d 20 43 6f | 6d 70 6f 6e 65 6e 74 73 |ker = Co|mponents|
|00000ea0| 2e 69 6e 74 65 72 66 61 | 63 65 73 2e 6e 73 49 46 |.interfa|ces.nsIF|
|00000eb0| 69 6c 65 50 69 63 6b 65 | 72 3b 0a 0a 20 20 20 20 |ilePicke|r;.. |
|00000ec0| 20 20 76 61 72 20 66 70 | 20 3d 20 43 6f 6d 70 6f | var fp| = Compo|
|00000ed0| 6e 65 6e 74 73 2e 63 6c | 61 73 73 65 73 5b 22 40 |nents.cl|asses["@|
|00000ee0| 6d 6f 7a 69 6c 6c 61 2e | 6f 72 67 2f 66 69 6c 65 |mozilla.|org/file|
|00000ef0| 70 69 63 6b 65 72 3b 31 | 22 5d 2e 63 72 65 61 74 |picker;1|"].creat|
|00000f00| 65 49 6e 73 74 61 6e 63 | 65 28 6e 73 49 46 69 6c |eInstanc|e(nsIFil|
|00000f10| 65 50 69 63 6b 65 72 29 | 3b 0a 20 20 20 20 20 20 |ePicker)|;. |
|00000f20| 66 70 2e 69 6e 69 74 28 | 77 69 6e 64 6f 77 2c 20 |fp.init(|window, |
|00000f30| 22 41 74 74 61 63 68 20 | 46 69 6c 65 22 2c 20 6e |"Attach |File", n|
|00000f40| 73 49 46 69 6c 65 50 69 | 63 6b 65 72 2e 6d 6f 64 |sIFilePi|cker.mod|
|00000f50| 65 4f 70 65 6e 29 3b 0a | 20 20 20 20 20 20 0a 20 |eOpen);.| . |
|00000f60| 20 20 20 20 20 76 61 72 | 20 6c 61 73 74 44 69 72 | var| lastDir|
|00000f70| 65 63 74 6f 72 79 20 3d | 20 47 65 74 4c 61 73 74 |ectory =| GetLast|
|00000f80| 41 74 74 61 63 68 44 69 | 72 65 63 74 6f 72 79 28 |AttachDi|rectory(|
|00000f90| 29 3b 0a 20 20 20 20 20 | 20 69 66 20 28 6c 61 73 |);. | if (las|
|00000fa0| 74 44 69 72 65 63 74 6f | 72 79 29 20 0a 20 20 20 |tDirecto|ry) . |
|00000fb0| 20 20 20 20 20 66 70 2e | 64 69 73 70 6c 61 79 44 | fp.|displayD|
|00000fc0| 69 72 65 63 74 6f 72 79 | 20 3d 20 6c 61 73 74 44 |irectory| = lastD|
|00000fd0| 69 72 65 63 74 6f 72 79 | 3b 0a 0a 20 20 20 20 20 |irectory|;.. |
|00000fe0| 20 66 70 2e 61 70 70 65 | 6e 64 46 69 6c 74 65 72 | fp.appe|ndFilter|
|00000ff0| 73 28 6e 73 49 46 69 6c | 65 50 69 63 6b 65 72 2e |s(nsIFil|ePicker.|
|00001000| 66 69 6c 74 65 72 41 6c | 6c 29 3b 0a 20 20 20 20 |filterAl|l);. |
|00001010| 20 20 0a 20 20 20 20 20 | 20 69 66 20 28 66 70 2e | . | if (fp.|
|00001020| 73 68 6f 77 28 29 20 3d | 3d 20 6e 73 49 46 69 6c |show() =|= nsIFil|
|00001030| 65 50 69 63 6b 65 72 2e | 72 65 74 75 72 6e 4f 4b |ePicker.|returnOK|
|00001040| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 20 63 75 72 |) {. | cur|
|00001050| 72 65 6e 74 41 74 74 61 | 63 68 6d 65 6e 74 20 3d |rentAtta|chment =|
|00001060| 20 66 70 2e 66 69 6c 65 | 55 52 4c 2e 73 70 65 63 | fp.file|URL.spec|
|00001070| 3b 0a 20 20 20 20 20 20 | 20 20 20 53 65 74 4c 61 |;. | SetLa|
|00001080| 73 74 41 74 74 61 63 68 | 44 69 72 65 63 74 6f 72 |stAttach|Director|
|00001090| 79 28 66 70 2e 66 69 6c | 65 29 0a 20 20 20 20 20 |y(fp.fil|e). |
|000010a0| 20 7d 0a 20 20 7d 0a 20 | 20 63 61 74 63 68 20 28 | }. }. | catch (|
|000010b0| 65 78 29 20 7b 0a 20 20 | 20 20 64 75 6d 70 28 22 |ex) {. | dump("|
|000010c0| 66 61 69 6c 65 64 20 74 | 6f 20 67 65 74 20 74 68 |failed t|o get th|
|000010d0| 65 20 6c 6f 63 61 6c 20 | 66 69 6c 65 20 74 6f 20 |e local |file to |
|000010e0| 61 74 74 61 63 68 5c 6e | 22 29 3b 0a 20 20 7d 0a |attach\n|");. }.|
|000010f0| 20 20 0a 20 20 69 66 20 | 28 63 75 72 72 65 6e 74 | . if |(current|
|00001100| 41 74 74 61 63 68 6d 65 | 6e 74 20 3d 3d 20 22 22 |Attachme|nt == ""|
|00001110| 29 0a 20 20 20 20 72 65 | 74 75 72 6e 3b 0a 0a 20 |). re|turn;.. |
|00001120| 20 69 66 20 28 44 75 70 | 6c 69 63 61 74 65 46 69 | if (Dup|licateFi|
|00001130| 6c 65 43 68 65 63 6b 28 | 63 75 72 72 65 6e 74 41 |leCheck(|currentA|
|00001140| 74 74 61 63 68 6d 65 6e | 74 29 29 0a 20 20 7b 0a |ttachmen|t)). {.|
|00001150| 20 20 20 20 64 75 6d 70 | 28 22 45 72 72 6f 72 2c | dump|("Error,|
|00001160| 20 61 74 74 61 63 68 69 | 6e 67 20 74 68 65 20 73 | attachi|ng the s|
|00001170| 61 6d 65 20 69 74 65 6d | 20 74 77 69 63 65 5c 6e |ame item| twice\n|
|00001180| 22 29 3b 0a 20 20 7d 0a | 20 20 65 6c 73 65 0a 20 |");. }.| else. |
|00001190| 20 7b 0a 20 20 20 20 76 | 61 72 20 61 74 74 61 63 | {. v|ar attac|
|000011a0| 68 6d 65 6e 74 20 3d 20 | 43 6f 6d 70 6f 6e 65 6e |hment = |Componen|
|000011b0| 74 73 2e 63 6c 61 73 73 | 65 73 5b 22 40 6d 6f 7a |ts.class|es["@moz|
|000011c0| 69 6c 6c 61 2e 6f 72 67 | 2f 6d 65 73 73 65 6e 67 |illa.org|/messeng|
|000011d0| 65 72 63 6f 6d 70 6f 73 | 65 2f 61 74 74 61 63 68 |ercompos|e/attach|
|000011e0| 6d 65 6e 74 3b 31 22 5d | 0a 20 20 20 20 20 20 20 |ment;1"]|. |
|000011f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2e 63 | | .c|
|00001200| 72 65 61 74 65 49 6e 73 | 74 61 6e 63 65 28 43 6f |reateIns|tance(Co|
|00001210| 6d 70 6f 6e 65 6e 74 73 | 2e 69 6e 74 65 72 66 61 |mponents|.interfa|
|00001220| 63 65 73 2e 6e 73 49 4d | 73 67 41 74 74 61 63 68 |ces.nsIM|sgAttach|
|00001230| 6d 65 6e 74 29 3b 0a 20 | 20 20 20 61 74 74 61 63 |ment);. | attac|
|00001240| 68 6d 65 6e 74 2e 75 72 | 6c 20 3d 20 63 75 72 72 |hment.ur|l = curr|
|00001250| 65 6e 74 41 74 74 61 63 | 68 6d 65 6e 74 3b 0a 20 |entAttac|hment;. |
|00001260| 20 20 20 41 64 64 41 74 | 74 61 63 68 6d 65 6e 74 | AddAt|tachment|
|00001270| 28 61 74 74 61 63 68 6d | 65 6e 74 29 3b 0a 20 20 |(attachm|ent);. |
|00001280| 7d 0a 7d 0a 0a 66 75 6e | 63 74 69 6f 6e 20 41 64 |}.}..fun|ction Ad|
|00001290| 64 41 74 74 61 63 68 6d | 65 6e 74 28 61 74 74 61 |dAttachm|ent(atta|
|000012a0| 63 68 6d 65 6e 74 29 0a | 7b 0a 20 20 69 66 20 28 |chment).|{. if (|
|000012b0| 61 74 74 61 63 68 6d 65 | 6e 74 20 26 26 20 61 74 |attachme|nt && at|
|000012c0| 74 61 63 68 6d 65 6e 74 | 2e 75 72 6c 29 0a 20 20 |tachment|.url). |
|000012d0| 7b 0a 20 20 20 20 76 61 | 72 20 62 75 63 6b 65 74 |{. va|r bucket|
|000012e0| 20 3d 20 64 6f 63 75 6d | 65 6e 74 2e 67 65 74 45 | = docum|ent.getE|
|000012f0| 6c 65 6d 65 6e 74 42 79 | 49 64 28 22 61 74 74 61 |lementBy|Id("atta|
|00001300| 63 68 6d 65 6e 74 42 75 | 63 6b 65 74 22 29 3b 0a |chmentBu|cket");.|
|00001310| 20 20 20 20 76 61 72 20 | 69 74 65 6d 20 3d 20 64 | var |item = d|
|00001320| 6f 63 75 6d 65 6e 74 2e | 63 72 65 61 74 65 45 6c |ocument.|createEl|
|00001330| 65 6d 65 6e 74 28 22 6c | 69 73 74 69 74 65 6d 22 |ement("l|istitem"|
|00001340| 29 3b 0a 0a 20 20 20 20 | 69 66 20 28 21 61 74 74 |);.. |if (!att|
|00001350| 61 63 68 6d 65 6e 74 2e | 6e 61 6d 65 29 0a 20 20 |achment.|name). |
|00001360| 20 20 20 20 61 74 74 61 | 63 68 6d 65 6e 74 2e 6e | atta|chment.n|
|00001370| 61 6d 65 20 3d 20 61 74 | 74 61 63 68 6d 65 6e 74 |ame = at|tachment|
|00001380| 2e 75 72 6c 3b 0a 0a 20 | 20 20 20 69 74 65 6d 2e |.url;.. | item.|
|00001390| 73 65 74 41 74 74 72 69 | 62 75 74 65 28 22 6c 61 |setAttri|bute("la|
|000013a0| 62 65 6c 22 2c 20 61 74 | 74 61 63 68 6d 65 6e 74 |bel", at|tachment|
|000013b0| 2e 6e 61 6d 65 29 3b 20 | 20 20 20 2f 2f 75 73 65 |.name); | //use|
|000013c0| 20 66 6f 72 20 64 69 73 | 70 6c 61 79 20 6f 6e 6c | for dis|play onl|
|000013d0| 79 0a 20 20 20 20 69 74 | 65 6d 2e 61 74 74 61 63 |y. it|em.attac|
|000013e0| 68 6d 65 6e 74 20 3d 20 | 61 74 74 61 63 68 6d 65 |hment = |attachme|
|000013f0| 6e 74 3b 20 20 20 2f 2f | 66 75 6c 6c 20 61 74 74 |nt; //|full att|
|00001400| 61 63 68 6d 65 6e 74 20 | 6f 62 6a 65 63 74 20 73 |achment |object s|
|00001410| 74 6f 72 65 64 20 68 65 | 72 65 0a 20 20 20 20 74 |tored he|re. t|
|00001420| 72 79 20 7b 0a 20 20 20 | 20 20 20 69 74 65 6d 2e |ry {. | item.|
|00001430| 73 65 74 41 74 74 72 69 | 62 75 74 65 28 22 74 6f |setAttri|bute("to|
|00001440| 6f 6c 74 69 70 74 65 78 | 74 22 2c 20 64 65 63 6f |oltiptex|t", deco|
|00001450| 64 65 55 52 49 28 61 74 | 74 61 63 68 6d 65 6e 74 |deURI(at|tachment|
|00001460| 2e 75 72 6c 29 29 3b 0a | 20 20 20 20 7d 20 63 61 |.url));.| } ca|
|00001470| 74 63 68 28 65 29 20 7b | 0a 20 20 20 20 20 20 69 |tch(e) {|. i|
|00001480| 74 65 6d 2e 73 65 74 41 | 74 74 72 69 62 75 74 65 |tem.setA|ttribute|
|00001490| 28 22 74 6f 6f 6c 74 69 | 70 74 65 78 74 22 2c 20 |("toolti|ptext", |
|000014a0| 61 74 74 61 63 68 6d 65 | 6e 74 2e 75 72 6c 29 3b |attachme|nt.url);|
|000014b0| 0a 20 20 20 20 7d 0a 20 | 20 20 20 69 74 65 6d 2e |. }. | item.|
|000014c0| 73 65 74 41 74 74 72 69 | 62 75 74 65 28 22 63 6c |setAttri|bute("cl|
|000014d0| 61 73 73 22 2c 20 22 6c | 69 73 74 69 74 65 6d 2d |ass", "l|istitem-|
|000014e0| 69 63 6f 6e 69 63 22 29 | 3b 0a 20 20 20 20 69 74 |iconic")|;. it|
|000014f0| 65 6d 2e 73 65 74 41 74 | 74 72 69 62 75 74 65 28 |em.setAt|tribute(|
|00001500| 22 69 6d 61 67 65 22 2c | 20 22 6d 6f 7a 2d 69 63 |"image",| "moz-ic|
|00001510| 6f 6e 3a 22 20 2b 20 61 | 74 74 61 63 68 6d 65 6e |on:" + a|ttachmen|
|00001520| 74 2e 75 72 6c 29 3b 0a | 20 20 20 20 62 75 63 6b |t.url);.| buck|
|00001530| 65 74 2e 61 70 70 65 6e | 64 43 68 69 6c 64 28 69 |et.appen|dChild(i|
|00001540| 74 65 6d 29 3b 0a 20 20 | 7d 0a 7d 0a 0a 66 75 6e |tem);. |}.}..fun|
|00001550| 63 74 69 6f 6e 20 44 75 | 70 6c 69 63 61 74 65 46 |ction Du|plicateF|
|00001560| 69 6c 65 43 68 65 63 6b | 28 46 69 6c 65 55 72 6c |ileCheck|(FileUrl|
|00001570| 29 0a 7b 0a 20 20 76 61 | 72 20 62 75 63 6b 65 74 |).{. va|r bucket|
|00001580| 20 3d 20 64 6f 63 75 6d | 65 6e 74 2e 67 65 74 45 | = docum|ent.getE|
|00001590| 6c 65 6d 65 6e 74 42 79 | 49 64 28 27 61 74 74 61 |lementBy|Id('atta|
|000015a0| 63 68 6d 65 6e 74 42 75 | 63 6b 65 74 27 29 3b 0a |chmentBu|cket');.|
|000015b0| 20 20 66 6f 72 20 28 76 | 61 72 20 69 6e 64 65 78 | for (v|ar index|
|000015c0| 20 3d 20 30 3b 20 69 6e | 64 65 78 20 3c 20 62 75 | = 0; in|dex < bu|
|000015d0| 63 6b 65 74 2e 63 68 69 | 6c 64 4e 6f 64 65 73 2e |cket.chi|ldNodes.|
|000015e0| 6c 65 6e 67 74 68 3b 20 | 69 6e 64 65 78 2b 2b 29 |length; |index++)|
|000015f0| 0a 20 20 7b 0a 20 20 20 | 20 76 61 72 20 69 74 65 |. {. | var ite|
|00001600| 6d 20 3d 20 62 75 63 6b | 65 74 2e 63 68 69 6c 64 |m = buck|et.child|
|00001610| 4e 6f 64 65 73 5b 69 6e | 64 65 78 5d 3b 0a 20 20 |Nodes[in|dex];. |
|00001620| 20 20 76 61 72 20 61 74 | 74 61 63 68 6d 65 6e 74 | var at|tachment|
|00001630| 20 3d 20 69 74 65 6d 2e | 61 74 74 61 63 68 6d 65 | = item.|attachme|
|00001640| 6e 74 3b 0a 20 20 20 20 | 69 66 20 28 61 74 74 61 |nt;. |if (atta|
|00001650| 63 68 6d 65 6e 74 29 0a | 20 20 20 20 7b 0a 20 20 |chment).| {. |
|00001660| 20 20 20 20 69 66 20 28 | 46 69 6c 65 55 72 6c 20 | if (|FileUrl |
|00001670| 3d 3d 20 61 74 74 61 63 | 68 6d 65 6e 74 2e 75 72 |== attac|hment.ur|
|00001680| 6c 29 0a 20 20 20 20 20 | 20 20 20 20 72 65 74 75 |l). | retu|
|00001690| 72 6e 20 74 72 75 65 3b | 0a 20 20 20 20 7d 0a 20 |rn true;|. }. |
|000016a0| 20 7d 0a 0a 20 20 72 65 | 74 75 72 6e 20 66 61 6c | }.. re|turn fal|
|000016b0| 73 65 3b 0a 7d 0a 0a 66 | 75 6e 63 74 69 6f 6e 20 |se;.}..f|unction |
|000016c0| 52 65 6d 6f 76 65 53 65 | 6c 65 63 74 65 64 41 74 |RemoveSe|lectedAt|
|000016d0| 74 61 63 68 6d 65 6e 74 | 28 29 0a 7b 0a 20 20 76 |tachment|().{. v|
|000016e0| 61 72 20 63 68 69 6c 64 | 3b 0a 20 20 76 61 72 20 |ar child|;. var |
|000016f0| 62 75 63 6b 65 74 20 3d | 20 64 6f 63 75 6d 65 6e |bucket =| documen|
|00001700| 74 2e 67 65 74 45 6c 65 | 6d 65 6e 74 42 79 49 64 |t.getEle|mentById|
|00001710| 28 22 61 74 74 61 63 68 | 6d 65 6e 74 42 75 63 6b |("attach|mentBuck|
|00001720| 65 74 22 29 3b 0a 20 20 | 69 66 20 28 62 75 63 6b |et");. |if (buck|
|00001730| 65 74 2e 73 65 6c 65 63 | 74 65 64 49 74 65 6d 73 |et.selec|tedItems|
|00001740| 2e 6c 65 6e 67 74 68 20 | 3e 20 30 29 20 7b 0a 20 |.length |> 0) {. |
|00001750| 20 20 20 66 6f 72 20 28 | 76 61 72 20 69 74 65 6d | for (|var item|
|00001760| 20 3d 20 62 75 63 6b 65 | 74 2e 73 65 6c 65 63 74 | = bucke|t.select|
|00001770| 65 64 49 74 65 6d 73 2e | 6c 65 6e 67 74 68 20 2d |edItems.|length -|
|00001780| 20 31 3b 20 69 74 65 6d | 20 3e 3d 20 30 3b 20 69 | 1; item| >= 0; i|
|00001790| 74 65 6d 2d 2d 20 29 0a | 20 20 20 20 7b 0a 20 20 |tem-- ).| {. |
|000017a0| 20 20 20 20 63 68 69 6c | 64 20 3d 20 62 75 63 6b | chil|d = buck|
|000017b0| 65 74 2e 72 65 6d 6f 76 | 65 43 68 69 6c 64 28 62 |et.remov|eChild(b|
|000017c0| 75 63 6b 65 74 2e 73 65 | 6c 65 63 74 65 64 49 74 |ucket.se|lectedIt|
|000017d0| 65 6d 73 5b 69 74 65 6d | 5d 29 20 3d 20 6e 75 6c |ems[item|]) = nul|
|000017e0| 6c 3b 0a 20 20 20 20 20 | 20 2f 2f 20 4c 65 74 27 |l;. | // Let'|
|000017f0| 73 20 72 65 6c 65 61 73 | 65 20 74 68 65 20 61 74 |s releas|e the at|
|00001800| 74 61 63 68 6d 65 6e 74 | 20 6f 62 6a 65 63 74 20 |tachment| object |
|00001810| 68 6f 6c 64 20 62 79 20 | 74 68 65 20 6e 6f 64 65 |hold by |the node|
|00001820| 20 65 6c 73 65 20 69 74 | 20 77 6f 6e 27 74 20 67 | else it| won't g|
|00001830| 6f 20 61 77 61 79 20 75 | 6e 74 69 6c 20 74 68 65 |o away u|ntil the|
|00001840| 20 77 69 6e 64 6f 77 20 | 69 73 20 64 65 73 74 72 | window |is destr|
|00001850| 6f 79 65 64 0a 20 20 20 | 20 20 20 63 68 69 6c 64 |oyed. | child|
|00001860| 2e 61 74 74 61 63 68 6d | 65 6e 74 20 3d 20 6e 75 |.attachm|ent = nu|
|00001870| 6c 6c 3b 0a 20 20 20 20 | 7d 0a 20 20 7d 0a 7d 0a |ll;. |}. }.}.|
|00001880| 0a 66 75 6e 63 74 69 6f | 6e 20 41 74 74 61 63 68 |.functio|n Attach|
|00001890| 6d 65 6e 74 42 75 63 6b | 65 74 43 6c 69 63 6b 65 |mentBuck|etClicke|
|000018a0| 64 28 65 76 65 6e 74 29 | 0a 7b 0a 20 20 69 66 20 |d(event)|.{. if |
|000018b0| 28 65 76 65 6e 74 2e 62 | 75 74 74 6f 6e 20 21 3d |(event.b|utton !=|
|000018c0| 20 30 29 0a 20 20 20 20 | 72 65 74 75 72 6e 3b 0a | 0). |return;.|
|000018d0| 0a 20 20 69 66 20 28 65 | 76 65 6e 74 2e 6f 72 69 |. if (e|vent.ori|
|000018e0| 67 69 6e 61 6c 54 61 72 | 67 65 74 2e 6c 6f 63 61 |ginalTar|get.loca|
|000018f0| 6c 4e 61 6d 65 20 3d 3d | 20 22 6c 69 73 74 62 6f |lName ==| "listbo|
|00001900| 78 62 6f 64 79 22 29 0a | 20 20 7b 0a 20 20 20 20 |xbody").| {. |
|00001910| 20 41 74 74 61 63 68 46 | 69 6c 65 28 29 3b 0a 20 | AttachF|ile();. |
|00001920| 20 7d 0a 7d 0a 0a 76 61 | 72 20 61 74 74 61 63 68 | }.}..va|r attach|
|00001930| 6d 65 6e 74 42 75 63 6b | 65 74 4f 62 73 65 72 76 |mentBuck|etObserv|
|00001940| 65 72 20 3d 20 7b 0a 0a | 20 20 63 61 6e 48 61 6e |er = {..| canHan|
|00001950| 64 6c 65 4d 75 6c 74 69 | 70 6c 65 49 74 65 6d 73 |dleMulti|pleItems|
|00001960| 3a 20 74 72 75 65 2c 0a | 0a 20 20 6f 6e 44 72 6f |: true,.|. onDro|
|00001970| 70 3a 20 66 75 6e 63 74 | 69 6f 6e 20 28 61 45 76 |p: funct|ion (aEv|
|00001980| 65 6e 74 2c 20 61 44 61 | 74 61 2c 20 61 44 72 61 |ent, aDa|ta, aDra|
|00001990| 67 53 65 73 73 69 6f 6e | 29 0a 20 20 20 20 7b 0a |gSession|). {.|
|000019a0| 20 20 20 20 20 20 76 61 | 72 20 64 61 74 61 4c 69 | va|r dataLi|
|000019b0| 73 74 20 3d 20 61 44 61 | 74 61 2e 64 61 74 61 4c |st = aDa|ta.dataL|
|000019c0| 69 73 74 3b 0a 20 20 20 | 20 20 20 76 61 72 20 64 |ist;. | var d|
|000019d0| 61 74 61 4c 69 73 74 4c | 65 6e 67 74 68 20 3d 20 |ataListL|ength = |
|000019e0| 64 61 74 61 4c 69 73 74 | 2e 6c 65 6e 67 74 68 3b |dataList|.length;|
|000019f0| 0a 20 20 20 20 20 20 76 | 61 72 20 65 72 72 6f 72 |. v|ar error|
|00001a00| 54 69 74 6c 65 3b 0a 20 | 20 20 20 20 20 76 61 72 |Title;. | var|
|00001a10| 20 61 74 74 61 63 68 6d | 65 6e 74 3b 0a 20 20 20 | attachm|ent;. |
|00001a20| 20 20 20 76 61 72 20 65 | 72 72 6f 72 4d 73 67 3b | var e|rrorMsg;|
|00001a30| 0a 0a 20 20 20 20 20 20 | 66 6f 72 20 28 76 61 72 |.. |for (var|
|00001a40| 20 69 20 3d 20 30 3b 20 | 69 20 3c 20 64 61 74 61 | i = 0; |i < data|
|00001a50| 4c 69 73 74 4c 65 6e 67 | 74 68 3b 20 69 2b 2b 29 |ListLeng|th; i++)|
|00001a60| 20 0a 20 20 20 20 20 20 | 7b 0a 20 20 20 20 20 20 | . |{. |
|00001a70| 20 20 76 61 72 20 69 74 | 65 6d 20 3d 20 64 61 74 | var it|em = dat|
|00001a80| 61 4c 69 73 74 5b 69 5d | 2e 66 69 72 73 74 3b 0a |aList[i]|.first;.|
|00001a90| 20 20 20 20 20 20 20 20 | 76 61 72 20 70 72 65 74 | |var pret|
|00001aa0| 74 79 4e 61 6d 65 3b 0a | 20 20 20 20 20 20 20 20 |tyName;.| |
|00001ab0| 76 61 72 20 72 61 77 44 | 61 74 61 20 3d 20 69 74 |var rawD|ata = it|
|00001ac0| 65 6d 2e 64 61 74 61 3b | 0a 20 20 20 20 20 20 20 |em.data;|. |
|00001ad0| 20 0a 20 20 20 20 20 20 | 20 20 69 66 20 28 69 74 | . | if (it|
|00001ae0| 65 6d 2e 66 6c 61 76 6f | 75 72 2e 63 6f 6e 74 65 |em.flavo|ur.conte|
|00001af0| 6e 74 54 79 70 65 20 3d | 3d 20 22 74 65 78 74 2f |ntType =|= "text/|
|00001b00| 78 2d 6d 6f 7a 2d 75 72 | 6c 22 20 7c 7c 0a 20 20 |x-moz-ur|l" ||. |
|00001b10| 20 20 20 20 20 20 20 20 | 20 20 69 74 65 6d 2e 66 | | item.f|
|00001b20| 6c 61 76 6f 75 72 2e 63 | 6f 6e 74 65 6e 74 54 79 |lavour.c|ontentTy|
|00001b30| 70 65 20 3d 3d 20 22 74 | 65 78 74 2f 78 2d 6d 6f |pe == "t|ext/x-mo|
|00001b40| 7a 2d 6d 65 73 73 61 67 | 65 2d 6f 72 2d 66 6f 6c |z-messag|e-or-fol|
|00001b50| 64 65 72 22 20 7c 7c 0a | 20 20 20 20 20 20 20 20 |der" ||.| |
|00001b60| 20 20 20 20 69 74 65 6d | 2e 66 6c 61 76 6f 75 72 | item|.flavour|
|00001b70| 2e 63 6f 6e 74 65 6e 74 | 54 79 70 65 20 3d 3d 20 |.content|Type == |
|00001b80| 22 61 70 70 6c 69 63 61 | 74 69 6f 6e 2f 78 2d 6d |"applica|tion/x-m|
|00001b90| 6f 7a 2d 66 69 6c 65 22 | 29 0a 20 20 20 20 20 20 |oz-file"|). |
|00001ba0| 20 20 7b 0a 20 20 20 20 | 20 20 20 20 20 20 69 66 | {. | if|
|00001bb0| 20 28 69 74 65 6d 2e 66 | 6c 61 76 6f 75 72 2e 63 | (item.f|lavour.c|
|00001bc0| 6f 6e 74 65 6e 74 54 79 | 70 65 20 3d 3d 20 22 61 |ontentTy|pe == "a|
|00001bd0| 70 70 6c 69 63 61 74 69 | 6f 6e 2f 78 2d 6d 6f 7a |pplicati|on/x-moz|
|00001be0| 2d 66 69 6c 65 22 29 0a | 20 20 20 20 20 20 20 20 |-file").| |
|00001bf0| 20 20 7b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00001c00| 76 61 72 20 69 6f 53 65 | 72 76 69 63 65 20 3d 20 |var ioSe|rvice = |
|00001c10| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 63 6c 61 73 73 |Componen|ts.class|
|00001c20| 65 73 5b 22 40 6d 6f 7a | 69 6c 6c 61 2e 6f 72 67 |es["@moz|illa.org|
|00001c30| 2f 6e 65 74 77 6f 72 6b | 2f 69 6f 2d 73 65 72 76 |/network|/io-serv|
|00001c40| 69 63 65 3b 31 22 5d 0a | 20 20 20 20 20 20 20 20 |ice;1"].| |
|00001c50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001c60| 20 20 20 20 2e 67 65 74 | 53 65 72 76 69 63 65 28 | .get|Service(|
|00001c70| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|00001c80| 66 61 63 65 73 2e 6e 73 | 49 49 4f 53 65 72 76 69 |faces.ns|IIOServi|
|00001c90| 63 65 29 3b 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ce);. | |
|00001ca0| 20 72 61 77 44 61 74 61 | 20 3d 20 69 6f 53 65 72 | rawData| = ioSer|
|00001cb0| 76 69 63 65 2e 67 65 74 | 55 52 4c 53 70 65 63 46 |vice.get|URLSpecF|
|00001cc0| 72 6f 6d 46 69 6c 65 28 | 72 61 77 44 61 74 61 29 |romFile(|rawData)|
|00001cd0| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 7d 0a 20 20 |;. | }. |
|00001ce0| 20 20 20 20 20 20 20 20 | 65 6c 73 65 0a 20 20 20 | |else. |
|00001cf0| 20 20 20 20 20 20 20 7b | 0a 20 20 20 20 20 20 20 | {|. |
|00001d00| 20 20 20 20 20 76 61 72 | 20 73 65 70 61 72 61 74 | var| separat|
|00001d10| 6f 72 20 3d 20 72 61 77 | 44 61 74 61 2e 69 6e 64 |or = raw|Data.ind|
|00001d20| 65 78 4f 66 28 22 5c 6e | 22 29 3b 0a 20 20 20 20 |exOf("\n|");. |
|00001d30| 20 20 20 20 20 20 20 20 | 69 66 20 28 73 65 70 61 | |if (sepa|
|00001d40| 72 61 74 6f 72 20 21 3d | 20 2d 31 29 20 0a 20 20 |rator !=| -1) . |
|00001d50| 20 20 20 20 20 20 20 20 | 20 20 7b 0a 20 20 20 20 | | {. |
|00001d60| 20 20 20 20 20 20 20 20 | 20 20 70 72 65 74 74 79 | | pretty|
|00001d70| 4e 61 6d 65 20 3d 20 72 | 61 77 44 61 74 61 2e 73 |Name = r|awData.s|
|00001d80| 75 62 73 74 72 28 73 65 | 70 61 72 61 74 6f 72 2b |ubstr(se|parator+|
|00001d90| 31 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |1);. | |
|00001da0| 20 20 72 61 77 44 61 74 | 61 20 3d 20 72 61 77 44 | rawDat|a = rawD|
|00001db0| 61 74 61 2e 73 75 62 73 | 74 72 28 30 2c 73 65 70 |ata.subs|tr(0,sep|
|00001dc0| 61 72 61 74 6f 72 29 3b | 0a 20 20 20 20 20 20 20 |arator);|. |
|00001dd0| 20 20 20 20 20 7d 0a 20 | 20 20 20 20 20 20 20 20 | }. | |
|00001de0| 20 7d 0a 0a 20 20 20 20 | 20 20 20 20 20 20 69 66 | }.. | if|
|00001df0| 20 28 44 75 70 6c 69 63 | 61 74 65 46 69 6c 65 43 | (Duplic|ateFileC|
|00001e00| 68 65 63 6b 28 72 61 77 | 44 61 74 61 29 29 20 0a |heck(raw|Data)) .|
|00001e10| 20 20 20 20 20 20 20 20 | 20 20 7b 0a 20 20 20 20 | | {. |
|00001e20| 20 20 20 20 20 20 20 20 | 64 75 6d 70 28 22 45 72 | |dump("Er|
|00001e30| 72 6f 72 2c 20 61 74 74 | 61 63 68 69 6e 67 20 74 |ror, att|aching t|
|00001e40| 68 65 20 73 61 6d 65 20 | 69 74 65 6d 20 74 77 69 |he same |item twi|
|00001e50| 63 65 5c 6e 22 29 3b 0a | 20 20 20 20 20 20 20 20 |ce\n");.| |
|00001e60| 20 20 7d 0a 20 20 20 20 | 20 20 20 20 20 20 65 6c | }. | el|
|00001e70| 73 65 20 0a 20 20 20 20 | 20 20 20 20 20 20 7b 0a |se . | {.|
|00001e80| 20 20 20 20 20 20 20 20 | 20 20 20 20 61 74 74 61 | | atta|
|00001e90| 63 68 6d 65 6e 74 20 3d | 20 43 6f 6d 70 6f 6e 65 |chment =| Compone|
|00001ea0| 6e 74 73 2e 63 6c 61 73 | 73 65 73 5b 22 40 6d 6f |nts.clas|ses["@mo|
|00001eb0| 7a 69 6c 6c 61 2e 6f 72 | 67 2f 6d 65 73 73 65 6e |zilla.or|g/messen|
|00001ec0| 67 65 72 63 6f 6d 70 6f | 73 65 2f 61 74 74 61 63 |gercompo|se/attac|
|00001ed0| 68 6d 65 6e 74 3b 31 22 | 5d 0a 20 20 20 20 20 20 |hment;1"|]. |
|00001ee0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001ef0| 20 20 20 2e 63 72 65 61 | 74 65 49 6e 73 74 61 6e | .crea|teInstan|
|00001f00| 63 65 28 43 6f 6d 70 6f | 6e 65 6e 74 73 2e 69 6e |ce(Compo|nents.in|
|00001f10| 74 65 72 66 61 63 65 73 | 2e 6e 73 49 4d 73 67 41 |terfaces|.nsIMsgA|
|00001f20| 74 74 61 63 68 6d 65 6e | 74 29 3b 0a 20 20 20 20 |ttachmen|t);. |
|00001f30| 20 20 20 20 20 20 20 20 | 61 74 74 61 63 68 6d 65 | |attachme|
|00001f40| 6e 74 2e 75 72 6c 20 3d | 20 72 61 77 44 61 74 61 |nt.url =| rawData|
|00001f50| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 61 74 |;. | at|
|00001f60| 74 61 63 68 6d 65 6e 74 | 2e 6e 61 6d 65 20 3d 20 |tachment|.name = |
|00001f70| 70 72 65 74 74 79 4e 61 | 6d 65 3b 0a 20 20 20 20 |prettyNa|me;. |
|00001f80| 20 20 20 20 20 20 20 20 | 41 64 64 41 74 74 61 63 | |AddAttac|
|00001f90| 68 6d 65 6e 74 28 61 74 | 74 61 63 68 6d 65 6e 74 |hment(at|tachment|
|00001fa0| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 20 7d 0a 20 |);. | }. |
|00001fb0| 20 20 20 20 20 20 20 7d | 0a 20 20 20 20 20 20 7d | }|. }|
|00001fc0| 0a 20 20 20 20 7d 2c 0a | 0a 20 20 6f 6e 44 72 61 |. },.|. onDra|
|00001fd0| 67 4f 76 65 72 3a 20 66 | 75 6e 63 74 69 6f 6e 20 |gOver: f|unction |
|00001fe0| 28 61 45 76 65 6e 74 2c | 20 61 46 6c 61 76 6f 75 |(aEvent,| aFlavou|
|00001ff0| 72 2c 20 61 44 72 61 67 | 53 65 73 73 69 6f 6e 29 |r, aDrag|Session)|
|00002000| 0a 20 20 20 20 7b 0a 20 | 20 20 20 20 20 76 61 72 |. {. | var|
|00002010| 20 61 74 74 61 63 68 6d | 65 6e 74 42 75 63 6b 65 | attachm|entBucke|
|00002020| 74 20 3d 20 64 6f 63 75 | 6d 65 6e 74 2e 67 65 74 |t = docu|ment.get|
|00002030| 45 6c 65 6d 65 6e 74 42 | 79 49 64 28 22 61 74 74 |ElementB|yId("att|
|00002040| 61 63 68 6d 65 6e 74 42 | 75 63 6b 65 74 22 29 3b |achmentB|ucket");|
|00002050| 0a 20 20 20 20 20 20 61 | 74 74 61 63 68 6d 65 6e |. a|ttachmen|
|00002060| 74 42 75 63 6b 65 74 2e | 73 65 74 41 74 74 72 69 |tBucket.|setAttri|
|00002070| 62 75 74 65 28 22 64 72 | 61 67 6f 76 65 72 22 2c |bute("dr|agover",|
|00002080| 20 22 74 72 75 65 22 29 | 3b 0a 20 20 20 20 7d 2c | "true")|;. },|
|00002090| 0a 0a 20 20 6f 6e 44 72 | 61 67 45 78 69 74 3a 20 |.. onDr|agExit: |
|000020a0| 66 75 6e 63 74 69 6f 6e | 20 28 61 45 76 65 6e 74 |function| (aEvent|
|000020b0| 2c 20 61 44 72 61 67 53 | 65 73 73 69 6f 6e 29 0a |, aDragS|ession).|
|000020c0| 20 20 20 20 7b 0a 20 20 | 20 20 20 20 76 61 72 20 | {. | var |
|000020d0| 61 74 74 61 63 68 6d 65 | 6e 74 42 75 63 6b 65 74 |attachme|ntBucket|
|000020e0| 20 3d 20 64 6f 63 75 6d | 65 6e 74 2e 67 65 74 45 | = docum|ent.getE|
|000020f0| 6c 65 6d 65 6e 74 42 79 | 49 64 28 22 61 74 74 61 |lementBy|Id("atta|
|00002100| 63 68 6d 65 6e 74 42 75 | 63 6b 65 74 22 29 3b 0a |chmentBu|cket");.|
|00002110| 20 20 20 20 20 20 61 74 | 74 61 63 68 6d 65 6e 74 | at|tachment|
|00002120| 42 75 63 6b 65 74 2e 72 | 65 6d 6f 76 65 41 74 74 |Bucket.r|emoveAtt|
|00002130| 72 69 62 75 74 65 28 22 | 64 72 61 67 6f 76 65 72 |ribute("|dragover|
|00002140| 22 29 3b 0a 20 20 20 20 | 7d 2c 0a 0a 20 20 67 65 |");. |},.. ge|
|00002150| 74 53 75 70 70 6f 72 74 | 65 64 46 6c 61 76 6f 75 |tSupport|edFlavou|
|00002160| 72 73 3a 20 66 75 6e 63 | 74 69 6f 6e 20 28 29 0a |rs: func|tion ().|
|00002170| 20 20 20 20 7b 0a 20 20 | 20 20 20 20 76 61 72 20 | {. | var |
|00002180| 66 6c 61 76 6f 75 72 53 | 65 74 20 3d 20 6e 65 77 |flavourS|et = new|
|00002190| 20 46 6c 61 76 6f 75 72 | 53 65 74 28 29 3b 0a 20 | Flavour|Set();. |
|000021a0| 20 20 20 20 20 66 6c 61 | 76 6f 75 72 53 65 74 2e | fla|vourSet.|
|000021b0| 61 70 70 65 6e 64 46 6c | 61 76 6f 75 72 28 22 74 |appendFl|avour("t|
|000021c0| 65 78 74 2f 78 2d 6d 6f | 7a 2d 75 72 6c 22 29 3b |ext/x-mo|z-url");|
|000021d0| 0a 20 20 20 20 20 20 66 | 6c 61 76 6f 75 72 53 65 |. f|lavourSe|
|000021e0| 74 2e 61 70 70 65 6e 64 | 46 6c 61 76 6f 75 72 28 |t.append|Flavour(|
|000021f0| 22 74 65 78 74 2f 78 2d | 6d 6f 7a 2d 6d 65 73 73 |"text/x-|moz-mess|
|00002200| 61 67 65 2d 6f 72 2d 66 | 6f 6c 64 65 72 22 29 3b |age-or-f|older");|
|00002210| 0a 20 20 20 20 20 20 66 | 6c 61 76 6f 75 72 53 65 |. f|lavourSe|
|00002220| 74 2e 61 70 70 65 6e 64 | 46 6c 61 76 6f 75 72 28 |t.append|Flavour(|
|00002230| 22 61 70 70 6c 69 63 61 | 74 69 6f 6e 2f 78 2d 6d |"applica|tion/x-m|
|00002240| 6f 7a 2d 66 69 6c 65 22 | 2c 20 22 6e 73 49 46 69 |oz-file"|, "nsIFi|
|00002250| 6c 65 22 29 3b 0a 20 20 | 20 20 20 20 72 65 74 75 |le");. | retu|
|00002260| 72 6e 20 66 6c 61 76 6f | 75 72 53 65 74 3b 0a 20 |rn flavo|urSet;. |
|00002270| 20 20 20 7d 0a 7d 3b 0a | 0a 50 4b 03 04 0a 00 00 | }.};.|.PK.....|
|00002280| 00 00 00 c6 95 4c 36 cf | cd 42 da 78 3b 00 00 78 |.....L6.|.B.x;..x|
|00002290| 3b 00 00 26 00 00 00 63 | 6f 6e 74 65 6e 74 2f 63 |;..&...c|ontent/c|
|000022a0| 61 6c 65 6e 64 61 72 2f | 63 61 6c 65 6e 64 61 72 |alendar/|calendar|
|000022b0| 4d 61 6e 61 67 65 6d 65 | 6e 74 2e 6a 73 2f 2a 20 |Manageme|nt.js/* |
|000022c0| 2d 2a 2d 20 4d 6f 64 65 | 3a 20 6a 61 76 61 73 63 |-*- Mode|: javasc|
|000022d0| 72 69 70 74 3b 20 74 61 | 62 2d 77 69 64 74 68 3a |ript; ta|b-width:|
|000022e0| 20 32 30 3b 20 69 6e 64 | 65 6e 74 2d 74 61 62 73 | 20; ind|ent-tabs|
|000022f0| 2d 6d 6f 64 65 3a 20 6e | 69 6c 3b 20 63 2d 62 61 |-mode: n|il; c-ba|
|00002300| 73 69 63 2d 6f 66 66 73 | 65 74 3a 20 34 20 2d 2a |sic-offs|et: 4 -*|
|00002310| 2d 20 2a 2f 0a 2f 2a 20 | 2a 2a 2a 2a 2a 20 42 45 |- */./* |***** BE|
|00002320| 47 49 4e 20 4c 49 43 45 | 4e 53 45 20 42 4c 4f 43 |GIN LICE|NSE BLOC|
|00002330| 4b 20 2a 2a 2a 2a 2a 0a | 20 2a 20 56 65 72 73 69 |K *****.| * Versi|
|00002340| 6f 6e 3a 20 4d 50 4c 20 | 31 2e 31 2f 47 50 4c 20 |on: MPL |1.1/GPL |
|00002350| 32 2e 30 2f 4c 47 50 4c | 20 32 2e 31 0a 20 2a 0a |2.0/LGPL| 2.1. *.|
|00002360| 20 2a 20 54 68 65 20 63 | 6f 6e 74 65 6e 74 73 20 | * The c|ontents |
|00002370| 6f 66 20 74 68 69 73 20 | 66 69 6c 65 20 61 72 65 |of this |file are|
|00002380| 20 73 75 62 6a 65 63 74 | 20 74 6f 20 74 68 65 20 | subject| to the |
|00002390| 4d 6f 7a 69 6c 6c 61 20 | 50 75 62 6c 69 63 20 4c |Mozilla |Public L|
|000023a0| 69 63 65 6e 73 65 20 56 | 65 72 73 69 6f 6e 0a 20 |icense V|ersion. |
|000023b0| 2a 20 31 2e 31 20 28 74 | 68 65 20 22 4c 69 63 65 |* 1.1 (t|he "Lice|
|000023c0| 6e 73 65 22 29 3b 20 79 | 6f 75 20 6d 61 79 20 6e |nse"); y|ou may n|
|000023d0| 6f 74 20 75 73 65 20 74 | 68 69 73 20 66 69 6c 65 |ot use t|his file|
|000023e0| 20 65 78 63 65 70 74 20 | 69 6e 20 63 6f 6d 70 6c | except |in compl|
|000023f0| 69 61 6e 63 65 20 77 69 | 74 68 0a 20 2a 20 74 68 |iance wi|th. * th|
|00002400| 65 20 4c 69 63 65 6e 73 | 65 2e 20 59 6f 75 20 6d |e Licens|e. You m|
|00002410| 61 79 20 6f 62 74 61 69 | 6e 20 61 20 63 6f 70 79 |ay obtai|n a copy|
|00002420| 20 6f 66 20 74 68 65 20 | 4c 69 63 65 6e 73 65 20 | of the |License |
|00002430| 61 74 0a 20 2a 20 68 74 | 74 70 3a 2f 2f 77 77 77 |at. * ht|tp://www|
|00002440| 2e 6d 6f 7a 69 6c 6c 61 | 2e 6f 72 67 2f 4d 50 4c |.mozilla|.org/MPL|
|00002450| 2f 0a 20 2a 0a 20 2a 20 | 53 6f 66 74 77 61 72 65 |/. *. * |Software|
|00002460| 20 64 69 73 74 72 69 62 | 75 74 65 64 20 75 6e 64 | distrib|uted und|
|00002470| 65 72 20 74 68 65 20 4c | 69 63 65 6e 73 65 20 69 |er the L|icense i|
|00002480| 73 20 64 69 73 74 72 69 | 62 75 74 65 64 20 6f 6e |s distri|buted on|
|00002490| 20 61 6e 20 22 41 53 20 | 49 53 22 20 62 61 73 69 | an "AS |IS" basi|
|000024a0| 73 2c 0a 20 2a 20 57 49 | 54 48 4f 55 54 20 57 41 |s,. * WI|THOUT WA|
|000024b0| 52 52 41 4e 54 59 20 4f | 46 20 41 4e 59 20 4b 49 |RRANTY O|F ANY KI|
|000024c0| 4e 44 2c 20 65 69 74 68 | 65 72 20 65 78 70 72 65 |ND, eith|er expre|
|000024d0| 73 73 20 6f 72 20 69 6d | 70 6c 69 65 64 2e 20 53 |ss or im|plied. S|
|000024e0| 65 65 20 74 68 65 20 4c | 69 63 65 6e 73 65 0a 20 |ee the L|icense. |
|000024f0| 2a 20 66 6f 72 20 74 68 | 65 20 73 70 65 63 69 66 |* for th|e specif|
|00002500| 69 63 20 6c 61 6e 67 75 | 61 67 65 20 67 6f 76 65 |ic langu|age gove|
|00002510| 72 6e 69 6e 67 20 72 69 | 67 68 74 73 20 61 6e 64 |rning ri|ghts and|
|00002520| 20 6c 69 6d 69 74 61 74 | 69 6f 6e 73 20 75 6e 64 | limitat|ions und|
|00002530| 65 72 20 74 68 65 0a 20 | 2a 20 4c 69 63 65 6e 73 |er the. |* Licens|
|00002540| 65 2e 0a 20 2a 0a 20 2a | 20 54 68 65 20 4f 72 69 |e.. *. *| The Ori|
|00002550| 67 69 6e 61 6c 20 43 6f | 64 65 20 69 73 20 6d 6f |ginal Co|de is mo|
|00002560| 7a 69 6c 6c 61 20 63 61 | 6c 65 6e 64 61 72 20 63 |zilla ca|lendar c|
|00002570| 6f 64 65 2e 0a 20 2a 0a | 20 2a 20 54 68 65 20 49 |ode.. *.| * The I|
|00002580| 6e 69 74 69 61 6c 20 44 | 65 76 65 6c 6f 70 65 72 |nitial D|eveloper|
|00002590| 20 6f 66 20 74 68 65 20 | 4f 72 69 67 69 6e 61 6c | of the |Original|
|000025a0| 20 43 6f 64 65 20 69 73 | 0a 20 2a 20 20 4d 69 63 | Code is|. * Mic|
|000025b0| 68 69 65 6c 20 76 61 6e | 20 4c 65 65 75 77 65 6e |hiel van| Leeuwen|
|000025c0| 20 3c 6d 76 6c 40 65 78 | 65 64 6f 2e 6e 6c 3e 0a | <mvl@ex|edo.nl>.|
|000025d0| 20 2a 20 50 6f 72 74 69 | 6f 6e 73 20 63 72 65 61 | * Porti|ons crea|
|000025e0| 74 65 64 20 62 79 20 74 | 68 65 20 49 6e 69 74 69 |ted by t|he Initi|
|000025f0| 61 6c 20 44 65 76 65 6c | 6f 70 65 72 20 61 72 65 |al Devel|oper are|
|00002600| 20 43 6f 70 79 72 69 67 | 68 74 20 28 43 29 20 32 | Copyrig|ht (C) 2|
|00002610| 30 30 34 0a 20 2a 20 74 | 68 65 20 49 6e 69 74 69 |004. * t|he Initi|
|00002620| 61 6c 20 44 65 76 65 6c | 6f 70 65 72 2e 20 41 6c |al Devel|oper. Al|
|00002630| 6c 20 52 69 67 68 74 73 | 20 52 65 73 65 72 76 65 |l Rights| Reserve|
|00002640| 64 2e 0a 20 2a 0a 20 2a | 20 43 6f 6e 74 72 69 62 |d.. *. *| Contrib|
|00002650| 75 74 6f 72 28 73 29 3a | 0a 20 2a 20 20 20 4a 6f |utor(s):|. * Jo|
|00002660| 65 79 20 4d 69 6e 74 61 | 20 3c 6a 6d 69 6e 74 61 |ey Minta| <jminta|
|00002670| 40 67 6d 61 69 6c 2e 63 | 6f 6d 3e 0a 20 2a 0a 20 |@gmail.c|om>. *. |
|00002680| 2a 20 41 6c 74 65 72 6e | 61 74 69 76 65 6c 79 2c |* Altern|atively,|
|00002690| 20 74 68 65 20 63 6f 6e | 74 65 6e 74 73 20 6f 66 | the con|tents of|
|000026a0| 20 74 68 69 73 20 66 69 | 6c 65 20 6d 61 79 20 62 | this fi|le may b|
|000026b0| 65 20 75 73 65 64 20 75 | 6e 64 65 72 20 74 68 65 |e used u|nder the|
|000026c0| 20 74 65 72 6d 73 20 6f | 66 0a 20 2a 20 65 69 74 | terms o|f. * eit|
|000026d0| 68 65 72 20 74 68 65 20 | 47 4e 55 20 47 65 6e 65 |her the |GNU Gene|
|000026e0| 72 61 6c 20 50 75 62 6c | 69 63 20 4c 69 63 65 6e |ral Publ|ic Licen|
|000026f0| 73 65 20 56 65 72 73 69 | 6f 6e 20 32 20 6f 72 20 |se Versi|on 2 or |
|00002700| 6c 61 74 65 72 20 28 74 | 68 65 20 22 47 50 4c 22 |later (t|he "GPL"|
|00002710| 29 2c 20 6f 72 0a 20 2a | 20 74 68 65 20 47 4e 55 |), or. *| the GNU|
|00002720| 20 4c 65 73 73 65 72 20 | 47 65 6e 65 72 61 6c 20 | Lesser |General |
|00002730| 50 75 62 6c 69 63 20 4c | 69 63 65 6e 73 65 20 56 |Public L|icense V|
|00002740| 65 72 73 69 6f 6e 20 32 | 2e 31 20 6f 72 20 6c 61 |ersion 2|.1 or la|
|00002750| 74 65 72 20 28 74 68 65 | 20 22 4c 47 50 4c 22 29 |ter (the| "LGPL")|
|00002760| 2c 0a 20 2a 20 69 6e 20 | 77 68 69 63 68 20 63 61 |,. * in |which ca|
|00002770| 73 65 20 74 68 65 20 70 | 72 6f 76 69 73 69 6f 6e |se the p|rovision|
|00002780| 73 20 6f 66 20 74 68 65 | 20 47 50 4c 20 6f 72 20 |s of the| GPL or |
|00002790| 74 68 65 20 4c 47 50 4c | 20 61 72 65 20 61 70 70 |the LGPL| are app|
|000027a0| 6c 69 63 61 62 6c 65 20 | 69 6e 73 74 65 61 64 0a |licable |instead.|
|000027b0| 20 2a 20 6f 66 20 74 68 | 6f 73 65 20 61 62 6f 76 | * of th|ose abov|
|000027c0| 65 2e 20 49 66 20 79 6f | 75 20 77 69 73 68 20 74 |e. If yo|u wish t|
|000027d0| 6f 20 61 6c 6c 6f 77 20 | 75 73 65 20 6f 66 20 79 |o allow |use of y|
|000027e0| 6f 75 72 20 76 65 72 73 | 69 6f 6e 20 6f 66 20 74 |our vers|ion of t|
|000027f0| 68 69 73 20 66 69 6c 65 | 20 6f 6e 6c 79 0a 20 2a |his file| only. *|
|00002800| 20 75 6e 64 65 72 20 74 | 68 65 20 74 65 72 6d 73 | under t|he terms|
|00002810| 20 6f 66 20 65 69 74 68 | 65 72 20 74 68 65 20 47 | of eith|er the G|
|00002820| 50 4c 20 6f 72 20 74 68 | 65 20 4c 47 50 4c 2c 20 |PL or th|e LGPL, |
|00002830| 61 6e 64 20 6e 6f 74 20 | 74 6f 20 61 6c 6c 6f 77 |and not |to allow|
|00002840| 20 6f 74 68 65 72 73 20 | 74 6f 0a 20 2a 20 75 73 | others |to. * us|
|00002850| 65 20 79 6f 75 72 20 76 | 65 72 73 69 6f 6e 20 6f |e your v|ersion o|
|00002860| 66 20 74 68 69 73 20 66 | 69 6c 65 20 75 6e 64 65 |f this f|ile unde|
|00002870| 72 20 74 68 65 20 74 65 | 72 6d 73 20 6f 66 20 74 |r the te|rms of t|
|00002880| 68 65 20 4d 50 4c 2c 20 | 69 6e 64 69 63 61 74 65 |he MPL, |indicate|
|00002890| 20 79 6f 75 72 0a 20 2a | 20 64 65 63 69 73 69 6f | your. *| decisio|
|000028a0| 6e 20 62 79 20 64 65 6c | 65 74 69 6e 67 20 74 68 |n by del|eting th|
|000028b0| 65 20 70 72 6f 76 69 73 | 69 6f 6e 73 20 61 62 6f |e provis|ions abo|
|000028c0| 76 65 20 61 6e 64 20 72 | 65 70 6c 61 63 65 20 74 |ve and r|eplace t|
|000028d0| 68 65 6d 20 77 69 74 68 | 20 74 68 65 20 6e 6f 74 |hem with| the not|
|000028e0| 69 63 65 0a 20 2a 20 61 | 6e 64 20 6f 74 68 65 72 |ice. * a|nd other|
|000028f0| 20 70 72 6f 76 69 73 69 | 6f 6e 73 20 72 65 71 75 | provisi|ons requ|
|00002900| 69 72 65 64 20 62 79 20 | 74 68 65 20 47 50 4c 20 |ired by |the GPL |
|00002910| 6f 72 20 74 68 65 20 4c | 47 50 4c 2e 20 49 66 20 |or the L|GPL. If |
|00002920| 79 6f 75 20 64 6f 20 6e | 6f 74 20 64 65 6c 65 74 |you do n|ot delet|
|00002930| 65 0a 20 2a 20 74 68 65 | 20 70 72 6f 76 69 73 69 |e. * the| provisi|
|00002940| 6f 6e 73 20 61 62 6f 76 | 65 2c 20 61 20 72 65 63 |ons abov|e, a rec|
|00002950| 69 70 69 65 6e 74 20 6d | 61 79 20 75 73 65 20 79 |ipient m|ay use y|
|00002960| 6f 75 72 20 76 65 72 73 | 69 6f 6e 20 6f 66 20 74 |our vers|ion of t|
|00002970| 68 69 73 20 66 69 6c 65 | 20 75 6e 64 65 72 0a 20 |his file| under. |
|00002980| 2a 20 74 68 65 20 74 65 | 72 6d 73 20 6f 66 20 61 |* the te|rms of a|
|00002990| 6e 79 20 6f 6e 65 20 6f | 66 20 74 68 65 20 4d 50 |ny one o|f the MP|
|000029a0| 4c 2c 20 74 68 65 20 47 | 50 4c 20 6f 72 20 74 68 |L, the G|PL or th|
|000029b0| 65 20 4c 47 50 4c 2e 0a | 20 2a 0a 20 2a 20 2a 2a |e LGPL..| *. * **|
|000029c0| 2a 2a 2a 20 45 4e 44 20 | 4c 49 43 45 4e 53 45 20 |*** END |LICENSE |
|000029d0| 42 4c 4f 43 4b 20 2a 2a | 2a 2a 2a 20 2a 2f 0a 0a |BLOCK **|*** */..|
|000029e0| 66 75 6e 63 74 69 6f 6e | 20 67 65 74 4c 69 73 74 |function| getList|
|000029f0| 49 74 65 6d 28 61 43 61 | 6c 65 6e 64 61 72 29 20 |Item(aCa|lendar) |
|00002a00| 7b 0a 20 20 20 20 76 61 | 72 20 63 61 6c 65 6e 64 |{. va|r calend|
|00002a10| 61 72 4c 69 73 74 20 3d | 20 64 6f 63 75 6d 65 6e |arList =| documen|
|00002a20| 74 2e 67 65 74 45 6c 65 | 6d 65 6e 74 42 79 49 64 |t.getEle|mentById|
|00002a30| 28 22 6c 69 73 74 2d 63 | 61 6c 65 6e 64 61 72 73 |("list-c|alendars|
|00002a40| 2d 6c 69 73 74 62 6f 78 | 22 29 3b 0a 20 20 20 20 |-listbox|");. |
|00002a50| 66 6f 72 20 28 76 61 72 | 20 69 74 65 6d 20 3d 20 |for (var| item = |
|00002a60| 63 61 6c 65 6e 64 61 72 | 4c 69 73 74 2e 66 69 72 |calendar|List.fir|
|00002a70| 73 74 43 68 69 6c 64 3b | 0a 20 20 20 20 20 20 20 |stChild;|. |
|00002a80| 20 20 69 74 65 6d 3b 0a | 20 20 20 20 20 20 20 20 | item;.| |
|00002a90| 20 69 74 65 6d 20 3d 20 | 69 74 65 6d 2e 6e 65 78 | item = |item.nex|
|00002aa0| 74 53 69 62 6c 69 6e 67 | 29 20 7b 0a 20 20 20 20 |tSibling|) {. |
|00002ab0| 20 20 20 20 69 66 20 28 | 69 74 65 6d 2e 63 61 6c | if (|item.cal|
|00002ac0| 65 6e 64 61 72 20 26 26 | 20 69 74 65 6d 2e 63 61 |endar &&| item.ca|
|00002ad0| 6c 65 6e 64 61 72 2e 75 | 72 69 2e 65 71 75 61 6c |lendar.u|ri.equal|
|00002ae0| 73 28 61 43 61 6c 65 6e | 64 61 72 2e 75 72 69 29 |s(aCalen|dar.uri)|
|00002af0| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |) {. | |
|00002b00| 72 65 74 75 72 6e 20 69 | 74 65 6d 3b 0a 20 20 20 |return i|tem;. |
|00002b10| 20 20 20 20 20 7d 0a 20 | 20 20 20 7d 0a 20 20 20 | }. | }. |
|00002b20| 20 72 65 74 75 72 6e 20 | 66 61 6c 73 65 3b 0a 7d | return |false;.}|
|00002b30| 0a 0a 2f 2f 20 46 6f 72 | 20 6f 62 73 65 72 76 69 |..// For| observi|
|00002b40| 6e 67 20 63 68 61 6e 67 | 65 73 20 74 6f 20 74 68 |ng chang|es to th|
|00002b50| 65 20 6c 69 73 74 20 6f | 66 20 63 61 6c 65 6e 64 |e list o|f calend|
|00002b60| 61 72 73 0a 76 61 72 20 | 63 61 6c 43 61 6c 65 6e |ars.var |calCalen|
|00002b70| 64 61 72 4d 61 6e 61 67 | 65 72 4f 62 73 65 72 76 |darManag|erObserv|
|00002b80| 65 72 20 3d 20 7b 0a 20 | 20 20 20 51 75 65 72 79 |er = {. | Query|
|00002b90| 49 6e 74 65 72 66 61 63 | 65 3a 20 66 75 6e 63 74 |Interfac|e: funct|
|00002ba0| 69 6f 6e 28 61 49 49 44 | 29 20 7b 0a 20 20 20 20 |ion(aIID|) {. |
|00002bb0| 20 20 20 20 69 66 20 28 | 21 61 49 49 44 2e 65 71 | if (|!aIID.eq|
|00002bc0| 75 61 6c 73 28 43 6f 6d | 70 6f 6e 65 6e 74 73 2e |uals(Com|ponents.|
|00002bd0| 69 6e 74 65 72 66 61 63 | 65 73 2e 63 61 6c 49 43 |interfac|es.calIC|
|00002be0| 61 6c 65 6e 64 61 72 4d | 61 6e 61 67 65 72 4f 62 |alendarM|anagerOb|
|00002bf0| 73 65 72 76 65 72 29 20 | 26 26 0a 20 20 20 20 20 |server) |&&. |
|00002c00| 20 20 20 20 20 20 20 21 | 61 49 49 44 2e 65 71 75 | !|aIID.equ|
|00002c10| 61 6c 73 28 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 69 |als(Comp|onents.i|
|00002c20| 6e 74 65 72 66 61 63 65 | 73 2e 6e 73 49 53 75 70 |nterface|s.nsISup|
|00002c30| 70 6f 72 74 73 29 29 20 | 7b 0a 20 20 20 20 20 20 |ports)) |{. |
|00002c40| 20 20 20 20 20 20 74 68 | 72 6f 77 20 43 6f 6d 70 | th|row Comp|
|00002c50| 6f 6e 65 6e 74 73 2e 72 | 65 73 75 6c 74 73 2e 4e |onents.r|esults.N|
|00002c60| 53 5f 45 52 52 4f 52 5f | 4e 4f 5f 49 4e 54 45 52 |S_ERROR_|NO_INTER|
|00002c70| 46 41 43 45 3b 0a 20 20 | 20 20 20 20 20 20 7d 0a |FACE;. | }.|
|00002c80| 0a 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 |. | return |
|00002c90| 74 68 69 73 3b 0a 20 20 | 20 20 7d 2c 0a 0a 20 20 |this;. | },.. |
|00002ca0| 20 20 6f 6e 43 61 6c 65 | 6e 64 61 72 52 65 67 69 | onCale|ndarRegi|
|00002cb0| 73 74 65 72 65 64 3a 20 | 66 75 6e 63 74 69 6f 6e |stered: |function|
|00002cc0| 28 61 43 61 6c 65 6e 64 | 61 72 29 20 7b 0a 20 20 |(aCalend|ar) {. |
|00002cd0| 20 20 20 20 20 20 2f 2f | 20 45 6e 61 62 6c 65 20 | //| Enable |
|00002ce0| 6e 65 77 20 63 61 6c 65 | 6e 64 61 72 73 20 62 79 |new cale|ndars by|
|00002cf0| 20 64 65 66 61 75 6c 74 | 0a 20 20 20 20 20 20 20 | default|. |
|00002d00| 20 67 65 74 43 6f 6d 70 | 6f 73 69 74 65 43 61 6c | getComp|ositeCal|
|00002d10| 65 6e 64 61 72 28 29 2e | 61 64 64 43 61 6c 65 6e |endar().|addCalen|
|00002d20| 64 61 72 28 61 43 61 6c | 65 6e 64 61 72 29 3b 0a |dar(aCal|endar);.|
|00002d30| 20 20 20 20 20 20 20 20 | 73 65 74 43 61 6c 65 6e | |setCalen|
|00002d40| 64 61 72 4d 61 6e 61 67 | 65 72 55 49 28 29 3b 0a |darManag|erUI();.|
|00002d50| 20 20 20 20 20 20 20 20 | 64 6f 63 75 6d 65 6e 74 | |document|
|00002d60| 2e 67 65 74 45 6c 65 6d | 65 6e 74 42 79 49 64 28 |.getElem|entById(|
|00002d70| 22 6e 65 77 5f 63 6f 6d | 6d 61 6e 64 22 29 2e 72 |"new_com|mand").r|
|00002d80| 65 6d 6f 76 65 41 74 74 | 72 69 62 75 74 65 28 22 |emoveAtt|ribute("|
|00002d90| 64 69 73 61 62 6c 65 64 | 22 29 3b 0a 20 20 20 20 |disabled|");. |
|00002da0| 20 20 20 20 64 6f 63 75 | 6d 65 6e 74 2e 67 65 74 | docu|ment.get|
|00002db0| 45 6c 65 6d 65 6e 74 42 | 79 49 64 28 22 6e 65 77 |ElementB|yId("new|
|00002dc0| 5f 74 6f 64 6f 5f 63 6f | 6d 6d 61 6e 64 22 29 2e |_todo_co|mmand").|
|00002dd0| 72 65 6d 6f 76 65 41 74 | 74 72 69 62 75 74 65 28 |removeAt|tribute(|
|00002de0| 22 64 69 73 61 62 6c 65 | 64 22 29 3b 0a 0a 20 20 |"disable|d");.. |
|00002df0| 20 20 20 20 20 20 69 66 | 20 28 61 43 61 6c 65 6e | if| (aCalen|
|00002e00| 64 61 72 2e 63 61 6e 52 | 65 66 72 65 73 68 29 20 |dar.canR|efresh) |
|00002e10| 7b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 76 61 |{. | va|
|00002e20| 72 20 72 65 6d 6f 74 65 | 43 6f 6d 6d 61 6e 64 20 |r remote|Command |
|00002e30| 3d 20 64 6f 63 75 6d 65 | 6e 74 2e 67 65 74 45 6c |= docume|nt.getEl|
|00002e40| 65 6d 65 6e 74 42 79 49 | 64 28 22 72 65 6c 6f 61 |ementByI|d("reloa|
|00002e50| 64 5f 72 65 6d 6f 74 65 | 5f 63 61 6c 65 6e 64 61 |d_remote|_calenda|
|00002e60| 72 73 22 29 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |rs");. | |
|00002e70| 20 20 72 65 6d 6f 74 65 | 43 6f 6d 6d 61 6e 64 2e | remote|Command.|
|00002e80| 72 65 6d 6f 76 65 41 74 | 74 72 69 62 75 74 65 28 |removeAt|tribute(|
|00002e90| 22 64 69 73 61 62 6c 65 | 64 22 29 3b 0a 20 20 20 |"disable|d");. |
|00002ea0| 20 20 20 20 20 7d 0a 20 | 20 20 20 7d 2c 0a 0a 20 | }. | },.. |
|00002eb0| 20 20 20 6f 6e 43 61 6c | 65 6e 64 61 72 55 6e 72 | onCal|endarUnr|
|00002ec0| 65 67 69 73 74 65 72 69 | 6e 67 3a 20 66 75 6e 63 |egisteri|ng: func|
|00002ed0| 74 69 6f 6e 28 61 43 61 | 6c 65 6e 64 61 72 29 20 |tion(aCa|lendar) |
|00002ee0| 7b 0a 20 20 20 20 20 20 | 20 20 76 61 72 20 69 74 |{. | var it|
|00002ef0| 65 6d 20 3d 20 67 65 74 | 4c 69 73 74 49 74 65 6d |em = get|ListItem|
|00002f00| 28 61 43 61 6c 65 6e 64 | 61 72 29 3b 0a 20 20 20 |(aCalend|ar);. |
|00002f10| 20 20 20 20 20 69 66 20 | 28 69 74 65 6d 29 20 7b | if |(item) {|
|00002f20| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 76 61 72 |. | var|
|00002f30| 20 6c 69 73 74 62 6f 78 | 20 3d 20 64 6f 63 75 6d | listbox| = docum|
|00002f40| 65 6e 74 2e 67 65 74 45 | 6c 65 6d 65 6e 74 42 79 |ent.getE|lementBy|
|00002f50| 49 64 28 22 6c 69 73 74 | 2d 63 61 6c 65 6e 64 61 |Id("list|-calenda|
|00002f60| 72 73 2d 6c 69 73 74 62 | 6f 78 22 29 3b 0a 20 20 |rs-listb|ox");. |
|00002f70| 20 20 20 20 20 20 20 20 | 20 20 76 61 72 20 6f 6c | | var ol|
|00002f80| 64 49 6e 64 65 78 20 3d | 20 6c 69 73 74 62 6f 78 |dIndex =| listbox|
|00002f90| 2e 73 65 6c 65 63 74 65 | 64 49 6e 64 65 78 3b 0a |.selecte|dIndex;.|
|00002fa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 66 20 28 | | if (|
|00002fb0| 69 74 65 6d 20 3d 3d 20 | 6c 69 73 74 62 6f 78 2e |item == |listbox.|
|00002fc0| 6c 61 73 74 43 68 69 6c | 64 29 20 7b 0a 20 20 20 |lastChil|d) {. |
|00002fd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6f 6c 64 | | old|
|00002fe0| 49 6e 64 65 78 2d 2d 3b | 0a 20 20 20 20 20 20 20 |Index--;|. |
|00002ff0| 20 20 20 20 20 7d 0a 20 | 20 20 20 20 20 20 20 20 | }. | |
|00003000| 20 20 20 6c 69 73 74 62 | 6f 78 2e 72 65 6d 6f 76 | listb|ox.remov|
|00003010| 65 43 68 69 6c 64 28 69 | 74 65 6d 29 3b 0a 20 20 |eChild(i|tem);. |
|00003020| 20 20 20 20 20 20 20 20 | 20 20 2f 2f 20 54 68 69 | | // Thi|
|00003030| 73 20 69 73 20 63 61 6c | 6c 65 64 20 62 65 66 6f |s is cal|led befo|
|00003040| 72 65 20 74 68 65 20 63 | 61 6c 65 6e 64 61 72 20 |re the c|alendar |
|00003050| 69 73 20 61 63 74 75 61 | 6c 6c 79 20 64 65 6c 65 |is actua|lly dele|
|00003060| 74 65 64 2c 20 73 6f 20 | 3d 3d 31 20 69 73 20 63 |ted, so |==1 is c|
|00003070| 6f 72 72 65 63 74 0a 20 | 20 20 20 20 20 20 20 20 |orrect. | |
|00003080| 20 20 20 69 66 20 28 67 | 65 74 43 61 6c 65 6e 64 | if (g|etCalend|
|00003090| 61 72 4d 61 6e 61 67 65 | 72 28 29 2e 67 65 74 43 |arManage|r().getC|
|000030a0| 61 6c 65 6e 64 61 72 73 | 28 7b 7d 29 2e 6c 65 6e |alendars|({}).len|
|000030b0| 67 74 68 20 3c 3d 20 31 | 29 20 7b 0a 20 20 20 20 |gth <= 1|) {. |
|000030c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2f 20 49 | | // I|
|000030d0| 66 20 74 68 65 72 65 20 | 61 72 65 20 6e 6f 20 63 |f there |are no c|
|000030e0| 61 6c 65 6e 64 61 72 73 | 2c 20 79 6f 75 20 63 61 |alendars|, you ca|
|000030f0| 6e 27 74 20 63 72 65 61 | 74 65 20 65 76 65 6e 74 |n't crea|te event|
|00003100| 73 2f 74 61 73 6b 73 0a | 20 20 20 20 20 20 20 20 |s/tasks.| |
|00003110| 20 20 20 20 20 20 20 20 | 64 6f 63 75 6d 65 6e 74 | |document|
|00003120| 2e 67 65 74 45 6c 65 6d | 65 6e 74 42 79 49 64 28 |.getElem|entById(|
|00003130| 22 6e 65 77 5f 63 6f 6d | 6d 61 6e 64 22 29 2e 73 |"new_com|mand").s|
|00003140| 65 74 41 74 74 72 69 62 | 75 74 65 28 22 64 69 73 |etAttrib|ute("dis|
|00003150| 61 62 6c 65 64 22 2c 20 | 74 72 75 65 29 3b 0a 20 |abled", |true);. |
|00003160| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 64 | | d|
|00003170| 6f 63 75 6d 65 6e 74 2e | 67 65 74 45 6c 65 6d 65 |ocument.|getEleme|
|00003180| 6e 74 42 79 49 64 28 22 | 6e 65 77 5f 74 6f 64 6f |ntById("|new_todo|
|00003190| 5f 63 6f 6d 6d 61 6e 64 | 22 29 2e 73 65 74 41 74 |_command|").setAt|
|000031a0| 74 72 69 62 75 74 65 28 | 22 64 69 73 61 62 6c 65 |tribute(|"disable|
|000031b0| 64 22 2c 20 74 72 75 65 | 29 3b 0a 20 20 20 20 20 |d", true|);. |
|000031c0| 20 20 20 20 20 20 20 7d | 20 65 6c 73 65 20 7b 0a | }| else {.|
|000031d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000031e0| 6c 69 73 74 62 6f 78 2e | 73 65 6c 65 63 74 65 64 |listbox.|selected|
|000031f0| 49 6e 64 65 78 20 3d 20 | 6f 6c 64 49 6e 64 65 78 |Index = |oldIndex|
|00003200| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 7d 0a |;. | }.|
|00003210| 20 20 20 20 20 20 20 20 | 7d 0a 0a 20 20 20 20 20 | |}.. |
|00003220| 20 20 20 69 66 20 28 61 | 43 61 6c 65 6e 64 61 72 | if (a|Calendar|
|00003230| 2e 63 61 6e 52 65 66 72 | 65 73 68 29 20 7b 0a 20 |.canRefr|esh) {. |
|00003240| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 20 57 65 | | // We|
|00003250| 20 6d 61 79 20 68 61 76 | 65 20 6a 75 73 74 20 72 | may hav|e just r|
|00003260| 65 6d 6f 76 65 64 20 6f | 75 72 20 6c 61 73 74 20 |emoved o|ur last |
|00003270| 72 65 6d 6f 74 65 20 63 | 61 6c 2e 20 20 54 68 65 |remote c|al. The|
|00003280| 6e 20 77 65 27 64 20 6e | 65 65 64 20 74 6f 0a 20 |n we'd n|eed to. |
|00003290| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2f 20 64 69 | | // di|
|000032a0| 73 61 62 6c 65 64 20 74 | 68 65 20 72 65 6c 6f 61 |sabled t|he reloa|
|000032b0| 64 2d 72 65 6d 6f 74 65 | 2d 63 61 6c 65 6e 64 61 |d-remote|-calenda|
|000032c0| 72 73 20 63 6f 6d 6d 61 | 6e 64 0a 20 20 20 20 20 |rs comma|nd. |
|000032d0| 20 20 20 20 20 20 20 76 | 61 72 20 63 61 6c 65 6e | v|ar calen|
|000032e0| 64 61 72 73 20 3d 20 67 | 65 74 43 61 6c 65 6e 64 |dars = g|etCalend|
|000032f0| 61 72 4d 61 6e 61 67 65 | 72 28 29 2e 67 65 74 43 |arManage|r().getC|
|00003300| 61 6c 65 6e 64 61 72 73 | 28 7b 7d 29 3b 0a 20 20 |alendars|({});. |
|00003310| 20 20 20 20 20 20 20 20 | 20 20 66 75 6e 63 74 69 | | functi|
|00003320| 6f 6e 20 63 61 6c 43 61 | 6e 52 65 66 72 65 73 68 |on calCa|nRefresh|
|00003330| 28 63 61 6c 29 20 7b 0a | 20 20 20 20 20 20 20 20 |(cal) {.| |
|00003340| 20 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 28 | |return (|
|00003350| 63 61 6c 2e 63 61 6e 52 | 65 66 72 65 73 68 20 26 |cal.canR|efresh &|
|00003360| 26 20 21 63 61 6c 2e 75 | 72 69 2e 65 71 75 61 6c |& !cal.u|ri.equal|
|00003370| 73 28 61 43 61 6c 65 6e | 64 61 72 2e 75 72 69 29 |s(aCalen|dar.uri)|
|00003380| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 7d |);. | }|
|00003390| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 |. | if |
|000033a0| 28 21 63 61 6c 65 6e 64 | 61 72 73 2e 73 6f 6d 65 |(!calend|ars.some|
|000033b0| 28 63 61 6c 43 61 6e 52 | 65 66 72 65 73 68 29 29 |(calCanR|efresh))|
|000033c0| 20 7b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|000033d0| 20 20 20 76 61 72 20 72 | 65 6d 6f 74 65 43 6f 6d | var r|emoteCom|
|000033e0| 6d 61 6e 64 20 3d 20 64 | 6f 63 75 6d 65 6e 74 2e |mand = d|ocument.|
|000033f0| 67 65 74 45 6c 65 6d 65 | 6e 74 42 79 49 64 28 22 |getEleme|ntById("|
|00003400| 72 65 6c 6f 61 64 5f 72 | 65 6d 6f 74 65 5f 63 61 |reload_r|emote_ca|
|00003410| 6c 65 6e 64 61 72 73 22 | 29 3b 0a 20 20 20 20 20 |lendars"|);. |
|00003420| 20 20 20 20 20 20 20 20 | 20 20 20 72 65 6d 6f 74 | | remot|
|00003430| 65 43 6f 6d 6d 61 6e 64 | 2e 73 65 74 41 74 74 72 |eCommand|.setAttr|
|00003440| 69 62 75 74 65 28 22 64 | 69 73 61 62 6c 65 64 22 |ibute("d|isabled"|
|00003450| 2c 20 74 72 75 65 29 3b | 0a 20 20 20 20 20 20 20 |, true);|. |
|00003460| 20 20 20 20 20 7d 0a 20 | 20 20 20 20 20 20 20 7d | }. | }|
|00003470| 0a 20 20 20 20 7d 2c 0a | 0a 20 20 20 20 6f 6e 43 |. },.|. onC|
|00003480| 61 6c 65 6e 64 61 72 44 | 65 6c 65 74 69 6e 67 3a |alendarD|eleting:|
|00003490| 20 66 75 6e 63 74 69 6f | 6e 28 61 43 61 6c 65 6e | functio|n(aCalen|
|000034a0| 64 61 72 29 20 7b 0a 20 | 20 20 20 20 20 20 20 73 |dar) {. | s|
|000034b0| 65 74 43 61 6c 65 6e 64 | 61 72 4d 61 6e 61 67 65 |etCalend|arManage|
|000034c0| 72 55 49 28 29 3b 0a 20 | 20 20 20 7d 2c 0a 0a 20 |rUI();. | },.. |
|000034d0| 20 20 20 6f 6e 43 61 6c | 65 6e 64 61 72 50 72 65 | onCal|endarPre|
|000034e0| 66 53 65 74 3a 20 66 75 | 6e 63 74 69 6f 6e 28 61 |fSet: fu|nction(a|
|000034f0| 43 61 6c 65 6e 64 61 72 | 2c 20 61 4e 61 6d 65 2c |Calendar|, aName,|
|00003500| 20 61 56 61 6c 75 65 29 | 20 7b 0a 20 20 20 20 20 | aValue)| {. |
|00003510| 20 20 20 76 61 72 20 69 | 74 65 6d 20 3d 20 67 65 | var i|tem = ge|
|00003520| 74 4c 69 73 74 49 74 65 | 6d 28 61 43 61 6c 65 6e |tListIte|m(aCalen|
|00003530| 64 61 72 29 3b 0a 20 20 | 20 20 20 20 20 20 69 66 |dar);. | if|
|00003540| 20 28 61 4e 61 6d 65 20 | 3d 3d 20 27 63 6f 6c 6f | (aName |== 'colo|
|00003550| 72 27 29 20 7b 0a 20 20 | 20 20 20 20 20 20 20 20 |r') {. | |
|00003560| 20 20 69 66 20 28 69 74 | 65 6d 29 20 7b 0a 20 20 | if (it|em) {. |
|00003570| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 76 61 | | va|
|00003580| 72 20 63 6f 6c 6f 72 43 | 65 6c 6c 20 3d 20 69 74 |r colorC|ell = it|
|00003590| 65 6d 2e 63 68 69 6c 64 | 4e 6f 64 65 73 5b 31 5d |em.child|Nodes[1]|
|000035a0| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|000035b0| 20 20 63 6f 6c 6f 72 43 | 65 6c 6c 2e 73 74 79 6c | colorC|ell.styl|
|000035c0| 65 2e 62 61 63 6b 67 72 | 6f 75 6e 64 20 3d 20 61 |e.backgr|ound = a|
|000035d0| 56 61 6c 75 65 3b 0a 20 | 20 20 20 20 20 20 20 20 |Value;. | |
|000035e0| 20 20 20 7d 0a 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|000035f0| 20 75 70 64 61 74 65 53 | 74 79 6c 65 53 68 65 65 | updateS|tyleShee|
|00003600| 74 46 6f 72 4f 62 6a 65 | 63 74 28 61 43 61 6c 65 |tForObje|ct(aCale|
|00003610| 6e 64 61 72 2c 20 67 43 | 61 63 68 65 64 53 74 79 |ndar, gC|achedSty|
|00003620| 6c 65 53 68 65 65 74 29 | 3b 0a 20 20 20 20 20 20 |leSheet)|;. |
|00003630| 20 20 7d 20 65 6c 73 65 | 20 69 66 20 28 61 4e 61 | } else| if (aNa|
|00003640| 6d 65 20 3d 3d 20 27 6e | 61 6d 65 27 29 20 7b 0a |me == 'n|ame') {.|
|00003650| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 66 20 28 | | if (|
|00003660| 69 74 65 6d 29 20 7b 0a | 20 20 20 20 20 20 20 20 |item) {.| |
|00003670| 20 20 20 20 20 20 20 20 | 76 61 72 20 6e 61 6d 65 | |var name|
|00003680| 43 65 6c 6c 20 3d 20 69 | 74 65 6d 2e 63 68 69 6c |Cell = i|tem.chil|
|00003690| 64 4e 6f 64 65 73 5b 32 | 5d 3b 0a 20 20 20 20 20 |dNodes[2|];. |
|000036a0| 20 20 20 20 20 20 20 20 | 20 20 20 6e 61 6d 65 43 | | nameC|
|000036b0| 65 6c 6c 2e 73 65 74 41 | 74 74 72 69 62 75 74 65 |ell.setA|ttribute|
|000036c0| 28 22 6c 61 62 65 6c 22 | 2c 20 61 43 61 6c 65 6e |("label"|, aCalen|
|000036d0| 64 61 72 2e 6e 61 6d 65 | 29 3b 0a 20 20 20 20 20 |dar.name|);. |
|000036e0| 20 20 20 20 20 20 20 7d | 0a 20 20 20 20 20 20 20 | }|. |
|000036f0| 20 7d 0a 20 20 20 20 7d | 2c 0a 0a 20 20 20 20 6f | }. }|,.. o|
|00003700| 6e 43 61 6c 65 6e 64 61 | 72 50 72 65 66 44 65 6c |nCalenda|rPrefDel|
|00003710| 65 74 69 6e 67 3a 20 66 | 75 6e 63 74 69 6f 6e 28 |eting: f|unction(|
|00003720| 61 43 61 6c 65 6e 64 61 | 72 2c 20 61 4e 61 6d 65 |aCalenda|r, aName|
|00003730| 29 20 7b 0a 20 20 20 20 | 20 20 20 20 69 66 20 28 |) {. | if (|
|00003740| 61 4e 61 6d 65 20 21 3d | 20 27 63 6f 6c 6f 72 27 |aName !=| 'color'|
|00003750| 20 26 26 20 61 4e 61 6d | 65 20 21 3d 20 27 6e 61 | && aNam|e != 'na|
|00003760| 6d 65 27 29 20 7b 0a 20 | 20 20 20 20 20 20 20 20 |me') {. | |
|00003770| 20 20 20 72 65 74 75 72 | 6e 3b 0a 20 20 20 20 20 | retur|n;. |
|00003780| 20 20 20 7d 0a 20 20 20 | 20 20 20 20 20 73 65 74 | }. | set|
|00003790| 43 61 6c 65 6e 64 61 72 | 4d 61 6e 61 67 65 72 55 |Calendar|ManagerU|
|000037a0| 49 28 29 3b 0a 20 20 20 | 20 20 20 20 20 69 66 20 |I();. | if |
|000037b0| 28 61 4e 61 6d 65 20 3d | 3d 20 27 63 6f 6c 6f 72 |(aName =|= 'color|
|000037c0| 27 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 75 |'). | u|
|000037d0| 70 64 61 74 65 53 74 79 | 6c 65 53 68 65 65 74 46 |pdateSty|leSheetF|
|000037e0| 6f 72 4f 62 6a 65 63 74 | 28 61 43 61 6c 65 6e 64 |orObject|(aCalend|
|000037f0| 61 72 2c 20 67 43 61 63 | 68 65 64 53 74 79 6c 65 |ar, gCac|hedStyle|
|00003800| 53 68 65 65 74 29 3b 0a | 20 20 20 20 7d 0a 7d 3b |Sheet);.| }.};|
|00003810| 0a 0a 2f 2f 20 46 6f 72 | 20 6f 62 73 65 72 76 69 |..// For| observi|
|00003820| 6e 67 20 63 68 61 6e 67 | 65 73 20 74 6f 20 74 68 |ng chang|es to th|
|00003830| 65 20 6c 69 73 74 20 6f | 66 20 5f 61 63 74 69 76 |e list o|f _activ|
|00003840| 65 5f 20 63 61 6c 65 6e | 64 61 72 73 0a 76 61 72 |e_ calen|dars.var|
|00003850| 20 63 61 6c 43 6f 6d 70 | 6f 73 69 74 65 43 61 6c | calComp|ositeCal|
|00003860| 65 6e 64 61 72 4f 62 73 | 65 72 76 65 72 20 3d 20 |endarObs|erver = |
|00003870| 7b 0a 20 20 20 20 51 75 | 65 72 79 49 6e 74 65 72 |{. Qu|eryInter|
|00003880| 66 61 63 65 3a 20 66 75 | 6e 63 74 69 6f 6e 28 61 |face: fu|nction(a|
|00003890| 49 49 44 29 20 7b 0a 20 | 20 20 20 20 20 20 20 69 |IID) {. | i|
|000038a0| 66 20 28 21 61 49 49 44 | 2e 65 71 75 61 6c 73 28 |f (!aIID|.equals(|
|000038b0| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|000038c0| 66 61 63 65 73 2e 63 61 | 6c 49 4f 62 73 65 72 76 |faces.ca|lIObserv|
|000038d0| 65 72 29 20 26 26 0a 20 | 20 20 20 20 20 20 20 20 |er) &&. | |
|000038e0| 20 20 20 21 61 49 49 44 | 2e 65 71 75 61 6c 73 28 | !aIID|.equals(|
|000038f0| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|00003900| 66 61 63 65 73 2e 63 61 | 6c 49 43 6f 6d 70 6f 73 |faces.ca|lICompos|
|00003910| 69 74 65 4f 62 73 65 72 | 76 65 72 29 20 26 26 0a |iteObser|ver) &&.|
|00003920| 20 20 20 20 20 20 20 20 | 20 20 20 20 21 61 49 49 | | !aII|
|00003930| 44 2e 65 71 75 61 6c 73 | 28 43 6f 6d 70 6f 6e 65 |D.equals|(Compone|
|00003940| 6e 74 73 2e 69 6e 74 65 | 72 66 61 63 65 73 2e 6e |nts.inte|rfaces.n|
|00003950| 73 49 53 75 70 70 6f 72 | 74 73 29 29 20 7b 0a 20 |sISuppor|ts)) {. |
|00003960| 20 20 20 20 20 20 20 20 | 20 20 20 74 68 72 6f 77 | | throw|
|00003970| 20 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 72 65 73 75 | Compone|nts.resu|
|00003980| 6c 74 73 2e 4e 53 5f 45 | 52 52 4f 52 5f 4e 4f 5f |lts.NS_E|RROR_NO_|
|00003990| 49 4e 54 45 52 46 41 43 | 45 3b 0a 20 20 20 20 20 |INTERFAC|E;. |
|000039a0| 20 20 20 7d 0a 0a 20 20 | 20 20 20 20 20 20 72 65 | }.. | re|
|000039b0| 74 75 72 6e 20 74 68 69 | 73 3b 0a 20 20 20 20 7d |turn thi|s;. }|
|000039c0| 2c 0a 0a 20 20 20 20 2f | 2f 20 63 61 6c 49 43 6f |,.. /|/ calICo|
|000039d0| 6d 70 6f 73 69 74 65 4f | 62 73 65 72 76 65 72 0a |mpositeO|bserver.|
|000039e0| 20 20 20 20 6f 6e 43 61 | 6c 65 6e 64 61 72 41 64 | onCa|lendarAd|
|000039f0| 64 65 64 3a 20 66 75 6e | 63 74 69 6f 6e 20 28 61 |ded: fun|ction (a|
|00003a00| 43 61 6c 65 6e 64 61 72 | 29 20 7b 0a 20 20 20 20 |Calendar|) {. |
|00003a10| 20 20 20 20 76 61 72 20 | 69 74 65 6d 20 3d 20 67 | var |item = g|
|00003a20| 65 74 4c 69 73 74 49 74 | 65 6d 28 61 43 61 6c 65 |etListIt|em(aCale|
|00003a30| 6e 64 61 72 29 3b 0a 20 | 20 20 20 20 20 20 20 69 |ndar);. | i|
|00003a40| 66 20 28 69 74 65 6d 29 | 20 7b 0a 20 20 20 20 20 |f (item)| {. |
|00003a50| 20 20 20 20 20 20 20 76 | 61 72 20 63 68 65 63 6b | v|ar check|
|00003a60| 43 65 6c 6c 20 3d 20 69 | 74 65 6d 2e 66 69 72 73 |Cell = i|tem.firs|
|00003a70| 74 43 68 69 6c 64 3b 0a | 20 20 20 20 20 20 20 20 |tChild;.| |
|00003a80| 20 20 20 20 63 68 65 63 | 6b 43 65 6c 6c 2e 73 65 | chec|kCell.se|
|00003a90| 74 41 74 74 72 69 62 75 | 74 65 28 27 63 68 65 63 |tAttribu|te('chec|
|00003aa0| 6b 65 64 27 2c 20 74 72 | 75 65 29 3b 0a 20 20 20 |ked', tr|ue);. |
|00003ab0| 20 20 20 20 20 7d 0a 20 | 20 20 20 7d 2c 0a 0a 20 | }. | },.. |
|00003ac0| 20 20 20 6f 6e 43 61 6c | 65 6e 64 61 72 52 65 6d | onCal|endarRem|
|00003ad0| 6f 76 65 64 3a 20 66 75 | 6e 63 74 69 6f 6e 20 28 |oved: fu|nction (|
|00003ae0| 61 43 61 6c 65 6e 64 61 | 72 29 20 7b 0a 20 20 20 |aCalenda|r) {. |
|00003af0| 20 20 20 20 20 76 61 72 | 20 69 74 65 6d 20 3d 20 | var| item = |
|00003b00| 67 65 74 4c 69 73 74 49 | 74 65 6d 28 61 43 61 6c |getListI|tem(aCal|
|00003b10| 65 6e 64 61 72 29 3b 0a | 20 20 20 20 20 20 20 20 |endar);.| |
|00003b20| 69 66 20 28 69 74 65 6d | 29 20 7b 0a 20 20 20 20 |if (item|) {. |
|00003b30| 20 20 20 20 20 20 20 20 | 76 61 72 20 63 68 65 63 | |var chec|
|00003b40| 6b 43 65 6c 6c 20 3d 20 | 69 74 65 6d 2e 66 69 72 |kCell = |item.fir|
|00003b50| 73 74 43 68 69 6c 64 3b | 0a 20 20 20 20 20 20 20 |stChild;|. |
|00003b60| 20 20 20 20 20 63 68 65 | 63 6b 43 65 6c 6c 2e 73 | che|ckCell.s|
|00003b70| 65 74 41 74 74 72 69 62 | 75 74 65 28 27 63 68 65 |etAttrib|ute('che|
|00003b80| 63 6b 65 64 27 2c 20 66 | 61 6c 73 65 29 3b 0a 20 |cked', f|alse);. |
|00003b90| 20 20 20 20 20 20 20 7d | 0a 20 20 20 20 7d 2c 0a | }|. },.|
|00003ba0| 0a 20 20 20 20 6f 6e 44 | 65 66 61 75 6c 74 43 61 |. onD|efaultCa|
|00003bb0| 6c 65 6e 64 61 72 43 68 | 61 6e 67 65 64 3a 20 66 |lendarCh|anged: f|
|00003bc0| 75 6e 63 74 69 6f 6e 20 | 28 61 4e 65 77 44 65 66 |unction |(aNewDef|
|00003bd0| 61 75 6c 74 43 61 6c 65 | 6e 64 61 72 29 20 7b 0a |aultCale|ndar) {.|
|00003be0| 20 20 20 20 20 20 20 20 | 2f 2f 20 6d 61 6b 65 20 | |// make |
|00003bf0| 74 68 65 20 63 61 6c 65 | 6e 64 61 72 20 62 6f 6c |the cale|ndar bol|
|00003c00| 64 20 69 6e 20 74 68 65 | 20 74 72 65 65 0a 20 20 |d in the| tree. |
|00003c10| 20 20 7d 2c 0a 0a 20 20 | 20 20 2f 2f 20 63 61 6c | },.. | // cal|
|00003c20| 49 4f 62 73 65 72 76 65 | 72 0a 20 20 20 20 6f 6e |IObserve|r. on|
|00003c30| 53 74 61 72 74 42 61 74 | 63 68 3a 20 66 75 6e 63 |StartBat|ch: func|
|00003c40| 74 69 6f 6e 28 29 20 7b | 20 7d 2c 0a 20 20 20 20 |tion() {| },. |
|00003c50| 6f 6e 45 6e 64 42 61 74 | 63 68 3a 20 66 75 6e 63 |onEndBat|ch: func|
|00003c60| 74 69 6f 6e 28 29 20 7b | 20 7d 2c 0a 20 20 20 20 |tion() {| },. |
|00003c70| 6f 6e 4c 6f 61 64 3a 20 | 66 75 6e 63 74 69 6f 6e |onLoad: |function|
|00003c80| 28 29 20 7b 20 7d 2c 0a | 20 20 20 20 6f 6e 41 64 |() { },.| onAd|
|00003c90| 64 49 74 65 6d 3a 20 66 | 75 6e 63 74 69 6f 6e 28 |dItem: f|unction(|
|00003ca0| 61 49 74 65 6d 29 20 7b | 20 7d 2c 0a 20 20 20 20 |aItem) {| },. |
|00003cb0| 6f 6e 4d 6f 64 69 66 79 | 49 74 65 6d 3a 20 66 75 |onModify|Item: fu|
|00003cc0| 6e 63 74 69 6f 6e 28 61 | 4e 65 77 49 74 65 6d 2c |nction(a|NewItem,|
|00003cd0| 20 61 4f 6c 64 49 74 65 | 6d 29 20 7b 20 7d 2c 0a | aOldIte|m) { },.|
|00003ce0| 20 20 20 20 6f 6e 44 65 | 6c 65 74 65 49 74 65 6d | onDe|leteItem|
|00003cf0| 3a 20 66 75 6e 63 74 69 | 6f 6e 28 61 44 65 6c 65 |: functi|on(aDele|
|00003d00| 74 65 64 49 74 65 6d 29 | 20 7b 20 7d 2c 0a 20 20 |tedItem)| { },. |
|00003d10| 20 20 6f 6e 45 72 72 6f | 72 3a 20 66 75 6e 63 74 | onErro|r: funct|
|00003d20| 69 6f 6e 28 61 45 72 72 | 4e 6f 2c 20 61 4d 65 73 |ion(aErr|No, aMes|
|00003d30| 73 61 67 65 29 20 7b 20 | 7d 0a 7d 3b 0a 0a 66 75 |sage) { |}.};..fu|
|00003d40| 6e 63 74 69 6f 6e 20 6f | 6e 43 61 6c 65 6e 64 61 |nction o|nCalenda|
|00003d50| 72 43 68 65 63 6b 62 6f | 78 43 6c 69 63 6b 28 65 |rCheckbo|xClick(e|
|00003d60| 76 65 6e 74 29 20 7b 0a | 20 20 20 20 2f 2f 20 54 |vent) {.| // T|
|00003d70| 68 69 73 20 69 73 20 61 | 20 48 41 43 4b 2e 0a 20 |his is a| HACK.. |
|00003d80| 20 20 20 2f 2f 20 49 74 | 20 73 65 65 6d 73 20 74 | // It| seems t|
|00003d90| 6f 20 62 65 20 69 6d 70 | 6f 73 73 69 62 6c 65 20 |o be imp|ossible |
|00003da0| 74 6f 20 61 64 64 20 6f | 6e 43 6c 69 63 6b 20 74 |to add o|nClick t|
|00003db0| 6f 20 61 20 6c 69 73 74 | 43 65 6c 6c 2e 0a 20 20 |o a list|Cell.. |
|00003dc0| 20 20 2f 2f 20 57 6f 72 | 6b 61 72 6f 75 6e 64 20 | // Wor|karound |
|00003dd0| 74 68 61 74 20 62 79 20 | 63 68 65 63 6b 69 6e 67 |that by |checking|
|00003de0| 20 74 68 65 20 63 6f 6f | 72 64 69 6e 61 74 65 73 | the coo|rdinates|
|00003df0| 20 6f 66 20 74 68 65 20 | 63 6c 69 63 6b 2e 0a 20 | of the |click.. |
|00003e00| 20 20 20 76 61 72 20 63 | 68 65 63 6b 45 6c 65 6d | var c|heckElem|
|00003e10| 20 3d 20 65 76 65 6e 74 | 2e 74 61 72 67 65 74 2e | = event|.target.|
|00003e20| 66 69 72 73 74 43 68 69 | 6c 64 3b 0a 20 20 20 20 |firstChi|ld;. |
|00003e30| 69 66 20 28 28 65 76 65 | 6e 74 2e 63 6c 69 65 6e |if ((eve|nt.clien|
|00003e40| 74 58 20 3c 20 63 68 65 | 63 6b 45 6c 65 6d 2e 62 |tX < che|ckElem.b|
|00003e50| 6f 78 4f 62 6a 65 63 74 | 2e 78 20 2b 20 63 68 65 |oxObject|.x + che|
|00003e60| 63 6b 45 6c 65 6d 2e 62 | 6f 78 4f 62 6a 65 63 74 |ckElem.b|oxObject|
|00003e70| 2e 77 69 64 74 68 29 20 | 26 26 0a 20 20 20 20 20 |.width) |&&. |
|00003e80| 20 20 20 28 65 76 65 6e | 74 2e 63 6c 69 65 6e 74 | (even|t.client|
|00003e90| 58 20 3e 20 63 68 65 63 | 6b 45 6c 65 6d 2e 62 6f |X > chec|kElem.bo|
|00003ea0| 78 4f 62 6a 65 63 74 2e | 78 29 29 20 7b 0a 0a 20 |xObject.|x)) {.. |
|00003eb0| 20 20 20 20 20 20 20 2f | 2f 20 63 6c 69 63 6b 65 | /|/ clicke|
|00003ec0| 64 20 74 68 65 20 63 68 | 65 63 6b 62 6f 78 20 63 |d the ch|eckbox c|
|00003ed0| 65 6c 6c 0a 0a 20 20 20 | 20 20 20 20 20 76 61 72 |ell.. | var|
|00003ee0| 20 63 61 6c 20 3d 20 65 | 76 65 6e 74 2e 74 61 72 | cal = e|vent.tar|
|00003ef0| 67 65 74 2e 63 61 6c 65 | 6e 64 61 72 3b 0a 20 20 |get.cale|ndar;. |
|00003f00| 20 20 20 20 20 20 69 66 | 20 28 63 68 65 63 6b 45 | if| (checkE|
|00003f10| 6c 65 6d 2e 67 65 74 41 | 74 74 72 69 62 75 74 65 |lem.getA|ttribute|
|00003f20| 28 27 63 68 65 63 6b 65 | 64 27 29 20 3d 3d 20 22 |('checke|d') == "|
|00003f30| 74 72 75 65 22 29 20 7b | 0a 20 20 20 20 20 20 20 |true") {|. |
|00003f40| 20 20 20 20 20 67 65 74 | 43 6f 6d 70 6f 73 69 74 | get|Composit|
|00003f50| 65 43 61 6c 65 6e 64 61 | 72 28 29 2e 72 65 6d 6f |eCalenda|r().remo|
|00003f60| 76 65 43 61 6c 65 6e 64 | 61 72 28 63 61 6c 2e 75 |veCalend|ar(cal.u|
|00003f70| 72 69 29 3b 0a 20 20 20 | 20 20 20 20 20 7d 20 65 |ri);. | } e|
|00003f80| 6c 73 65 20 7b 0a 20 20 | 20 20 20 20 20 20 20 20 |lse {. | |
|00003f90| 20 20 67 65 74 43 6f 6d | 70 6f 73 69 74 65 43 61 | getCom|positeCa|
|00003fa0| 6c 65 6e 64 61 72 28 29 | 2e 61 64 64 43 61 6c 65 |lendar()|.addCale|
|00003fb0| 6e 64 61 72 28 63 61 6c | 29 3b 0a 20 20 20 20 20 |ndar(cal|);. |
|00003fc0| 20 20 20 7d 0a 0a 20 20 | 20 20 20 20 20 20 65 76 | }.. | ev|
|00003fd0| 65 6e 74 2e 70 72 65 76 | 65 6e 74 44 65 66 61 75 |ent.prev|entDefau|
|00003fe0| 6c 74 28 29 3b 0a 20 20 | 20 20 7d 0a 7d 0a 0a 66 |lt();. | }.}..f|
|00003ff0| 75 6e 63 74 69 6f 6e 20 | 73 65 74 43 61 6c 65 6e |unction |setCalen|
|00004000| 64 61 72 4d 61 6e 61 67 | 65 72 55 49 28 29 0a 7b |darManag|erUI().{|
|00004010| 0a 20 20 20 20 76 61 72 | 20 63 61 6c 65 6e 64 61 |. var| calenda|
|00004020| 72 4c 69 73 74 20 3d 20 | 64 6f 63 75 6d 65 6e 74 |rList = |document|
|00004030| 2e 67 65 74 45 6c 65 6d | 65 6e 74 42 79 49 64 28 |.getElem|entById(|
|00004040| 22 6c 69 73 74 2d 63 61 | 6c 65 6e 64 61 72 73 2d |"list-ca|lendars-|
|00004050| 6c 69 73 74 62 6f 78 22 | 29 3b 0a 20 20 20 20 76 |listbox"|);. v|
|00004060| 61 72 20 6f 6c 64 53 65 | 6c 65 63 74 69 6f 6e 20 |ar oldSe|lection |
|00004070| 3d 20 63 61 6c 65 6e 64 | 61 72 4c 69 73 74 2e 73 |= calend|arList.s|
|00004080| 65 6c 65 63 74 65 64 49 | 6e 64 65 78 3b 0a 20 20 |electedI|ndex;. |
|00004090| 20 20 76 61 72 20 63 68 | 69 6c 64 3b 0a 20 20 20 | var ch|ild;. |
|000040a0| 20 77 68 69 6c 65 20 28 | 28 63 68 69 6c 64 20 3d | while (|(child =|
|000040b0| 20 63 61 6c 65 6e 64 61 | 72 4c 69 73 74 2e 6c 61 | calenda|rList.la|
|000040c0| 73 74 43 68 69 6c 64 29 | 20 26 26 20 28 63 68 69 |stChild)| && (chi|
|000040d0| 6c 64 2e 74 61 67 4e 61 | 6d 65 20 3d 3d 20 22 6c |ld.tagNa|me == "l|
|000040e0| 69 73 74 69 74 65 6d 22 | 29 29 20 7b 0a 20 20 20 |istitem"|)) {. |
|000040f0| 20 20 20 20 20 63 61 6c | 65 6e 64 61 72 4c 69 73 | cal|endarLis|
|00004100| 74 2e 72 65 6d 6f 76 65 | 43 68 69 6c 64 28 63 68 |t.remove|Child(ch|
|00004110| 69 6c 64 29 3b 0a 20 20 | 20 20 7d 0a 0a 20 20 20 |ild);. | }.. |
|00004120| 20 76 61 72 20 63 6f 6d | 70 6f 73 69 74 65 20 3d | var com|posite =|
|00004130| 20 67 65 74 43 6f 6d 70 | 6f 73 69 74 65 43 61 6c | getComp|ositeCal|
|00004140| 65 6e 64 61 72 28 29 3b | 0a 20 20 20 20 76 61 72 |endar();|. var|
|00004150| 20 63 61 6c 6d 67 72 20 | 3d 20 67 65 74 43 61 6c | calmgr |= getCal|
|00004160| 65 6e 64 61 72 4d 61 6e | 61 67 65 72 28 29 3b 0a |endarMan|ager();.|
|00004170| 20 20 20 20 76 61 72 20 | 63 61 6c 65 6e 64 61 72 | var |calendar|
|00004180| 73 20 3d 20 63 61 6c 6d | 67 72 2e 67 65 74 43 61 |s = calm|gr.getCa|
|00004190| 6c 65 6e 64 61 72 73 28 | 7b 7d 29 3b 0a 20 20 20 |lendars(|{});. |
|000041a0| 20 76 61 72 20 68 61 73 | 52 65 66 72 65 73 68 61 | var has|Refresha|
|000041b0| 62 6c 65 43 61 6c 20 3d | 20 66 61 6c 73 65 3b 0a |bleCal =| false;.|
|000041c0| 20 20 20 20 66 6f 72 20 | 65 61 63 68 20 28 76 61 | for |each (va|
|000041d0| 72 20 63 61 6c 65 6e 64 | 61 72 20 69 6e 20 63 61 |r calend|ar in ca|
|000041e0| 6c 65 6e 64 61 72 73 29 | 20 7b 0a 20 20 20 20 20 |lendars)| {. |
|000041f0| 20 20 20 69 66 20 28 63 | 61 6c 65 6e 64 61 72 2e | if (c|alendar.|
|00004200| 63 61 6e 52 65 66 72 65 | 73 68 29 20 7b 0a 20 20 |canRefre|sh) {. |
|00004210| 20 20 20 20 20 20 20 20 | 20 20 68 61 73 52 65 66 | | hasRef|
|00004220| 72 65 73 68 61 62 6c 65 | 43 61 6c 20 3d 20 74 72 |reshable|Cal = tr|
|00004230| 75 65 3b 0a 20 20 20 20 | 20 20 20 20 7d 0a 0a 20 |ue;. | }.. |
|00004240| 20 20 20 20 20 20 20 76 | 61 72 20 6c 69 73 74 49 | v|ar listI|
|00004250| 74 65 6d 20 3d 20 64 6f | 63 75 6d 65 6e 74 2e 63 |tem = do|cument.c|
|00004260| 72 65 61 74 65 45 6c 65 | 6d 65 6e 74 28 22 6c 69 |reateEle|ment("li|
|00004270| 73 74 69 74 65 6d 22 29 | 3b 0a 0a 20 20 20 20 20 |stitem")|;.. |
|00004280| 20 20 20 76 61 72 20 63 | 68 65 63 6b 43 65 6c 6c | var c|heckCell|
|00004290| 20 3d 20 64 6f 63 75 6d | 65 6e 74 2e 63 72 65 61 | = docum|ent.crea|
|000042a0| 74 65 45 6c 65 6d 65 6e | 74 28 22 6c 69 73 74 63 |teElemen|t("listc|
|000042b0| 65 6c 6c 22 29 3b 0a 20 | 20 20 20 20 20 20 20 63 |ell");. | c|
|000042c0| 68 65 63 6b 43 65 6c 6c | 2e 73 65 74 41 74 74 72 |heckCell|.setAttr|
|000042d0| 69 62 75 74 65 28 22 74 | 79 70 65 22 2c 20 22 63 |ibute("t|ype", "c|
|000042e0| 68 65 63 6b 62 6f 78 22 | 29 3b 0a 0a 20 20 20 20 |heckbox"|);.. |
|000042f0| 20 20 20 20 63 68 65 63 | 6b 43 65 6c 6c 2e 73 65 | chec|kCell.se|
|00004300| 74 41 74 74 72 69 62 75 | 74 65 28 22 63 68 65 63 |tAttribu|te("chec|
|00004310| 6b 65 64 22 2c 20 0a 20 | 20 20 20 20 20 20 20 20 |ked", . | |
|00004320| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004330| 20 20 20 20 20 20 63 6f | 6d 70 6f 73 69 74 65 2e | co|mposite.|
|00004340| 67 65 74 43 61 6c 65 6e | 64 61 72 28 63 61 6c 65 |getCalen|dar(cale|
|00004350| 6e 64 61 72 2e 75 72 69 | 29 20 3f 20 74 72 75 65 |ndar.uri|) ? true|
|00004360| 20 3a 20 66 61 6c 73 65 | 29 3b 0a 20 20 20 20 20 | : false|);. |
|00004370| 20 20 20 6c 69 73 74 49 | 74 65 6d 2e 61 70 70 65 | listI|tem.appe|
|00004380| 6e 64 43 68 69 6c 64 28 | 63 68 65 63 6b 43 65 6c |ndChild(|checkCel|
|00004390| 6c 29 3b 0a 20 20 20 20 | 20 20 20 20 6c 69 73 74 |l);. | list|
|000043a0| 49 74 65 6d 2e 61 64 64 | 45 76 65 6e 74 4c 69 73 |Item.add|EventLis|
|000043b0| 74 65 6e 65 72 28 22 63 | 6c 69 63 6b 22 2c 20 6f |tener("c|lick", o|
|000043c0| 6e 43 61 6c 65 6e 64 61 | 72 43 68 65 63 6b 62 6f |nCalenda|rCheckbo|
|000043d0| 78 43 6c 69 63 6b 2c 20 | 74 72 75 65 29 3b 0a 0a |xClick, |true);..|
|000043e0| 20 20 20 20 20 20 20 20 | 76 61 72 20 63 6f 6c 6f | |var colo|
|000043f0| 72 43 65 6c 6c 20 3d 20 | 64 6f 63 75 6d 65 6e 74 |rCell = |document|
|00004400| 2e 63 72 65 61 74 65 45 | 6c 65 6d 65 6e 74 28 22 |.createE|lement("|
|00004410| 6c 69 73 74 63 65 6c 6c | 22 29 3b 0a 20 20 20 20 |listcell|");. |
|00004420| 20 20 20 20 74 72 79 20 | 7b 0a 20 20 20 20 20 20 | try |{. |
|00004430| 20 20 20 20 20 76 61 72 | 20 63 61 6c 43 6f 6c 6f | var| calColo|
|00004440| 72 20 3d 20 63 61 6c 6d | 67 72 2e 67 65 74 43 61 |r = calm|gr.getCa|
|00004450| 6c 65 6e 64 61 72 50 72 | 65 66 28 63 61 6c 65 6e |lendarPr|ef(calen|
|00004460| 64 61 72 2c 20 27 63 6f | 6c 6f 72 27 29 3b 0a 20 |dar, 'co|lor');. |
|00004470| 20 20 20 20 20 20 20 20 | 20 20 63 6f 6c 6f 72 43 | | colorC|
|00004480| 65 6c 6c 2e 73 74 79 6c | 65 2e 62 61 63 6b 67 72 |ell.styl|e.backgr|
|00004490| 6f 75 6e 64 20 3d 20 63 | 61 6c 43 6f 6c 6f 72 3b |ound = c|alColor;|
|000044a0| 0a 20 20 20 20 20 20 20 | 20 7d 20 63 61 74 63 68 |. | } catch|
|000044b0| 28 65 29 20 7b 7d 0a 20 | 20 20 20 20 20 20 20 6c |(e) {}. | l|
|000044c0| 69 73 74 49 74 65 6d 2e | 61 70 70 65 6e 64 43 68 |istItem.|appendCh|
|000044d0| 69 6c 64 28 63 6f 6c 6f | 72 43 65 6c 6c 29 3b 0a |ild(colo|rCell);.|
|000044e0| 0a 20 20 20 20 20 20 20 | 20 76 61 72 20 6e 61 6d |. | var nam|
|000044f0| 65 43 65 6c 6c 20 3d 20 | 64 6f 63 75 6d 65 6e 74 |eCell = |document|
|00004500| 2e 63 72 65 61 74 65 45 | 6c 65 6d 65 6e 74 28 22 |.createE|lement("|
|00004510| 6c 69 73 74 63 65 6c 6c | 22 29 3b 0a 20 20 20 20 |listcell|");. |
|00004520| 20 20 20 20 6e 61 6d 65 | 43 65 6c 6c 2e 73 65 74 | name|Cell.set|
|00004530| 41 74 74 72 69 62 75 74 | 65 28 22 6c 61 62 65 6c |Attribut|e("label|
|00004540| 22 2c 20 63 61 6c 65 6e | 64 61 72 2e 6e 61 6d 65 |", calen|dar.name|
|00004550| 29 3b 0a 20 20 20 20 20 | 20 20 20 6c 69 73 74 49 |);. | listI|
|00004560| 74 65 6d 2e 61 70 70 65 | 6e 64 43 68 69 6c 64 28 |tem.appe|ndChild(|
|00004570| 6e 61 6d 65 43 65 6c 6c | 29 3b 0a 0a 20 20 20 20 |nameCell|);.. |
|00004580| 20 20 20 20 6c 69 73 74 | 49 74 65 6d 2e 63 61 6c | list|Item.cal|
|00004590| 65 6e 64 61 72 20 3d 20 | 63 61 6c 65 6e 64 61 72 |endar = |calendar|
|000045a0| 3b 0a 20 20 20 20 20 20 | 20 20 63 61 6c 65 6e 64 |;. | calend|
|000045b0| 61 72 4c 69 73 74 2e 61 | 70 70 65 6e 64 43 68 69 |arList.a|ppendChi|
|000045c0| 6c 64 28 6c 69 73 74 49 | 74 65 6d 29 3b 0a 20 20 |ld(listI|tem);. |
|000045d0| 20 20 7d 0a 0a 20 20 20 | 20 2f 2f 20 45 6e 73 75 | }.. | // Ensu|
|000045e0| 72 65 20 74 68 61 74 20 | 61 20 63 61 6c 65 6e 64 |re that |a calend|
|000045f0| 61 72 20 69 73 20 73 65 | 6c 65 63 74 65 64 20 69 |ar is se|lected i|
|00004600| 6e 20 63 61 6c 65 6e 64 | 61 72 20 6c 69 73 74 20 |n calend|ar list |
|00004610| 61 66 74 65 72 20 73 74 | 61 72 74 75 70 2e 0a 20 |after st|artup.. |
|00004620| 20 20 20 69 66 20 28 21 | 6f 6c 64 53 65 6c 65 63 | if (!|oldSelec|
|00004630| 74 69 6f 6e 20 7c 7c 20 | 6f 6c 64 53 65 6c 65 63 |tion || |oldSelec|
|00004640| 74 69 6f 6e 20 3c 20 30 | 29 20 7b 0a 20 20 20 20 |tion < 0|) {. |
|00004650| 20 20 20 20 76 61 72 20 | 64 65 66 61 75 6c 74 43 | var |defaultC|
|00004660| 61 6c 65 6e 64 61 72 20 | 3d 20 63 6f 6d 70 6f 73 |alendar |= compos|
|00004670| 69 74 65 2e 64 65 66 61 | 75 6c 74 43 61 6c 65 6e |ite.defa|ultCalen|
|00004680| 64 61 72 3b 0a 20 20 20 | 20 20 20 20 20 76 61 72 |dar;. | var|
|00004690| 20 69 74 65 6d 20 3d 20 | 64 65 66 61 75 6c 74 43 | item = |defaultC|
|000046a0| 61 6c 65 6e 64 61 72 20 | 3f 20 67 65 74 4c 69 73 |alendar |? getLis|
|000046b0| 74 49 74 65 6d 28 64 65 | 66 61 75 6c 74 43 61 6c |tItem(de|faultCal|
|000046c0| 65 6e 64 61 72 29 20 3a | 20 6e 75 6c 6c 3b 0a 20 |endar) :| null;. |
|000046d0| 20 20 20 20 20 20 20 6f | 6c 64 53 65 6c 65 63 74 | o|ldSelect|
|000046e0| 69 6f 6e 20 3d 20 69 74 | 65 6d 20 3f 20 63 61 6c |ion = it|em ? cal|
|000046f0| 65 6e 64 61 72 4c 69 73 | 74 2e 67 65 74 49 6e 64 |endarLis|t.getInd|
|00004700| 65 78 4f 66 49 74 65 6d | 28 69 74 65 6d 29 20 3a |exOfItem|(item) :|
|00004710| 20 30 3b 0a 20 20 20 20 | 7d 0a 20 20 20 20 69 66 | 0;. |}. if|
|00004720| 20 28 6f 6c 64 53 65 6c | 65 63 74 69 6f 6e 20 3e | (oldSel|ection >|
|00004730| 3d 20 63 61 6c 65 6e 64 | 61 72 73 2e 6c 65 6e 67 |= calend|ars.leng|
|00004740| 74 68 29 20 7b 0a 20 20 | 20 20 20 20 20 20 6f 6c |th) {. | ol|
|00004750| 64 53 65 6c 65 63 74 69 | 6f 6e 20 3d 20 63 61 6c |dSelecti|on = cal|
|00004760| 65 6e 64 61 72 73 2e 6c | 65 6e 67 74 68 2d 31 3b |endars.l|ength-1;|
|00004770| 0a 20 20 20 20 7d 0a 0a | 20 20 20 20 63 61 6c 65 |. }..| cale|
|00004780| 6e 64 61 72 4c 69 73 74 | 2e 73 65 6c 65 63 74 65 |ndarList|.selecte|
|00004790| 64 49 6e 64 65 78 20 3d | 20 6f 6c 64 53 65 6c 65 |dIndex =| oldSele|
|000047a0| 63 74 69 6f 6e 3b 0a 20 | 20 20 20 76 61 72 20 72 |ction;. | var r|
|000047b0| 65 6d 6f 74 65 43 6f 6d | 6d 61 6e 64 20 3d 20 64 |emoteCom|mand = d|
|000047c0| 6f 63 75 6d 65 6e 74 2e | 67 65 74 45 6c 65 6d 65 |ocument.|getEleme|
|000047d0| 6e 74 42 79 49 64 28 22 | 72 65 6c 6f 61 64 5f 72 |ntById("|reload_r|
|000047e0| 65 6d 6f 74 65 5f 63 61 | 6c 65 6e 64 61 72 73 22 |emote_ca|lendars"|
|000047f0| 29 3b 0a 20 20 20 20 69 | 66 20 28 21 68 61 73 52 |);. i|f (!hasR|
|00004800| 65 66 72 65 73 68 61 62 | 6c 65 43 61 6c 29 20 7b |efreshab|leCal) {|
|00004810| 0a 20 20 20 20 20 20 20 | 20 72 65 6d 6f 74 65 43 |. | remoteC|
|00004820| 6f 6d 6d 61 6e 64 2e 73 | 65 74 41 74 74 72 69 62 |ommand.s|etAttrib|
|00004830| 75 74 65 28 22 64 69 73 | 61 62 6c 65 64 22 2c 20 |ute("dis|abled", |
|00004840| 74 72 75 65 29 3b 0a 20 | 20 20 20 7d 20 65 6c 73 |true);. | } els|
|00004850| 65 20 7b 0a 20 20 20 20 | 20 20 20 20 72 65 6d 6f |e {. | remo|
|00004860| 74 65 43 6f 6d 6d 61 6e | 64 2e 72 65 6d 6f 76 65 |teComman|d.remove|
|00004870| 41 74 74 72 69 62 75 74 | 65 28 22 64 69 73 61 62 |Attribut|e("disab|
|00004880| 6c 65 64 22 29 3b 0a 20 | 20 20 20 7d 0a 7d 0a 0a |led");. | }.}..|
|00004890| 66 75 6e 63 74 69 6f 6e | 20 6f 6e 43 61 6c 65 6e |function| onCalen|
|000048a0| 64 61 72 4c 69 73 74 53 | 65 6c 65 63 74 28 29 20 |darListS|elect() |
|000048b0| 7b 0a 20 20 20 20 76 61 | 72 20 73 65 6c 65 63 74 |{. va|r select|
|000048c0| 65 64 43 61 6c 65 6e 64 | 61 72 20 3d 20 67 65 74 |edCalend|ar = get|
|000048d0| 53 65 6c 65 63 74 65 64 | 43 61 6c 65 6e 64 61 72 |Selected|Calendar|
|000048e0| 4f 72 4e 75 6c 6c 28 29 | 3b 0a 20 20 20 20 69 66 |OrNull()|;. if|
|000048f0| 20 28 21 73 65 6c 65 63 | 74 65 64 43 61 6c 65 6e | (!selec|tedCalen|
|00004900| 64 61 72 29 20 7b 0a 20 | 20 20 20 20 20 20 20 72 |dar) {. | r|
|00004910| 65 74 75 72 6e 3b 0a 20 | 20 20 20 7d 0a 20 20 20 |eturn;. | }. |
|00004920| 20 67 65 74 43 6f 6d 70 | 6f 73 69 74 65 43 61 6c | getComp|ositeCal|
|00004930| 65 6e 64 61 72 28 29 2e | 64 65 66 61 75 6c 74 43 |endar().|defaultC|
|00004940| 61 6c 65 6e 64 61 72 20 | 3d 20 73 65 6c 65 63 74 |alendar |= select|
|00004950| 65 64 43 61 6c 65 6e 64 | 61 72 3b 0a 7d 0a 0a 66 |edCalend|ar;.}..f|
|00004960| 75 6e 63 74 69 6f 6e 20 | 69 6e 69 74 43 61 6c 65 |unction |initCale|
|00004970| 6e 64 61 72 4d 61 6e 61 | 67 65 72 28 29 0a 7b 0a |ndarMana|ger().{.|
|00004980| 20 20 20 20 76 61 72 20 | 63 61 6c 4d 67 72 20 3d | var |calMgr =|
|00004990| 20 67 65 74 43 61 6c 65 | 6e 64 61 72 4d 61 6e 61 | getCale|ndarMana|
|000049a0| 67 65 72 28 29 3b 0a 20 | 20 20 20 76 61 72 20 63 |ger();. | var c|
|000049b0| 6f 6d 70 6f 73 69 74 65 | 20 3d 20 67 65 74 43 6f |omposite| = getCo|
|000049c0| 6d 70 6f 73 69 74 65 43 | 61 6c 65 6e 64 61 72 28 |mpositeC|alendar(|
|000049d0| 29 3b 0a 20 20 20 20 69 | 66 20 28 63 61 6c 4d 67 |);. i|f (calMg|
|000049e0| 72 2e 67 65 74 43 61 6c | 65 6e 64 61 72 73 28 7b |r.getCal|endars({|
|000049f0| 7d 29 2e 6c 65 6e 67 74 | 68 20 3d 3d 20 30 29 20 |}).lengt|h == 0) |
|00004a00| 7b 0a 20 20 20 20 20 20 | 20 20 76 61 72 20 68 6f |{. | var ho|
|00004a10| 6d 65 43 61 6c 65 6e 64 | 61 72 20 3d 20 63 61 6c |meCalend|ar = cal|
|00004a20| 4d 67 72 2e 63 72 65 61 | 74 65 43 61 6c 65 6e 64 |Mgr.crea|teCalend|
|00004a30| 61 72 28 22 73 74 6f 72 | 61 67 65 22 2c 20 6d 61 |ar("stor|age", ma|
|00004a40| 6b 65 55 52 4c 28 22 6d | 6f 7a 2d 70 72 6f 66 69 |keURL("m|oz-profi|
|00004a50| 6c 65 2d 63 61 6c 65 6e | 64 61 72 3a 2f 2f 22 29 |le-calen|dar://")|
|00004a60| 29 3b 0a 20 20 20 20 20 | 20 20 20 63 61 6c 4d 67 |);. | calMg|
|00004a70| 72 2e 72 65 67 69 73 74 | 65 72 43 61 6c 65 6e 64 |r.regist|erCalend|
|00004a80| 61 72 28 68 6f 6d 65 43 | 61 6c 65 6e 64 61 72 29 |ar(homeC|alendar)|
|00004a90| 3b 0a 20 20 20 20 20 20 | 20 20 76 61 72 20 6e 61 |;. | var na|
|00004aa0| 6d 65 20 3d 20 63 61 6c | 47 65 74 53 74 72 69 6e |me = cal|GetStrin|
|00004ab0| 67 28 22 63 61 6c 65 6e | 64 61 72 22 2c 20 22 68 |g("calen|dar", "h|
|00004ac0| 6f 6d 65 43 61 6c 65 6e | 64 61 72 4e 61 6d 65 22 |omeCalen|darName"|
|00004ad0| 29 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |);. | |
|00004ae0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00004af0| 20 20 20 20 0a 20 20 20 | 20 20 20 20 20 68 6f 6d | . | hom|
|00004b00| 65 43 61 6c 65 6e 64 61 | 72 2e 6e 61 6d 65 20 3d |eCalenda|r.name =|
|00004b10| 20 6e 61 6d 65 3b 0a 20 | 20 20 20 20 20 20 20 63 | name;. | c|
|00004b20| 6f 6d 70 6f 73 69 74 65 | 2e 61 64 64 43 61 6c 65 |omposite|.addCale|
|00004b30| 6e 64 61 72 28 68 6f 6d | 65 43 61 6c 65 6e 64 61 |ndar(hom|eCalenda|
|00004b40| 72 29 3b 0a 20 20 20 20 | 20 20 20 20 2f 2f 20 57 |r);. | // W|
|00004b50| 72 61 70 70 69 6e 67 20 | 74 68 69 73 20 69 6e 20 |rapping |this in |
|00004b60| 61 20 74 72 79 2f 63 61 | 74 63 68 20 62 6c 6f 63 |a try/ca|tch bloc|
|00004b70| 6b 2c 20 61 73 20 69 66 | 20 61 6e 79 20 6f 66 20 |k, as if| any of |
|00004b80| 74 68 65 20 6d 69 67 72 | 61 74 69 6f 6e 20 63 6f |the migr|ation co|
|00004b90| 64 65 0a 20 20 20 20 20 | 20 20 20 2f 2f 20 66 61 |de. | // fa|
|00004ba0| 69 6c 73 2c 20 74 68 65 | 20 61 70 70 20 6d 61 79 |ils, the| app may|
|00004bb0| 20 6e 6f 74 20 6c 6f 61 | 64 2e 0a 20 20 20 20 20 | not loa|d.. |
|00004bc0| 20 20 20 74 72 79 20 7b | 0a 20 20 20 20 20 20 20 | try {|. |
|00004bd0| 20 20 20 20 20 67 44 61 | 74 61 4d 69 67 72 61 74 | gDa|taMigrat|
|00004be0| 6f 72 2e 63 68 65 63 6b | 41 6e 64 4d 69 67 72 61 |or.check|AndMigra|
|00004bf0| 74 65 28 29 3b 0a 20 20 | 20 20 20 20 20 20 7d 20 |te();. | } |
|00004c00| 63 61 74 63 68 20 28 65 | 29 20 7b 0a 20 20 20 20 |catch (e|) {. |
|00004c10| 20 20 20 20 20 20 20 20 | 43 6f 6d 70 6f 6e 65 6e | |Componen|
|00004c20| 74 73 2e 75 74 69 6c 73 | 2e 72 65 70 6f 72 74 45 |ts.utils|.reportE|
|00004c30| 72 72 6f 72 28 22 4d 69 | 67 72 61 74 6f 72 20 65 |rror("Mi|grator e|
|00004c40| 72 72 6f 72 3a 20 22 20 | 2b 20 65 29 3b 0a 20 20 |rror: " |+ e);. |
|00004c50| 20 20 20 20 20 20 7d 0a | 20 20 20 20 7d 0a 20 20 | }.| }. |
|00004c60| 20 20 63 61 6c 4d 67 72 | 2e 61 64 64 4f 62 73 65 | calMgr|.addObse|
|00004c70| 72 76 65 72 28 63 61 6c | 43 61 6c 65 6e 64 61 72 |rver(cal|Calendar|
|00004c80| 4d 61 6e 61 67 65 72 4f | 62 73 65 72 76 65 72 29 |ManagerO|bserver)|
|00004c90| 3b 0a 20 20 20 20 63 6f | 6d 70 6f 73 69 74 65 2e |;. co|mposite.|
|00004ca0| 61 64 64 4f 62 73 65 72 | 76 65 72 28 63 61 6c 43 |addObser|ver(calC|
|00004cb0| 6f 6d 70 6f 73 69 74 65 | 43 61 6c 65 6e 64 61 72 |omposite|Calendar|
|00004cc0| 4f 62 73 65 72 76 65 72 | 29 3b 0a 20 20 20 20 73 |Observer|);. s|
|00004cd0| 65 74 43 61 6c 65 6e 64 | 61 72 4d 61 6e 61 67 65 |etCalend|arManage|
|00004ce0| 72 55 49 28 29 3b 0a 20 | 20 20 20 69 6e 69 74 43 |rUI();. | initC|
|00004cf0| 6f 6c 6f 72 73 28 29 3b | 0a 20 20 20 20 76 61 72 |olors();|. var|
|00004d00| 20 63 61 6c 65 6e 64 61 | 72 4c 69 73 74 20 3d 20 | calenda|rList = |
|00004d10| 64 6f 63 75 6d 65 6e 74 | 2e 67 65 74 45 6c 65 6d |document|.getElem|
|00004d20| 65 6e 74 42 79 49 64 28 | 22 6c 69 73 74 2d 63 61 |entById(|"list-ca|
|00004d30| 6c 65 6e 64 61 72 73 2d | 6c 69 73 74 62 6f 78 22 |lendars-|listbox"|
|00004d40| 29 3b 0a 20 20 20 20 63 | 61 6c 65 6e 64 61 72 4c |);. c|alendarL|
|00004d50| 69 73 74 2e 61 64 64 45 | 76 65 6e 74 4c 69 73 74 |ist.addE|ventList|
|00004d60| 65 6e 65 72 28 22 73 65 | 6c 65 63 74 22 2c 20 6f |ener("se|lect", o|
|00004d70| 6e 43 61 6c 65 6e 64 61 | 72 4c 69 73 74 53 65 6c |nCalenda|rListSel|
|00004d80| 65 63 74 2c 20 74 72 75 | 65 29 3b 0a 20 0a 20 20 |ect, tru|e);. . |
|00004d90| 20 20 20 2f 2f 20 53 65 | 74 20 75 70 20 61 20 70 | // Se|t up a p|
|00004da0| 72 65 66 20 6c 69 73 74 | 65 6e 65 72 20 73 6f 20 |ref list|ener so |
|00004db0| 74 68 65 20 70 72 6f 70 | 65 72 20 55 49 20 62 69 |the prop|er UI bi|
|00004dc0| 74 73 20 63 61 6e 20 62 | 65 20 72 65 66 72 65 73 |ts can b|e refres|
|00004dd0| 68 65 64 20 77 68 65 6e | 20 70 72 65 66 73 0a 20 |hed when| prefs. |
|00004de0| 20 20 20 20 2f 2f 20 61 | 72 65 20 63 68 61 6e 67 | // a|re chang|
|00004df0| 65 64 2e 0a 20 20 20 20 | 20 76 61 72 20 70 72 65 |ed.. | var pre|
|00004e00| 66 53 65 72 76 69 63 65 | 20 3d 20 43 63 5b 22 40 |fService| = Cc["@|
|00004e10| 6d 6f 7a 69 6c 6c 61 2e | 6f 72 67 2f 70 72 65 66 |mozilla.|org/pref|
|00004e20| 65 72 65 6e 63 65 73 2d | 73 65 72 76 69 63 65 3b |erences-|service;|
|00004e30| 31 22 5d 2e 0a 20 20 20 | 20 20 20 20 20 20 20 20 |1"].. | |
|00004e40| 20 20 20 20 20 20 20 20 | 20 20 20 20 67 65 74 53 | | getS|
|00004e50| 65 72 76 69 63 65 28 43 | 69 2e 6e 73 49 50 72 65 |ervice(C|i.nsIPre|
|00004e60| 66 53 65 72 76 69 63 65 | 29 3b 0a 20 20 20 20 20 |fService|);. |
|00004e70| 76 61 72 20 70 62 32 20 | 3d 20 70 72 65 66 53 65 |var pb2 |= prefSe|
|00004e80| 72 76 69 63 65 2e 67 65 | 74 42 72 61 6e 63 68 28 |rvice.ge|tBranch(|
|00004e90| 22 22 29 2e 51 75 65 72 | 79 49 6e 74 65 72 66 61 |"").Quer|yInterfa|
|00004ea0| 63 65 28 43 69 2e 6e 73 | 49 50 72 65 66 42 72 61 |ce(Ci.ns|IPrefBra|
|00004eb0| 6e 63 68 32 29 3b 0a 20 | 20 20 20 20 70 62 32 2e |nch2);. | pb2.|
|00004ec0| 61 64 64 4f 62 73 65 72 | 76 65 72 28 22 63 61 6c |addObser|ver("cal|
|00004ed0| 65 6e 64 61 72 2e 22 2c | 20 63 61 6c 50 72 65 66 |endar.",| calPref|
|00004ee0| 4f 62 73 65 72 76 65 72 | 2c 20 66 61 6c 73 65 29 |Observer|, false)|
|00004ef0| 3b 0a 7d 0a 0a 66 75 6e | 63 74 69 6f 6e 20 66 69 |;.}..fun|ction fi|
|00004f00| 6e 69 73 68 43 61 6c 65 | 6e 64 61 72 4d 61 6e 61 |nishCale|ndarMana|
|00004f10| 67 65 72 28 29 20 7b 0a | 20 20 20 20 2f 2f 20 52 |ger() {.| // R|
|00004f20| 65 6d 6f 76 65 20 74 68 | 65 20 63 61 74 65 67 6f |emove th|e catego|
|00004f30| 72 79 20 63 6f 6c 6f 72 | 20 70 72 65 66 20 6f 62 |ry color| pref ob|
|00004f40| 73 65 72 76 65 72 0a 20 | 20 20 20 76 61 72 20 70 |server. | var p|
|00004f50| 72 65 66 53 65 72 76 69 | 63 65 20 3d 20 43 63 5b |refServi|ce = Cc[|
|00004f60| 22 40 6d 6f 7a 69 6c 6c | 61 2e 6f 72 67 2f 70 72 |"@mozill|a.org/pr|
|00004f70| 65 66 65 72 65 6e 63 65 | 73 2d 73 65 72 76 69 63 |eference|s-servic|
|00004f80| 65 3b 31 22 5d 2e 0a 20 | 20 20 20 20 20 20 20 20 |e;1"].. | |
|00004f90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 67 65 74 | | get|
|00004fa0| 53 65 72 76 69 63 65 28 | 43 69 2e 6e 73 49 50 72 |Service(|Ci.nsIPr|
|00004fb0| 65 66 53 65 72 76 69 63 | 65 29 3b 0a 20 20 20 20 |efServic|e);. |
|00004fc0| 76 61 72 20 70 62 69 20 | 3d 20 70 72 65 66 53 65 |var pbi |= prefSe|
|00004fd0| 72 76 69 63 65 2e 67 65 | 74 42 72 61 6e 63 68 28 |rvice.ge|tBranch(|
|00004fe0| 22 22 29 3b 0a 20 20 20 | 20 70 62 69 20 3d 20 70 |"");. | pbi = p|
|00004ff0| 62 69 2e 51 75 65 72 79 | 49 6e 74 65 72 66 61 63 |bi.Query|Interfac|
|00005000| 65 28 43 6f 6d 70 6f 6e | 65 6e 74 73 2e 69 6e 74 |e(Compon|ents.int|
|00005010| 65 72 66 61 63 65 73 2e | 6e 73 49 50 72 65 66 42 |erfaces.|nsIPrefB|
|00005020| 72 61 6e 63 68 32 29 3b | 0a 20 20 20 20 70 62 69 |ranch2);|. pbi|
|00005030| 2e 72 65 6d 6f 76 65 4f | 62 73 65 72 76 65 72 28 |.removeO|bserver(|
|00005040| 22 63 61 6c 65 6e 64 61 | 72 2e 63 61 74 65 67 6f |"calenda|r.catego|
|00005050| 72 79 2e 63 6f 6c 6f 72 | 2e 22 2c 20 63 61 74 65 |ry.color|.", cate|
|00005060| 67 6f 72 79 50 72 65 66 | 4f 62 73 65 72 76 65 72 |goryPref|Observer|
|00005070| 29 3b 0a 20 20 20 20 70 | 62 69 2e 72 65 6d 6f 76 |);. p|bi.remov|
|00005080| 65 4f 62 73 65 72 76 65 | 72 28 22 63 61 6c 65 6e |eObserve|r("calen|
|00005090| 64 61 72 2e 22 2c 20 63 | 61 6c 50 72 65 66 4f 62 |dar.", c|alPrefOb|
|000050a0| 73 65 72 76 65 72 29 3b | 0a 0a 20 20 20 20 76 61 |server);|.. va|
|000050b0| 72 20 63 61 6c 65 6e 64 | 61 72 4c 69 73 74 20 3d |r calend|arList =|
|000050c0| 20 64 6f 63 75 6d 65 6e | 74 2e 67 65 74 45 6c 65 | documen|t.getEle|
|000050d0| 6d 65 6e 74 42 79 49 64 | 28 22 6c 69 73 74 2d 63 |mentById|("list-c|
|000050e0| 61 6c 65 6e 64 61 72 73 | 2d 6c 69 73 74 62 6f 78 |alendars|-listbox|
|000050f0| 22 29 3b 0a 20 20 20 20 | 63 61 6c 65 6e 64 61 72 |");. |calendar|
|00005100| 4c 69 73 74 2e 72 65 6d | 6f 76 65 45 76 65 6e 74 |List.rem|oveEvent|
|00005110| 4c 69 73 74 65 6e 65 72 | 28 22 73 65 6c 65 63 74 |Listener|("select|
|00005120| 22 2c 20 6f 6e 43 61 6c | 65 6e 64 61 72 4c 69 73 |", onCal|endarLis|
|00005130| 74 53 65 6c 65 63 74 2c | 20 74 72 75 65 29 3b 0a |tSelect,| true);.|
|00005140| 0a 20 20 20 20 67 65 74 | 43 61 6c 65 6e 64 61 72 |. get|Calendar|
|00005150| 4d 61 6e 61 67 65 72 28 | 29 2e 72 65 6d 6f 76 65 |Manager(|).remove|
|00005160| 4f 62 73 65 72 76 65 72 | 28 63 61 6c 43 61 6c 65 |Observer|(calCale|
|00005170| 6e 64 61 72 4d 61 6e 61 | 67 65 72 4f 62 73 65 72 |ndarMana|gerObser|
|00005180| 76 65 72 29 3b 0a 7d 0a | 0a 66 75 6e 63 74 69 6f |ver);.}.|.functio|
|00005190| 6e 20 67 65 74 44 65 66 | 61 75 6c 74 43 61 6c 65 |n getDef|aultCale|
|000051a0| 6e 64 61 72 28 29 0a 7b | 0a 20 20 20 76 61 72 20 |ndar().{|. var |
|000051b0| 63 61 6c 65 6e 64 61 72 | 4c 69 73 74 20 3d 20 64 |calendar|List = d|
|000051c0| 6f 63 75 6d 65 6e 74 2e | 67 65 74 45 6c 65 6d 65 |ocument.|getEleme|
|000051d0| 6e 74 42 79 49 64 28 22 | 6c 69 73 74 2d 63 61 6c |ntById("|list-cal|
|000051e0| 65 6e 64 61 72 73 2d 6c | 69 73 74 62 6f 78 22 29 |endars-l|istbox")|
|000051f0| 3b 0a 20 20 20 74 72 79 | 20 7b 0a 20 20 20 20 20 |;. try| {. |
|00005200| 20 20 76 61 72 20 73 65 | 6c 65 63 74 65 64 43 61 | var se|lectedCa|
|00005210| 6c 65 6e 64 61 72 20 3d | 20 63 61 6c 65 6e 64 61 |lendar =| calenda|
|00005220| 72 4c 69 73 74 2e 73 65 | 6c 65 63 74 65 64 49 74 |rList.se|lectedIt|
|00005230| 65 6d 2e 63 61 6c 65 6e | 64 61 72 3b 0a 20 20 20 |em.calen|dar;. |
|00005240| 20 20 20 20 72 65 74 75 | 72 6e 20 73 65 6c 65 63 | retu|rn selec|
|00005250| 74 65 64 43 61 6c 65 6e | 64 61 72 3b 0a 20 20 20 |tedCalen|dar;. |
|00005260| 7d 20 63 61 74 63 68 28 | 65 29 20 7b 0a 20 20 20 |} catch(|e) {. |
|00005270| 20 20 20 20 6e 65 77 43 | 61 6c 65 6e 64 61 72 44 | newC|alendarD|
|00005280| 69 61 6c 6f 67 28 29 3b | 0a 20 20 20 20 20 20 20 |ialog();|. |
|00005290| 73 65 6c 65 63 74 65 64 | 43 61 6c 65 6e 64 61 72 |selected|Calendar|
|000052a0| 20 3d 20 63 61 6c 65 6e | 64 61 72 4c 69 73 74 2e | = calen|darList.|
|000052b0| 73 65 6c 65 63 74 65 64 | 49 74 65 6d 2e 63 61 6c |selected|Item.cal|
|000052c0| 65 6e 64 61 72 3b 0a 20 | 20 20 20 20 20 20 72 65 |endar;. | re|
|000052d0| 74 75 72 6e 20 73 65 6c | 65 63 74 65 64 43 61 6c |turn sel|ectedCal|
|000052e0| 65 6e 64 61 72 3b 0a 20 | 20 20 7d 0a 20 20 20 72 |endar;. | }. r|
|000052f0| 65 74 75 72 6e 20 66 61 | 6c 73 65 3b 0a 7d 0a 0a |eturn fa|lse;.}..|
|00005300| 66 75 6e 63 74 69 6f 6e | 20 72 65 6c 6f 61 64 43 |function| reloadC|
|00005310| 61 6c 65 6e 64 61 72 73 | 28 29 0a 7b 0a 20 20 20 |alendars|().{. |
|00005320| 20 67 65 74 43 6f 6d 70 | 6f 73 69 74 65 43 61 6c | getComp|ositeCal|
|00005330| 65 6e 64 61 72 28 29 2e | 72 65 66 72 65 73 68 28 |endar().|refresh(|
|00005340| 29 3b 0a 7d 0a 0a 76 61 | 72 20 67 43 61 63 68 65 |);.}..va|r gCache|
|00005350| 64 53 74 79 6c 65 53 68 | 65 65 74 3b 0a 66 75 6e |dStyleSh|eet;.fun|
|00005360| 63 74 69 6f 6e 20 69 6e | 69 74 43 6f 6c 6f 72 73 |ction in|itColors|
|00005370| 28 29 20 7b 0a 20 20 20 | 20 76 61 72 20 63 61 6c |() {. | var cal|
|00005380| 65 6e 64 61 72 73 20 3d | 20 67 65 74 43 61 6c 65 |endars =| getCale|
|00005390| 6e 64 61 72 4d 61 6e 61 | 67 65 72 28 29 2e 67 65 |ndarMana|ger().ge|
|000053a0| 74 43 61 6c 65 6e 64 61 | 72 73 28 7b 7d 29 3b 0a |tCalenda|rs({});.|
|000053b0| 20 20 20 20 67 43 61 63 | 68 65 64 53 74 79 6c 65 | gCac|hedStyle|
|000053c0| 53 68 65 65 74 20 3d 20 | 67 65 74 53 74 79 6c 65 |Sheet = |getStyle|
|000053d0| 53 68 65 65 74 28 22 63 | 68 72 6f 6d 65 3a 2f 2f |Sheet("c|hrome://|
|000053e0| 63 61 6c 65 6e 64 61 72 | 2f 63 6f 6e 74 65 6e 74 |calendar|/content|
|000053f0| 2f 63 61 6c 65 6e 64 61 | 72 2d 76 69 65 77 2d 62 |/calenda|r-view-b|
|00005400| 69 6e 64 69 6e 67 73 2e | 63 73 73 22 29 3b 0a 20 |indings.|css");. |
|00005410| 20 20 20 66 6f 72 20 28 | 76 61 72 20 6a 20 69 6e | for (|var j in|
|00005420| 20 63 61 6c 65 6e 64 61 | 72 73 29 20 0a 20 20 20 | calenda|rs) . |
|00005430| 20 20 20 20 20 75 70 64 | 61 74 65 53 74 79 6c 65 | upd|ateStyle|
|00005440| 53 68 65 65 74 46 6f 72 | 4f 62 6a 65 63 74 28 63 |SheetFor|Object(c|
|00005450| 61 6c 65 6e 64 61 72 73 | 5b 6a 5d 2c 20 67 43 61 |alendars|[j], gCa|
|00005460| 63 68 65 64 53 74 79 6c | 65 53 68 65 65 74 29 3b |chedStyl|eSheet);|
|00005470| 0a 0a 20 20 20 20 76 61 | 72 20 70 72 65 66 53 65 |.. va|r prefSe|
|00005480| 72 76 69 63 65 20 3d 20 | 43 63 5b 22 40 6d 6f 7a |rvice = |Cc["@moz|
|00005490| 69 6c 6c 61 2e 6f 72 67 | 2f 70 72 65 66 65 72 65 |illa.org|/prefere|
|000054a0| 6e 63 65 73 2d 73 65 72 | 76 69 63 65 3b 31 22 5d |nces-ser|vice;1"]|
|000054b0| 2e 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|000054c0| 20 20 20 20 20 20 20 20 | 67 65 74 53 65 72 76 69 | |getServi|
|000054d0| 63 65 28 43 69 2e 6e 73 | 49 50 72 65 66 53 65 72 |ce(Ci.ns|IPrefSer|
|000054e0| 76 69 63 65 29 3b 0a 20 | 20 20 20 76 61 72 20 63 |vice);. | var c|
|000054f0| 61 74 65 67 6f 72 79 50 | 72 65 66 42 72 61 6e 63 |ategoryP|refBranc|
|00005500| 68 20 3d 20 70 72 65 66 | 53 65 72 76 69 63 65 2e |h = pref|Service.|
|00005510| 67 65 74 42 72 61 6e 63 | 68 28 22 63 61 6c 65 6e |getBranc|h("calen|
|00005520| 64 61 72 2e 63 61 74 65 | 67 6f 72 79 2e 63 6f 6c |dar.cate|gory.col|
|00005530| 6f 72 2e 22 29 3b 0a 20 | 20 20 20 76 61 72 20 70 |or.");. | var p|
|00005540| 72 65 66 41 72 72 61 79 | 20 3d 20 63 61 74 65 67 |refArray| = categ|
|00005550| 6f 72 79 50 72 65 66 42 | 72 61 6e 63 68 2e 67 65 |oryPrefB|ranch.ge|
|00005560| 74 43 68 69 6c 64 4c 69 | 73 74 28 22 22 2c 20 7b |tChildLi|st("", {|
|00005570| 7d 29 3b 0a 20 20 20 20 | 66 6f 72 20 28 76 61 72 |});. |for (var|
|00005580| 20 69 20 3d 20 30 3b 20 | 69 20 3c 20 70 72 65 66 | i = 0; |i < pref|
|00005590| 41 72 72 61 79 2e 6c 65 | 6e 67 74 68 3b 20 69 2b |Array.le|ngth; i+|
|000055a0| 2b 29 20 0a 20 20 20 20 | 20 20 20 20 75 70 64 61 |+) . | upda|
|000055b0| 74 65 53 74 79 6c 65 53 | 68 65 65 74 46 6f 72 4f |teStyleS|heetForO|
|000055c0| 62 6a 65 63 74 28 70 72 | 65 66 41 72 72 61 79 5b |bject(pr|efArray[|
|000055d0| 69 5d 2c 20 67 43 61 63 | 68 65 64 53 74 79 6c 65 |i], gCac|hedStyle|
|000055e0| 53 68 65 65 74 29 3b 0a | 20 20 20 0a 20 20 20 20 |Sheet);.| . |
|000055f0| 2f 2f 20 53 65 74 75 70 | 20 63 73 73 20 63 6c 61 |// Setup| css cla|
|00005600| 73 73 65 73 20 66 6f 72 | 20 63 61 74 65 67 6f 72 |sses for| categor|
|00005610| 79 20 63 6f 6c 6f 72 73 | 0a 20 20 20 20 76 61 72 |y colors|. var|
|00005620| 20 63 61 74 65 72 67 6f | 72 79 50 72 65 66 42 72 | catergo|ryPrefBr|
|00005630| 61 6e 63 68 20 3d 20 70 | 72 65 66 53 65 72 76 69 |anch = p|refServi|
|00005640| 63 65 2e 67 65 74 42 72 | 61 6e 63 68 28 22 22 29 |ce.getBr|anch("")|
|00005650| 3b 0a 20 20 20 20 76 61 | 72 20 70 62 69 20 3d 20 |;. va|r pbi = |
|00005660| 63 61 74 65 72 67 6f 72 | 79 50 72 65 66 42 72 61 |catergor|yPrefBra|
|00005670| 6e 63 68 2e 51 75 65 72 | 79 49 6e 74 65 72 66 61 |nch.Quer|yInterfa|
|00005680| 63 65 28 0a 20 20 20 20 | 20 20 20 20 43 6f 6d 70 |ce(. | Comp|
|00005690| 6f 6e 65 6e 74 73 2e 69 | 6e 74 65 72 66 61 63 65 |onents.i|nterface|
|000056a0| 73 2e 6e 73 49 50 72 65 | 66 42 72 61 6e 63 68 32 |s.nsIPre|fBranch2|
|000056b0| 29 3b 0a 20 20 20 20 70 | 62 69 2e 61 64 64 4f 62 |);. p|bi.addOb|
|000056c0| 73 65 72 76 65 72 28 22 | 63 61 6c 65 6e 64 61 72 |server("|calendar|
|000056d0| 2e 63 61 74 65 67 6f 72 | 79 2e 63 6f 6c 6f 72 2e |.categor|y.color.|
|000056e0| 22 2c 20 63 61 74 65 67 | 6f 72 79 50 72 65 66 4f |", categ|oryPrefO|
|000056f0| 62 73 65 72 76 65 72 2c | 20 66 61 6c 73 65 29 3b |bserver,| false);|
|00005700| 0a 20 20 20 20 63 61 74 | 65 67 6f 72 79 50 72 65 |. cat|egoryPre|
|00005710| 66 4f 62 73 65 72 76 65 | 72 2e 6f 62 73 65 72 76 |fObserve|r.observ|
|00005720| 65 28 6e 75 6c 6c 2c 20 | 6e 75 6c 6c 2c 20 22 22 |e(null, |null, ""|
|00005730| 29 3b 0a 7d 0a 0a 76 61 | 72 20 63 61 74 65 67 6f |);.}..va|r catego|
|00005740| 72 79 50 72 65 66 4f 62 | 73 65 72 76 65 72 20 3d |ryPrefOb|server =|
|00005750| 0a 7b 0a 20 20 20 6f 62 | 73 65 72 76 65 3a 20 66 |.{. ob|serve: f|
|00005760| 75 6e 63 74 69 6f 6e 28 | 61 53 75 62 6a 65 63 74 |unction(|aSubject|
|00005770| 2c 20 61 54 6f 70 69 63 | 2c 20 61 50 72 65 66 4e |, aTopic|, aPrefN|
|00005780| 61 6d 65 29 0a 20 20 20 | 7b 0a 20 20 20 20 20 20 |ame). |{. |
|00005790| 20 76 61 72 20 6e 61 6d | 65 20 3d 20 61 50 72 65 | var nam|e = aPre|
|000057a0| 66 4e 61 6d 65 3b 0a 20 | 20 20 20 20 20 20 2f 2f |fName;. | //|
|000057b0| 20 57 65 20 6f 6e 6c 79 | 20 77 61 6e 74 20 74 68 | We only| want th|
|000057c0| 65 20 61 63 74 75 61 6c | 20 63 61 74 65 67 6f 72 |e actual| categor|
|000057d0| 79 20 6e 61 6d 65 2e 20 | 20 32 34 20 69 73 20 74 |y name. | 24 is t|
|000057e0| 68 65 20 6c 65 6e 67 74 | 68 20 6f 66 20 74 68 65 |he lengt|h of the|
|000057f0| 20 0a 20 20 20 20 20 20 | 20 2f 2f 20 6c 65 61 64 | . | // lead|
|00005800| 69 6e 67 20 27 63 61 6c | 65 6e 64 61 72 2e 63 61 |ing 'cal|endar.ca|
|00005810| 74 65 67 6f 72 79 2e 63 | 6f 6c 6f 72 2e 27 20 74 |tegory.c|olor.' t|
|00005820| 65 72 6d 0a 20 20 20 20 | 20 20 20 6e 61 6d 65 20 |erm. | name |
|00005830| 3d 20 6e 61 6d 65 2e 73 | 75 62 73 74 72 28 32 34 |= name.s|ubstr(24|
|00005840| 2c 20 61 50 72 65 66 4e | 61 6d 65 2e 6c 65 6e 67 |, aPrefN|ame.leng|
|00005850| 74 68 20 2d 20 32 34 29 | 3b 0a 20 20 20 20 20 20 |th - 24)|;. |
|00005860| 20 75 70 64 61 74 65 53 | 74 79 6c 65 53 68 65 65 | updateS|tyleShee|
|00005870| 74 46 6f 72 4f 62 6a 65 | 63 74 28 6e 61 6d 65 2c |tForObje|ct(name,|
|00005880| 20 67 43 61 63 68 65 64 | 53 74 79 6c 65 53 68 65 | gCached|StyleShe|
|00005890| 65 74 29 3b 0a 20 20 20 | 7d 0a 7d 0a 0a 76 61 72 |et);. |}.}..var|
|000058a0| 20 67 43 6f 6d 70 6f 73 | 69 74 65 43 61 6c 65 6e | gCompos|iteCalen|
|000058b0| 64 61 72 20 3d 20 6e 75 | 6c 6c 3b 0a 66 75 6e 63 |dar = nu|ll;.func|
|000058c0| 74 69 6f 6e 20 67 65 74 | 43 6f 6d 70 6f 73 69 74 |tion get|Composit|
|000058d0| 65 43 61 6c 65 6e 64 61 | 72 28 29 0a 7b 0a 20 20 |eCalenda|r().{. |
|000058e0| 20 20 69 66 20 28 21 67 | 43 6f 6d 70 6f 73 69 74 | if (!g|Composit|
|000058f0| 65 43 61 6c 65 6e 64 61 | 72 29 20 7b 0a 20 20 20 |eCalenda|r) {. |
|00005900| 20 20 20 20 67 43 6f 6d | 70 6f 73 69 74 65 43 61 | gCom|positeCa|
|00005910| 6c 65 6e 64 61 72 20 3d | 20 43 6f 6d 70 6f 6e 65 |lendar =| Compone|
|00005920| 6e 74 73 2e 63 6c 61 73 | 73 65 73 5b 22 40 6d 6f |nts.clas|ses["@mo|
|00005930| 7a 69 6c 6c 61 2e 6f 72 | 67 2f 63 61 6c 65 6e 64 |zilla.or|g/calend|
|00005940| 61 72 2f 63 61 6c 65 6e | 64 61 72 3b 31 3f 74 79 |ar/calen|dar;1?ty|
|00005950| 70 65 3d 63 6f 6d 70 6f | 73 69 74 65 22 5d 0a 20 |pe=compo|site"]. |
|00005960| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005970| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005980| 20 20 20 20 2e 63 72 65 | 61 74 65 49 6e 73 74 61 | .cre|ateInsta|
|00005990| 6e 63 65 28 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 69 |nce(Comp|onents.i|
|000059a0| 6e 74 65 72 66 61 63 65 | 73 2e 63 61 6c 49 43 6f |nterface|s.calICo|
|000059b0| 6d 70 6f 73 69 74 65 43 | 61 6c 65 6e 64 61 72 29 |mpositeC|alendar)|
|000059c0| 3b 0a 20 20 20 20 20 20 | 20 67 43 6f 6d 70 6f 73 |;. | gCompos|
|000059d0| 69 74 65 43 61 6c 65 6e | 64 61 72 2e 70 72 65 66 |iteCalen|dar.pref|
|000059e0| 50 72 65 66 69 78 20 3d | 20 27 63 61 6c 65 6e 64 |Prefix =| 'calend|
|000059f0| 61 72 2d 6d 61 69 6e 27 | 3b 0a 20 20 20 20 7d 0a |ar-main'|;. }.|
|00005a00| 20 20 20 20 72 65 74 75 | 72 6e 20 67 43 6f 6d 70 | retu|rn gComp|
|00005a10| 6f 73 69 74 65 43 61 6c | 65 6e 64 61 72 3b 0a 7d |ositeCal|endar;.}|
|00005a20| 0a 0a 76 61 72 20 63 61 | 6c 50 72 65 66 4f 62 73 |..var ca|lPrefObs|
|00005a30| 65 72 76 65 72 20 3d 0a | 7b 0a 20 20 20 6f 62 73 |erver =.|{. obs|
|00005a40| 65 72 76 65 3a 20 66 75 | 6e 63 74 69 6f 6e 28 61 |erve: fu|nction(a|
|00005a50| 53 75 62 6a 65 63 74 2c | 20 61 54 6f 70 69 63 2c |Subject,| aTopic,|
|00005a60| 20 61 50 72 65 66 4e 61 | 6d 65 29 0a 20 20 20 7b | aPrefNa|me). {|
|00005a70| 0a 20 20 20 20 20 20 20 | 73 75 62 6a 65 63 74 20 |. |subject |
|00005a80| 3d 20 61 53 75 62 6a 65 | 63 74 2e 51 75 65 72 79 |= aSubje|ct.Query|
|00005a90| 49 6e 74 65 72 66 61 63 | 65 28 43 6f 6d 70 6f 6e |Interfac|e(Compon|
|00005aa0| 65 6e 74 73 2e 69 6e 74 | 65 72 66 61 63 65 73 2e |ents.int|erfaces.|
|00005ab0| 6e 73 49 50 72 65 66 42 | 72 61 6e 63 68 32 29 3b |nsIPrefB|ranch2);|
|00005ac0| 0a 0a 20 20 20 20 20 20 | 20 73 77 69 74 63 68 20 |.. | switch |
|00005ad0| 28 61 50 72 65 66 4e 61 | 6d 65 29 20 7b 0a 20 20 |(aPrefNa|me) {. |
|00005ae0| 20 20 20 20 20 20 20 20 | 20 20 63 61 73 65 20 22 | | case "|
|00005af0| 63 61 6c 65 6e 64 61 72 | 2e 77 65 65 6b 2e 73 74 |calendar|.week.st|
|00005b00| 61 72 74 22 3a 0a 20 20 | 20 20 20 20 20 20 20 20 |art":. | |
|00005b10| 20 20 20 20 20 20 64 6f | 63 75 6d 65 6e 74 2e 67 | do|cument.g|
|00005b20| 65 74 45 6c 65 6d 65 6e | 74 42 79 49 64 28 22 6c |etElemen|tById("l|
|00005b30| 65 66 74 68 61 6e 64 63 | 61 6c 65 6e 64 61 72 22 |efthandc|alendar"|
|00005b40| 29 2e 72 65 66 72 65 73 | 68 44 69 73 70 6c 61 79 |).refres|hDisplay|
|00005b50| 28 74 72 75 65 29 3b 0a | 20 20 20 20 20 20 20 20 |(true);.| |
|00005b60| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0a 20 | |break;. |
|00005b70| 20 20 20 20 20 20 20 20 | 20 20 20 63 61 73 65 20 | | case |
|00005b80| 22 63 61 6c 65 6e 64 61 | 72 2e 64 61 74 65 2e 66 |"calenda|r.date.f|
|00005b90| 6f 72 6d 61 74 22 3a 0a | 20 20 20 20 20 20 20 20 |ormat":.| |
|00005ba0| 20 20 20 20 20 20 20 20 | 76 61 72 20 63 75 72 72 | |var curr|
|00005bb0| 65 6e 74 56 69 65 77 20 | 3d 20 64 6f 63 75 6d 65 |entView |= docume|
|00005bc0| 6e 74 2e 67 65 74 45 6c | 65 6d 65 6e 74 42 79 49 |nt.getEl|ementByI|
|00005bd0| 64 28 22 76 69 65 77 2d | 64 65 63 6b 22 29 2e 73 |d("view-|deck").s|
|00005be0| 65 6c 65 63 74 65 64 50 | 61 6e 65 6c 3b 0a 20 20 |electedP|anel;. |
|00005bf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 63 75 | | cu|
|00005c00| 72 72 65 6e 74 56 69 65 | 77 2e 67 6f 54 6f 44 61 |rrentVie|w.goToDa|
|00005c10| 79 28 63 75 72 72 65 6e | 74 56 69 65 77 2e 73 65 |y(curren|tView.se|
|00005c20| 6c 65 63 74 65 64 44 61 | 79 29 3b 0a 20 20 20 20 |lectedDa|y);. |
|00005c30| 20 20 20 20 20 20 20 20 | 20 20 20 20 72 65 66 72 | | refr|
|00005c40| 65 73 68 45 76 65 6e 74 | 54 72 65 65 28 29 3b 0a |eshEvent|Tree();.|
|00005c50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005c60| 74 6f 44 6f 55 6e 69 66 | 69 6e 64 65 72 52 65 66 |toDoUnif|inderRef|
|00005c70| 72 65 73 68 28 29 3b 0a | 20 20 20 20 20 20 20 20 |resh();.| |
|00005c80| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0a 0a | |break;..|
|00005c90| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 61 73 65 | | case|
|00005ca0| 20 22 63 61 6c 65 6e 64 | 61 72 2e 74 69 6d 65 7a | "calend|ar.timez|
|00005cb0| 6f 6e 65 2e 6c 6f 63 61 | 6c 22 3a 0a 20 20 20 20 |one.loca|l":. |
|00005cc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 67 44 65 66 | | gDef|
|00005cd0| 61 75 6c 74 54 69 6d 65 | 7a 6f 6e 65 20 3d 20 73 |aultTime|zone = s|
|00005ce0| 75 62 6a 65 63 74 2e 67 | 65 74 43 68 61 72 50 72 |ubject.g|etCharPr|
|00005cf0| 65 66 28 61 50 72 65 66 | 4e 61 6d 65 29 3b 0a 0a |ef(aPref|Name);..|
|00005d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005d10| 76 61 72 20 63 75 72 72 | 65 6e 74 56 69 65 77 20 |var curr|entView |
|00005d20| 3d 20 64 6f 63 75 6d 65 | 6e 74 2e 67 65 74 45 6c |= docume|nt.getEl|
|00005d30| 65 6d 65 6e 74 42 79 49 | 64 28 22 76 69 65 77 2d |ementByI|d("view-|
|00005d40| 64 65 63 6b 22 29 2e 73 | 65 6c 65 63 74 65 64 50 |deck").s|electedP|
|00005d50| 61 6e 65 6c 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |anel;. | |
|00005d60| 20 20 20 20 20 20 63 75 | 72 72 65 6e 74 56 69 65 | cu|rrentVie|
|00005d70| 77 2e 67 6f 54 6f 44 61 | 79 28 63 75 72 72 65 6e |w.goToDa|y(curren|
|00005d80| 74 56 69 65 77 2e 73 65 | 6c 65 63 74 65 64 44 61 |tView.se|lectedDa|
|00005d90| 79 29 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |y);. | |
|00005da0| 20 20 20 20 72 65 66 72 | 65 73 68 45 76 65 6e 74 | refr|eshEvent|
|00005db0| 54 72 65 65 28 29 3b 0a | 20 20 20 20 20 20 20 20 |Tree();.| |
|00005dc0| 20 20 20 20 20 20 20 20 | 74 6f 44 6f 55 6e 69 66 | |toDoUnif|
|00005dd0| 69 6e 64 65 72 52 65 66 | 72 65 73 68 28 29 3b 0a |inderRef|resh();.|
|00005de0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005df0| 62 72 65 61 6b 3b 0a 0a | 20 20 20 20 20 20 20 20 |break;..| |
|00005e00| 20 20 20 20 64 65 66 61 | 75 6c 74 20 3a 0a 20 20 | defa|ult :. |
|00005e10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 62 72 | | br|
|00005e20| 65 61 6b 3b 0a 20 20 20 | 20 20 20 20 7d 0a 20 20 |eak;. | }. |
|00005e30| 20 7d 0a 7d 0a 50 4b 03 | 04 0a 00 00 00 00 00 84 | }.}.PK.|........|
|00005e40| 70 6f 36 ab 3a c9 f7 1a | 18 00 00 1a 18 00 00 22 |po6.:...|......."|
|00005e50| 00 00 00 63 6f 6e 74 65 | 6e 74 2f 63 61 6c 65 6e |...conte|nt/calen|
|00005e60| 64 61 72 2f 63 61 6c 65 | 6e 64 61 72 57 69 6e 64 |dar/cale|ndarWind|
|00005e70| 6f 77 2e 6a 73 2f 2a 20 | 2a 2a 2a 2a 2a 20 42 45 |ow.js/* |***** BE|
|00005e80| 47 49 4e 20 4c 49 43 45 | 4e 53 45 20 42 4c 4f 43 |GIN LICE|NSE BLOC|
|00005e90| 4b 20 2a 2a 2a 2a 2a 0a | 20 2a 20 56 65 72 73 69 |K *****.| * Versi|
|00005ea0| 6f 6e 3a 20 4d 50 4c 20 | 31 2e 31 2f 47 50 4c 20 |on: MPL |1.1/GPL |
|00005eb0| 32 2e 30 2f 4c 47 50 4c | 20 32 2e 31 0a 20 2a 0a |2.0/LGPL| 2.1. *.|
|00005ec0| 20 2a 20 54 68 65 20 63 | 6f 6e 74 65 6e 74 73 20 | * The c|ontents |
|00005ed0| 6f 66 20 74 68 69 73 20 | 66 69 6c 65 20 61 72 65 |of this |file are|
|00005ee0| 20 73 75 62 6a 65 63 74 | 20 74 6f 20 74 68 65 20 | subject| to the |
|00005ef0| 4d 6f 7a 69 6c 6c 61 20 | 50 75 62 6c 69 63 20 4c |Mozilla |Public L|
|00005f00| 69 63 65 6e 73 65 20 56 | 65 72 73 69 6f 6e 0a 20 |icense V|ersion. |
|00005f10| 2a 20 31 2e 31 20 28 74 | 68 65 20 22 4c 69 63 65 |* 1.1 (t|he "Lice|
|00005f20| 6e 73 65 22 29 3b 20 79 | 6f 75 20 6d 61 79 20 6e |nse"); y|ou may n|
|00005f30| 6f 74 20 75 73 65 20 74 | 68 69 73 20 66 69 6c 65 |ot use t|his file|
|00005f40| 20 65 78 63 65 70 74 20 | 69 6e 20 63 6f 6d 70 6c | except |in compl|
|00005f50| 69 61 6e 63 65 20 77 69 | 74 68 0a 20 2a 20 74 68 |iance wi|th. * th|
|00005f60| 65 20 4c 69 63 65 6e 73 | 65 2e 20 59 6f 75 20 6d |e Licens|e. You m|
|00005f70| 61 79 20 6f 62 74 61 69 | 6e 20 61 20 63 6f 70 79 |ay obtai|n a copy|
|00005f80| 20 6f 66 20 74 68 65 20 | 4c 69 63 65 6e 73 65 20 | of the |License |
|00005f90| 61 74 0a 20 2a 20 68 74 | 74 70 3a 2f 2f 77 77 77 |at. * ht|tp://www|
|00005fa0| 2e 6d 6f 7a 69 6c 6c 61 | 2e 6f 72 67 2f 4d 50 4c |.mozilla|.org/MPL|
|00005fb0| 2f 0a 20 2a 0a 20 2a 20 | 53 6f 66 74 77 61 72 65 |/. *. * |Software|
|00005fc0| 20 64 69 73 74 72 69 62 | 75 74 65 64 20 75 6e 64 | distrib|uted und|
|00005fd0| 65 72 20 74 68 65 20 4c | 69 63 65 6e 73 65 20 69 |er the L|icense i|
|00005fe0| 73 20 64 69 73 74 72 69 | 62 75 74 65 64 20 6f 6e |s distri|buted on|
|00005ff0| 20 61 6e 20 22 41 53 20 | 49 53 22 20 62 61 73 69 | an "AS |IS" basi|
|00006000| 73 2c 0a 20 2a 20 57 49 | 54 48 4f 55 54 20 57 41 |s,. * WI|THOUT WA|
|00006010| 52 52 41 4e 54 59 20 4f | 46 20 41 4e 59 20 4b 49 |RRANTY O|F ANY KI|
|00006020| 4e 44 2c 20 65 69 74 68 | 65 72 20 65 78 70 72 65 |ND, eith|er expre|
|00006030| 73 73 20 6f 72 20 69 6d | 70 6c 69 65 64 2e 20 53 |ss or im|plied. S|
|00006040| 65 65 20 74 68 65 20 4c | 69 63 65 6e 73 65 0a 20 |ee the L|icense. |
|00006050| 2a 20 66 6f 72 20 74 68 | 65 20 73 70 65 63 69 66 |* for th|e specif|
|00006060| 69 63 20 6c 61 6e 67 75 | 61 67 65 20 67 6f 76 65 |ic langu|age gove|
|00006070| 72 6e 69 6e 67 20 72 69 | 67 68 74 73 20 61 6e 64 |rning ri|ghts and|
|00006080| 20 6c 69 6d 69 74 61 74 | 69 6f 6e 73 20 75 6e 64 | limitat|ions und|
|00006090| 65 72 20 74 68 65 0a 20 | 2a 20 4c 69 63 65 6e 73 |er the. |* Licens|
|000060a0| 65 2e 0a 20 2a 0a 20 2a | 20 54 68 65 20 4f 72 69 |e.. *. *| The Ori|
|000060b0| 67 69 6e 61 6c 20 43 6f | 64 65 20 69 73 20 4f 45 |ginal Co|de is OE|
|000060c0| 6f 6e 65 20 43 61 6c 65 | 6e 64 61 72 20 43 6f 64 |one Cale|ndar Cod|
|000060d0| 65 2c 20 72 65 6c 65 61 | 73 65 64 20 4f 63 74 6f |e, relea|sed Octo|
|000060e0| 62 65 72 20 33 31 73 74 | 2c 20 32 30 30 31 2e 0a |ber 31st|, 2001..|
|000060f0| 20 2a 0a 20 2a 20 54 68 | 65 20 49 6e 69 74 69 61 | *. * Th|e Initia|
|00006100| 6c 20 44 65 76 65 6c 6f | 70 65 72 20 6f 66 20 74 |l Develo|per of t|
|00006110| 68 65 20 4f 72 69 67 69 | 6e 61 6c 20 43 6f 64 65 |he Origi|nal Code|
|00006120| 20 69 73 0a 20 2a 20 4f | 45 6f 6e 65 20 43 6f 72 | is. * O|Eone Cor|
|00006130| 70 6f 72 61 74 69 6f 6e | 2e 0a 20 2a 20 50 6f 72 |poration|.. * Por|
|00006140| 74 69 6f 6e 73 20 63 72 | 65 61 74 65 64 20 62 79 |tions cr|eated by|
|00006150| 20 74 68 65 20 49 6e 69 | 74 69 61 6c 20 44 65 76 | the Ini|tial Dev|
|00006160| 65 6c 6f 70 65 72 20 61 | 72 65 20 43 6f 70 79 72 |eloper a|re Copyr|
|00006170| 69 67 68 74 20 28 43 29 | 20 32 30 30 31 0a 20 2a |ight (C)| 2001. *|
|00006180| 20 74 68 65 20 49 6e 69 | 74 69 61 6c 20 44 65 76 | the Ini|tial Dev|
|00006190| 65 6c 6f 70 65 72 2e 20 | 41 6c 6c 20 52 69 67 68 |eloper. |All Righ|
|000061a0| 74 73 20 52 65 73 65 72 | 76 65 64 2e 0a 20 2a 0a |ts Reser|ved.. *.|
|000061b0| 20 2a 20 43 6f 6e 74 72 | 69 62 75 74 6f 72 28 73 | * Contr|ibutor(s|
|000061c0| 29 3a 20 47 61 72 74 68 | 20 53 6d 65 64 6c 65 79 |): Garth| Smedley|
|000061d0| 20 3c 67 61 72 74 68 73 | 40 6f 65 6f 6e 65 2e 63 | <garths|@oeone.c|
|000061e0| 6f 6d 3e 0a 20 2a 20 20 | 20 20 20 20 20 20 20 20 |om>. * | |
|000061f0| 20 20 20 20 20 20 20 4d | 69 6b 65 20 50 6f 74 74 | M|ike Pott|
|00006200| 65 72 20 3c 6d 69 6b 65 | 70 40 6f 65 6f 6e 65 2e |er <mike|p@oeone.|
|00006210| 63 6f 6d 3e 0a 20 2a 20 | 20 20 20 20 20 20 20 20 |com>. * | |
|00006220| 20 20 20 20 20 20 20 20 | 45 72 69 63 20 42 65 6c | |Eric Bel|
|00006230| 68 61 69 72 65 20 3c 62 | 65 6c 68 61 69 72 65 40 |haire <b|elhaire@|
|00006240| 69 65 66 2e 75 2d 70 73 | 75 64 2e 66 72 3e 0a 20 |ief.u-ps|ud.fr>. |
|00006250| 2a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |* | |
|00006260| 20 20 52 6f 62 69 6e 20 | 45 64 72 65 6e 69 75 73 | Robin |Edrenius|
|00006270| 20 3c 72 6f 62 69 6e 2e | 65 64 72 65 6e 69 75 73 | <robin.|edrenius|
|00006280| 40 67 6d 61 69 6c 2e 63 | 6f 6d 3e 0a 20 2a 20 20 |@gmail.c|om>. * |
|00006290| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 4a | | J|
|000062a0| 6f 65 79 20 4d 69 6e 74 | 61 20 3c 6a 6d 69 6e 74 |oey Mint|a <jmint|
|000062b0| 61 40 67 6d 61 69 6c 2e | 63 6f 6d 3e 0a 20 2a 0a |a@gmail.|com>. *.|
|000062c0| 20 2a 20 41 6c 74 65 72 | 6e 61 74 69 76 65 6c 79 | * Alter|natively|
|000062d0| 2c 20 74 68 65 20 63 6f | 6e 74 65 6e 74 73 20 6f |, the co|ntents o|
|000062e0| 66 20 74 68 69 73 20 66 | 69 6c 65 20 6d 61 79 20 |f this f|ile may |
|000062f0| 62 65 20 75 73 65 64 20 | 75 6e 64 65 72 20 74 68 |be used |under th|
|00006300| 65 20 74 65 72 6d 73 20 | 6f 66 0a 20 2a 20 65 69 |e terms |of. * ei|
|00006310| 74 68 65 72 20 74 68 65 | 20 47 4e 55 20 47 65 6e |ther the| GNU Gen|
|00006320| 65 72 61 6c 20 50 75 62 | 6c 69 63 20 4c 69 63 65 |eral Pub|lic Lice|
|00006330| 6e 73 65 20 56 65 72 73 | 69 6f 6e 20 32 20 6f 72 |nse Vers|ion 2 or|
|00006340| 20 6c 61 74 65 72 20 28 | 74 68 65 20 22 47 50 4c | later (|the "GPL|
|00006350| 22 29 2c 20 6f 72 0a 20 | 2a 20 74 68 65 20 47 4e |"), or. |* the GN|
|00006360| 55 20 4c 65 73 73 65 72 | 20 47 65 6e 65 72 61 6c |U Lesser| General|
|00006370| 20 50 75 62 6c 69 63 20 | 4c 69 63 65 6e 73 65 20 | Public |License |
|00006380| 56 65 72 73 69 6f 6e 20 | 32 2e 31 20 6f 72 20 6c |Version |2.1 or l|
|00006390| 61 74 65 72 20 28 74 68 | 65 20 22 4c 47 50 4c 22 |ater (th|e "LGPL"|
|000063a0| 29 2c 0a 20 2a 20 69 6e | 20 77 68 69 63 68 20 63 |),. * in| which c|
|000063b0| 61 73 65 20 74 68 65 20 | 70 72 6f 76 69 73 69 6f |ase the |provisio|
|000063c0| 6e 73 20 6f 66 20 74 68 | 65 20 47 50 4c 20 6f 72 |ns of th|e GPL or|
|000063d0| 20 74 68 65 20 4c 47 50 | 4c 20 61 72 65 20 61 70 | the LGP|L are ap|
|000063e0| 70 6c 69 63 61 62 6c 65 | 20 69 6e 73 74 65 61 64 |plicable| instead|
|000063f0| 0a 20 2a 20 6f 66 20 74 | 68 6f 73 65 20 61 62 6f |. * of t|hose abo|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.