Edgewall Software
Modify

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#10398 closed defect (fixed)

auto_preview_timeout has no effect

Reported by: franz.mayer@… 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)

ticket_10398.patch (1.3 KB ) - added by franz.mayer@… 9 years ago.
possible patch for this ticket

Download all attachments as: .zip

Change History (12)

comment:1 by Remy Blank, 9 years ago

Milestone: 0.13
Resolution: worksforme
Status: newclosed

Works fine here, with the same version. Did you set the option in the [trac] section?

in reply to:  1 ; comment:2 by franz.mayer@…, 9 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 franz.mayer@…, 9 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>

in reply to:  2 ; comment:4 by Remy Blank, 9 years ago

Component: generalticket 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 :)

by franz.mayer@…, 9 years ago

Attachment: ticket_10398.patch added

possible patch for this ticket

in reply to:  4 comment:5 by franz.mayer@…, 9 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 Remy Blank, 9 years ago

Resolution: worksforme
Status: closedreopened

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:7 by Remy Blank, 9 years ago

Milestone: 0.12.30.13

This is actually 0.13-specific.

comment:8 by franz.mayer@…, 9 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 Remy Blank, 8 years ago

Owner: set to Remy Blank
Status: reopenednew

comment:10 by Remy Blank, 8 years ago

Resolution: fixed
Status: newclosed

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 Christian Boos, 8 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.