jQuery(function(n){$gp.notices.init(),n("#project_id").change(function(){var i=n(this),e=n("option:selected",i).attr("value");if(!e)return n("#submit").prop("disabled",!0),void n("#preview").hide();$gp.notices.notice($gp_mass_create_sets_options.loading),i.prop("disabled",!0),n.ajax({type:"POST",url:$gp_mass_create_sets_options.url,data:{project_id:e},dataType:"json",success:function(r){var e=n("#preview"),t="";function s(e,t){var s=r[e],i="";return i+='
  • '+t.replace("{count}",s.length)+"",s.length&&(i+=""),i+="
  • "}e.html("

    Preview changes:

    "),t+=""),e.fadeIn()},error:function(e,t){i.prop("disabled",!1),t=e.responsehtml?"Error: "+e.responsehtml:"Error saving the translation!",$gp.notices.error(t)}})}),n("#submit").prop("disabled",!0),n("#preview").hide()});