PageSourceSearch

https://zekuu-bodywork.com/static/js/sns.js?1791440569.2904603

js zekuu-bodywork.com collected 2026-10-08 06:22:54 UTC 3,787 bytes, 111 lines download raw bytes

1$(function() {
2    function isSmartPhone() {
3        return /iPhone|Android.*Mobile/.test(navigator.userAgent);
4    }
5
6    var snsUrls = {
7        twitter: "http://twitter.com/intent/tweet?",
8        facebook: "http://www.facebook.com/share.php?",
9        google: "https://plus.google.com/share?",
10        line: {
11            sm: "line://msg/text/",
12            pc: "http://line.me/R/msg/text/?"
13        }
14    };
15
16    function getTwitterUrl() {
17        return snsUrls.twitter + 'text=' + encodeURIComponent(document.title) + '&url=' + encodeURIComponent(location.href);
18    }
19
20    function getFacebookUrl() {
21        return snsUrls.facebook + 'u=' + encodeURIComponent(location.href);
22    }
23
24    function getGoogleUrl() {
25        return snsUrls.google + 'url=' + encodeURIComponent(location.href);
26    }
27
28    function getLineUrl() {
29        if(isSmartPhone()) {
30            return snsUrls.line.sm + encodeURIComponent(document.title + ' ' + location.href);
31        } else {
32            return snsUrls.line.pc + encodeURIComponent(document.title + ' ' + location.href);
33        }
34    }
35
36    // ----------------------------
37    // 通常のシェア処理
38    // ----------------------------
39    function setupSnsHandlers() {
40        // SNSボタン
41        $('.snstable a').off("click.sns").on("click.sns", function(e) {
42            var sns = $(this).data('sns');
43            var url = '';
44            var href = $(this).attr('href');
45
46            if(href == '#'){ 
47                switch(sns) {
48                    case 'twitter': url = getTwitterUrl(); break;
49                    case 'facebook': url = getFacebookUrl(); break;
50                    case 'google': url = getGoogleUrl(); break;
51                    case 'line': url = getLineUrl(); break;
52                }
53
54                if(url.match('^https?://')) {
55                    window.open(url);
56                } else {
57                    location.href = url;
58                }
59
60                e.preventDefault();
61            }
62        });
63
64        // Googleマップリンクは通常のまま
65        $('a[href*="www.google.com/maps/search"]').off("click.gmap");
66
67        // bottomBannerリンクは通常のまま
68        $('.bottomBanner a').off("click.banner");
69    }
70
71    // ----------------------------
72    // プレビュー用:リンク無効化
73    // ----------------------------
74    function disablePreviewHandlers() {
75        // SNSボタンを無効化
76        $('.snstable a').off("click.sns").on("click.sns", function(e) {
77            e.preventDefault();
78            e.stopPropagation();
79            console.log("プレビュー中のためSNSリンクは無効化されています");
80            return false;
81        });
82
83        // Googleマップ拡大リンクを無効化
84        $('a[href*="www.google.com/maps/search"]').off("click.gmap").on("click.gmap", function(e) {
85            e.preventDefault();
86            e.stopPropagation();
87            console.log("プレビュー中のためGoogleマップ拡大は無効化されています");
88            return false;
89        });
90
91        // bottomBanner内リンクを無効化
92        $('.bottomBanner a').off("click.banner").on("click.banner", function(e) {
93            e.preventDefault();
94            e.stopPropagation();
95            console.log("プレビュー中のため広告リンクは無効化されています");
96            return false;
97        });
98    }
99
100    // 初期状態は通常
101    setupSnsHandlers();
102
103    // 親からの postMessage を待ち受け
104    window.addEventListener("message", function(event) {
105        if (event.data.action === "disablePreviewLinks") {
106            disablePreviewHandlers();
107        } else if (event.data.action === "enablePreviewLinks") {
108            setupSnsHandlers();
109        }
110    });
111});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.