Changeset 4725
- Timestamp:
- Nov 3, 2008, 4:34:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sectioneditplugin/0.11/tracsectionedit/web_ui.py
r4724 r4725 39 39 if len(section_text) > 0 and section_text[-1] != '\n': 40 40 section_text += '\n' 41 if len(req.args['section_pre']) > 0 and req.args['section_pre'][-1] != '\n': 42 section_text = '\n' + section_text 41 43 req.args['section_text'] = req.args.get('text') 42 44 req.args['text'] = "%s%s%s"%(req.args.get('section_pre'), … … 52 54 # ITemplateStreamFilter methods 53 55 def filter_stream(self, req, method, filename, stream, data): 54 if filename == 'wiki_edit.html' and 'section' in req.args :56 if filename == 'wiki_edit.html' and 'section' in req.args and 'merge' not in req.args: 55 57 if 'section_text' in req.args: 56 58 section_pre, section_text, section_post = req.args.get('section_pre'), req.args.get('section_text'), req.args.get('section_post') 57 59 else: 58 60 section_pre, section_text, section_post = self._split_page_text(data['page'].text, req.args['section']) 61 section_text = ''.join(section_text) 59 62 60 63 section_element = html.input(type='hidden', name='section', id='section', value=req.args.get('section')) … … 63 66 64 67 section_html = html(section_element, pre_element, post_element) 65 stream = stream | Transformer('//textarea[@name="text"]').empty().append( ''.join(section_text)).before(section_html)66 stream = stream | Transformer('//div[@id="content"]//h1').append("/%s (section %s)"%(section_text[ 0].strip('= '), req.args['section']))68 stream = stream | Transformer('//textarea[@name="text"]').empty().append(section_text).before(section_html) 69 stream = stream | Transformer('//div[@id="content"]//h1').append("/%s (section %s)"%(section_text[:section_text.find('\n')].strip(" = \r\n"), req.args['section'])) 67 70 return stream 68 71
Note: See TracChangeset
for help on using the changeset viewer.