Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 408762

Summary: browserCompatibility is a global
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Gabriel Luong <gabriel.luong>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: gabriel.luong, libingw
Version: 2.0Flags: libingw: review+
Target Milestone: 3.0 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-05-22 18:08:24 EDT
The new browserCompatibility.js file is a global function, not an AMD module. E.g. if you open the Javascript console in your browser on an Orion page and type 'isSupportedBrowser' you'll see the function has been added to the window object.

Is there a reason for this? We should really avoid leaking anything into the global object if possible.
Comment 1 Gabriel Luong CLA 2013-05-24 11:35:01 EDT
Made browserCompatibility into an AMD module. Note forEach does not work in IE8. 
https://orion.eclipse.org/git/reviewRequest.html#git@github.com:gabrielluong/orion.client.git_f0c8d511158c442e16620a61e1557004144a7315

I assert that I authored 100% of the content of this contribution and have the rights to donate the content to Eclipse under the EPL
Comment 2 Mark Macdonald CLA 2013-05-24 12:00:08 EDT
(In reply to comment #1)
> Note forEach does not work in IE8. 

Good point.

Also, I can't get the review request link to work... unless I hand-craft the URL to be
https://orion.eclipse.org/git/reviewRequest.html#git://github.com/gabrielluong/orion.client.git_f0c8d511158c442e16620a61e1557004144a7315

The reviewRequest page doesn't seem to like the git@github.com repo URL.
Comment 3 libing wang CLA 2013-05-24 12:07:50 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > Note forEach does not work in IE8. 
> 
> Good point.
> 
> Also, I can't get the review request link to work... unless I hand-craft the
> URL to be
> https://orion.eclipse.org/git/reviewRequest.html#git://github.com/
> gabrielluong/orion.client.git_f0c8d511158c442e16620a61e1557004144a7315
> 
> The reviewRequest page doesn't seem to like the git@github.com repo URL.
Same here. Opened bug 409013. BTW, the original URL works from Gabriel's account.
Comment 4 libing wang CLA 2013-05-24 12:14:13 EDT
Looks good and I've tested the fix.
Pushed with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=b736cceca408c775c4823ea0314a7521b8fb5ea5