This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 133026 - Eclipse Foundation News Items launch in new browser
Summary: Eclipse Foundation News Items launch in new browser
Status: RESOLVED FIXED
Alias: None
Product: Community
Classification: Eclipse Foundation
Component: Website (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: phoenix.ui CLA
QA Contact:
URL: http://www.eclipse.org
Whiteboard:
Keywords:
: 141356 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-23 12:19 EST by Nathan Gervais CLA
Modified: 2006-12-13 15:25 EST (History)
1 user (show)

See Also:


Attachments
/eclipse.org-common/system (1.03 KB, patch)
2006-04-04 13:46 EDT, Nathan Gervais CLA
no flags Details | Diff
/eclipse.org-common/system (1002 bytes, patch)
2006-04-04 14:29 EDT, Nathan Gervais CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Gervais CLA 2006-03-23 12:19:19 EST
Ian and i had a conversation about how the left hand news section will open a new browser when those links are part of the foundation site already.  We should be staying in one browser as long as were on the eclipse.org site.

The code at fault here is located in eclipse.org-common/system/rss.php, and it creates a target=_blank for each link, while this is useful for the Community News (right side) we should modify the behaviour of this to perform the right action.

Since this is in eclipse.org-common when can we make this change.

//Nathan
Comment 1 Wayne Beaton CLA 2006-03-23 18:59:03 EST
You can make the change whenever you want. It just won't be rolled out until the next release of Phoenix.
Comment 2 Nathan Gervais CLA 2006-04-04 13:46:56 EDT
Created attachment 37649 [details]
/eclipse.org-common/system
Comment 3 Nathan Gervais CLA 2006-04-04 13:48:53 EDT
Above is a patch to fix this bug.  I have added a string compare that will check to see if the url begins with http://www.eclipse.org and then adds a target="_blank" if it does not.
Comment 4 Eclipse Webmaster CLA 2006-04-04 13:56:49 EDT
This patch assumes the links will be made to www.eclipse.org, and technically download.eclipse.org is local to us, and so is http://eclipse.org/.

I'd suggest a regexp search for ^http:\/\/(.*).eclipse.org and also allow http://eclipse.org/

D.
Comment 5 Nathan Gervais CLA 2006-04-04 14:28:22 EDT
I've changed this to

// Added a regex string compare here to force the creation of a new window when the link exists outside of eclipse.org
if (preg_match("^http:\/\/(.*)eclipse.org^", $item->link))
{
	$html .= "<a href=\"$item->link\">$item->title</a>";
}
else
{
	$html .= "<a href=\"$item->link\" target=\"_blank\">$item->title</a>";		
}

Which takes into account any url hose domain name ends in eclipse.org
Comment 6 Nathan Gervais CLA 2006-04-04 14:29:25 EDT
Created attachment 37653 [details]
/eclipse.org-common/system
Comment 7 Eclipse Webmaster CLA 2006-04-05 12:08:34 EDT
The above patch will consider the following link local:

www.pluginsforeclipse.org

hence the reason I suggested ^http:\/\/(.*).eclipse.org and also allow
http://eclipse.org/ explicitly.

D.
Comment 8 Nathan Gervais CLA 2006-04-07 16:09:37 EDT
Before i make another change, i'd like to discuss the purpose of this change.
This really comes down to not where the link is located but which news its in.  

When a peice of news is on the left side "Foundation News" then that link will always be on www.eclipse.org somewhere. 

When a peice of news is on the right side "Community News" then that link will always be outside www.eclipse.org

So do we put in a filter such as above to do this or do we build a mechanism (read variable passed in a function) to determine this, eliminating the need for a regex statement and explicit check for http://eclipse.org

Keep in mind that this issue will disappear in the near future once i have converted the RSS feeds to be read from a database rather then an XML file.

Discuss.
Comment 9 Nathan Gervais CLA 2006-05-25 15:45:00 EDT
*** Bug 141356 has been marked as a duplicate of this bug. ***
Comment 10 Nathan Gervais CLA 2006-12-13 15:20:45 EST
Since this was all revamped with the launch of the new homepage the way that news is displayed on the homepage has changed.

I have updated this new method to cause links in the Community News section to open in a new browser (this includes eclipseplugincentral.com links in the plugin section) and to stay in the current browser when opening links from the Annoucements section.

Marking this bug as fixed
Comment 11 Nathan Gervais CLA 2006-12-13 15:25:26 EST
> I have updated this new method to cause links in the Community News section to
> open in a new browser (this includes eclipseplugincentral.com links in the
> plugin section) and to stay in the current browser when opening links from the
> Annoucements section.


Correction i got my logic mixed up.  Since www.eclipseplugincentral.com is considered part of eclipse.org those links open in the same window.