PageSourceSearch

https://bexco.co.kr/resources/_Js/common.pageShare.js?v=8

js bexco.co.kr collected 2026-10-02 07:46:37 UTC 6,645 bytes, 226 lines download raw bytes

1var pageSNSShare = {
2  init: function (settings) {
3    if (typeof settings != "undefined") {
4      this.cfg = $.extend({}, {}, settings);
5    }
6  },
7  sendToNaver: function (title, url) {
8    //2017-08-30
9    var sUrl = encodeURIComponent(url);
10    var sTitle = encodeURI(title);
11    var shareURL =
12      "http://share.naver.com/web/shareView.nhn?url=" +
13      sUrl +
14      "&title=" +
15      sTitle;
16
17    this.openShareWin(shareURL);
18  },
19  sendToBand: function (title, url) {
20    //2017-08-30
21    var sUrl = encodeURIComponent(url);
22    var sTitle = encodeURI(title);
23    var shareURL =
24      "http://band.us/plugin/share??url=" +
25      sUrl +
26      "&body=" +
27      sTitle +
28      " " +
29      url +
30      "&route=" +
31      url;
32
33    this.openShareWin(shareURL);
34  },
35  sendToFacebook: function (title, url, share) {
36    if (typeof share == "undefined") var share = {};
37
38    //2017-08-30
39    var sUrl = encodeURIComponent(url);
40    var sTitle = encodeURI(title);
41    var shareURL = "http://www.facebook.com/sharer/sharer.php?u=" + sUrl + "";
42
43    this.openShareWin(shareURL);
44  },
45  sendToTwitter: function (title, url, share) {
46    if (typeof share == "undefined") var share = {};
47    //2017-08-30
48    var sendTxt = "[" + title + "] " + url;
49    var sUrl = encodeURIComponent(url);
50    var sTitle = encodeURI(title);
51
52    var shareURL =
53      "http://twitter.com/intent/tweet?text=" + sTitle + "&url=" + sUrl;
54
55    this.openShareWin(shareURL);
56  },
57  sendToGoogle: function (title, url, share) {
58    if (typeof share == "undefined") var share = {};
59    //2017-08-30
60    var sendTxt = "[" + title + "] " + url;
61    var sUrl = encodeURIComponent(url);
62    var sTitle = encodeURI(title);
63
64    var shareURL = "https://plus.google.com/share?url=" + sUrl;
65
66    this.openShareWin(shareURL);
67  },
68  initKaKao: function () {
69    if (!Kakao.isInitialized()) {
70      // 초기화 안 됐을 때만 실행
71      Kakao.init("fabba3668bd3ed284a02bd1a370bee2d");
72    }
73  },
74  sendToKakaoStory: function (title, url, share) {
75    var shareData = {
76      url: url,
77      text: title,
78    };
79    if (isMobile()) {
80      Kakao.Story.open(shareData); //앱으로 공유
81    } else {
82      Kakao.Story.share(shareData); //웹으로 공유
83    }
84  },
85
86  sendToKakao: function (title, url, share) {
87    var isMobile =
88      /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
89        navigator.userAgent,
90      );
91
92    if (isMobile) {
93      try {
94        if (!Kakao.isInitialized()) {
95          this.initKaKao();
96        }
97      } catch (e) {}
98      try {
99        var imgUrl =
100          share && share.indexOf("http") === 0
101            ? share
102            : "https://www.bexco.co.kr/resources/_Img/bexco_logo_kakao.png";
103
104        Kakao.Share.sendDefault({
105          objectType: "feed",
106          content: {
107            title: title,
108            description: "지금 바로 확인해보세요!",
109            imageUrl: imgUrl,
110            link: {
111              mobileWebUrl: url,
112              webUrl: url,
113            },
114          },
115          buttons: [
116            {
117              title: "자세히 보기",
118              link: {
119                mobileWebUrl: url,
120                webUrl: url,
121              },
122            },
123          ],
124        });
125      } catch (e) {
126        alert(e);
127        alert("카카오톡이 설치된 스마트폰에서만 지원됩니다");
128      }
129    } else {
130      alert("스마트폰에서만 지원됩니다.");
131    }
132  },
133
134  openShareWin: function (url) {
135    var wp = window.open(url, "shareWin", "width=450,height=600");
136    if (wp) {
137      wp.focus();
138    }
139  },
140
141  sendToInstagram: function (title, url, share) {
142    var isMobile =
143      /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
144        navigator.userAgent,
145      );
146
147    if (!isMobile) {
148      alert("스마트폰에서만 지원됩니다.");
149      return;
150    }
151
152    var imgUrl =
153      share && share.indexOf("http") === 0
154        ? share
155        : "https://www.bexco.co.kr/resources/_Img/bexco_logo_kakao.png";
156
157    // 클립보드에 URL 복사
158    var copySuccess = false;
159    try {
160      if (navigator.clipboard && navigator.clipboard.writeText) {
161        navigator.clipboard.writeText(url);
162        copySuccess = true;
163      } else {
164        // fallback: 구형 브라우저 대응
165        var textarea = document.createElement("textarea");
166        textarea.value = url;
167        textarea.style.position = "fixed";
168        textarea.style.opacity = "0";
169        document.body.appendChild(textarea);
170        textarea.select();
171        document.execCommand("copy");
172        document.body.removeChild(textarea);
173        copySuccess = true;
174      }
175    } catch (e) {}
176
177    // Instagram Stories 딥링크 시도
178    try {
179      var isIOS = /iPhone|iPad|iPod/i.test(navigator.userAgent);
180      var isAndroid = /Android/i.test(navigator.userAgent);
181
182      if (isIOS) {
183        // iOS: Instagram Stories 공유 딥링크
184        location.href = "instagram://app";
185      } else if (isAndroid) {
186        // Android: 인스타그램 앱 열기
187        location.href =
188          "intent://instagram.com/#Intent;package=com.instagram.android;scheme=https;end";
189      }
190
191      var msg = copySuccess
192        ? "인스타그램 앱으로 이동합니다.\n링크가 클립보드에 복사되었으니 붙여넣기 해주세요.\n\n" +
193          url
194        : "인스타그램 앱으로 이동합니다.\n공유할 링크: \n\n" + url;
195
196      alert(msg);
197    } catch (e) {
198      alert(
199        "인스타그램 앱을 열 수 없습니다.\n링크를 복사하여 인스타그램에서 공유해주세요.\n\n" +
200          url,
201      );
202    }
203  },
204  copyLink: function (url) {
205    try {
206      if (navigator.clipboard && navigator.clipboard.writeText) {
207        navigator.clipboard.writeText(url).then(function () {
208          alert("링크가 복사되었습니다.");
209        });
210      } else {
211        // fallback: 구형 브라우저 대응
212        var textarea = document.createElement("textarea");
213        textarea.value = url;
214        textarea.style.position = "fixed";
215        textarea.style.opacity = "0";
216        document.body.appendChild(textarea);
217        textarea.select();
218        document.execCommand("copy");
219        document.body.removeChild(textarea);
220        alert("링크가 복사되었습니다.");
221      }
222    } catch (e) {
223      alert("링크 복사에 실패했습니다.");
224    }
225  },
226};

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.