1//ê³µíµ script ì²ë¦¬ 2jQuery(function($) { 3 $( document ).ready(function() { 4 Kakao.init(PavoSocialParams.KAKAO_API_VALUE); 5 6 //íë¸ë¦¿ 기기ì¸ì§ íë¨íë¤. 7 var isTablet = window.matchMedia("only screen and (min-device-width: 768px)"); 8 isTablet = isTablet.matches; 9 10 if($(".social_share").length > 0) { 11 if (PavoSocialParams.MOBILE_SHARE_BUTTON_POS == "float" && PavoSocialParams.IS_MOBILE == true && isTablet == false) { 12 $( window ).bind( "resize", function() { 13 setMaxWidth(); 14 displaySocialButton(); 15 }); 16 17 $( window ).scroll(function() { 18 isTablet = window.matchMedia("only screen and (min-device-width: 768px)"); 19 isTablet = isTablet.matches; 20 21 if(!isTablet) { 22 displaySocialButton(); 23 } 24 }); 25 26 27 }else{ 28 //PC ë²ì ì´ê±°ë íë¸ë¦¿ 기기ì´ê³ ìì ë²í¼ ìì¹ ìµì ê°ì´ topì¼ë 29 if(PavoSocialParams.SOCIAL_SHARE_BUTTON_POS == "top") { 30 $("#pavo_contents").css("clear", "both"); 31 $("#pavo_contents").css("padding-top", "8px"); 32 } else if(PavoSocialParams.SOCIAL_SHARE_BUTTON_POS == "bottom") { 33 $("#pavo_contents").css("clear", "both"); 34 $(".social_share").after("<br/>"); 35 } 36 } 37 38 $(".social_share").on("click", "a", function(){ 39 }); 40 } 41 42 43 //í´ë¦ì count ì ë°ì´í¸ 44 $(".social_share").on("click", "a.pvss", function(e){ 45 post_id = $(this).data('pid'); 46 var className = $(this).attr('class'); 47 className = className.replace("pvss ",""); 48 console.log(className); 49 50 // e.preventDefault(); 51 52 $.ajax({ 53 type: 'POST', 54 url: PavoSocialParams.ajax_url, 55 data: { 56 "action" : "pavo_click_count", 57 "postId" : post_id, 58 "provider" : className, 59 }, 60 dataType: "json", 61 error : function(error) { 62 alert('ì¤ë¥ê° ë°ìíìµëë¤.'); 63 }, 64 success: function(data){ 65 66 } 67 68 }); 69 70 71 }); 72 73 74 75 76 77 78/* 79 80 if($(".social_share").length > 0) { 81 82 if (PavoSocialParams.MOBILE_SHARE_BUTTON_POS == "float" && PavoSocialParams.IS_MOBILE == true && isTablet == false) { 83 84 setMaxWidth(); 85 86 $("#pavo_contents").before($(".social_share")); 87 $(".social_share").css("position", "fixed"); 88 89 displaySocialButton(); 90 91 $( window ).scroll(function() { 92 isTablet = window.matchMedia("only screen and (min-device-width: 768px)"); 93 isTablet = isTablet.matches; 94 95 if(!isTablet) { 96 displaySocialButton(); 97 } 98 }); 99 } else { 100 //PC ë²ì ì´ê±°ë íë¸ë¦¿ 기기ì´ê³ ìì ë²í¼ ìì¹ ìµì ê°ì´ topì¼ë 101 if(PavoSocialParams.SOCIAL_SHARE_BUTTON_POS == "top") { 102 $("#pavo_contents").css("clear", "both"); 103 $("#pavo_contents").css("padding-top", "8px"); 104 } else if(PavoSocialParams.SOCIAL_SHARE_BUTTON_POS == "bottom") { 105 $("#pavo_contents").css("clear", "both"); 106 $(".social_share").after("<br/>"); 107 } 108 } 109 110 $( window ).bind( "resize", function() { 111 isTablet = window.matchMedia("only screen and (min-device-width: 768px)"); 112 isTablet = isTablet.matches; 113 114 if(isTablet) { 115 $(".social_share").removeAttr('style'); 116 $("#pavo_contents").removeAttr('style'); 117 118 $(".social_share").css("z-index", "20"); 119 $(".social_share").css("height", PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE + "px"); 120 121 $("#pavo_social_sharing").parent().css("margin-bottom", "0px"); 122 123 $(".social_share > a > img").css( "width", PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE + "px" ); 124 $(".social_share > a > img").css( "height", PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE + "px" ); 125 126 if(PavoSocialParams.SOCIAL_SHARE_BUTTON_POS == "top") { 127 $("#pavo_contents").before($(".social_share")); 128 $("#pavo_contents").css("clear", "both"); 129 $("#pavo_contents").css("padding-top", "8px"); 130 131 } else if(PavoSocialParams.SOCIAL_SHARE_BUTTON_POS == "bottom") { 132 $("#pavo_contents").after($(".social_share")); 133 $("#pavo_contents").css("clear", "both"); 134 $(".social_share").after("<br/>"); 135 } 136 } else { 137 if (PavoSocialParams.MOBILE_SHARE_BUTTON_POS == "float" && PavoSocialParams.IS_MOBILE == true) { 138 setMaxWidth(); 139 displaySocialButton(); 140 } 141 } 142 }); 143 } 144 */ 145 146 }); 147 148 displaySocialButton = function ( ) { 149 150 var screenwidth = $( window ).width(); 151 var screenheight = $( window ).height(); 152 var cnt = $(".social_share > a").size(); 153 // var top = $("#pavo_social_sharing").position().top; 154 var top = $("#pavo_social_sharing").offset().top; 155 var height = $("#pavo_social_sharing").outerHeight(true); 156 157 if($("#wpadminbar").length > 0 ){ 158 screenheight = screenheight - $("#wpadminbar").height(); 159 } 160 161 //ê°ë¡ëª¨ëì´ê³ íì¬ ì¬ì©ì ì¤í¬ë¡¤ íë©´ì´ ë³¸ë¬¸ë³´ë¤ ìì ìì ê²½ì°ìë fixed ìì±ì ì ê±°í´ì¤ë¤. 162 if(window.innerWidth > window.innerHeight) { 163 164 if($(this).scrollTop() < top) { 165 $(".social_share").css("position", ""); 166 } else { 167 168 169 170 if(height - screenheight > 0) { 171 $(".social_share").css("position", "fixed"); 172 $(".social_share").css("right", (screenwidth - $("#pavo_social_sharing").width())/2+"px"); 173 } 174 } 175 } 176 177 //2. ì¬ì©ìê° ì¤í¬ë¡¤í ììì´ ë³¸ë¬¸ ììì¼ ê²½ì° ìì´ì½ ë³´ì¬ì¤. 178 if($(this).scrollTop() <= top + height) { 179 $(".social_share > a").css("display", "block"); 180 } 181 182 //3. ì¸ë¡ëª¨ëì¼ë ì¤í¬ë¡¤ ë²ìì ë°ë¼ ìì ë²í¼ì 본문 íë¨ì ìì¹ìì¼ì¤ë¤. 183 //3-1. ì¤í¬ë¡¤ ë²ìê° ë³¸ë¬¸ íë¨ì¼ ê²½ì°ìë social share div를 pavo_contents ë°ì ë¶ì¬ì¤ë¤. 184 if(window.innerWidth < window.innerHeight) { 185 var bottom = top + height + $('.social_share').height(); 186 187 if($("#wpadminbar").length > 0 ){ 188 bottom += $("#wpadminbar").height(); 189 } 190 191 if(height - screenheight > 0) { 192 var icon_height = $(".social_share").height(); 193 var add_height = icon_height; 194 if( $("#wpadminbar").length > 0 ){ 195 add_height += ( $("#wpadminbar").height() * 2 ); 196 } 197 if($(this).scrollTop() >( top - add_height ) && (bottom - $(this).scrollTop()) < (screenheight + add_height) ) { 198 //fixed, bottom 0px ìì± ì ê±°íê³ ìì ê³µì ìì´ì½ì 본문 íë¨ì ë
198¶ì¸ë¤. 199 $(".social_share").removeAttr('style'); 200 201 $(".social_share").css("z-index", "20"); 202 $("#pavo_contents").after($(".social_share")); 203 204 //ìì ìì´ì½ ì¬ì©ê°¯ìê° 6ê° ì´íì¼ëë width, height ê³ ì 205 if(cnt >= 5) { 206 $("#pavo_social_sharing").parent().css("margin-bottom", screenheight/cnt+"px"); 207 } else { 208 $("#pavo_social_sharing").parent().css("margin-bottom", screenheight/PavoSocialParams.SOCIAL_OPTION_COUNT+"px"); 209 } 210 $("#pavo_social_sharing").css("margin-bottom", "0px" ); 211 } else { 212 //ìì ê³µì ìì´ì½ì íë©´ íë¨ì fixìí¨ë¤. 213 $("#pavo_contents").before($(".social_share")); 214 215 $(".social_share").css("position", "fixed"); 216 $(".social_share").css("bottom", "0px"); 217 218 $("#pavo_contents").css("margin-bottom", "0px"); 219 $("#pavo_social_sharing").css("margin-bottom", icon_height + "px" ); 220 } 221 } else { 222 $(".social_share").removeAttr('style'); 223 224 $(".social_share").css("z-index", "20"); 225 $("#pavo_contents").after($(".social_share")); 226
227 //ìì ìì´ì½ ì¬ì©ê°¯ìê° 6ê° ì´íì¼ëë width, height ê³ ì 228 if(cnt >= 6) { 229 $("#pavo_social_sharing").parent().css("margin-bottom", screenheight/cnt+"px"); 230 } else { 231 $("#pavo_social_sharing").parent().css("margin-bottom", screenheight/PavoSocialParams.SOCIAL_OPTION_COUNT+"px"); 232 } 233 } 234 } else if(window.innerWidth > window.innerHeight) { 235 //3. ê°ë¡ëª¨ëì¼ë ì¤í¬ë¡¤ ë²ìì ë°ë¼ ìì ë²í¼ì 본문 íë¨ì ìì¹ìì¼ì¤ë¤. 236 //3-1. ì¤í¬ë¡¤ ë²ìê° ë³¸ë¬¸ íë¨ì¼ ê²½ì°ìë social share div를 fixed ìì±ì í´ì ìí¤ê³ pavo_contents ìì ë¶ì¬ì¤ë¤. 237 var bottom = top + height; 238 var social_area_height = $(".social_share > a > img").outerHeight(true)*cnt; 239 //if(height - screenheight > 0) { 240 //본문 길ì´ê° ìì ìì´ì½ í¬ê¸°ë³´ë¤ ìì ê²½ì°ì ì²ë¦¬ 241 if($("#pavo_contents").height() < social_area_height) { 242 $("#pavo_contents").after($(".social_share")); 243 $("#pavo_social_sharing").parent().css("margin-bottom", screenheight/cnt+"px"); 244 } else { 245 if($(this).scrollTop() > top && (bottom - ($(this).scrollTop() - ((screenheight - social_area_height)*2) + (screenheight - social_area_height )) ) < screenheight ) { 246 if(height - screenheight > 0) { 247 //fixed, bottom 0px ìì± ì ê±°íê³ ìì ê³µì ìì´ì½ì 본문 íë¨ì ë¶ì¸ë¤. 248 $(".social_share").removeAttr('style'); 249 250 $(".social_share").css("z-index", "20"); 251 252 //1-1. social_share_divì í¬ê¸° ì¡°ì - ê°ë¡ 253 var icon_size = screenheight/PavoSocialParams.SOCIAL_OPTION_COUNT; 254 if( icon_size > PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE ){ 255 icon_size = Number(PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE); 256 } 257 258 $(".social_share").css("width", icon_size+"px"); 259 260 var iconheight = 0; 261 if(cnt >= 6) { 262 iconheight = (screenheight/cnt )-5; 263 } else { 264 iconheight = icon_size; 265 } 266 var socialmargintop = height - (iconheight * cnt); 267 268 $(".social_share").css("margin-top", socialmargintop+"px"); 269 $(".social_share").css("float", "right"); 270 } 271 } else { 272 $(".social_share").css("margin-top", ""); 273 if($(this).scrollTop() < top) { 274 $(".social_share").css("position", ""); 275 } else { 276 $(".social_share").css("position", "fixed"); 277 278 if($("#wpadminbar").length > 0 ){ 279 $(".social_share").css("top", $("#wpadminbar").height()); 280 }else{ 281 $(".social_share").css("top", "0px"); 282 } 283 $(".social_share").css("right", (screenwidth - $("#pavo_social_sharing").width())/2+"px"); 284 } 285 } 286 } 287 //} 288 } 289 } 290 291 292 setMaxWidth = function ( ) { 293 294 var maxwidth = $(".social_share").parent().width(); 295 var maxheight = $(".social_share").parent().height(); 296 var cnt = $(".social_share > a").size(); 297 298 var screenwidth = $( window ).width(); 299 var screenheight = $( window ).height(); 300 if($("#wpadminbar").length > 0 ){ 301 screenheight = screenheight - $("#wpadminbar").height(); 302 } 303 304 var top = $("#pavo_social_sharing").position().top; 305 var height = $("#pavo_social_sharing").outerHeight(true); 306 307 308 //ê°ë¡ 모ë, ì¸ë¡ 모ë ë¶ê¸° 309 if(window.innerWidth > window.innerHeight) { 310 //ê°ë¡ 모ëì¼ ê²½ì°ì 311 //모ë°ì¼ê¸°ê¸°ì´ê³ íë¨ ê³ ì ìµì ì ì¬ì©í ê²½ì°ì social_share div ìì img ìì´ì½ í¬ê¸° ì¡°ì 312 if (PavoSocialParams.MOBILE_SHARE_BUTTON_POS == "float" && PavoSocialParams.IS_MOBILE == true) { 313 $(".social_share").removeAttr('style'); 314 315 $(".social_share").css("position", "fixed"); 316 $(".social_share").css("z-index", "20"); 317 $(".social_share").css("top", "0px"); 318 319 $("#pavo_contents").before($(".social_share")); 320 321 //1. social_share div ìì img ìì´ì½ í¬ê¸° ì¡°ì - ìì ìì´ì½ ê°¯ìê° 6ê° ì´ìì¼ë 322 if(cnt >= 6) { 323 $(".social_share > a > img").css( "width", (( screenheight/cnt )-5) + "px" ); 324 $(".social_share > a > img").css( "height", (( screenheight/cnt )-5) + "px" ); 325 } else { 326 var icon_size = screenheight/PavoSocialParams.SOCIAL_OPTION_COUNT; 327 if( icon_size > PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE ){ 328 icon_size = Number(PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE); 329 } 330 $(".social_share > a > img").css( "width", icon_size + "px" ); 331 $(".social_share > a > img").css( "height", icon_size + "px" ); 332 } 333 334 //본문 길ì´ê° ìì ìì´ì½ì ëì´ë³´ë¤ ìì ê²½ì°ìë 본문 íë¨ì ë
334¶ì¬ì¤ë¤. 335 if($("#pavo_contents").height() < $(".social_share > a > img").height()*cnt) { 336 337 $("#pavo_contents").after($(".social_share")); 338 $(".social_share").removeAttr('style'); 339 340 $(".social_share").css("z-index", "20"); 341 $(".social_share").css("width", "100%"); 342 343 $("#pavo_contents").css("padding-right", "0px"); 344 } else { 345 ////////////ìì ìì´ì½ ê°¯ìê° 6ê° ì´ìì¼ë 346 //4. 본문 div right padding 347 if(cnt >= 6) { 348 //1-1. social_share_divì í¬ê¸° ì¡°ì - ê°ë¡ 349 var icon_size = screenheight/PavoSocialParams.SOCIAL_OPTION_COUNT; 350 if( icon_size > PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE ){ 351 icon_size = Number(PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE); 352 } 353 $(".social_share").css("width", icon_size + "px"); 354 $(".social_share a img").css("height", icon_size + "px"); 355 //1-2. social_share_divì í¬ê¸° ì¡°ì - ì¸ë¡ 356 //$(".social_share").css("height", height + "px"); 357 $("#pavo_contents").css("padding-right", icon_size+10+"px"); 358 }
358 else { //ìì ìì´ì½ ê°¯ìê° 6ê° ì´íì¼ ê²½ì° 359 //1-1. social_share_divì í¬ê¸° ì¡°ì - ê°ë¡ 360 var icon_size = screenheight/PavoSocialParams.SOCIAL_OPTION_COUNT; 361 if( icon_size > PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE ){ 362 icon_size = Number(PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE); 363 } 364 $(".social_share").css("width", icon_size+"px"); 365 //1-2. social_share_divì í¬ê¸° ì¡°ì - ì¸ë¡ 366 //$(".social_share").css("height", height + "px"); 367 368 $("#pavo_contents").css("padding-right", icon_size+"px"); 369 } 370 371 $(".social_share").css("float", "right"); 372 $(".social_share").css("right", "0px"); 373 } 374 } 375 } else if (window.innerWidth < window.innerHeight) { 376 //ì¸ë¡ 모ëì¼ ê²½ì°ì 377 //모ë°ì¼ê¸°ê¸°ì´ê³ íë¨ ê³ ì ìµì ì ì¬ì©í ê²½ì°ì 378 if (PavoSocialParams.MOBILE_SHARE_BUTTON_POS == "float" && PavoSocialParams.IS_MOBILE == true) { 379 $(".social_share").removeAttr('style'); 380 381 $(".social_share").css("position", "fixed"); 382 $(".social_share").css("z-index", "999"); 383 $(".social_share").css("bottom", "0px"); 384 $(".social_share").css("width", "100%"); 385 386 $("#pavo_contents").css("padding-right", "0px"); 387 388 //ìì ìì´ì½ ê°¯ìê° 6ê° ì´ìì¼ë 389 if(cnt >= 5) { 390 $(".social_share > a > img").css( "width", (( maxwidth/cnt )- 4) + "px" ); 391 $(".social_share > a > img").css( "height", (( maxwidth/cnt )- 4) + "px" ); 392 } else { 393 var icon_size = maxwidth/PavoSocialParams.SOCIAL_OPTION_COUNT; 394 if( icon_size > PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE ){ 395 icon_size = Number(PavoSocialParams.SOCIAL_SHARE_BUTTON_SIZE); 396 } 397 $(".social_share > a > img").css( "width", icon_size + "px" ); 398 $(".social_share > a > img").css( "height", icon_size + "px" ); 399 } 400 } 401 } 402 } 403 404 sendStoryLink = function ( postUrl , post_id ) { 405 if(PavoSocialParams.IS_MOBILE){ 406 $.ajax({ 407 type: 'POST', 408 url: PavoSocialParams.ajax_url, 409 data: { 410 "action": "pavo_sharing_kakao", 411 "postId" : post_id, 412 }, 413 dataType: "json", 414 error : function(error) { 415 alert('ì¤ë¥ê° ë°ìíìµëë¤.'); 416 }, 417 success: function(data){ 418 var thumbnail = ''; 419 if(data.thumbnail && data.thumbnail[0]) { 420 thumbnail = data.thumbnail[0]; 421 } 422 Kakao.Story.open({ 423 url: postUrl, 424 text: PavoSocialParams.SITE_NAME + ' ìì ê³µì ë ê¸ì ëë¤.', 425 urlInfo: { 426 title: PavoSocialParams.SITE_NAME, 427 name: data.desc, 428 images: [thumbnail] 429 } 430 }); 431 } 432 }); 433 }else{ 434 Kakao.Story.share({ 435 url: postUrl, 436 text: PavoSocialParams.SITE_NAME + ' ìì ê³µì ë ê¸ì ëë¤.' 437 }); 438 } 439 440 } 441 442 sendTalkLink = function ( post_id ) { 443 $.ajax({ 444 type: 'POST', 445 url: PavoSocialParams.ajax_url, 446 data: { 447 "action": "pavo_sharing_kakao", 448 "postId" : post_id, 449 }, 450 dataType: "json", 451 error : function(error) { 452 alert('ì¤ë¥ê° ë°ìíìµëë¤.'); 453 }, 454 success: function(data){ 455 var thumbnail = ''; 456 var thumbnail_width = 0; 457 var thumbnail_height = 0; 458 if(data.thumbnail && data.thumbnail[0]) { 459 thumbnail = data.thumbnail[0]; 460 thumbnail_width = data.thumbnail[1]; 461 thumbnail_height = data.thumbnail[2]; 462 } 463 Kakao.Link.sendDefault({ 464 objectType: 'feed', 465 content: { 466 title: data.title, 467 description: data.desc, 468 imageUrl: thumbnail, 469 imageWidth: thumbnail_width, 470 imageHeight: thumbnail_height, 471 link: { 472 mobileWebUrl: data.post_url, 473 webUrl: data.post_url 474 } 475 }, 476 buttons: [ 477 { 478 title: PavoSocialParams.KAKAO_BTN_TEXT, 479 link: { 480 mobileWebUrl: data.post_url, 481 webUrl: data.post_url 482 } 483 } 484 ] 485 }); 486 } 487 }); 488 } 489 490 function nospaces(t) { 491 if(t.value.match(/\s/g)){ 492 t.value=t.value.replace(/\s/g,''); 493 } 494 } 495 496 function showKakaoHelpDiv() { 497 if($("#kakao_api_help").css("display") == "none") 498 $("#kakao_api_help").show(); 499 else if($("#kakao_api_help").css("display") == "block") 500 $("#kakao_api_help").hide(); 501 } 502 503 var clipboard = new ClipboardJS('.social_share .clipboard'); 504 505 clipboard.on('success', function(e) { 506 if(window.clipboardData != undefined ){ 507 window.clipboardData.setData('text', e.text); 508 } 509 alert('í´ë¦½ë³´ëì ë³µì¬ëììµëë¤.'); 510 }); 511 512 clipboard.on('error', function(e) { 513 alert('í´ë¦½ë³´ëì ë³µì¬ì ì¤í¨íììµëë¤..'); 514 }); 515 516 517 518});
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.