[Epydoc-commits] SF.net SVN: epydoc: [1626] trunk/epydoc/src/epydoc/docwriter/html.py
Brought to you by:
edloper
From: <ed...@us...> - 2007-09-24 00:34:01
|
Revision: 1626 http://epydoc.svn.sourceforge.net/epydoc/?rev=1626&view=rev Author: edloper Date: 2007-09-23 17:33:58 -0700 (Sun, 23 Sep 2007) Log Message: ----------- - fixed sf bug [ 1675832 ] minor troubles with python properties in Html output -- links to private objects now include 'onclick="show_private()"', which shows private objects. (E.g., for property fget/fset/fdel functions) Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-23 19:44:06 UTC (rev 1625) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2007-09-24 00:33:58 UTC (rev 1626) @@ -1416,6 +1416,7 @@ def write_javascript(self, directory): jsfile = open(os.path.join(directory, 'epydoc.js'), 'w') print >> jsfile, self.TOGGLE_PRIVATE_JS + print >> jsfile, self.SHOW_PRIVATE_JS print >> jsfile, self.GET_COOKIE_JS print >> jsfile, self.SET_FRAME_JS print >> jsfile, self.HIDE_PRIVATE_JS @@ -1532,6 +1533,19 @@ } '''.strip() + SHOW_PRIVATE_JS = ''' + function show_private() { + var elts = document.getElementsByTagName("a"); + for(var i=0; i<elts.length; i++) { + if (elts[i].className == "privatelink") { + cmd = elts[i].innerHTML; + if (cmd && cmd.substr(0,4)=="show") + toggle_private(); + } + } + } + '''.strip() + GET_ANCHOR_JS = ''' function get_anchor() { var href = location.href; @@ -1744,10 +1758,9 @@ // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. - checkCookie() + checkCookie(); // --> </script> - </body> </html> ''') @@ -3258,8 +3271,15 @@ else: css = ' class="%s"' % css_class - return '<a href="%s"%s>%s</a>' % (url, css, label) + onclick = '' + if ((isinstance(target, VariableDoc) and not target.is_public) or + (isinstance(target, ValueDoc) and + not isinstance(target, GenericValueDoc) and + not self._val_is_public(target))): + onclick = ' onclick="show_private();"' + return '<a href="%s"%s%s>%s</a>' % (url, css, onclick, label) + def _attr_to_html(self, attr, api_doc, indent): if api_doc in (None, UNKNOWN): return '' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |