Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7673 closed defect (fixed)

Fix JavaScript code

Reported by: Eygene Ryabinkin Owned by: Ryan J Ollos
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 6 years ago by Ryan J Ollos

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 6 years ago by Eygene Ryabinkin

Here is the reminder: 2 weeks were passed ;)

comment:3 Changed 6 years ago by Eygene Ryabinkin

And another reminder: 3 weeks passed.

comment:4 Changed 6 years ago by Ryan J Ollos

Owner: changed from thomasvs to Ryan J Ollos

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 6 years ago by Ryan J Ollos

Owner: changed from Ryan J Ollos to anonymous
Status: newassigned

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 6 years ago by Eygene Ryabinkin

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 6 years ago by Ryan J Ollos

Owner: changed from anonymous to Ryan J Ollos
Status: assignednew

comment:8 Changed 6 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

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 Changed 6 years ago by Ryan J Ollos

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 6 years ago by Ryan J Ollos

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 6 years ago by Eygene Ryabinkin

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 6 years ago by Eygene Ryabinkin

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 6 years ago by Ryan J Ollos

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

comment:14 Changed 6 years ago by anonymous

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

Modify Ticket

Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.