svnno****@sourc*****
svnno****@sourc*****
2009年 6月 22日 (月) 21:05:12 JST
Revision: 1227 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1227 Author: dhrname Date: 2009-06-22 21:05:12 +0900 (Mon, 22 Jun 2009) Log Message: ----------- synchParserの修正とテスト Modified Paths: -------------- branches/05x/051/sie.js Modified: branches/05x/051/sie.js =================================================================== --- branches/05x/051/sie.js 2009-06-22 11:41:43 UTC (rev 1226) +++ branches/05x/051/sie.js 2009-06-22 12:05:12 UTC (rev 1227) @@ -1854,14 +1854,14 @@ return false; } } -//_synchParserメソッド。begin属性の値などの解析を行う。 -Date.prototype._synchParser(str) { - var mode = 0, pool = "", midValue = idValue = null; - for (var i=0,sti=str.length;i<stri;++i) { +//synchParserメソッド。begin属性の値などの解析を行う。 +Date.prototype.synchParser = function(str) { + var mode = 0, pool = "", midValue = null, idValue = null; + for (var i=0,sti=str.length;i<sti;++i) { var stri = str.charAt(i); switch (mode) { case 0: - if ("+-".indexOf(stri) !== -1 || stri.test(/[1-9]/)) { + if ("+-".indexOf(stri) !== -1 || /[0-9]/.test(stri)) { mode = 1; } else { mode = 12; @@ -1907,13 +1907,13 @@ this.event = midValue || pool; } var beginEvent = new Date(), endEvent = new Date(), _currentTime = 0; -beginEvent.setClockValue("00:02"); -endEvent.setClockValue("00:04"); +beginEvent.synchParser("id.event-00:02"); +endEvent.synchParser("00:04"); beginEvent.indefinite = false; endEvent.indefinite = false; setInterval((function() { if (beginEvent.isFired(_currentTime) && !endEvent.isFired(_currentTime)) { - alert(""); + alert(beginEvent.event); } _currentTime += 100; }),41)