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

Legend:
Removed from v.7  
changed lines
  Added in v.60

  ViewVC Help
Powered by ViewVC 1.1.26