Edgewall Software
Modify

Opened 5 months ago

Closed 5 months ago

#13760 closed defect (fixed)

threaded_comments.js should be added using add_script rather than directly from ticket.html

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.6.1
Component: ticket system Version: 1.6
Severity: minor Keywords:
Cc: Branch:
Release Notes:

Use add_script rather than directly adding threaded_comments.js in ticket.html template.

API Changes:
Internal Changes:

Description

The threaded_comments.js is added directly from ticket.html. I think it should be added using add_script rather than. Currently only this script is added from templates.

$ git grep -n htdocs_location mirror/1.6-stable -- '*.html'
mirror/1.6-stable:trac/templates/about.html:28:        <img src="${chrome.htdocs_location}trac_banner.png"
mirror/1.6-stable:trac/templates/about.html:56:        <img src="${chrome.htdocs_location}python.png"
mirror/1.6-stable:trac/templates/theme.html:147:         ><img src="${chrome.htdocs_location}trac_logo_mini.png" height="30"
mirror/1.6-stable:trac/ticket/templates/ticket.html:33:    <script src="${chrome.htdocs_location}js/threaded_comments.js"></script>
$ git grep -n '<script\s*src=' mirror/1.6-stable -- '*.html'
mirror/1.6-stable:trac/ticket/templates/ticket.html:33:    <script src="${chrome.htdocs_location}js/threaded_comments.js"></script>
  • trac/ticket/templates/ticket.html

    diff --git a/trac/ticket/templates/ticket.html b/trac/ticket/templates/ticket.html
    index db9d278d3..781bf775a 100644
    a b  
    2929
    3030    ${ super() }
    3131
    32     # if ticket.exists:
    33     <script src="${chrome.htdocs_location}js/threaded_comments.js"></script>
    34     # endif
    3532    <script>
    3633      jQuery(function($) {
    3734        $("div.description").find("h1,h2,h3,h4,h5,h6")
  • trac/ticket/web_ui.py

    diff --git a/trac/ticket/web_ui.py b/trac/ticket/web_ui.py
    index 79e152c87..fa32d643c 100644
    a b class TicketModule(Component):  
    757757                              'changes': data['changes'],
    758758                              })
    759759        add_stylesheet(req, 'common/css/ticket.css')
     760        add_script(req, 'common/js/threaded_comments.js')
    760761        chrome = Chrome(self.env)
    761762        chrome.add_wiki_toolbars(req)
    762763        if not data['disable_submit']:

Attachments (0)

Change History (1)

comment:1 by Jun Omae, 5 months ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [17834] and merged in [17835].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae 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.