home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 September / Chip_2003-09_cd1.bin / zkuste / macos / Files / wamcom.sit / wamcom-131-macos9-20030721 / Components / nsSidebar.js < prev    next >
MacBinary  |  2003-06-30  |  18.3 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Janne Salmijarvi Optimizer (music/janneSalmijarviOptimizer) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Mon Jun 30 01:49:23 2003, modified Mon Jun 30 01:49:23 2003, creator 'CWIE', type ASCII, 17979 bytes "nsSidebar.js" , at 0x46bb 407 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 6e 73 53 69 64 65 | 62 61 72 2e 6a 73 00 00 |..nsSide|bar.js..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 46 3b 00 | 00 01 97 bb 25 7f e3 bb |.....F;.|....%...|
|00000060| 25 7f e3 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |%.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 25 75 00 00 |........|....%u..|
|00000080| 2f 2a 20 2d 2a 2d 20 4d | 6f 64 65 3a 20 43 2b 2b |/* -*- M|ode: C++|
|00000090| 3b 20 74 61 62 2d 77 69 | 64 74 68 3a 20 34 3b 20 |; tab-wi|dth: 4; |
|000000a0| 69 6e 64 65 6e 74 2d 74 | 61 62 73 2d 6d 6f 64 65 |indent-t|abs-mode|
|000000b0| 3a 20 6e 69 6c 3b 20 63 | 2d 62 61 73 69 63 2d 6f |: nil; c|-basic-o|
|000000c0| 66 66 73 65 74 3a 20 34 | 20 2d 2a 2d 0d 20 2a 20 |ffset: 4| -*-. * |
|000000d0| 54 68 65 20 63 6f 6e 74 | 65 6e 74 73 20 6f 66 20 |The cont|ents of |
|000000e0| 74 68 69 73 20 66 69 6c | 65 20 61 72 65 20 73 75 |this fil|e are su|
|000000f0| 62 6a 65 63 74 20 74 6f | 20 74 68 65 20 4d 6f 7a |bject to| the Moz|
|00000100| 69 6c 6c 61 20 50 75 62 | 6c 69 63 0d 20 2a 20 4c |illa Pub|lic. * L|
|00000110| 69 63 65 6e 73 65 20 56 | 65 72 73 69 6f 6e 20 31 |icense V|ersion 1|
|00000120| 2e 31 20 28 74 68 65 20 | 22 4c 69 63 65 6e 73 65 |.1 (the |"License|
|00000130| 22 29 3b 20 79 6f 75 20 | 6d 61 79 20 6e 6f 74 20 |"); you |may not |
|00000140| 75 73 65 20 74 68 69 73 | 20 66 69 6c 65 0d 20 2a |use this| file. *|
|00000150| 20 65 78 63 65 70 74 20 | 69 6e 20 63 6f 6d 70 6c | except |in compl|
|00000160| 69 61 6e 63 65 20 77 69 | 74 68 20 74 68 65 20 4c |iance wi|th the L|
|00000170| 69 63 65 6e 73 65 2e 20 | 59 6f 75 20 6d 61 79 20 |icense. |You may |
|00000180| 6f 62 74 61 69 6e 20 61 | 20 63 6f 70 79 20 6f 66 |obtain a| copy of|
|00000190| 0d 20 2a 20 74 68 65 20 | 4c 69 63 65 6e 73 65 20 |. * the |License |
|000001a0| 61 74 20 68 74 74 70 3a | 2f 2f 77 77 77 2e 6d 6f |at http:|//www.mo|
|000001b0| 7a 69 6c 6c 61 2e 6f 72 | 67 2f 4d 50 4c 2f 0d 20 |zilla.or|g/MPL/. |
|000001c0| 2a 20 0d 20 2a 20 53 6f | 66 74 77 61 72 65 20 64 |* . * So|ftware d|
|000001d0| 69 73 74 72 69 62 75 74 | 65 64 20 75 6e 64 65 72 |istribut|ed under|
|000001e0| 20 74 68 65 20 4c 69 63 | 65 6e 73 65 20 69 73 20 | the Lic|ense is |
|000001f0| 64 69 73 74 72 69 62 75 | 74 65 64 20 6f 6e 20 61 |distribu|ted on a|
|00000200| 6e 20 22 41 53 0d 20 2a | 20 49 53 22 20 62 61 73 |n "AS. *| IS" bas|
|00000210| 69 73 2c 20 57 49 54 48 | 4f 55 54 20 57 41 52 52 |is, WITH|OUT WARR|
|00000220| 41 4e 54 59 20 4f 46 20 | 41 4e 59 20 4b 49 4e 44 |ANTY OF |ANY KIND|
|00000230| 2c 20 65 69 74 68 65 72 | 20 65 78 70 72 65 73 73 |, either| express|
|00000240| 20 6f 72 0d 20 2a 20 69 | 6d 70 6c 69 65 64 2e 20 | or. * i|mplied. |
|00000250| 53 65 65 20 74 68 65 20 | 4c 69 63 65 6e 73 65 20 |See the |License |
|00000260| 66 6f 72 20 74 68 65 20 | 73 70 65 63 69 66 69 63 |for the |specific|
|00000270| 20 6c 61 6e 67 75 61 67 | 65 20 67 6f 76 65 72 6e | languag|e govern|
|00000280| 69 6e 67 0d 20 2a 20 72 | 69 67 68 74 73 20 61 6e |ing. * r|ights an|
|00000290| 64 20 6c 69 6d 69 74 61 | 74 69 6f 6e 73 20 75 6e |d limita|tions un|
|000002a0| 64 65 72 20 74 68 65 20 | 4c 69 63 65 6e 73 65 2e |der the |License.|
|000002b0| 0d 20 2a 20 0d 20 2a 20 | 54 68 65 20 4f 72 69 67 |. * . * |The Orig|
|000002c0| 69 6e 61 6c 20 43 6f 64 | 65 20 69 73 20 6d 6f 7a |inal Cod|e is moz|
|000002d0| 69 6c 6c 61 2e 6f 72 67 | 20 63 6f 64 65 2e 0d 20 |illa.org| code.. |
|000002e0| 2a 20 0d 20 2a 20 54 68 | 65 20 49 6e 69 74 69 61 |* . * Th|e Initia|
|000002f0| 6c 20 44 65 76 65 6c 6f | 70 65 72 20 6f 66 20 74 |l Develo|per of t|
|00000300| 68 65 20 4f 72 69 67 69 | 6e 61 6c 20 43 6f 64 65 |he Origi|nal Code|
|00000310| 20 69 73 20 4e 65 74 73 | 63 61 70 65 0d 20 2a 20 | is Nets|cape. * |
|00000320| 43 6f 6d 6d 75 6e 69 63 | 61 74 69 6f 6e 73 20 43 |Communic|ations C|
|00000330| 6f 72 70 6f 72 61 74 69 | 6f 6e 2e 20 20 50 6f 72 |orporati|on. Por|
|00000340| 74 69 6f 6e 73 20 63 72 | 65 61 74 65 64 20 62 79 |tions cr|eated by|
|00000350| 20 4e 65 74 73 63 61 70 | 65 20 61 72 65 0d 20 2a | Netscap|e are. *|
|00000360| 20 43 6f 70 79 72 69 67 | 68 74 20 28 43 29 20 31 | Copyrig|ht (C) 1|
|00000370| 39 39 39 20 4e 65 74 73 | 63 61 70 65 20 43 6f 6d |999 Nets|cape Com|
|00000380| 6d 75 6e 69 63 61 74 69 | 6f 6e 73 20 43 6f 72 70 |municati|ons Corp|
|00000390| 6f 72 61 74 69 6f 6e 2e | 20 20 41 6c 6c 0d 20 2a |oration.| All. *|
|000003a0| 20 52 69 67 68 74 73 20 | 52 65 73 65 72 76 65 64 | Rights |Reserved|
|000003b0| 2e 0d 20 2a 20 0d 20 2a | 20 43 6f 6e 74 72 69 62 |.. * . *| Contrib|
|000003c0| 75 74 6f 72 28 73 29 3a | 20 53 74 65 70 68 65 6e |utor(s):| Stephen|
|000003d0| 20 4c 61 6d 6d 20 20 20 | 20 20 20 20 20 20 20 20 | Lamm | |
|000003e0| 20 3c 73 6c 61 6d 6d 40 | 6e 65 74 73 63 61 70 65 | <slamm@|netscape|
|000003f0| 2e 63 6f 6d 3e 0d 20 2a | 20 20 20 20 20 20 20 20 |.com>. *| |
|00000400| 20 20 20 20 20 20 20 20 | 20 52 6f 62 65 72 74 20 | | Robert |
|00000410| 4a 6f 68 6e 20 43 68 75 | 72 63 68 69 6c 6c 20 20 |John Chu|rchill |
|00000420| 20 3c 72 6a 63 40 6e 65 | 74 73 63 61 70 65 2e 63 | <rjc@ne|tscape.c|
|00000430| 6f 6d 3e 0d 20 2a 2f 0d | 0d 2f 2a 0d 20 2a 20 4e |om>. */.|./*. * N|
|00000440| 6f 20 6d 61 67 69 63 20 | 63 6f 6e 73 74 72 75 63 |o magic |construc|
|00000450| 74 6f 72 20 62 65 68 61 | 76 69 6f 75 72 2c 20 61 |tor beha|viour, a|
|00000460| 73 20 69 73 20 64 65 20 | 72 69 67 65 75 72 20 66 |s is de |rigeur f|
|00000470| 6f 72 20 58 50 43 4f 4d | 2e 0d 20 2a 20 49 66 20 |or XPCOM|.. * If |
|00000480| 79 6f 75 20 6d 75 73 74 | 20 70 65 72 66 6f 72 6d |you must| perform|
|00000490| 20 73 6f 6d 65 20 69 6e | 69 74 69 61 6c 69 7a 61 | some in|itializa|
|000004a0| 74 69 6f 6e 2c 20 61 6e | 64 20 69 74 20 63 6f 75 |tion, an|d it cou|
|000004b0| 6c 64 20 70 6f 73 73 69 | 62 6c 79 20 66 61 69 6c |ld possi|bly fail|
|000004c0| 20 28 65 76 65 6e 0d 20 | 2a 20 64 75 65 20 74 6f | (even. |* due to|
|000004d0| 20 61 6e 20 6f 75 74 2d | 6f 66 2d 6d 65 6d 6f 72 | an out-|of-memor|
|000004e0| 79 20 63 6f 6e 64 69 74 | 69 6f 6e 29 2c 20 79 6f |y condit|ion), yo|
|000004f0| 75 20 73 68 6f 75 6c 64 | 20 75 73 65 20 61 6e 20 |u should| use an |
|00000500| 49 6e 69 74 20 6d 65 74 | 68 6f 64 2c 20 77 68 69 |Init met|hod, whi|
|00000510| 63 68 0d 20 2a 20 63 61 | 6e 20 63 6f 6e 76 65 79 |ch. * ca|n convey|
|00000520| 20 66 61 69 6c 75 72 65 | 20 61 70 70 72 6f 70 72 | failure| appropr|
|00000530| 69 61 74 65 6c 79 20 28 | 74 68 72 6f 77 6e 20 65 |iately (|thrown e|
|00000540| 78 63 65 70 74 69 6f 6e | 20 69 6e 20 4a 53 2c 0d |xception| in JS,.|
|00000550| 20 2a 20 4e 53 5f 46 41 | 49 4c 45 44 28 6e 73 72 | * NS_FA|ILED(nsr|
|00000560| 65 73 75 6c 74 29 20 72 | 65 74 75 72 6e 20 69 6e |esult) r|eturn in|
|00000570| 20 43 2b 2b 29 2e 0d 20 | 2a 0d 20 2a 20 49 6e 20 | C++).. |*. * In |
|00000580| 4a 53 2c 20 79 6f 75 20 | 63 61 6e 20 61 63 74 75 |JS, you |can actu|
|00000590| 61 6c 6c 79 20 63 68 65 | 61 74 2c 20 62 65 63 61 |ally che|at, beca|
|000005a0| 75 73 65 20 61 20 74 68 | 72 6f 77 6e 20 65 78 63 |use a th|rown exc|
|000005b0| 65 70 74 69 6f 6e 20 77 | 69 6c 6c 20 63 61 75 73 |eption w|ill caus|
|000005c0| 65 20 74 68 65 0d 20 2a | 20 43 72 65 61 74 65 49 |e the. *| CreateI|
|000005d0| 6e 73 74 61 6e 63 65 20 | 63 61 6c 6c 20 74 6f 20 |nstance |call to |
|000005e0| 66 61 69 6c 20 69 6e 20 | 74 75 72 6e 2c 20 62 75 |fail in |turn, bu|
|000005f0| 74 20 6e 6f 74 20 61 6c | 6c 20 6c 61 6e 67 75 61 |t not al|l langua|
|00000600| 67 65 73 20 61 72 65 20 | 73 6f 20 6c 75 63 6b 79 |ges are |so lucky|
|00000610| 2e 0d 20 2a 20 28 54 68 | 6f 75 67 68 20 41 4e 53 |.. * (Th|ough ANS|
|00000620| 49 20 43 2b 2b 20 70 72 | 6f 76 69 64 65 73 20 65 |I C++ pr|ovides e|
|00000630| 78 63 65 70 74 69 6f 6e | 73 2c 20 74 68 65 79 20 |xception|s, they |
|00000640| 61 72 65 20 76 65 72 62 | 6f 74 65 6e 20 69 6e 20 |are verb|oten in |
|00000650| 4d 6f 7a 69 6c 6c 61 20 | 63 6f 64 65 0d 20 2a 20 |Mozilla |code. * |
|00000660| 66 6f 72 20 70 6f 72 74 | 61 62 69 6c 69 74 79 20 |for port|ability |
|00000670| 72 65 61 73 6f 6e 73 20 | 2d 2d 20 61 6e 64 20 65 |reasons |-- and e|
|00000680| 76 65 6e 20 77 68 65 6e | 20 79 6f 75 27 72 65 20 |ven when| you're |
|00000690| 62 75 69 6c 64 69 6e 67 | 20 63 6f 6d 70 6c 65 74 |building| complet|
|000006a0| 65 6c 79 0d 20 2a 20 70 | 6c 61 74 66 6f 72 6d 2d |ely. * p|latform-|
|000006b0| 73 70 65 63 69 66 69 63 | 20 63 6f 64 65 2c 20 79 |specific| code, y|
|000006c0| 6f 75 20 63 61 6e 27 74 | 20 74 68 72 6f 77 20 61 |ou can't| throw a|
|000006d0| 63 72 6f 73 73 20 61 6e | 20 58 50 43 4f 4d 20 6d |cross an| XPCOM m|
|000006e0| 65 74 68 6f 64 20 62 6f | 75 6e 64 61 72 79 2e 29 |ethod bo|undary.)|
|000006f0| 0d 20 2a 2f 0d 0d 63 6f | 6e 73 74 20 44 45 42 55 |. */..co|nst DEBU|
|00000700| 47 20 3d 20 66 61 6c 73 | 65 3b 20 2f 2a 20 73 65 |G = fals|e; /* se|
|00000710| 74 20 74 6f 20 66 61 6c | 73 65 20 74 6f 20 73 75 |t to fal|se to su|
|00000720| 70 70 72 65 73 73 20 64 | 65 62 75 67 20 6d 65 73 |ppress d|ebug mes|
|00000730| 73 61 67 65 73 20 2a 2f | 0d 63 6f 6e 73 74 20 50 |sages */|.const P|
|00000740| 41 4e 45 4c 53 5f 52 44 | 46 5f 46 49 4c 45 20 20 |ANELS_RD|F_FILE |
|00000750| 3d 20 22 55 50 6e 6c 73 | 22 3b 20 2f 2a 20 64 69 |= "UPnls|"; /* di|
|00000760| 72 65 63 74 6f 72 79 20 | 73 65 72 76 69 63 65 73 |rectory |services|
|00000770| 20 70 72 6f 70 65 72 74 | 79 20 74 6f 20 66 69 6e | propert|y to fin|
|00000780| 64 20 70 61 6e 65 6c 73 | 2e 72 64 66 20 2a 2f 0d |d panels|.rdf */.|
|00000790| 0d 63 6f 6e 73 74 20 53 | 49 44 45 42 41 52 5f 43 |.const S|IDEBAR_C|
|000007a0| 4f 4e 54 52 41 43 54 49 | 44 20 20 20 3d 20 22 40 |ONTRACTI|D = "@|
|000007b0| 6d 6f 7a 69 6c 6c 61 2e | 6f 72 67 2f 73 69 64 65 |mozilla.|org/side|
|000007c0| 62 61 72 3b 31 22 3b 0d | 63 6f 6e 73 74 20 53 49 |bar;1";.|const SI|
|000007d0| 44 45 42 41 52 5f 43 49 | 44 20 20 20 20 20 20 3d |DEBAR_CI|D =|
|000007e0| 20 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 49 44 28 22 | Compone|nts.ID("|
|000007f0| 7b 32 32 31 31 37 31 34 | 30 2d 39 63 36 65 2d 31 |{2211714|0-9c6e-1|
|00000800| 31 64 33 2d 61 61 66 31 | 2d 30 30 38 30 35 66 38 |1d3-aaf1|-00805f8|
|00000810| 61 34 39 30 35 7d 22 29 | 3b 0d 63 6f 6e 73 74 20 |a4905}")|;.const |
|00000820| 43 4f 4e 54 41 49 4e 45 | 52 5f 43 4f 4e 54 52 41 |CONTAINE|R_CONTRA|
|00000830| 43 54 49 44 20 3d 20 22 | 40 6d 6f 7a 69 6c 6c 61 |CTID = "|@mozilla|
|00000840| 2e 6f 72 67 2f 72 64 66 | 2f 63 6f 6e 74 61 69 6e |.org/rdf|/contain|
|00000850| 65 72 3b 31 22 3b 0d 63 | 6f 6e 73 74 20 44 49 52 |er;1";.c|onst DIR|
|00000860| 5f 53 45 52 56 5f 43 4f | 4e 54 52 41 43 54 49 44 |_SERV_CO|NTRACTID|
|00000870| 20 20 3d 20 22 40 6d 6f | 7a 69 6c 6c 61 2e 6f 72 | = "@mo|zilla.or|
|00000880| 67 2f 66 69 6c 65 2f 64 | 69 72 65 63 74 6f 72 79 |g/file/d|irectory|
|00000890| 5f 73 65 72 76 69 63 65 | 3b 31 22 0d 63 6f 6e 73 |_service|;1".cons|
|000008a0| 74 20 4e 45 54 53 45 41 | 52 43 48 5f 43 4f 4e 54 |t NETSEA|RCH_CONT|
|000008b0| 52 41 43 54 49 44 20 3d | 20 22 40 6d 6f 7a 69 6c |RACTID =| "@mozil|
|000008c0| 6c 61 2e 6f 72 67 2f 72 | 64 66 2f 64 61 74 61 73 |la.org/r|df/datas|
|000008d0| 6f 75 72 63 65 3b 31 3f | 6e 61 6d 65 3d 69 6e 74 |ource;1?|name=int|
|000008e0| 65 72 6e 65 74 73 65 61 | 72 63 68 22 0d 63 6f 6e |ernetsea|rch".con|
|000008f0| 73 74 20 49 4f 5f 53 45 | 52 56 5f 43 4f 4e 54 52 |st IO_SE|RV_CONTR|
|00000900| 41 43 54 49 44 20 20 20 | 3d 20 22 40 6d 6f 7a 69 |ACTID |= "@mozi|
|00000910| 6c 6c 61 2e 6f 72 67 2f | 6e 65 74 77 6f 72 6b 2f |lla.org/|network/|
|00000920| 69 6f 2d 73 65 72 76 69 | 63 65 3b 31 22 3b 0d 63 |io-servi|ce;1";.c|
|00000930| 6f 6e 73 74 20 6e 73 49 | 53 75 70 70 6f 72 74 73 |onst nsI|Supports|
|00000940| 20 20 20 20 20 20 3d 20 | 43 6f 6d 70 6f 6e 65 6e | = |Componen|
|00000950| 74 73 2e 69 6e 74 65 72 | 66 61 63 65 73 2e 6e 73 |ts.inter|faces.ns|
|00000960| 49 53 75 70 70 6f 72 74 | 73 3b 0d 63 6f 6e 73 74 |ISupport|s;.const|
|00000970| 20 6e 73 49 46 61 63 74 | 6f 72 79 20 20 20 20 20 | nsIFact|ory |
|00000980| 20 20 3d 20 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 69 | = Comp|onents.i|
|00000990| 6e 74 65 72 66 61 63 65 | 73 2e 6e 73 49 46 61 63 |nterface|s.nsIFac|
|000009a0| 74 6f 72 79 3b 0d 63 6f | 6e 73 74 20 6e 73 49 53 |tory;.co|nst nsIS|
|000009b0| 69 64 65 62 61 72 20 20 | 20 20 20 20 20 3d 20 43 |idebar | = C|
|000009c0| 6f 6d 70 6f 6e 65 6e 74 | 73 2e 69 6e 74 65 72 66 |omponent|s.interf|
|000009d0| 61 63 65 73 2e 6e 73 49 | 53 69 64 65 62 61 72 3b |aces.nsI|Sidebar;|
|000009e0| 0d 63 6f 6e 73 74 20 6e | 73 49 52 44 46 43 6f 6e |.const n|sIRDFCon|
|000009f0| 74 61 69 6e 65 72 20 20 | 3d 20 43 6f 6d 70 6f 6e |tainer |= Compon|
|00000a00| 65 6e 74 73 2e 69 6e 74 | 65 72 66 61 63 65 73 2e |ents.int|erfaces.|
|00000a10| 6e 73 49 52 44 46 43 6f | 6e 74 61 69 6e 65 72 3b |nsIRDFCo|ntainer;|
|00000a20| 0d 63 6f 6e 73 74 20 6e | 73 49 50 72 6f 70 65 72 |.const n|sIProper|
|00000a30| 74 69 65 73 20 20 20 20 | 3d 20 43 6f 6d 70 6f 6e |ties |= Compon|
|00000a40| 65 6e 74 73 2e 69 6e 74 | 65 72 66 61 63 65 73 2e |ents.int|erfaces.|
|00000a50| 6e 73 49 50 72 6f 70 65 | 72 74 69 65 73 3b 0d 63 |nsIPrope|rties;.c|
|00000a60| 6f 6e 73 74 20 6e 73 49 | 46 69 6c 65 55 52 4c 20 |onst nsI|FileURL |
|00000a70| 20 20 20 20 20 20 3d 20 | 43 6f 6d 70 6f 6e 65 6e | = |Componen|
|00000a80| 74 73 2e 69 6e 74 65 72 | 66 61 63 65 73 2e 6e 73 |ts.inter|faces.ns|
|00000a90| 49 46 69 6c 65 55 52 4c | 3b 0d 63 6f 6e 73 74 20 |IFileURL|;.const |
|00000aa0| 6e 73 49 52 44 46 52 65 | 6d 6f 74 65 44 61 74 61 |nsIRDFRe|moteData|
|00000ab0| 53 6f 75 72 63 65 20 3d | 20 43 6f 6d 70 6f 6e 65 |Source =| Compone|
|00000ac0| 6e 74 73 2e 69 6e 74 65 | 72 66 61 63 65 73 2e 6e |nts.inte|rfaces.n|
|00000ad0| 73 49 52 44 46 52 65 6d | 6f 74 65 44 61 74 61 53 |sIRDFRem|oteDataS|
|00000ae0| 6f 75 72 63 65 3b 0d 63 | 6f 6e 73 74 20 6e 73 49 |ource;.c|onst nsI|
|00000af0| 49 6e 74 65 72 6e 65 74 | 53 65 61 72 63 68 53 65 |Internet|SearchSe|
|00000b00| 72 76 69 63 65 20 3d 20 | 43 6f 6d 70 6f 6e 65 6e |rvice = |Componen|
|00000b10| 74 73 2e 69 6e 74 65 72 | 66 61 63 65 73 2e 6e 73 |ts.inter|faces.ns|
|00000b20| 49 49 6e 74 65 72 6e 65 | 74 53 65 61 72 63 68 53 |IInterne|tSearchS|
|00000b30| 65 72 76 69 63 65 3b 0d | 63 6f 6e 73 74 20 6e 73 |ervice;.|const ns|
|00000b40| 49 43 6c 61 73 73 49 6e | 66 6f 20 3d 20 43 6f 6d |IClassIn|fo = Com|
|00000b50| 70 6f 6e 65 6e 74 73 2e | 69 6e 74 65 72 66 61 63 |ponents.|interfac|
|00000b60| 65 73 2e 6e 73 49 43 6c | 61 73 73 49 6e 66 6f 3b |es.nsICl|assInfo;|
|00000b70| 0d 0d 66 75 6e 63 74 69 | 6f 6e 20 6e 73 53 69 64 |..functi|on nsSid|
|00000b80| 65 62 61 72 28 29 0d 7b | 0d 20 20 20 20 63 6f 6e |ebar().{|. con|
|00000b90| 73 74 20 52 44 46 5f 43 | 4f 4e 54 52 41 43 54 49 |st RDF_C|ONTRACTI|
|00000ba0| 44 20 3d 20 22 40 6d 6f | 7a 69 6c 6c 61 2e 6f 72 |D = "@mo|zilla.or|
|00000bb0| 67 2f 72 64 66 2f 72 64 | 66 2d 73 65 72 76 69 63 |g/rdf/rd|f-servic|
|00000bc0| 65 3b 31 22 3b 0d 20 20 | 20 20 63 6f 6e 73 74 20 |e;1";. | const |
|00000bd0| 6e 73 49 52 44 46 53 65 | 72 76 69 63 65 20 3d 20 |nsIRDFSe|rvice = |
|00000be0| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|00000bf0| 66 61 63 65 73 2e 6e 73 | 49 52 44 46 53 65 72 76 |faces.ns|IRDFServ|
|00000c00| 69 63 65 3b 0d 20 20 20 | 20 0d 20 20 20 20 74 68 |ice;. | . th|
|00000c10| 69 73 2e 72 64 66 20 3d | 20 43 6f 6d 70 6f 6e 65 |is.rdf =| Compone|
|00000c20| 6e 74 73 2e 63 6c 61 73 | 73 65 73 5b 52 44 46 5f |nts.clas|ses[RDF_|
|00000c30| 43 4f 4e 54 52 41 43 54 | 49 44 5d 2e 67 65 74 53 |CONTRACT|ID].getS|
|00000c40| 65 72 76 69 63 65 28 6e | 73 49 52 44 46 53 65 72 |ervice(n|sIRDFSer|
|00000c50| 76 69 63 65 29 3b 0d 20 | 20 20 20 74 68 69 73 2e |vice);. | this.|
|00000c60| 64 61 74 61 73 6f 75 72 | 63 65 5f 75 72 69 20 3d |datasour|ce_uri =|
|00000c70| 20 67 65 74 53 69 64 65 | 62 61 72 44 61 74 61 73 | getSide|barDatas|
|00000c80| 6f 75 72 63 65 55 52 49 | 28 50 41 4e 45 4c 53 5f |ourceURI|(PANELS_|
|00000c90| 52 44 46 5f 46 49 4c 45 | 29 3b 0d 20 20 20 20 64 |RDF_FILE|);. d|
|00000ca0| 65 62 75 67 28 27 64 61 | 74 61 73 6f 75 72 63 65 |ebug('da|tasource|
|00000cb0| 5f 75 72 69 20 69 73 20 | 27 20 2b 20 74 68 69 73 |_uri is |' + this|
|00000cc0| 2e 64 61 74 61 73 6f 75 | 72 63 65 5f 75 72 69 29 |.datasou|rce_uri)|
|00000cd0| 3b 0d 20 20 20 20 74 68 | 69 73 2e 72 65 73 6f 75 |;. th|is.resou|
|00000ce0| 72 63 65 20 3d 20 27 75 | 72 6e 3a 73 69 64 65 62 |rce = 'u|rn:sideb|
|00000cf0| 61 72 3a 63 75 72 72 65 | 6e 74 2d 70 61 6e 65 6c |ar:curre|nt-panel|
|00000d00| 2d 6c 69 73 74 27 3b 0d | 20 20 20 20 74 68 69 73 |-list';.| this|
|00000d10| 2e 64 61 74 61 73 6f 75 | 72 63 65 20 3d 20 74 68 |.datasou|rce = th|
|00000d20| 69 73 2e 72 64 66 2e 47 | 65 74 44 61 74 61 53 6f |is.rdf.G|etDataSo|
|00000d30| 75 72 63 65 28 74 68 69 | 73 2e 64 61 74 61 73 6f |urce(thi|s.dataso|
|00000d40| 75 72 63 65 5f 75 72 69 | 29 3b 0d 7d 0d 0d 6e 73 |urce_uri|);.}..ns|
|00000d50| 53 69 64 65 62 61 72 2e | 70 72 6f 74 6f 74 79 70 |Sidebar.|prototyp|
|00000d60| 65 2e 6e 63 20 3d 20 22 | 68 74 74 70 3a 2f 2f 68 |e.nc = "|http://h|
|00000d70| 6f 6d 65 2e 6e 65 74 73 | 63 61 70 65 2e 63 6f 6d |ome.nets|cape.com|
|00000d80| 2f 4e 43 2d 72 64 66 23 | 22 3b 0d 0d 6e 73 53 69 |/NC-rdf#|";..nsSi|
|00000d90| 64 65 62 61 72 2e 70 72 | 6f 74 6f 74 79 70 65 2e |debar.pr|ototype.|
|00000da0| 73 65 74 57 69 6e 64 6f | 77 20 3d 0d 66 75 6e 63 |setWindo|w =.func|
|00000db0| 74 69 6f 6e 20 28 61 57 | 69 6e 64 6f 77 29 0d 7b |tion (aW|indow).{|
|00000dc0| 20 20 20 20 0d 20 20 20 | 20 74 68 69 73 2e 77 69 | . | this.wi|
|00000dd0| 6e 64 6f 77 20 3d 20 61 | 57 69 6e 64 6f 77 3b 20 |ndow = a|Window; |
|00000de0| 20 20 20 0d 7d 0d 0d 6e | 73 53 69 64 65 62 61 72 | .}..n|sSidebar|
|00000df0| 2e 70 72 6f 74 6f 74 79 | 70 65 2e 69 73 50 61 6e |.prototy|pe.isPan|
|00000e00| 65 6c 20 3d 0d 66 75 6e | 63 74 69 6f 6e 20 28 61 |el =.fun|ction (a|
|00000e10| 43 6f 6e 74 65 6e 74 55 | 52 4c 29 0d 7b 0d 20 20 |ContentU|RL).{. |
|00000e20| 20 20 76 61 72 20 63 6f | 6e 74 61 69 6e 65 72 20 | var co|ntainer |
|00000e30| 3d 20 0d 20 20 20 20 20 | 20 20 20 43 6f 6d 70 6f |= . | Compo|
|00000e40| 6e 65 6e 74 73 2e 63 6c | 61 73 73 65 73 5b 43 4f |nents.cl|asses[CO|
|00000e50| 4e 54 41 49 4e 45 52 5f | 43 4f 4e 54 52 41 43 54 |NTAINER_|CONTRACT|
|00000e60| 49 44 5d 2e 63 72 65 61 | 74 65 49 6e 73 74 61 6e |ID].crea|teInstan|
|00000e70| 63 65 28 6e 73 49 52 44 | 46 43 6f 6e 74 61 69 6e |ce(nsIRD|FContain|
|00000e80| 65 72 29 3b 0d 0d 20 20 | 20 20 63 6f 6e 74 61 69 |er);.. | contai|
|00000e90| 6e 65 72 2e 49 6e 69 74 | 28 74 68 69 73 2e 64 61 |ner.Init|(this.da|
|00000ea0| 74 61 73 6f 75 72 63 65 | 2c 20 74 68 69 73 2e 72 |tasource|, this.r|
|00000eb0| 64 66 2e 47 65 74 52 65 | 73 6f 75 72 63 65 28 74 |df.GetRe|source(t|
|00000ec0| 68 69 73 2e 72 65 73 6f | 75 72 63 65 29 29 3b 0d |his.reso|urce));.|
|00000ed0| 20 20 20 20 0d 20 20 20 | 20 2f 2a 20 43 72 65 61 | . | /* Crea|
|00000ee0| 74 65 20 61 20 72 65 73 | 6f 75 72 63 65 20 66 6f |te a res|ource fo|
|00000ef0| 72 20 74 68 65 20 6e 65 | 77 20 70 61 6e 65 6c 20 |r the ne|w panel |
|00000f00| 61 6e 64 20 61 64 64 20 | 69 74 20 74 6f 20 74 68 |and add |it to th|
|00000f10| 65 20 6c 69 73 74 20 2a | 2f 0d 20 20 20 20 76 61 |e list *|/. va|
|00000f20| 72 20 70 61 6e 65 6c 5f | 72 65 73 6f 75 72 63 65 |r panel_|resource|
|00000f30| 20 3d 20 0d 20 20 20 20 | 20 20 20 20 74 68 69 73 | = . | this|
|00000f40| 2e 72 64 66 2e 47 65 74 | 52 65 73 6f 75 72 63 65 |.rdf.Get|Resource|
|00000f50| 28 22 75 72 6e 3a 73 69 | 64 65 62 61 72 3a 33 72 |("urn:si|debar:3r|
|00000f60| 64 70 61 72 74 79 2d 70 | 61 6e 65 6c 3a 22 20 2b |dparty-p|anel:" +|
|00000f70| 20 61 43 6f 6e 74 65 6e | 74 55 52 4c 29 3b 0d 0d | aConten|tURL);..|
|00000f80| 20 20 20 20 72 65 74 75 | 72 6e 20 28 63 6f 6e 74 | retu|rn (cont|
|00000f90| 61 69 6e 65 72 2e 49 6e | 64 65 78 4f 66 28 70 61 |ainer.In|dexOf(pa|
|00000fa0| 6e 65 6c 5f 72 65 73 6f | 75 72 63 65 29 20 21 3d |nel_reso|urce) !=|
|00000fb0| 20 2d 31 29 3b 0d 7d 0d | 0d 66 75 6e 63 74 69 6f | -1);.}.|.functio|
|00000fc0| 6e 20 73 69 64 65 62 61 | 72 55 52 4c 53 65 63 75 |n sideba|rURLSecu|
|00000fd0| 72 69 74 79 43 68 65 63 | 6b 28 75 72 6c 29 0d 7b |rityChec|k(url).{|
|00000fe0| 0d 20 20 20 20 69 66 20 | 28 75 72 6c 2e 73 65 61 |. if |(url.sea|
|00000ff0| 72 63 68 28 2f 28 5e 68 | 74 74 70 3a 7c 5e 66 74 |rch(/(^h|ttp:|^ft|
|00001000| 70 3a 7c 5e 68 74 74 70 | 73 3a 29 2f 29 20 3d 3d |p:|^http|s:)/) ==|
|00001010| 20 2d 31 29 0d 20 20 20 | 20 20 20 20 20 74 68 72 | -1). | thr|
|00001020| 6f 77 20 22 53 63 72 69 | 70 74 20 61 74 74 65 6d |ow "Scri|pt attem|
|00001030| 70 74 65 64 20 74 6f 20 | 61 64 64 20 73 69 64 65 |pted to |add side|
|00001040| 62 61 72 20 70 61 6e 65 | 6c 20 66 72 6f 6d 20 69 |bar pane|l from i|
|00001050| 6c 6c 65 67 61 6c 20 73 | 6f 75 72 63 65 22 3b 0d |llegal s|ource";.|
|00001060| 7d 0d 0d 2f 2a 20 64 65 | 63 6f 72 61 74 65 20 70 |}../* de|corate p|
|00001070| 72 6f 74 6f 74 79 70 65 | 20 74 6f 20 70 72 6f 76 |rototype| to prov|
|00001080| 69 64 65 20 60 60 63 6c | 61 73 73 27 27 20 6d 65 |ide ``cl|ass'' me|
|00001090| 74 68 6f 64 73 20 61 6e | 64 20 70 72 6f 70 65 72 |thods an|d proper|
|000010a0| 74 79 20 61 63 63 65 73 | 73 6f 72 73 20 2a 2f 0d |ty acces|sors */.|
|000010b0| 6e 73 53 69 64 65 62 61 | 72 2e 70 72 6f 74 6f 74 |nsSideba|r.protot|
|000010c0| 79 70 65 2e 61 64 64 50 | 61 6e 65 6c 20 3d 0d 66 |ype.addP|anel =.f|
|000010d0| 75 6e 63 74 69 6f 6e 20 | 28 61 54 69 74 6c 65 2c |unction |(aTitle,|
|000010e0| 20 61 43 6f 6e 74 65 6e | 74 55 52 4c 2c 20 61 43 | aConten|tURL, aC|
|000010f0| 75 73 74 6f 6d 69 7a 65 | 55 52 4c 29 0d 7b 0d 20 |ustomize|URL).{. |
|00001100| 20 20 20 64 65 62 75 67 | 28 22 61 64 64 50 61 6e | debug|("addPan|
|00001110| 65 6c 28 22 20 2b 20 61 | 54 69 74 6c 65 20 2b 20 |el(" + a|Title + |
|00001120| 22 2c 20 22 20 2b 20 61 | 43 6f 6e 74 65 6e 74 55 |", " + a|ContentU|
|00001130| 52 4c 20 2b 20 22 2c 20 | 22 20 2b 0d 20 20 20 20 |RL + ", |" +. |
|00001140| 20 20 20 20 20 20 61 43 | 75 73 74 6f 6d 69 7a 65 | aC|ustomize|
|00001150| 55 52 4c 20 2b 20 22 29 | 22 29 3b 0d 20 20 20 0d |URL + ")|");. .|
|00001160| 20 20 20 20 72 65 74 75 | 72 6e 20 74 68 69 73 2e | retu|rn this.|
|00001170| 61 64 64 50 61 6e 65 6c | 49 6e 74 65 72 6e 61 6c |addPanel|Internal|
|00001180| 28 61 54 69 74 6c 65 2c | 20 61 43 6f 6e 74 65 6e |(aTitle,| aConten|
|00001190| 74 55 52 4c 2c 20 61 43 | 75 73 74 6f 6d 69 7a 65 |tURL, aC|ustomize|
|000011a0| 55 52 4c 2c 20 66 61 6c | 73 65 29 3b 0d 7d 0d 0d |URL, fal|se);.}..|
|000011b0| 6e 73 53 69 64 65 62 61 | 72 2e 70 72 6f 74 6f 74 |nsSideba|r.protot|
|000011c0| 79 70 65 2e 61 64 64 50 | 65 72 73 69 73 74 65 6e |ype.addP|ersisten|
|000011d0| 74 50 61 6e 65 6c 20 3d | 20 0d 66 75 6e 63 74 69 |tPanel =| .functi|
|000011e0| 6f 6e 28 61 54 69 74 6c | 65 2c 20 61 43 6f 6e 74 |on(aTitl|e, aCont|
|000011f0| 65 6e 74 55 52 4c 2c 20 | 61 43 75 73 74 6f 6d 69 |entURL, |aCustomi|
|00001200| 7a 65 55 52 4c 29 0d 7b | 0d 20 20 20 20 64 65 62 |zeURL).{|. deb|
|00001210| 75 67 28 22 61 64 64 50 | 65 72 73 69 73 74 65 6e |ug("addP|ersisten|
|00001220| 74 50 61 6e 65 6c 28 22 | 20 2b 20 61 54 69 74 6c |tPanel("| + aTitl|
|00001230| 65 20 2b 20 22 2c 20 22 | 20 2b 20 61 43 6f 6e 74 |e + ", "| + aCont|
|00001240| 65 6e 74 55 52 4c 20 2b | 20 22 2c 20 22 20 2b 0d |entURL +| ", " +.|
|00001250| 20 20 20 20 20 20 20 20 | 20 20 20 61 43 75 73 74 | | aCust|
|00001260| 6f 6d 69 7a 65 55 52 4c | 20 2b 20 22 29 5c 6e 22 |omizeURL| + ")\n"|
|00001270| 29 3b 0d 0d 20 20 20 20 | 72 65 74 75 72 6e 20 74 |);.. |return t|
|00001280| 68 69 73 2e 61 64 64 50 | 61 6e 65 6c 49 6e 74 65 |his.addP|anelInte|
|00001290| 72 6e 61 6c 28 61 54 69 | 74 6c 65 2c 20 61 43 6f |rnal(aTi|tle, aCo|
|000012a0| 6e 74 65 6e 74 55 52 4c | 2c 20 61 43 75 73 74 6f |ntentURL|, aCusto|
|000012b0| 6d 69 7a 65 55 52 4c 2c | 20 74 72 75 65 29 3b 0d |mizeURL,| true);.|
|000012c0| 7d 0d 0d 6e 73 53 69 64 | 65 62 61 72 2e 70 72 6f |}..nsSid|ebar.pro|
|000012d0| 74 6f 74 79 70 65 2e 61 | 64 64 50 61 6e 65 6c 49 |totype.a|ddPanelI|
|000012e0| 6e 74 65 72 6e 61 6c 20 | 3d 0d 66 75 6e 63 74 69 |nternal |=.functi|
|000012f0| 6f 6e 20 28 61 54 69 74 | 6c 65 2c 20 61 43 6f 6e |on (aTit|le, aCon|
|00001300| 74 65 6e 74 55 52 4c 2c | 20 61 43 75 73 74 6f 6d |tentURL,| aCustom|
|00001310| 69 7a 65 55 52 4c 2c 20 | 61 50 65 72 73 69 73 74 |izeURL, |aPersist|
|00001320| 29 0d 7b 0d 20 20 20 20 | 69 66 20 28 21 74 68 69 |).{. |if (!thi|
|00001330| 73 2e 77 69 6e 64 6f 77 | 29 0d 20 20 20 20 7b 0d |s.window|). {.|
|00001340| 20 20 20 20 20 20 20 20 | 64 65 62 75 67 20 28 22 | |debug ("|
|00001350| 6e 6f 20 77 69 6e 64 6f | 77 20 6f 62 6a 65 63 74 |no windo|w object|
|00001360| 20 73 65 74 2c 20 62 61 | 69 6c 69 6e 67 20 6f 75 | set, ba|iling ou|
|00001370| 74 2e 22 29 3b 0d 20 20 | 20 20 20 20 20 20 74 68 |t.");. | th|
|00001380| 72 6f 77 20 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 72 |row Comp|onents.r|
|00001390| 65 73 75 6c 74 73 2e 4e | 53 5f 45 52 52 4f 52 5f |esults.N|S_ERROR_|
|000013a0| 4e 4f 54 5f 49 4e 49 54 | 49 41 4c 49 5a 45 44 3b |NOT_INIT|IALIZED;|
|000013b0| 0d 20 20 20 20 7d 0d 0d | 20 20 20 20 73 69 64 65 |. }..| side|
|000013c0| 62 61 72 55 52 4c 53 65 | 63 75 72 69 74 79 43 68 |barURLSe|curityCh|
|000013d0| 65 63 6b 28 61 43 6f 6e | 74 65 6e 74 55 52 4c 29 |eck(aCon|tentURL)|
|000013e0| 3b 0d 0d 20 20 20 20 2f | 2f 20 43 72 65 61 74 65 |;.. /|/ Create|
|000013f0| 20 61 20 22 63 6f 6e 74 | 61 69 6e 65 72 22 20 77 | a "cont|ainer" w|
|00001400| 72 61 70 70 65 72 20 61 | 72 6f 75 6e 64 20 74 68 |rapper a|round th|
|00001410| 65 20 63 75 72 72 65 6e | 74 20 70 61 6e 65 6c 73 |e curren|t panels|
|00001420| 20 74 6f 0d 20 20 20 20 | 2f 2f 20 6d 61 6e 69 70 | to. |// manip|
|00001430| 75 6c 61 74 65 20 74 68 | 65 20 52 44 46 3a 53 65 |ulate th|e RDF:Se|
|00001440| 71 20 6d 6f 72 65 20 65 | 61 73 69 6c 79 2e 0d 20 |q more e|asily.. |
|00001450| 20 20 20 76 61 72 20 70 | 61 6e 65 6c 5f 6c 69 73 | var p|anel_lis|
|00001460| 74 20 3d 20 74 68 69 73 | 2e 64 61 74 61 73 6f 75 |t = this|.datasou|
|00001470| 72 63 65 2e 47 65 74 54 | 61 72 67 65 74 28 74 68 |rce.GetT|arget(th|
|00001480| 69 73 2e 72 64 66 2e 47 | 65 74 52 65 73 6f 75 72 |is.rdf.G|etResour|
|00001490| 63 65 28 74 68 69 73 2e | 72 65 73 6f 75 72 63 65 |ce(this.|resource|
|000014a0| 29 2c 20 74 68 69 73 2e | 72 64 66 2e 47 65 74 52 |), this.|rdf.GetR|
|000014b0| 65 73 6f 75 72 63 65 28 | 6e 73 53 69 64 65 62 61 |esource(|nsSideba|
|000014c0| 72 2e 70 72 6f 74 6f 74 | 79 70 65 2e 6e 63 2b 22 |r.protot|ype.nc+"|
|000014d0| 70 61 6e 65 6c 2d 6c 69 | 73 74 22 29 2c 20 74 72 |panel-li|st"), tr|
|000014e0| 75 65 29 3b 0d 20 20 20 | 20 69 66 20 28 70 61 6e |ue);. | if (pan|
|000014f0| 65 6c 5f 6c 69 73 74 29 | 20 7b 0d 20 20 20 20 20 |el_list)| {. |
|00001500| 20 20 20 70 61 6e 65 6c | 5f 6c 69 73 74 2e 51 75 | panel|_list.Qu|
|00001510| 65 72 79 49 6e 74 65 72 | 66 61 63 65 28 43 6f 6d |eryInter|face(Com|
|00001520| 70 6f 6e 65 6e 74 73 2e | 69 6e 74 65 72 66 61 63 |ponents.|interfac|
|00001530| 65 73 2e 6e 73 49 52 44 | 46 52 65 73 6f 75 72 63 |es.nsIRD|FResourc|
|00001540| 65 29 3b 0d 20 20 20 20 | 7d 20 65 6c 73 65 20 7b |e);. |} else {|
|00001550| 0d 20 20 20 20 20 20 20 | 20 2f 2f 20 44 61 74 61 |. | // Data|
|00001560| 73 6f 75 72 63 65 20 69 | 73 20 62 75 73 74 65 64 |source i|s busted|
|00001570| 2e 20 53 74 61 72 74 20 | 6f 76 65 72 2e 0d 20 20 |. Start |over.. |
|00001580| 20 20 20 20 20 20 64 65 | 62 75 67 28 22 53 69 64 | de|bug("Sid|
|00001590| 65 62 61 72 20 64 61 74 | 61 73 6f 75 72 63 65 20 |ebar dat|asource |
|000015a0| 69 73 20 62 75 73 74 65 | 64 5c 6e 22 29 3b 0d 20 |is buste|d\n");. |
|000015b0| 20 20 20 7d 0d 0d 20 20 | 20 20 76 61 72 20 63 6f | }.. | var co|
|000015c0| 6e 74 61 69 6e 65 72 20 | 3d 20 43 6f 6d 70 6f 6e |ntainer |= Compon|
|000015d0| 65 6e 74 73 2e 63 6c 61 | 73 73 65 73 5b 43 4f 4e |ents.cla|sses[CON|
|000015e0| 54 41 49 4e 45 52 5f 43 | 4f 4e 54 52 41 43 54 49 |TAINER_C|ONTRACTI|
|000015f0| 44 5d 2e 63 72 65 61 74 | 65 49 6e 73 74 61 6e 63 |D].creat|eInstanc|
|00001600| 65 28 6e 73 49 52 44 46 | 43 6f 6e 74 61 69 6e 65 |e(nsIRDF|Containe|
|00001610| 72 29 3b 0d 20 20 20 20 | 63 6f 6e 74 61 69 6e 65 |r);. |containe|
|00001620| 72 2e 49 6e 69 74 28 74 | 68 69 73 2e 64 61 74 61 |r.Init(t|his.data|
|00001630| 73 6f 75 72 63 65 2c 20 | 70 61 6e 65 6c 5f 6c 69 |source, |panel_li|
|00001640| 73 74 29 3b 0d 0d 20 20 | 20 20 2f 2a 20 43 72 65 |st);.. | /* Cre|
|00001650| 61 74 65 20 61 20 72 65 | 73 6f 75 72 63 65 20 66 |ate a re|source f|
|00001660| 6f 72 20 74 68 65 20 6e | 65 77 20 70 61 6e 65 6c |or the n|ew panel|
|00001670| 20 61 6e 64 20 61 64 64 | 20 69 74 20 74 6f 20 74 | and add| it to t|
|00001680| 68 65 20 6c 69 73 74 20 | 2a 2f 0d 20 20 20 20 76 |he list |*/. v|
|00001690| 61 72 20 70 61 6e 65 6c | 5f 72 65 73 6f 75 72 63 |ar panel|_resourc|
|000016a0| 65 20 3d 20 0d 20 20 20 | 20 20 20 20 20 74 68 69 |e = . | thi|
|000016b0| 73 2e 72 64 66 2e 47 65 | 74 52 65 73 6f 75 72 63 |s.rdf.Ge|tResourc|
|000016c0| 65 28 22 75 72 6e 3a 73 | 69 64 65 62 61 72 3a 33 |e("urn:s|idebar:3|
|000016d0| 72 64 70 61 72 74 79 2d | 70 61 6e 65 6c 3a 22 20 |rdparty-|panel:" |
|000016e0| 2b 20 61 43 6f 6e 74 65 | 6e 74 55 52 4c 29 3b 0d |+ aConte|ntURL);.|
|000016f0| 20 20 20 20 76 61 72 20 | 70 61 6e 65 6c 5f 69 6e | var |panel_in|
|00001700| 64 65 78 20 3d 20 63 6f | 6e 74 61 69 6e 65 72 2e |dex = co|ntainer.|
|00001710| 49 6e 64 65 78 4f 66 28 | 70 61 6e 65 6c 5f 72 65 |IndexOf(|panel_re|
|00001720| 73 6f 75 72 63 65 29 3b | 0d 20 20 20 20 76 61 72 |source);|. var|
|00001730| 20 73 74 72 69 6e 67 42 | 75 6e 64 6c 65 2c 20 62 | stringB|undle, b|
|00001740| 72 61 6e 64 53 74 72 69 | 6e 67 42 75 6e 64 6c 65 |randStri|ngBundle|
|00001750| 2c 20 74 69 74 6c 65 4d | 65 73 73 61 67 65 2c 20 |, titleM|essage, |
|00001760| 64 69 61 6c 6f 67 4d 65 | 73 73 61 67 65 2c 20 70 |dialogMe|ssage, p|
|00001770| 72 6f 6d 70 74 53 65 72 | 76 69 63 65 3b 0d 20 20 |romptSer|vice;. |
|00001780| 20 20 69 66 20 28 70 61 | 6e 65 6c 5f 69 6e 64 65 | if (pa|nel_inde|
|00001790| 78 20 21 3d 20 2d 31 29 | 0d 20 20 20 20 7b 0d 20 |x != -1)|. {. |
|000017a0| 20 20 20 20 20 20 20 74 | 72 79 20 7b 0d 20 20 20 | t|ry {. |
|000017b0| 20 20 20 20 20 20 20 20 | 20 73 74 72 69 6e 67 42 | | stringB|
|000017c0| 75 6e 64 6c 65 20 3d 20 | 73 72 47 65 74 53 74 72 |undle = |srGetStr|
|000017d0| 42 75 6e 64 6c 65 28 22 | 63 68 72 6f 6d 65 3a 2f |Bundle("|chrome:/|
|000017e0| 2f 63 6f 6d 6d 75 6e 69 | 63 61 74 6f 72 2f 6c 6f |/communi|cator/lo|
|000017f0| 63 61 6c 65 2f 73 69 64 | 65 62 61 72 2f 73 69 64 |cale/sid|ebar/sid|
|00001800| 65 62 61 72 2e 70 72 6f | 70 65 72 74 69 65 73 22 |ebar.pro|perties"|
|00001810| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 62 |);. | b|
|00001820| 72 61 6e 64 53 74 72 69 | 6e 67 42 75 6e 64 6c 65 |randStri|ngBundle|
|00001830| 20 3d 20 73 72 47 65 74 | 53 74 72 42 75 6e 64 6c | = srGet|StrBundl|
|00001840| 65 28 22 63 68 72 6f 6d | 65 3a 2f 2f 67 6c 6f 62 |e("chrom|e://glob|
|00001850| 61 6c 2f 6c 6f 63 61 6c | 65 2f 62 72 61 6e 64 2e |al/local|e/brand.|
|00001860| 70 72 6f 70 65 72 74 69 | 65 73 22 29 3b 0d 20 20 |properti|es");. |
|00001870| 20 20 20 20 20 20 20 20 | 20 20 69 66 20 28 73 74 | | if (st|
|00001880| 72 69 6e 67 42 75 6e 64 | 6c 65 29 20 7b 0d 20 20 |ringBund|le) {. |
|00001890| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 73 69 | | si|
|000018a0| 64 65 62 61 72 4e 61 6d | 65 20 3d 20 62 72 61 6e |debarNam|e = bran|
|000018b0| 64 53 74 72 69 6e 67 42 | 75 6e 64 6c 65 2e 47 65 |dStringB|undle.Ge|
|000018c0| 74 53 74 72 69 6e 67 46 | 72 6f 6d 4e 61 6d 65 28 |tStringF|romName(|
|000018d0| 22 73 69 64 65 62 61 72 | 4e 61 6d 65 22 29 3b 0d |"sidebar|Name");.|
|000018e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000018f0| 74 69 74 6c 65 4d 65 73 | 73 61 67 65 20 3d 20 73 |titleMes|sage = s|
|00001900| 74 72 69 6e 67 42 75 6e | 64 6c 65 2e 47 65 74 53 |tringBun|dle.GetS|
|00001910| 74 72 69 6e 67 46 72 6f | 6d 4e 61 6d 65 28 22 64 |tringFro|mName("d|
|00001920| 75 70 65 50 61 6e 65 6c | 41 6c 65 72 74 54 69 74 |upePanel|AlertTit|
|00001930| 6c 65 22 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |le");. | |
|00001940| 20 20 20 20 20 20 64 69 | 61 6c 6f 67 4d 65 73 73 | di|alogMess|
|00001950| 61 67 65 20 3d 20 73 74 | 72 69 6e 67 42 75 6e 64 |age = st|ringBund|
|00001960| 6c 65 2e 47 65 74 53 74 | 72 69 6e 67 46 72 6f 6d |le.GetSt|ringFrom|
|00001970| 4e 61 6d 65 28 22 64 75 | 70 65 50 61 6e 65 6c 41 |Name("du|pePanelA|
|00001980| 6c 65 72 74 4d 65 73 73 | 61 67 65 22 29 3b 0d 20 |lertMess|age");. |
|00001990| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 64 | | d|
|000019a0| 69 61 6c 6f 67 4d 65 73 | 73 61 67 65 20 3d 20 64 |ialogMes|sage = d|
|000019b0| 69 61 6c 6f 67 4d 65 73 | 73 61 67 65 2e 72 65 70 |ialogMes|sage.rep|
|000019c0| 6c 61 63 65 28 2f 25 75 | 72 6c 25 2f 2c 20 61 43 |lace(/%u|rl%/, aC|
|000019d0| 6f 6e 74 65 6e 74 55 52 | 4c 29 3b 0d 20 20 20 20 |ontentUR|L);. |
|000019e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 64 69 61 6c | | dial|
|000019f0| 6f 67 4d 65 73 73 61 67 | 65 20 3d 20 64 69 61 6c |ogMessag|e = dial|
|00001a00| 6f 67 4d 65 73 73 61 67 | 65 2e 72 65 70 6c 61 63 |ogMessag|e.replac|
|00001a10| 65 28 2f 25 6e 61 6d 65 | 25 2f 2c 20 73 69 64 65 |e(/%name|%/, side|
|00001a20| 62 61 72 4e 61 6d 65 29 | 3b 0d 20 20 20 20 20 20 |barName)|;. |
|00001a30| 20 20 20 20 20 20 7d 0d | 20 20 20 20 20 20 20 20 | }.| |
|00001a40| 7d 0d 20 20 20 20 20 20 | 20 20 63 61 74 63 68 20 |}. | catch |
|00001a50| 28 65 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |(e) {. | |
|00001a60| 20 20 74 69 74 6c 65 4d | 65 73 73 61 67 65 20 3d | titleM|essage =|
|00001a70| 20 22 53 69 64 65 62 61 | 72 22 3b 0d 20 20 20 20 | "Sideba|r";. |
|00001a80| 20 20 20 20 20 20 20 20 | 64 69 61 6c 6f 67 4d 65 | |dialogMe|
|00001a90| 73 73 61 67 65 20 3d 20 | 61 43 6f 6e 74 65 6e 74 |ssage = |aContent|
|00001aa0| 55 52 4c 20 2b 20 22 20 | 61 6c 72 65 61 64 79 20 |URL + " |already |
|00001ab0| 65 78 69 73 74 73 20 69 | 6e 20 53 69 64 65 62 61 |exists i|n Sideba|
|00001ac0| 72 2e 20 20 4e 6f 20 73 | 74 72 69 6e 67 20 62 75 |r. No s|tring bu|
|00001ad0| 6e 64 6c 65 22 3b 0d 20 | 20 20 20 20 20 20 20 7d |ndle";. | }|
|00001ae0| 0d 20 20 20 20 20 20 20 | 20 20 20 0d 20 20 20 20 |. | . |
|00001af0| 20 20 20 20 70 72 6f 6d | 70 74 53 65 72 76 69 63 | prom|ptServic|
|00001b00| 65 20 3d 20 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 63 |e = Comp|onents.c|
|00001b10| 6c 61 73 73 65 73 5b 22 | 40 6d 6f 7a 69 6c 6c 61 |lasses["|@mozilla|
|00001b20| 2e 6f 72 67 2f 65 6d 62 | 65 64 63 6f 6d 70 2f 70 |.org/emb|edcomp/p|
|00001b30| 72 6f 6d 70 74 2d 73 65 | 72 76 69 63 65 3b 31 22 |rompt-se|rvice;1"|
|00001b40| 5d 2e 67 65 74 53 65 72 | 76 69 63 65 28 29 3b 0d |].getSer|vice();.|
|00001b50| 20 20 20 20 20 20 20 20 | 69 66 20 28 70 72 6f 6d | |if (prom|
|00001b60| 70 74 53 65 72 76 69 63 | 65 29 20 7b 0d 20 20 20 |ptServic|e) {. |
|00001b70| 20 20 20 20 20 20 20 70 | 72 6f 6d 70 74 53 65 72 | p|romptSer|
|00001b80| 76 69 63 65 20 3d 20 70 | 72 6f 6d 70 74 53 65 72 |vice = p|romptSer|
|00001b90| 76 69 63 65 2e 51 75 65 | 72 79 49 6e 74 65 72 66 |vice.Que|ryInterf|
|00001ba0| 61 63 65 28 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 69 |ace(Comp|onents.i|
|00001bb0| 6e 74 65 72 66 61 63 65 | 73 2e 6e 73 49 50 72 6f |nterface|s.nsIPro|
|00001bc0| 6d 70 74 53 65 72 76 69 | 63 65 29 3b 0d 20 20 20 |mptServi|ce);. |
|00001bd0| 20 20 20 20 20 20 20 70 | 72 6f 6d 70 74 53 65 72 | p|romptSer|
|00001be0| 76 69 63 65 2e 61 6c 65 | 72 74 28 74 68 69 73 2e |vice.ale|rt(this.|
|00001bf0| 77 69 6e 64 6f 77 2c 20 | 74 69 74 6c 65 4d 65 73 |window, |titleMes|
|00001c00| 73 61 67 65 2c 20 64 69 | 61 6c 6f 67 4d 65 73 73 |sage, di|alogMess|
|00001c10| 61 67 65 29 3b 0d 20 20 | 20 20 20 20 20 20 7d 0d |age);. | }.|
|00001c20| 0d 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 3b |. | return;|
|00001c30| 0d 20 20 20 20 7d 0d 0d | 20 20 20 20 74 72 79 20 |. }..| try |
|00001c40| 7b 0d 20 20 20 20 20 20 | 20 20 73 74 72 69 6e 67 |{. | string|
|00001c50| 42 75 6e 64 6c 65 20 3d | 20 73 72 47 65 74 53 74 |Bundle =| srGetSt|
|00001c60| 72 42 75 6e 64 6c 65 28 | 22 63 68 72 6f 6d 65 3a |rBundle(|"chrome:|
|00001c70| 2f 2f 63 6f 6d 6d 75 6e | 69 63 61 74 6f 72 2f 6c |//commun|icator/l|
|00001c80| 6f 63 61 6c 65 2f 73 69 | 64 65 62 61 72 2f 73 69 |ocale/si|debar/si|
|00001c90| 64 65 62 61 72 2e 70 72 | 6f 70 65 72 74 69 65 73 |debar.pr|operties|
|00001ca0| 22 29 3b 0d 20 20 20 20 | 20 20 20 20 62 72 61 6e |");. | bran|
|00001cb0| 64 53 74 72 69 6e 67 42 | 75 6e 64 6c 65 20 3d 20 |dStringB|undle = |
|00001cc0| 73 72 47 65 74 53 74 72 | 42 75 6e 64 6c 65 28 22 |srGetStr|Bundle("|
|00001cd0| 63 68 72 6f 6d 65 3a 2f | 2f 67 6c 6f 62 61 6c 2f |chrome:/|/global/|
|00001ce0| 6c 6f 63 61 6c 65 2f 62 | 72 61 6e 64 2e 70 72 6f |locale/b|rand.pro|
|00001cf0| 70 65 72 74 69 65 73 22 | 29 3b 0d 20 20 20 20 20 |perties"|);. |
|00001d00| 20 20 20 69 66 20 28 73 | 74 72 69 6e 67 42 75 6e | if (s|tringBun|
|00001d10| 64 6c 65 29 20 7b 0d 20 | 20 20 20 20 20 20 20 20 |dle) {. | |
|00001d20| 20 20 20 73 69 64 65 62 | 61 72 4e 61 6d 65 20 3d | sideb|arName =|
|00001d30| 20 62 72 61 6e 64 53 74 | 72 69 6e 67 42 75 6e 64 | brandSt|ringBund|
|00001d40| 6c 65 2e 47 65 74 53 74 | 72 69 6e 67 46 72 6f 6d |le.GetSt|ringFrom|
|00001d50| 4e 61 6d 65 28 22 73 69 | 64 65 62 61 72 4e 61 6d |Name("si|debarNam|
|00001d60| 65 22 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |e");. | |
|00001d70| 20 74 69 74 6c 65 4d 65 | 73 73 61 67 65 20 3d 20 | titleMe|ssage = |
|00001d80| 73 74 72 69 6e 67 42 75 | 6e 64 6c 65 2e 47 65 74 |stringBu|ndle.Get|
|00001d90| 53 74 72 69 6e 67 46 72 | 6f 6d 4e 61 6d 65 28 22 |StringFr|omName("|
|00001da0| 61 64 64 50 61 6e 65 6c | 43 6f 6e 66 69 72 6d 54 |addPanel|ConfirmT|
|00001db0| 69 74 6c 65 22 29 3b 0d | 20 20 20 20 20 20 20 20 |itle");.| |
|00001dc0| 20 20 20 20 64 69 61 6c | 6f 67 4d 65 73 73 61 67 | dial|ogMessag|
|00001dd0| 65 20 3d 20 73 74 72 69 | 6e 67 42 75 6e 64 6c 65 |e = stri|ngBundle|
|00001de0| 2e 47 65 74 53 74 72 69 | 6e 67 46 72 6f 6d 4e 61 |.GetStri|ngFromNa|
|00001df0| 6d 65 28 22 61 64 64 50 | 61 6e 65 6c 43 6f 6e 66 |me("addP|anelConf|
|00001e00| 69 72 6d 4d 65 73 73 61 | 67 65 22 29 3b 0d 20 20 |irmMessa|ge");. |
|00001e10| 20 20 20 20 20 20 20 20 | 20 20 69 66 20 28 61 50 | | if (aP|
|00001e20| 65 72 73 69 73 74 29 0d | 20 20 20 20 20 20 20 20 |ersist).| |
|00001e30| 20 20 20 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00001e40| 20 20 20 20 20 20 76 61 | 72 20 77 61 72 6e 69 6e | va|r warnin|
|00001e50| 67 20 3d 20 73 74 72 69 | 6e 67 42 75 6e 64 6c 65 |g = stri|ngBundle|
|00001e60| 2e 47 65 74 53 74 72 69 | 6e 67 46 72 6f 6d 4e 61 |.GetStri|ngFromNa|
|00001e70| 6d 65 28 22 70 65 72 73 | 69 73 74 65 6e 74 50 61 |me("pers|istentPa|
|00001e80| 6e 65 6c 57 61 72 6e 69 | 6e 67 22 29 3b 0d 20 20 |nelWarni|ng");. |
|00001e90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 64 69 | | di|
|00001ea0| 61 6c 6f 67 4d 65 73 73 | 61 67 65 20 2b 3d 20 22 |alogMess|age += "|
|00001eb0| 5c 6e 22 20 2b 20 77 61 | 72 6e 69 6e 67 3b 0d 20 |\n" + wa|rning;. |
|00001ec0| 20 20 20 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 | | }. |
|00001ed0| 20 20 20 20 20 20 20 20 | 20 64 69 61 6c 6f 67 4d | | dialogM|
|00001ee0| 65 73 73 61 67 65 20 3d | 20 64 69 61 6c 6f 67 4d |essage =| dialogM|
|00001ef0| 65 73 73 61 67 65 2e 72 | 65 70 6c 61 63 65 28 2f |essage.r|eplace(/|
|00001f00| 25 74 69 74 6c 65 25 2f | 2c 20 61 54 69 74 6c 65 |%title%/|, aTitle|
|00001f10| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 64 |);. | d|
|00001f20| 69 61 6c 6f 67 4d 65 73 | 73 61 67 65 20 3d 20 64 |ialogMes|sage = d|
|00001f30| 69 61 6c 6f 67 4d 65 73 | 73 61 67 65 2e 72 65 70 |ialogMes|sage.rep|
|00001f40| 6c 61 63 65 28 2f 25 75 | 72 6c 25 2f 2c 20 61 43 |lace(/%u|rl%/, aC|
|00001f50| 6f 6e 74 65 6e 74 55 52 | 4c 29 3b 0d 20 20 20 20 |ontentUR|L);. |
|00001f60| 20 20 20 20 20 20 20 20 | 64 69 61 6c 6f 67 4d 65 | |dialogMe|
|00001f70| 73 73 61 67 65 20 3d 20 | 64 69 61 6c 6f 67 4d 65 |ssage = |dialogMe|
|00001f80| 73 73 61 67 65 2e 72 65 | 70 6c 61 63 65 28 2f 23 |ssage.re|place(/#|
|00001f90| 2f 67 2c 20 22 5c 6e 22 | 29 3b 0d 20 20 20 20 20 |/g, "\n"|);. |
|00001fa0| 20 20 20 20 20 20 20 64 | 69 61 6c 6f 67 4d 65 73 | d|ialogMes|
|00001fb0| 73 61 67 65 20 3d 20 64 | 69 61 6c 6f 67 4d 65 73 |sage = d|ialogMes|
|00001fc0| 73 61 67 65 2e 72 65 70 | 6c 61 63 65 28 2f 25 6e |sage.rep|lace(/%n|
|00001fd0| 61 6d 65 25 2f 67 2c 20 | 73 69 64 65 62 61 72 4e |ame%/g, |sidebarN|
|00001fe0| 61 6d 65 29 3b 0d 20 20 | 20 20 20 20 20 20 7d 0d |ame);. | }.|
|00001ff0| 20 20 20 20 7d 0d 20 20 | 20 20 63 61 74 63 68 20 | }. | catch |
|00002000| 28 65 29 20 7b 0d 20 20 | 20 20 20 20 20 20 74 69 |(e) {. | ti|
|00002010| 74 6c 65 4d 65 73 73 61 | 67 65 20 3d 20 22 41 64 |tleMessa|ge = "Ad|
|00002020| 64 20 54 61 62 20 74 6f | 20 53 69 64 65 62 61 72 |d Tab to| Sidebar|
|00002030| 22 3b 0d 20 20 20 20 20 | 20 20 20 64 69 61 6c 6f |";. | dialo|
|00002040| 67 4d 65 73 73 61 67 65 | 20 3d 20 22 4e 6f 20 73 |gMessage| = "No s|
|00002050| 74 72 69 6e 67 20 62 75 | 6e 64 6c 65 2e 20 20 41 |tring bu|ndle. A|
|00002060| 64 64 20 74 68 65 20 54 | 61 62 20 27 22 20 2b 20 |dd the T|ab '" + |
|00002070| 61 54 69 74 6c 65 20 2b | 20 22 27 20 74 6f 20 53 |aTitle +| "' to S|
|00002080| 69 64 65 62 61 72 3f 5c | 6e 5c 6e 22 20 2b 20 22 |idebar?\|n\n" + "|
|00002090| 53 6f 75 72 63 65 3a 20 | 22 20 2b 20 61 43 6f 6e |Source: |" + aCon|
|000020a0| 74 65 6e 74 55 52 4c 3b | 0d 20 20 20 20 7d 0d 20 |tentURL;|. }. |
|000020b0| 20 20 20 20 20 20 20 20 | 20 0d 20 20 20 20 70 72 | | . pr|
|000020c0| 6f 6d 70 74 53 65 72 76 | 69 63 65 20 3d 20 43 6f |omptServ|ice = Co|
|000020d0| 6d 70 6f 6e 65 6e 74 73 | 2e 63 6c 61 73 73 65 73 |mponents|.classes|
|000020e0| 5b 22 40 6d 6f 7a 69 6c | 6c 61 2e 6f 72 67 2f 65 |["@mozil|la.org/e|
|000020f0| 6d 62 65 64 63 6f 6d 70 | 2f 70 72 6f 6d 70 74 2d |mbedcomp|/prompt-|
|00002100| 73 65 72 76 69 63 65 3b | 31 22 5d 2e 67 65 74 53 |service;|1"].getS|
|00002110| 65 72 76 69 63 65 28 29 | 3b 0d 20 20 20 20 70 72 |ervice()|;. pr|
|00002120| 6f 6d 70 74 53 65 72 76 | 69 63 65 20 3d 20 70 72 |omptServ|ice = pr|
|00002130| 6f 6d 70 74 53 65 72 76 | 69 63 65 2e 51 75 65 72 |omptServ|ice.Quer|
|00002140| 79 49 6e 74 65 72 66 61 | 63 65 28 43 6f 6d 70 6f |yInterfa|ce(Compo|
|00002150| 6e 65 6e 74 73 2e 69 6e | 74 65 72 66 61 63 65 73 |nents.in|terfaces|
|00002160| 2e 6e 73 49 50 72 6f 6d | 70 74 53 65 72 76 69 63 |.nsIProm|ptServic|
|00002170| 65 29 3b 0d 20 20 20 20 | 76 61 72 20 72 76 20 3d |e);. |var rv =|
|00002180| 20 70 72 6f 6d 70 74 53 | 65 72 76 69 63 65 2e 63 | promptS|ervice.c|
|00002190| 6f 6e 66 69 72 6d 28 74 | 68 69 73 2e 77 69 6e 64 |onfirm(t|his.wind|
|000021a0| 6f 77 2c 20 74 69 74 6c | 65 4d 65 73 73 61 67 65 |ow, titl|eMessage|
|000021b0| 2c 20 64 69 61 6c 6f 67 | 4d 65 73 73 61 67 65 29 |, dialog|Message)|
|000021c0| 3b 0d 20 20 20 20 20 20 | 0d 20 20 20 20 69 66 20 |;. |. if |
|000021d0| 28 21 72 76 29 0d 20 20 | 20 20 20 20 20 20 72 65 |(!rv). | re|
|000021e0| 74 75 72 6e 3b 0d 0d 20 | 20 20 20 2f 2a 20 4e 6f |turn;.. | /* No|
|000021f0| 77 20 6d 61 6b 65 20 73 | 6f 6d 65 20 73 69 64 65 |w make s|ome side|
|00002200| 62 61 72 2d 69 73 68 20 | 61 73 73 65 72 74 69 6f |bar-ish |assertio|
|00002210| 6e 73 20 61 62 6f 75 74 | 20 69 74 2e 2e 2e 20 2a |ns about| it... *|
|00002220| 2f 0d 20 20 20 20 74 68 | 69 73 2e 64 61 74 61 73 |/. th|is.datas|
|00002230| 6f 75 72 63 65 2e 41 73 | 73 65 72 74 28 70 61 6e |ource.As|sert(pan|
|00002240| 65 6c 5f 72 65 73 6f 75 | 72 63 65 2c 0d 20 20 20 |el_resou|rce,. |
|00002250| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002260| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 72 64 66 | |this.rdf|
|00002270| 2e 47 65 74 52 65 73 6f | 75 72 63 65 28 74 68 69 |.GetReso|urce(thi|
|00002280| 73 2e 6e 63 20 2b 20 22 | 74 69 74 6c 65 22 29 2c |s.nc + "|title"),|
|00002290| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000022a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 74 68 69 73 | | this|
|000022b0| 2e 72 64 66 2e 47 65 74 | 4c 69 74 65 72 61 6c 28 |.rdf.Get|Literal(|
|000022c0| 61 54 69 74 6c 65 29 2c | 0d 20 20 20 20 20 20 20 |aTitle),|. |
|000022d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000022e0| 20 20 20 20 74 72 75 65 | 29 3b 0d 20 20 20 20 74 | true|);. t|
|000022f0| 68 69 73 2e 64 61 74 61 | 73 6f 75 72 63 65 2e 41 |his.data|source.A|
|00002300| 73 73 65 72 74 28 70 61 | 6e 65 6c 5f 72 65 73 6f |ssert(pa|nel_reso|
|00002310| 75 72 63 65 2c 0d 20 20 | 20 20 20 20 20 20 20 20 |urce,. | |
|00002320| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002330| 20 74 68 69 73 2e 72 64 | 66 2e 47 65 74 52 65 73 | this.rd|f.GetRes|
|00002340| 6f 75 72 63 65 28 74 68 | 69 73 2e 6e 63 20 2b 20 |ource(th|is.nc + |
|00002350| 22 63 6f 6e 74 65 6e 74 | 22 29 2c 0d 20 20 20 20 |"content|"),. |
|00002360| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002370| 20 20 20 20 20 20 20 74 | 68 69 73 2e 72 64 66 2e | t|his.rdf.|
|00002380| 47 65 74 4c 69 74 65 72 | 61 6c 28 61 43 6f 6e 74 |GetLiter|al(aCont|
|00002390| 65 6e 74 55 52 4c 29 2c | 0d 20 20 20 20 20 20 20 |entURL),|. |
|000023a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000023b0| 20 20 20 20 74 72 75 65 | 29 3b 0d 20 20 20 20 69 | true|);. i|
|000023c0| 66 20 28 61 43 75 73 74 | 6f 6d 69 7a 65 55 52 4c |f (aCust|omizeURL|
|000023d0| 29 0d 20 20 20 20 20 20 | 20 20 74 68 69 73 2e 64 |). | this.d|
|000023e0| 61 74 61 73 6f 75 72 63 | 65 2e 41 73 73 65 72 74 |atasourc|e.Assert|
|000023f0| 28 70 61 6e 65 6c 5f 72 | 65 73 6f 75 72 63 65 2c |(panel_r|esource,|
|00002400| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002410| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002420| 74 68 69 73 2e 72 64 66 | 2e 47 65 74 52 65 73 6f |this.rdf|.GetReso|
|00002430| 75 72 63 65 28 74 68 69 | 73 2e 6e 63 20 2b 20 22 |urce(thi|s.nc + "|
|00002440| 63 75 73 74 6f 6d 69 7a | 65 22 29 2c 0d 20 20 20 |customiz|e"),. |
|00002450| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002460| 20 20 20 20 20 20 20 20 | 20 20 20 20 74 68 69 73 | | this|
|00002470| 2e 72 64 66 2e 47 65 74 | 4c 69 74 65 72 61 6c 28 |.rdf.Get|Literal(|
|00002480| 61 43 75 73 74 6f 6d 69 | 7a 65 55 52 4c 29 2c 0d |aCustomi|zeURL),.|
|00002490| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000024a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 74 | | t|
|000024b0| 72 75 65 29 3b 0d 20 20 | 20 20 76 61 72 20 70 65 |rue);. | var pe|
|000024c0| 72 73 69 73 74 56 61 6c | 75 65 20 3d 20 61 50 65 |rsistVal|ue = aPe|
|000024d0| 72 73 69 73 74 20 3f 20 | 22 74 72 75 65 22 20 3a |rsist ? |"true" :|
|000024e0| 20 22 66 61 6c 73 65 22 | 3b 0d 20 20 20 20 74 68 | "false"|;. th|
|000024f0| 69 73 2e 64 61 74 61 73 | 6f 75 72 63 65 2e 41 73 |is.datas|ource.As|
|00002500| 73 65 72 74 28 70 61 6e | 65 6c 5f 72 65 73 6f 75 |sert(pan|el_resou|
|00002510| 72 63 65 2c 0d 20 20 20 | 20 20 20 20 20 20 20 20 |rce,. | |
|00002520| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002530| 74 68 69 73 2e 72 64 66 | 2e 47 65 74 52 65 73 6f |this.rdf|.GetReso|
|00002540| 75 72 63 65 28 74 68 69 | 73 2e 6e 63 20 2b 20 22 |urce(thi|s.nc + "|
|00002550| 70 65 72 73 69 73 74 22 | 29 2c 0d 20 20 20 20 20 |persist"|),. |
|00002560| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002570| 20 20 20 20 20 20 74 68 | 69 73 2e 72 64 66 2e 47 | th|is.rdf.G|
|00002580| 65 74 4c 69 74 65 72 61 | 6c 28 70 65 72 73 69 73 |etLitera|l(persis|
|00002590| 74 56 61 6c 75 65 29 2c | 0d 20 20 20 20 20 20 20 |tValue),|. |
|000025a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000025b0| 20 20 20 20 74 72 75 65 | 29 3b 0d 20 20 20 20 20 | true|);. |
|000025c0| 20 20 20 0d 20 20 20 20 | 63 6f 6e 74 61 69 6e 65 | . |containe|
|000025d0| 72 2e 41 70 70 65 6e 64 | 45 6c 65 6d 65 6e 74 28 |r.Append|Element(|
|000025e0| 70 61 6e 65 6c 5f 72 65 | 73 6f 75 72 63 65 29 3b |panel_re|source);|
|000025f0| 0d 0d 20 20 20 20 2f 2f | 20 55 73 65 20 61 6e 20 |.. //| Use an |
|00002600| 61 73 73 65 72 74 69 6f | 6e 20 74 6f 20 70 61 73 |assertio|n to pas|
|00002610| 73 20 61 20 22 72 65 66 | 72 65 73 68 22 20 65 76 |s a "ref|resh" ev|
|00002620| 65 6e 74 20 74 6f 20 61 | 6c 6c 20 74 68 65 20 73 |ent to a|ll the s|
|00002630| 69 64 65 62 61 72 73 2e | 0d 20 20 20 20 2f 2f 20 |idebars.|. // |
|00002640| 54 68 65 79 20 75 73 65 | 20 6f 62 73 65 72 76 65 |They use| observe|
|00002650| 72 73 20 74 6f 20 77 61 | 74 63 68 20 66 6f 72 20 |rs to wa|tch for |
|00002660| 74 68 69 73 20 61 73 73 | 65 72 74 69 6f 6e 20 28 |this ass|ertion (|
|00002670| 69 6e 20 73 69 64 65 62 | 61 72 4f 76 65 72 6c 61 |in sideb|arOverla|
|00002680| 79 2e 6a 73 29 2e 0d 20 | 20 20 20 74 68 69 73 2e |y.js).. | this.|
|00002690| 64 61 74 61 73 6f 75 72 | 63 65 2e 41 73 73 65 72 |datasour|ce.Asser|
|000026a0| 74 28 74 68 69 73 2e 72 | 64 66 2e 47 65 74 52 65 |t(this.r|df.GetRe|
|000026b0| 73 6f 75 72 63 65 28 74 | 68 69 73 2e 72 65 73 6f |source(t|his.reso|
|000026c0| 75 72 63 65 29 2c 0d 20 | 20 20 20 20 20 20 20 20 |urce),. | |
|000026d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000026e0| 20 20 74 68 69 73 2e 72 | 64 66 2e 47 65 74 52 65 | this.r|df.GetRe|
|000026f0| 73 6f 75 72 63 65 28 74 | 68 69 73 2e 6e 63 20 2b |source(t|his.nc +|
|00002700| 20 22 72 65 66 72 65 73 | 68 22 29 2c 0d 20 20 20 | "refres|h"),. |
|00002710| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002720| 20 20 20 20 20 20 20 20 | 74 68 69 73 2e 72 64 66 | |this.rdf|
|00002730| 2e 47 65 74 4c 69 74 65 | 72 61 6c 28 22 74 72 75 |.GetLite|ral("tru|
|00002740| 65 22 29 2c 0d 20 20 20 | 20 20 20 20 20 20 20 20 |e"),. | |
|00002750| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002760| 74 72 75 65 29 3b 0d 20 | 20 20 20 74 68 69 73 2e |true);. | this.|
|00002770| 64 61 74 61 73 6f 75 72 | 63 65 2e 55 6e 61 73 73 |datasour|ce.Unass|
|00002780| 65 72 74 28 74 68 69 73 | 2e 72 64 66 2e 47 65 74 |ert(this|.rdf.Get|
|00002790| 52 65 73 6f 75 72 63 65 | 28 74 68 69 73 2e 72 65 |Resource|(this.re|
|000027a0| 73 6f 75 72 63 65 29 2c | 0d 20 20 20 20 20 20 20 |source),|. |
|000027b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000027c0| 20 20 20 20 20 20 74 68 | 69 73 2e 72 64 66 2e 47 | th|is.rdf.G|
|000027d0| 65 74 52 65 73 6f 75 72 | 63 65 28 74 68 69 73 2e |etResour|ce(this.|
|000027e0| 6e 63 20 2b 20 22 72 65 | 66 72 65 73 68 22 29 2c |nc + "re|fresh"),|
|000027f0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002800| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 74 68 | | th|
|00002810| 69 73 2e 72 64 66 2e 47 | 65 74 4c 69 74 65 72 61 |is.rdf.G|etLitera|
|00002820| 6c 28 22 74 72 75 65 22 | 29 29 3b 0d 0d 20 20 20 |l("true"|));.. |
|00002830| 20 2f 2a 20 57 72 69 74 | 65 20 74 68 65 20 6d 6f | /* Writ|e the mo|
|00002840| 64 69 66 69 65 64 20 70 | 61 6e 65 6c 73 20 6f 75 |dified p|anels ou|
|00002850| 74 2e 20 2a 2f 0d 20 20 | 20 20 74 68 69 73 2e 64 |t. */. | this.d|
|00002860| 61 74 61 73 6f 75 72 63 | 65 2e 51 75 65 72 79 49 |atasourc|e.QueryI|
|00002870| 6e 74 65 72 66 61 63 65 | 28 6e 73 49 52 44 46 52 |nterface|(nsIRDFR|
|00002880| 65 6d 6f 74 65 44 61 74 | 61 53 6f 75 72 63 65 29 |emoteDat|aSource)|
|00002890| 2e 46 6c 75 73 68 28 29 | 3b 0d 0d 7d 0d 0d 2f 2a |.Flush()|;..}../*|
|000028a0| 20 64 65 63 6f 72 61 74 | 65 20 70 72 6f 74 6f 74 | decorat|e protot|
|000028b0| 79 70 65 20 74 6f 20 70 | 72 6f 76 69 64 65 20 60 |ype to p|rovide `|
|000028c0| 60 63 6c 61 73 73 27 27 | 20 6d 65 74 68 6f 64 73 |`class''| methods|
|000028d0| 20 61 6e 64 20 70 72 6f | 70 65 72 74 79 20 61 63 | and pro|perty ac|
|000028e0| 63 65 73 73 6f 72 73 20 | 2a 2f 0d 6e 73 53 69 64 |cessors |*/.nsSid|
|000028f0| 65 62 61 72 2e 70 72 6f | 74 6f 74 79 70 65 2e 61 |ebar.pro|totype.a|
|00002900| 64 64 53 65 61 72 63 68 | 45 6e 67 69 6e 65 20 3d |ddSearch|Engine =|
|00002910| 0d 66 75 6e 63 74 69 6f | 6e 20 28 65 6e 67 69 6e |.functio|n (engin|
|00002920| 65 55 52 4c 2c 20 69 63 | 6f 6e 55 52 4c 2c 20 73 |eURL, ic|onURL, s|
|00002930| 75 67 67 65 73 74 65 64 | 54 69 74 6c 65 2c 20 73 |uggested|Title, s|
|00002940| 75 67 67 65 73 74 65 64 | 43 61 74 65 67 6f 72 79 |uggested|Category|
|00002950| 29 0d 7b 0d 20 20 20 20 | 64 65 62 75 67 28 22 61 |).{. |debug("a|
|00002960| 64 64 53 65 61 72 63 68 | 45 6e 67 69 6e 65 28 22 |ddSearch|Engine("|
|00002970| 20 2b 20 65 6e 67 69 6e | 65 55 52 4c 20 2b 20 22 | + engin|eURL + "|
|00002980| 2c 20 22 20 2b 20 69 63 | 6f 6e 55 52 4c 20 2b 20 |, " + ic|onURL + |
|00002990| 22 2c 20 22 20 2b 0d 20 | 20 20 20 20 20 20 20 20 |", " +. | |
|000029a0| 20 73 75 67 67 65 73 74 | 65 64 43 61 74 65 67 6f | suggest|edCatego|
|000029b0| 72 79 20 2b 20 22 2c 20 | 22 20 2b 20 73 75 67 67 |ry + ", |" + sugg|
|000029c0| 65 73 74 65 64 54 69 74 | 6c 65 20 2b 20 22 29 22 |estedTit|le + ")"|
|000029d0| 29 3b 0d 0d 20 20 20 20 | 69 66 20 28 21 74 68 69 |);.. |if (!thi|
|000029e0| 73 2e 77 69 6e 64 6f 77 | 29 0d 20 20 20 20 7b 0d |s.window|). {.|
|000029f0| 20 20 20 20 20 20 20 20 | 64 65 62 75 67 20 28 22 | |debug ("|
|00002a00| 6e 6f 20 77 69 6e 64 6f | 77 20 6f 62 6a 65 63 74 |no windo|w object|
|00002a10| 20 73 65 74 2c 20 62 61 | 69 6c 69 6e 67 20 6f 75 | set, ba|iling ou|
|00002a20| 74 2e 22 29 3b 0d 20 20 | 20 20 20 20 20 20 74 68 |t.");. | th|
|00002a30| 72 6f 77 20 43 6f 6d 70 | 6f 6e 65 6e 74 73 2e 72 |row Comp|onents.r|
|00002a40| 65 73 75 6c 74 73 2e 4e | 53 5f 45 52 52 4f 52 5f |esults.N|S_ERROR_|
|00002a50| 4e 4f 54 5f 49 4e 49 54 | 49 41 4c 49 5a 45 44 3b |NOT_INIT|IALIZED;|
|00002a60| 0d 20 20 20 20 7d 0d 0d | 20 20 20 20 74 72 79 0d |. }..| try.|
|00002a70| 20 20 20 20 7b 0d 20 20 | 20 20 20 20 20 20 2f 2f | {. | //|
|00002a80| 20 6d 61 6b 65 20 73 75 | 72 65 20 75 73 69 6e 67 | make su|re using|
|00002a90| 20 48 54 54 50 20 28 66 | 6f 72 20 62 6f 74 68 20 | HTTP (f|or both |
|00002aa0| 65 6e 67 69 6e 65 20 61 | 73 20 77 65 6c 6c 20 61 |engine a|s well a|
|00002ab0| 73 20 69 63 6f 6e 20 55 | 52 4c 73 29 0d 0d 20 20 |s icon U|RLs).. |
|00002ac0| 20 20 20 20 20 20 69 66 | 20 28 65 6e 67 69 6e 65 | if| (engine|
|00002ad0| 55 52 4c 2e 73 65 61 72 | 63 68 28 2f 5e 68 74 74 |URL.sear|ch(/^htt|
|00002ae0| 70 3a 5c 2f 5c 2f 2f 69 | 29 20 3d 3d 20 2d 31 29 |p:\/\//i|) == -1)|
|00002af0| 0d 20 20 20 20 20 20 20 | 20 7b 0d 20 20 20 20 20 |. | {. |
|00002b00| 20 20 20 20 20 20 20 64 | 65 62 75 67 20 28 22 6d | d|ebug ("m|
|00002b10| 75 73 74 20 75 73 65 20 | 48 54 54 50 20 74 6f 20 |ust use |HTTP to |
|00002b20| 66 65 74 63 68 20 73 65 | 61 72 63 68 20 65 6e 67 |fetch se|arch eng|
|00002b30| 69 6e 65 20 66 69 6c 65 | 22 29 3b 0d 20 20 20 20 |ine file|");. |
|00002b40| 20 20 20 20 20 20 20 20 | 74 68 72 6f 77 20 43 6f | |throw Co|
|00002b50| 6d 70 6f 6e 65 6e 74 73 | 2e 72 65 73 75 6c 74 73 |mponents|.results|
|00002b60| 2e 4e 53 5f 45 52 52 4f | 52 5f 49 4e 56 41 4c 49 |.NS_ERRO|R_INVALI|
|00002b70| 44 5f 41 52 47 3b 0d 20 | 20 20 20 20 20 20 20 7d |D_ARG;. | }|
|00002b80| 0d 0d 20 20 20 20 20 20 | 20 20 69 66 20 28 69 63 |.. | if (ic|
|00002b90| 6f 6e 55 52 4c 2e 73 65 | 61 72 63 68 28 2f 5e 68 |onURL.se|arch(/^h|
|00002ba0| 74 74 70 3a 5c 2f 5c 2f | 2f 69 29 20 3d 3d 20 2d |ttp:\/\/|/i) == -|
|00002bb0| 31 29 0d 20 20 20 20 20 | 20 20 20 7b 0d 20 20 20 |1). | {. |
|00002bc0| 20 20 20 20 20 20 20 20 | 20 64 65 62 75 67 20 28 | | debug (|
|00002bd0| 22 6d 75 73 74 20 75 73 | 65 20 48 54 54 50 20 74 |"must us|e HTTP t|
|00002be0| 6f 20 66 65 74 63 68 20 | 73 65 61 72 63 68 20 69 |o fetch |search i|
|00002bf0| 63 6f 6e 20 66 69 6c 65 | 22 29 3b 0d 20 20 20 20 |con file|");. |
|00002c00| 20 20 20 20 20 20 20 20 | 74 68 72 6f 77 20 43 6f | |throw Co|
|00002c10| 6d 70 6f 6e 65 6e 74 73 | 2e 72 65 73 75 6c 74 73 |mponents|.results|
|00002c20| 2e 4e 53 5f 45 52 52 4f | 52 5f 49 4e 56 41 4c 49 |.NS_ERRO|R_INVALI|
|00002c30| 44 5f 41 52 47 3b 0d 20 | 20 20 20 20 20 20 20 7d |D_ARG;. | }|
|00002c40| 0d 0d 20 20 20 20 20 20 | 20 20 2f 2f 20 6d 61 6b |.. | // mak|
|00002c50| 65 20 73 75 72 65 20 65 | 6e 67 69 6e 65 55 52 4c |e sure e|ngineURL|
|00002c60| 20 72 65 66 65 72 73 20 | 74 6f 20 61 20 2e 73 72 | refers |to a .sr|
|00002c70| 63 20 66 69 6c 65 0d 20 | 20 20 20 20 20 20 20 69 |c file. | i|
|00002c80| 66 20 28 65 6e 67 69 6e | 65 55 52 4c 2e 73 65 61 |f (engin|eURL.sea|
|00002c90| 72 63 68 28 2f 5c 2e 73 | 72 63 24 2f 69 29 20 3d |rch(/\.s|rc$/i) =|
|00002ca0| 3d 20 2d 31 29 0d 20 20 | 20 20 20 20 20 20 7b 0d |= -1). | {.|
|00002cb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 64 65 62 75 | | debu|
|00002cc0| 67 20 28 22 65 6e 67 69 | 6e 65 55 52 4c 20 64 6f |g ("engi|neURL do|
|00002cd0| 65 73 6e 27 74 20 72 65 | 66 65 72 65 6e 63 65 20 |esn't re|ference |
|00002ce0| 61 20 2e 73 72 63 20 66 | 69 6c 65 22 29 3b 0d 20 |a .src f|ile");. |
|00002cf0| 20 20 20 20 20 20 20 20 | 20 20 20 74 68 72 6f 77 | | throw|
|00002d00| 20 43 6f 6d 70 6f 6e 65 | 6e 74 73 2e 72 65 73 75 | Compone|nts.resu|
|00002d10| 6c 74 73 2e 4e 53 5f 45 | 52 52 4f 52 5f 49 4e 56 |lts.NS_E|RROR_INV|
|00002d20| 41 4c 49 44 5f 41 52 47 | 3b 0d 20 20 20 20 20 20 |ALID_ARG|;. |
|00002d30| 20 20 7d 0d 0d 20 20 20 | 20 20 20 20 20 2f 2f 20 | }.. | // |
|00002d40| 6d 61 6b 65 20 73 75 72 | 65 20 69 63 6f 6e 55 52 |make sur|e iconUR|
|00002d50| 4c 20 72 65 66 65 72 73 | 20 74 6f 20 61 20 2e 67 |L refers| to a .g|
|00002d60| 69 66 2f 2e 6a 70 67 2f | 2e 6a 70 65 67 2f 2e 70 |if/.jpg/|.jpeg/.p|
|00002d70| 6e 67 20 66 69 6c 65 0d | 20 20 20 20 20 20 20 20 |ng file.| |
|00002d80| 69 66 20 28 69 63 6f 6e | 55 52 4c 2e 73 65 61 72 |if (icon|URL.sear|
|00002d90| 63 68 28 2f 5c 2e 28 67 | 69 66 7c 6a 70 67 7c 6a |ch(/\.(g|if|jpg|j|
|00002da0| 70 65 67 7c 70 6e 67 29 | 24 2f 69 29 20 3d 3d 20 |peg|png)|$/i) == |
|00002db0| 2d 31 29 0d 20 20 20 20 | 20 20 20 20 7b 0d 20 20 |-1). | {. |
|00002dc0| 20 20 20 20 20 20 20 20 | 20 20 64 65 62 75 67 20 | | debug |
|00002dd0| 28 22 69 63 6f 6e 55 52 | 4c 20 64 6f 65 73 6e 27 |("iconUR|L doesn'|
|00002de0| 74 20 72 65 66 65 72 65 | 6e 63 65 20 61 20 73 75 |t refere|nce a su|
|00002df0| 70 70 6f 72 74 65 64 20 | 69 6d 61 67 65 20 66 69 |pported |image fi|
|00002e00| 6c 65 22 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |le");. | |
|00002e10| 20 20 74 68 72 6f 77 20 | 43 6f 6d 70 6f 6e 65 6e | throw |Componen|
|00002e20| 74 73 2e 72 65 73 75 6c | 74 73 2e 4e 53 5f 45 52 |ts.resul|ts.NS_ER|
|00002e30| 52 4f 52 5f 49 4e 56 41 | 4c 49 44 5f 41 52 47 3b |ROR_INVA|LID_ARG;|
|00002e40| 0d 20 20 20 20 20 20 20 | 20 7d 0d 0d 20 20 20 20 |. | }.. |
|00002e50| 7d 0d 20 20 20 20 63 61 | 74 63 68 28 65 78 29 0d |}. ca|tch(ex).|
|00002e60| 20 20 20 20 7b 0d 20 20 | 20 20 20 20 20 20 74 68 | {. | th|
|00002e70| 69 73 2e 77 69 6e 64 6f | 77 2e 61 6c 65 72 74 28 |is.windo|w.alert(|
|00002e80| 22 46 61 69 6c 65 64 20 | 74 6f 20 61 64 64 20 74 |"Failed |to add t|
|00002e90| 68 65 20 73 65 61 72 63 | 68 20 65 6e 67 69 6e 65 |he searc|h engine|
|00002ea0| 2e 5c 6e 22 29 3b 0d 20 | 20 20 20 20 20 20 20 74 |.\n");. | t|
|00002eb0| 68 72 6f 77 20 43 6f 6d | 70 6f 6e 65 6e 74 73 2e |hrow Com|ponents.|
|00002ec0| 72 65 73 75 6c 74 73 2e | 4e 53 5f 45 52 52 4f 52 |results.|NS_ERROR|
|00002ed0| 5f 49 4e 56 41 4c 49 44 | 5f 41 52 47 3b 0d 20 20 |_INVALID|_ARG;. |
|00002ee0| 20 20 7d 0d 0d 20 20 20 | 20 76 61 72 20 74 69 74 | }.. | var tit|
|00002ef0| 6c 65 4d 65 73 73 61 67 | 65 2c 20 64 69 61 6c 6f |leMessag|e, dialo|
|00002f00| 67 4d 65 73 73 61 67 65 | 3b 0d 20 20 20 20 74 72 |gMessage|;. tr|
|00002f10| 79 20 7b 0d 20 20 20 20 | 20 20 20 20 76 61 72 20 |y {. | var |
|00002f20| 73 74 72 69 6e 67 42 75 | 6e 64 6c 65 20 3d 20 73 |stringBu|ndle = s|
|00002f30| 72 47 65 74 53 74 72 42 | 75 6e 64 6c 65 28 22 63 |rGetStrB|undle("c|
|00002f40| 68 72 6f 6d 65 3a 2f 2f | 63 6f 6d 6d 75 6e 69 63 |hrome://|communic|
|00002f50| 61 74 6f 72 2f 6c 6f 63 | 61 6c 65 2f 73 69 64 65 |ator/loc|ale/side|
|00002f60| 62 61 72 2f 73 69 64 65 | 62 61 72 2e 70 72 6f 70 |bar/side|bar.prop|
|00002f70| 65 72 74 69 65 73 22 29 | 3b 0d 20 20 20 20 20 20 |erties")|;. |
|00002f80| 20 20 76 61 72 20 62 72 | 61 6e 64 53 74 72 69 6e | var br|andStrin|
|00002f90| 67 42 75 6e 64 6c 65 20 | 3d 20 73 72 47 65 74 53 |gBundle |= srGetS|
|00002fa0| 74 72 42 75 6e 64 6c 65 | 28 22 63 68 72 6f 6d 65 |trBundle|("chrome|
|00002fb0| 3a 2f 2f 67 6c 6f 62 61 | 6c 2f 6c 6f 63 61 6c 65 |://globa|l/locale|
|00002fc0| 2f 62 72 61 6e 64 2e 70 | 72 6f 70 65 72 74 69 65 |/brand.p|ropertie|
|00002fd0| 73 22 29 3b 0d 20 20 20 | 20 20 20 20 20 69 66 20 |s");. | if |
|00002fe0| 28 73 74 72 69 6e 67 42 | 75 6e 64 6c 65 29 20 7b |(stringB|undle) {|
|00002ff0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 73 69 64 |. | sid|
|00003000| 65 62 61 72 4e 61 6d 65 | 20 3d 20 62 72 61 6e 64 |ebarName| = brand|
|00003010| 53 74 72 69 6e 67 42 75 | 6e 64 6c 65 2e 47 65 74 |StringBu|ndle.Get|
|00003020| 53 74 72 69 6e 67 46 72 | 6f 6d 4e 61 6d 65 28 22 |StringFr|omName("|
|00003030| 73 69 64 65 62 61 72 4e | 61 6d 65 22 29 3b 20 20 |sidebarN|ame"); |
|00003040| 20 20 20 20 20 20 20 20 | 20 20 0d 20 20 20 20 20 | | . |
|00003050| 20 20 20 20 20 20 20 74 | 69 74 6c 65 4d 65 73 73 | t|itleMess|
|00003060| 61 67 65 20 3d 20 73 74 | 72 69 6e 67 42 75 6e 64 |age = st|ringBund|
|00003070| 6c 65 2e 47 65 74 53 74 | 72 69 6e 67 46 72 6f 6d |le.GetSt|ringFrom|
|00003080| 4e 61 6d 65 28 22 61 64 | 64 45 6e 67 69 6e 65 43 |Name("ad|dEngineC|
|00003090| 6f 6e 66 69 72 6d 54 69 | 74 6c 65 22 29 3b 0d 20 |onfirmTi|tle");. |
|000030a0| 20 20 20 20 20 20 20 20 | 20 20 20 64 69 61 6c 6f | | dialo|
|000030b0| 67 4d 65 73 73 61 67 65 | 20 3d 20 73 74 72 69 6e |gMessage| = strin|
|000030c0| 67 42 75 6e 64 6c 65 2e | 47 65 74 53 74 72 69 6e |gBundle.|GetStrin|
|000030d0| 67 46 72 6f 6d 4e 61 6d | 65 28 22 61 64 64 45 6e |gFromNam|e("addEn|
|000030e0| 67 69 6e 65 43 6f 6e 66 | 69 72 6d 4d 65 73 73 61 |gineConf|irmMessa|
|000030f0| 67 65 22 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |ge");. | |
|00003100| 20 20 64 69 61 6c 6f 67 | 4d 65 73 73 61 67 65 20 | dialog|Message |
|00003110| 3d 20 64 69 61 6c 6f 67 | 4d 65 73 73 61 67 65 2e |= dialog|Message.|
|00003120| 72 65 70 6c 61 63 65 28 | 2f 25 74 69 74 6c 65 25 |replace(|/%title%|
|00003130| 2f 2c 20 73 75 67 67 65 | 73 74 65 64 54 69 74 6c |/, sugge|stedTitl|
|00003140| 65 29 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |e);. | |
|00003150| 64 69 61 6c 6f 67 4d 65 | 73 73 61 67 65 20 3d 20 |dialogMe|ssage = |
|00003160| 64 69 61 6c 6f 67 4d 65 | 73 73 61 67 65 2e 72 65 |dialogMe|ssage.re|
|00003170| 70 6c 61 63 65 28 2f 25 | 63 61 74 65 67 6f 72 79 |place(/%|category|
|00003180| 25 2f 2c 20 73 75 67 67 | 65 73 74 65 64 43 61 74 |%/, sugg|estedCat|
|00003190| 65 67 6f 72 79 29 3b 0d | 20 20 20 20 20 20 20 20 |egory);.| |
|000031a0| 20 20 20 20 64 69 61 6c | 6f 67 4d 65 73 73 61 67 | dial|ogMessag|
|000031b0| 65 20 3d 20 64 69 61 6c | 6f 67 4d 65 73 73 61 67 |e = dial|ogMessag|
|000031c0| 65 2e 72 65 70 6c 61 63 | 65 28 2f 25 75 72 6c 25 |e.replac|e(/%url%|
|000031d0| 2f 2c 20 65 6e 67 69 6e | 65 55 52 4c 29 3b 0d 20 |/, engin|eURL);. |
|000031e0| 20 20 20 20 20 20 20 20 | 20 20 20 64 69 61 6c 6f | | dialo|
|000031f0| 67 4d 65 73 73 61 67 65 | 20 3d 20 64 69 61 6c 6f |gMessage| = dialo|
|00003200| 67 4d 65 73 73 61 67 65 | 2e 72 65 70 6c 61 63 65 |gMessage|.replace|
|00003210| 28 2f 23 2f 67 2c 20 22 | 5c 6e 22 29 3b 0d 20 20 |(/#/g, "|\n");. |
|00003220| 20 20 20 20 20 20 20 20 | 20 20 64 69 61 6c 6f 67 | | dialog|
|00003230| 4d 65 73 73 61 67 65 20 | 3d 20 64 69 61 6c 6f 67 |Message |= dialog|
|00003240| 4d 65 73 73 61 67 65 2e | 72 65 70 6c 61 63 65 28 |Message.|replace(|
|00003250| 2f 25 6e 61 6d 65 25 2f | 2c 20 73 69 64 65 62 61 |/%name%/|, sideba|
|00003260| 72 4e 61 6d 65 29 3b 0d | 20 20 20 20 20 20 20 20 |rName);.| |
|00003270| 7d 0d 20 20 20 20 7d 0d | 20 20 20 20 63 61 74 63 |}. }.| catc|
|00003280| 68 20 28 65 29 20 7b 0d | 20 20 20 20 20 20 20 20 |h (e) {.| |
|00003290| 74 69 74 6c 65 4d 65 73 | 73 61 67 65 20 3d 20 22 |titleMes|sage = "|
|000032a0| 41 64 64 20 53 65 61 72 | 63 68 20 45 6e 67 69 6e |Add Sear|ch Engin|
|000032b0| 65 22 3b 0d 20 20 20 20 | 20 20 20 20 64 69 61 6c |e";. | dial|
|000032c0| 6f 67 4d 65 73 73 61 67 | 65 20 3d 20 22 41 64 64 |ogMessag|e = "Add|
|000032d0| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 20 73 | the fol|lowing s|
|000032e0| 65 61 72 63 68 20 65 6e | 67 69 6e 65 3f 5c 6e 5c |earch en|gine?\n\|
|000032f0| 6e 4e 61 6d 65 3a 20 22 | 20 2b 20 73 75 67 67 65 |nName: "| + sugge|
|00003300| 73 74 65 64 54 69 74 6c | 65 3b 0d 20 20 20 20 20 |stedTitl|e;. |
|00003310| 20 20 20 64 69 61 6c 6f | 67 4d 65 73 73 61 67 65 | dialo|gMessage|
|00003320| 20 2b 3d 20 22 5c 6e 53 | 65 61 72 63 68 20 43 61 | += "\nS|earch Ca|
|00003330| 74 65 67 6f 72 79 3a 20 | 22 20 2b 20 73 75 67 67 |tegory: |" + sugg|
|00003340| 65 73 74 65 64 43 61 74 | 65 67 6f 72 79 3b 0d 20 |estedCat|egory;. |
|00003350| 20 20 20 20 20 20 20 64 | 69 61 6c 6f 67 4d 65 73 | d|ialogMes|
|00003360| 73 61 67 65 20 2b 3d 20 | 22 5c 6e 53 6f 75 72 63 |sage += |"\nSourc|
|00003370| 65 3a 20 22 20 2b 20 65 | 6e 67 69 6e 65 55 52 4c |e: " + e|ngineURL|
|00003380| 3b 0d 20 20 20 20 7d 0d | 20 20 20 20 20 20 20 20 |;. }.| |
|00003390| 20 20 0d 20 20 20 20 76 | 61 72 20 70 72 6f 6d 70 | . v|ar promp|
|000033a0| 74 53 65 72 76 69 63 65 | 20 3d 20 43 6f 6d 70 6f |tService| = Compo|
|000033b0| 6e 65 6e 74 73 2e 63 6c | 61 73 73 65 73 5b 22 40 |nents.cl|asses["@|
|000033c0| 6d 6f 7a 69 6c 6c 61 2e | 6f 72 67 2f 65 6d 62 65 |mozilla.|org/embe|
|000033d0| 64 63 6f 6d 70 2f 70 72 | 6f 6d 70 74 2d 73 65 72 |dcomp/pr|ompt-ser|
|000033e0| 76 69 63 65 3b 31 22 5d | 2e 67 65 74 53 65 72 76 |vice;1"]|.getServ|
|000033f0| 69 63 65 28 29 3b 0d 20 | 20 20 20 70 72 6f 6d 70 |ice();. | promp|
|00003400| 74 53 65 72 76 69 63 65 | 20 3d 20 70 72 6f 6d 70 |tService| = promp|
|00003410| 74 53 65 72 76 69 63 65 | 2e 51 75 65 72 79 49 6e |tService|.QueryIn|
|00003420| 74 65 72 66 61 63 65 28 | 43 6f 6d 70 6f 6e 65 6e |terface(|Componen|
|00003430| 74 73 2e 69 6e 74 65 72 | 66 61 63 65 73 2e 6e 73 |ts.inter|faces.ns|
|00003440| 49 50 72 6f 6d 70 74 53 | 65 72 76 69 63 65 29 3b |IPromptS|ervice);|
|00003450| 0d 20 20 20 20 76 61 72 | 20 72 76 20 3d 20 70 72 |. var| rv = pr|
|00003460| 6f 6d 70 74 53 65 72 76 | 69 63 65 2e 63 6f 6e 66 |omptServ|ice.conf|
|00003470| 69 72 6d 28 74 68 69 73 | 2e 77 69 6e 64 6f 77 2c |irm(this|.window,|
|00003480| 20 74 69 74 6c 65 4d 65 | 73 73 61 67 65 2c 20 64 | titleMe|ssage, d|
|00003490| 69 61 6c 6f 67 4d 65 73 | 73 61 67 65 29 3b 0d 20 |ialogMes|sage);. |
|000034a0| 20 20 20 20 20 0d 20 20 | 20 20 69 66 20 28 21 72 | . | if (!r|
|000034b0| 76 29 0d 20 20 20 20 20 | 20 20 20 72 65 74 75 72 |v). | retur|
|000034c0| 6e 3b 0d 0d 20 20 20 20 | 76 61 72 20 69 6e 74 65 |n;.. |var inte|
|000034d0| 72 6e 65 74 53 65 61 72 | 63 68 20 3d 20 43 6f 6d |rnetSear|ch = Com|
|000034e0| 70 6f 6e 65 6e 74 73 2e | 63 6c 61 73 73 65 73 5b |ponents.|classes[|
|000034f0| 4e 45 54 53 45 41 52 43 | 48 5f 43 4f 4e 54 52 41 |NETSEARC|H_CONTRA|
|00003500| 43 54 49 44 5d 2e 67 65 | 74 53 65 72 76 69 63 65 |CTID].ge|tService|
|00003510| 28 29 3b 0d 20 20 20 20 | 69 66 20 28 69 6e 74 65 |();. |if (inte|
|00003520| 72 6e 65 74 53 65 61 72 | 63 68 29 20 20 20 20 0d |rnetSear|ch) .|
|00003530| 20 20 20 20 20 20 20 20 | 69 6e 74 65 72 6e 65 74 | |internet|
|00003540| 53 65 61 72 63 68 20 3d | 20 69 6e 74 65 72 6e 65 |Search =| interne|
|00003550| 74 53 65 61 72 63 68 2e | 51 75 65 72 79 49 6e 74 |tSearch.|QueryInt|
|00003560| 65 72 66 61 63 65 28 6e | 73 49 49 6e 74 65 72 6e |erface(n|sIIntern|
|00003570| 65 74 53 65 61 72 63 68 | 53 65 72 76 69 63 65 29 |etSearch|Service)|
|00003580| 3b 0d 20 20 20 20 69 66 | 20 28 69 6e 74 65 72 6e |;. if| (intern|
|00003590| 65 74 53 65 61 72 63 68 | 29 0d 20 20 20 20 7b 0d |etSearch|). {.|
|000035a0| 20 20 20 20 20 20 20 20 | 69 6e 74 65 72 6e 65 74 | |internet|
|000035b0| 53 65 61 72 63 68 2e 41 | 64 64 53 65 61 72 63 68 |Search.A|ddSearch|
|000035c0| 45 6e 67 69 6e 65 28 65 | 6e 67 69 6e 65 55 52 4c |Engine(e|ngineURL|
|000035d0| 2c 20 69 63 6f 6e 55 52 | 4c 2c 20 73 75 67 67 65 |, iconUR|L, sugge|
|000035e0| 73 74 65 64 54 69 74 6c | 65 2c 0d 20 20 20 20 20 |stedTitl|e,. |
|000035f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003600| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003610| 20 20 73 75 67 67 65 73 | 74 65 64 43 61 74 65 67 | sugges|tedCateg|
|00003620| 6f 72 79 29 3b 0d 20 20 | 20 20 7d 0d 7d 0d 0d 2f |ory);. | }.}../|
|00003630| 2f 20 70 72 6f 70 65 72 | 74 79 20 6f 66 20 6e 73 |/ proper|ty of ns|
|00003640| 49 43 6c 61 73 73 49 6e | 66 6f 0d 6e 73 53 69 64 |IClassIn|fo.nsSid|
|00003650| 65 62 61 72 2e 70 72 6f | 74 6f 74 79 70 65 2e 66 |ebar.pro|totype.f|
|00003660| 6c 61 67 73 20 3d 20 6e | 73 49 43 6c 61 73 73 49 |lags = n|sIClassI|
|00003670| 6e 66 6f 2e 44 4f 4d 5f | 4f 42 4a 45 43 54 3b 0d |nfo.DOM_|OBJECT;.|
|00003680| 0d 2f 2f 20 70 72 6f 70 | 65 72 74 79 20 6f 66 20 |.// prop|erty of |
|00003690| 6e 73 49 43 6c 61 73 73 | 49 6e 66 6f 0d 6e 73 53 |nsIClass|Info.nsS|
|000036a0| 69 64 65 62 61 72 2e 70 | 72 6f 74 6f 74 79 70 65 |idebar.p|rototype|
|000036b0| 2e 63 6c 61 73 73 44 65 | 73 63 72 69 70 74 69 6f |.classDe|scriptio|
|000036c0| 6e 20 3d 20 22 53 69 64 | 65 62 61 72 22 3b 0d 0d |n = "Sid|ebar";..|
|000036d0| 2f 2f 20 6d 65 74 68 6f | 64 20 6f 66 20 6e 73 49 |// metho|d of nsI|
|000036e0| 43 6c 61 73 73 49 6e 66 | 6f 0d 6e 73 53 69 64 65 |ClassInf|o.nsSide|
|000036f0| 62 61 72 2e 70 72 6f 74 | 6f 74 79 70 65 2e 67 65 |bar.prot|otype.ge|
|00003700| 74 49 6e 74 65 72 66 61 | 63 65 73 20 3d 20 66 75 |tInterfa|ces = fu|
|00003710| 6e 63 74 69 6f 6e 28 63 | 6f 75 6e 74 29 20 7b 0d |nction(c|ount) {.|
|00003720| 20 20 20 20 76 61 72 20 | 69 6e 74 65 72 66 61 63 | var |interfac|
|00003730| 65 4c 69 73 74 20 3d 20 | 5b 6e 73 49 53 69 64 65 |eList = |[nsISide|
|00003740| 62 61 72 2c 20 6e 73 49 | 43 6c 61 73 73 49 6e 66 |bar, nsI|ClassInf|
|00003750| 6f 5d 3b 0d 20 20 20 20 | 63 6f 75 6e 74 2e 76 61 |o];. |count.va|
|00003760| 6c 75 65 20 3d 20 69 6e | 74 65 72 66 61 63 65 4c |lue = in|terfaceL|
|00003770| 69 73 74 2e 6c 65 6e 67 | 74 68 3b 0d 20 20 20 20 |ist.leng|th;. |
|00003780| 72 65 74 75 72 6e 20 69 | 6e 74 65 72 66 61 63 65 |return i|nterface|
|00003790| 4c 69 73 74 3b 0d 7d 0d | 0d 2f 2f 20 6d 65 74 68 |List;.}.|.// meth|
|000037a0| 6f 64 20 6f 66 20 6e 73 | 49 43 6c 61 73 73 49 6e |od of ns|IClassIn|
|000037b0| 66 6f 0d 6e 73 53 69 64 | 65 62 61 72 2e 70 72 6f |fo.nsSid|ebar.pro|
|000037c0| 74 6f 74 79 70 65 2e 67 | 65 74 48 65 6c 70 65 72 |totype.g|etHelper|
|000037d0| 46 6f 72 4c 61 6e 67 75 | 61 67 65 20 3d 20 66 75 |ForLangu|age = fu|
|000037e0| 6e 63 74 69 6f 6e 28 63 | 6f 75 6e 74 29 20 7b 72 |nction(c|ount) {r|
|000037f0| 65 74 75 72 6e 20 6e 75 | 6c 6c 3b 7d 0d 0d 6e 73 |eturn nu|ll;}..ns|
|00003800| 53 69 64 65 62 61 72 2e | 70 72 6f 74 6f 74 79 70 |Sidebar.|prototyp|
|00003810| 65 2e 51 75 65 72 79 49 | 6e 74 65 72 66 61 63 65 |e.QueryI|nterface|
|00003820| 20 3d 0d 66 75 6e 63 74 | 69 6f 6e 20 28 69 69 64 | =.funct|ion (iid|
|00003830| 29 20 7b 0d 20 20 20 20 | 69 66 20 28 21 69 69 64 |) {. |if (!iid|
|00003840| 2e 65 71 75 61 6c 73 28 | 6e 73 49 53 69 64 65 62 |.equals(|nsISideb|
|00003850| 61 72 29 20 26 26 20 0d | 20 20 20 20 20 20 20 20 |ar) && .| |
|00003860| 21 69 69 64 2e 65 71 75 | 61 6c 73 28 6e 73 49 43 |!iid.equ|als(nsIC|
|00003870| 6c 61 73 73 49 6e 66 6f | 29 20 26 26 0d 20 20 20 |lassInfo|) &&. |
|00003880| 20 20 20 20 20 21 69 69 | 64 2e 65 71 75 61 6c 73 | !ii|d.equals|
|00003890| 28 6e 73 49 53 75 70 70 | 6f 72 74 73 29 29 0d 20 |(nsISupp|orts)). |
|000038a0| 20 20 20 20 20 20 20 74 | 68 72 6f 77 20 43 6f 6d | t|hrow Com|
|000038b0| 70 6f 6e 65 6e 74 73 2e | 72 65 73 75 6c 74 73 2e |ponents.|results.|
|000038c0| 4e 53 5f 45 52 52 4f 52 | 5f 4e 4f 5f 49 4e 54 45 |NS_ERROR|_NO_INTE|
|000038d0| 52 46 41 43 45 3b 0d 20 | 20 20 20 72 65 74 75 72 |RFACE;. | retur|
|000038e0| 6e 20 74 68 69 73 3b 0d | 7d 0d 0d 76 61 72 20 73 |n this;.|}..var s|
|000038f0| 69 64 65 62 61 72 4d 6f | 64 75 6c 65 20 3d 20 6e |idebarMo|dule = n|
|00003900| 65 77 20 4f 62 6a 65 63 | 74 28 29 3b 0d 0d 73 69 |ew Objec|t();..si|
|00003910| 64 65 62 61 72 4d 6f 64 | 75 6c 65 2e 72 65 67 69 |debarMod|ule.regi|
|00003920| 73 74 65 72 53 65 6c 66 | 20 3d 0d 66 75 6e 63 74 |sterSelf| =.funct|
|00003930| 69 6f 6e 20 28 63 6f 6d | 70 4d 67 72 2c 20 66 69 |ion (com|pMgr, fi|
|00003940| 6c 65 53 70 65 63 2c 20 | 6c 6f 63 61 74 69 6f 6e |leSpec, |location|
|00003950| 2c 20 74 79 70 65 29 0d | 7b 0d 20 20 20 20 64 65 |, type).|{. de|
|00003960| 62 75 67 28 22 72 65 67 | 69 73 74 65 72 69 6e 67 |bug("reg|istering|
|00003970| 20 28 61 6c 6c 20 72 69 | 67 68 74 20 2d 2d 20 61 | (all ri|ght -- a|
|00003980| 20 4a 61 76 61 53 63 72 | 69 70 74 20 6d 6f 64 75 | JavaScr|ipt modu|
|00003990| 6c 65 21 29 22 29 3b 0d | 20 20 20 20 63 6f 6d 70 |le!)");.| comp|
|000039a0| 4d 67 72 20 3d 20 63 6f | 6d 70 4d 67 72 2e 51 75 |Mgr = co|mpMgr.Qu|
|000039b0| 65 72 79 49 6e 74 65 72 | 66 61 63 65 28 43 6f 6d |eryInter|face(Com|
|000039c0| 70 6f 6e 65 6e 74 73 2e | 69 6e 74 65 72 66 61 63 |ponents.|interfac|
|000039d0| 65 73 2e 6e 73 49 43 6f | 6d 70 6f 6e 65 6e 74 52 |es.nsICo|mponentR|
|000039e0| 65 67 69 73 74 72 61 72 | 29 3b 0d 0d 20 20 20 20 |egistrar|);.. |
|000039f0| 63 6f 6d 70 4d 67 72 2e | 72 65 67 69 73 74 65 72 |compMgr.|register|
|00003a00| 46 61 63 74 6f 72 79 4c | 6f 63 61 74 69 6f 6e 28 |FactoryL|ocation(|
|00003a10| 53 49 44 45 42 41 52 5f | 43 49 44 2c 20 0d 20 20 |SIDEBAR_|CID, . |
|00003a20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003a30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003a40| 20 20 22 53 69 64 65 62 | 61 72 20 4a 53 20 43 6f | "Sideb|ar JS Co|
|00003a50| 6d 70 6f 6e 65 6e 74 22 | 2c 0d 20 20 20 20 20 20 |mponent"|,. |
|00003a60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003a70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 53 49 | | SI|
|00003a80| 44 45 42 41 52 5f 43 4f | 4e 54 52 41 43 54 49 44 |DEBAR_CO|NTRACTID|
|00003a90| 2c 20 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |, . | |
|00003aa0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ab0| 20 20 20 20 20 20 20 66 | 69 6c 65 53 70 65 63 2c | f|ileSpec,|
|00003ac0| 20 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | . | |
|00003ad0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ae0| 20 20 20 20 20 20 6c 6f | 63 61 74 69 6f 6e 2c 0d | lo|cation,.|
|00003af0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003b00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003b10| 20 20 20 20 74 79 70 65 | 29 3b 0d 7d 0d 0d 73 69 | type|);.}..si|
|00003b20| 64 65 62 61 72 4d 6f 64 | 75 6c 65 2e 67 65 74 43 |debarMod|ule.getC|
|00003b30| 6c 61 73 73 4f 62 6a 65 | 63 74 20 3d 0d 66 75 6e |lassObje|ct =.fun|
|00003b40| 63 74 69 6f 6e 20 28 63 | 6f 6d 70 4d 67 72 2c 20 |ction (c|ompMgr, |
|00003b50| 63 69 64 2c 20 69 69 64 | 29 20 7b 0d 20 20 20 20 |cid, iid|) {. |
|00003b60| 69 66 20 28 21 63 69 64 | 2e 65 71 75 61 6c 73 28 |if (!cid|.equals(|
|00003b70| 53 49 44 45 42 41 52 5f | 43 49 44 29 29 0d 20 20 |SIDEBAR_|CID)). |
|00003b80| 20 20 20 20 20 20 74 68 | 72 6f 77 20 43 6f 6d 70 | th|row Comp|
|00003b90| 6f 6e 65 6e 74 73 2e 72 | 65 73 75 6c 74 73 2e 4e |onents.r|esults.N|
|00003ba0| 53 5f 45 52 52 4f 52 5f | 4e 4f 5f 49 4e 54 45 52 |S_ERROR_|NO_INTER|
|00003bb0| 46 41 43 45 3b 0d 20 20 | 20 20 0d 20 20 20 20 69 |FACE;. | . i|
|00003bc0| 66 20 28 21 69 69 64 2e | 65 71 75 61 6c 73 28 43 |f (!iid.|equals(C|
|00003bd0| 6f 6d 70 6f 6e 65 6e 74 | 73 2e 69 6e 74 65 72 66 |omponent|s.interf|
|00003be0| 61 63 65 73 2e 6e 73 49 | 46 61 63 74 6f 72 79 29 |aces.nsI|Factory)|
|00003bf0| 29 0d 20 20 20 20 20 20 | 20 20 74 68 72 6f 77 20 |). | throw |
|00003c00| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 72 65 73 75 6c |Componen|ts.resul|
|00003c10| 74 73 2e 4e 53 5f 45 52 | 52 4f 52 5f 4e 4f 54 5f |ts.NS_ER|ROR_NOT_|
|00003c20| 49 4d 50 4c 45 4d 45 4e | 54 45 44 3b 0d 20 20 20 |IMPLEMEN|TED;. |
|00003c30| 20 0d 20 20 20 20 72 65 | 74 75 72 6e 20 73 69 64 | . re|turn sid|
|00003c40| 65 62 61 72 46 61 63 74 | 6f 72 79 3b 0d 7d 0d 0d |ebarFact|ory;.}..|
|00003c50| 73 69 64 65 62 61 72 4d | 6f 64 75 6c 65 2e 63 61 |sidebarM|odule.ca|
|00003c60| 6e 55 6e 6c 6f 61 64 20 | 3d 0d 66 75 6e 63 74 69 |nUnload |=.functi|
|00003c70| 6f 6e 28 63 6f 6d 70 4d | 67 72 29 0d 7b 0d 20 20 |on(compM|gr).{. |
|00003c80| 20 20 64 65 62 75 67 28 | 22 55 6e 6c 6f 61 64 69 | debug(|"Unloadi|
|00003c90| 6e 67 20 63 6f 6d 70 6f | 6e 65 6e 74 2e 22 29 3b |ng compo|nent.");|
|00003ca0| 0d 20 20 20 20 72 65 74 | 75 72 6e 20 74 72 75 65 |. ret|urn true|
|00003cb0| 3b 0d 7d 0d 20 20 20 20 | 0d 2f 2a 20 66 61 63 74 |;.}. |./* fact|
|00003cc0| 6f 72 79 20 6f 62 6a 65 | 63 74 20 2a 2f 0d 76 61 |ory obje|ct */.va|
|00003cd0| 72 20 73 69 64 65 62 61 | 72 46 61 63 74 6f 72 79 |r sideba|rFactory|
|00003ce0| 20 3d 20 6e 65 77 20 4f | 62 6a 65 63 74 28 29 3b | = new O|bject();|
|00003cf0| 0d 0d 73 69 64 65 62 61 | 72 46 61 63 74 6f 72 79 |..sideba|rFactory|
|00003d00| 2e 63 72 65 61 74 65 49 | 6e 73 74 61 6e 63 65 20 |.createI|nstance |
|00003d10| 3d 0d 66 75 6e 63 74 69 | 6f 6e 20 28 6f 75 74 65 |=.functi|on (oute|
|00003d20| 72 2c 20 69 69 64 29 20 | 7b 0d 20 20 20 20 64 65 |r, iid) |{. de|
|00003d30| 62 75 67 28 22 43 49 3a | 20 22 20 2b 20 69 69 64 |bug("CI:| " + iid|
|00003d40| 29 3b 0d 20 20 20 20 69 | 66 20 28 6f 75 74 65 72 |);. i|f (outer|
|00003d50| 20 21 3d 20 6e 75 6c 6c | 29 0d 20 20 20 20 20 20 | != null|). |
|00003d60| 20 20 74 68 72 6f 77 20 | 43 6f 6d 70 6f 6e 65 6e | throw |Componen|
|00003d70| 74 73 2e 72 65 73 75 6c | 74 73 2e 4e 53 5f 45 52 |ts.resul|ts.NS_ER|
|00003d80| 52 4f 52 5f 4e 4f 5f 41 | 47 47 52 45 47 41 54 49 |ROR_NO_A|GGREGATI|
|00003d90| 4f 4e 3b 0d 0d 20 20 20 | 20 72 65 74 75 72 6e 20 |ON;.. | return |
|00003da0| 28 6e 65 77 20 6e 73 53 | 69 64 65 62 61 72 28 29 |(new nsS|idebar()|
|00003db0| 29 2e 51 75 65 72 79 49 | 6e 74 65 72 66 61 63 65 |).QueryI|nterface|
|00003dc0| 28 69 69 64 29 3b 0d 7d | 0d 0d 2f 2a 20 65 6e 74 |(iid);.}|../* ent|
|00003dd0| 72 79 70 6f 69 6e 74 20 | 2a 2f 0d 66 75 6e 63 74 |rypoint |*/.funct|
|00003de0| 69 6f 6e 20 4e 53 47 65 | 74 4d 6f 64 75 6c 65 28 |ion NSGe|tModule(|
|00003df0| 63 6f 6d 70 4d 67 72 2c | 20 66 69 6c 65 53 70 65 |compMgr,| fileSpe|
|00003e00| 63 29 20 7b 0d 20 20 20 | 20 72 65 74 75 72 6e 20 |c) {. | return |
|00003e10| 73 69 64 65 62 61 72 4d | 6f 64 75 6c 65 3b 0d 7d |sidebarM|odule;.}|
|00003e20| 0d 0d 2f 2a 20 73 74 61 | 74 69 63 20 66 75 6e 63 |../* sta|tic func|
|00003e30| 74 69 6f 6e 73 20 2a 2f | 0d 69 66 20 28 44 45 42 |tions */|.if (DEB|
|00003e40| 55 47 29 0d 20 20 20 20 | 64 65 62 75 67 20 3d 20 |UG). |debug = |
|00003e50| 66 75 6e 63 74 69 6f 6e | 20 28 73 29 20 7b 20 64 |function| (s) { d|
|00003e60| 75 6d 70 28 22 2d 2a 2d | 20 73 69 64 65 62 61 72 |ump("-*-| sidebar|
|00003e70| 20 63 6f 6d 70 6f 6e 65 | 6e 74 3a 20 22 20 2b 20 | compone|nt: " + |
|00003e80| 73 20 2b 20 22 5c 6e 22 | 29 3b 20 7d 0d 65 6c 73 |s + "\n"|); }.els|
|00003e90| 65 0d 20 20 20 20 64 65 | 62 75 67 20 3d 20 66 75 |e. de|bug = fu|
|00003ea0| 6e 63 74 69 6f 6e 20 28 | 73 29 20 7b 7d 0d 0d 66 |nction (|s) {}..f|
|00003eb0| 75 6e 63 74 69 6f 6e 20 | 67 65 74 53 69 64 65 62 |unction |getSideb|
|00003ec0| 61 72 44 61 74 61 73 6f | 75 72 63 65 55 52 49 28 |arDataso|urceURI(|
|00003ed0| 70 61 6e 65 6c 73 5f 66 | 69 6c 65 5f 69 64 29 0d |panels_f|ile_id).|
|00003ee0| 7b 0d 20 20 20 20 74 72 | 79 20 0d 20 20 20 20 7b |{. tr|y . {|
|00003ef0| 0d 20 20 20 20 20 20 20 | 20 2f 2a 20 75 73 65 20 |. | /* use |
|00003f00| 74 68 65 20 66 69 6c 65 | 4c 6f 63 61 74 6f 72 20 |the file|Locator |
|00003f10| 74 6f 20 6c 6f 6f 6b 20 | 69 6e 20 74 68 65 20 70 |to look |in the p|
|00003f20| 72 6f 66 69 6c 65 20 64 | 69 72 65 63 74 6f 72 79 |rofile d|irectory|
|00003f30| 20 0d 20 20 20 20 20 20 | 20 20 20 2a 20 74 6f 20 | . | * to |
|00003f40| 66 69 6e 64 20 27 70 61 | 6e 65 6c 73 2e 72 64 66 |find 'pa|nels.rdf|
|00003f50| 27 2c 20 77 68 69 63 68 | 20 69 73 20 74 68 65 0d |', which| is the.|
|00003f60| 20 20 20 20 20 20 20 20 | 20 2a 20 64 61 74 61 62 | | * datab|
|00003f70| 61 73 65 20 6f 66 20 74 | 68 65 20 75 73 65 72 27 |ase of t|he user'|
|00003f80| 73 20 63 75 72 72 65 6e | 74 6c 79 20 73 65 6c 65 |s curren|tly sele|
|00003f90| 63 74 65 64 20 70 61 6e | 65 6c 73 2e 20 2a 2f 0d |cted pan|els. */.|
|00003fa0| 20 20 20 20 20 20 20 20 | 76 61 72 20 64 69 72 65 | |var dire|
|00003fb0| 63 74 6f 72 79 5f 73 65 | 72 76 69 63 65 20 3d 20 |ctory_se|rvice = |
|00003fc0| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 63 6c 61 73 73 |Componen|ts.class|
|00003fd0| 65 73 5b 44 49 52 5f 53 | 45 52 56 5f 43 4f 4e 54 |es[DIR_S|ERV_CONT|
|00003fe0| 52 41 43 54 49 44 5d 2e | 67 65 74 53 65 72 76 69 |RACTID].|getServi|
|00003ff0| 63 65 28 43 6f 6d 70 6f | 6e 65 6e 74 73 2e 69 6e |ce(Compo|nents.in|
|00004000| 74 65 72 66 61 63 65 73 | 2e 6e 73 49 50 72 6f 70 |terfaces|.nsIProp|
|00004010| 65 72 74 69 65 73 29 3b | 0d 0d 20 20 20 20 20 20 |erties);|.. |
|00004020| 20 20 2f 2a 20 69 66 20 | 3c 70 72 6f 66 69 6c 65 | /* if |<profile|
|00004030| 3e 2f 70 61 6e 65 6c 73 | 2e 72 64 66 20 64 6f 65 |>/panels|.rdf doe|
|00004040| 73 6e 27 74 20 65 78 69 | 73 74 2c 20 67 65 74 20 |sn't exi|st, get |
|00004050| 77 69 6c 6c 20 63 6f 70 | 79 0d 20 20 20 20 20 20 |will cop|y. |
|00004060| 20 20 20 2a 62 69 6e 2f | 64 65 66 61 75 6c 74 73 | *bin/|defaults|
|00004070| 2f 70 72 6f 66 69 6c 65 | 2f 70 61 6e 65 6c 73 2e |/profile|/panels.|
|00004080| 72 64 66 20 74 6f 20 3c | 70 72 6f 66 69 6c 65 3e |rdf to <|profile>|
|00004090| 2f 70 61 6e 65 6c 73 2e | 72 64 66 20 2a 2f 0d 20 |/panels.|rdf */. |
|000040a0| 20 20 20 20 20 20 20 76 | 61 72 20 73 69 64 65 62 | v|ar sideb|
|000040b0| 61 72 5f 66 69 6c 65 20 | 3d 20 64 69 72 65 63 74 |ar_file |= direct|
|000040c0| 6f 72 79 5f 73 65 72 76 | 69 63 65 2e 67 65 74 28 |ory_serv|ice.get(|
|000040d0| 70 61 6e 65 6c 73 5f 66 | 69 6c 65 5f 69 64 2c 20 |panels_f|ile_id, |
|000040e0| 43 6f 6d 70 6f 6e 65 6e | 74 73 2e 69 6e 74 65 72 |Componen|ts.inter|
|000040f0| 66 61 63 65 73 2e 6e 73 | 49 46 69 6c 65 29 3b 0d |faces.ns|IFile);.|
|00004100| 0d 20 20 20 20 20 20 20 | 20 69 66 20 28 21 73 69 |. | if (!si|
|00004110| 64 65 62 61 72 5f 66 69 | 6c 65 2e 65 78 69 73 74 |debar_fi|le.exist|
|00004120| 73 28 29 29 0d 20 20 20 | 20 20 20 20 20 7b 0d 20 |s()). | {. |
|00004130| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 74 68 | | /* th|
|00004140| 69 73 20 73 68 6f 75 6c | 64 20 6e 6f 74 20 68 61 |is shoul|d not ha|
|00004150| 70 70 65 6e 2c 20 61 73 | 20 47 65 74 46 69 6c 65 |ppen, as| GetFile|
|00004160| 4c 6f 63 61 74 69 6f 6e | 28 29 20 73 68 6f 75 6c |Location|() shoul|
|00004170| 64 20 63 6f 70 79 0d 20 | 20 20 20 20 20 20 20 20 |d copy. | |
|00004180| 20 20 20 20 2a 20 64 65 | 66 61 75 6c 74 73 2f 70 | * de|faults/p|
|00004190| 61 6e 65 6c 73 2e 72 64 | 66 20 74 6f 20 74 68 65 |anels.rd|f to the|
|000041a0| 20 75 73 65 72 73 20 70 | 72 6f 66 69 6c 65 20 64 | users p|rofile d|
|000041b0| 69 72 65 63 74 6f 72 79 | 20 2a 2f 0d 20 20 20 20 |irectory| */. |
|000041c0| 20 20 20 20 20 20 20 20 | 64 65 62 75 67 28 22 73 | |debug("s|
|000041d0| 69 64 65 62 61 72 20 66 | 69 6c 65 20 64 6f 65 73 |idebar f|ile does|
|000041e0| 20 6e 6f 74 20 65 78 69 | 73 74 22 29 3b 0d 20 20 | not exi|st");. |
|000041f0| 20 20 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e | | return|
|00004200| 20 6e 75 6c 6c 3b 0d 20 | 20 20 20 20 20 20 20 7d | null;. | }|
|00004210| 0d 0d 20 20 20 20 20 20 | 20 20 76 61 72 20 69 6f |.. | var io|
|00004220| 5f 73 65 72 76 69 63 65 | 20 3d 20 43 6f 6d 70 6f |_service| = Compo|
|00004230| 6e 65 6e 74 73 2e 63 6c | 61 73 73 65 73 5b 49 4f |nents.cl|asses[IO|
|00004240| 5f 53 45 52 56 5f 43 4f | 4e 54 52 41 43 54 49 44 |_SERV_CO|NTRACTID|
|00004250| 5d 2e 67 65 74 53 65 72 | 76 69 63 65 28 43 6f 6d |].getSer|vice(Com|
|00004260| 70 6f 6e 65 6e 74 73 2e | 69 6e 74 65 72 66 61 63 |ponents.|interfac|
|00004270| 65 73 2e 6e 73 49 49 4f | 53 65 72 76 69 63 65 29 |es.nsIIO|Service)|
|00004280| 3b 0d 20 20 20 20 20 20 | 20 20 76 61 72 20 66 69 |;. | var fi|
|00004290| 6c 65 5f 68 61 6e 64 6c | 65 72 20 3d 20 69 6f 5f |le_handl|er = io_|
|000042a0| 73 65 72 76 69 63 65 2e | 67 65 74 50 72 6f 74 6f |service.|getProto|
|000042b0| 63 6f 6c 48 61 6e 64 6c | 65 72 28 22 66 69 6c 65 |colHandl|er("file|
|000042c0| 22 29 2e 51 75 65 72 79 | 49 6e 74 65 72 66 61 63 |").Query|Interfac|
|000042d0| 65 28 43 6f 6d 70 6f 6e | 65 6e 74 73 2e 69 6e 74 |e(Compon|ents.int|
|000042e0| 65 72 66 61 63 65 73 2e | 6e 73 49 46 69 6c 65 50 |erfaces.|nsIFileP|
|000042f0| 72 6f 74 6f 63 6f 6c 48 | 61 6e 64 6c 65 72 29 3b |rotocolH|andler);|
|00004300| 0d 20 20 20 20 20 20 20 | 20 76 61 72 20 73 69 64 |. | var sid|
|00004310| 65 62 61 72 5f 75 72 69 | 20 3d 20 66 69 6c 65 5f |ebar_uri| = file_|
|00004320| 68 61 6e 64 6c 65 72 2e | 67 65 74 55 52 4c 53 70 |handler.|getURLSp|
|00004330| 65 63 46 72 6f 6d 46 69 | 6c 65 28 73 69 64 65 62 |ecFromFi|le(sideb|
|00004340| 61 72 5f 66 69 6c 65 29 | 3b 0d 20 20 20 20 20 20 |ar_file)|;. |
|00004350| 20 20 64 65 62 75 67 28 | 22 73 69 64 65 62 61 72 | debug(|"sidebar|
|00004360| 20 75 72 69 20 69 73 20 | 22 20 2b 20 73 69 64 65 | uri is |" + side|
|00004370| 62 61 72 5f 75 72 69 29 | 3b 0d 20 20 20 20 20 20 |bar_uri)|;. |
|00004380| 20 20 72 65 74 75 72 6e | 20 73 69 64 65 62 61 72 | return| sidebar|
|00004390| 5f 75 72 69 3b 0d 20 20 | 20 20 7d 0d 20 20 20 20 |_uri;. | }. |
|000043a0| 63 61 74 63 68 20 28 65 | 78 29 0d 20 20 20 20 7b |catch (e|x). {|
|000043b0| 0d 20 20 20 20 20 20 20 | 20 2f 2a 20 74 68 69 73 |. | /* this|
|000043c0| 20 73 68 6f 75 6c 64 20 | 6e 6f 74 20 68 61 70 70 | should |not happ|
|000043d0| 65 6e 20 2a 2f 0d 20 20 | 20 20 20 20 20 20 64 65 |en */. | de|
|000043e0| 62 75 67 28 22 63 61 75 | 67 68 74 20 22 20 2b 20 |bug("cau|ght " + |
|000043f0| 65 78 20 2b 20 22 20 67 | 65 74 74 69 6e 67 20 73 |ex + " g|etting s|
|00004400| 69 64 65 62 61 72 20 64 | 61 74 61 73 6f 75 72 63 |idebar d|atasourc|
|00004410| 65 20 75 72 69 22 29 3b | 0d 20 20 20 20 20 20 20 |e uri");|. |
|00004420| 20 72 65 74 75 72 6e 20 | 6e 75 6c 6c 3b 0d 20 20 | return |null;. |
|00004430| 20 20 7d 0d 7d 0d 0d 0d | 76 61 72 20 73 74 72 42 | }.}...|var strB|
|00004440| 75 6e 64 6c 65 53 65 72 | 76 69 63 65 20 3d 20 6e |undleSer|vice = n|
|00004450| 75 6c 6c 3b 0d 66 75 6e | 63 74 69 6f 6e 20 73 72 |ull;.fun|ction sr|
|00004460| 47 65 74 53 74 72 42 75 | 6e 64 6c 65 28 70 61 74 |GetStrBu|ndle(pat|
|00004470| 68 29 0d 7b 0d 20 20 20 | 76 61 72 20 73 74 72 42 |h).{. |var strB|
|00004480| 75 6e 64 6c 65 20 3d 20 | 6e 75 6c 6c 3b 0d 20 20 |undle = |null;. |
|00004490| 20 69 66 20 28 21 73 74 | 72 42 75 6e 64 6c 65 53 | if (!st|rBundleS|
|000044a0| 65 72 76 69 63 65 29 20 | 7b 0d 20 20 20 20 20 20 |ervice) |{. |
|000044b0| 20 74 72 79 20 7b 0d 20 | 20 20 20 20 20 20 20 20 | try {. | |
|000044c0| 20 73 74 72 42 75 6e 64 | 6c 65 53 65 72 76 69 63 | strBund|leServic|
|000044d0| 65 20 3d 0d 20 20 20 20 | 20 20 20 20 20 20 43 6f |e =. | Co|
|000044e0| 6d 70 6f 6e 65 6e 74 73 | 2e 63 6c 61 73 73 65 73 |mponents|.classes|
|000044f0| 5b 22 40 6d 6f 7a 69 6c | 6c 61 2e 6f 72 67 2f 69 |["@mozil|la.org/i|
|00004500| 6e 74 6c 2f 73 74 72 69 | 6e 67 62 75 6e 64 6c 65 |ntl/stri|ngbundle|
|00004510| 3b 31 22 5d 2e 67 65 74 | 53 65 72 76 69 63 65 28 |;1"].get|Service(|
|00004520| 29 3b 20 0d 20 20 20 20 | 20 20 20 20 20 20 73 74 |); . | st|
|00004530| 72 42 75 6e 64 6c 65 53 | 65 72 76 69 63 65 20 3d |rBundleS|ervice =|
|00004540| 20 0d 20 20 20 20 20 20 | 20 20 20 20 73 74 72 42 | . | strB|
|00004550| 75 6e 64 6c 65 53 65 72 | 76 69 63 65 2e 51 75 65 |undleSer|vice.Que|
|00004560| 72 79 49 6e 74 65 72 66 | 61 63 65 28 43 6f 6d 70 |ryInterf|ace(Comp|
|00004570| 6f 6e 65 6e 74 73 2e 69 | 6e 74 65 72 66 61 63 65 |onents.i|nterface|
|00004580| 73 2e 6e 73 49 53 74 72 | 69 6e 67 42 75 6e 64 6c |s.nsIStr|ingBundl|
|00004590| 65 53 65 72 76 69 63 65 | 29 3b 0d 20 20 20 20 20 |eService|);. |
|000045a0| 20 20 7d 20 63 61 74 63 | 68 20 28 65 78 29 20 7b | } catc|h (ex) {|
|000045b0| 0d 20 20 20 20 20 20 20 | 20 20 20 64 75 6d 70 28 |. | dump(|
|000045c0| 22 5c 6e 2d 2d 2a 2a 20 | 73 74 72 42 75 6e 64 6c |"\n--** |strBundl|
|000045d0| 65 53 65 72 76 69 63 65 | 20 66 61 69 6c 65 64 3a |eService| failed:|
|000045e0| 20 22 20 2b 20 65 78 20 | 2b 20 22 5c 6e 22 29 3b | " + ex |+ "\n");|
|000045f0| 0d 20 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 |. | retur|
|00004600| 6e 20 6e 75 6c 6c 3b 0d | 20 20 20 20 20 20 7d 0d |n null;.| }.|
|00004610| 20 20 20 7d 0d 20 20 20 | 73 74 72 42 75 6e 64 6c | }. |strBundl|
|00004620| 65 20 3d 20 73 74 72 42 | 75 6e 64 6c 65 53 65 72 |e = strB|undleSer|
|00004630| 76 69 63 65 2e 63 72 65 | 61 74 65 42 75 6e 64 6c |vice.cre|ateBundl|
|00004640| 65 28 70 61 74 68 29 3b | 20 0d 20 20 20 69 66 20 |e(path);| . if |
|00004650| 28 21 73 74 72 42 75 6e | 64 6c 65 29 20 7b 0d 20 |(!strBun|dle) {. |
|00004660| 20 20 20 20 20 20 64 75 | 6d 70 28 22 5c 6e 2d 2d | du|mp("\n--|
|00004670| 2a 2a 20 73 74 72 42 75 | 6e 64 6c 65 20 63 72 65 |** strBu|ndle cre|
|00004680| 61 74 65 49 6e 73 74 61 | 6e 63 65 20 66 61 69 6c |ateInsta|nce fail|
|00004690| 65 64 20 2a 2a 2d 2d 5c | 6e 22 29 3b 0d 20 20 20 |ed **--\|n");. |
|000046a0| 7d 0d 20 20 20 72 65 74 | 75 72 6e 20 73 74 72 42 |}. ret|urn strB|
|000046b0| 75 6e 64 6c 65 3b 0d 7d | 0d 0d 0d 00 00 00 00 00 |undle;.}|........|
|000046c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004700| 00 00 01 00 00 00 01 56 | 00 00 00 56 00 00 00 41 |.......V|...V...A|
|00004710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004800| 00 00 00 52 59 ab 93 98 | 3f e5 32 30 00 04 00 00 |...RY...|?.20....|
|00004810| 00 00 00 00 00 00 bb 25 | 39 93 bb 25 39 93 00 00 |.......%|9..%9...|
|00004820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 11 6b |........|.......k|
|00004830| 61 69 65 25 6e 65 74 73 | 63 61 70 65 2e 63 6f 6d |aie%nets|cape.com|
|00004840| 00 00 00 0c 6e 73 53 69 | 64 65 62 61 72 2e 6a 73 |....nsSi|debar.js|
|00004850| 00 00 00 00 00 00 00 00 | 01 00 00 00 01 56 00 00 |........|.....V..|
|00004860| 00 56 00 00 00 41 00 0e | 80 84 3e c8 00 00 00 1c |.V...A..|..>.....|
|00004870| 00 32 00 00 63 6b 69 64 | 00 00 00 0a 00 80 00 00 |.2..ckid|........|
|00004880| 00 00 00 00 01 3b 21 5c | 0e 50 72 6f 6a 65 63 74 |.....;!\|.Project|
|00004890| 6f 72 20 44 61 74 61 00 | 00 00 00 00 00 00 00 00 |or Data.|........|
|000048a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+