PageSourceSearch

https://vermilionculturalcenter.org/wp/wp-content/litespeed/js/69f636edd809933dd6c543f983293c23.js?ver=50d2a

js vermilionculturalcenter.org collected 2026-10-05 19:01:32 UTC 74,563 bytes, 193 lines download raw bytes

1/**
2 * Wpfd
3 *
4 * We developed this code with our hearts and passion.
5 * We hope you found it useful, easy to understand and to customize.
6 * Otherwise, please feel free to contact us at [email protected] *
7 * @package WP File Download
8 * @copyright Copyright (C) 2013 JoomUnited (http://www.joomunited.com). All rights reserved.
9 * @copyright Copyright (C) 2013 Damien Barrère (http://www.crac-design.com). All rights reserved.
10 * @license GNU General Public License version 2 or later; http://www.gnu.org/licenses/gpl-2.0.html
11 */
12jQuery(document).ready(function($){var sourcefile=$("#wpfd-template-preview-box").html();var preview_hash=window.location.hash;var preview_cParents={};var preview_tree=$('.wpfd-foldertree-preview');var preview_root_cat=$('.wpfd-content-preview').data('category');var preview_subcategories_hover_color_list={};var allCategoriesBreadcrumbs='<li><a class="catlink" data-idcat="all_0" href="javascript:void(0);">'+wpfdparams.translates.wpfd_all_categories+'</a></li>';var allCategoriesDividerBreadcrumbs='<li><a class="catlink" data-idcat="all_0" href="javascript:void(0);">'+wpfdparams.translates.wpfd_all_categories+'</a><span class="divider"> &gt; </span></li>';if(window.wpfdAjax===undefined){window.wpfdAjax={}}
13window.wpfdAjax[preview_root_cat]={category:null,file:null};$(".wpfd-content-preview").each(function(){var preview_topCat=$(this).data('category');if(preview_topCat=='all_0'){preview_cParents[preview_topCat]={parent:0,term_id:0,name:$(this).find("h2").text().trim()}}else{preview_cParents[preview_topCat]={parent:0,term_id:preview_topCat,name:$(this).find("h2").text().trim()}}
14$(this).find(".wpfdcategory.catlink").each(function(){var tempidCat=$(this).data('idcat');preview_cParents[tempidCat]={parent:preview_topCat,term_id:tempidCat,name:$(this).text().trim()}});initInputSelected(preview_topCat);initDownloadSelected(preview_topCat);wpfdMailNotifyFileChanges(preview_topCat);wpfdFrontFilesOrdering(preview_topCat)});Handlebars.registerHelper('bytesToSize',function(bytes){if(typeof bytes==="undefined"){return'n/a'}
15return bytes.toString().toLowerCase()==='n/a'?bytes:bytesToSize(bytes)});function wpfdPreviewDisplayDownloadedFiles(){var fileDownload=$('.wpfd-content.wpfd-content-preview .file');var linkDownload=$('.dropblock .wpfd_downloadlink');var user_login_id=wpfdparams.wpfd_user_login_id;if(linkDownload.length){linkDownload.on('click',function(){var fileId=$(this).parents('.dropblock').data('id');const download_timestamp=Math.floor(Date.now()/1000);var isDownloadedFile=localStorage.getItem('wpfd_downloaded_file_'+user_login_id+'_'+fileId);if(isDownloadedFile===null){localStorage.setItem('wpfd_downloaded_file_'+user_login_id+'_'+fileId,'yes');localStorage.setItem('wpfd_downloaded_file_'+user_login_id+'_'+fileId+'_timer',download_timestamp.toString());$('.wpfd-file-link[data-id="'+fileId+'"]').parents('.file').addClass('is_downloaded')}else{localStorage.setItem('wpfd_downloaded_file_'+user_login_id+'_'+fileId+'_timer',download_timestamp.toString())}})}
16if(fileDownload.length){fileDownload.each(function(){var id=$(this).find('.wpfd-file-link').data('id');var edit=$(this).find('.wpfd-file-link').data('edit');var isFileDownload=localStorage.getItem('wpfd_downloaded_file_'+user_login_id+'_'+id);if(isFileDownload){$(this).addClass('is_downloaded');var download_timer=localStorage.getItem('wpfd_downloaded_file_'+user_login_id+'_'+id+'_timer');if(!download_timer){download_timer=0}
17if(parseInt(edit)-parseInt(download_timer)>0){$(this).addClass('new_edit')}}
18$(this).show()})}
19$('.wpfd-content.wpfd-content-preview').show()}
20wpfdPreviewDisplayDownloadedFiles();initClickFile();function preview_initClick(){$(document).off('click','.wpfd-content-preview .catlink').on('click','.wpfd-content-preview .catlink',function(e){var ctheme=$(this).parents('.wpfd-content').find('.wpfd_root_category_theme').val();var c_root_cat=$(this).parents('.wpfd-content').find('.wpfd_root_category_id').val();if($(this).hasClass('backcategory')){c_root_cat=$(this).data('idcat')}
21$(".wpfd-content[data-category="+$(this).parents('.wpfd-content-'+ctheme).data('category')+"] .wpfd-container-"+ctheme).find('.wpfd-categories .wpfdcategory.catlink').each(function(){var tempidCat=$(this).data('idcat');var catName='';if($(this).attr('title')!==undefined){catName=$(this).attr('title').trim()}else if($(this).data('title')!==undefined){catName=$(this).data('title').trim()}
22preview_cParents[tempidCat]={parent:$(this).parents('.wpfd-content-'+ctheme).data('category'),term_id:tempidCat,name:catName}});e.preventDefault();load(c_root_cat,$(this).data('idcat'))})}
23function initInputSelected(sc){$(document).on('change',".wpfd-content-preview.wpfd-content-multi[data-category="+sc+"] input.cbox_file_download",function(e){e.stopPropagation();var rootCat=".wpfd-content-preview.wpfd-content-multi[data-category="+sc+"]";var selectedFiles=$(rootCat+" input.cbox_file_download:checked");var mailNotify=parseInt($(rootCat+" .wpfd_category_notify_file_changes").val())===1?!0:!1;var globalNotify=parseInt($(rootCat+" .wpfd_global_notify_file_changes").val())===1?!0:!1;var loginUser=parseInt($(rootCat+" .wpfd_user_login").val())===0?!1:!0;var filesId=[];if(selectedFiles.length){selectedFiles.each(function(index,file){filesId.push($(file).data('id'))})}
24if(!globalNotify||!loginUser){mailNotify=!1}
25if(filesId.length>0){$(rootCat+" .wpfdSelectedFiles").remove();$('<input type="hidden" class="wpfdSelectedFiles" value="'+filesId.join(',')+'" />').insertAfter($(rootCat).find(" #current_category_slug_"+sc));hideDownloadAllBtn(sc,!0);$(rootCat+" .preview-download-selected").remove();if(mailNotify){$(rootCat).find(".wpfd-category-mail-subscribe-selected").remove();$(rootCat).find(".wpfd-category-mail-subscribe-all").hide();var mailSelectedBtn=$('<a href="javascript:void(0);" class="wpfd-category-mail-subscribe-selected" style="display: block;">'+wpfdparams.translates.mail_notify_selected+'</a>');$(rootCat).find("div.wpfd-header-btn-group").append(mailSelectedBtn)}
26var downloadSelectedBtn=$('<a href="javascript:void(0);" class="preview-download-selected" style="display: block;">'+wpfdparams.translates.download_selected+'<i class="zmdi zmdi-check-all wpfd-download-category"></i></a>');$(rootCat).find("div.wpfd-header-btn-group").append(downloadSelectedBtn)}else{$(rootCat+" .wpfdSelectedFiles").remove();$(rootCat+" .preview-download-selected").remove();hideDownloadAllBtn(sc,!1);if(mailNotify){$(rootCat).find(".wpfd-category-mail-subscribe-selected").remove();$(rootCat).find(".wpfd-category-mail-subscribe-all").show()}}
27preview_init_pagination($(rootCat).next(".wpfd-pagination"))})}
28function hideDownloadAllBtn(sc,hide){var rootCat=".wpfd-content-preview.wpfd-content-multi[data-category="+sc+"]";var downloadCatButton=$(rootCat+" .preview-download-category");if(downloadCatButton.length===0||downloadCatButton.hasClass('display-download-category')){return}
29if(hide){$(rootCat+" .preview-download-category").hide()}else{$(rootCat+" .preview-download-category").show()}}
30function initDownloadSelected(sc){var rootCat=".wpfd-content-preview.wpfd-content-multi[data-category="+sc+"]";$(document).on('click',rootCat+' .preview-download-selected',function(){if($(rootCat).find('.wpfdSelectedFiles').length>0){var current_category=$(rootCat).find('#current_category_'+sc).val();var category_name=$(rootCat).find('#current_category_slug_'+sc).val();var selectedFilesId=$(rootCat).find('.wpfdSelectedFiles').val();$.ajax({url:wpfdparams.wpfdajaxurl+"?action=wpfd&task=files.zipSeletedFiles&filesId="+selectedFilesId+"&wpfd_category_id="+current_category,dataType:"json",}).done(function(results){if(results.success){var hash=results.data.hash;window.location.href=wpfdparams.wpfdajaxurl+"?action=wpfd&task=files.downloadZipedFile&hash="+hash+"&wpfd_category_id="+current_category+"&wpfd_category_name="+category_name}else{alert(results.data.message)}})}})}
31function showMailSubscriptions(sc,show){var rootCat=".wpfd-content.wpfd-content-multi[data-category="+sc+"]";var globalNotify=parseInt($(rootCat+" .wpfd_global_notify_file_changes").val())===1?!0:!1;var loginUser=parseInt($(rootCat+" .wpfd_user_login").val())===0?!1:!0;var subscribeAll=$(rootCat+" .wpfd-category-mail-subscribe-all");var subscribeSelected=$(rootCat+" .wpfd-category-mail-subscribe-selected");if(show){subscribeAll.show();subscribeSelected.show()}else{subscribeAll.hide();subscribeSelected.hide()}
32if(!globalNotify||!loginUser){subscribeAll.hide();subscribeSelected.hide()}}
33function wpfdMailNotifyFileChanges(sc){var rootCat=".wpfd-content-preview.wpfd-content-multi[data-category="+sc+"]";$(document).on('click',rootCat+' .wpfd-category-mail-subscribe-all',function(e){e.preventDefault();var current_category=$(rootCat).find('#current_category_'+sc).val();var category_name=$(rootCat).find('#current_category_slug_'+sc).val();var selectedFilesId=$(rootCat).find('.wpfdSelectedFiles').val();var title=$(rootCat).find('.wpfd-category-mail-subscribe-all').text();$.ajax({url:wpfdparams.wpfdajaxurl+"?action=wpfd&task=files.mailNotifyEntireCategoryFiles&wpfd_category_id="+current_category,dataType:"json",beforeSend:function(){$(rootCat).find('.wpfd-category-mail-subscribe-all').text('Subscribing...')},}).done(function(results){if(results.success){var hash=results.data.hash;$(rootCat).find('.wpfd-category-mail-subscribe-all').text('Done!');setTimeout(function(){$(rootCat).find('.wpfd-category-mail-subscribe-all').text(title)},1500)}else{alert(results.data.message)}})});$(document).on('click',rootCat+' .wpfd-category-mail-subscribe-selected',function(e){e.preventDefault();if($(rootCat).find('.wpfdSelectedFiles').length>0){var current_category=$(rootCat).find('#current_category_'+sc).val();var category_name=$(rootCat).find('#current_category_slug_'+sc).val();var selectedFilesId=$(rootCat).find('.wpfdSelectedFiles').val();$.ajax({url:wpfdparams.wpfdajaxurl+"?action=wpfd&task=files.mailNotifySelectedFiles&filesId="+selectedFilesId+"&wpfd_category_id="+current_category,dataType:"json",beforeSend:function(){$(rootCat).find('.wpfd-category-mail-subscribe-selected').text('Subscribing...')},}).done(function(results){if(results.success){var hash=results.data.hash;$(rootCat).find('.wpfd-category-mail-subscribe-selected').text('Done!');setTimeout(function(){$(rootCat).find('.wpfd-category-mail-subscribe-selected').text(wpfdparams.translates.mail_notify_selected)},1500)}else{alert(results.data.message)}})}})}
34function wpfdFrontFilesOrdering(sc){var rootCat=".wpfd-content-preview.wpfd-content-multi[data-category="+sc+"]";$(document).on('change',rootCat+' .ju-front-ordering',function(e){e.preventDefault();if(parseInt(sc)===0){return!1}
35var current_category_id=$(rootCat).find('#current_category_'+sc).val();var front_files_ordering=$(rootCat+' .front-selected-files-ordering').val();var front_files_ordering_direction=$(rootCat+' .front-selected-files-ordering-direction').val();var page=1;var ordering_hash=window.location.hash;ordering_hash=ordering_hash.replace('#','');if(ordering_hash!==''&&ordering_hash.indexOf('-wpfd-')!==-1){var hasha=ordering_hash.split('-');var re=new RegExp("^(p[0-9]+)$");var stringpage=hasha.pop();if(re.test(stringpage)){page=stringpage.replace('p','')}}
36$(rootCat).find('#current_ordering_'+sc).val(front_files_ordering);$(rootCat).find('#current_ordering_direction_'+sc).val(front_files_ordering_direction);preview_front_ordering_load(sc,current_category_id,page)})}
37preview_initClick();if(typeof wpfdColorboxInit!=='undefined'){wpfdColorboxInit()}
38function wpfd_preview_menu_category_link_handlers(){if($('.wpfd_menu_category_links .elementor-icon-list-item').length){$('.wpfd_menu_category_links .elementor-icon-list-item').unbind('click').on('click',function(e){var hashSubUrl=$(this).find('a').attr('href');var hashGoId='';if(hashSubUrl.indexOf('/')!==-1){var hashParams=hashSubUrl.split('/');hashGoId=hashParams[hashParams.length-1];hashGoId=hashGoId.replace('#','');if(hashGoId!==''){var hashGoIda=hashGoId.split('-');var hashGoIda_sourcecat=hashGoIda[0];var hashGoIda_category_id=hashGoIda[1];setTimeout(function(){load(hashGoIda_sourcecat,hashGoIda_category_id,null);if($('#e-n-menu-content-1872').length){$('#e-n-menu-content-1872').hide()}},100)}}})}}
39wpfd_preview_menu_category_link_handlers();preview_hash=preview_hash.replace('#','');if(preview_hash!==''){var hasha=preview_hash.split('-');var re=new RegExp("^(p[0-9]+)$");var page=null;var stringpage=hasha.pop();if(re.test(stringpage)){page=stringpage.replace('p','')}
40var hash_category_id=hasha[1];var hash_sourcecat=hasha[0];if(parseInt(hash_category_id)>0||hash_category_id==='all_0'){if(hash_category_id=='all_0'){hash_category_id=0}
41setTimeout(function(){load(hash_sourcecat,hash_category_id,page)},100)}}
42function initClickFile(){$('.wpfd-content .wpfd-file-link').unbind('click').click(function(e){var atthref=$(this).attr('href');if(atthref!=='#'){return}
43e.preventDefault();var fileid=$(this).data('id');var categoryid=$(this).data('category_id');$.ajax({url:wpfdparams.wpfdajaxurl+"task=file.display&view=file&id="+fileid+"&categoryid="+categoryid+"&rootcat="+preview_root_cat,dataType:"json",beforeSend:function(){if($('body').has('wpfd-preview-box-loader')!==!0){$('body').append('<div class="wpfd-preview-box-loader"></div>')}}}).done(function(file){var template=Handlebars.compile(sourcefile);var html=template(file);var box=$("#wpfd-preview-box");$('.wpfd-preview-box-loader').each(function(){$(this).remove()});if(box.length===0){$('body').append('<div id="wpfd-preview-box" style="display: none;"></div>');box=$("#wpfd-preview-box")}
44box.empty();box.prepend(html);box.attr('data-id',fileid);box.attr('data-catid',categoryid);box.attr('class','wpfd-preview-box wpfd-download-box');if(typeof(file.file.ext)!=='undefined'){box.attr('data-type',file.file.ext);box.addClass(file.file.ext)}
45box.click(function(e){if($(e.target).is('#wpfd-preview-box')){box.hide()}
46$('#wpfd-preview-box').unbind('click.box').bind('click.box',function(e){if($(e.target).is('#wpfd-preview-box')){box.hide()}})});if($("#wpfd-preview-box .file-custom-field.file-url").length){var link=typeof(wpfdparams.translates.wpfd_url_custom_field)!=='undefined'?wpfdparams.translates.wpfd_url_custom_field:'Link';$("#wpfd-preview-box .file-custom-field.file-url").each(function(){var label=$(this).attr('data-field-label');var url=$(this).attr('data-field-val');var urlContents='<div><span>'+label+': </span><a href="'+url+'" target="_blank">'+link+'</a></div>';$(this).empty().append(urlContents)})}
47if(typeof(file.file.linkdownload)!=='undefined'){var previewLinkDownload='<input type="hidden" class="wpfd_file_preview_link_download" value="'+file.file.linkdownload+'" data-filetitle="'+file.file.post_title+'" />';box.prepend(previewLinkDownload)}
48$('#wpfd-preview-box .wpfd-close').click(function(e){e.preventDefault();box.hide()});box.show();var dropblock=box.find('.dropblock');if($(window).width()<400){dropblock.css('margin-top','0');dropblock.css('margin-left','0');dropblock.css('top','0');dropblock.css('left','0');dropblock.height($(window).height()-parseInt(dropblock.css('padding-top'),10)-parseInt(dropblock.css('padding-bottom'),10));dropblock.width($(window).width()-parseInt(dropblock.css('padding-left'),10)-parseInt(dropblock.css('padding-right'),10))}else{dropblock.css('margin-top',(-(dropblock.height()/2)-20)+'px');dropblock.css('margin-left',(-(dropblock.width()/2)-20)+'px');dropblock.css('height','');dropblock.css('width','');dropblock.css('top','');dropblock.css('left','')}
49if(dropblock&&typeof(file.file.ID)!=='undefined'){dropblock.attr('data-id',file.file.ID)}
50if(typeof wpfdColorboxInit!=='undefined'){wpfdColorboxInit()}
51wpfdTrackDownload();$('body.elementor-default #wpfd-preview-box a.wpfd_downloadlink').on('click',function(e){e.preventDefault();e.stopPropagation();var link=$(this).attr('href');window.location.href=link});wpfdPreviewDisplayDownloadedFiles();wpfdPreviewDownloadFiles();wpfdPreviewFileNewName()})})}
52_wpfd_text=function(text){if(typeof(l10n)!=='undefined'){return l10n[text]}
53return text};function toMB(mb){return mb*1024*1024}
54var allowedExt=wpfdparams.allowed;allowedExt=allowedExt.split(',');allowedExt.sort();var initUploader=function(currentContainer){var upload_type='file';var uploader=new Resumable({target:wpfdparams.wpfduploadajax+'?action=wpfd&task=files.upload&upload_from=front',query:{id_category:$(currentContainer).find('input[name=id_category]').val(),},fileParameterName:'file_upload',simultaneousUploads:1,maxChunkRetries:1,maxFileSize:toMB(wpfdparams.maxFileSize),maxFileSizeErrorCallback:function(file){alert(file.name+' '+_wpfd_text('is too large, please upload file(s) less than ')+wpfdparams.maxFileSize+'Mb!')},chunkSize:wpfdparams.serverUploadLimit-50*1024,forceChunkSize:!0,fileType:allowedExt,fileTypeErrorCallback:function(file){alert(file.name+' cannot upload!<br/><br/>'+_wpfd_text('This type of file is not allowed to be uploaded. You can add new file types in the plugin configuration'))},generateUniqueIdentifier:function(file,event){var relativePath=file.webkitRelativePath||file.fileName||file.name;var size=file.size;var prefix=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);return(prefix+size+'-'+relativePath.replace(/[^0-9a-zA-Z_-]/img,''))}});if(!uploader.support){alert(_wpfd_text('Your browser does not support HTML5 file uploads!'))}
55if(typeof(willUpload)==='undefined'){var willUpload=!0}
56uploader.on('filesAdded',function(files){files.forEach(function(file){var progressBlock='<div class="wpfd_process_block" id="'+file.uniqueIdentifier+'">'+'<div class="wpfd_process_fileinfo">'+'<span class="wpfd_process_filename">'+file.fileName+'</span>'+'<span class="wpfd_process_cancel">Cancel</span>'+'</div>'+'<div class="wpfd_process_full" style="display: block;">'+'<div class="wpfd_process_run" data-w="0" style="width: 0%;"></div>'+'</div></div>';currentContainer.find('#preview','.wpreview').before(progressBlock);$(currentContainer).find('.wpfd_process_cancel').unbind('click').click(function(){fileID=$(this).parents('.wpfd_process_block').attr('id');fileObj=uploader.getFromUniqueIdentifier(fileID);uploader.removeFile(fileObj);$(this).parents('.wpfd_process_block').fadeOut('normal',function(){$(this).remove()});if(uploader.files.length===0){$(currentContainer).find('.wpfd_process_pause').fadeOut('normal',function(){$(this).remove()})}
57$.ajax({url:wpfdparams.wpfduploadajax+'?action=wpfd&task=files.upload',method:'POST',dataType:'json',data:{id_category:$('input[name=id_category]').val(),deleteChunks:fileID},success:function(res,stt){if(res.response===!0){}}})})});if(files.length>0){uploadPauseBtn=$(currentContainer).find('.wpreview').find('.wpfd_process_pause').length;restableBlock=$(currentContainer).find('.wpfd_process_block');if(!uploadPauseBtn){restableBlock.before('<div class="wpfd_process_pause">Pause</div>');$(currentContainer).find('.wpfd_process_pause').unbind('click').click(function(){if(uploader.isUploading()){uploader.pause();$(this).text('Start');$(this).addClass('paused');willUpload=!1}else{uploader.upload();$(this).text('Pause');$(this).removeClass('paused');willUpload=!0}})}
58uploader.opts.query={id_category:currentContainer.find('input[name=id_category]').val()};if(willUpload){setTimeout(function(){uploader.upload()},1000)}}});uploader.on('createFolders',function(files){upload_type='folder';var currentRootCat=currentContainer.find('input[name=id_category]').val()
59var paths=files.map(function(file){if(file.hasOwnProperty('catId')){currentRootCat=file.catId}
60var filePath=(file.hasOwnProperty('relativePath'))?file.relativePath:file.webkitRelativePath;var namePos=filePath.lastIndexOf(file.name);return filePath.substr(0,namePos)});paths=paths.filter(function(item,i,ar){return item&&ar.indexOf(item)===i});if(paths.length>0){var categoryType=currentContainer.find('input[name=category_type]').val();$.ajax({url:wpfdparams.wpfduploadajax+'?action=wpfd&task=categories.createCategoriesDeep',data:{paths:paths.join('|'),category_id:currentRootCat,type:categoryType},method:'POST',success:function(data){}})}})
61uploader.on('fileProgress',function(file){$(currentContainer).find('.wpfd_process_block#'+file.uniqueIdentifier).find('.wpfd_process_run').width(Math.floor(file.progress()*100)+'%')});uploader.on('fileSuccess',function(file,res){var thisUploadBlock=currentContainer.find('.wpfd_process_block#'+file.uniqueIdentifier);thisUploadBlock.find('.wpfd_process_cancel').addClass('uploadDone').text('OK').unbind('click');thisUploadBlock.find('.wpfd_process_full').remove();var response=JSON.parse(res);if(response.response===!1&&typeof(response.datas)!=='undefined'){if(typeof(response.datas.code)!=='undefined'&&response.datas.code>20){alert('<div>'+response.datas.message+'</div>');return!1}}
62if(typeof(response)==='string'){alert('<div>'+response+'</div>');return!1}
63if(response.response!==!0){alert(response.response);return!1}});uploader.on('fileError',function(file,msg){thisUploadBlock=currentContainer.find('.wpfd_process_block#'+file.uniqueIdentifier);thisUploadBlock.find('.wpfd_process_cancel').addClass('uploadError').text('Error').unbind('click');thisUploadBlock.find('.wpfd_process_full').remove()});uploader.on('complete',function(){var currentRootCat=currentContainer.find('input[name=id_category]').val();var sourcecat=currentContainer.parents('.wpfd-content.wpfd-content-multi').data('category');var theme=currentContainer.parents('.wpfd-content.wpfd-content-multi[data-category='+sourcecat+']').find('.wpfd_root_category_theme').val();var wpfd_tree=$('.wpfd-content[data-category="'+sourcecat+'"] .wpfd-foldertree');wpfd_tree.jaofiletree({script:wpfdparams.wpfduploadajax+'?juwpfisadmin=false&action=wpfd&task=categories.getCats',usecheckboxes:!1,root:sourcecat,expanded:parseInt(wpfdparams.allow_category_tree_expanded)===1?!0:!1});var categoryAjaxUrl=wpfdparams.wpfdajaxurl+"task=categories.display&view=categories&id="+currentRootCat+"&top="+sourcecat;if(wpfdPreviewCategoriesLocalCache.exist(categoryAjaxUrl)){wpfdPreviewCategoriesLocalCache.remove(categoryAjaxUrl)}
64var fileCount=$(currentContainer).find('.wpfd_process_cancel').length;var categoryId=$(currentContainer).find('input[name=id_category]').val();$.ajax({url:wpfdparams.wpfduploadajax+'?action=wpfd&task=files.wpfdPendingUploadFiles',method:'POST',dataType:'json',data:{uploadedFiles:fileCount,id_category:categoryId,},success:function(res){currentContainer.find('.progress').delay(300).fadeIn(300).hide(300,function(){$(this).remove()});currentContainer.find('.uploaded').delay(300).fadeIn(300).hide(300,function(){$(this).remove()});$('#wpreview .file').delay(1200).show(1200,function(){$(this).removeClass('done placeholder')});$('.gritter-item-wrapper ').remove();$(currentContainer).find('#wpfd-upload-messages').append(wpfdparams.translates.msg_upload_file);$(currentContainer).find('#wpfd-upload-messages').delay(1200).fadeIn(1200,function(){$(currentContainer).find('#wpfd-upload-messages').empty();$(currentContainer).find('.wpfd_process_pause').remove();$(currentContainer).find('.wpfd_process_block').remove()});if(currentContainer.parent('.wpfd-upload-form').length){var preview_sourcecat=currentContainer.parents('.wpfd-content.wpfd-content-multi').data('category');var current_category=currentContainer.parents('.wpfd-content.wpfd-content-multi').find('#current_category_'+preview_sourcecat).val();var ordering=$(".wpfd-content-preview.wpfd-content-multi[data-category="+preview_sourcecat+"]").find('#current_ordering_'+preview_sourcecat).val();var orderingDirection=$(".wpfd-content-preview.wpfd-content-multi[data-category="+preview_sourcecat+"]").find('#current_ordering_direction_'+preview_sourcecat).val();var page_limit=$(".wpfd-content-preview[data-category="+preview_sourcecat+"]").find('#page_limit_'+preview_sourcecat).val();var params=$.param({task:'files.display',view:'files',id:current_category,rootcat:preview_sourcecat,page:page,orderCol:ordering,orderDir:orderingDirection,page_limit:page_limit});var previewFilesAjaxUrl=wpfdparams.wpfdajaxurl+params;if(wpfdPreviewFilesLocalCache.exist(previewFilesAjaxUrl)){wpfdPreviewFilesLocalCache.remove(previewFilesAjaxUrl)}
65upload_type='file';load(preview_sourcecat,current_category,null,upload_type)}}})});uploader.assignBrowse($(currentContainer).find('#upload_button'));uploader.assignBrowse($(currentContainer).find('#upload_folder_button'),!0);uploader.assignDrop($(currentContainer).find('.jsWpfdFrontUpload'))}
66function load(sourcecat,catid,page,upload_type){$(document).trigger('wpfd:category-loading');var pathname=window.location.href.replace(window.location.hash,'');var container=$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]");var view_empty_subcategories=$(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_is_empty_subcategories");
66var view_empty_files=$(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_is_empty_files");container.find('#current_category_'+sourcecat).val(catid);container.next('.wpfd-pagination').remove();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").empty();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").html($('#wpfd-loading-wrap').html());if(view_empty_subcategories.length){view_empty_subcategories.val('1')}
67if(view_empty_files.length){view_empty_files.val('1')}
68var oldCategoryAjax=window.wpfdAjax[preview_root_cat].category;var previewCategoriesAjaxUrl=wpfdparams.wpfdajaxurl+"task=categories.display&view=categories&id="+catid+"&top="+sourcecat;if(oldCategoryAjax!==null){oldCategoryAjax.abort()}
69window.wpfdAjax[preview_root_cat].category=$.ajax({url:previewCategoriesAjaxUrl,dataType:"json",cache:!0,beforeSend:function(){if(container.find('.wpfd-form-search-file-category').length){container.find('.wpfd-form-search-file-category').remove()}
70if(wpfdPreviewCategoriesLocalCache.exist(previewCategoriesAjaxUrl)&&upload_type!='folder'){var triggerPreviewCategories=wpfdPreviewCategoriesLocalCache.get(previewCategoriesAjaxUrl);wpfdPreviewCategoriesLocalCacheTrigger(triggerPreviewCategories,sourcecat,page,pathname,catid,container,view_empty_subcategories);return!1}
71return!0}}).done(function(categories){wpfdPreviewCategoriesLocalCache.set(previewCategoriesAjaxUrl,categories);var $displayFileSearch=$(".wpfd-content-preview[data-category="+sourcecat+"]").find('.wpfd_root_category_display_file_search');if($displayFileSearch.length){var $themeName=container.find('.wpfd_root_category_theme').val();if(typeof(categories.category.correctConvertCategoryId)==='undefined'){categories.category.correctConvertCategoryId=0}
72var $searchContent='<form action="" id="adminForm-'+categories.category.term_id+'" class="wpfd-adminForm wpfd-form-search-file-category" name="adminForm" method="post">'+wpfdparams.wp_nonce_field_localize+'<div id="loader" style="display:none; text-align: center">'+'<img src="'+wpfdparams.wpfd_plugin_url+'/app/site/assets/images/searchloader.svg" style="margin: 0 auto"/>'+'</div>'+'<div class="box-search-filter wpfd-category-search-section">'+'<div class="searchSection">'+'<div class="only-file input-group clearfix wpfd_search_input" id="Search_container">'+'<img src="'+wpfdparams.wpfd_plugin_url+'/app/site/assets/images/search-24.svg" class="material-icons wpfd-icon-search wpfd-search-file-category-icon" />'+'<input type="text" class="pull-left required txtfilename" name="q" id="txtfilename" autocomplete="off" placeholder="'+wpfdparams.translates.msg_search_file_category_placeholder+'" value="" />'+'</div>'+'<button id="btnsearchbelow" class="btnsearchbelow wpfd-btnsearchbelow" type="button">'+wpfdparams.translates.msg_search_file_category_search+'</button>'+'</div>'+'<input type="hidden" id="filter_catid" class="chzn-select filter_catid" name="catid" value="'+categories.category.correctConvertCategoryId+'" data-cattype="" data-slug="" />'+'<input type="hidden" name="theme" value="'+$themeName+'">'+'<input type="hidden" name="limit" value="15">'+'<div id="wpfd-results" class="wpfd-results list-results"></div>'+'</div>'+'</form>';container.prepend($searchContent);wpfdPreviewSearchFileCategoryHandle()}
73if(typeof(categories.notify_file_changes)!=='undefined'&&parseInt(categories.notify_file_changes)===1){$(".wpfd-content.wpfd-content-multi[data-category="+sourcecat+"]").find('.wpfd_category_notify_file_changes').val('1');showMailSubscriptions(sourcecat,!0)}else{$(".wpfd-content.wpfd-content-multi[data-category="+sourcecat+"]").find('.wpfd_category_notify_file_changes').val('0');showMailSubscriptions(sourcecat,!1)}
74if(page!==null&&page!==undefined){var stateCatId=catid;if(sourcecat==='all_0'&&parseInt(catid)===0){stateCatId='all_0'}
75window.history.pushState('',document.title,pathname+'#'+sourcecat+'-'+stateCatId+'-'+categories.category.slug+'-p'+page)}else{window.history.pushState('',document.title,pathname+'#'+sourcecat+'-'+catid+'-'+categories.category.slug)}
76container.find('#current_category_slug_'+sourcecat).val(categories.category.slug);var sourcecategories=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-template-categories").html();if(sourcecategories){var template=Handlebars.compile(sourcecategories);var html=template(categories);if($(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-categories").length){$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-categories").remove()}
77$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").prepend(html)}
78if(categories.category.breadcrumbs!==undefined){if(sourcecat.toString()==='all_0'&&catid.toString()!=='all_0'&&parseInt(catid)!==0){categories.category.breadcrumbs=allCategoriesDividerBreadcrumbs+categories.category.breadcrumbs}
79$(".wpfd-content-preview[data-category="+sourcecat+"] .breadcrumbs").html(categories.category.breadcrumbs)}
80for(var i=0;i<categories.categories.length;i++){preview_cParents[categories.categories[i].term_id]=categories.categories[i]}
81preview_breadcrum(sourcecat,catid,categories.category);preview_initClick();if(preview_tree.length){var currentTree=container.find('.wpfd-foldertree-preview');currentTree.find('li').removeClass('selected');currentTree.find('i.md').removeClass('md-folder-open').addClass("md-folder");currentTree.jaofiletree('open',catid,currentTree);var el=currentTree.find('a[data-file="'+catid+'"]').parent();el.find(' > i.md').removeClass("md-folder").addClass("md-folder-open");if(!el.hasClass('selected')){el.addClass('selected')}
82var ps=currentTree.find('.icon-open-close');$.each(ps.get().reverse(),function(i,p){if(typeof $(p).data()!=='undefined'&&$(p).data('id')==Number(hash_category_id)){hash_category_id=$(p).data('parent_id');if(parseInt(wpfdparams.allow_category_tree_expanded)!==1){$(p).click()}}})}
83wpfd_preview_subcategory_class();if(typeof(preview_subcategories_hover_color_list)!=='undefined'){var root_key_exists=sourcecat in preview_subcategories_hover_color_list;if(root_key_exists){var color=preview_subcategories_hover_color_list[sourcecat];wpfd_preview_subcategories_hover_color(sourcecat,color)}}
84if(view_empty_subcategories.length){view_empty_subcategories.val(categories.categories.length);wpfd_view_fire_empty_category_message(sourcecat)}
85if(parseInt($(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_category_notify_file_changes").val())===0||parseInt($(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_global_notify_file_changes").val())===0){$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd_cloud_checkbox_mail").remove()}});var ordering=$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]").find('#current_ordering_'+sourcecat).val();var orderingDirection=$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]").find('#current_ordering_direction_'+sourcecat).val();var page_limit=$(".wpfd-content-preview[data-category="+sourcecat+"]").find('#page_limit_'+sourcecat).val();var themeName=$(".wpfd-content-preview[data-category="+sourcecat+"]").find('.wpfd_root_category_theme').val();var show_files=1;var atts_shortcode=window["wpfdfrontend_"+themeName];if(atts_shortcode!==undefined&&atts_shortcode.shortcode_param.show_files!==undefined&&sourcecat==='all_0'&&(parseInt(catid)===0||catid==='all_0')){show_files=atts_shortcode.shortcode_param.show_files}
86var params=$.param({task:'files.display',view:'files',id:catid,rootcat:sourcecat,page:page,orderCol:ordering,orderDir:orderingDirection,page_limit:page_limit,show_files:show_files});var oldFileAjax=window.wpfdAjax[preview_root_cat].file;var previewFilesAjaxUrl=wpfdparams.wpfdajaxurl+params;if(oldFileAjax!==null){oldFileAjax.abort()}
87window.wpfdAjax[preview_root_cat].file=$.ajax({url:previewFilesAjaxUrl,dataType:"json",cache:!0,beforeSend:function(){if(wpfdPreviewFilesLocalCache.exist(previewFilesAjaxUrl)&&(upload_type===null||upload_type===undefined)){var previewTriggerFiles=wpfdPreviewFilesLocalCache.get(previewFilesAjaxUrl);wpfdPreviewFilesLocalCacheTrigger(previewTriggerFiles,sourcecat,view_empty_f
87iles,previewFilesAjaxUrl);return!1}
88return!0}}).done(function(content){if(typeof(content.pagination)!=='undefined'&&content.pagination.length){content.cache_pagination=content.pagination}
89wpfdPreviewFilesLocalCache.set(previewFilesAjaxUrl,content);if(content.files.length){$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]  .preview-download-category").removeClass("display-download-category")}else{$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]  .preview-download-category").addClass("display-download-category")}
90if(sourcecat.toString()==='all_0'){$(".wpfd-content-preview[data-category="+sourcecat+"]").parent().find('.wpfd-pagination').remove()}
91$(".wpfd-content-preview[data-category="+sourcecat+"]").after(content.pagination);delete content.pagination;var sourcefiles=$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-template-files").html();var template=Handlebars.compile(sourcefiles);var html=template(content);html=$('<textarea/>').html(html).val();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview .wpfd_list").find('.file').remove();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").append(html);if(typeof(content.filepasswords)!=='undefined'){$.each(content.filepasswords,function(file_id,pw_form){var protected_file=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").find('.wpfd-file-link[data-id="'+file_id+'"]').parent();protected_file.empty();protected_file.addClass('wpfd-password-protection-form');protected_file.append(pw_form)})}
92if(content.uploadform!==undefined&&content.uploadform.length){var upload_form_html='<div class="wpfd-upload-form" style="margin: 20px 10px">';upload_form_html+=content.uploadform;upload_form_html+='</div>';$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").append(upload_form_html);if(typeof(Wpfd)==='undefined'){Wpfd={}}
93var containers=$(".wpfd-content-preview[data-category="+sourcecat+"] div[class*=wpfdUploadForm]");if(containers.length>0){containers.each(function(i,el){initUploader($(el))})}}
94if(typeof(content.fileview)!=='undefined'&&content.fileview.length){content.fileview.forEach(function(viewFile){var preview_dropblock=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview .wpfd-file-link[data-id='"+viewFile.id+"'] .dropblock");if(viewFile.view===!0){preview_dropblock.css({'background-image':'url('+viewFile.link+')'});preview_dropblock.addClass(viewFile.view_class)}else{preview_dropblock.addClass('wpfd-view-default')}})}
95initClickFile();preview_init_pagination($('.wpfd-content-preview[data-category='+sourcecat+'] + .wpfd-pagination'));wpfd_remove_loading($(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview"));$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .wpfdSelectedFiles").remove();$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .preview-download-selected").remove();$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-category-mail-subscribe-selected").remove();hideDownloadAllBtn(sourcecat,!1);if(view_empty_files.length){view_empty_files.val(content.files.length);wpfd_view_fire_empty_category_message(sourcecat)}
96if(parseInt($(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_category_notify_file_changes").val())===0||parseInt($(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_global_notify_file_changes").val())===0){$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd_cloud_checkbox_mail").remove()}
97if(typeof(content.notify_file_changes)!=='undefined'&&parseInt(content.notify_file_changes)===1){$(".wpfd-content-preview[data-category="+sourcecat+"]").find('.wpfd_mail_checkbox').show()}
98wpfdPreviewDisplayDownloadedFiles();wpfdPreviewDownloadFiles();wpfdPreviewFileNewName();wpfdWooCommerceAddToCart()});$(document).trigger('wpfd:category-loaded')}
99function preview_front_ordering_load(sourcecat,catid,page,upload_type){$(document).trigger('wpfd:category-loading');var pathname=window.location.href.replace(window.location.hash,'');var container=$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]");var view_empty_subcategories=$(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_is_empty_subcategories");
99var view_empty_files=$(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_is_empty_files");container.find('#current_category_'+sourcecat).val(catid);container.next('.wpfd-pagination').remove();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").empty();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").html($('#wpfd-loading-wrap').html());if(view_empty_subcategories.length){view_empty_subcategories.val('1')}
100if(view_empty_files.length){view_empty_files.val('1')}
101var previewCategoriesAjaxUrl=wpfdparams.wpfdajaxurl+"task=categories.display&view=categories&id="+catid+"&top="+sourcecat;$.ajax({url:previewCategoriesAjaxUrl,dataType:"json",cache:!0,beforeSend:function(){if(container.find('.wpfd-form-search-file-category').length){container.find('.wpfd-form-search-file-category').remove()}
102return!0}}).done(function(categories){var $displayFileSearch=$(".wpfd-content-preview[data-category="+sourcecat+"]").find('.wpfd_root_category_display_file_search');if($displayFileSearch.length){var $themeName=container.find('.wpfd_root_category_theme').val();if(typeof(categories.category.correctConvertCategoryId)==='undefined'){categories.category.correctConvertCategoryId=0}
103var $searchContent='<form action="" id="adminForm-'+categories.category.term_id+'" class="wpfd-adminForm wpfd-form-search-file-category" name="adminForm" method="post">'+wpfdparams.wp_nonce_field_localize+'<div id="loader" style="display:none; text-align: center">'+'<img src="'+wpfdparams.wpfd_plugin_url+'/app/site/assets/images/searchloader.svg" style="margin: 0 auto"/>'+'</div>'+'<div class="box-search-filter wpfd-category-search-section">'+'<div class="searchSection">'+'<div class="only-file input-group clearfix wpfd_search_input" id="Search_container">'+'<img src="'+wpfdparams.wpfd_plugin_url+'/app/site/assets/images/search-24.svg" class="material-icons wpfd-icon-search wpfd-search-file-category-icon" />'+'<input type="text" class="pull-left required txtfilename" name="q" id="txtfilename" autocomplete="off" placeholder="'+wpfdparams.translates.msg_search_file_category_placeholder+'" value="" />'+'</div>'+'<button id="btnsearchbelow" class="btnsearchbelow wpfd-btnsearchbelow" type="button">'+wpfdparams.translates.msg_search_file_category_search+'</button>'+'</div>'+'<input type="hidden" id="filter_catid" class="chzn-select filter_catid" name="catid" value="'+categories.category.correctConvertCategoryId+'" data-cattype="" data-slug="" />'+'<input type="hidden" name="theme" value="'+$themeName+'">'+'<input type="hidden" name="limit" value="15">'+'<div id="wpfd-results" class="wpfd-results list-results"></div>'+'</div>'+'</form>';container.prepend($searchContent);wpfdPreviewSearchFileCategoryHandle()}
104if(typeof(categories.notify_file_changes)!=='undefined'&&parseInt(categories.notify_file_changes)===1){$(".wpfd-content.wpfd-content-multi[data-category="+sourcecat+"]").find('.wpfd_category_notify_file_changes').val('1');showMailSubscriptions(sourcecat,!0)}else{$(".wpfd-content.wpfd-content-multi[data-category="+sourcecat+"]").find('.wpfd_category_notify_file_changes').val('0');showMailSubscriptions(sourcecat,!1)}
105container.find('#current_category_slug_'+sourcecat).val(categories.category.slug);var sourcecategories=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-template-categories").html();if(sourcecategories){var template=Handlebars.compile(sourcecategories);var html=template(categories);if($(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-categories").length){$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-categories").remove()}
106$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").prepend(html)}
107if(categories.category.breadcrumbs!==undefined){if(sourcecat.toString()==='all_0'&&catid.toString()!=='all_0'&&parseInt(catid)!==0){categories.category.breadcrumbs=allCategoriesDividerBreadcrumbs+categories.category.breadcrumbs}
108$(".wpfd-content-preview[data-category="+sourcecat+"] .breadcrumbs").html(categories.category.breadcrumbs)}
109for(var i=0;i<categories.categories.length;i++){preview_cParents[categories.categories[i].term_id]=categories.categories[i]}
110preview_breadcrum(sourcecat,catid,categories.category);preview_initClick();if(preview_tree.length){var currentTree=container.find('.wpfd-foldertree-preview');currentTree.find('li').removeClass('selected');currentTree.find('i.md').removeClass('md-folder-open').addClass("md-folder");currentTree.jaofiletree('open',catid,currentTree);var el=currentTree.find('a[data-file="'+catid+'"]').parent();el.find(' > i.md').removeClass("md-folder").addClass("md-folder-open");if(!el.hasClass('selected')){el.addClass('selected')}
111var ps=currentTree.find('.icon-open-close');$.each(ps.get().reverse(),function(i,p){if(typeof $(p).data()!=='undefined'&&$(p).data('id')==Number(hash_category_id)){hash_category_id=$(p).data('parent_id');if(parseInt(wpfdparams.allow_category_tree_expanded)!==1){$(p).click()}}})}
112wpfd_preview_subcategory_class();if(typeof(preview_subcategories_hover_color_list)!=='undefined'){var root_key_exists=sourcecat in preview_subcategories_hover_color_list;if(root_key_exists){var color=preview_subcategories_hover_color_list[sourcecat];wpfd_preview_subcategories_hover_color(sourcecat,color)}}
113if(view_empty_subcategories.length){view_empty_subcategories.val(categories.categories.length);wpfd_view_fire_empty_category_message(sourcecat)}
114if(parseInt($(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_category_notify_file_changes").val())===0||parseInt($(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_global_notify_file_changes").val())===0){$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd_cloud_checkbox_mail").remove()}});var ordering=$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]").find('#current_ordering_'+sourcecat).val();var orderingDirection=$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]").find('#current_ordering_direction_'+sourcecat).val();var page_limit=$(".wpfd-content-preview[data-category="+sourcecat+"]").find('#page_limit_'+sourcecat).val();var themeName=$(".wpfd-content-preview[data-category="+sourcecat+"]").find('.wpfd_root_category_theme').val();var show_files=1;var atts_shortcode=window["wpfdfrontend_"+themeName];if(atts_shortcode!==undefined&&atts_shortcode.shortcode_param.show_files!==undefined&&sourcecat==='all_0'&&(parseInt(catid)===0||catid==='all_0')){show_files=atts_shortcode.shortcode_param.show_files}
115var params=$.param({task:'files.display',view:'files',id:catid,rootcat:sourcecat,page:page,orderCol:ordering,orderDir:orderingDirection,page_limit:page_limit,show_files:show_files});var previewFilesAjaxUrl=wpfdparams.wpfdajaxurl+params;$.ajax({url:previewFilesAjaxUrl,dataType:"json",cache:!0,beforeSend:function(){return!0}}).done(function(content){if(typeof(content.pagination)!=='undefined'&&content.pagination.length){content.cache_pagination=content.pagination}
116if(content.files.length){$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]  .preview-download-category").removeClass("display-download-category")}else{$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]  .preview-download-category").addClass("display-download-category")}
117if(sourcecat.toString()==='all_0'){$(".wpfd-content-preview[data-category="+sourcecat+"]").parent().find('.wpfd-pagination').remove()}
118$(".wpfd-content-preview[data-category="+sourcecat+"]").after(content.pagination);delete content.pagination;var sourcefiles=$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-template-files").html();var template=Handlebars.compile(sourcefiles);var html=template(content);html=$('<textarea/>').html(html).val();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview .wpfd_list").find('.file').remove();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").append(html);if(typeof(content.filepasswords)!=='undefined'){$.each(content.filepasswords,function(file_id,pw_form){var protected_file=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").find('.wpfd-file-link[data-id="'+file_id+'"]').parent();protected_file.empty();protected_file.addClass('wpfd-password-protection-form');protected_file.append(pw_form)})}
119if(content.uploadform!==undefined&&content.uploadform.length){var upload_form_html='<div class="wpfd-upload-form" style="margin: 20px 10px">';upload_form_html+=content.uploadform;upload_form_html+='</div>';$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").append(upload_form_html);if(typeof(Wpfd)==='undefined'){Wpfd={}}
120var containers=$(".wpfd-content-preview[data-category="+sourcecat+"] div[class*=wpfdUploadForm]");if(containers.length>0){containers.each(function(i,el){initUploader($(el))})}}
121if(typeof(content.fileview)!=='undefined'&&content.fileview.length){content.fileview.forEac
121h(function(viewFile){var preview_dropblock=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview .wpfd-file-link[data-id='"+viewFile.id+"'] .dropblock");if(viewFile.view===!0){preview_dropblock.css({'background-image':'url('+viewFile.link+')'});preview_dropblock.addClass(viewFile.view_class)}else{preview_dropblock.addClass('wpfd-view-default')}})}
122initClickFile();preview_init_pagination($('.wpfd-content-preview[data-category='+sourcecat+'] + .wpfd-pagination'));wpfd_remove_loading($(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview"));$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .wpfdSelectedFiles").remove();$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .preview-download-selected").remove();$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-category-mail-subscribe-selected").remove();hideDownloadAllBtn(sourcecat,!1);if(view_empty_files.length){view_empty_files.val(content.files.length);wpfd_view_fire_empty_category_message(sourcecat)}
123if(parseInt($(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_category_notify_file_changes").val())===0||parseInt($(".wpfd-content-preview[data-category="+sourcecat+"] #wpfd_global_notify_file_changes").val())===0){$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd_cloud_checkbox_mail").remove()}
124if(typeof(content.notify_file_changes)!=='undefined'&&parseInt(content.notify_file_changes)===1){$(".wpfd-content-preview[data-category="+sourcecat+"]").find('.wpfd_mail_checkbox').show()}
125wpfdPreviewDisplayDownloadedFiles();wpfdPreviewDownloadFiles();wpfdPreviewFileNewName()});$(document).trigger('wpfd:category-loaded')}
126function preview_breadcrum(preview_topCat,catid,category){var links=[];var current_Cat=preview_cParents[catid];if(!current_Cat){$(".wpfd-content-preview[data-category="+preview_topCat+"] .preview-download-category").attr('href',category.linkdownload_cat);return!1}
127links.unshift(current_Cat);if(current_Cat.parent!==0){while(preview_cParents[current_Cat.parent]){current_Cat=preview_cParents[current_Cat.parent];if(links.includes(current_Cat)){break}
128links.unshift(current_Cat)}}
129var html='';if(preview_topCat.toString()==='all_0'&&catid.toString()!=='all_0'&&parseInt(catid)!==0){html=allCategoriesDividerBreadcrumbs}
130for(var i=0;i<links.length;i++){if(parseInt(links[i].term_id)===0){continue}
131if(i<links.length-1){if(links[i].term_id!="all_0"&&parseInt(links[i].term_id)!=0){html+='<li><a class="catlink" data-idcat="'+links[i].term_id+'" href="javascript:void(0)">';html+=links[i].name+'</a><span class="divider"> &gt; </span></li>'}}else{if(links[i].term_id!="all_0"&&parseInt(links[i].term_id)!=0){html+='<li><span>'+links[i].name+'</span></li>'}else{html+='<li><span>'+wpfdparams.translates.wpfd_all_categories+'</span></li>'}}}
132if(html==''&&(catid.toString()=='all_0'||parseInt(catid)==0)){html+='<li><span>'+wpfdparams.translates.wpfd_all_categories+'</span></li>'}
133$(".wpfd-content-preview[data-category="+preview_topCat+"] .wpfd-breadcrumbs-preview").html(html);$(".wpfd-content-preview[data-category="+preview_topCat+"] .catlink").click(function(e){e.preventDefault();load(preview_topCat,$(this).data('idcat'));initClickFile()});$(".wpfd-content-preview[data-category="+preview_topCat+"] .preview-download-category").attr('href',category.linkdownload_cat)}
134if(preview_tree.length){preview_tree.each(function(){var preview_topCat=$(this).parents('.wpfd-content-preview.wpfd-content-multi').data('category');var is_private_category=$(this).parents('.wpfd-content-preview.wpfd-content-multi').hasClass('wpfd-private-category-content');var private_category=is_private_category?1:0;$(this).jaofiletree({script:wpfdparams.wpfdajaxurl+'task=categories.getCats&private_category='+private_category,usecheckboxes:!1,root:preview_topCat,showroot:preview_cParents[preview_topCat].name,expanded:parseInt(wpfdparams.allow_category_tree_expanded)===1?!0:!1,onclick:function(elem,file){if(is_private_category){return!1}
135var preview_topCat=$(elem).parents('.wpfd-content-preview.wpfd-content-multi').data('category');if(preview_topCat!==file){$('.directory',$(elem).parents('.wpfd-content-preview.wpfd-content-multi')).each(function(){if(!$(this).hasClass('selected')&&$(this).find('> ul > li').length===0){$(this).removeClass('expanded')}});if(parseInt(wpfdparams.allow_category_tree_expanded)!==1){$(elem).parents('.directory').each(function(){var $this=$(this);var category=$this.find(' > a');var parent=$this.find('.icon-open-close');if(parent.length>0){if(typeof preview_cParents[category.data('file')]==='undefined'){preview_cParents[category.data('file')]={parent:parent.data('parent_id'),term_id:category.data('file'),name:category.text()}}}})}}
136load(preview_topCat,file)}});var ele=$(this);setTimeout(function(){ele.find("li.directory a").each(function(){var tempCatID=$(this).data('catid');var patentCatID=$(this).data('parent_id');if(tempCatID=='all_0'){preview_cParents[tempCatID]={parent:0,term_id:0,name:$(this).text().trim()}}else{preview_cParents[tempCatID]={parent:patentCatID,term_id:tempCatID,name:$(this).text().trim()}}})},1000)})}
137$('.wpfd-content-preview + .wpfd-pagination').each(function(index,elm){var $this=$(elm);preview_init_pagination($this)});function preview_init_pagination($this){var number=$this.find(':not(.current)');var wrap=$this.prev('.wpfd-content-preview');var sourcecat=wrap.data('category');var current_category=wrap.find('#current_category_'+sourcecat).val();number.unbind('click').bind('click',function(){var page_number=$(this).attr('data-page');var current_sourcecat=$(this).attr('data-sourcecat');var wrap=$(".wpfd-content-preview[data-category="+current_sourcecat+"]");var current_category=$(".wpfd-content-preview[data-category="+current_sourcecat+"]").find('#current_category_'+current_sourcecat).val();if(typeof page_number!=='undefined'){var pathname=window.location.href.replace(window.location.hash,'');var category=$(".wpfd-content-preview[data-category="+current_sourcecat+"]").find('#current_category_'+current_sourcecat).val();var category_slug=$(".wpfd-content-preview[data-category="+current_sourcecat+"]").find('#current_category_slug_'+current_sourcecat).val();var ordering=$(".wpfd-content-preview[data-category="+current_sourcecat+"]").find('#current_ordering_'+current_sourcecat).val();var orderingDirection=$(".wpfd-content-preview[data-category="+current_sourcecat+"]").find('#current_ordering_direction_'+current_sourcecat).val();var page_limit=$(".wpfd-content-preview[data-category="+current_sourcecat+"]").find('#page_limit_'+current_sourcecat).val();var stateCatId=category;if(current_sourcecat==='all_0'&&parseInt(category)===0){stateCatId='all_0'}
138window.history.pushState('',document.title,pathname+'#'+current_sourcecat+'-'+stateCatId+'-'+category_slug+'-p'+page_number);$(".wpfd-content-preview[data-category="+current_sourcecat+"] .wpfd-container-preview:not(wpfd-results .wpfd-container-preview) .wpfd_list").remove();$(".wpfd-content-preview[data-category="+current_sourcecat+"] .wpfd-container-preview:not(wpfd-results .wpfd-container-preview)").append($('#wpfd-loading-wrap').html());var themeName=$(".wpfd-content-preview[data-category="+sourcecat+"]").find('.wpfd_root_category_theme').val();var show_files=1;var atts_shortcode=window["wpfdfrontend_"+themeName];if(atts_shortcode!==undefined&&atts_shortcode.shortcode_param.show_files!==undefined&&sourcecat==='all_0'&&(parseInt(catid)===0||catid==='all_0')){show_files=atts_shortcode.shortcode_param.show_files}
139var params=$.param({task:'files.display',view:'files',id:current_category,rootcat:current_sourcecat,page:page_number,orderCol:ordering,orderDir:orderingDirection,page_limit:page_limit,show_files:show_files});$.ajax({url:wpfdparams.wpfdajaxurl+params,dataType:"json",beforeSend:function(){$('html, body').animate({scrollTop:$(".wpfd-content[data-category="+current_sourcecat+"]").offset().top},'fast')}}).done(function(content){delete content.category;wrap.next('.wpfd-pagination').remove();wrap.after(content.pagination);delete content.pagination;var sourcefiles=$(".wpfd-content-preview.wpfd-content-multi[data-category="+current_sourcecat+"]  .wpfd-template-files").html();var template=Handlebars.compile(sourcefiles);var html=template(content);if($(".wpfd-content-preview[data-category="+current_sourcecat+"] .wpfd-container-preview:not(wpfd-results .wpfd-container-preview) .wpfd-upload-form").length){$(".wpfd-content-preview[data-category="+current_sourcecat+"] .wpfd-container-preview:not(wpfd-results .wpfd-container-preview) .wpfd-upload-form").before(html)}else{$(".wpfd-content-preview[data-category="+current_sourcecat+"] .wpfd-container-preview:not(wpfd-results .wpfd-container-preview)").append(html)}
140initClickFile();if(typeof(content.fileview)!=='undefined'&&content.fileview.length){content.fileview.forEac
140h(function(viewFile){var preview_dropblock=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview:not(wpfd-results .wpfd-container-preview) .wpfd-file-link[data-id='"+viewFile.id+"'] .dropblock");if(viewFile.view===!0){preview_dropblock.css({'background-image':'url('+viewFile.link+')'});preview_dropblock.addClass(viewFile.view_class)}else{preview_dropblock.addClass('wpfd-view-default')}})}
141if(typeof(content.filepasswords)!=='undefined'){$.each(content.filepasswords,function(file_id,pw_form){var protected_file=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").find('.wpfd-file-link[data-id="'+file_id+'"]').parent();protected_file.empty();protected_file.addClass('wpfd-password-protection-form');protected_file.append(pw_form)})}
142preview_init_pagination(wrap.next('.wpfd-pagination'));wpfd_remove_loading($(".wpfd-content-preview[data-category="+current_sourcecat+"] .wpfd-container-preview:not(wpfd-results .wpfd-container-preview)"));wpfdPreviewDisplayDownloadedFiles();wpfdPreviewDownloadFiles();wpfdPreviewFileNewName()})}})}
143function wpfd_preview_container_with_foldertree(){$('.wpfd-content-preview .wpfd-container').each(function(){if($(this).children('.with_foldertree').length>0){$(this).addClass('wpfd_previewcontainer_foldertree')}else{if($(this).hasClass('wpfd_previewcontainer_foldertree')){$(this).removeClass('wpfd_previewcontainer_foldertree')}}});$('.wpfd-content-preview').each(function(){if($(this).children().has('.wpfd-foldertree').length>0){$(this).addClass('wpfdcontent_preview_folder_tree')}else{if($(this).hasClass('wpfdcontent_preview_folder_tree')){$(this).removeClass('wpfdcontent_preview_folder_tree')}}})}
144wpfd_preview_container_with_foldertree();function wpfd_preview_subcategory_class(){var preview_subcategory=$('.wpfd-content-preview a.wpfdcategory');if(preview_subcategory.length){preview_subcategory.addClass('preview_category')}}
145wpfd_preview_subcategory_class();function wpfd_preview_subcategories_hover_color(root_category,color){if(typeof(color)==='undefined'||color===''){color='#3e3294'}
146var style_el='wpfd-view-custom-colors-'+root_category;var custom_color=$('<style class="'+style_el+'">.wpfd-content.wpfd-content-preview[data-category="'+root_category+'"] .preview_category .wpfd-folder:before{color: '+color+' !important; }</style>');if(!$('.'+style_el).length){$('head').append(custom_color)}
147$('.wpfd-content.wpfd-content-preview[data-category="'+root_category+'"] .preview_category').on('mouseover',function(){$(this).css({'background-color':color})}).on('mouseout',function(){$(this).css({'background-color':'#fff'})})}
148if($('.wpfd_subcategories_hover_color').length){$('.wpfd_subcategories_hover_color').each(function(){var color=$(this).val();var root_category=$(this).parents('.wpfd-content').data('category');wpfd_preview_subcategories_hover_color(root_category,color);preview_subcategories_hover_color_list[root_category]=color})}
149function wpfd_view_fire_empty_category_message(category_id){if(!category_id){return}
150var root_category='.wpfd-content-preview.wpfd-content-multi[data-category='+category_id+']';var display_empty_category_message=$(root_category).find('#wpfd_display_empty_category_message').val();var empty_category_message_val=$(root_category).find('#wpfd_empty_category_message_val').val();var is_empty_subcategories=$(root_category).find('#wpfd_is_empty_subcategories').val();var is_empty_files=$(root_category).find('#wpfd_is_empty_files').val();if(parseInt(display_empty_category_message)!==1||parseInt(is_empty_subcategories)!==0||parseInt(is_empty_files)!==0){return}
151var code='<div class="wpfd-empty-category-message-section">';code+='<p class="wpfd-empty-category-message">';code+=empty_category_message_val;code+='</p>';code+='</div>';$(root_category).find('.wpfd-empty-category-message-section').remove();$(root_category).find('.wpfd-container-preview').append(code)}
152var destroy_upload=$('.wpfd-upload-form.destroy');if(destroy_upload.length){destroy_upload.remove()}
153function wpfdPreviewCategoriesLocalCacheTrigger(triggerPreviewCategories,sourcecat,page,pathname,catid,c
153ontainer,view_empty_subcategories){var $displayFileSearch=$(".wpfd-content-preview[data-category="+sourcecat+"]").find('.wpfd_root_category_display_file_search');if($displayFileSearch.length){var $themeName=$(".wpfd-content-preview[data-category="+sourcecat+"]").find('.wpfd_root_category_theme').val();if(typeof(triggerPreviewCategories.category.correctConvertCategoryId)==='undefined'){triggerPreviewCategories.category.correctConvertCategoryId=0}
154var $searchContent='<form action="" id="adminForm-'+triggerPreviewCategories.category.term_id+'" class="wpfd-adminForm wpfd-form-search-file-category" name="adminForm" method="post">'+wpfdparams.wp_nonce_field_localize+'<div id="loader" style="display:none; text-align: center">'+'<img src="'+wpfdparams.wpfd_plugin_url+'/app/site/assets/images/searchloader.svg" style="margin: 0 auto"/>'+'</div>'+'<div class="box-search-filter wpfd-category-search-section">'+'<div class="searchSection">'+'<div class="only-file input-group clearfix wpfd_search_input" id="Search_container">'+'<img src="'+wpfdparams.wpfd_plugin_url+'/app/site/assets/images/search-24.svg" class="material-icons wpfd-icon-search wpfd-search-file-category-icon" />'+'<input type="text" class="pull-left required txtfilename" name="q" id="txtfilename" autocomplete="off" placeholder="'+wpfdparams.translates.msg_search_file_category_placeholder+'" value="" />'+'</div>'+'<button id="btnsearchbelow" class="btnsearchbelow wpfd-btnsearchbelow" type="button">'+wpfdparams.translates.msg_search_file_category_search+'</button>'+'</div>'+'<input type="hidden" id="filter_catid" class="chzn-select filter_catid" name="catid" value="'+triggerPreviewCategories.category.correctConvertCategoryId+'" data-cattype="" data-slug="" />'+'<input type="hidden" name="theme" value="'+$themeName+'">'+'<input type="hidden" name="limit" value="15">'+'<div id="wpfd-results" class="wpfd-results list-results"></div>'+'</div>'+'</form>';$(".wpfd-content-preview[data-category="+sourcecat+"]").prepend($searchContent);wpfdPreviewSearchFileCategoryHandle()}
155if(typeof(triggerPreviewCategories.notify_file_changes)!=='undefined'&&parseInt(triggerPreviewCategories.notify_file_changes)===1){$(".wpfd-content.wpfd-content-multi[data-category="+sourcecat+"]").find('.wpfd_category_notify_file_changes').val('1');showMailSubscriptions(sourcecat,!0)}else{$(".wpfd-content.wpfd-content-multi[data-category="+sourcecat+"]").find('.wpfd_category_notify_file_changes').val('0');showMailSubscriptions(sourcecat,!1)}
156if(page!==null&&page!==undefined){var stateCatId=catid;if(sourcecat==='all_0'&&parseInt(catid)===0){stateCatId='all_0'}
157window.history.pushState('',document.title,pathname+'#'+sourcecat+'-'+stateCatId+'-'+triggerPreviewCategories.category.slug+'-p'+page)}else{window.history.pushState('',document.title,pathname+'#'+sourcecat+'-'+catid+'-'+triggerPreviewCategories.category.slug)}
158container.find('#current_category_slug_'+sourcecat).val(triggerPreviewCategories.category.slug);var sourcecategories=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-template-categories").html();if(sourcecategories){var template=Handlebars.compile(sourcecategories);var html=template(triggerPreviewCategories);$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").prepend(html)}
159if(triggerPreviewCategories.category.breadcrumbs!==undefined){$(".wpfd-content-preview[data-category="+sourcecat+"] .breadcrumbs").html(triggerPreviewCategories.category.breadcrumbs)}
160for(var i=0;i<triggerPreviewCategories.categories.length;i++){preview_cParents[triggerPreviewCategories.categories[i].term_id]=triggerPreviewCategories.categories[i]}
161preview_breadcrum(sourcecat,catid,triggerPreviewCategories.category);preview_initClick();if(preview_tree.length){var currentTree=container.find('.wpfd-foldertree-preview');currentTree.find('li').removeClass('selected');currentTree.find('i.md').removeClass('md-folder-open').addClass("md-folder");currentTree.jaofiletree('open',catid,currentTree);var el=currentTree.find('a[data-file="'+catid+'"]').parent();el.find(' > i.md').removeClass("md-folder").addClass("md-folder-open");if(!el.hasClass('selected')){el.addClass('selected')}
162var ps=currentTree.find('.icon-open-close');$.each(ps.get().reverse(),function(i,p){if(typeof $(p).data()!=='undefined'&&$(p).data('id')==Number(hash_category_id)){hash_category_id=$(p).data('parent_id');$(p).click()}})}
163wpfd_preview_subcategory_class();if(typeof(preview_subcategories_hover_color_list)!=='undefined'){var root_key_exists=sourcecat in preview_subcategories_hover_color_list;if(root_key_exists){var color=preview_subcategories_hover_color_list[sourcecat];wpfd_preview_subcategories_hover_color(sourcecat,color)}}
164if(view_empty_subcategories.length){view_empty_subcategories.val(triggerPreviewCategories.categories.length);wpfd_view_fire_empty_category_message(sourcecat)}}
165function wpfdPreviewFilesLocalCacheTrigger(previewTriggerFiles,sourcecat,view_empty_f
165iles,previewFilesAjaxUrl){if(previewTriggerFiles.files.length){$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]  .preview-download-category").removeClass("display-download-category")}else{$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]  .preview-download-category").addClass("display-download-category")}
166$(".wpfd-content-preview[data-category="+sourcecat+"]").after(previewTriggerFiles.cache_pagination);var sourcefiles=$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]  .wpfd-template-files").html();var template=Handlebars.compile(sourcefiles);var html=template(previewTriggerFiles);html=$('<textarea/>').html(html).val();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview .wpfd_list").find('.file').remove();$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").append(html);if(typeof(previewTriggerFiles.filepasswords)!=='undefined'){$.each(previewTriggerFiles.filepasswords,function(file_id,pw_form){var protected_file=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").find('.wpfd-file-link[data-id="'+file_id+'"]').parent();protected_file.empty();protected_file.addClass('wpfd-password-protection-form');protected_file.append(pw_form)})}
167if(previewTriggerFiles.uploadform!==undefined&&previewTriggerFiles.uploadform.length){var upload_form_html='<div class="wpfd-upload-form" style="margin: 20px 10px">';upload_form_html+=previewTriggerFiles.uploadform;upload_form_html+='</div>';$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview").append(upload_form_html);if(typeof(Wpfd)==='undefined'){Wpfd={}}
168var containers=$(".wpfd-content-preview[data-category="+sourcecat+"] div[class*=wpfdUploadForm]");if(containers.length>0){containers.each(function(i,el){initUploader($(el))})}}
169if(typeof(previewTriggerFiles.fileview)!=='undefined'&&previewTriggerFiles.fileview.length){previewTriggerFiles.fileview.forEach(function(viewFile){var preview_dropblock=$(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview .wpfd-file-link[data-id='"+viewFile.id+"'] .dropblock");if(viewFile.view===!0){preview_dropblock.css({'background-image':'url('+viewFile.link+')'});preview_dropblock.addClass(viewFile.view_class)}else{preview_dropblock.addClass('wpfd-view-default')}})}
170initClickFile();preview_init_pagination($('.wpfd-content-preview[data-category='+sourcecat+'] + .wpfd-pagination'));wpfd_remove_loading($(".wpfd-content-preview[data-category="+sourcecat+"] .wpfd-container-preview"));$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .wpfdSelectedFiles").remove();$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"] .preview-download-selected").remove();hideDownloadAllBtn(sourcecat,!1);if(view_empty_files.length){view_empty_files.val(previewTriggerFiles.files.length);wpfd_view_fire_empty_category_message(sourcecat)}
171if(typeof(previewTriggerFiles.notify_file_changes)!=='undefined'&&parseInt(previewTriggerFiles.notify_file_changes)===1){$(".wpfd-content-preview.wpfd-content-multi[data-category="+sourcecat+"]").find('.wpfd_mail_checkbox').show()}
172wpfdPreviewDisplayDownloadedFiles();wpfdPreviewDownloadFiles();wpfdPreviewFileNewName()}
173function wpfdPreviewCategoryAjaxSearch(element,ordering,direction,pushState=!0){var $=jQuery;var sform=element;var $key=$(sform).find('input[name=q]').val();var $placeholder=$(sform).find('input[name=q]').attr('placeholder');if($key.toString()===$placeholder.toString()){$key=''}
174var formData={'q':$key,'catid':$(sform).find('[name=catid]').val(),'theme':$(sform).find('[name=theme]').val(),'wpfd_search_nonce':$(sform).find('input[name=wpfd_search_nonce]').val(),'limit':$(sform).find('[name=limit]').val()};formData=cleanObj(formData);if(jQuery.isEmptyObject(formData)||(typeof(formData.q)==='undefined'&&typeof(formData.catid)!=='undefined'&&parseInt(formData.catid)===0)||typeof(formData.q)==='undefined'){$(element).find(".txtfilename").focus();return!1}
175if((typeof ordering!=='undefined')&&ordering)formData.ordering=ordering;if((typeof direction!=='undefined')&&direction)formData.dir=direction;if(pushState){var filter_url=jQuery.param(formData);var currentUrl=window.location.search;var pushUrl;if(typeof URLSearchParams!=='undefined'){var currentFilters=new URLSearchParams(currentUrl.substring(1));
175Object.keys(formData).forEach(function(key){if(currentFilters.has(key)){currentFilters.delete(key)}});if(currentUrl.substring(1)==='?'&&currentFilters.toString()!==''){pushUrl=currentFilters.toString()+'&'+filter_url}else{pushUrl='?'+filter_url}
176window.history.pushState(formData,"",pushUrl)}}
177$.ajax({method:"POST",url:wpfdparams.wpfdajaxurl+"task=search.display",data:formData,beforeSend:function(){$(element).find(".wpfd-results").html('');$(element).find(".wpfd-results").prepend($(element).find("#loader").clone().show())},success:function(result){$(element).find(".wpfd_search_file_suggestion").html('');$(element).find(".wpfd_search_file_suggestion").fadeOut(300);$(element).find(".wpfd-results").html(result);$(element).find(".wpfd-results .wpfd-container-preview").addClass('wpfd-container-preview-search');if($(element).find(".wpfd-results .wpfd-form-search-file-category").length){$(element).find(".wpfd-results .wpfd-form-search-file-category").remove()}
178wpfdPreviewInitSorting();if(typeof wpfdColorboxInit!=='undefined'){wpfdColorboxInit()}
179wpfdWooCommerceAddToCart()}})}
180function wpfdPreviewInitSorting(){jQuery('.orderingCol').click(function(e){e.preventDefault();var ordering=jQuery(this).data('ordering');var direction=jQuery(this).data('direction');wpfdPreviewCategoryAjaxSearch(ordering,direction)});jQuery(".list-results #limit").change(function(e){e.preventDefault();jQuery('input[name="limit"]').val(jQuery(this).val());var formID='#'+jQuery(this).closest('form').attr('id');wpfdPreviewCategoryAjaxSearch(formID);return!1})}
181function wpfdPreviewSearchFileCategoryHandle(){$(".wpfd-content .wpfd-adminForm").submit(function(e){e.preventDefault();return!1});$('.wpfd-content .txtfilename').on('keyup',function(e){var $this=$(this);if(e.keyCode===13||e.which===13||e.key==='Enter'){e.preventDefault();if($this.val()===''){return}
182var formID='#'+$this.closest('form').attr('id');wpfdPreviewCategoryAjaxSearch(formID);return}});$(".wpfd-content .btnsearchbelow").on('click',function(e){e.preventDefault();var formID='#'+$(this).closest('form').attr('id');wpfdPreviewCategoryAjaxSearch(formID);return!1})}
183wpfdPreviewSearchFileCategoryHandle();function wpfdPreviewDownloadFiles(){if(!wpfdparams.offRedirectLinkDownloadImageFile){$('.wpfd-preview-box.png .wpfd_downloadlink, .wpfd-preview-box.jpg .wpfd_downloadlink, .wpfd-preview-box.jpeg .wpfd_downloadlink, .wpfd-preview-box.gif .wpfd_downloadlink').on('click',function(event){event.preventDefault();var fileId=$(this).parents('.wpfd-preview-box').attr('data-id');var categoryId=$(this).parents('.wpfd-preview-box').attr('data-catid');var cloudType=$('.wpfd-content-preview').find('.wpfd_root_category_type').val();if(!fileId||!categoryId){return!1}
184if($(this).find('.wpfd-add-to-cart').length){return!1}
185window.location.href=wpfdparams.site_url+"?wpfd_action=wpfd_download_file&wpfd_file_id="+fileId+"&wpfd_category_id="+categoryId+"&cloudType="+cloudType})}}
186wpfdPreviewDownloadFiles();function wpfdPreviewFileNewName(){$('.wpfd_previewlink').click(function(e){var newWindow=$(this).attr('target');var previewLink=$(this).attr('href');var fileTitle=$(this).parents('.dropblock').find('.wpfd_downloadlink').attr('title');var fileName=fileTitle;fileName=fileName?fileName:'WPFD Preview File';if(newWindow==='_blank'&&(previewLink.indexOf('previews')!==-1)&&previewLink.indexOf('docs.google.com')===-1){e.preventDefault();var win=window.open(previewLink,'_blank');win.onload=function(){setTimeout(function(){win.document.title=fileName},100);setTimeout(function(){$(win.document.head).append('<title>'+fileName+'</title>')},3000)};setTimeout(function(){if(win.document.title!==fileName){win.document.title=fileName}},1000);setTimeout(function(){if(win.document.title!==fileName){win.document.title=fileName}},3000)}})}
187wpfdPreviewFileNewName();function wpfdWooCommerceAddToCart(){if(typeof('wc_add_to_cart_params')==="undefined"){return!1}
188var $=jQuery;$('.wpfd_downloadlink:has(.wpfd-add-to-cart)').unbind('click').click(function(e){var $this=$(this);if(!$this.attr('data-product_id')){return!0}
189e.preventDefault();var url=$this.attr('href');var data={};$.each($this.data(),function(key,value){data[key]=value});jQuery.ajax({url:wc_add_to_cart_params.wc_ajax_url.toString().replace('%%endpoint%%','add_to_cart'),method:'POST',data:data,success:function(response,status,xhr){if(!response){return}
190if(response.error&&response.product_url){window.location=response.product_url;return}
191if(wc_add_to_cart_params.cart_redirect_after_add==='yes'){window.location=wc_add_to_cart_params.cart_url;return}
192$(document.body).trigger('added_to_cart',[response.fragments,response.cart_hash,$this]);if(!wc_add_to_cart_params.is_cart&&$this.parent().find('.added_to_cart').length===0){$this.removeClass('loading');$this.addClass('added');$this.after(' <a href="'+wc_add_to_cart_params.cart_url+'" class="added_to_cart wc-forward" title="'+wc_add_to_cart_params.i18n_view_cart+'">'+wc_add_to_cart_params.i18n_view_cart+'</a>')}},});return!1})}});var wpfdPreviewCategoriesLocalCache={data:{},remove:function(url){delete wpfdPreviewCategoriesLocalCache.data[url]},exist:function(url){return wpfdPreviewCategoriesLocalCache.data.hasOwnProperty(url)&&wpfdPreviewCategoriesLocalCache.data[url]!==null},get:function(url){return wpfdPreviewCategoriesLocalCache.data[url]}
192,set:function(url,cachedData){wpfdPreviewCategoriesLocalCache.remove(url);wpfdPreviewCategoriesLocalCache.data[url]=cachedData}};var wpfdPreviewFilesLocalCache={data:{},remove:function(url){delete wpfdPreviewFilesLocalCache.data[url]},exist:function(url){return wpfdPreviewFilesLocalCache.data.hasOwnProperty(url)&&wpfdPreviewFilesLocalCache.data[url]!==null},get:function(url){return wpfdPreviewFilesLocalCache.data[url]},set:function(url,cachedData){wpfdPreviewFilesLocalCache.remove(url);wpfdPreviewFilesLocalCache.data[url]=cachedData}}
193;

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.