1jQuery(document).ready( function($) { 2 3 4 /* Hide Whatsapp button on other devices than iPhones and Androids */ 5 if(navigator.userAgent.match(/(iPhone)/i) || navigator.userAgent.match(/(Android)/i)){ 6 $('.mashicon-whatsapp').show(); 7 } 8 /* Network sharer scripts */ 9 $('.mashicon-google').click( function(e) { 10 e.preventDefault(); 11 winWidth = 520; 12 winHeight = 350; 13 var winTop = (screen.height / 2) - (winHeight / 2); 14 var winLeft = (screen.width / 2) - (winWidth / 2); 15 var url = $(this).attr('href'); 16 17 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 18 }); 19 $('.mashicon-buffer').click( function(e) { 20 e.preventDefault(); 21 console.log("buffer"); 22 winWidth = 800; 23 winHeight = 470; 24 var winTop = (screen.height / 2) - (winHeight / 2); 25 var winLeft = (screen.width / 2) - (winWidth / 2); 26 var url = $(this).attr('href'); 27 28 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 29 }); 30 31 32 $('body') 33 .off('click', '.mashicon-pinterest') 34 .on('click', '.mashicon-pinterest', function(e) { 35 e.preventDefault(); 36 console.log('preventDefault:' + e); 37 winWidth = 520; 38 winHeight = 350; 39 var winTop = (screen.height / 2) - (winHeight / 2); 40 var winLeft = (screen.width / 2) - (winWidth / 2); 41 var url = $(this).attr('data-mashsb-url'); 42 var pinterest_select = mashnet.pinterest_select; 43 if (pinterest_select === '1'){ 44 console.log('pinterest_select:' + pinterest_select); 45 mashnet_load_pinterest(mashnet_get_images(url)); 46 return; 47 }else{ 48 console.log('opening second sharer:' + pinterest_select); 49 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 50 51 } 52 }); 53 54 55 $('.mashicon-linkedin').click( function(e) { 56 e.preventDefault(); 57 winWidth = 520; 58 winHeight = 350; 59 var winTop = (screen.height / 2) - (winHeight / 2); 60 var winLeft = (screen.width / 2) - (winWidth / 2); 61 var url = $(this).attr('href'); 62 63 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 64 }); 65 $('.mashicon-digg').click( function(e) { 66 e.preventDefault(); 67 winWidth = 520; 68 winHeight = 350; 69 var winTop = (screen.height / 2) - (winHeight / 2); 70 var winLeft = (screen.width / 2) - (winWidth / 2); 71 var url = $(this).attr('href'); 72 //window.open('http://digg.com/submit?phase=2%20&url=' + mashsb.share_url + '&title=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 73 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 74 }); 75 $('.mashicon-stumbleupon').click( function(e) { 76 e.preventDefault(); 77 winWidth = 520; 78 winHeight = 350; 79 var winTop = (screen.height / 2) - (winHeight / 2); 80 var winLeft = (screen.width / 2) - (winWidth / 2); 81 var url = $(this).attr('href'); 82 /*if (mashsb.singular === '1') { 83 window.open('http://www.stumbleupon.com/submit?url=' + encodeURIComponent(mashsb.share_url), 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 84 }else{*/ 85 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 86 //} 87 }); 88 $('.mashicon-vk').click( function(e) { 89 e.preventDefault(); 90 winWidth = 520; 91 winHeight = 350; 92 var winTop = (screen.height / 2) - (winHeight / 2); 93 var winLeft = (screen.width / 2) - (winWidth / 2); 94 var url = $(this).attr('href'); 95 //if (mashsb.singular === '1') { 96 //window.open('http://vkontakte.ru/share.php?url=' + mashsb.share_url + '&item=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 97 /*}else{*/ 98 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 99 //} 100 }); 101 $('.mashicon-print').click( function(e) { 102 e.preventDefault(); 103 winWidth = 520; 104 winHeight = 350; 105 var winTop = (screen.height / 2) - (winHeight / 2); 106 var winLeft = (screen.width / 2) - (winWidth / 2); 107 var url = $(this).attr('href'); 108 //window.open('http://www.printfriendly.com/print/?url=' + mashsb.share_url + '&item=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 109 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 110 }); 111 $('.mashicon-reddit').click( function(e) { 112 e.preventDefault(); 113 winWidth = 520; 114 winHeight = 820; 115 var winTop = (screen.height / 2) - (winHeight / 2); 116 var winLeft = (screen.width / 2) - (winWidth / 2); 117 var url = $(this).attr('href'); 118 /*if (mashsb.singular === '1') { 119 window.open('http://www.reddit.com/submit?url=' + mashsb.share_url + '&title=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 120 }else{*/ 121 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 122 //} 123 }); 124 $('.mashicon-delicious').click( function(e) { 125 e.preventDefault(); 126 winWidth = 520; 127 winHeight = 350; 128 var winTop = (screen.height / 2) - (winHeight / 2); 129 var winLeft = (screen.width / 2) - (winWidth / 2); 130 var url = $(this).attr('href'); 131 /*if (mashsb.singular === '1') { 132 window.open('https://delicious.com/save?v=5&noui&jump=close&url=' + mashsb.share_url + '&title=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 133 }else{*/ 134 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 135 //} 136 }); 137 $('.mashicon-weibo').click( function(e) { 138 e.preventDefault(); 139 winWidth = 520; 140 winHeight = 350; 141 var winTop = (screen.height / 2) - (winHeight / 2); 142 var winLeft = (screen.width / 2) - (winWidth / 2); 143 var url = $(this).attr('href'); 144 /*if (mashsb.singular === '1') { 145 window.open('http://service.weibo.com/share/share.php?url=' + mashsb.share_url + '&title=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 146 }else{*/ 147 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 148 //} 149 }); 150 $('.mashicon-pocket').click( function(e) { 151 e.preventDefault(); 152 winWidth = 520; 153 winHeight = 350; 154 var winTop = (screen.height / 2) - (winHeight / 2); 155 var winLeft = (screen.width / 2) - (winWidth / 2); 156 var url = $(this).attr('href'); 157 /*if (mashsb.singular === '1') { 158 window.open('https://getpocket.com/save?title=' + mashsb.title + '&url=' + mashsb.share_url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 159 }else{*/ 160 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 161 //} 162 }); 163 $('.mashicon-xing').click( function(e) { 164 e.preventDefault(); 165 winWidth = 520; 166 winHeight = 350; 167 var winTop = (screen.height / 2) - (winHeight / 2); 168 var winLeft = (screen.width / 2) - (winWidth / 2); 169 var url = $(this).attr('href'); 170 /*if (mashsb.singular === '1') { 171 window.open('https://www.xing.com/social_plugins/share?h=1;url=' + mashsb.share_url + '&title=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 172 }else{*/ 173 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 174 //} 175 }); 176 $('.mashicon-odnoklassniki').click( function(e) { 177 e.preventDefault(); 178 winWidth = 520; 179 winHeight = 350; 180 var winTop = (screen.height / 2) - (winHeight / 2); 181 var winLeft = (screen.width / 2) - (winWidth / 2); 182 var url = $(this).attr('href'); 183 /*if (mashsb.singular === '1') { 184 window.open('http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=' + mashsb.share_url + '&title=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 185 }else{ 186 */ 187 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 188 //} 189 }); 190 $('.mashicon-managewp').click( function(e) { 191 e.preventDefault(); 192 winWidth = 520; 193 winHeight = 350; 194 var winTop = (screen.height / 2) - (winHeight / 2); 195 var winLeft = (screen.width / 2) - (winWidth / 2); 196 var url = $(this).attr('href'); 197 /*if (mashsb.singular === '1') { 198 window.open('http://managewp.org/share/form?url=' + mashsb.share_url + '&title=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 199 }else{*/ 200 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 201 //} 202 }); 203 $('.mashicon-tumblr').click( function(e) { 204 e.preventDefault(); 205 winWidth = 520; 206 winHeight = 350; 207 var winTop = (screen.height / 2) - (winHeight / 2); 208 var winLeft = (screen.width / 2) - (winWidth / 2); 209 var url = $(this).attr('href'); 210 /*if (mashsb.singular === '1') { 211 window.open('https://www.tumblr.com/share?v=3&u='+ encodeURIComponent(mashsb.share_url) + '&t=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 212 }else{*/ 213 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 214 //} 215 }); 216 $('.mashicon-meneame').click( function(e) { 217 e.preventDefault(); 218 winWidth = 520; 219 winHeight = 350; 220 var winTop = (screen.height / 2) - (winHeight / 2); 221 var winLeft = (screen.width / 2) - (winWidth / 2); 222 var url = $(this).attr('href'); 223 /*if (mashsb.singular === '1') { 224 window.open('http://www.meneame.net/submit.php?url=' + mashsb.share_url + '&title=' + mashsb.title, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); 225 }else{*/ 226 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 227 //} 228 }); 229 $('.mashicon-whatsapp').click( function(e) { 230 //e.preventDefault(); 231 function escapeRegExp(string) { 232 return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); 233 } 234 235 function replaceAll(string, find, replace) { 236 return string.replace(new RegExp(escapeRegExp(find), 'g'), replace); 237 } 238 var title = mashsb.title; 239 var url = $(this).attr('href'); 240 var href = 'whatsapp://send?text=' + replaceAll(title, '+', '%20') + '%20' + mashsb.share_url; 241 /*if (mashsb.singular === '1') { 242 $(this).attr("href", href); 243 }else{*/ 244 $(this).attr("href", url); 245 //} 246 }); 247 $('.mashicon-mail').click( function(e) { 248 if (typeof mashnet !== 'undefined'){ 249 var subject = mashnet.subject; 250 var body = mashnet.body; 251 } else { 252 var subject = 'Check out this site: '; 253 var body = ''; 254 } 255 256 /*if (mashsb.singular === '1') { 257 var href = 'mailto:?subject=' + subject + '&body=' + body + mashsb.share_url; 258 $(this).attr("href", href); 259 }else{*/ 260 var href = $(this).attr('href'); 261 $(this).attr("href", href); 262 //} 263 $(this).attr('target', '_blank'); 264 }); 265 $('.mashicon-yummly').click( function(e) { 266 e.preventDefault(); 267 winWidth = 620; 268 winHeight = 447; 269 var winTop = (screen.height / 2) - (winHeight / 2); 270 var winLeft = (screen.width / 2) - (winWidth / 2); 271 var url = $(this).attr('href'); 272 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 273 }); 274 $('.mashicon-frype').click( function(e) { 275 e.preventDefault(); 276 winWidth = 620; 277 winHeight = 447; 278 var winTop = (screen.height / 2) - (winHeight / 2); 279 var winLeft = (screen.width / 2) - (winWidth / 2); 280 var url = $(this).attr('href'); 281 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 282 }); 283 $('.mashicon-skype').click( function(e) { 284 e.preventDefault(); 285 winWidth = 620; 286 winHeight = 447; 287 var winTop = (screen.height / 2) - (winHeight / 2); 288 var winLeft = (screen.width / 2) - (winWidth / 2); 289 var url = $(this).attr('href'); 290 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 291 }); 292 $('.mashicon-telegram').click( function(e) { 293 e.preventDefault(); 294 winWidth = 620; 295 winHeight = 540; 296 var winTop = (screen.height / 2) - (winHeight / 2); 297 var winLeft = (screen.width / 2) - (winWidth / 2); 298 var url = $(this).attr('href'); 299 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 300 }); 301 $('.mashicon-flipboard').click( function(e) { 302 e.preventDefault(); 303 winWidth = 620; 304 winHeight = 540; 305 var winTop = (screen.height / 2) - (winHeight / 2); 306 var winLeft = (screen.width / 2) - (winWidth / 2); 307 var url = $(this).attr('href'); 308 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 309 }); 310 $('.mashicon-hackernews').click( function(e) { 311 e.preventDefault(); 312 winWidth = 620; 313 winHeight = 540; 314 var winTop = (screen.height / 2) - (winHeight / 2); 315 var winLeft = (screen.width / 2) - (winWidth / 2); 316 var url = $(this).attr('href'); 317 window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight + ',resizable=yes'); 318 }); 319 320/* Load Pinterest Popup window 321 * 322 * @param string html cont
322ainer 323 * @returns void 324 */ 325function mashnet_load_pinterest(html) { 326 327 mashnet_load_pinterest_body(); 328 329 jQuery('.mashnet_pinterest_header').fadeIn(500); 330 jQuery('.mashnet_pinterest_inner').html(html); 331 332 /* Close Pinterest popup*/ 333 jQuery ('.mashnet_pinterest_close').click( function (e){ 334 e.preventDefault(); 335 jQuery ('.mashnet_pinterest_header').hide(); 336 }); 337} 338 339/** 340 * Load pinterest wrapper 341 * 342 * @returns voids 343 */ 344 function mashnet_load_pinterest_body() { 345 var winWidth = window.innerWidth; 346 var popupWidth = 350; 347 var popupHeight = 310; 348 349 /* Load Pinterest popup into body of page */ 350 if (winWidth <= 330) 351 var popupWidth = 310; 352 if (winWidth > 400) 353 var popupWidth = 390; 354 if (winWidth > 500) 355 var popupWidth = 490; 356 357 var winTop = (window.innerHeight / 2) - (popupHeight / 2); 358 var winLeft = (window.innerWidth / 2) - (popupWidth / 2); 359 var struct = '<div class="mashnet_pinterest_header" style="position:fixed;z-index:999999;max-width:' + popupWidth + 'px; margin-left:' + winLeft + 'px;top:' + winTop + 'px;">\n\ 360 <div class="mashnet_pinit_wrapper" style="background-color:white;"><span class="mashnet_pin_it">Pin it! </span><span class="mashnet_pinicon"></span> \n\ 361<div class="mashnet_pinterest_close" style="float:right;"><a href="#">X</a></div></div>\n\ 362<div class="mashnet_pinterest_inner"></div>\n\ 363 </div>\n\ 364 '; 365 366 jQuery('body').append(struct); 367 } 368 369 370 /* Get all images on site 371 * 372 * @return html 373 * */ 374 function mashnet_get_images(url){ 375 376 var allImages = jQuery('img').not("[nopin='nopin']"); 377 var html = ''; 378 var url = ''; 379 380 var largeImages = allImages.filter(function(){ 381 return (jQuery(this).width() > 70) || (jQuery(this).height() > 70) 382 }) 383 for (i = 0; i < largeImages.length; i++){ 384 html += '<li><a target="_blank" id="mashnetPinterestPopup" href="https://pinterest.com/pin/create/button/?url='+encodeURIComponent(window.location.href) +'%2F&media='+largeImages[i].src+'&description='+largeImages[i].alt+'"><img src="' + largeImages[i].src + '"></a></li>'; 385 } 386 return html; 387 } 388});
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.