scripts.gadget-sonar-accessor-min.js Maven / Gradle / Ivy
AJS.$.namespace("AJS.gadget.sonar.accessor");AJS.gadget.sonar.accessor.populateProjectSelectorWithProjects=function(G,A,H,C,B){var E=AJS.$("#waitingImage");var F=AJS.$("").attr({id:"error_msg"});E.parent().prepend(F);H.empty();H.css("display","none");E.css("display","block");G.resize();var D=AJS.sonar.accessor.getAjaxOptions(AJS.sonar.accessor.parseSonarServer(G.getBaseUrl(),A),AJS.sonar.accessor.generateServerResourceApiUrl(),function(I){if(B!==null&&B.value!==undefined&&B.label!==undefined){H.append(AJS.$("").attr({value:B.value,selected:(C===B.value)}).text(B.label))}AJS.$(I).each(function(){H.append(AJS.$("").attr({value:this.key,selected:(C===this.key)}).text(this.name))});F.css("display","none");E.css("display","none");H.css("display","block");G.resize()},function(){E.css("display","none");H.css("display","none");F.css("display","block");F.empty().append(AJS.format(G.getMsg("sonar.error.failed.to.connect"),A))});AJS.$.ajax(D)};