关于GMAIL的容量

//new Date(CP[X][0]).toString()		CP[X][1]
//"Fri Jan 04 2008 16:00"		6283
//"Mon Oct 20 2008 15:00"		7254
//"Sun Dec 20 2037 16:00"		10996
//"Sun Jan 17 2038 16:00"		43008
//"Wed Jan 02 3456 15:00"		1.7976931348623157e+308
function updateQuota() {
  if (!quota_elem) {
    return;
  }
  var now = (new Date()).getTime();
  var i;
  for (i = 0; i < CP.length; i++) {
    if (now < CP[i][0]) {
      break;
    }
  }
  if (i == 0) {
    setTimeout(updateQuota, 1000);
  } else if (i == CP.length) {
    quota_elem.innerHTML = CP[i - 1][1];
  } else {
    var ts = CP[i - 1][0];
    var bs = CP[i - 1][1];
    quota_elem.innerHTML = format(((now - ts) / (CP[i][0] - ts) * (CP[i][1] - bs)) + bs);
    setTimeout(updateQuota, 1000);
  }
}

  

在gmail首页发呆,看到那变动的数字,就翻了下源码……

posted @ 2011-12-11 14:59  Arliang  阅读(163)  评论(0编辑  收藏  举报