~ubuntu-branches/ubuntu/lucid/webdeveloper/lucid-proposed

« back to all changes in this revision

Viewing changes to source/content_common/webdeveloper/about/about.js

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna
  • Date: 2009-01-04 12:25:00 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090104122500-agtub7j8tfr3s09t
Tags: 1.1.6+repack-1ubuntu1
* Merge from Debian experimental, remaining Ubuntu changes:
  + debian/control:
    - Build firefox-webdeveloper and adjust it for Firefox.
    - Do not conflict/replaces with firefox-developer.
    - Add Vcs-Bzr header.
  + debian/rules:
    - Adjust makebuilddir to build firefox-webdeveloper package.
  + Rename iceweasel-{webdeveloper.links,firefox-webdeveloper.install} to
    firefox-{webdeveloper.links,firefox-webdeveloper.install}

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Opens the URL in a new tab
 
2
function webdeveloper_openURL(urlElement)
 
3
{
 
4
    var parentWindow = null;
 
5
    var url          = urlElement.firstChild.nodeValue;
 
6
 
 
7
    // If there is a parent window
 
8
    if(window.opener)
 
9
    {
 
10
        // If there is a grand parent window
 
11
        if(window.opener.opener)
 
12
        {
 
13
            parentWindow = window.opener.opener;
 
14
        }
 
15
        else
 
16
        {
 
17
            parentWindow = window.opener;
 
18
        }
 
19
    }
 
20
 
 
21
    // If a parent window was found
 
22
    if(parentWindow)
 
23
    {
 
24
        // If the open in windows preference is set to true
 
25
        if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs", true))
 
26
        {
 
27
            var newTab = parentWindow.getBrowser().addTab(url);
 
28
 
 
29
            // If the open tabs in background preference is not set or is set to false
 
30
            if(!webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
 
31
            {
 
32
                parentWindow.getBrowser().selectedTab = newTab;
 
33
            }
 
34
        }
 
35
        else
 
36
        {
 
37
            parentWindow.open(url);
 
38
        }
 
39
 
 
40
        window.close();
 
41
    }
 
42
}