Changing tree icon colors
My site uses the chocolate style sheet from w3.org and as such is fairly dark. I was wondering if there is a way to force the + and - symbols on trees to be a different color (ie. white) Thanks, Jeff 7/5/99 3:54:54 PM [ Jeff Clement / BlueSine Consulting] email: jeff@bluesine.tj web: www.bluesine.tj cell: 403.850.9180
At 23:56 05/07/99 , Jeff Clement wrote:
My site uses the chocolate style sheet from w3.org and as such is fairly dark. I was wondering if there is a way to force the + and - symbols on trees to be a different color (ie. white)
Nope, you can't. We're stuck with the default GIF images. I have seen in the source of the #tree tag, the beginnings of code to allow specification of URLs of your own images to replace the defaults. You could always finish that off, and supply a patch of course =). -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
On Tue, 6 Jul 1999, Martijn Pieters wrote:
At 23:56 05/07/99 , Jeff Clement wrote:
My site uses the chocolate style sheet from w3.org and as such is fairly dark. I was wondering if there is a way to force the + and - symbols on trees to be a different color (ie. white)
Nope, you can't. We're stuck with the default GIF images.
I have seen in the source of the #tree tag, the beginnings of code to allow specification of URLs of your own images to replace the defaults. You could always finish that off, and supply a patch of course =).
Martijn, I'd like to see that patch... I've been thinking about doing just this thing. I created a myTree product just to change the icons, which seems silly. I'd rather have the original treetag do this. Thanks, --- John Eikenberry [jae@kavi.com - http://taos.kavi.com/~jae/] ______________________________________________________________ "A society that will trade a little liberty for a little order will deserve neither and lose both." --B. Franklin
On Tue, 6 Jul 1999, Martijn Pieters wrote:
At 23:56 05/07/99 , Jeff Clement wrote:
My site uses the chocolate style sheet from w3.org and as such is fairly dark. I was wondering if there is a way to force the + and - symbols on trees to be a different color (ie. white)
Nope, you can't. We're stuck with the default GIF images.
I have seen in the source of the #tree tag, the beginnings of code to allow specification of URLs of your own images to replace the defaults. You could always finish that off, and supply a patch of course =).
Martijn, I'd like to see that patch... I've been thinking about doing just this thing. I created a myTree product just to change the icons, which seems silly. I'd rather have the original treetag do this.
John Eikenberry
I don't want to be a PITA - but, me too. I implemented an SQL-based dynamic tree tag DTML instance based on the 'good stuff' from Phillip Eby et al - one of my users found the totally unreleased 'beta' site where I had it running and (after saying how cool it was) then reeled off a list of cosmetic changes that he wanted doing (open & closed book icons, differently emphasised text for the 'active' leaf etc.) sheesh! ...users. And before anyone says 'you do it' - I can't...yet. I'm not revved up enough on Python methods etc. to do it yet, but considering I'm basing our 3-year project on Zope, as they used to say in 'StingRay' "anything can happen in the next half hour!" tone. ps our site is http://nle.ncl.ac.uk/ - navigate to the demo area and click on the 'database driven' section to see the SQL menu stuff in action.
At 00:34 07/07/99 , Tony.McDonald@newcastle.ac.uk wrote:
Martijn, I'd like to see that patch... I've been thinking about doing just this thing. I created a myTree product just to change the icons, which seems silly. I'd rather have the original treetag do this.
John Eikenberry
I don't want to be a PITA - but, me too. I implemented an SQL-based dynamic tree tag DTML instance based on the 'good stuff' from Phillip Eby et al - one of my users found the totally unreleased 'beta' site where I had it running and (after saying how cool it was) then reeled off a list of cosmetic changes that he wanted doing (open & closed book icons, differently emphasised text for the 'active' leaf etc.) sheesh! ...users.
Okay, here goes: This is a context diff to patch the TreeTag.py file (in lib/python/TreeDisplay), so it supports the opened_decoration and closed_decoration attributes of the tree tag. With this patch applied, you can specify the URL of images to replace the minus (for open branches) and the plus symbol (for closed branches). The URL of each image will be prepended by SCRIPT_NAME. Example: <!--#tree opened_decoration="/HelpSys/hs_obook" closed_decoration="/HelpSys/hs_cbook"--> Here the plus and minus symbols are replaced by the help system opened and closed book icons. Note that I did not implement the 'childless_decoration' attribute. This is a quick patch... PS: DC, I'll post a patch for the current CVS version to the Collector. *** TreeTag.py 1999/06/11 15:56:34 1.29.2.1 --- TreeTag.py 1999/07/07 08:45:05 *************** *** 99,104 **** --- 99,107 ---- tplus=tbl[:ord('+')]+'-'+tbl[ord('+')+1:] tminus=tbl[:ord('-')]+'+'+tbl[ord('-')+1:] + plus_icon = '/p_/pl' + minus_icon = '/p_/mi' + class Tree: name='tree' blockContinuations=() *************** *** 112,120 **** branches=None, branches_expr=None, sort=None, reverse=1, skip_unauthorized=1, id=None, single=1, url=None, ! # opened_decoration=None, ! # closed_decoration=None, ! # childless_decoration=None, assume_children=1) has_key=args.has_key --- 115,122 ---- branches=None, branches_expr=None, sort=None, reverse=1, skip_unauthorized=1, id=None, single=1, url=None, ! opened_decoration=None, ! closed_decoration=None, assume_children=1) has_key=args.has_key *************** *** 132,139 **** if not has_key('id'): args['id']='tpId' if not has_key('url'): args['url']='tpURL' ! if not has_key('childless_decoration'): ! args['childless_decoration']='' self.__name__ = name self.section=section.blocks --- 134,143 ---- if not has_key('id'): args['id']='tpId' if not has_key('url'): args['url']='tpURL' ! if not has_key('opened_decoration'): ! args['opened_decoration']=minus_icon ! if not has_key('closed_decoration'): ! args['closed_decoration']=plus_icon self.__name__ = name self.section=section.blocks *************** *** 377,391 **** script=md['SCRIPT_NAME'] if exp: treeData['tree-item-expanded']=1 output('<A NAME="%s">' '<A HREF="%s?tree-c=%s#%s">' ! '<IMG SRC="%s/p_/mi" BORDER=0></A></A>' % ! (id, root_url, s, id, script)) else: output('<A NAME="%s">' '<A HREF="%s?tree-e=%s#%s">' ! '<IMG SRC="%s/p_/pl" BORDER=0></A></A>' % ! (id, root_url, s, id, script)) output('</TD>\n') else: --- 378,398 ---- script=md['SCRIPT_NAME'] if exp: treeData['tree-item-expanded']=1 + if have_arg('opened_decoration'): + icon=args['opened_decoration'] + else: icon=minus_icon output('<A NAME="%s">' '<A HREF="%s?tree-c=%s#%s">' ! '<IMG SRC="%s%s" BORDER=0></A></A>' % ! (id, root_url, s, id, script, icon)) else: + if have_arg('closed_decoration'): + icon=args['closed_decoration'] + else: icon=plus_icon output('<A NAME="%s">' '<A HREF="%s?tree-e=%s#%s">' ! '<IMG SRC="%s%s" BORDER=0></A></A>' % ! (id, root_url, s, id, script, icon)) output('</TD>\n') else: *************** *** 648,656 **** return r - #icoSpace='<IMG SRC="Blank_icon" BORDER="0">' - #icoPlus ='<IMG SRC="Plus_icon" BORDER="0">' - #icoMinus='<IMG SRC="Minus_icon" BORDER="0">' --- 655,660 ---- -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
Note that I did not implement the 'childless_decoration' attribute. This is a quick patch...
I used my lunchbreak to add this as well, because it looked ugly without: Example: <!--#tree opened_decoration="/HelpSys/hs_obook" closed_decoration="/HelpSys/hs_cbook" childless_decoration="/HelpSys/hs_dnode"--> Here the plus and minus symbols are replaced by the help system opened and closed book icons. Nodes without children are displayed with the helpsystem document icon. This is a new patch, _replacing_ the previous one I posted (you did keep a copy of the old version, didn't you?). Again, I'll post this patch to the Collector. Patch against 1.10.3: *** TreeTag.py Wed Jul 7 13:22:59 1999 --- TreeTag.py Wed Jul 7 13:23:30 1999 *************** *** 99,104 **** --- 99,107 ---- tplus=tbl[:ord('+')]+'-'+tbl[ord('+')+1:] tminus=tbl[:ord('-')]+'+'+tbl[ord('-')+1:] + plus_icon = '/p_/pl' + minus_icon = '/p_/mi' + class Tree: name='tree' blockContinuations=() *************** *** 112,120 **** branches=None, branches_expr=None, sort=None, reverse=1, skip_unauthorized=1, id=None, single=1, url=None, ! # opened_decoration=None, ! # closed_decoration=None, ! # childless_decoration=None, assume_children=1) has_key=args.has_key --- 115,123 ---- branches=None, branches_expr=None, sort=None, reverse=1, skip_unauthorized=1, id=None, single=1, url=None, ! opened_decoration=None, ! closed_decoration=None, ! childless_decoration=None, assume_children=1) has_key=args.has_key *************** *** 132,137 **** --- 135,144 ---- if not has_key('id'): args['id']='tpId' if not has_key('url'): args['url']='tpURL' + if not has_key('opened_decoration'): + args['opened_decoration']=minus_icon + if not has_key('closed_decoration'): + args['closed_decoration']=plus_icon if not has_key('childless_decoration'): args['childless_decoration']='' *************** *** 377,397 **** script=md['SCRIPT_NAME'] if exp: treeData['tree-item-expanded']=1 output('<A NAME="%s">' '<A HREF="%s?tree-c=%s#%s">' ! '<IMG SRC="%s/p_/mi" BORDER=0></A></A>' % ! (id, root_url, s, id, script)) else: output('<A NAME="%s">' '<A HREF="%s?tree-e=%s#%s">' ! '<IMG SRC="%s/p_/pl" BORDER=0></A></A>' % ! (id, root_url, s, id, script)) output('</TD>\n') else: if level > 2: output('<TD COLSPAN="%s"></TD>' % level) elif level > 0: output('<TD></TD>' * level) ! output('<TD WIDTH="16"></TD>\n') # add item text --- 385,415 ---- script=md['SCRIPT_NAME'] if exp: treeData['tree-item-expanded']=1 + if have_arg('opened_decoration'): + icon=args['opened_decoration'] + else: icon=minus_icon output('<A NAME="%s">' '<A HREF="%s?tree-c=%s#%s">' ! '<IMG SRC="%s%s" BORDER=0></A></A>' % ! (id, root_url, s, id, script, icon)) else: + if have_arg('closed_decoration'): + icon=args['closed_decoration'] + else: icon=plus_icon output('<A NAME="%s">' '<A HREF="%s?tree-e=%s#%s">' ! '<IMG SRC="%s%s" BORDER=0></A></A>' % ! (id, root_url, s, id, script, icon)) output('</TD>\n') else: if level > 2: output('<TD COLSPAN="%s"></TD>' % level) elif level > 0: output('<TD></TD>' * level) ! if have_arg('childless_decoration') and args['childless_decoration']: ! output('<TD WIDTH="16"><IMG SRC="%s%s"></TD>\n' % ! (md['SCRIPT_NAME'], args['childless_decoration'])) ! else: ! output('<TD WIDTH="16"></TD>\n') # add item text *************** *** 648,656 **** return r - #icoSpace='<IMG SRC="Blank_icon" BORDER="0">' - #icoPlus ='<IMG SRC="Plus_icon" BORDER="0">' - #icoMinus='<IMG SRC="Minus_icon" BORDER="0">' --- 666,671 ---- -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
participants (4)
-
Jeff Clement -
John Eikenberry -
Martijn Pieters -
Tony.McDonald@newcastle.ac.uk