1/** 2 * WP File Download 3 * 4 * @package WP File Download 5 * @author Joomunited 6 * @version 1.0 7 */ 8function preloader() { 9 jQuery('.wpfd-loading').css('background',"transparent url("+wpfdfrontend.pluginurl + "/app/site/assets/images/theme/loadingfile.svg) no-repeat center center"); 10} 11function addLoadEvent(func) { 12 var oldonload = window.onload; 13 if (typeof window.onload != 'function') { 14 window.onload = func; 15 } else { 16 window.onload = function() { 17 if (oldonload) { 18 oldonload(); 19 } 20 func(); 21 } 22 } 23} 24function wpfdSendTrackingEventThenDownload(Action, Label, Url) { 25 "use strict"; 26 var rtn = false; 27 if (typeof (_gaq) !== "undefined") { 28 _gaq.push(['_trackEvent', 'WPFD', Action, Label]); 29 rtn = true; 30 } 31 32 if (typeof (ga) !== "undefined") { 33 ga('send', 'event', 'WPFD', Action, Label); 34 rtn = true; 35 } 36 37 if (typeof (gtag) !== "undefined") { 38 gtag('event', Action, { 39 'event_category' : 'WPFD', 40 'event_label' : Label 41 }); 42 rtn = true; 43 } 44 45 return rtn; 46} 47function wpfdTrackDownload() { 48 if(typeof (wpfdparams) !== "undefined" && wpfdparams.ga_download_tracking === "1") { 49 jQuery('a.wpfd_downloadlink').on('click', function(e) { 50 var href = jQuery(this).attr('href'); 51 var extLink = href.replace(/^https?\:\/\//i, ''); 52 53 wpfdSendTrackingEventThenDownload('Download', extLink, href); 54 }); 55 56 //run below code when open preview on new tab 57 jQuery('a.wpfd_previewlink').on('click', function(e) { 58 var href = jQuery(this).attr('href'); 59 var extLink = href.replace(/^https?\:\/\//i, ''); 60 61 wpfdSendTrackingEventThenDownload('Preview', extLink, href); 62 }); 63 } 64} 65 66function wpfd_remove_loading(el) { 67 jQuery('.wpfd-loading', el).remove(); 68} 69window.wpfdAjax = {}; 70jQuery(document).ready(function($) { 71 addLoadEvent(preloader); 72 wpfdTrackDownload(); 73 $(document).on('click', '.wpfd-open-tree', function (e) { 74 var $this = $(this); 75 var tree = $this.parent().find('.wpfd-foldertree'); 76 77 // tree.toggleClass('tree-open'); 78 if (tree.hasClass('tree-open')) { 79 tree.slideUp(500).removeClass('tree-open'); 80 } else { 81 tree.slideDown(500).addClass('tree-open'); 82 } 83 }); 84 $(document).on('wpfd:category-loaded', function (e) { 85 var tree2 = $('.wpfd-foldertree'); 86 // Hide all opened left tree 87 if (tree2.hasClass('tree-open')) { 88 tree2.slideUp(500).removeClass('tree-open'); 89 } 90 }); 91}); 92
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.