toooooooby (owner)

Revisions

  • 2ae33e toooooooby Sat Oct 04 03:29:54 -0700 2008
  • 4abd28 toooooooby Sat Oct 04 03:18:45 -0700 2008
  • 697fa6 toooooooby Sat Oct 04 02:34:56 -0700 2008
gist: 14739 Download_button fork
public
Description:
UserActionScript of adding delicious bookmark for Slepnir2
Public Clone URL: git://gist.github.com/14739.git
Embed All Files: show embed
add_delicious.js #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
delicious.com 登録スクリプト
 
= 特徴
* 別のページで開く
* JavaScriptオフのページで当スクリプトを起動しても、
del.icio.us登録ページでは JavaScript がオンになり、
tagの補完などが効く。
= 履歴
* ver 0.2 2008/10/04 delicious.com に対応
* ver 0.1 2008/07/07 del.icio.us.com 対応
*/
(function(){
    // 別のページで開く
    var newtab = 1;
 
    var pnir = new ActiveXObject("Sleipnir.API");
    var id = pnir.GetDocumentID(pnir.ActiveIndex);
    var document = pnir.GetDocumentObject(id);
 
    if (document == null) {
        pnir.MessageBox("タブがない");
        return;
    }
    var url = document.location.href;
    var title = document.title;
 
    var nid;
    if (newtab == 1)
        nid = pnir.NewWindow('about:blank', true);
    else
        nid = id;
    pnir.Navigate(nid, 'http://delicious.com/save?url='
        + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&v=5&jump=no');
  
    var flag = getSecurity();
    flag.JavaScript = 1;
    setSecurity(flag, nid);
 
    // セキュリティ設定取得、sleipnir用
    function getSecurity(){
        return {
            JavaScript : pnir.IsJavaScriptEnabled(id),
            Java : pnir.IsJavaEnabled(id),
            RunActiveX : pnir.IsRunActiveXEnabled(id),
            DownloadActiveX : pnir.IsDownloadActiveXEnabled(id),
            Picture : pnir.IsPictureEnabled(id),
            Sound : pnir.IsSoundEnabled(id),
            Video : pnir.IsVideoEnabled(id)
        };
    }
 
    //セキュリティ設定変更 sleipnir用。
    function setSecurity(s, id){
        pnir.SetSecurity(
            id, s.JavaScript, s.Java, s.RunActiveX, s.DownloadActiveX, s.Picture, s.Sound, s.Video
        );
    }
}());