#10398 closed defect (fixed)
auto_preview_timeout has no effect
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0 |
Component: | ticket system | Version: | 0.13dev |
Severity: | normal | Keywords: | bitesized |
Cc: | Branch: | ||
Release Notes: |
When creating a new ticket, only show the preview after the first modification. |
||
API Changes: | |||
Internal Changes: |
Description
Using Trac 0.13dev-r10801 option auto_preview_timeout
has no effect. I set it as following
auto_preview_timeout = 0.0
but when creating a new ticket a preview is always shown. But I don't want an auto-preview.
Attachments (1)
Change History (12)
follow-up: 2 comment:1 by , 13 years ago
Milestone: | 0.13 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
follow-up: 4 comment:2 by , 13 years ago
Replying to rblank:
Works fine here, with the same version. Did you set the option in the
[trac]
section?
Yes I set the option in [trac]
section.
I debugged following Javascript code and the Firebug shows the correct value for auto_preview_timeout
(0).
$.fn.autoSubmit = function(args, update, busy) { if (this.length == 0 || auto_preview_timeout <= 0) return this; ... }
The strange thing is that it only appears, when I create a new ticket, but when I edit an existing ticket, I get no preview.
Do you have any hint, why this effect does appear? Could it be any plugin? (Yet I search all plugins with string auto_preview_timeout
, but haven't found anything).
comment:3 by , 13 years ago
It seems that trac sends the preview page already with the very first GET newticket
. So in the HTTP response in Firebug I see following HTML:
<div id="ticket" class="ticketdraft"> <div class="date"> <p><span class="trac-loading"></span><i>(Ticket noch nicht erstellt)</i></p>
follow-up: 5 comment:4 by , 13 years ago
Component: | general → ticket system |
---|---|
Keywords: | bitesized added |
Milestone: | → 0.12.3 |
Replying to franz.mayer@…:
The strange thing is that it only appears, when I create a new ticket, but when I edit an existing ticket, I get no preview.
Ah, now I see what you mean. You don't actually have an auto-preview, you just have the preview of the "empty" ticket. That must be a simple error in the template. I'll look into it, but feel free to beat me to it :)
comment:5 by , 13 years ago
Replying to rblank:
Ah, now I see what you mean. You don't actually have an auto-preview, you just have the preview of the "empty" ticket. That must be a simple error in the template. I'll look into it, but feel free to beat me to it :)
I uploaded a possible patch … maybe putting auto_preview_timeout
into req.args
isn't that nice, but it works (and I don't want to mess Trac, so I tried to change as little as possible).
comment:6 by , 13 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
No, req.args
is indeed not the place to do that. I'm not sure yet, but I think the style of the preview box should be set to display: none
if this is the first time the page is shown (i.e. not after hitting "Preview") and it should be shown with JavaScript on page load if auto_preveiw_timeout
is non-zero.
(Forgot to reopen.)
comment:8 by , 13 years ago
I had a little bug in my patch. When hitting the preview button for a new ticket, the preview didn't work anymore.
Here's the diff for the fix:
-
(a) old vs. (b) new
a b 369 <xi:include href="ticket_box.html" py:if=" not ticket.exists and auto_preview_timeout > 0" py:with="preview_mode = True"/>369 <xi:include href="ticket_box.html" py:if="(not ticket.exists and auto_preview_timeout > 0) or preview_mode == True" py:with="preview_mode = True"/>
comment:9 by , 12 years ago
Owner: | set to |
---|---|
Status: | reopened → new |
comment:10 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in [11060]. The preview is now hidden until the user makes her first change. With auto-preview, that's as soon as she edits a field. Without, it's when hitting the "Preview" button.
comment:11 by , 12 years ago
Release Notes: | modified (diff) |
---|
Works fine here, with the same version. Did you set the option in the
[trac]
section?