Macro/投稿/65 の変更点

http://sakura.qp.land.to/?Macro%2F%C5%EA%B9%C6%2F65


Top > Macro > 投稿 > 65
  • 追加された行はこの色です。
  • 削除された行はこの色です。
  • Macro/投稿/65 へ行く。

* テキストブラウザ化(Html Source View) [#qe075a04]
-ページ: [[Macro/投稿]]
-作者: [[ぷる]]
-カテゴリー: js
-投稿日: 2005-08-26 (金) 21:52:59

** メッセージ [#f794340c]
#code(javascript){{
var selection = Editor.GetSelectedString(0);
if(selection.length == 0)
{
    selection = "http://www.yahoo.co.jp/";
}
else
{
    if(!selection.match(/:\/\/.*/))
    {
        Editor.GoFileTop();
        Editor.Down();
        Editor.GoLineEnd_Sel(0);
        selection = selection.replace(/^\//, "");
        selection = Editor.GetSelectedString(0) + selection;
    }
}

Editor.SelectAll();
Editor.InsText(selection + " を読み込み中...");
Editor.GoFileTop();
Editor.ReDraw();

var http = new ActiveXObject("Microsoft.XMLHTTP");

if(http != null)
{
    var uri = selection;
    http.open("GET", uri, false);
    http.send(null);
 
    var html = http.responseText;
    var result = "";
    result += "------------------------------------------------------------\r\n";
    result += selection + "\r\n";
    result += "------------------------------------------------------------\r\n";
    result += html;
 
    Editor.SelectAll();
    Editor.InsText(result);
    Editor.GoFileTop();
    Editor.ReDraw();
}
}}

----

#comment

    ホーム 一覧 単語検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS