File: XMLTermChrome.js

package info (click to toggle)
kompozer 1%3A0.8~b3.dfsg.1-0.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 283,956 kB
  • ctags: 314,166
  • sloc: cpp: 1,763,181; ansic: 990,028; xml: 97,969; makefile: 46,334; asm: 34,989; perl: 26,943; sh: 20,165; cs: 6,232; java: 5,513; python: 3,221; pascal: 340; lex: 306; php: 244; csh: 132; objc: 97; yacc: 79; ada: 49; awk: 14; sql: 4; sed: 4
file content (47 lines) | stat: -rw-r--r-- 1,510 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// XMLTerm Chrome Commands

function StartupXMLTerm() {
   //dump("StartupXMLTerm:"+window.frames.length+"\n");
   //dump("StartupXMLTerm:"+window.frames[0].name+"\n");

   if (window.frames.length == 2) {
      xmltwin = window.frames[1];
      xmltwin.xmltbrowser = window.frames[0];
   } else {
      xmltwin = window.frames[0];
   }

   // Determine telnet URL, if any, from query portion of chrome URL
   // For security reasons, only the protocol/host portion of the URL should be
   // used to open a new connection
   var url = "";
   if (document.location.search) {
      url = document.location.search.substr(1);
   }
   //dump("StartupXMLterm: URL="+url+"\n");

   //dump("StartupXMLterm: WINDOW.ARGUMENTS="+window.arguments+"\n");

   dump("Trying to make an XMLTerm Shell through the component manager...\n");

   var xmltshell = Components.classes["@mozilla.org/xmlterm/xmltermshell;1"].createInstance();

   xmltshell = xmltshell.QueryInterface(Components.interfaces.mozIXMLTermShell);
   //dump("Interface xmltshell2 = " + xmltshell + "\n");

   if (!xmltshell) {
     dump("Failed to create XMLTerm shell\n");
     window.close();
     return;
   }
  
   // Store the XMLTerm shell in current window and in the XMLTerm frame
   window.xmlterm = xmltshell;
   xmltwin.xmlterm = xmltshell;

  if (window.arguments != null)
     document.title = "xmlterm: "+window.arguments;

   // Initialize XMLTerm shell in content window with argvals
   window.xmlterm.init(xmltwin, "", window.arguments);
}