Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#7673 closed defect (fixed)

Fix JavaScript code

Reported by: rea Owned by: rjollos
Priority: normal Component: TracKeywordsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

IE goes angry on the following code

link = document.getElementById('add_' + currentTags[i]);

because 'link' should be made local variable: IE pollutes the namespace with variables named after all DOM nodes, so it nags the users about the object ('link') that isn't support the particular method ('=', I think).

The patch is available at http://codelabs.ru/patches/trac-keywords/fix-javascript-make-local-variable.diff

It was tested on our Trac 0.12 and IE 6.x/8.x: the original JS problem is gone.

Attachments (0)

Change History (14)

comment:1 Changed 4 years ago by rjollos

Looks like a straighforward fix. I'd be happy to apply this to the repository 0.11 branch given permission of the author, or if no response from plugin author within 2 weeks (per t-h.o policies) (... and feel free to remind me in 2 weeks if I forget).

comment:2 Changed 4 years ago by rea

Here is the reminder: 2 weeks were passed ;)

comment:3 Changed 4 years ago by rea

And another reminder: 3 weeks passed.

comment:4 Changed 4 years ago by rjollos

  • Owner changed from thomasvs to rjollos

It's high on my todo list ;) I can apply the patch right now if you can checkout the latest version afterwards just to confirm that I don't make a silly mistake. Just don't 15 min to setup a trac environment and test right now.

comment:5 Changed 4 years ago by rjollos

  • Owner changed from rjollos to anonymous
  • Status changed from new to assigned

There seems to be another problem. The following file doesn't exist in the repository: 0.11/trackeywords/templates/keywords.html

In fact, I think there may have been an error in [6528] because the log message doesn't match the changes that were made (he may have mixed up the 0.l0 and 0.11 branches).

comment:6 Changed 4 years ago by rea

Ah, I am terribly sorry, I completely forgot about this bug: #6104. It should be fixed prior to this bug: I am using the patched version inside FreeBSD port, so I missed that point.

And it looks like not only trackeywords/templates/keywords.html, but trackeywords/web_ui.py was misplaced too: they both should live under 0.11, not under 0.10.

comment:7 Changed 4 years ago by rjollos

  • Owner changed from anonymous to rjollos
  • Status changed from assigned to new

comment:8 Changed 4 years ago by rjollos

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [9285]. Not sure why the post-commit hook didn't insert the log message here.

---

Make javascript variables locate so as to not pollute the namespace. Fixes #7673.

comment:9 follow-up: Changed 4 years ago by rjollos

Okay, should be fixed now. Would you be willing to test out the 0.11 version? Also, if it does work on 0.12, we should add a 0.12 tag to the project's wiki page: TracKeywordsPlugin.

comment:10 Changed 4 years ago by rjollos

A few other things:

  • It appears that the modification to ticket.cs listed under TracKeywordsPlugin#Example should only be necessary in Trac 0.10, so I added (0.10 only). Please confirm if possible.
  • It would be nice to have a screen capture on the project's wiki page, showing the plugin in action.
  • (already mentioned) add 0.12 tag if it works with 0.12.

comment:11 in reply to: ↑ 9 Changed 4 years ago by rea

Replying to rjollos:

Okay, should be fixed now. Would you be willing to test out the 0.11 version?

Yes.

Also, if it does work on 0.12, we should add a 0.12 tag to the project's wiki page: TracKeywordsPlugin.

I'll also test the 0.12. In fact, our production systems are running 0.12, so I will need to up 0.11 somehow.

comment:12 Changed 4 years ago by rea

Works for me at 0.12. And I hadn't made any modifications for ticket.cs neither for 0.11, nor for 0.12.

comment:13 Changed 4 years ago by rjollos

Thanks, I've updated the project's wiki page accordingly.

comment:14 Changed 4 years ago by anonymous

New version works for 0.11. Thanks for committing the fixes!

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.