[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/assets/js/ -> mass-create-sets-page.min.js (source)

   1  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){i.prop("disabled",!1),$gp.notices.clear(),(r.added.length||r.removed.length)&&n("#submit").prop("disabled",!1);var e=n("#preview");e.html("<h3>Preview changes:</h3>");var t="";function s(e,t){var s=r[e],i="";return i+='<li><span class="'+e+'">'+t.replace("{count}",s.length)+"</span>",s.length&&(i+="<ul>",n.each(s,function(){i+="<li>"+$gp.esc_html(this.name)+" ("+this.locale+"/"+this.slug+")</li>"}),i+="</ul>"),i+="</li>"}t+="<ul>",t+=s("added","{count} set(s) will be added"),t+=s("removed","{count} set(s) will be removed"),e.append(t+="</ul>"),e.fadeIn()},error:function(e,t,s){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()});


Generated: Fri Oct 22 01:01:06 2021 Cross-referenced by PHPXref 0.7.1