/[meteor]/googlecode.com/svn/trunk/public_html/meteor.js
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /googlecode.com/svn/trunk/public_html/meteor.js

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

revision 63 by andrew.betts, Thu Nov 27 00:33:21 2008 UTC revision 64 by andrew.betts, Mon Jan 19 11:19:41 2009 UTC
# Line 77  Meteor = { Line 77  Meteor = {
77          },          },
78    
79          connect: function() {          connect: function() {
                 Meteor.log("Connecting");  
80                  if (!Meteor.host) throw "Meteor host not specified";                  if (!Meteor.host) throw "Meteor host not specified";
81                  if (isNaN(Meteor.port)) throw "Meteor port not specified";                  if (isNaN(Meteor.port)) throw "Meteor port not specified";
82                  if (!Meteor.channelcount) throw "No channels specified";                  if (!Meteor.channelcount) throw "No channels specified";
83                  if (Meteor.status) Meteor.disconnect();                  if (Meteor.status) Meteor.disconnect();
84                    Meteor.log("Connecting");
85                  Meteor.setstatus(1);                  Meteor.setstatus(1);
86                  if (!Meteor.hostid) Meteor.hostid = Meteor.time()+""+Math.floor(Math.random()*1000000)                  if (!Meteor.hostid) Meteor.hostid = Meteor.time()+""+Math.floor(Math.random()*1000000)
87                  document.domain = Meteor.extract_xss_domain(document.domain);                  document.domain = Meteor.extract_xss_domain(document.domain);
# Line 107  Meteor = { Line 107  Meteor = {
107    
108          disconnect: function() {          disconnect: function() {
109                  if (Meteor.status) {                  if (Meteor.status) {
110                            if (Meteor.status != 6) Meteor.setstatus(0);
111                            Meteor.clearpoll();
112                          clearTimeout(Meteor.pingtimer);                          clearTimeout(Meteor.pingtimer);
113                          clearTimeout(Meteor.updatepollfreqtimer);                          clearTimeout(Meteor.updatepollfreqtimer);
114                          clearTimeout(Meteor.frameloadtimer);                          clearTimeout(Meteor.frameloadtimer);
115                          if (typeof CollectGarbage == 'function') CollectGarbage();                          if (typeof CollectGarbage == 'function') CollectGarbage();
                         if (Meteor.status != 6) Meteor.setstatus(0);  
116                          Meteor.log("Disconnected");                          Meteor.log("Disconnected");
117                          try { Meteor.frameref.parentNode.removeChild(Meteor.frameref); delete Meteor.frameref; return true; } catch(e) { }                          try { Meteor.frameref.parentNode.removeChild(Meteor.frameref); delete Meteor.frameref; return true; } catch(e) { }
118                          try { Meteor.frameref.open(); Meteor.frameref.close(); return true; } catch(e) {}                                                try { Meteor.frameref.open(); Meteor.frameref.close(); return true; } catch(e) {}                      
# Line 319  Meteor = { Line 320  Meteor = {
320          },          },
321    
322          clearpoll: function() {          clearpoll: function() {
323                  var s = document.getElementById('meteorpoll'+Meteor.pollnum);                  if (document.getElementById('meteorpoll'+Meteor.pollnum)) {
324                  if (typeof s != 'undefined') s.parentNode.removeChild(s);                          var s = document.getElementById('meteorpoll'+Meteor.pollnum);
325                  if (Meteor.status) {                          s.parentNode.removeChild(s);
326                    }
327                    if (Meteor.status == 5) {
328                          var x = parent.Meteor.pollfreq - (Meteor.time()-Meteor.lastrequest);                          var x = parent.Meteor.pollfreq - (Meteor.time()-Meteor.lastrequest);
329                          if (x < 10) x = 10;                          if (x < 10) x = 10;
330                          setTimeout(Meteor.poll, x);                          setTimeout(Meteor.poll, x);

Legend:
Removed from v.63  
changed lines
  Added in v.64

  ViewVC Help
Powered by ViewVC 1.1.26