Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to Marvelution under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Marvelution licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
AJS.$.namespace("AJS.sonar.admin");
AJS.sonar.admin.displaySonarAssociationPopup = function(associationId, projectId, componentId, titleText, cancelText, saveText, failureText) {
var popup = new AJS.Dialog(500, 300);
popup.addHeader(titleText);
popup.addPanel("Panel 1", "panel1");
popup.getCurrentPanel().body.append(AJS.$("#associationDialog"));
popup.addButton(cancelText, function (dialog) {
dialog.hide();
});
popup.addButton(saveText, function (dialog) {
var server = AJS.$("#sonarServer").val();
var project = AJS.$("#sonarProjectList").val();
var associationId = AJS.$("#associationId").val();
var url = 'add';
if (associationId > 0) {
url = 'edit/' + associationId;
}
AJS.$.ajax({
type : "POST",
async: false,
dataType: "text",
data: ({
projectId: projectId,
componentId: componentId,
sonarServer: server,
sonarProject: project
}),
url : contextPath + "/rest/sonar/1.0/association/" + url,
success: function() {
dialog.hide();
location.reload();
},
error: function() {
alert(failureText);
}
});
});
popup.gotoPage(0);
popup.gotoPanel(0);
if (associationId > 0) {
AJS.sonar.admin.initiateSonarProjectList(associationId);
AJS.$("#sonarProjectList").css("display", "block");
} else {
AJS.$("#sonarProjectList").css("display", "none");
}
AJS.$("#associationId").val(associationId);
popup.show();
};
AJS.sonar.admin.initiateSonarProjectList = function(associationId) {
AJS.$('#waitImage').css("display", "block");
var selectList = AJS.$('#sonarProjectList');
selectList.css("display", "none");
AJS.$.ajax({
type : "GET",
async: true,
dataType: "json",
data: ({
associationId: associationId
}),
url : contextPath + "/rest/sonar/1.0/association/get/currentConfiguration",
success: function(data) {
selectList.empty();
if (data !== null && data !== undefined) {
AJS.$("#sonarServer").val(data.sonarServer);
AJS.$(data.availableResources).each(function() {
AJS.$("").attr({
value: this.key,
selected: (data.sonarProject === this.key)
}).text(this.name).appendTo(selectList);
});
selectList.css("display", "block");
} else {
alert("No Resources are available on the Sonar Server.");
}
AJS.$('#waitImage').css("display", "none");
}
});
}
AJS.sonar.admin.updateSonarProjectList = function(sonarServerUrl, sonarProjectListName, waitImage) {
AJS.$('#' + waitImage).css("display", "block");
var selectList = AJS.$('#' + sonarProjectListName);
selectList.css("display", "none");
AJS.sonar.accessor.FORCE_SERVLET_QUERY = true;
AJS.sonar.accessor.PARSE_JSON_RESPONSES = false;
var ajaxOptions = AJS.sonar.accessor.getAjaxOptions(
AJS.sonar.accessor.parseSonarServer(contextPath, sonarServerUrl),
AJS.sonar.accessor.generateServerResourceApiUrl(),
function(data) {
selectList.empty();
if (data !== null && data !== undefined) {
AJS.$(data).each(function() {
AJS.$("").attr({
value: this.key
}).text(this.name).appendTo(selectList);
});
selectList.css("display", "block");
} else {
alert("No Resources are available on the Sonar Server.");
}
AJS.$('#' + waitImage).css("display", "none");
}
);
AJS.$.ajax(ajaxOptions);
}