/[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 8 by andrew.betts, Thu Nov 23 16:35:37 2006 UTC revision 39 by andrew.betts, Sat Feb 2 16:49:20 2008 UTC
# Line 1  Line 1 
1  // Set domain at highest level  /*
2  var domainparts = document.domain.split(".");  stream: xhrinteractive, iframe, serversent
3  document.domain = domainparts[domainparts.length-2]+"."+domainparts[domainparts.length-1];  longpoll
4    smartpoll
5  Function.prototype.bind = function(obj) {  simplepoll
6          var method = this,  */
7          temp = function() {  
8                  return method.apply(obj, arguments);  Meteor = {
9          };  
10          return temp;          callbacks: {
11  }                  process: function() {},
12  Function.prototype.andThen=function(g) {                  reset: function() {},
13          var f=this;                  eof: function() {},
14          var a=this.arguments                  statuschanged: function() {},
15          return function(args) {                  changemode: function() {}
16                  f(a);g(args);          },
17          }          channelcount: 0,
18  };          channels: {},
19  function addUnLoadEvent(func) {          debugmode: false,
20    var oldonunload = window.onunload;          frameref: null,
21    if (typeof window.onunload != 'function') {          host: null,
22      window.onunload = func;          hostid: null,
23    } else {          maxpollfreq: 60000,
24      window.onunload = function() {          minpollfreq: 2000,
25        if (oldonunload) {          mode: "stream",
26          oldonunload();          pingtimeout: 20000,
27        }          pingtimer: null,
28        func();          pollfreq: 3000,
29      }          port: 80,
30    }          polltimeout: 30000,
31  }          recvtimes: [],
32  addUnLoadEvent(meteordestroy);          status: 0,
33  function meteordestroy() {          updatepollfreqtimer: null,
34          var x = Meteor.instances.length;  
35          for(var i=0; i<x; i++) {          register: function(ifr) {
36                  if (typeof(Meteor.instances[i].transferDoc)=="object") {                  ifr.p = Meteor.process;
37                          Meteor.instances[i].transferDoc.open();                  ifr.r = Meteor.reset;
38                          Meteor.instances[i].transferDoc.close();                  ifr.eof = Meteor.eof;
39                          delete Meteor.instances[i].transferDoc;                  clearTimeout(Meteor.frameloadtimer);
40                  }                  Meteor.setstatus(4);
41                  if (document.getElementById("meteorframe_"+Meteor.instances[i].instID)) {                  Meteor.log("Frame registered");
42                          document.body.removeChild(document.getElementById("meteorframe_"+Meteor.instances[i].instID));          },
43                  }  
44                  delete Meteor.instances[i];          joinChannel: function(channelname, backtrack) {
45          }                  if (typeof(Meteor.channels[channelname]) != "undefined") throw "Cannot join channel "+channelname+": already subscribed";
46  }                  Meteor.channels[channelname] = {backtrack:backtrack, lastmsgreceived:0};
47                    Meteor.log("Joined channel "+channelname);
48  function Meteor(instID) {                  Meteor.channelcount++;
49                    if (Meteor.status != 0) Meteor.connect();
50          this.lastmsgreceived = -1;          },
51          this.transferDoc = false;  
52          this.pingtimer = false;          leaveChannel: function(channelname) {
53          this.updatepollfreqtimer = false;                  if (typeof(Meteor.channels[channelname]) == "undefined") throw "Cannot leave channel "+channelname+": not subscribed";
54          this.lastrequest = 0;                  delete Meteor.channels[channelname];
55          this.recvtimes = new Array();                  Meteor.log("Left channel "+channelname);
56          this.MHostId = false;                  if (Meteor.status != 0) Meteor.connect();
57          this.callback_process = function() {};                  Meteor.channelcount--;
58          this.callback_reset = function() {};          },
59          this.callback_eof = function() {};  
60          this.callback_changemode = function() {};          connect: function() {
61          this.callback_statuschanged = function() {};                  Meteor.log("Connecting");
62          this.persist = true;                  if (!Meteor.host) throw "Meteor host not specified";
63          this.frameloadtimer = false;                  if (isNaN(Meteor.port)) throw "Meteor port not specified";
64          this.frameurl = false;                  if (!Meteor.channelcount) throw "No channels specified";
65                    if (Meteor.status) Meteor.disconnect();
66          // Documented public properties                  Meteor.setstatus(1);
67          this.channel = false;                  var now = new Date();
68          this.subdomain = "data";                  var t = now.getTime();
69          this.dynamicpageaddress = "push";                  if (!Meteor.hostid) Meteor.hostid = t+""+Math.floor(Math.random()*1000000)
70          this.backtrack = 0;                  document.domain = Meteor.extract_xss_domain(document.domain);
71          this.smartpoll = true;                  if (Meteor.mode=="stream") Meteor.mode = Meteor.selectStreamTransport();
72          this.pollfreq = 2000;                  Meteor.log("Selected "+Meteor.mode+" transport");
73          this.minpollfreq = 2000;                  if (Meteor.mode=="xhrinteractive" || Meteor.mode=="iframe" || Meteor.mode=="serversent") {
74          this.mode = "stream";                          if (Meteor.mode == "iframe") {
75          this.polltimeout=30000;                                  Meteor.loadFrame(Meteor.getSubsUrl());
76          this.maxmessages=0;                          } else {
77          this.pingtimeout = 10000;                                  Meteor.loadFrame("http://"+Meteor.host+((Meteor.port==80)?"":":"+Meteor.port)+"/stream.html");
78          this.status = 0;                          }
79                            clearTimeout(Meteor.pingtimer);
80          /* Statuses:    0 = Uninitialised,                          Meteor.pingtimer = setTimeout(Meteor.pollmode, Meteor.pingtimeout);
81                                          1 = Loading stream,  
82                                          2 = Loading controller frame,                  } else {
83                                          3 = Controller frame timeout, retrying every 5 seconds                          Meteor.loadFrame("http://"+Meteor.host+((Meteor.port==80)?"":":"+Meteor.port)+"/poll.html");
84                                          4 = Controller frame loaded and ready                          Meteor.recvtimes[0] = t;
85                                          5 = Receiving data                          if (Meteor.updatepollfreqtimer) clearTimeout(Meteor.updatepollfreqtimer);
86          */                          if (Meteor.mode=='smartpoll') Meteor.updatepollfreqtimer = setInterval(Meteor.updatepollfreq, 2500);
87                            if (Meteor.mode=='longpoll') Meteor.pollfreq = Meteor.minpollfreq;
88          // Set or retrieve host id.  Cookie takes this form:                  }
89          // MeteorID=123:6356353/124:098320454;                  Meteor.lastrequest = t;
90          var MeteIds = Meteor.readCookie("MeteorID");          },
91          var regex1 = new RegExp("^([0-9\:\/M]+\/)*"+instID+"\:([^\/]+)(\/[0-9\:\/M]+)*$");  
92          var regex2 = new RegExp("^([0-9\:\/M]+\/)*M\:([^\/]+)(\/[0-9\:\/M]+)*$");          disconnect: function() {
93          if (typeof(instID) == "Number" && regex1.exec(MeteIds)) {                  if (Meteor.status) {
94                  this.MHostId = ma[2];                          clearTimeout(Meteor.pingtimer);
95          } else if (typeof(instID) == "Number") {                          clearTimeout(Meteor.updatepollfreqtimer);
96                  this.MHostId = Math.floor(Math.random()*1000000);                          clearTimeout(Meteor.frameloadtimer);
97                  var newcookie = (MeteIds)?MeteIds+"/":"";                          if (typeof CollectGarbage == 'function') CollectGarbage();
98                  newcookie += instID+":"+this.MHostId;                          Meteor.setstatus(0);
99                  Meteor.createCookie("MeteorID", newcookie);                  }
100          } else if (ma = regex2.exec(MeteIds)) {          },
101                  this.MHostId = ma[2];          
102          } else {          selectStreamTransport: function() {
103                  this.MHostId = Math.floor(Math.random()*1000000);                  try {
104                  var newcookie = (MeteIds)?MeteIds+"/":"";                          var test = ActiveXObject;
105                  newcookie += "M:"+this.MHostId;                          return "iframe";
106                  Meteor.createCookie("MeteorID", newcookie);                  } catch (e) {}
107          }                  if ((typeof window.addEventStream) == "function") return "iframe";
108          this.instID = (typeof(instID) != "undefined") ? instID : 0;                  return "xhrinteractive";
109  }          },
110    
111  Meteor.instances = new Array();          getSubsUrl: function() {
112  Meteor.servertimeoffset = 0;                  var surl = "http://" + Meteor.host + ((Meteor.port==80)?"":":"+Meteor.port) + "/push/" + Meteor.hostid + "/" + Meteor.mode;
113                    for (var c in Meteor.channels) {
114  Meteor.create = function(instID) {                          surl += "/"+c;
115          if (!instID) instID = 0;                          if (Meteor.channels[c].lastmsgreceived > 0) {
116          Meteor.instances[instID] = new Meteor(instID);                                  surl += ".r"+(Meteor.channels[c].lastmsgreceived+1);
117          return Meteor.instances[instID];                          } else if (Meteor.channels[c].backtrack > 0) {
118  }                                  surl += ".b"+Meteor.channels[c].backtrack;
119                            } else if (Meteor.channels[c].backtrack < 0 || isNaN(Meteor.channels[c].backtrack)) {
120  Meteor.register = function(ifr) {                                  surl += ".h";
121          instid = new String(ifr.window.frameElement.id);                          }
122          instid = instid.replace("meteorframe_", "");                  }
123          ifr.p = this.instances[instid].process.bind(this.instances[instid]);                  return surl;
124          ifr.r = this.instances[instid].reset.bind(this.instances[instid]);          },
125          ifr.eof = this.instances[instid].eof.bind(this.instances[instid]);  
126          ifr.get = this.instances[instid].get.bind(this.instances[instid]);          loadFrame: function(url) {
127          ifr.increasepolldelay = this.instances[instid].increasepolldelay.bind(this.instances[instid]);                  try {
128          clearTimeout(this.instances[instid].frameloadtimer);                          if (!Meteor.frameref) {
129          this.instances[instid].setstatus(4);                                  var transferDoc = new ActiveXObject("htmlfile");
130  }                                  Meteor.frameref = transferDoc;
131                            }
132  Meteor.setServerTime = function(timestamp) {                          Meteor.frameref.open();
133          var now = new Date();                          Meteor.frameref.write("<html><script>");
134          var clienttime = (now.getTime() / 1000);                          Meteor.frameref.write("document.domain=\""+(document.domain)+"\";");
135          Meteor.servertimeoffset = timestamp - clienttime;                          Meteor.frameref.write("</"+"script></html>");
136  }                          Meteor.frameref.parentWindow.Meteor = Meteor;
137                            Meteor.frameref.close();
138  Meteor.prototype.start = function() {                          var ifrDiv = Meteor.frameref.createElement("div");
139          this.persist = (this.maxmessages)?1:0;                          Meteor.frameref.appendChild(ifrDiv);
140          this.smartpoll = (this.smartpoll)?1:0;                          ifrDiv.innerHTML = "<iframe src=\""+url+"\"></iframe>";
141          this.mode = (this.mode=="stream")?"stream":"poll";                  } catch (e) {
142          if (!this.subdomain || !this.channel) throw "Channel or Meteor subdomain host not specified";                          if (!Meteor.frameref) {
143          var now = new Date();                                  var ifr = document.createElement("IFRAME");
144          var t = now.getTime();                                  ifr.style.width = "10px";
145          if (typeof(this.transferDoc)=="object") {                                  ifr.style.height = "10px";
146                  this.transferDoc.open();                                  ifr.style.border = "none";
147                  this.transferDoc.close();                                  ifr.style.position = "absolute";
148                  delete this.transferDoc;                                  ifr.style.top = "-10px";
149          }                                  ifr.style.marginTop = "-10px";
150          if (document.getElementById("meteorframe_"+this.instID)) {                                  ifr.style.zIndex = "-20";
151                  document.body.removeChild(document.getElementById("meteorframe_"+this.instID));                                  ifr.Meteor = Meteor;
152          }                                  document.body.appendChild(ifr);
153          if (this.mode=="stream") {                                  Meteor.frameref = ifr;
154                  if (document.all) {                          }
155                          this.setstatus(1);                          Meteor.frameref.setAttribute("src", url);
156                          this.transferDoc = new ActiveXObject("htmlfile");                  }
157                          this.transferDoc.open();                  Meteor.log("Loading URL '"+url+"' into frame...");
158                          this.transferDoc.write("<html>");                  Meteor.frameloadtimer = setTimeout(Meteor.frameloadtimeout, 5000);
159                          this.transferDoc.write("<script>document.domain=\""+(document.domain)+"\";</"+"script>");          },
160                          this.transferDoc.write("</html>");  
161                          var selfref = this;          pollmode: function() {
162                          this.transferDoc.parentWindow.Meteor = Meteor;                  Meteor.log("Ping timeout");
163                          this.transferDoc.close();                  Meteor.mode="simplepoll";
164                          var ifrDiv = this.transferDoc.createElement("div");                  clearTimeout(Meteor.pingtimer);
165                          this.transferDoc.appendChild(ifrDiv);                  Meteor.connect();
166                          var url = "http://"+this.subdomain+"."+location.hostname+"/"+this.dynamicpageaddress+"?channel="+this.channel+"&id="+this.MHostId;                  Meteor.callbacks["changemode"]("poll");
167                          if (this.lastmsgreceived >= 0) {                  Meteor.lastpingtime = false;
168                                  url += "&restartfrom="+this.lastmsgreceived;          },
169                          } else if (this.backtrack > 0) {  
170                                  url += "&backtrack="+this.backtrack;          process: function(id, channel, data) {
171                          } else if (this.backtrack < 0 || isNaN(this.backtrack)) {                  if (id == -1) {
172                                  url += "&restartfrom=";                          Meteor.log("Ping");
173                          }                          Meteor.ping();
174                          ifrDiv.innerHTML = "<iframe id=\"meteorframe_"+this.instID+"\" src=\""+url+"&nocache="+t+"\" style=\"display: none;\"></iframe>";                  } else if (typeof(Meteor.channels[channel]) != "undefined" && id > Meteor.channels[channel].lastmsgreceived) {
175                  } else {                          Meteor.log("Message "+id+" received on channel "+channel+" (last id on channel: "+Meteor.channels[channel].lastmsgreceived+")\n"+data);
176                          var ifr = document.createElement("IFRAME");                          Meteor.callbacks["process"](data);
177                          ifr.style.width = "10px";                          Meteor.channels[channel].lastmsgreceived = id;
178                          ifr.style.height = "10px";                          if (Meteor.mode=="smartpoll") {
179                          ifr.style.border = "none";                                  var now = new Date();
180                          ifr.style.position = "absolute";                                  Meteor.recvtimes[Meteor.recvtimes.length] = now.getTime();
181                          ifr.style.top = "-10px";                                  while (Meteor.recvtimes.length > 5) Meteor.recvtimes.shift();
182                          ifr.style.marginTop = "-10px";                          }
183                          ifr.style.zIndex = "-20";                  }
184                          ifr.id = "meteorframe_"+this.instID;                  Meteor.setstatus(5);
185                          document.body.appendChild(ifr);          },
186                          this.frameurl = "http://"+this.subdomain+"."+location.hostname+"/stream.html";  
187                          this.frameload();          ping: function() {
188                  }                  if (Meteor.pingtimer) {
189                  var f = this.pollmode.bind(this);                          clearTimeout(Meteor.pingtimer);
190                  clearTimeout(this.pingtimer);                          Meteor.pingtimer = setTimeout(Meteor.pollmode, Meteor.pingtimeout);
191                  this.pingtimer = setTimeout(f, this.pingtimeout);                          var now = new Date();
192                            Meteor.lastpingtime = now.getTime();
193          } else {                  }
194                  var ifr = document.createElement("IFRAME");                  Meteor.setstatus(5);
195                  ifr.style.width = "10px";          },
196                  ifr.style.height = "10px";  
197                  ifr.style.border = "none";          reset: function() {
198                  if (document.all) {                  Meteor.log("Stream reset");
199                          ifr.style.display = "none";                  Meteor.ping();
200                  } else {                  Meteor.callbacks["reset"]();
201                          ifr.style.position = "absolute";                  var now = new Date();
202                          ifr.style.marginTop = "-10px";                  var t = now.getTime();
203                          ifr.style.zIndex = "-20";                  var x = Meteor.pollfreq - (t-Meteor.lastrequest);
204                  }                  if (x < 10) x = 10;
205                  ifr.id = "meteorframe_"+this.instID;                  setTimeout(Meteor.connect, x);
206                  document.body.appendChild(ifr);          },
207                  this.frameurl = "http://"+this.subdomain+"."+location.hostname+"/poll.html";  
208                  this.frameload();          eof: function() {
209                  this.recvtimes[0] = t;                  Meteor.callbacks["eof"]();
210                  if (this.updatepollfreqtimer) clearTimeout(this.updatepollfreqtimer);          },
211                  this.updatepollfreqtimer = setInterval(this.updatepollfreq.bind(this), 2500);  
212          }          updatepollfreq: function() {
213          this.lastrequest = t;                  var now = new Date();
214  }                  var t = now.getTime();
215                    var avg = 0;
216  Meteor.prototype.pollmode = function() {                  for (var i=1; i<Meteor.recvtimes.length; i++) {
217          this.mode="poll";                          avg += (Meteor.recvtimes[i]-Meteor.recvtimes[i-1]);
218          this.start();                  }
219          this.callback_changemode("poll");                  avg += (t-Meteor.recvtimes[Meteor.recvtimes.length-1]);
220          this.lastpingtime = false;                  avg /= Meteor.recvtimes.length;
221  }                  var target = avg/2;
222                    if (target < Meteor.pollfreq && Meteor.pollfreq > Meteor.minpollfreq) Meteor.pollfreq = Math.ceil(Meteor.pollfreq*0.9);
223  Meteor.prototype.process = function(id, data) {                  if (target > Meteor.pollfreq && Meteor.pollfreq < Meteor.maxpollfreq) Meteor.pollfreq = Math.floor(Meteor.pollfreq*1.05);
224          if (id > this.lastmsgreceived) {          },
225                  this.callback_process(data);  
226                  if (id != -1) this.lastmsgreceived = id;          registerEventCallback: function(evt, funcRef) {
227                  if (this.mode=="poll") {                  Function.prototype.andThen=function(g) {
228                          var now = new Date();                          var f=this;
229                          var t = now.getTime();                          var a=Meteor.arguments
230                          this.recvtimes[this.recvtimes.length] = t;                          return function(args) {
231                          while (this.recvtimes.length > 5) this.recvtimes.shift();                                  f(a);g(args);
232                  }                          }
233          } else if (id == -1) {                  };
234                  this.ping();                  if (typeof Meteor.callbacks[evt] == "function") {
235          }                          Meteor.callbacks[evt] = (Meteor.callbacks[evt]).andThen(funcRef);
236          this.setstatus(5);                  } else {
237  }                          Meteor.callbacks[evt] = funcRef;
238                    }
239  Meteor.prototype.ping = function() {          },
240          if (this.mode=="stream" && this.pingtimer) {  
241                  clearTimeout(this.pingtimer);          frameloadtimeout: function() {
242                  var f = this.pollmode.bind(this);                  Meteor.log("Frame load timeout");
243                  this.pingtimer = setTimeout(f, this.pingtimeout);                  if (Meteor.frameloadtimer) clearTimeout(Meteor.frameloadtimer);
244                  var now = new Date();                  Meteor.setstatus(3);
245                  this.lastpingtime = now.getTime();                  setTimeout(Meteor.connect, 5000);
246          }          },
247          this.setstatus(5);  
248  }          extract_xss_domain: function(old_domain) {
249                    if (old_domain.match(/^(\d{1,3}\.){3}\d{1,3}$/)) return old_domain;
250  Meteor.prototype.reset = function() {                  domain_pieces = old_domain.split('.');
251          var now = new Date();                  return domain_pieces.slice(-2, domain_pieces.length).join(".");
252          var t = now.getTime();          },
253          var x = this.pollfreq - (t-this.lastrequest);  
254          if (x < 10) x = 10;          setstatus: function(newstatus) {
255          this.ping();                  // Statuses:    0 = Uninitialised,
256          this.callback_reset();                  //                              1 = Loading stream,
257          setTimeout(this.start.bind(this), x);                  //                              2 = Loading controller frame,
258  }                  //                              3 = Controller frame timeout, retrying.
259                    //                              4 = Controller frame loaded and ready
260  Meteor.prototype.eof = function() {                  //                              5 = Receiving data
261          this.callback_eof();  
262  }                  if (Meteor.status != newstatus) {
263                            Meteor.status = newstatus;
264  Meteor.prototype.get = function(varname) {                          Meteor.callbacks["statuschanged"](newstatus);
265          eval("var a = this."+varname+";");                  }
266          if (typeof(a) == "undefined") throw "Cannot get value of "+varname;          },
267          return a;  
268  }          log: function(logstr) {
269                    if (Meteor.debugmode) {
270  Meteor.prototype.increasepolldelay = function() {                          if (window.console) {
271          this.pollfreq *= 2;                                  window.console.log(logstr);
272  }                          } else if (document.getElementById("meteorlogoutput")) {
273                                    document.getElementById("meteorlogoutput").innerHTML += logstr+"<br/>";
274  Meteor.prototype.updatepollfreq = function() {                          }
275          if (this.smartpoll) {                  }
276                  var now = new Date();          }
277                  var t = now.getTime();  }
278                  var avg = 0;  
279                  for (var i=1; i<this.recvtimes.length; i++) {  var oldonunload = window.onunload;
280                          var x = (this.recvtimes[i]-this.recvtimes[i-1]);  if (typeof window.onunload != 'function') {
281                          avg += (x>60000)? 60000 : x;          window.onunload = Meteor.disconnect;
282                  }  } else {
283                  x = (t-this.recvtimes[this.recvtimes.length-1]);          window.onunload = function() {
284                  avg += (x>180000)? 180000 : x;                  if (oldonunload) oldonunload();
285                  avg /= this.recvtimes.length;                  Meteor.disconnect();
286                  if ((avg/3) < this.pollfreq && (avg/3) >= this.minpollfreq) this.pollfreq = Math.ceil(this.pollfreq*0.9);          }
                 if ((avg/3) > this.pollfreq) this.pollfreq = Math.floor(this.pollfreq*1.05);  
         }  
 }  
   
 Meteor.prototype.registerEventCallback = function(evt, funcRef) {  
         if (evt=="process") {  
                 this.callback_process = (this.callback_process).andThen(funcRef);  
         } else if (evt=="reset") {  
                 this.callback_reset = (this.callback_reset).andThen(funcRef);  
         } else if (evt=="eof") {  
                 this.callback_eof = (this.callback_eof).andThen(funcRef);  
         } else if (evt=="changemode") {  
                 this.callback_changemode = (this.callback_changemode).andThen(funcRef);  
         } else if (evt=="changestatus") {  
                 this.callback_statuschanged = (this.callback_statuschanged).andThen(funcRef);  
         }  
 }  
   
 Meteor.prototype.frameload = function() {  
         this.setstatus(2);  
         if (document.getElementById("meteorframe_"+this.instID)) {  
                 var f = this.frameloadtimeout.bind(this);  
                 this.frameloadtimer = setTimeout(f, 5000);  
                 document.getElementById("meteorframe_"+this.instID).src = "about:blank";  
                 setTimeout(this.doloadurl.bind(this), 100);  
         }  
 }  
 Meteor.prototype.doloadurl = function() {  
         var now = new Date();  
         var t = now.getTime();  
         document.getElementById("meteorframe_"+this.instID).src = this.frameurl+"?nocache="+t;  
 }  
 Meteor.prototype.frameloadtimeout = function() {  
         if (this.frameloadtimer) clearTimeout(this.frameloadtimer);  
         this.setstatus(3);  
         this.frameload();  
 }  
 Meteor.prototype.setstatus = function(newstatus) {  
         if (this.status != newstatus) {  
                 this.status = newstatus;  
                 this.callback_statuschanged(newstatus);  
         }  
 }  
   
 Meteor.createCookie = function(name,value,days) {  
         if (days) {  
                 var date = new Date();  
                 date.setTime(date.getTime()+(days*24*60*60*1000));  
                 var expires = "; expires="+date.toGMTString();  
         }  
         else var expires = "";  
         document.cookie = name+"="+value+expires+"; path=/";  
 }  
   
 Meteor.readCookie = function(name) {  
         var nameEQ = name + "=";  
         var ca = document.cookie.split(';');  
         for(var i=0;i < ca.length;i++) {  
                 var c = ca[i];  
                 while (c.charAt(0)==' ') c = c.substring(1,c.length);  
                 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);  
         }  
         return null;  
 }  
   
 Meteor.eraseCookie = function(name) {  
         createCookie(name,"",-1);  
287  }  }

Legend:
Removed from v.8  
changed lines
  Added in v.39

  ViewVC Help
Powered by ViewVC 1.1.26