File "redux-icon-select.min.js"
Full Path: /home/elegucvf/public_html/video/wp-content/plugins/atlas-core/framework/redux-core/inc/extensions/icon_select/icon_select/redux-icon-select.min.js
File size: 2.97 KB
MIME-type: text/plain
Charset: utf-8
!function(a){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.icon_select=redux.field_objects.icon_select||{},redux.field_objects.icon_select.getIconArray=function(e){return e.find(".redux-icon-select").data("options")},redux.field_objects.icon_select.reloadIcons=function(e,d,i,n,o){window.wp.ajax.post("redux_get_icons",{icon_set:n,select_text:o,nonce:d.data("nonce"),data:redux.field_objects.icon_select.getIconArray(e)}).done(function(e){i.find(".redux-modal-loading").hide(),i.find(".redux-modal-load").html(e.content)}).fail(function(e,d,n){i.find(".redux-modal-loading").hide(),i.find(".redux-modal-load").html(n),i.on("click",function(){i.addClass("hidden"),i.off("click"),a(".redux-icon-select-font").empty(),i.find(".redux-modal-load").empty()})})},redux.field_objects.icon_select.init=function(e){e=e||a(document).find(".redux-group-tab:visible").find(".redux-container-icon_select:visible"),a(e).each(function(){var c=a(this),e=c;(e=c.hasClass("redux-field-container")?e:c.parents(".redux-field-container:first")).is(":hidden")||e.hasClass("redux-field-init")&&(e.removeClass("redux-field-init"),c.find(".redux-icon-add").on("click",function(e){var d,i=a(this),o=a("#redux-modal-icon"),t=o.find(".redux-icon-select-font");e.preventDefault(),e=c.find(".redux-icon-select").data("icon-sets"),e=JSON.parse(decodeURIComponent(e)),a.each(e,function(e,d){t.append(a("<option>",{value:e,text:d}))}),o.removeClass("hidden"),e=t.val(),d=t.find(":selected").text(),o.find(".redux-modal-loading").show(),window.wp.ajax.post("redux_get_icons",{icon_set:e,select_text:d,nonce:i.data("nonce"),data:redux.field_objects.icon_select.getIconArray(c)}).done(function(e){o.find(".redux-modal-loading").hide();var n=o.find(".redux-modal-load").html(e.content);n.off("click"),n.on("click","i",function(e){e.preventDefault();e=a(this).attr("title");c.find(".redux-icon-select-preview i").removeAttr("class").addClass(e),c.find(".redux-icon-select-preview").removeClass("hidden"),c.find(".redux-icon-remove").removeClass("hidden"),c.find("input").val(e).trigger("change"),o.addClass("hidden"),t.empty(),n.empty()}),o.off("change"),o.on("change",".redux-icon-select-font",function(){var e=a(this).val(),d=a(this).find(":selected").text();o.find(".redux-modal-loading").show(),redux.field_objects.icon_select.reloadIcons(c,i,o,e,d)}),o.on("change keyup",".redux-icon-search",function(){var d=a(this).val();n.find("i").each(function(){var e=a(this);e.attr("title").search(new RegExp(d,"i"))<0?e.hide():e.show()})}),o.on("click",".redux-modal-close, .redux-modal-overlay",function(){o.addClass("hidden"),t.empty(),n.empty()})}).fail(function(e,d,n){o.find(".redux-modal-loading").hide(),o.find(".redux-modal-load").html(n),o.on("click",function(){t.empty(),c.find(".redux-modal-load").empty(),o.off("click")})})}),c.find(".redux-icon-remove").on("click",function(e){e.preventDefault(),c.find(".redux-icon-select-preview").addClass("hidden"),c.find("input").val("").trigger("change"),a(this).addClass("hidden")}))})}}(jQuery);