1// Korea SNS Pro - kissshare.js - v1.0.3 2////////////////////////////////////////////////// 3 4var g_bInitKakao = false; 5var g_bInitKakaoButtons = false; 6 7function InitKakao(strKey){ 8 9 if( !g_bInitKakao ){ 10 11 try{ 12 if( Kakao ){ 13 Kakao.init(strKey); 14 }; 15 }catch(e){}; 16 17 g_bInitKakao = true; 18 } 19} 20 21function InitKakaobuttons(uniqPostID){ 22 23 if( !g_bInitKakaoButtons ){ 24 g_bInitKakaoButtons = true; 25 26 arInitMethods.forEach(function (item, index, array){ 27 if (typeof eval(item) != 'undefined') { 28 eval(item+'();'); 29 } 30 }); 31 32 document.getElementById('kakao-link-btn-'+uniqPostID).click(); 33 } 34} 35 36function PrepareKakao(app_key, containerID, title, imageUrl, link, appTitle){ 37 console.log('PrepareKakao', imageUrl); 38 InitKakao(app_key); 39 40 Kakao.Link.createDefaultButton( 41 { 42 container: containerID, 43 objectType: 'feed', 44 content: { 45 title: title, 46 imageUrl: imageUrl, 47 link:{ 48 mobileWebUrl:link, 49 webUrl: link 50 } 51 }, 52 buttons:[{ 53 title: appTitle, 54 link:{ 55 mobileWebUrl: link, 56 webUrl:link 57 } 58 }] 59 } 60 ); 61} 62 63function ShareKakaostory(strKey, strUrl, strTitle, bMobile){ 64 65 InitKakao(strKey); 66 67 if( bMobile ){ 68 Kakao.Story.open({ 69 url: strUrl, 70 text: strTitle 71 }); 72 } 73 else{ 74 Kakao.Story.share({ 75 url: strUrl, 76 text: strTitle 77 }); 78 } 79} 80 81function SendSNS(sns, title, url, image, bMobile){ 82 83 var o; 84 var _url = encodeURIComponent(url); 85 //var _url = url; 86 console.log(_url); 87 var _title = encodeURIComponent(title); 88 var _br = encodeURIComponent('\r\n'); 89 // @hansongwook ìì í¨ íì´ì¤ë¶ë§ íê¸ urlë¡ 90 switch(sns){ 91 case 'facebook': 92 o = { method:'popup', width:600, height:800, 93 //url:'http://www.facebook.com/sharer/sharer.php?u=' + _url 94 url:'http://www.facebook.com/sharer/sharer.php?u=' + url 95 }; 96 break; 97 98 case 'twitter': 99 o = { method:'popup', width:750, height:500, 100 url:'http://twitter.com/intent/tweet?text=' + _title + '&url=' + _url 101 }; 102 break; 103 104 case 'naverband': 105 if( bMobile ){ 106 o = { method:'web2app', 107 param:'create/post?text=' + _title + _br + _url, 108 a_store:'itms-apps://itunes.apple.com/app/id542613198?mt=8', 109 g_store:'market://details?id=com.nhn.android.band', 110 a_proto:'bandapp://', 111 g_proto:'scheme=bandapp;package=com.nhn.android.band' 112 }; 113 } 114 else{ 115 o = { method:'popup', width:700, height:750, 116 url:'http://band.us/plugin/share?body=' + _title + _br + _url + '&route=' + _url 117 }; 118 } 119 break; 120 121 case 'naverblog': 122 o = { method:'popup', width:600, height:750, 123 url:'https://share.naver.com/web/shareView.nhn?url=' + _url + '&title=' + _title 124 }; 125 break; 126 127 case 'telegram': 128 o = { method:'popup', width:600, height:750, 129 url:'https://telegram.me/share/url?url=' + _url + '&text=' + _title 130 }; 131 break; 132 133 default: 134 return false; 135 } 136 137 switch(o.method){ 138 case 'popup': 139 if( o.height > 0 && o.width > 0 ){ 140 window.open(o.url,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height='+o.height+',width='+o.width); 141 } 142 else{ 143 window.open(o.url); 144 } 145 146 break; 147 148 case 'web2app': 149 if(navigator.userAgent.match(/android/i)){ 150 setTimeout(function(){ location.href = 'intent://' + o.param + '#Intent;' + o.g_proto + ';end'}, 100); 151 } 152 else if(navigator.userAgent.match(/(iphone)|(ipod)|(ipad)/i)){ 153 setTimeout(function(){ location.href = o.a_store; }, 200); 154 setTimeout(function(){ location.href = o.a_proto + o.param }, 100); 155 } 156 else{ 157 alert('Only mobile'); 158 } 159 break; 160 } 161}
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.