Changeset 2672 for package_branches
- Timestamp:
- Dec 20, 2009, 9:44:26 PM (15 years ago)
- Location:
- package_branches/invirt-web/cherrypy-rebased/code
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy-rebased/code/main.py
r2670 r2672 94 94 checkpoint = Checkpoint() 95 95 96 def jquote(string):97 return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'"98 99 def helppopup(subj):100 """Return HTML code for a (?) link to a specified help topic"""101 return ('<span class="helplink"><a href="help?' +102 cgi.escape(urllib.urlencode(dict(subject=subj, simple='true')))103 +'" target="_blank" ' +104 'onclick="return helppopup(' + cgi.escape(jquote(subj)) + ')">(?)</a></span>')105 106 96 def makeErrorPre(old, addition): 107 97 if addition is None: … … 114 104 Template.database = database 115 105 Template.config = config 116 Template.helppopup = staticmethod(helppopup)117 106 Template.err = None 118 107 -
package_branches/invirt-web/cherrypy-rebased/code/templates/functions.mako
r2667 r2672 40 40 % endif 41 41 </%def> 42 43 <%! 44 def jquote(string): 45 return "'" + string.replace('\\', '\\\\').replace("'", "\\'").replace('\n', '\\n') + "'" 46 %> 47 48 <%def name="helppopup(subj)"> 49 ## Return HTML code for a (?) link to a specified help topic 50 <span class="helplink"><a href="help?simple=true;subject=${subj | u}" target="_blank" onclick="return helppopup(${subj | u,jquote})">(?)</a></span> 51 </%def>
Note: See TracChangeset
for help on using the changeset viewer.