1define('fc/wa', ['jquery'], function ($) { 2 var module = {}; 3 4 function share_click(e) { 5 e.preventDefault(); 6 module.share($(this)); 7 } 8 9 module.init = function ($parent) { 10 if (!$parent) { 11 $parent = $(document); 12 } 13 $parent.find('.whatsapp-publish') 14 .off('click', share_click) 15 .on('click', share_click); 16 }; 17 18 /** 19 * 20 * @param {Object} Element with whatsapp url scheme link 21 */ 22 module.share = function (ele) { 23 data = {}; 24 if (ele.attr('href') && ele.attr('href').length > 0) { 25 data['url'] = ele.attr('href'); 26 } 27 else { 28 data['url'] = ele.data('link'); 29 } 30 31 var wa_url = ele.data('share-url'); 32 if (wa_url) { 33 _gaq.push(['_trackSocial', 'Whatsapp', 'share', data['url']]); 34 window.location = wa_url; 35 } 36 }; 37 38 return module; 39});
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.