右クリックで はてなブックマーク、ついでに del.icio.us (2005年7月版)

観測気球

収集物の記録書庫 a data archive of collection -- collectible toys

[要旨] 「はてなブックマーク」の7月13日に実施された仕様変更にあわせて、スクリプトを大幅に書き直しました。古い版をお使いの方は、差し替えをお願いします。
[キーワード] はてなブックマーク

« MyClip! の表示設定 (Clipフォーマット)(BlogPet) | トップページ | 今週のお買い物 (2005.07.10~07.16) »

2005.07.15

右クリックで はてなブックマーク、ついでに del.icio.us (2005年7月版)

最終更新: 2005年7月21日

2005年7月13日の夕方に行なわれた、「はてなブックマーク」の仕様変更により、「はてなブックマーク」の登録用 URI (http://b.hatena.ne.jp/add) に mode=enter 要求を投げたときの動きが変わってしまいました。 その影響で、拙作の「右クリックで はてなブックマーク、ついでに del.icio.us (改訂2版)」ではてなブックマークへの登録がうまくいかなくなってしまいました(ブックマーク元記事内の文字列をマウスで選択しているときのみ)。

いろいろ試行錯誤しつつ、なんとか対処できるものができましたので、新しい版を公開します。 他に、Bloglines から取り込む処理もバグフィックスしています。

今回の版では、外部 Javascript として、“Paj’s Home: Cryptography: JavaScript MD5” にて公開されている md5.js を利用しています。 「右クリックで はてなブックマーク、ついでに del.icio.us」スクリプトと同じディレクトリ(フォルダ)に、md5.js をダウンロードして、置いておいてください。

はてなブックマーク と del.icio.us に同時登録
(クリックすると大きな画像を表示します)

関連記事: [hatena API]はてなブックマーク登録画面の仕様変更?[hatena API]はてなブックマークの


変更履歴

  • 2.2版 2005年7月21日 「はてなブックマーク」で使っている cookie の仕様変更に対応
  • 2.1版 2005年7月20日 Bloglines から引用する処理を調整
  • 2.0版 2005年7月15日 「2005年7月版」を公開

ソース

それでは、ソースです。

<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=EUC-JP">
<script type="text/javascript" src="md5.js"></script>
<script type="text/javascript" language="JavaScript">

// 「右クリックで はてなブックマーク、ついでに del.icio.us」
//     written by H.Tsujimura (tsupo@na.rim.or.jp)
//
//     注意: 本スクリプトを使用するにあたって、あらかじめ
//              Paj’s Home: Cryptography: JavaScript MD5
//                  (http://pajhome.org.uk/crypt/md5/index.html)
//           にて公開されている
//              md5.js
//                  (ソース本体:   http://pajhome.org.uk/crypt/md5/md5.js)
//                  (ソースリスト: http://pajhome.org.uk/crypt/md5/md5src.html)
//           をダウンロードして、本スクリプトと同じディレクトリ(フォルダ)
//           に設置しておいてください。
//
//     Version 2.2  21 Jul 2005  「はてなブックマーク」で使っているcookie 
//                               の中身が変更(追加)されたのに対応
//     Version 2.1  20 Jul 2005  Version 1.7 の修正を一部キャンセルし、元に
//                               戻す (Bloglines の生成する html が元に戻っ
//                               た?)
//     Version 2.0  15 Jul 2005  はてなブックマーク登録時の動作変更(仕様変
//                               更)に対応するため、大幅に処理を追加
//     Version 1.7  15 Jul 2005  Bloglines でうまく拾えないパターンが残っ
//                               ている原因(の1つ?)が判明、対策を実施
//     Version 1.6   7 Jul 2005  「はてなダイアリーキーワード」対策を実施
//     Version 1.5  28 Jun 2005  Bloglines で読んでいる記事を拾ってくるとき、
//                               当該記事のサイト名も一緒に拾うようにした
//     Version 1.4  14 Jun 2005  Bloglines で RSS フィード内に 1個しか記事
//                               がないとき、0x0A もしくは 0x0D が含まれる
//                               ときなど、記事題名、URL を取得するのに失敗
//                               するケース(既知のもののみ)に対処
//     Version 1.3  14 Jun 2005  Ver 1.2 で Bloglines の日本語モードにしか
//                               対応しなくなってしまっていた不具合を修正。
//                               英語モードでも動くことを確認。
//     Version 1.2  13 Jun 2005  (1) Bloglines で読んでいる記事をクリップす
//                                   るとき、違う記事のURL、題名を持ってき
//                                   てしまう可能性を極力減らした
//                               (2) Google の検索結果から、元記事をブック
//                                   マークできるようにしてみた
//                               (3) はてなRSS で読んでいる記事もそのまま
//                                   ブックマークできるようにしてみた
//                               (4) 実際にブックマークを実行する前に投稿内
//                                   容を確認するためのダイアログを出すよう
//                                   にした
//     Version 1.1   9 Jun 2005  Bloglines で読んでいる記事をそのままブック
//                               マークできるようにした
//     Version 1.0   6 Jun 2005  最初の版

obj = external.menuArguments;     // 右クリック時の引数のオブジェクトの参照
page_url   = obj.document.URL;    // ページのURL
title_txt  = obj.document.title;  // タイトル文字列
cite_range = obj.document.selection.createRange();
cite_txt   = cite_range.text;     // 引用文字列
cite_html  = cite_range.htmlText; // 引用文字列(html)
inn        = obj.document.body.innerHTML;

if ( obj.location.href && (obj.location.href != "") )
    page_url = obj.location.href; // 「はてなダイアリーキーワード」対策

// 注意: (1) はてなにログイン済みの状態で使うことを前提にしています。
//       (2) 「はてなブックマーク」では title の値を指定しても無視されます。
//           (はてなサーバ側で当該Webページを取得し、その Web ページの title
//            要素を取得し、初期値として採用する仕様のため)
//       (3) del.icio.us はログイン済みでなくても使えますが、本ブックマーク起
//           動時点でログイン済みでない場合は、漢字等が文字化けします。文字化
//           けを避けるために、あらかじめログインしておくことをおすすめします。

// ↓↓ あなたのアカウントに変更して、お使いください
del_userID = "tsupo";           // del.icio.us のアカウント
// ↑↑ あなたのアカウントに変更して、お使いください

txt = "";
function getTarget()
{
    rest = txt;
    s = txt.indexOf("<");
    while ( (s >= 0) && (s <= 2) ) {
        e = txt.indexOf(">");
        txt = txt.substring(e+1,txt.length);
        s = txt.indexOf("<");
    }
    if ( s > 0 ) {
        target = txt.substring(0,s);
        rest   = txt.substring(s,txt.length);
    }
    else {
        target = txt;
        rest   = "";
    }
    txt = rest;

    return ( target );
}

function adjustTarget(target)
{
    /* for Bloglines */
    q = target.indexOf('"'); // "
    if ( q > 0 )
        target = target.substring(0,q);
    else if ( q == 0 )
        target = target.substring(1,target.length);

    q = target.indexOf(' ');
    if ( q > 0 )
        target = target.substring(0,q);
    else if ( q == 0 )
        target = target.substring(1,target.length);

    q = target.indexOf('\\x0A');
    if ( q > 0 )
        target = target.substring(0,q);
    else if ( q == 0 )
        target = target.substring(4,target.length);

    q = target.indexOf('\\x0D');
    if ( q > 0 )
        target = target.substring(0,q);
    else if ( q == 0 )
        target = target.substring(4,target.length);

    do {
        q = target.indexOf('/');
        if ( q >= 0 )
            target = target.substring(0,q) + '\\x2F' + target.substring(q+1,target.length);
        else
            break;
    } while ( true );

    return ( target );
}

if ( (cite_txt != "") && (cite_txt.length > 0) ) {
    if ( page_url.match("http://www.bloglines.com/myblogs_display") ||
         page_url.match("http://bloglines.com/myblogs_display")        ) {
        /* Bloglines で読んでいるテキスト(記事、クリップ、など)をブックマーク可能にするための処理 */
        target1 = "";
        target2 = "";
        target3 = "";
        target4 = "";
        target5 = "";
        if ( cite_txt == cite_html )
            target1 = cite_txt;
        else {
            /* target1 */
            txt = cite_html;
            target1 = getTarget();
            cite_html = txt;

            if ( target1 != "" ) {
                target1 = adjustTarget(target1);

                txt = cite_html;
                target2 = getTarget();
                cite_html = txt;
            }

            if ( target2 != "" ) {
                target2 = adjustTarget(target2);

                txt = cite_html;
                target3 = getTarget();
                cite_html = txt;
            }

            if ( target3 != "" ) {
                target3 = adjustTarget(target3);

                txt = cite_html;
                target4 = getTarget();
                cite_html = txt;
            }

            if ( target4 != "" ) {
                target4 = adjustTarget(target4);

                txt = cite_html;
                target5 = getTarget();
                cite_html = txt;
            }

            if ( target5 != "" ) {
                target5 = adjustTarget(target5);
            }
        }

/** for debugging
alert("target1 = " + target1 + "\n" +
      "target2 = " + target2 + "\n" +
      "target3 = " + target3 + "\n" +
      "target4 = " + target4 + "\n" +
      "target5 = " + target5 + "\n");
*/
        loc  = 0;
        aim  = inn;
        done = false;
        s_summary = 0;
        do {
            s_summary = aim.indexOf("itemText+=\"<p><table cellspacing=0 cellpadding=0 width=\\\"100%\\\">");
/** for debugging
alert("s_summary = " + aim.substring(s_summary,s_summary+360) + ", loc = " + loc);
*/
            if ( s_summary >= 0 ) {
                e_summary = aim.indexOf("itemText+=\"<div class=\\\"item_links\\\">\";",s_summary);
/** for debugging
alert("e_summary = " + aim.substring(e_summary,e_summary+360));
*/
                if ( s_summary < e_summary ) {
                    aim2 = aim.substring(s_summary+64,e_summary);
/** for debugging
alert("aim2 = " + aim2);
*/
                    if ( aim2.indexOf("\\x3C") == -1 ) {
                        // 主として「人力検索サイトはてな」対策
                        //   -- ちなみに、aim2.indexOf("\\x3C") >= 0 になるのは、MM/Memo とか はてなブックマーク --
                        //   -- とか 記事本文(冒頭)が a 要素、blockquote要素等でマークアップされている場合       --
                        txt  = aim2;
                        aim2 = getTarget();
                        aim2 = adjustTarget(aim2);
                        // 注意: 上記処理の結果、aim2.length < target?.length となる可能性が発生
                    }
                    if ( (aim2.indexOf(target1) == -1) && (target1.indexOf(aim2) == -1) ) {
                        aim = aim.substring(e_summary+39,aim.length);
                        loc += (e_summary+39);
                    //  if ( target2 == "" ) { /* {@@} 2005.07.15 追加 ↓ */
                    //      done = true;
                    //      break;
                    //  }                      /* {@@} 2005.07.15 追加 ↑ */
                        continue;
                    }
                    if ( (target2 != "") && (aim2.indexOf(target2) == -1) && (target2.indexOf(aim2) == -1) ) {
                        aim = aim.substring(e_summary+39,aim.length);
                        loc += (e_summary+39);
                    //  if ( target3 == "" ) { /* {@@} 2005.07.15 追加 ↓ */
                    //      done = true;
                    //      break;
                    //  }                      /* {@@} 2005.07.15 追加 ↑ */
                        continue;
                    }
                    if ( (target3 != "") && (aim2.indexOf(target3) == -1) && (target3.indexOf(aim2) == -1) ) {
                        aim = aim.substring(e_summary+39,aim.length);
                        loc += (e_summary+39);
                    //  if ( target4 == "" ) { /* {@@} 2005.07.15 追加 ↓ */
                    //      done = true;
                    //      break;
                    //  }                      /* {@@} 2005.07.15 追加 ↑ */
                        continue;
                    }
                    if ( (target4 != "") && (aim2.indexOf(target4) == -1) && (target4.indexOf(aim2) == -1) ) {
                        aim = aim.substring(e_summary+39,aim.length);
                        loc += (e_summary+39);
                        continue;
                    //  if ( target5 == "" ) { /* {@@} 2005.07.15 追加 ↓ */
                    //      done = true;
                    //      break;
                    //  }                      /* {@@} 2005.07.15 追加 ↑ */
                    }
                    if ( (target5 != "") && (aim2.indexOf(target5) == -1) && (target5.indexOf(aim2) == -1) ) {
                        aim = aim.substring(e_summary+39,aim.length);
                        loc += (e_summary+39);
                        continue;
                    }
                    done = true;
                }
                else
                    break;
            }
            else
                break;
        } while ( done == false );

/** for debugging
alert("* s_summary = " + aim.substring(s_summary,s_summary+360) + ", loc = " + loc);
*/
        if ( s_summary > 0 ) {
            if ( loc >= 0 ) {
                locH3 = inn.substring(0,loc+s_summary).lastIndexOf("a title=\\\"サイト"); // "
                if ( locH3 == -1 )
                    locH3 = inn.substring(0,loc+s_summary).lastIndexOf("a title=\\\"Site"); // "
                if ( locH3 > 0 ) {
                    targetString = inn.substring(locH3,loc+s_summary);

                    siteName   = "";
                    s_siteName = targetString.indexOf(": ");
                    e_siteName = targetString.indexOf("\\\" href=");
                    if ( (s_siteName > 0) && (s_siteName < e_siteName) )
                        siteName = targetString.substring(s_siteName+2,e_siteName);

                    if ( targetString.match( "</a>") == null )
                        targetString = inn.substring(locH3,locH3+inn.substring(locH3,inn.length).indexOf("</a>")+4);
                    locHREF = targetString.indexOf("href=");
                    if ( locHREF > 0 ) {
                        targetHREF = targetString.substring(locHREF + 7,targetString.indexOf('\\" target='));
                        s = targetString.indexOf('" target=_blank>');
                        e = targetString.indexOf("</a>");
                        if ( (s > 0) && (s < e) )
                            targetTITLE = targetString.substring(targetString.indexOf('" target=_blank>')+16,targetString.indexOf("</a>"));
                        else
                            targetTITLE = "";
                        if ( targetHREF != "" )
                            page_url  = targetHREF;
                        if ( targetTITLE != "" ) {
                            if ( siteName != "" )
                                title_txt = siteName + ': ' + targetTITLE;
                            else
                                title_txt = targetTITLE;
                        }
                    }
                }
            }
        }
    }
    else if ( page_url.match( "http://r.hatena.ne.jp/" ) ) {
        /* はてなRSS で読んでいるテキスト(記事、クリップ、など)をブックマーク可能にするための処理 */
        target1 = "";
        target2 = "";
        target3 = "";
        target4 = "";
        target5 = "";
        if ( cite_txt == cite_html )
            target1 = cite_txt;
        else {
            /* target1 */
            txt = cite_html;
            target1 = getTarget();
            cite_html = txt;

            if ( target1 != "" ) {
                txt = cite_html;
                target2 = getTarget();
                cite_html = txt;
            }

            if ( target2 != "" ) {
                txt = cite_html;
                target3 = getTarget();
                cite_html = txt;
            }

            if ( target3 != "" ) {
                txt = cite_html;
                target4 = getTarget();
                cite_html = txt;
            }

            if ( target4 != "" ) {
                txt = cite_html;
                target5 = getTarget();
                cite_html = txt;
            }
        }

        loc  = 0;
        aim  = inn;
        done = false;
        s_summary = 0;
        do {
            s_summary = aim.indexOf("<DIV class=summary>");
            if ( s_summary >= 0 ) {
                e_summary = aim.indexOf("</DIV>",s_summary);
                if ( s_summary < e_summary ) {
                    aim2 = aim.substring(s_summary+19,e_summary);
                    if ( aim2.indexOf(target1) == -1 ) {
                        aim = aim.substring(e_summary+6,aim.length);
                        loc += (e_summary+6);
                        continue;
                    }
                    if ( (target2 != "") && (aim2.indexOf(target2) == -1) ) {
                        aim = aim.substring(e_summary+6,aim.length);
                        loc += (e_summary+6);
                        continue;
                    }
                    if ( (target3 != "") && (aim2.indexOf(target3) == -1) ) {
                        aim = aim.substring(e_summary+6,aim.length);
                        loc += (e_summary+6);
                        continue;
                    }
                    if ( (target4 != "") && (aim2.indexOf(target4) == -1) ) {
                        aim = aim.substring(e_summary+6,aim.length);
                        loc += (e_summary+6);
                        continue;
                    }
                    if ( (target5 != "") && (aim2.indexOf(target5) == -1) ) {
                        aim = aim.substring(e_summary+6,aim.length);
                        loc += (e_summary+6);
                        continue;
                    }
                    done = true;
                }
                else
                    break;
            }
            else
                break;
        } while ( done == false );

        if ( s_summary > 0 ) {
            loc = inn.substring(0,loc+s_summary).lastIndexOf("<H3>");
            if ( loc >= 0 ) {
                txt = inn.substring(loc+4,inn.length);
                targetHREF  = txt.substring(txt.indexOf("href=\"")+6,txt.indexOf("\" target=_blank")); 
                targetTITLE = getTarget();
                if ( targetHREF != "" )
                    page_url  = targetHREF;
                if ( targetTITLE != "" )
                    title_txt = targetTITLE;
            }
        }
    }
    else if ( page_url.match( "http://www.google.co.jp/search" ) ) {
        /* Google の検索結果を元に、元記事を参照することなくクリップするための処理 */
        /*  -- LostGoogles をインストールしている環境でも動作確認済み              */

        /* cite_html は正規化済み(IEの場合)なのに対し、inn の方はオリジナルの html ソース  */
        /* のままなので、そのまま文字列比較はできないため、比較できる形式に cite_html を変 */
        /* 形する (本当は、DOM を使ってあれこれすべき)                                      */
        while ( cite_html.match( "</FONT>" ) ) {
            f = cite_html.indexOf( "</FONT>" );
            cite_html = cite_html.substring(0,f) + cite_html.substring(f+7,cite_html.length);
        }
        if ( cite_html.match( "\n" ) ) {
            f = cite_html.indexOf( "\n" );
            cite_html = cite_html.substring(0,f-1);
        }

        /*
         * locG       locHREF                                                     locTitle
         * |           |                                                             |
         * v           v                                                             v
         * <p class=g><a href="元記事URL" onmousedown="return clk(this,'res',11,'')">元記事タイトル</a>
         * (検索キーワードと一致する部分は <b> ~ </b> で囲まれている)
         */
        loc = inn.indexOf(cite_html);
        if ( loc >= 0 ) {
            sub = inn.substring(0,loc);
            locG = sub.lastIndexOf("<P class=g>");
            if ( locG >= 0 ) {
                sub = sub.substring(locG+11,loc);
                locHREF = sub.indexOf("href=\"");
                if ( locHREF >= 0 ) {
                    sub = sub.substring(locHREF+6,sub.length);
                    targetHREF  = sub.substring(0,sub.indexOf('"'));
                    targetTITLE = "";
                    locTitle    = sub.indexOf("\">");
                    if ( locTitle >= 0 ) {
                        locTitle += 2;
                        sub = sub.substring(locTitle,sub.length);
                        locEnd = sub.indexOf("</A>");
                        if ( locEnd >= 0 ) {
                            targetTITLE = sub.substring(0,locEnd);

                            /* <B> ~ </B> を除去 */
                            while ( targetTITLE.match( "<B>" ) || targetTITLE.match( "</B>" ) ) {
                                b1 = targetTITLE.indexOf( "<B>" );
                                if ( b1 >= 0 )
                                    targetTITLE = targetTITLE.substring(0,b1) + targetTITLE.substring(b1+3,targetTITLE.length);
                                b2 = targetTITLE.indexOf( "</B>" );
                                if ( b2 >= 0 )
                                    targetTITLE = targetTITLE.substring(0,b2) + targetTITLE.substring(b2+4,targetTITLE.length);
                            }
                        }
                    }
                    if ( targetHREF != "" )
                        page_url  = targetHREF;
                    if ( targetTITLE != "" )
                        title_txt = targetTITLE;
                }
            }
        }
    }
}

if ( title_txt == "[object]" ) {
    /* title に '*' が含まれている場合にうまく取り込めない現象への対策 */
    str = obj.document.body.parentNode;
    inn = str.innerHTML;
    s = inn.indexOf("<TITLE>");
    e = inn.indexOf("</TITLE>");
    if ( (s > 0) && (e > s) )
        title_txt = inn.substring(s + 7, e);
}

ok = confirm('URL: '+page_url+'\nタイトル: '+title_txt+'\n引用: '+cite_txt);

if ( ok ) {
    if ( cite_txt != "" ) {
        // マウスで選択中の文字列があれば、extended に入れる
        newWin = window.open('http://b.hatena.ne.jp/add?mode=confirm&is_bm=1&title='+escape(title_txt)+'&url='+escape(page_url)+'&comment='+escape(cite_txt), '_blank', 'width=520,height=600,resizable=1,scrollbars=1');
        window.open('http://del.icio.us/' + del_userID + '?v=2&url=' + encodeURIComponent(page_url) + '&title=' + encodeURIComponent(title_txt) + '&extended=' + encodeURIComponent(cite_txt));

        t = newWin.document.cookie;
        loc = t.lastIndexOf(';');
        if ( loc > 0 )
            rk = t.substring(0,t.lastIndexOf(';')); /* 2005年7月21日 夕方以降 */
        else
            rk = t;                                 /* 2005年7月21日 夕方まで */
        rk = rk.substring(rk.lastIndexOf('=')+1);
        rkm = b64_md5(rk);

//      newWin.close();

//      newWin = window.open('http://b.hatena.ne.jp/add', '_blank', 'width=520,height=600,resizable=1,scrollbars=1');
        newWin.document.open();

        newWin.document.write("<html>\n<head>\n<title>はてなブックマーク - ソーシャルブックマーク</title>\n");
        newWin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n');
        newWin.document.write('<meta http-equiv="Content-Style-Type" content="text/css">\n');
        newWin.document.write('<meta http-equiv="Content-Script-Type" content="text/javascript">');
        newWin.document.write('<link rel="stylesheet" type="text/css" href="http://b.hatena.ne.jp/style">\n');
        newWin.document.write('<style type="text/css">\n#body {\n  margin-left: 0px;\n}\n\n.info td {\n  font-size: 80%;\n}\n\n');
        newWin.document.write('div.note {\n  margin-left: 10px;\n  margin-top:  20px;\n}\n\n');
        newWin.document.write('div.info p {\n  font-size: 90%;\n}\n\ndiv.info p.addurl-footer {\n  font-size: 100%;\n}\n');
        newWin.document.write('</style>\n');
        newWin.document.write('</head>\n<body>\n');

        newWin.document.write('<div id="banner"><h1><a href="http://www.hatena.ne.jp/" target="_blank"><img src="http://b.hatena.ne.jp/images/hatena_de.gif" width="104" height="40" alt="Hatena"></a>');
        newWin.document.write('<a href="http://b.hatena.ne.jp/" target="_blank"><img src="http://b.hatena.ne.jp/images/Bookmarkde.gif" width="118" height="40" alt="Bookmark"></a>');
        newWin.document.write('<img src="http://b.hatena.ne.jp/images/betade.gif" width="42" height="40" alt="beta" title="beta">');
        newWin.document.write('<img border="0" src="http://b.hatena.ne.jp/images/tri_de.gif" width="15" height="40" usemap="#trimap" alt="tri"></h1>');
        newWin.document.write('<a href="http://www.hatena.ne.jp/"><img src="http://b.hatena.ne.jp/images/hatenade.gif" class="logo" alt="はてな" title="はてな"></a></div>\n');
        newWin.document.write('<map name="trimap">\n');
        newWin.document.write('<area shape="rect" coords="1,10,15,25" href="http://a.hatena.ne.jp/" alt="はてなアンテナ" title="はてなアンテナ">\n');
        newWin.document.write('<area shape="rect" coords="1,25,15,40" href="http://d.hatena.ne.jp/" alt="はてなダイアリー" title="はてなダイアリー">\n');
        newWin.document.write('</map>\n');

        newWin.document.write('<div id="container">\n');
        newWin.document.write('<div id="body">\n');
        newWin.document.write('<h2>ブックマークの確認</h2>\n');
        newWin.document.write('<form action="http://b.hatena.ne.jp/add" method="POST" name="add" id="edit_form" style="margin:0">\n');
        newWin.document.write('<input type="hidden" name="mode" value="enter">\n');
        newWin.document.write('<input type="hidden" name="eid" value="">\n');
        newWin.document.write('<input type="hidden" name="url" value="' + page_url + '">\n');
        newWin.document.write('<input type="hidden" name="rkm" value="' + rkm + '">\n');
        newWin.document.write('<input type="hidden" name="is_bm" value="1">\n');
        newWin.document.write('<div class="info">\n<table>\n<tr>\n');
        newWin.document.write('<td class="label" nowrap>URL</td>\n<td class="addurl">\n');
        newWin.document.write('<a href="' + page_url + '" target="_blank">' + page_url + '</a>\n');
        newWin.document.write('</td>\n</tr><tr>\n<td class="label" nowrap>タイトル</td>\n<td>\n');
        newWin.document.write('<input type="text" name="title" value="' + title_txt + '" size="50" />\n');
        newWin.document.write('</td>\n</tr>\n<tr>\n<td class="label" nowrap>コメント<br><span class="note">(省略可)</span></td>\n<td>\n');
        newWin.document.write('<input type="text" name="comment" id="comment" value="' + cite_txt + '" size="50" />\n');
        newWin.document.write('<span id="comment_count"></span>\n<div id="candidates_list"></div>\n</td>\n</table>\n');
        newWin.document.write('</div>\n');
        newWin.document.write('<input type="submit" name="commit" value="追加する">\n');
        newWin.document.write('<input type="submit" name="go_bm" value="追加して確認">\n');
        newWin.document.write('<div id="tags_list"></div>\n<div id="othertags_list"></div>\n<div id="keywords_list"></div>\n');
        newWin.document.write('</form>\n');
        newWin.document.write('<div class="note" style="padding-bottom: 1em;">※コメント欄で"[hoge]..."と書くとタグが利用できます。→<a href="/help#tag" target="_blank">詳しい説明</a></div>\n');
        newWin.document.write('</div>\n</div>\n');
        newWin.document.write('</body>\n</html>\n');

        newWin.document.close();
        newWin.document.focus();
    }
    else {
        window.open('http://b.hatena.ne.jp/add?mode=confirm&is_bm=1&title='+escape(title_txt)+'&url='+escape(page_url), '_blank', 'width=520,height=600,resizable=1,scrollbars=1');
        window.open('http://del.icio.us/' + del_userID + '?v=2&url=' + encodeURIComponent(page_url) + '&title=' + encodeURIComponent(title_txt));
    }
}
</script>

投稿者: tsupo 2005.07.15 午後 04:56 | 固定リンク | このエントリーをはてなブックマークに追加 | このエントリを del.icio.us に登録 このエントリの del.icio.us での登録状況 | このエントリを Buzzurl に追加このエントリの Buzzurl での登録状況 | このエントリをlivedoorクリップに登録 このエントリのlivedoorクリップでの登録状況 このエントリをlivedoorクリップに登録している人の数 | 酢鶏巡回中

楽天市場


品揃え豊富で安い!NTT-X Store


アマゾンわくわく探検隊

トラックバック

この記事のトラックバックURL:

この記事へのトラックバック一覧です: 右クリックで はてなブックマーク、ついでに del.icio.us (2005年7月版):

» 右クリックで「モヒカン族」 (改訂版) from 観測気球
はてなグループの掲示板もCSRF対策が実施されました。それに伴い、以前の『右クリックで「モヒカン族」』は期待通りに動かなくなってしまったため、改訂版を用意しました。以前の版をお使いの方は、差し替えをお願いします。... 続きを読む

受信: 2005.07.21 午前 11:54

» 右クリックで はてなブックマーク、ついでに del.icio.us (はてな投げ銭対応版) from 観測気球
はてなの「投げ銭」に対応しました。 続きを読む

受信: 2005.08.15 午後 07:43

» 右クリックではてなブックマーク、ついでにdel.icio.us (はてなブックマーク「コレクション」対応版) from 観測気球
いまさらのような気がしますが、はてなブックマークの「コレクション」に対応してみました。 続きを読む

受信: 2006.04.04 午後 07:06

コメント

ワード

ニッセン

fujisan.co.jp

楽天市場