/[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 61 by andrew.betts, Thu Apr 17 20:03:54 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.status != 6) 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.status != 6) 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);                          Meteor.log("Disconnected");
102  }                          try { Meteor.frameref.parentNode.removeChild(Meteor.frameref); delete Meteor.frameref; return true; } catch(e) { }
103                            try { Meteor.frameref.open(); Meteor.frameref.close(); return true; } catch(e) {}                      
104  Meteor.setServerTime = function(timestamp) {                  }
105          var now = new Date();          },
106          var clienttime = (now.getTime() / 1000);          
107          Meteor.servertimeoffset = timestamp - clienttime;          selectStreamTransport: function() {
108  }                  try {
109                            var test = ActiveXObject;
110  Meteor.prototype.start = function() {                          return "iframe";
111          this.persist = (this.maxmessages)?1:0;                  } catch (e) {}
112          this.smartpoll = (this.smartpoll)?1:0;                  if ((typeof window.addEventStream) == "function") return "iframe";
113          this.mode = (this.mode=="stream")?"stream":"poll";                  return "xhrinteractive";
114          if (!this.subdomain || !this.channel) throw "Channel or Meteor subdomain host not specified";          },
115          var now = new Date();  
116          var t = now.getTime();          getSubsUrl: function() {
117          if (typeof(this.transferDoc)=="object") {                  var surl = "http://" + Meteor.host + ((Meteor.port==80)?"":":"+Meteor.port) + "/push/" + Meteor.hostid + "/" + Meteor.mode;
118                  this.transferDoc.open();                  for (var c in Meteor.channels) {
119                  this.transferDoc.close();                          surl += "/"+c;
120                  delete this.transferDoc;                          if (typeof Meteor.channels[c].lastmsgreceived != 'undefined' && Meteor.channels[c].lastmsgreceived >= 0) {
121          }                                  surl += ".r"+(Meteor.channels[c].lastmsgreceived+1);
122          if (document.getElementById("meteorframe_"+this.instID)) {                          } else if (Meteor.channels[c].backtrack > 0) {
123                  document.body.removeChild(document.getElementById("meteorframe_"+this.instID));                                  surl += ".b"+Meteor.channels[c].backtrack;
124          }                          } else if (Meteor.channels[c].backtrack != undefined) {
125          if (this.mode=="stream") {                                  surl += ".h";
126                  if (document.all) {                          }
127                          this.setstatus(1);                  }
128                          this.transferDoc = new ActiveXObject("htmlfile");                  var now = new Date();
129                          this.transferDoc.open();                  surl += "?nc="+now.getTime();
130                          this.transferDoc.write("<html>");                  return surl;
131                          this.transferDoc.write("<script>document.domain=\""+(document.domain)+"\";</"+"script>");          },
132                          this.transferDoc.write("</html>");  
133                          var selfref = this;          loadFrame: function(url) {
134                          this.transferDoc.parentWindow.Meteor = Meteor;                  try {
135                          this.transferDoc.close();                          if (!Meteor.frameref) {
136                          var ifrDiv = this.transferDoc.createElement("div");                                  var transferDoc = new ActiveXObject("htmlfile");
137                          this.transferDoc.appendChild(ifrDiv);                                  Meteor.frameref = transferDoc;
138                          var url = "http://"+this.subdomain+"."+location.hostname+"/"+this.dynamicpageaddress+"?channel="+this.channel+"&id="+this.MHostId;                          }
139                          if (this.lastmsgreceived >= 0) {                          Meteor.frameref.open();
140                                  url += "&restartfrom="+this.lastmsgreceived;                          Meteor.frameref.write("<html><script>");
141                          } else if (this.backtrack > 0) {                          Meteor.frameref.write("document.domain=\""+(document.domain)+"\";");
142                                  url += "&backtrack="+this.backtrack;                          Meteor.frameref.write("</"+"script></html>");
143                          } else if (this.backtrack < 0 || isNaN(this.backtrack)) {                          Meteor.frameref.parentWindow.Meteor = Meteor;
144                                  url += "&restartfrom=";                          Meteor.frameref.close();
145                          }                          var ifrDiv = Meteor.frameref.createElement("div");
146                          ifrDiv.innerHTML = "<iframe id=\"meteorframe_"+this.instID+"\" src=\""+url+"&nocache="+t+"\" style=\"display: none;\"></iframe>";                          Meteor.frameref.appendChild(ifrDiv);
147                  } else {                          ifrDiv.innerHTML = "<iframe src=\""+url+"\"></iframe>";
148                          var ifr = document.createElement("IFRAME");                  } catch (e) {
149                          ifr.style.width = "10px";                          if (!Meteor.frameref) {
150                          ifr.style.height = "10px";                                  var ifr = document.createElement("IFRAME");
151                          ifr.style.border = "none";                                  ifr.style.width = "10px";
152                          ifr.style.position = "absolute";                                  ifr.style.height = "10px";
153                          ifr.style.top = "-10px";                                  ifr.style.border = "none";
154                          ifr.style.marginTop = "-10px";                                  ifr.style.position = "absolute";
155                          ifr.style.zIndex = "-20";                                  ifr.style.top = "-10px";
156                          ifr.id = "meteorframe_"+this.instID;                                  ifr.style.marginTop = "-10px";
157                          document.body.appendChild(ifr);                                  ifr.style.zIndex = "-20";
158                          this.frameurl = "http://"+this.subdomain+"."+location.hostname+"/stream.html";                                  ifr.Meteor = Meteor;
159                          this.frameload();                                  document.body.appendChild(ifr);
160                  }                                  Meteor.frameref = ifr;
161                  var f = this.pollmode.bind(this);                          }
162                  clearTimeout(this.pingtimer);                          Meteor.frameref.setAttribute("src", url);
163                  this.pingtimer = setTimeout(f, this.pingtimeout);                  }
164                    Meteor.log("Loading URL '"+url+"' into frame...");
165          } else {                  Meteor.frameloadtimer = setTimeout(Meteor.frameloadtimeout, 5000);
166                  var ifr = document.createElement("IFRAME");          },
167                  ifr.style.width = "10px";  
168                  ifr.style.height = "10px";          pollmode: function() {
169                  ifr.style.border = "none";                  Meteor.log("Ping timeout");
170                  if (document.all) {                  if (Meteor.mode != "smartpoll") {
171                          ifr.style.display = "none";                          Meteor.mode="smartpoll";
172                  } else {                          Meteor.callbacks["changemode"]("poll");
173                          ifr.style.position = "absolute";                          clearTimeout(Meteor.pingtimer);
174                          ifr.style.marginTop = "-10px";                          Meteor.lastpingtime = false;
175                          ifr.style.zIndex = "-20";                  }
176                  }                  Meteor.connect();
177                  ifr.id = "meteorframe_"+this.instID;          },
178                  document.body.appendChild(ifr);  
179                  this.frameurl = "http://"+this.subdomain+"."+location.hostname+"/poll.html";          process: function(id, channel, data) {
180                  this.frameload();                  if (id == -1) {
181                  this.recvtimes[0] = t;                          Meteor.log("Ping");
182                  if (this.updatepollfreqtimer) clearTimeout(this.updatepollfreqtimer);                          Meteor.ping();
183                  this.updatepollfreqtimer = setInterval(this.updatepollfreq.bind(this), 2500);                  } else if (typeof(Meteor.channels[channel]) != "undefined") {
184          }                          Meteor.log("Message "+id+" received on channel "+channel+" (last id on channel: "+Meteor.channels[channel].lastmsgreceived+")\n"+data);
185          this.lastrequest = t;                          Meteor.callbacks["process"](data);
186  }                          Meteor.channels[channel].lastmsgreceived = id;
187                            if (Meteor.mode=="smartpoll") {
188  Meteor.prototype.pollmode = function() {                                  var now = new Date();
189          this.mode="poll";                                  Meteor.recvtimes[Meteor.recvtimes.length] = now.getTime();
190          this.start();                                  while (Meteor.recvtimes.length > 5) Meteor.recvtimes.shift();
191          this.callback_changemode("poll");                          }
192          this.lastpingtime = false;                  }
193  }                  Meteor.setstatus(5);
194            },
195  Meteor.prototype.process = function(id, data) {  
196          if (id > this.lastmsgreceived) {          ping: function() {
197                  this.callback_process(data);                  if (Meteor.pingtimer) {
198                  if (id != -1) this.lastmsgreceived = id;                          clearTimeout(Meteor.pingtimer);
199                  if (this.mode=="poll") {                          Meteor.pingtimer = setTimeout(Meteor.pollmode, Meteor.pingtimeout);
200                          var now = new Date();                          var now = new Date();
201                          var t = now.getTime();                          Meteor.lastpingtime = now.getTime();
202                          this.recvtimes[this.recvtimes.length] = t;                  }
203                          while (this.recvtimes.length > 5) this.recvtimes.shift();                  Meteor.setstatus(5);
204                  }          },
205          } else if (id == -1) {  
206                  this.ping();          reset: function() {
207          }                  if (Meteor.status != 6 && Meteor.status != 0) {
208          this.setstatus(5);                          Meteor.log("Stream reset");
209  }                          Meteor.ping();
210                            Meteor.callbacks["reset"]();
211  Meteor.prototype.ping = function() {                          var now = new Date();
212          if (this.mode=="stream" && this.pingtimer) {                          var t = now.getTime();
213                  clearTimeout(this.pingtimer);                          var x = Meteor.pollfreq - (t-Meteor.lastrequest);
214                  var f = this.pollmode.bind(this);                          if (x < 10) x = 10;
215                  this.pingtimer = setTimeout(f, this.pingtimeout);                          setTimeout(Meteor.connect, x);
216                  var now = new Date();                  }
217                  this.lastpingtime = now.getTime();          },
218          }  
219          this.setstatus(5);          eof: function() {
220  }                  Meteor.log("Received end of stream, will not reconnect");
221                    Meteor.callbacks["eof"]();
222  Meteor.prototype.reset = function() {                  Meteor.setstatus(6);
223          var now = new Date();                  Meteor.disconnect();
224          var t = now.getTime();          },
225          var x = this.pollfreq - (t-this.lastrequest);  
226          if (x < 10) x = 10;          channelInfo: function(channel, id) {
227          this.ping();                  Meteor.channels[channel].lastmsgreceived = id;
228          this.callback_reset();                  Meteor.log("Received channel info for channel "+channel+": resume from "+id);
229          setTimeout(this.start.bind(this), x);          },
230  }  
231            updatepollfreq: function() {
232  Meteor.prototype.eof = function() {                  var now = new Date();
233          this.callback_eof();                  var t = now.getTime();
234  }                  var avg = 0;
235                    for (var i=1; i<Meteor.recvtimes.length; i++) {
236  Meteor.prototype.get = function(varname) {                          avg += (Meteor.recvtimes[i]-Meteor.recvtimes[i-1]);
237          eval("var a = this."+varname+";");                  }
238          if (typeof(a) == "undefined") throw "Cannot get value of "+varname;                  avg += (t-Meteor.recvtimes[Meteor.recvtimes.length-1]);
239          return a;                  avg /= Meteor.recvtimes.length;
240  }                  var target = avg/2;
241                    if (target < Meteor.pollfreq && Meteor.pollfreq > Meteor.minpollfreq) Meteor.pollfreq = Math.ceil(Meteor.pollfreq*0.9);
242  Meteor.prototype.increasepolldelay = function() {                  if (target > Meteor.pollfreq && Meteor.pollfreq < Meteor.maxpollfreq) Meteor.pollfreq = Math.floor(Meteor.pollfreq*1.05);
243          this.pollfreq *= 2;          },
244  }  
245            registerEventCallback: function(evt, funcRef) {
246  Meteor.prototype.updatepollfreq = function() {                  Function.prototype.andThen=function(g) {
247          if (this.smartpoll) {                          var f=this;
248                  var now = new Date();                          var a=Meteor.arguments
249                  var t = now.getTime();                          return function(args) {
250                  var avg = 0;                                  f(a);g(args);
251                  for (var i=1; i<this.recvtimes.length; i++) {                          }
252                          var x = (this.recvtimes[i]-this.recvtimes[i-1]);                  };
253                          avg += (x>60000)? 60000 : x;                  if (typeof Meteor.callbacks[evt] == "function") {
254                  }                          Meteor.callbacks[evt] = (Meteor.callbacks[evt]).andThen(funcRef);
255                  x = (t-this.recvtimes[this.recvtimes.length-1]);                  } else {
256                  avg += (x>180000)? 180000 : x;                          Meteor.callbacks[evt] = funcRef;
257                  avg /= this.recvtimes.length;                  }
258                  if ((avg/3) < this.pollfreq && (avg/3) >= this.minpollfreq) this.pollfreq = Math.ceil(this.pollfreq*0.9);          },
259                  if ((avg/3) > this.pollfreq) this.pollfreq = Math.floor(this.pollfreq*1.05);  
260          }          frameloadtimeout: function() {
261  }                  Meteor.log("Frame load timeout");
262                    if (Meteor.frameloadtimer) clearTimeout(Meteor.frameloadtimer);
263  Meteor.prototype.registerEventCallback = function(evt, funcRef) {                  Meteor.setstatus(3);
264          if (evt=="process") {                  Meteor.pollmode();
265                  this.callback_process = (this.callback_process).andThen(funcRef);          },
266          } else if (evt=="reset") {  
267                  this.callback_reset = (this.callback_reset).andThen(funcRef);          extract_xss_domain: function(old_domain) {
268          } else if (evt=="eof") {                  if (old_domain.match(/^(\d{1,3}\.){3}\d{1,3}$/)) return old_domain;
269                  this.callback_eof = (this.callback_eof).andThen(funcRef);                  domain_pieces = old_domain.split('.');
270          } else if (evt=="changemode") {                  return domain_pieces.slice(-2, domain_pieces.length).join(".");
271                  this.callback_changemode = (this.callback_changemode).andThen(funcRef);          },
272          } else if (evt=="changestatus") {  
273                  this.callback_statuschanged = (this.callback_statuschanged).andThen(funcRef);          setstatus: function(newstatus) {
274          }                  // Statuses:    0 = Uninitialised,
275  }                  //                              1 = Loading stream,
276                    //                              2 = Loading controller frame,
277  Meteor.prototype.frameload = function() {                  //                              3 = Controller frame timeout, retrying.
278          this.setstatus(2);                  //                              4 = Controller frame loaded and ready
279          if (document.getElementById("meteorframe_"+this.instID)) {                  //                              5 = Receiving data
280                  var f = this.frameloadtimeout.bind(this);                  //                              6 = End of stream, will not reconnect
281                  this.frameloadtimer = setTimeout(f, 5000);  
282                  document.getElementById("meteorframe_"+this.instID).src = "about:blank";                  if (Meteor.status != newstatus) {
283                  setTimeout(this.doloadurl.bind(this), 100);                          Meteor.status = newstatus;
284          }                          Meteor.callbacks["statuschanged"](newstatus);
285  }                  }
286  Meteor.prototype.doloadurl = function() {          },
287          var now = new Date();  
288          var t = now.getTime();          log: function(logstr) {
289          document.getElementById("meteorframe_"+this.instID).src = this.frameurl+"?nocache="+t;                  if (Meteor.debugmode) {
290  }                          if (window.console) {
291  Meteor.prototype.frameloadtimeout = function() {                                  window.console.log(logstr);
292          if (this.frameloadtimer) clearTimeout(this.frameloadtimer);                          } else if (document.getElementById("meteorlogoutput")) {
293          this.setstatus(3);                                  document.getElementById("meteorlogoutput").innerHTML += logstr+"<br/>";
294          this.frameload();                          }
295  }                  }
296  Meteor.prototype.setstatus = function(newstatus) {          }
297          if (this.status != newstatus) {  }
298                  this.status = newstatus;  
299                  this.callback_statuschanged(newstatus);  var oldonunload = window.onunload;
300          }  if (typeof window.onunload != 'function') {
301  }          window.onunload = Meteor.disconnect;
302    } else {
303  Meteor.createCookie = function(name,value,days) {          window.onunload = function() {
304          if (days) {                  if (oldonunload) oldonunload();
305                  var date = new Date();                  Meteor.disconnect();
306                  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);  
307  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26