の形で呼ぶ。
//
// anchor_idはフレームを使う場合最低限各フレームごとに設定。お互い他のフレームを書換えたときにへんな干渉をさけるため。
// その他ページの種別毎などで変えてもよいが、あまり小分けにするとcookieが増える。
// 同じanchor_idで保存されるcookieは1セットのみ。でも単独ページ表示のサイトなら概ねこれで充分。
anchor_id = "anc_main";
noanchor = false; // bodyにanchorをしかけたときなど場合によって一時無効にするためのフラグ。
// アンカーの記憶。
function anchor_save(object_id, page_id) {
if(noanchor) { anchor_erase(); return; }
get_scroll();
setcookie(anchor_id+"_pid", page_id, 0);
setcookie(anchor_id+"_st", scroll_top, 0);
setcookie(anchor_id+"_sl", scroll_left, 0);
if(object_id) {
object_top = scroll_top + get_object_top(object_id);
object_left = scroll_left + get_object_left(object_id);
setcookie(anchor_id+"_oid", object_id, 0);
setcookie(anchor_id+"_ot", object_top, 0);
setcookie(anchor_id+"_ol", object_left, 0);
} else {
setcookie(anchor_id+"_oid", "", -1);
setcookie(anchor_id+"_ot", "", -1);
setcookie(anchor_id+"_ol", "", -1);
}
}
// アンカーの適用。
function anchor_apply(page_id) {
if((saved_page_id = getcookie(anchor_id+"_pid")) && page_id != saved_page_id) { return; }
get_scroll();
if((anchor_st = getcookie(anchor_id+"_st")) != "" && (anchor_sl = getcookie(anchor_id+"_sl")) != "") {
anchor_st = parseInt(anchor_st);
anchor_sl = parseInt(anchor_sl);
} else {
anchor_st = scroll_top;
anchor_sl = scroll_left;
}
if((object_id = getcookie(anchor_id+"_oid"))
&& (anchor_ot = getcookie(anchor_id+"_ot")) != ""
&& (anchor_ol = getcookie(anchor_id+"_ol")) != "") {
offset_top = (scroll_top + get_object_top(object_id)) - parseInt(anchor_ot);
offset_left = (scroll_left + get_object_left(object_id)) - parseInt(anchor_ol);
} else {
offset_top = offset_left = 0;
}
window.scrollTo(anchor_sl + offset_left, anchor_st + offset_top);
}
// アンカー消去。あえてとっておく必要がなければanchor_apply()後すぐ消去が望ましい。
function anchor_erase() {
setcookie(anchor_id+"_pid", "", -1);
setcookie(anchor_id+"_st", "", -1);
setcookie(anchor_id+"_sl", "", -1);
setcookie(anchor_id+"_oid", "", -1);
setcookie(anchor_id+"_ot", "", -1);
setcookie(anchor_id+"_ol", "", -1);
}
//-->
倉金家ホームページ
趣味の部屋/サーバー構築メモ その3
|
|
大容量のSDカードを使う必要が出た。64GBなのでフォーマットがexFATというやつで、CentOS6ではそのままでは認識しない。
調べてみると、 http://www.torutk.com/projects/swe/wiki/Linux%E3%81%A7exFAT%E3%82%92%E4%BD%BF%E7%94%A8 に記事があり、まずは試してみる。
|
https://rpmfusion.org/ にアクセスし、表から EL -> 6 -> updates -> x86_64 をたどり, 以下2点をダウンロード。 exfat-utils-1.3.0-1.el6.x86_64.rpm fuse-exfat-1.3.0-1.el6.x86_64.rpm 引き続きインストール。 # rpm -ivh ./exfat-utils-1.3.0-1.el6.x86_64.rpm 警告: ./exfat-utils-1.3.0-1.el6.x86_64.rpm: ヘッダ V4 RSA/SHA1 Signature, key ID 849c449f: NOKEY 準備中... ########################################### [100%] 1:exfat-utils ########################################### [100%] # rpm -ivh ./fuse-exfat-1.3.0-1.el6.x86_64.rpm 警告: ./fuse-exfat-1.3.0-1.el6.x86_64.rpm: ヘッダ V4 RSA/SHA1 Signature, key ID 849c449f: NOKEY 準備中... ########################################### [100%] 1:fuse-exfat ########################################### [100%] #
|
SDXCカードはUSBのカードリーダーに挿して使う。 念のためPCを一度再起動して、messageログを見ながらUSBカードリーダーを挿してみる。 ........ Mar 22 10:59:05 cosmos kernel: usbcore: registered new interface driver usb-storage Mar 22 10:59:05 cosmos kernel: USB Mass Storage support registered. Mar 22 10:59:06 cosmos kernel: scsi 6:0:0:0: Direct-Access Generic STORAGE DEVICE 9910 PQ: 0 ANSI: 0 Mar 22 10:59:06 cosmos kernel: sd 6:0:0:0: Attached scsi generic sg3 type 0 Mar 22 10:59:06 cosmos kernel: sd 6:0:0:0: [sdc] 121864192 512-byte logical blocks: (62.3 GB/58.1 GiB) Mar 22 10:59:06 cosmos kernel: sd 6:0:0:0: [sdc] Write Protect is off Mar 22 10:59:06 cosmos kernel: sd 6:0:0:0: [sdc] Assuming drive cache: write through Mar 22 10:59:06 cosmos kernel: sd 6:0:0:0: [sdc] Assuming drive cache: write through Mar 22 10:59:06 cosmos kernel: sdc: sdc1 Mar 22 10:59:06 cosmos kernel: sd 6:0:0:0: [sdc] Assuming drive cache: write through Mar 22 10:59:06 cosmos kernel: sd 6:0:0:0: [sdc] Attached SCSI removable disk ........
どうやらsdc1として認識されるらしい。 で、/mnt/usb-sdxc なるディレクトリをつくっておく。 # mount -t exfat /dev/sdc1 /mnt/usb-sdxc でマウントできた。中身も見れる。 # umount /mnt/usb-sdxc でアンマウント。 あとはデスクトップにマウント、アンマウント操作、及びマウントされたディレクトリを開くためのリンクなりデスクトップ設定ファイルをつくって置いておけばよい。
|
|
|