/[drupal]/contributions/modules/mediumvote/theme/ajax_mediumvote.js
ViewVC logotype

Diff of /contributions/modules/mediumvote/theme/ajax_mediumvote.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Thu Feb 16 22:03:53 2006 UTC revision 1.2, Sat Apr 15 18:10:21 2006 UTC
# Line 3  if (isJsEnabled()) { Line 3  if (isJsEnabled()) {
3    addLoadEvent(mediumvoteClassAutoAttach);    addLoadEvent(mediumvoteClassAutoAttach);
4  }  }
5    
6    function getTextContent(node) {
7      var text = '';
8      if(node) {
9        if(node.children) {
10          text = GetTextContent(node.firstChild);
11        } else {
12          if(node.nodeValue) {
13            // ie
14            text = node.nodeValue;
15          } else {
16            // firefox
17            text = node.textContent;
18          }
19        }
20      }
21      return text;
22    }
23    
24  function mediumvoteClassAutoAttach() {  function mediumvoteClassAutoAttach() {
25    var vdb = [];    var vdb = [];
26    var spans = document.getElementsByTagName('span');    var spans = document.getElementsByTagName('span');
# Line 17  function mediumvoteClassAutoAttach() { Line 35  function mediumvoteClassAutoAttach() {
35        span.removeAttribute('title');        span.removeAttribute('title');
36    
37        // remove href link        // remove href link
38        var elem = document.getElementById(id);        if (document.getElementById)
39        elem.innerHTML = elem.textContent;          var elem = document.getElementById(id);
40          else if (document.all)
41            var elem = document.all[id];
42          else if (document.layers)
43            var elem = document.layers[id];
44    
45          elem.innerHTML = getTextContent(elem);
46    
47        // Create an object with this uri. Because        // Create an object with this uri. Because
48        // we feed in the span as an argument, we'll be able        // we feed in the span as an argument, we'll be able
# Line 57  VDB.prototype.receive = function(string, Line 81  VDB.prototype.receive = function(string,
81    
82    // update the display    // update the display
83    document.getElementById(vdb.id).innerHTML = string;    document.getElementById(vdb.id).innerHTML = string;
84      if (document.getElementById)
85        document.getElementById(vdb.id).innerHTML = string;
86      else if (document.all)
87        document.all[vdb.id].innerHTML = string;
88      else if (document.layers)
89        document.all[vdb.id].innerHTML = string;
90  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2