ÿØÿà JFIF    ÿÛ „  ( %"1!%)+...383,7(-.+  -+++--++++---+-+-----+---------------+---+-++7-----ÿÀ  ß â" ÿÄ     ÿÄ H    !1AQaq"‘¡2B±ÁÑð#R“Ò Tbr‚²á3csƒ’ÂñDS¢³$CÿÄ   ÿÄ %  !1AQa"23‘ÿÚ   ? ôÿ ¨pŸªáÿ —åYõõ\?àÒü©ŠÄï¨pŸªáÿ —åYõõ\?àÓü©ŠÄá 0Ÿªáÿ Ÿå[úƒ ú®ði~TÁbqÐ8OÕpÿ ƒOò¤Oè`–RÂáœá™êi€ßÉ< FtŸI“öÌ8úDf´°å}“¾œ6  öFá°y¥jñÇh†ˆ¢ã/ÃÐ:ªcÈ "Y¡ðÑl>ÿ ”ÏËte:qž\oäŠe÷󲍷˜HT4&ÿ ÓÐü6ö®¿øþßèô Ÿ•7Ñi’•j|“ñì>b…þS?*Óôÿ ÓÐü*h¥£ír¶ü UãS炟[AÐaè[ûª•õ&õj?†Éö+EzP—WeÒírJFt ‘BŒ†Ï‡%#tE Øz ¥OÛ«!1›üä±Í™%ºÍãö]°î(–:@<‹ŒÊö×òÆt¦ãº+‡¦%ÌÁ²h´OƒJŒtMÜ>ÀÜÊw3Y´•牋4ǍýʏTì>œú=Íwhyë,¾Ôò×õ¿ßÊa»«þˆѪQ|%6ž™A õ%:øj<>É—ÿ Å_ˆCbõ¥š±ý¯Ýƒï…¶|RëócÍf溪“t.СøTÿ *Ä¿-{†çàczůŽ_–^XþŒ±miB[X±d 1,é”zEù»& î9gœf™9Ð'.;—™i}!ôšåîqêÛ٤ёý£½ÆA–àôe"A$˝Úsäÿ ÷Û #°xŸëí(l »ý3—¥5m! rt`†0~'j2(]S¦¦kv,ÚÇ l¦øJA£Šƒ J3E8ÙiŽ:cÉžúeZ°€¯\®kÖ(79«Ž:¯X”¾³Š&¡* ….‰Ž(ÜíŸ2¥ª‡×Hi²TF¤ò[¨íÈRëÉ䢍mgÑ.Ÿ<öäS0í„ǹÁU´f#Vß;Õ–…P@3ío<ä-±»Ž.L|kªÀê›fÂ6@»eu‚|ÓaÞÆŸ…¨ááå>åŠ?cKü6ùTÍÆ”†sĤÚ;H2RÚ†õ\Ö·Ÿn'¾ ñ#ºI¤Å´%çÁ­‚â7›‹qT3Iï¨ÖÚ5I7Ë!ÅOóŸ¶øÝñØôת¦$Tcö‘[«Ö³šÒ';Aþ ¸èíg A2Z"i¸vdÄ÷.iõ®§)¿]¤À†–‡É&ä{V¶iŽ”.Ó×Õÿ û?h¬Mt–íª[ÿ Ñÿ ÌV(í}=ibÔ¡›¥¢±b Lô¥‡piη_Z<‡z§èŒ)iÖwiÇ 2hÙ3·=’d÷8éŽ1¦¸c¤µ€7›7Ø ð\á)} ¹fËí›pAÃL%âc2 í§æQz¿;T8sæ°qø)QFMð‰XŒÂ±N¢aF¨…8¯!U  Z©RÊ ÖPVÄÀÍin™Ì-GˆªÅËŠ›•zË}º±ŽÍFò¹}Uw×#ä5B¤{î}Ð<ÙD é©¤&‡ïDbàÁôMÁ." ¤‡ú*õ'VŽ|¼´Úgllº¼klz[Æüï÷Aób‡Eÿ dÑ»Xx9ÃÜ£ÁT/`¼¸vI±Ýµ·Ë‚“G³þ*Ÿû´r|*}<¨îºœ @¦mÄ’M¹”.œ«Y–|6ÏU¤jç¥ÕÞqO ˜kDÆÁ¨5ÿ š;ÐЦ¦€GÙk \ –Þ=â¼=SͧµªS°ÚÍpÜãQűÀõ¬?ÃÁ1Ñ•õZà?hóœ€ L¦l{Y*K˜Ù›zc˜–ˆâ ø+¾ ­-Ök¥%ùEÜA'}ˆ><ÊIè“bpÍ/qÞâvoX€w,\úªò6Z[XdÒæ­@Ö—€$òJí#é>'°Ú ôª˜<)4ryÙ£|óAÅn5žêŸyÒäMÝ2{"}‰–¤l÷ûWX\l¾Á¸góÉOÔ /óñB¤f¸çñ[.P˜ZsÊË*ßT܈§QN¢’¡¨§V¼(Üù*eÕ“”5T¨‹Âê¥FŒã½Dü[8'Ò¥a…Ú¶k7a *•›¼'Ò·\8¨ª\@\õ¢¦íq+DÙrmÎ…_ªæ»ŠÓœ¡¯’Ré9MÅ×D™lælffc+ŒÑ,ý™ÿ ¯þǤ=Å’Á7µ÷ÚÛ/“Ü€ñýã¼àí¾ÕÑ+ƒ,uµMâÀÄbm:ÒÎPæ{˜Gz[ƒ¯«® KHà`ߨŠéí¯P8Aq.C‰ à€kòpj´kN¶qô€…Õ,ÜNŠª-­{Zö’æû44‰sŽè‰îVíRœÕm" 6?³D9¡ÇTíÅꋇ`4«¸ÝÁô ï’ýorqКÇZ«x4Žâéþuïf¹µö[P ,Q£éaX±`PÉÍZ ¸äYúg üAx ’6Lê‚xÝÓ*äQ  Ï’¨hÍ =²,6ï#rÃ<¯–£»ƒ‹,–ê•€ aÛsñ'%Æ"®ÛüìBᝠHÚ3ß°©$“XnœÖ’î2ËTeûìxîß ¦å¿çÉ ðK§þ{‘t‚Ϋ¬jéîZ[ ”š7L¥4VÚCE×]m¤Øy”ä4-dz£œ§¸x.*ãÊÊ b÷•h:©‡¦s`BTÁRû¾g⻩‹jø sF¢àJøFl‘È•Xᓁà~*j¯ +(ÚÕ6-£¯÷GŠØy‚<Ç’.F‹Hœw(+)ÜÜâÈzÄäT§FߘãÏ;DmVœ3Àu@mÚüXÝü•3B¨òÌÁÛ<·ÃÜ z,Ì@õÅ·d2]ü8s÷IôÞ¯^Ç9¢u„~ëAŸï4«M? K]­ÅàPl@s_ p:°¬ZR”´›JC[CS.h‹ƒïËœ«Æ]–÷ó‚wR×k7X‰k›‘´ù¦=¡«‰¨¨Â')—71ó’c‡Ðúµ `é.{§p¹ój\Ž{1h{o±Ý=áUÊïGÖŒõ–-BÄm+AZX¶¡ ïHðæ¥JmÙ;…䡟ˆ¦ ° äšiÉg«$üMk5¤L“’çÊvïâï ,=f“"íἊ5ô¬x6{ɏžID0e¸vçmi'︧ºð9$ò¹÷*£’9ÿ ²TÔ…×>JV¥}Œ}$p[bÔ®*[jzS*8 ”·T›Í–ñUîƒwo$áè=LT™ç—~ô·¤ÈÚ$榍q‰„+´kFm)ž‹©i–ËqÞŠ‰à¶ü( ‚•§ •°ò·‡#5ª•µÊ﯅¡X¨šÁ*F#TXJÊ ušJVÍ&=iÄs1‚3•'fý§5Ñ<=[íÞ­ PÚ;ѱÌ_~Ä££8rÞ ²w;’hDT°>ÈG¬8Á²ÚzŽ®ò®qZcqJêäÞ-ö[ܘbň±çb“ж31²n×iƒðÕ;1¶þÉ ªX‰,ßqÏ$>•î íZ¥Z 1{ç൵+ƒÕµ¥°T$§K]á»Ûï*·¤tMI’ÂZbŽÕiÒ˜}bÓ0£ª5›¨ [5Ž^ÝœWøÂÝh° ¢OWun£¤5 a2Z.G2³YL]jåtì”ä ÁÓ‘%"©<Ôúʰsº UZvä‡ÄiÆÒM .÷V·™ø#kèýiíÌ–ª)µT[)BˆõÑ xB¾B€ÖT¨.¥~ð@VĶr#¸ü*åZNDŽH;âi ],©£öØpù(šºãö¼T.uCê•4@ÿ GÕÛ)Cx›®0ø#:ÏðFÒbR\(€€Ä®fã4Þ‰Fä¯HXƒÅ,†öEÑÔÜ]Öv²?tLÃvBY£ú6Êu5ÅAQ³1‘’¬x–HŒÐ‡ ^ ¸KwJôÖŽ5×CÚ¨vÜ«/B0$×k°=ðbÇ(Ï)w±A†Á† 11Í=èQšµ626ŒÜ/`G«µ<}—-Ö7KEHÈÉðóȤmݱû±·ø«Snmá=“䫚mݱŸ¡¶~ó·“äUóJæúòB|E LêŽy´jDÔ$G¢þÐñ7óR8ýÒ…Ç› WVe#·Ÿ p·Fx~•ݤF÷0Èÿ K¯æS<6’¡WШ; ´ÿ ¥Êø\Òuî†åÝ–VNœkÒ7oòX¨Á­Ø÷FÎÑä±g÷ÿ M~Çî=p,X´ ÝÌÚÅ‹’ÃjÖ.ØöÏñ qïQ¤ÓZE†° =6·]܈ s¸>v•Ž^Ý\wq9r‰Î\¸¡kURÒ$­*‹Nq?Þª*!sŠÆ:TU_u±T+øX¡ ®¹¡,ÄâÃBTsÜ$Ø›4m椴zÜK]’’›Pƒ @€#â˜`é¹=I‡fiV•Ôî“nRm+µFPOhÍ0B£ €+¬5c v•:P'ÒyÎ ‰V~‚Ó†ÖuókDoh$å\*ö%Ю=£«…aȼ½÷Û.-½VŒŠ¼'lyî±1¬3ó#ÞE¿ÔS¤gV£m›=§\û"—WU¤ÚǼÿ ÂnÁGŒÃ ‚õN D³õNÚíŒÕ;HôyÄÈ©P¹Ä{:?R‘Ô¨âF÷ø£bÅó® JS|‚R÷ivýáâ€Æé¡è³´IئÑT!§˜•ت‚¬â@q€wnïCWÄ@JU€ê¯m6]Ï:£âx'+ÒðXvÓ¦Úm=–´7œ $ì“B£~p%ÕŸUþ« N@¼üï~w˜ñø5®—'Ôe»¤5ã//€ž~‰Tþ›Å7•#¤× Íö pÄ$ùeåì*«ÓŠEØWEÈsßg ¦ûvžSsLpºÊW–âµEWöˬH; ™!CYõZ ÃÄf æ#1W. \uWâ\,\Çf j’<qTbên›Î[vxx£ë 'ö¨1›˜ÀM¼Pÿ H)ƒêêŒA7s,|F“ 꺸k³9Ìö*ç®;Ö!Ö$Eiž•¹ÒÚ†ýóéÝû¾ÕS®ó$’NÝäŸz¤5r¦ãÄÃD÷Üø!°ø‡Ô&@m™Ì^Ãä­d q5Lnÿ N;.6½·N|#ä"1Nƒx“ã<3('&ñßt  ~ªu”1Tb㫨9ê–›–bìd$ߣ=#ÕãÒmU¯eí$EFù5ýYô櫨æì™Ç—±ssM]·á¿0ÕåJRÓªîiƒ+O58ÖñªŠÒx" \µâá¨i’¤i —Ö ” M+M¤ë9‚‰A¦°Qõ¾ßøK~¼Ã‘g…Ö´~÷Ï[3GUœÒ½#…kàÔ®Ò”‰³·dWV‰IP‰Ú8u¹”E ÖqLj¾êÕCBš{A^Âß;–¨`¯¬ìö ˼ ×tìø.tƐm*n¨y4o&Àx¥n¦×î‡aupáÛj8¿m›è¶ã!o½;ß0y^ý×^EÑ¿ÒjzŒ­)vÚÑnÄL …^ªô× ‡—‚3k Îý­hï]içå–îÏ*÷ñþ»Ô CÒjøjÍznˆ´ ¹#b'Fô‹ ‰v¥'’à'T´ƒHýÍ%M‰ ƒ&ÆÇŒï1 ‘ –Þ ‰i¬s žR-Ÿ kЬá¬7:þ 0ŒÅÒÕ/aÙ¬ÃÝ#Úøœ ©aiVc‰. ¹¦ãµ” ›Yg¦›ÆÎýº°f³7ƒhá·¸­}&D9¡ÂsÉÙÞèŠõØàC™¨ñbFC|´Ü(ŸƒÚÒ-%»'a Ì¿)ËÇn¿úÿ ÞŽX…4ÊÅH^ôΑí@ù¹Eh¶“L8Çjù ¼ÎåVªóR©Ï5uà V4lZß®=€xÖŸ–ÑÈ ÷”¨°¾__yM1tÉ?uÆþIkÄgæ@þ[¢†°XÃJ£j·:nkÅ¢u ‘}âGzö­/IµèЬ¼48q¦F°ŽR¼=ûì{´¯RýicS ÕÛ íNtÍÙï£,w4rêì®»~x(©Uñ§#Ñ&œÕ¤>ÎåÍÓ9’Ö{9eV­[Öjâ²ãu]˜å2›qÑšÕJç0€sÄ|Êëè0튔bÁ>“{×_F`Ø©ºê:µä,v¤ðfc1±"«ÔÍän1#=· Âøv~H½ÐßA¾¿Ü€Óš]Õ; I¾÷ç‚Qi†î¹9ywÔKG˜áñ zQY—§ÃÕZ07§X‚ Áh;ÁM)iÌCH-¯T‘ë|A0{Ò½LÚ–TâÖkÜ’dÀ“rmm»”جPF³ÖcbE§T€ÒxKºû’Ó®7±²(\4ŽÃ¸Uu@j™yĵ;³µ!Á¢b.W¤=mõ´êµK k ¸K^ÜÛ#p*Ü14qkZç5ïë †°5Ï%ÍÛ<Õ¤×Ô¥ê†C Õ´¼ú$ƒÖ“”]Ù¬qÞÚ[4©ý!ûÏ—Áb쳐XµA¬â~`›Çr¸8ìùÝ䫦<>ä÷«?xs´ÇÑ /á;¹øüÊÈÙà{"@Žïzâ¬[âß‚ U_<ÇŸ½4èN˜ú61®qŠu ¦þF£»äJ_ˆÙÎ~ ÞAã–݄ϗrŠD;xTž‘ô`É«…suãO`?³à™ô Lý#Íc5öoæØ‚y´´÷«ZR§<&JÇ+éâô´€i!Àˆ0æAoàðLèÖ-2ŸõW.’t^–(KÁmHµV@xÜÇy®Ñø­â^:Ú3w· 7½¹°ñ¸â¹®:',«Mœ—n­Á+Ãbš LÈ‘ÄnRÓÅœ%¦²‰¨ùQ:¤f‚ "PÕtô¸…cæl…&˜Ú˜Ôkv‹ž+vŠ,=¢v­6—Xy*¥t£«<™:“aîϲ=¦6rO]XI¿Œ÷¤zÚ­›¶ 6÷”w\d ü~v®ˆÌk«^m<ÿ ¢‰Õ\)ùºŽ;… lîÙÅEŠ®cѾ@vnMÏ,¼“ñ•ŽBxðÃzãÇç%3ˆ"}Ù•Åî> BÉú;Ò]V+P˜F_´ßé> Øše|ï‡ÄOmFæÇ ãqÞ$/xÐx­z`ï9"œÜij‚!7.\Td…9M‡•iŽ‹¾‘50ÞŽn¥ß4ÉôO ¹*í^QêËÜÇÌ8=ާs‰'ÂëÙ«á%Pú[O †ÅP¯Vsް.‰,kc¶ ¬A9n˜XÎ-ÞšN["¹QÕ‰ƒMýÁߺXJæÍaLj¾×Ãmã¾ãÚ uñÒþåQô¦¥ /ÄUx:‚ÍÜ’ Đ©ØÝ3V¨‰ÕnÐ6ó*óúK­«…c ¯U òhsý­jóÔj#,ímŒRµ«lbïUTŒÑ8†Ä0œÏr`ð¡¬É Ї ë"À² ™ 6¥ f¶ ¢ÚoܱԷ-<Àî)†a¶ž'Ú»¨TXqØæ¶÷YÄHy˜9ÈIW­YÀuMFë ºÏ’AqÌ4·/Ú †ô'i$øä­=Ä Ý|öK×40è|È6p‘0§)o¥ctî§H+CA-“ xØ|ÐXАç l8íºð3Ø:³¤¬KX¯UÿÙ /* Script: mootree.js My Object Oriented Tree - Developed by Rasmus Schultz, - Tested with MooTools release 1.2, under Firefox 2, Opera 9 and Internet Explorer 6 and 7. License: MIT-style license. Credits: Inspired by: - WebFX xTree, - Destroydrop dTree, Changes: rev.12: - load() only worked once on the same node, fixed. - the script would sometimes try to get 'R' from the server, fixed. - the 'load' attribute is now supported in XML files (see example_5.html). rev.13: - enable() and disable() added - the adopt() and load() methods use these to improve performance by minimizing the number of visual updates. rev.14: - toggle() was using enable() and disable() which actually caused it to do extra work - fixed. rev.15: - adopt() now picks up 'href', 'target', 'title' and 'name' attributes of the a-tag, and stores them in the data object. - adopt() now picks up additional constructor arguments from embedded comments, e.g. icons, colors, etc. - documentation now generates properly with NaturalDocs, rev.16: - onClick events added to MooTreeControl and MooTreeNode - nodes can now have id's - method can be used to find a node with a given id rev.17: - changed icon rendering to use innerHTML, making the control faster (and code size slightly smaller). rev.18: - migrated to MooTools 1.2 (previous versions no longer supported) */ var MooTreeIcon = ['I','L','Lminus','Lplus','Rminus','Rplus','T','Tminus','Tplus','_closed','_doc','_open','minus','plus']; /* Class: MooTreeControl This class implements a tree control. Properties: root - returns the root object. selected - returns the currently selected object, or null if nothing is currently selected. Events: onExpand - called when a node is expanded or collapsed: function(node, state) - where node is the object that fired the event, and state is a boolean meaning true:expanded or false:collapsed. onSelect - called when a node is selected or deselected: function(node, state) - where node is the object that fired the event, and state is a boolean meaning true:selected or false:deselected. onClick - called when a node is clicked: function(node) - where node is the object that fired the event. Parameters: The constructor takes two object parameters: config and options. The first, config, contains global settings for the tree control - you can use the configuration options listed below. The second, options, should contain options for the constructor - please refer to the options listed in the documentation. Config: div - a string representing the div Element inside which to build the tree control. mode - optional string, defaults to 'files' - specifies default icon behavior. In 'files' mode, empty nodes have a document icon - whereas, in 'folders' mode, all nodes are displayed as folders (a'la explorer). grid - boolean, defaults to false. If set to true, a grid is drawn to outline the structure of the tree. theme - string, optional, defaults to 'mootree.gif' - specifies the 'theme' GIF to use. loader - optional, an options object for the constructor - defaults to {icon:'mootree_loader.gif', text:'Loading...', color:'a0a0a0'} onExpand - optional function (see Events above) onSelect - optional function (see Events above) */ var MooTreeControl = new Class({ initialize: function(config, options) { options.control = this; // make sure our new MooTreeNode knows who it's owner control is options.div = config.div; // tells the root node which div to insert itself into this.root = new MooTreeNode(options); // create the root node of this tree control this.index = new Object(); // used by the get() method this.enabled = true; // enable visual updates of the control this.theme = config.theme || 'mootree.gif'; this.loader = config.loader || {icon:'mootree_loader.gif', text:'Loading...', color:'#a0a0a0'}; this.selected = null; // set the currently selected node to nothing this.mode = config.mode; // mode can be "folders" or "files", and affects the default icons this.grid = config.grid; // grid can be turned on (true) or off (false) this.onExpand = config.onExpand || new Function(); // called when any node in the tree is expanded/collapsed this.onSelect = config.onSelect || new Function(); // called when any node in the tree is selected/deselected this.onClick = config.onClick || new Function(); // called when any node in the tree is clicked this.root.update(true); }, /* Property: insert Creates a new node under the root node of this tree. Parameters: options - an object containing the same options available to the constructor. Returns: A new instance. */ insert: function(options) { options.control = this; return this.root.insert(options); }, /* Property: select Sets the currently selected node. This is called by when a node is selected (e.g. by clicking it's title with the mouse). Parameters: node - the object to select. */ select: function(node) { this.onClick(node); node.onClick(); // fire click events if (this.selected === node) return; // already selected if (this.selected) { // deselect previously selected node: this.selected.select(false); this.onSelect(this.selected, false); } // select new node: this.selected = node; node.select(true); this.onSelect(node, true); }, /* Property: expand Expands the entire tree, recursively. */ expand: function() { this.root.toggle(true, true); }, /* Property: collapse Collapses the entire tree, recursively. */ collapse: function() { this.root.toggle(true, false); }, /* Property: get Retrieves the node with the given id - or null, if no node with the given id exists. Parameters: id - a string, the id of the node you wish to retrieve. Note: Node id can be assigned via the constructor, e.g. using the method. */ get: function(id) { return this.index[id] || null; }, /* Property: adopt Adopts a structure of nested ul/li/a elements as tree nodes, then removes the original elements. Parameters: id - a string representing the ul element to be adopted, or an element reference. parentNode - optional, a object under which to import the specified ul element. Defaults to the root node of the parent control. Note: The ul/li structure must be properly nested, and each li-element must contain one a-element, e.g.: > The "href", "target", "title" and "name" attributes of the a-tags are picked up and stored in the data property of the node. CSS-style comments inside a-tags are parsed, and treated as arguments for constructor, e.g. "icon", "openicon", "color", etc. */ adopt: function(id, parentNode) { if (parentNode === undefined) parentNode = this.root; this.disable(); this._adopt(id, parentNode); parentNode.update(true); document.id(id).destroy(); this.enable(); }, _adopt: function(id, parentNode) { /* adopts a structure of ul/li elements into this tree */ e = document.id(id); var i=0, c = e.getChildren(); for (i=0; i to turn on visual updates again, and automatically repaint all nodes that were changed. */ disable: function() { this.enabled = false; }, /* Property: enable Enables visual updates again after a call to */ enable: function() { this.enabled = true; this.root.update(true, true); } }); /* Class: MooTreeNode This class implements the functionality of a single node in a . Note: You should not manually create objects of this class -- rather, you should use to create nodes in the root of the tree, and then use the similar function to create subnodes. Both insert methods have a similar syntax, and both return the newly created object. Parameters: options - an object. See options below. Options: text - this is the displayed text of the node, and as such as is the only required parameter. id - string, optional - if specified, must be a unique node identifier. Nodes with id can be retrieved using the method. color - string, optional - if specified, must be a six-digit hexadecimal RGB color code. open - boolean value, defaults to false. Use true if you want the node open from the start. icon - use this to customize the icon of the node. The following predefined values may be used: '_open', '_closed' and '_doc'. Alternatively, specify the URL of a GIF or PNG image to use - this should be exactly 18x18 pixels in size. If you have a strip of images, you can specify an image number (e.g. 'my_icons.gif#4' for icon number 4). openicon - use this to customize the icon of the node when it's open. data - an object containing whatever data you wish to associate with this node (such as an url and/or an id, etc.) Events: onExpand - called when the node is expanded or collapsed: function(state) - where state is a boolean meaning true:expanded or false:collapsed. onSelect - called when the node is selected or deselected: function(state) - where state is a boolean meaning true:selected or false:deselected. onClick - called when the node is clicked (no arguments). */ var MooTreeNode = new Class({ initialize: function(options) { this.text = options.text; // the text displayed by this node this.id = options.id || null; // the node's unique id this.nodes = new Array(); // subnodes nested beneath this node (MooTreeNode objects) this.parent = null; // this node's parent node (another MooTreeNode object) this.last = true; // a flag telling whether this node is the last (bottom) node of it's parent this.control = options.control; // owner control of this node's tree this.selected = false; // a flag telling whether this node is the currently selected node in it's tree this.color = options.color || null; // text color of this node this.data = options.data || {}; // optional object containing whatever data you wish to associate with the node (typically an url or an id) this.onExpand = options.onExpand || new Function(); // called when the individual node is expanded/collapsed this.onSelect = options.onSelect || new Function(); // called when the individual node is selected/deselected this.onClick = options.onClick || new Function(); // called when the individual node is clicked this.open = options.open ? true : false; // flag: node open or closed? this.icon = options.icon; this.openicon = options.openicon || this.icon; // add the node to the control's node index: if (this.id) this.control.index[this.id] = this; // create the necessary divs: this.div = { main: new Element('div').addClass('mooTree_node'), indent: new Element('div'), gadget: new Element('div'), icon: new Element('div'), text: new Element('div').addClass('mooTree_text'), sub: new Element('div') } // put the other divs under the main div: this.div.main.adopt(this.div.indent); this.div.main.adopt(this.div.gadget); this.div.main.adopt(this.div.icon); this.div.main.adopt(this.div.text); // put the main and sub divs in the specified parent div: document.id(options.div).adopt(this.div.main); document.id(options.div).adopt(this.div.sub); // attach event handler to gadget: this.div.gadget._node = this; this.div.gadget.onclick = this.div.gadget.ondblclick = function() { this._node.toggle(); } // attach event handler to icon/text: this.div.icon._node = this.div.text._node = this; this.div.icon.onclick = this.div.icon.ondblclick = this.div.text.onclick = this.div.text.ondblclick = function() { this._node.control.select(this._node); } }, /* Property: insert Creates a new node, nested inside this one. Parameters: options - an object containing the same options available to the constructor. Returns: A new instance. */ insert: function(options) { // set the parent div and create the node: options.div = this.div.sub; options.control = this.control; var node = new MooTreeNode(options); // set the new node's parent: node.parent = this; // mark this node's last node as no longer being the last, then add the new last node: var n = this.nodes; if (n.length) n[n.length-1].last = false; n.push(node); // repaint the new node: node.update(); // repaint the new node's parent (this node): if (n.length == 1) this.update(); // recursively repaint the new node's previous sibling node: if (n.length > 1) n[n.length-2].update(true); return node; }, /* Property: remove Removes this node, and all of it's child nodes. If you want to remove all the childnodes without removing the node itself, use */ remove: function() { var p = this.parent; this._remove(); p.update(true); }, _remove: function() { // recursively remove this node's subnodes: var n = this.nodes; while (n.length) n[n.length-1]._remove(); // remove the node id from the control's index: delete this.control.index[this.id]; // remove this node's divs: this.div.main.destroy(); this.div.sub.destroy(); if (this.parent) { // remove this node from the parent's collection of nodes: var p = this.parent.nodes; p.erase(this); // in case we removed the parent's last node, flag it's current last node as being the last: if (p.length) p[p.length-1].last = true; } }, /* Property: clear Removes all child nodes under this node, without removing the node itself. To remove all nodes including this one, use */ clear: function() { this.control.disable(); while (this.nodes.length) this.nodes[this.nodes.length-1].remove(); this.control.enable(); }, /* Property: update Update the tree node's visual appearance. Parameters: recursive - boolean, defaults to false. If true, recursively updates all nodes beneath this one. invalidated - boolean, defaults to false. If true, updates only nodes that have been invalidated while the control has been disabled. */ update: function(recursive, invalidated) { var draw = true; if (!this.control.enabled) { // control is currently disabled, so we don't do any visual updates this.invalidated = true; draw = false; } if (invalidated) { if (!this.invalidated) { draw = false; // this one is still valid, don't draw } else { this.invalidated = false; // we're drawing this item now } } if (draw) { var x; // make selected, or not: this.div.main.className = 'mooTree_node' + (this.selected ? ' mooTree_selected' : ''); // update indentations: var p = this, i = ''; while (p.parent) { p = p.parent; i = this.getImg(p.last || !this.control.grid ? '' : 'I') + i; } this.div.indent.innerHTML = i; // update the text: x = this.div.text; x.empty(); x.appendText(this.text); if (this.color) x.style.color = this.color; // update the icon: this.div.icon.innerHTML = this.getImg( this.nodes.length ? ( this.open ? (this.openicon || this.icon || '_open') : (this.icon || '_closed') ) : ( this.icon || (this.control.mode == 'folders' ? '_closed' : '_doc') ) ); // update the plus/minus gadget: this.div.gadget.innerHTML = this.getImg( ( this.control.grid ? ( this.control.root == this ? (this.nodes.length ? 'R' : '') : (this.last?'L':'T') ) : '') + (this.nodes.length ? (this.open?'minus':'plus') : '') ); // show/hide subnodes: this.div.sub.style.display = this.open ? 'block' : 'none'; } // if recursively updating, update all child nodes: if (recursive) this.nodes.forEach( function(node) { node.update(true, invalidated); }); }, /* Property: getImg Creates a new image, in the form of HTML for a DIV element with appropriate style. You should not need to manually call this method. (though if for some reason you want to, you can) Parameters: name - the name of new image to create, defined by or located in an external file. Returns: The HTML for a new div Element. */ getImg: function(name) { var html = '
when the selection changes. You should not manually call this method - to set the selection, use the method. */ select: function(state) { this.selected = state; this.update(); this.onSelect(state); }, /* Property: load Asynchronously load an XML structure into a node of this tree. Parameters: url - string, required, specifies the URL from which to load the XML document. vars - query string, optional. */ load: function(url, vars) { if (this.loading) return; // if this node is already loading, return this.loading = true; // flag this node as loading this.toggle(false, true); // expand the node to make the loader visible this.clear(); this.insert(this.control.loader); var f = function() { new Request({ method: 'GET', url: url, onSuccess: this._loaded.bind(this), onFailure: this._load_err.bind(this) }).send(vars || ''); }.bind(this).delay(20); //window.setTimeout(f.bind(this), 20); // allowing a small delay for the browser to draw the loader-icon. }, _loaded: function(text, xml) { // called on success - import nodes from the root element: this.control.disable(); this.clear(); this._import(xml.documentElement); this.control.enable(); this.loading = false; }, _import: function(e) { // import childnodes from an xml element: var n = e.childNodes; for (var i=0; i