2005-10-19 [長年日記]

高橋メソッドReturnsに「オートクルーズ」機能を作ってみた

火曜日に向けて改造してみた。とりあえず、2秒固定で。
*** takahashi.xul.org	Sat Oct 15 13:21:59 2005
--- takahashi.xul	Thu Oct 20 01:08:31 2005
***************
*** 272,277 ****
--- 272,281 ----
  			</vbox>
  			<toolbarseparator/>
  			<spacer flex="1"/>
+ 			<toolbarbutton label="auto"
+ 				id="autoButton"
+ 				type="checkbox"
+ 				oncommand="Presentation.toggleAutoCruiseMode();" />
  			<toolbarbutton label="Pen"
  				id="penButton"
  				type="checkbox"
***************
*** 869,874 ****
--- 873,903 ----
  		this.setHash('eva', check.checked ? 'eva' : '' );
  	},
  
+ 	toggleAutoCruiseMode : function()
+ 	{
+ 		var autoCruise = document.getElementById('autoButton');
+ 		if(!autoCruise.checked)
+ 		{
+ 			window.setTimeout(this.autoCruise,2000);
+ 		}
+ 		autoCruise.checked != autoCruise.checked;
+ 	},
+ 
+ 	autoCruise : function()
+ 	{
+ 		var autoCruise = document.getElementById('autoButton');
+ 		if(autoCruise.checked)
+ 		{
+ 			if(Presentation.offset == Presentation.data.length-1)
+ 			{
+ 				Presentation.home();
+ 			} else {
+ 				Presentation.forwardStep();
+ 			}
+ 			window.setTimeout(arguments.callee, 2000, {});
+ 		}
+ 	},
+ 
  	setHash : function(aKey, aValue)
  	{
  		aKey = String(aKey).toLowerCase();
本日のツッコミ(全5件) [ツッコミを入れる]
kzslim (2005-10-20 04:27)

たのしみ

Piro (2005-10-20 04:27)

インターバルを変更できるようにした上で<br>本体の方にも取り込ませていただきました。

matobaa (2005-10-20 10:31)

はやっ! しかも機能追加&コーディング規約に合うように修正されてたり。<br>ありがとございまーす。

Piro (2005-10-20 13:57)

あう。コーディング規約は好みで変えたり変えなかったりします。行き当たりばったりです。

matobaa (2007-11-02 10:47)

そうそう、ライセンスを書いてなかったけど本体に合わせてMPL1.1でお願いします。念のため。

[]

«前の日記(2005-09-30) 最新 次の日記(2005-11-01)»