[ 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){var e=n("#preview"),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>"}e.html("<h3>Preview changes:</h3>"),t+="<ul>",i.prop("disabled",!1),$gp.notices.clear(),(r.added.length||r.removed.length)&&n("#submit").prop("disabled",!1),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){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 Apr 26 01:01:24 2024 Cross-referenced by PHPXref 0.7.1