scripts.gadget-fields-min.js Maven / Gradle / Ivy
AJS.$.namespace("AJS.gadget.sonar.fields");AJS.gadget.sonar.fields.waitImage=function(){var a="";if(WAIT_IMAGE_SRC!==undefined){a=WAIT_IMAGE_SRC}return AJS.$("").attr({id:"waitingImage",border:0,src:a}).addClass("waiting-image")};AJS.gadget.sonar.fields.isConfigured=function(){return{userpref:"isConfigured",type:"hidden",value:"true"}};AJS.gadget.sonar.fields.titleRequired=function(){return{userpref:"titleRequired",type:"hidden",value:"true"}};AJS.gadget.sonar.fields.generateServerAndProjectPickerFields=function(e,c,d,b){var a=AJS.sonar.utils.randomNumber();return[{userpref:c,label:e.getMsg("sonar.gadget.common.server.label"),description:e.getMsg("sonar.gadget.common.server.description"),id:"sonar_server_picker_"+a,type:"callbackBuilder",callback:function(g){var f=AJS.$("").attr({name:c,type:"text"}).val(e.getPref(c)).addClass("text");f.blur(function(){var h=AJS.$("#sonar_project_picker_"+a+" select");AJS.gadget.sonar.accessor.populateProjectSelectorWithProjects(e,f.val(),h,"",b)});g.append(f).append(AJS.$("").addClass("description").text(e.getMsg("sonar.gadget.common.server.description")))}},{userpref:d,label:e.getMsg("sonar.gadget.common.project.label"),description:e.getMsg("sonar.gadget.common.project.description"),id:"sonar_project_picker_"+a,type:"callbackBuilder",callback:function(g){var f=AJS.$("").attr({name:d}).addClass("select-one");f.empty();if(e.getPref(c)===""){f.css("display","none")}else{AJS.gadget.sonar.accessor.populateProjectSelectorWithProjects(e,e.getPref(c),f,e.getPref(d),b)}g.append(AJS.gadget.sonar.fields.waitImage()).append(f).append(AJS.$("").addClass("description").text(e.getMsg("sonar.gadget.common.project.description")))}},AJS.gadget.sonar.fields.isConfigured(),AJS.gadget.sonar.fields.titleRequired()]};