網頁

2006年11月23日 星期四

Mozilla Firefox 操作備忘

Alt + D 游標移至網址列
Ctrl + W or Ctro關閉分頁
Ctrl + n 直接切換到第 n 個分頁 (Windows)
Alt + n 直接切換到第 n 個分頁 (Linux)
Ctrl + 滑鼠左鍵 以新的分頁開啟連結
Shift + 滑鼠左鍵 以新的視窗開啟連結
Ctrl + View->Source 開在新Tab
Ctrl + View->Source 開在側邊欄
Ctrl + K 搜尋引擎, Alt+Enter新分頁顯示結果

2006年11月19日 星期日

Sitemaps 0.90可讓網站站長通知搜尋引擎有網頁上線

CNET新聞專區:Elinor Mills  17/11/2006
「在首度攜手改善網頁索引流程的合作中,三家公司將會宣佈支援Sitemaps 0.90,它可讓網站站長通知搜尋引擎有網頁上線,以便可以更完而有效被索引(index)到,以提供他們在搜尋引擎上的可見度,」三家公司的共同新聞稿 指出。「對使用者而言,Sitemaps可確保他們得到更高質更新的搜尋結果。」

2006年11月18日 星期六

這是測試的文章, 從Google Doc發佈的

abcd
12345

2006年11月17日 星期五

irssi UTF-8 Big5 中文轉換與設定

這個Blog有詳細的說明, 簡述如下.


  • putty程式的Settings->Window->Translator設為UTF-8
  • 進screen的時候記得用screen -URD (U是使用UTF-8)
  • 進irssi後要設定
/SET term_charset UTF-8
/SET recode_transliterate ON
/SET recode_fallback UTF-8
/SET recode_out_default_charset UTF-8

/RECODE ADD #debian-zh UTF-8
/RECODE ADD #debian.tw Big5
/RECODE

irssi的設定檔存在 ~/.irssi/config

irssi 自動加入頻道

/network add OFTC(irc network)
/server add -auto -ircnet OFTC(irc network) irc.debian.org(server)
/channel add -auto #dot(channel) OFTC(irc network)

irssi命令

/server list: 列出Server
/channel list: 列出Channel
/win list: 列出視窗
/join #abc: 加入channel abc
/msg: Sends a message to a nick or a channel
/leave: 離開視窗
/quit: 離開irssi
/nick: 改名字
Alt + 數字: 切換視窗
Ctrl + n: 下一個視窗

/channel add -auto #ossf-bugteam IRCnet
/channel add -auto #elixus IRCnet
/channel add -auto #ossf IRCnet
/channel add -auto #perl.tw IRCnet
/channel add -auto #bsdchat IRCnet

Iframe自動調整高度, 在子網域SubDomain的情形

全部參考:
1.Iframe自動調整高度, 在子網域SubDomain的情形
2.處理iframe auto height(Iframe自適應高度)
3.處理iframe auto height(Iframe自適應高度) - 相關問題紀錄
4.完整的iframe auto height程式(在iframe內容頁中處理)
5.或許你想要 "html include html,兩種工具介紹。"


如果CompanyName.com要以Iframe放入srv.CompanyName.com的網頁, 這時會有cross-site的問題, 無法互相以javascript設定Iframe的高度, 因此想到要以cookie的傳遞來完成這件工作.

當然子網域是可以用簡單的方式,就是設定document.domain,例如sub.a.com和www.a.com都加上document.domain = "a.com",但這樣會延伸出安全性的問題,
1. 因為不只iframe height,其它的網頁元素或資訊,如cookie也全都可以取得。
2. 其它如other.a.com,本來希望是cross-site,但它也可以跟著設定domain。
3. 可能會提供customer.a.com給你的客戶。

所謂cross-site,不同host就是cross-site
of.openfoundry.org 和 rt.of.openfoundry.org互相是cross-site, 沒有主從關係
of.openfoundry.org 和 of.openfoundry.org/rt, path間的關係不是cross-site

適用於IE;Firefox;Opera

過程大致如下:
1.在Iframe內容頁面(srv.CompanyName.com)的onload時, 取得頁面高度, 並放在主要Domain Cookie(CompanyName.com)中.
2.在CompanyName.com的網頁中, 再於Iframe的onload時, 取得Cookie的的值, 再去設定Iframe的高度.


過程1:

function iframeAutoFit()
{
var now = new Date();
setCookie("IframeMaxHeight", this.document.body.scrollHeight,
now,"/","CompanyName.com");
}

if(window.attachEvent)
{
window.attachEvent("onload", iframeAutoFit);
}
else if(window.addEventListener)
{
window.addEventListener('load', iframeAutoFit, false);
}

function setCookie(name, value, expires, path, domain, secure) {
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
}





過程2:

<iframe id="wiki" src="Content.html" frameborder="NO" scrolling="auto"
style="width:100%; height:2000px" onload="DoIframeToMaxHeight();">
</iframe>


function DoIframeToMaxHeight(){
//某些Browser的Iframe onload事件似乎慢了一點, 或setCookie時慢了一點, 所以要等一下子
window.setTimeout('IframeToMaxHeight("wiki")',500);
}

function IframeToMaxHeight(id){
try{
document.getElementById(id).style.height =
parseInt(getCookie("IframeMaxHeight")) + 50;
}
catch (ex){}
}

function getCookie(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else
begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1)
end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
}


一些情形:

1.Iframe 的onload事件:
在Linux的Konqueror中似乎只有第一次, 之後內容的改變都不會再onload.
Mac的Safari似乎沒有這個onload事件, 因此Iframe先預設高度為2000px.
而IE 6; Firefox 2; Opera 9都沒有問題.
2.在Konqueror3.5中Iframe會蓋住Div
3.觀看時調整字型變大時, 不會立即有反應, 而會出會Scroll Bar.

2006年11月16日 星期四

新版blogger終於beta了

新版blogger終於beta了, 真是令人高興, 一直期待有Tag的功能(就為了這一個小小的要求而已), 否則已經想轉到別的blog System去了. 開始來給他好好的試用看看吧!!

2006年11月9日 星期四

WYSIWYG

what you see is what you get 所見即所得