git-svn-id: svn://euphorik.ch/pompage@45 02bbb61a-6d21-0410-aba0-cb053bdfd66a
[pompage.git] / doc / webdeveloper / message / message.js
1 // Initializes the message dialog
2 function webdeveloper_initializeMessage()
3 {
4 document.getElementById("webdeveloper-message").value = window.arguments[0];
5
6 // If the second window argument is not set
7 if(!window.arguments[1])
8 {
9 document.getElementById("webdeveloper-more-information").style.display = "none";
10 }
11 }
12
13 // Loads the more information link in a new tab
14 function webdeveloper_moreInformation()
15 {
16 var parentWindow = null;
17
18 // If there is a parent window
19 if(window.opener)
20 {
21 // If there is a grand parent window
22 if(window.opener.opener)
23 {
24 parentWindow = window.opener.opener;
25 }
26 else
27 {
28 parentWindow = window.opener;
29 }
30 }
31
32 // If a parent window was found
33 if(parentWindow)
34 {
35 // If the open in windows preference is set to true
36 if(webdeveloper_getBooleanPreference("webdeveloper.open.tabs", true))
37 {
38 var newTab = parentWindow.getBrowser().addTab(window.arguments[1]);
39
40 // If the open tabs in background preference is not set or is set to false
41 if(!webdeveloper_getBooleanPreference("webdeveloper.open.tabs.background", true))
42 {
43 parentWindow.getBrowser().selectedTab = newTab;
44 }
45 }
46 else
47 {
48 parentWindow.open(window.arguments[1]);
49 }
50
51 window.close();
52 }
53 }