HamroKhanpin/hamrokhaanpaan/wp-content/__plugins/wp-optimize/js/wpo-images-view-3-2-3.min.js

1 line
6.6 KiB
JavaScript
Raw Normal View History

2024-04-29 07:27:44 +00:00
WP_Optimize_Images_View=function(e){function t(e,t,i){var a,o,n,_=e,c=!1;if(t&&e)for(a=C(O).index(C("#"+e)),o=C(O).index(C("#"+t)),-1==a&&(a=o),-1==o&&(o=a),a<o?(n=C(O).eq(a).closest(I),t=C(O).eq(o).attr("id")):(n=C(O).eq(o).closest(I),t=C(O).eq(a).attr("id"));!c;)i?(n.addClass("selected"),C(O,n).prop("checked",i)):(n.removeClass("selected"),C(O,n).prop("checked",i)),C(O,n).attr("id")==t&&(c=!0),n=n.next();else i?C("#"+_).closest(I).addClass("selected"):C("#"+_).closest(I).removeClass("selected");s(0==d().length)}function s(e){D.action_buttons&&C.each(D.action_buttons,function(t,s){s.prop("disabled",e)})}function i(){if(D.hide_when_empty){var e=C([".",D.image_container_class,":visible"].join(""),B).length;0===e?(0==C(".wpo-images-view-empty",B).length&&B.append(C('<div class="wpo-images-view-empty wpo-fieldgroup" />').text(D.no_images_found_message)),C(".wpo-images-view-empty",B).show()):C(".wpo-images-view-empty",B).hide(),C.each(D.hide_when_empty,function(t,s){e>0?s.show():s.hide()})}}function a(){m()&&(i(),s(0==d().length))}function o(){B.scrollTop()+B.height()+100>B[0].scrollHeight&&"function"==typeof D.load_next_page_callback&&D.load_next_page_callback()}function n(e,t,s,i,a,o){var n,_="image_"+(65536*(1+Math.random())|0).toString(16).substring(1),c="";if(D.row_action_buttons)for(n in D.row_action_buttons)D.row_action_buttons.hasOwnProperty(n)&&(c+=['<button href="javascript: ;" class="',D.row_action_buttons[n]["class"]?D.row_action_buttons[n]["class"]:"",'"',' title="',D.row_action_buttons[n].hint?D.row_action_buttons[n].hint:"",'">',D.row_action_buttons[n].title?D.row_action_buttons[n].title:"","</button>"].join(""));z.hasOwnProperty(e)||(z[e]=0),z[e]++,B.append(['\t\t\t<div class="',D.image_container_class," ",D.image_container_custom_classes," ",D.image_container_blog_class_prefix,e,'">\t\t\t\t<a class="button ',D.view_image_btn_link_class,'" href="',s,'" target="_blank">',D.view_image_btn_text,"</a>",'<div class="',D.row_id_class,'">\t\t\t\t\t<input id="',_,'" type="checkbox" class="',D.checkbox_class,'" value="',t,'">\t\t\t\t</div>\t\t\t\t<div class="',D.row_thumb_class,'">\t\t\t\t\t<a href="',s,'" target="_blank">\t\t\t\t\t\t<img class="lazyload" src="data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=" data-src="',i,'" title="',a,'" alt="',a,'">\t\t\t\t\t</a>\t\t\t\t</div>\t\t\t\t<div class="',D.row_file_class,'">\t\t\t\t\t<a href="',s,'" target="_blank">',o,'</a>\t\t\t\t</div>\t\t\t\t<div class="',D.row_action_class,'">',c,'</div>\t\t\t\t<label for="',_,'" class="',D.label_class,'">\t\t\t\t\t<div class="thumbnail">\t\t\t\t\t\t<img class="lazyload" src="data:image/gif;base64,R0lGODdhAQABAPAAAMPDwwAAACwAAAAAAQABAAACAkQBADs=" data-src="',i,'" title="',a,'" alt="',a,'">\t\t\t\t\t</div>\t\t\t\t</label>\t\t\t</div>'].join(""))}function _(e){C(I,B).hide(),C([".",D.image_container_blog_class_prefix,e].join(""),B).show(),a()}function c(e){return z.hasOwnProperty(e)?z[e]:0}function l(e){return C([".",D.image_container_blog_class_prefix,e].join(""),B).length}function r(e){e!==Q&&(Q=e,e===P.GRID&&B.removeClass(D.list_mode_class),e===P.LIST&&B.addClass(D.list_mode_class))}function d(){var e=[];return 0==C('input[type="checkbox"]',B).length?e:(C([".",D.image_container_class,":visible input:checked"].join(""),B).each(function(){e.push(C(this).val())}),e)}function u(){var e=[".",D.image_container_class].join("");C([e,":visible input:checked"].join(""),B).each(function(){C(this).closest(e).remove()})}function h(){B.show(),C(D.related_elements).each(function(){C(this).show()}),a(),o()}function p(){B.hide(),C(D.related_elements).each(function(){C(this).hide()})}function m(){return B.is(":visible")}function g(){w(wpoptimize.loading_data,"",D.loader_additional_html)}function w(e,t,s){t=t?t:"",s=s?s:"",B.css({"min-height":"220px"}),B.append(['<div class="wpo_shade">','<div class="wpo_shade_inner">','<span class="dashicons dashicons-update-alt wpo-rotate"></span>',"<h4>",e,"</h4>",'<p class="wpo-shade-progress-message">',t,"</p>",s,"</div>","</div>"].join("")),b()}function f(){B.css("min-height","initial"),C("