File: di.js

package info (click to toggle)
emacspeak 29.0-9
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 12,904 kB
  • sloc: xml: 55,354; lisp: 48,335; cpp: 2,321; tcl: 1,500; makefile: 936; python: 836; sh: 785; perl: 459; ansic: 241
file content (44 lines) | stat: -rw-r--r-- 899 bytes parent folder | download | duplicates (2)
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
//$Id: di.js 4679 2007-06-25 18:39:40Z tv.raman.tv $
/*
 * Description: DomInspector helpers
 */


/*
 * Show attributes of a DOM node along with NameSpace information
 */
repl.showAttributes = function(node) {
  var map = node.attributes;
  if (map  instanceof NamedNodeMap) {
    for (i = 0; i < map.length; i++) {
      repl.print (map[i].name +' = ' + map[i].value, false);
      if (map[i].namespaceURI) {
        repl.print("\tNamespace: " + map[i].namespaceURI);
      } else {
        repl.print("");
      }
    }
  } else {
    repl.print (node + " has no attributes.");
  }
};
 

/*
 * Function to attach to window.onerror
 */
repl.showErrors = function (m, u, l) {
    repl.print("Message: " +m + "URL: " +u +"Line: " + l);
};


/*
 * Show properties of an object.
 */
repl.showProps = function (object) {
    for (var name in object) {
      repl.print(name);
    }
};

"Loaded di.js";