ウィリアムのいたずらの、まちあるき、たべあるき

ウィリアムのいたずらが、街歩き、食べ物、音楽等の個人的見解を主に書くブログです(たま~にコンピューター関係も)

オープンソース資料、文書

2008-06-13 20:22:54 | Weblog

などがおいてあるところ、メモメモ。
ここ
http://opentechpress.jp/docs/

(以下斜体は上記サイトの目次より)

オープンソースライセンス、定義
・ オープンソースライセンス日本語参考訳
GPL、 BSD、 Apache2、 CPL、 MPL1.1、 etc..
・ オープンソースの定義
・ Debian社会契約
オープンソース資料、文書
・ BCG/OSDN、ハッカー意識調査結果
・ 伽藍とバザール
・ ノウアスフィアの開墾
・ 魔法のおなべ
Linuxカーネル文書
・ Linux ver2.2カーネル内部解析報告 (第3版)
・ Linux ver2.4カーネル内部解析報告 (ドラフト第4版)
過去イベント資料
・ VA Linux Kernel Forum 2002 講演資料
・ Linux Kernel Conference 2002 講演資料
・ オープンソースウェイ講演資料


Linuxカーネル文書とか、きょうみしんしん


  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

複数選択したものを、ドラッグ&ドロップして位置移動するHTML

2008-06-13 18:18:18 | Weblog

 ただし、使ってみると、おもったより使いにくい。
 複数選択して、(いや、ひとつ選択したときでもいいんだけど)
 "選択したとき"(青になったとき)に指をマウスから離さず、ドラッグアンドドロップしたら、複数選択したものが動くという仕組みのJavaScript

<html>
<head><title>てすと</title>
<SCRIPT Language="JavaScript">
<!--

var xpos = new Array(3); //	コメントのX座標
var ypos = new Array(3); //	コメントのy座標
var hi = new Array(3);	//	コメント幅
var wid = new Array(3);	//	コメント高さ
var chk = new Array(3);	//	選択されているかどうか

var nowx;
var nowy;

var flg = 0;

function Load()
{
	xpos[0] = 0;
	xpos[1] = 0;
	xpos[2] = 0;
	div11.style.left	=	xpos[0];
	div12.style.left	=	xpos[1];
	div13.style.left	=	xpos[2];

	ypos[0] = 100;
	ypos[1] = 200;
	ypos[2] = 300;
	div11.style.top		=	ypos[0];
	div12.style.top		=	ypos[1];
	div13.style.top		=	ypos[2];

	wid[0] = 100;
	wid[1] = 100;
	wid[2] = 100;
	div11.style.width	=	wid[0];
	div12.style.width	=	wid[1];
	div13.style.width	=	wid[2];

	hi[0] = 20;
	hi[1] = 20;
	hi[2] = 20;
	div11.style.height	=	hi[0];
	div12.style.height	=	hi[1];
	div13.style.height	=	hi[2];

	chk[0] = 0;
	chk[1] = 0;
	chk[2] = 0;

}

function mdown()
{
	nowx = event.clientX;
	nowy = event.clientY;
	for ( i = 0 ; i < 3 ; i ++ )
	{
		if(  ( xpos[i] <= nowx ) && ( xpos[i]+wid[i] >= nowx )  &&
		     ( ypos[i] <= nowy ) && ( ypos[i]+hi[i] >= nowy ) )
		{
			if ( chk[i]	==	0 )
			{
				flg	=	1;
				chk[i]	=	1;
				chgclr(i,"blue");
			}
			else
			{
				flg	=	0;
				chk[i]	=	0;
				chgclr(i,"red");
			}
		}
	}
}

function mmove()
{
	if ( flg	==	0 )
	{
		return;
	}

	posx = event.clientX;
	posy = event.clientY;
	for ( i = 0 ; i < 3 ; i ++ )
	{
		if( chk[i] == 1 )
		{
			xpos[i] = xpos[i] +posx - nowx;
			ypos[i] = ypos[i] +posy - nowy;
			switch(i)
			{
			case	0:
				div11.style.left	=	xpos[0];
				div11.style.top		=	ypos[0];
				break;
			case	1:
				div12.style.left	=	xpos[1];
				div12.style.top		=	ypos[1];
				break;
			case	2:
				div13.style.left	=	xpos[2];
				div13.style.top		=	ypos[2];
				break;
			}
		}
	}
	nowx	=	posx;
	nowy	=	posy;
}

function mup()
{
	flg	=	0;
}

function chgclr(pos,col)
{
	switch(pos)
	{
	case	0:
		div11.style.backgroundColor	=	col;
		break;
	case	1:
		div12.style.backgroundColor	=	col;
		break;
	case	2:
		div13.style.backgroundColor	=	col;
		break;
	}
}
// -->
</SCRIPT>

</head>
<body  onload="Load()">
<div id=div1 style="position:absolute;top:0;left:0;width:500;height:500;x-index:1;"
 onMouseDown="mdown()" onMouseMove="mmove()" onMouseUp="mup()">
<iframe src="http://slashdot.jp/it/08/06/06/0719236.shtml"
 scrolling="no" width="500" height="500">
</iframe>


<div id=div11 style="position:absolute;x-index:2;background-color:red;">コメント1
</div>
<div id=div12 style="position:absolute;x-index:2;background-color:red;">コメント2
</div>
<div id=div13 style="position:absolute;x-index:2;background-color:red;">コメント3
</div>

</div>

</body>
</html>

(上記< > は、本当は半角)
うーん、ちょっとやりにくいかなあ。。
選択は、ダブルクリックのほうが、いいんですかね?
 

  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする