File "redux-slides.min.js"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/kapee-extensions/inc/admin/redux-core/inc/fields/slides/redux-slides.min.js
File size: 2.8 KB
MIME-type: text/plain
Charset: utf-8

!function(s){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.slides=redux.field_objects.slides||{},redux.field_objects.slides.init=function(e){e=s.redux.getSelector(e,"slides"),s(e).each(function(){var e=s(this),i=e;redux.field_objects.media.init(e),(i=e.hasClass("redux-field-container")?i:e.parents(".redux-field-container:first")).is(":hidden")||(i.hasClass("redux-container-slides")&&i.addClass("redux-field-init"),i.hasClass("redux-field-init")&&(i.removeClass("redux-field-init"),e.find(".redux-slides-remove").on("click",function(){var e;redux_change(s(this)),s(this).parent().siblings().find('input[type="text"]').val(""),s(this).parent().siblings().find("textarea").val(""),s(this).parent().siblings().find('input[type="hidden"]').val(""),1<s(this).parents(".redux-container-slides:first").find(".redux-slides-accordion-group").length?s(this).parents(".redux-slides-accordion-group:first").slideUp("medium",function(){s(this).remove()}):(e=s(this).parent(".redux-slides-accordion").data("new-content-title"),s(this).parents(".redux-slides-accordion-group:first").find(".remove-image").trigger("click"),s(this).parents(".redux-container-slides:first").find(".redux-slides-accordion-group:last").find(".redux-slides-header").text(e))}),e.find(".redux-slides-add").off("click").on("click",function(){var e,i=s(this).prev().find(".redux-slides-accordion-group:last").clone(!0),t=+s(i).find(".slide-title").attr("name").match(/[0-9]+(?!.*[0-9])/)+1;s(i).find('input[type="text"], input[type="hidden"], textarea').each(function(){s(this).attr("name",s(this).attr("name").replace(/[0-9]+(?!.*[0-9])/,t)).attr("id",s(this).attr("id").replace(/[0-9]+(?!.*[0-9])/,t)),s(this).val(""),s(this).hasClass("slide-sort")&&s(this).val(t)}),e=s(this).prev().data("new-content-title"),s(i).find(".screenshot").removeAttr("style"),s(i).find(".screenshot").addClass("hide"),s(i).find(".screenshot a").attr("href",""),s(i).find(".remove-image").addClass("hide"),s(i).find(".redux-slides-image").attr("src","").removeAttr("id"),s(i).find("h3").text("").append('<span class="redux-slides-header">'+e+'</span><span class="ui-accordion-header-icon ui-icon ui-icon-plus"></span>'),s(this).prev().append(i)}),e.find(".slide-title").on("keyup",function(e){e=e.target.value;s(this).parents().eq(3).find(".redux-slides-header").text(e)}),e.find(".redux-slides-accordion").accordion({header:"> div > fieldset > h3",collapsible:!0,active:!1,heightStyle:"content",icons:{header:"ui-icon-plus",activeHeader:"ui-icon-minus"}}).sortable({axis:"y",handle:"h3",connectWith:".redux-slides-accordion",start:function(e,i){i.placeholder.height(i.item.height()),i.placeholder.width(i.item.width())},placeholder:"ui-state-highlight",stop:function(e,i){i.item.children("h3").triggerHandler("focusout"),s("input.slide-sort").each(function(e){s(this).val(e)})}})))})}}(jQuery);