Opened 17 years ago
Last modified 6 years ago
#4970 new enhancement
Jump to edited section after edit
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | normal | Component: | SectionEditPlugin |
| Severity: | normal | Keywords: | |
| Cc: | Steffen Hoffmann | Trac Release: | 0.11 |
Description
When I edit a section of a large Article, it would be nice to see the browser jump to that section's heading after I hit the Save button. If for any reason this behavior was not wanted, it could maybe be toggled by a checkbox near that button.
I'm using SectionEditPlugin 0.1 on Trac 0.11.4, Ubuntu Hardy 8.4.2 Server, Opera 9.64 Browser.
Attachments (2)
Change History (17)
comment:1 Changed 16 years ago by
| Cc: | Ryan J Ollos added; anonymous removed |
|---|
comment:2 Changed 14 years ago by
| Cc: | Steffen Hoffmann added |
|---|
comment:3 Changed 14 years ago by
comment:4 Changed 14 years ago by
| Owner: | changed from Catalin BALAN to Ryan J Ollos |
|---|---|
| Status: | new → assigned |
comment:5 Changed 14 years ago by
| Summary: | Jump to edited section after edit → [Patch] Jump to edited section after edit |
|---|
comment:6 Changed 14 years ago by
Well, this patch is no good because it does a redirect in pre_process_request and therefore the change doesn't get saved. It seems like the redirect needs to be done in post_process_request, however, I can't find a way to retrieve req.args['anchor'] in post_process_request, and I don't see a way to pass the value from pre_process_request to post_process_request. I spent about 5 hours on this, so I'm pretty much stuck at this point. It's possible the plugin needs some major redesign in order to implement this feature.
comment:8 Changed 14 years ago by
| Owner: | changed from Ryan J Ollos to Catalin BALAN |
|---|---|
| Status: | assigned → new |
| Summary: | [Patch] Jump to edited section after edit → Jump to edited section after edit |
I'm stuck on this after about 8 hours of effort and experimentation. Maybe someone will come along and help me out? ;) Otherwise, I'm moving on for now ...
Changed 12 years ago by
Changed 12 years ago by
| Attachment: | tracsectionedit.js added |
|---|
comment:12 Changed 12 years ago by
| Owner: | changed from Catalin BALAN to Ryan J Ollos |
|---|---|
| Status: | new → accepted |
comment:14 Changed 9 years ago by
| Owner: | Ryan J Ollos deleted |
|---|
comment:15 Changed 6 years ago by
| Cc: | Ryan J Ollos removed |
|---|



Let me prefix this by saying I absolutely don't know what I'm doing here, but I hacked around with this enough to get the following patch working.
The changes are:
filter_stream, I followed the pattern of inserting a hidden html element, by adding the anchor name as a hidden element.pre_process_request, I get the anchor name and use that to construct a redirect, as is done for Trac tickets after a comment is posted. See web_ui.py in Trac 0.12 for reference.I'm particularly unsure of step (2) Maybe there is a better way? Any help and suggestions would be greatly appreciated!!
Patch against [11180].
0.12/tracsectionedit/htdocs/js/tracsectionedit.js
0.12/tracsectionedit/web_ui.py
)