From cd4a1ae5dfa2d22e0512ddbfdb04920de8b25a0f Mon Sep 17 00:00:00 2001 From: swatipersistent <99341045+swatipersistent@users.noreply.github.com> Date: Thu, 17 Aug 2023 04:31:31 -0700 Subject: [PATCH 01/13] Added "search" while choosing project in SonarQube Plugin --- src/main/resources/static/fstdropdown.min.css | 1 + src/main/resources/static/fstdropdown.min.js | 1 + .../resources/static/project_configuration.js | 21 ++++++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/static/fstdropdown.min.css create mode 100644 src/main/resources/static/fstdropdown.min.js diff --git a/src/main/resources/static/fstdropdown.min.css b/src/main/resources/static/fstdropdown.min.css new file mode 100644 index 0000000..cc3aad9 --- /dev/null +++ b/src/main/resources/static/fstdropdown.min.css @@ -0,0 +1 @@ +.fstdiv{position:relative;min-height:34px;width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.fstdiv.open{z-index:2147483647}.fstdropdown{vertical-align:middle;border:1px solid #ccc;border-radius:4px;cursor:pointer;background:#fff;overflow:hidden;width:inherit}.fstdiv.open>.fstdropdown{position:absolute}.fstdropdown>.fstselected{line-height:1.42857143;padding:6px 24px 6px 12px;box-shadow:inset 0 1px 1px rgba(0,0,0,.075);color:#555;font-size:14px;outline:0;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-user-select:none}.fstdropdown>.fstselected::after{position:absolute;top:50%;display:block;height:0;margin-top:-3px;content:' ';right:11px;border-color:#999 transparent transparent;border-style:solid;border-width:4px 4px 0}.fstdropdown.open>.fstselected{border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-color:transparent}.fstdropdown.open>.fstselected::after{margin-top:-3px;border-color:transparent transparent #999;border-width:0 4px 4px}.fstdropdown>.fstlist{display:none;max-height:200px;overflow-y:auto;overflow-x:hidden}.fstdropdown.open>.fstlist{display:block}.fstlist>div{padding:6px 12px;user-select:none;-webkit-user-select:none;border-bottom:1px solid #f5f5f5}.fstdropdown.open:hover{border-color:#66afe9;overflow-x:hidden;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);-o-transition:border-color ease-in-out .1s,box-shadow ease-in-out .1s;-webkit-transition:border-color ease-in-out .1s,-webkit-box-shadow ease-in-out .1s;transition:border-color ease-in-out .1s,-webkit-box-shadow ease-in-out .1s;transition:border-color ease-in-out .1s,box-shadow ease-in-out .1s;transition:border-color ease-in-out .1s,box-shadow ease-in-out .1s,-webkit-box-shadow ease-in-out .1s}.fstlist>div:hover{background-color:#337ab7;color:#fff}.fstlist>div.selected{background-color:#cdcdcd;color:#262626}.fstsearchinput{padding:4px;width:100%;box-sizing:border-box;box-shadow:inset 0 1px 1px rgba(0,0,0,.075);background-color:#fff;border:1px solid #ccc;color:#555;font-size:14px;display:none}.fstdropdown.open>.fstsearch{display:block;padding:4px}.fstdropdown.open .fstsearchinput{display:block}.fstdropdown .hideFst,.fstdropdown-select.fstcreated{display:none}.fstAll{width:100%;position:relative;background-color:#0090ff;color:#fff;border:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;height:30px;display:none}.fstAll:hover{background-color:#337ab7}.open .fstAll{display:block} \ No newline at end of file diff --git a/src/main/resources/static/fstdropdown.min.js b/src/main/resources/static/fstdropdown.min.js new file mode 100644 index 0000000..3364b06 --- /dev/null +++ b/src/main/resources/static/fstdropdown.min.js @@ -0,0 +1 @@ +function setFstDropdown(){var e=document.querySelectorAll(".fstdropdown-select:not(.fstcreated)");for(var t in e)e.hasOwnProperty(t)&&l(e[t]);function l(e){var t=e.dataset.searchdisable,l=e.dataset.placeholder,a=e.dataset.opened,r=d("div","fstdiv",e.parentNode,null),i=d("div","fstdropdown"+(null!=a&&"true"==a?" open":""),r,null==a||"true"!=a?{click:s,blur:s}:null);if(i.select=e,i.setAttribute("tabindex","0"),null!=a&&"true"==a||d("div","fstselected",i,null),null==t||"true"!=t){var u=d("div","fstsearch",i,null),p={keyup:o,paste:o};null!=a&&"true"==a||(p.blur=s),d("input","fstsearchinput",u,p).placeholder=null!=l?l:""}if(e.multiple){var f=d("button","fstAll",i,{click:c});f.textContent="Select All",f.type="button",f.selected=!1}d("div","fstlist",i,null),e.fstdropdown={dd:i,rebind:function(){n(e)},setValue:function(e){!function(e,t){if(Array.isArray(t)){for(var l in t)if(t.hasOwnProperty(l)){var s=e.querySelector(".fstlist div[data-value='"+t[l]+"']");null!=s&&s.dispatchEvent(new Event("click",{bubbles:!0}))}}else{var s=e.querySelector(".fstlist div[data-value='"+t+"']");null!=s&&s.dispatchEvent(new Event("click",{bubbles:!0}))}}(i,e)}},n(e),e.classList.add("fstcreated")}function s(e,t,l){var s=e.target.classList.contains("fstdropdown")?e.target.select:e.target.closest(".fstdropdown").select;t=null==t?"blur"!=e.type:t;var a=s.fstdropdown.dd;if(!function(e,t){return null!=e.relatedTarget&&("INPUT"==e.relatedTarget.tagName||"BUTTON"==e.relatedTarget.tagName&&null==t)||"INPUT"==e.target.tagName&&"blur"!=e.type||"INPUT"==e.target.tagName&&null!=e.relatedTarget&&"fstdropdown open"==e.relatedTarget.className||e.target.classList.contains("fstselected")&&"blur"==e.type&&document.activeElement.classList.contains("fstsearchinput")||"blur"==e.type&&("fstlist"==document.activeElement.className||"fstAll"==document.activeElement.className)||"BUTTON"==e.target.tagName&&null==t}(e,l)){if(!t||a.classList.contains("open"))return a.classList.remove("open"),void a.parentNode.classList.remove("open");a.classList.add("open"),a.parentNode.classList.add("open"),null==s.dataset.searchdisable&&"true"!=s.dataset.searchdisable&&a.querySelector(".fstsearchinput").focus()}}function a(e){var t=e.target.closest(".fstdropdown").select,l=t.fstdropdown.dd,a=l.querySelector(".fstAll"),n=null==t.dataset.opened||"true"!=t.dataset.opened;t.value==e.target.dataset.value||t.multiple||(t.value=e.target.dataset.value,null!=l.querySelector(".fstlist>.selected")&&l.querySelector(".fstlist>.selected").classList.remove("selected"),e.target.classList.add("selected"),n&&(l.querySelector(".fstselected").textContent=e.target.textContent),r("change",t)),t.multiple&&function(e,t,l,s,a){e.querySelector("[value='"+t.target.dataset.value+"']").selected=!t.target.classList.contains("selected"),t.target.classList.contains("selected")?t.target.classList.remove("selected"):t.target.classList.add("selected");r("change",e);var n=l.querySelectorAll(".fstlist>.selected").length;s.selected=n>0,a&&(l.querySelector(".fstselected").textContent=1==n?t.target.textContent:n+" options selected");s.textContent=s.selected?"Deselect All":"Select All"}(t,e,l,a,n),n&&s(e,!1)}function n(e){for(var t=e.querySelectorAll("option"),l=e.fstdropdown.dd.querySelector(".fstlist");l.lastChild;)l.removeChild(l.lastChild);for(var s in t)if(t.hasOwnProperty(s)){var n=document.createElement("div");n.textContent=t[s].textContent,n.dataset.value=t[s].value,t[s].selected&&n.classList.add("selected"),n.addEventListener("click",a),l.appendChild(n)}i(e,null)}function r(e,t){var l;"function"==typeof Event?l=new Event(e,{bubbles:!0}):(l=document.createEvent("Event")).initEvent(e,!0,!0),t.dispatchEvent(l)}function o(e){var t="paste"!=e.type?"":void 0===e.clipboardData?window.clipboardData.getData("Text"):e.clipboardData.getData("text/plain"),l="paste"!=e.type?e.target.value:t,s=e.target.closest(".fstdropdown").querySelectorAll(".fstlist>div");for(var a in s)s.hasOwnProperty(a)&&(-1!=s[a].textContent.trim().toLowerCase().indexOf(l.trim().toLowerCase())?s[a].classList.remove("hideFst"):s[a].classList.add("hideFst"))}function d(e,t,l,s){var a=document.createElement(e);if(null!=t)for(var n in t.split(" "))isNaN(n)||a.classList.add(t.split(" ")[n]);if(null!=s)for(var r in s)s.hasOwnProperty(r)&&a.addEventListener(r,s[r],!0);return l.appendChild(a),a}function c(e){var t=e.target.closest(".fstdropdown").select,l=t.fstdropdown.dd,s=!e.target.selected;e.target.selected=s;var a=s?l.querySelectorAll(".fstlist>div:not(.hideFst)"):l.querySelectorAll(".selected");for(var n in a)a.hasOwnProperty(n)&&(t.querySelector("[value='"+a[n].dataset.value+"']").selected=s,s?a[n].classList.add("selected"):a[n].classList.remove("selected"));r("change",t),e.target.textContent=s?"Deselect All":"Select All",i(t,e)}function i(e,t){if(null==e.dataset.opened||"true"!=e.dataset.opened){var l="",a=e.options[e.selectedIndex];if(e.multiple){var n=0;for(var r in e.options)e.options.hasOwnProperty(r)&&1==e.options[r].selected&&n++;l=1==n?a.textContent:n+" options selected"}e.fstdropdown.dd.querySelector(".fstselected").textContent=e.multiple?l:null!=a?a.textContent:"",null!=t&&s(t,!1,!0)}}}!function(e){e.matches=e.matches||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector,e.closest=e.closest||function(e){return this&&(this.parentElement||this.matches(e))?this.matches(e)?this:this.parentElement.closest(e):null}}(Element.prototype),document.addEventListener("DOMContentLoaded",setFstDropdown); \ No newline at end of file diff --git a/src/main/resources/static/project_configuration.js b/src/main/resources/static/project_configuration.js index 1b700fb..a711e2c 100644 --- a/src/main/resources/static/project_configuration.js +++ b/src/main/resources/static/project_configuration.js @@ -35,6 +35,11 @@ window.registerExtension('checkmarx/project_configuration', function (options) { script.onload = init; document.body.appendChild(script); + var fstdropdown_script = document.createElement("script"); + fstdropdown_script.type = "text/javascript"; + fstdropdown_script.src = staticUrl + '/fstdropdown.min.js'; + document.body.appendChild(fstdropdown_script); + var configurationPage; @@ -85,7 +90,14 @@ window.registerExtension('checkmarx/project_configuration', function (options) { fileRef.rel = "stylesheet"; fileRef.type = "text/css"; fileRef.href = staticUrl + '/project_config_style.css'; - document.getElementsByTagName("head")[0].appendChild(fileRef) + document.getElementsByTagName("head")[0].appendChild(fileRef); + + var fstdropdown_css = document.createElement("link"); + fstdropdown_css.id = "fstdropdownCss"; + fstdropdown_css.rel = "stylesheet"; + fstdropdown_css.type = "text/css"; + fstdropdown_css.href = staticUrl + '/fstdropdown.min.css'; + document.getElementsByTagName("head")[0].appendChild(fstdropdown_css); } function getConnectingSpinner() { @@ -276,6 +288,7 @@ window.registerExtension('checkmarx/project_configuration', function (options) { projectsIn = ""; var select = document.getElementById('projectSelect'); select.innerHTML = createOptions(); + setFstDropdown(); } catch (ignored) { } try { @@ -307,6 +320,7 @@ window.registerExtension('checkmarx/project_configuration', function (options) { var select = document.getElementById('projectSelect'); select.innerHTML = createOptions(); + setFstDropdown(); }) } @@ -326,7 +340,12 @@ window.registerExtension('checkmarx/project_configuration', function (options) { form.appendChild(label); var select = document.createElement("SELECT"); select.id = 'projectSelect'; + var className = "fstdropdown-select"; + if (!select.classList.contains(className)) { + select.classList.add(className); + } select.innerHTML = createOptions(); + setFstDropdown(); form.appendChild(select); var errSpan = createErrSpan(form.id); paragraph.appendChild(form); From 389d5422d9fbb7e9c515e6d157ce7229b1c30bf0 Mon Sep 17 00:00:00 2001 From: Khant1000 <131154593+Khant1000@users.noreply.github.com> Date: Sun, 20 Aug 2023 00:08:45 +0530 Subject: [PATCH 02/13] jira1268 --- src/main/resources/static/project_configuration.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/static/project_configuration.js b/src/main/resources/static/project_configuration.js index 1b700fb..9705ca6 100644 --- a/src/main/resources/static/project_configuration.js +++ b/src/main/resources/static/project_configuration.js @@ -2,6 +2,11 @@ window.registerExtension('checkmarx/project_configuration', function (options) { // let's create a flag telling if the static is still displayed var isDisplayed = true; + if(!options.component.analysisDate){ + + options.component.analysisDate = new Date(); + + } var isCxConnectionSuccessful; var projectsIn; From 809133c1a0602883a760f01ebf0bd2bf11a0ad1e Mon Sep 17 00:00:00 2001 From: Khant1000 <131154593+Khant1000@users.noreply.github.com> Date: Sun, 20 Aug 2023 00:45:01 +0530 Subject: [PATCH 03/13] dates --- src/main/resources/static/cx_report.js | 5 +++++ src/main/resources/static/project_configuration.js | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/resources/static/cx_report.js b/src/main/resources/static/cx_report.js index 3979c1d..e9a5c6f 100644 --- a/src/main/resources/static/cx_report.js +++ b/src/main/resources/static/cx_report.js @@ -1,6 +1,11 @@ window.registerExtension('checkmarx/cx_report', function (options) { // let's create a flag telling if the static is still displayed + + if(!options.component.analysisDate){ + options.component.analysisDate = new Date(); + } + var isDisplayed = true; var staticUrl = window.baseUrl +'/static/checkmarx'; var spanSpinner; diff --git a/src/main/resources/static/project_configuration.js b/src/main/resources/static/project_configuration.js index f54007e..e87a11f 100644 --- a/src/main/resources/static/project_configuration.js +++ b/src/main/resources/static/project_configuration.js @@ -1,13 +1,11 @@ window.registerExtension('checkmarx/project_configuration', function (options) { // let's create a flag telling if the static is still displayed - var isDisplayed = true; if(!options.component.analysisDate){ + options.component.analysisDate = new Date(); + } - options.component.analysisDate = new Date(); - - } - + var isDisplayed = true; var isCxConnectionSuccessful; var projectsIn; var projectListNoServerConnectionMsg = "Unable to connect to server. Make sure URL and Credentials are valid to see project list."; From 2e177b956d3843540f1c363754df236ebea7afb3 Mon Sep 17 00:00:00 2001 From: Khant1000 <131154593+Khant1000@users.noreply.github.com> Date: Mon, 21 Aug 2023 14:48:30 +0530 Subject: [PATCH 04/13] new version changes --- pom.xml | 2 +- .../sonar/sensor/utils/CxConfigHelper.java | 19 ++++++++++--------- src/main/resources/static/cx_report.js | 13 +++++++------ .../resources/static/project_configuration.js | 14 ++++++++------ 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 6735084..23ffaa0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ checkmarx.com com.checkmarx.sonar.cxplugin sonar-plugin - 2022.3.2 + 2023.3.2 Checkmarx plugin Checkmarx plugin diff --git a/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java b/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java index 9a5aaeb..eda5b92 100644 --- a/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java +++ b/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java @@ -185,17 +185,18 @@ private String getPropertyValue(String responseJson) { } return value; } - + private ProjectDetails getProjectAndTeamDetails(String cxProject, CxFullCredentials cxFullCredentials) throws IOException { - - String teamName = cxProject.substring(cxProject.indexOf("\\") + 1, cxProject.lastIndexOf("\\")); - teamName = "/" + teamName ; - - log.info("Team name parsed from the projectName: "+teamName); + log.info("Team/Project path: " + cxProject); + + int lastIndex = Math.max(cxProject.lastIndexOf("\\"), cxProject.lastIndexOf("/")); + String teamName = cxProject.substring(1, lastIndex); + teamName = "/" + teamName; + ProjectDetails projectDetails = new ProjectDetails(); projectDetails.setTeamName(teamName); projectDetails.setTeamId(getTeamId(teamName, cxFullCredentials)); - projectDetails.setProjectName(cxProject.substring(cxProject.lastIndexOf("\\") + 1)); + projectDetails.setProjectName(cxProject.substring(lastIndex + 1)); return projectDetails; } @@ -288,8 +289,8 @@ private static String createStringFromResponse(org.apache.http.HttpResponse resp while ((line = rd.readLine()) != null) { result.append(line); } - - + + return result.toString(); } diff --git a/src/main/resources/static/cx_report.js b/src/main/resources/static/cx_report.js index e9a5c6f..aec94bd 100644 --- a/src/main/resources/static/cx_report.js +++ b/src/main/resources/static/cx_report.js @@ -1,13 +1,14 @@ window.registerExtension('checkmarx/cx_report', function (options) { // let's create a flag telling if the static is still displayed - - if(!options.component.analysisDate){ - options.component.analysisDate = new Date(); - } - var isDisplayed = true; - var staticUrl = window.baseUrl +'/static/checkmarx'; + //Setting analysis date to resolve continuous page refresh issue. + //It is observeed that until a sonar analysis is done for a project, all the pages keeps on reloading. + //By setting analysisDate for the project resolves the issue for checkmarx pages without having to run sonar scan on the project. + if(!options.component.analysisDate){ + options.component.analysisDate = new Date(); + } + var staticUrl = window.baseUrl +'/static/checkmarx'; var spanSpinner; //-------------------------- sast vars -------------------------------------- diff --git a/src/main/resources/static/project_configuration.js b/src/main/resources/static/project_configuration.js index e87a11f..5975d0d 100644 --- a/src/main/resources/static/project_configuration.js +++ b/src/main/resources/static/project_configuration.js @@ -1,11 +1,13 @@ -window.registerExtension('checkmarx/project_configuration', function (options) { - - // let's create a flag telling if the static is still displayed +window.registerExtension('checkmarx/project_configuration', function (options) +{ + // let's create a flag telling if the static is still displayed + var isDisplayed = true; + //Setting analysis date to resolve continuous page refresh issue. + //It is observeed that until a sonar analysis is done for a project, all the pages keeps on reloading. + //By setting analysisDate for the project resolves the issue for checkmarx pages without having to run sonar scan on the project. if(!options.component.analysisDate){ - options.component.analysisDate = new Date(); + options.component.analysisDate = new Date(); } - - var isDisplayed = true; var isCxConnectionSuccessful; var projectsIn; var projectListNoServerConnectionMsg = "Unable to connect to server. Make sure URL and Credentials are valid to see project list."; From bfd1d0a6bf54715965fe20e9f2ca9870abfde9fe Mon Sep 17 00:00:00 2001 From: Khant1000 <131154593+Khant1000@users.noreply.github.com> Date: Mon, 21 Aug 2023 15:32:57 +0530 Subject: [PATCH 05/13] bug_866 --- .../java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java b/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java index eda5b92..ad5cf64 100644 --- a/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java +++ b/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java @@ -257,7 +257,7 @@ private String getSonarPropertyHttp(String propertyName, Configuration config) { } return ""; } catch (IOException e) { - log.warn("Error occured while retrieving property value for property: "+propertyName); + log.warn("Error occured while retrieving property value for property: " + propertyName); return null; } finally { if (response != null) { From c98b753f3a4fdc6c6a956d3dcc9b59afd3dfdb02 Mon Sep 17 00:00:00 2001 From: PravinGadankush Date: Mon, 28 Aug 2023 15:28:25 +0530 Subject: [PATCH 06/13] Latest version compatibility related fixes --- .../sonar/sensor/utils/CxConfigHelper.java | 9 +++++++- .../sonar/settings/PropertyApiClient.java | 8 ++++++- .../resources/static/project_configuration.js | 21 +++++++++++++------ 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java b/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java index ad5cf64..3021538 100644 --- a/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java +++ b/src/main/java/com/checkmarx/sonar/sensor/utils/CxConfigHelper.java @@ -47,6 +47,7 @@ public class CxConfigHelper { public static final String SONAR_PROJECT_KEY = "sonar.projectKey"; public static final String SONAR_LOGIN_KEY = "sonar.login"; public static final String SONAR_PASSWORD_KEY = "sonar.password"; + public static final String SONAR_TOKEN_KEY = "sonar.token"; private static final String VALUE = "value"; @@ -229,7 +230,13 @@ private String getSonarPropertyHttp(String propertyName, Configuration config) { String token; String user; String pass; - if (config.get(SONAR_LOGIN_KEY).isPresent() && + //adding below condition for new versions of sonarqube including 10.1 + if (config.get(SONAR_TOKEN_KEY).isPresent()) { + log.info("sonar.token present"); + token = config.get(SONAR_TOKEN_KEY).get(); + auth = token + ":"; + auth = new String(Base64.encodeBase64(auth.getBytes(StandardCharsets.ISO_8859_1))); + }else if (config.get(SONAR_LOGIN_KEY).isPresent() && !config.get(SONAR_PASSWORD_KEY).isPresent()) { token = config.get(SONAR_LOGIN_KEY).get(); auth = token + ":"; diff --git a/src/main/java/com/checkmarx/sonar/settings/PropertyApiClient.java b/src/main/java/com/checkmarx/sonar/settings/PropertyApiClient.java index ef70914..98815bf 100644 --- a/src/main/java/com/checkmarx/sonar/settings/PropertyApiClient.java +++ b/src/main/java/com/checkmarx/sonar/settings/PropertyApiClient.java @@ -144,7 +144,13 @@ private HttpResponse getResponse(HttpUriRequest request) throws IOException { private void addAuthHeaders(HttpUriRequest request, CookieStore cookieStore) { try { if (sensorContext != null) { - if (sensorContext.config().get(CxConfigHelper.SONAR_LOGIN_KEY).isPresent() && + if (sensorContext.config().get(CxConfigHelper.SONAR_TOKEN_KEY).isPresent()) { + logger.info("Sonar server token is provided in sonar.token"); + String auth = sensorContext.config().get(CxConfigHelper.SONAR_TOKEN_KEY).get() + ":"; + byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.ISO_8859_1)); + String authHeader = "Basic " + new String(encodedAuth); + request.setHeader(HttpHeaders.AUTHORIZATION, authHeader); + }else if (sensorContext.config().get(CxConfigHelper.SONAR_LOGIN_KEY).isPresent() && !sensorContext.config().get(CxConfigHelper.SONAR_PASSWORD_KEY).isPresent()) { logger.info("Sonar server token is provided"); String auth = sensorContext.config().get(CxConfigHelper.SONAR_LOGIN_KEY).get() + ":"; diff --git a/src/main/resources/static/project_configuration.js b/src/main/resources/static/project_configuration.js index 5975d0d..b0b838a 100644 --- a/src/main/resources/static/project_configuration.js +++ b/src/main/resources/static/project_configuration.js @@ -2,12 +2,13 @@ window.registerExtension('checkmarx/project_configuration', function (options) { // let's create a flag telling if the static is still displayed var isDisplayed = true; - //Setting analysis date to resolve continuous page refresh issue. - //It is observeed that until a sonar analysis is done for a project, all the pages keeps on reloading. - //By setting analysisDate for the project resolves the issue for checkmarx pages without having to run sonar scan on the project. - if(!options.component.analysisDate){ - options.component.analysisDate = new Date(); - } + //Setting analysis date to resolve continuous page refresh issue. + //It is observeed that until a sonar analysis is done for a project, all the pages keeps on reloading. + //By setting analysisDate for the project resolves the issue for checkmarx pages without having to run sonar scan on the project. + if(!options.component.analysisDate) + { + options.component.analysisDate = 'tempAnalysisDate'; + } var isCxConnectionSuccessful; var projectsIn; var projectListNoServerConnectionMsg = "Unable to connect to server. Make sure URL and Credentials are valid to see project list."; @@ -121,6 +122,8 @@ window.registerExtension('checkmarx/project_configuration', function (options) /******************************************Build UI ****************************************************/ function loadUI() { + //clear page in case where the page was loaded, redirected and then redirected back + options.el.textContent = ''; //this is to avoid showing duplicate fields on UI. return new Promise(function () { var div = document.createElement('div'); div.className = "configurationDiv"; @@ -767,6 +770,12 @@ window.registerExtension('checkmarx/project_configuration', function (options) //Sonar documentation says this runs when the page closes, but as of 6.3 this has no effect return function () { + //This is to reset value of analysisDate and reload the component and other pages will keep on refreshing as expected + if(options.component.analysisDate === 'tempAnalysisDate') + { + options.component.analysisDate = undefined; + location.reload(); + } isDisplayed = false; }; From cc9624930e76f135f6e5d7c0a383a0eb77321c68 Mon Sep 17 00:00:00 2001 From: PravinGadankush Date: Mon, 28 Aug 2023 19:17:47 +0530 Subject: [PATCH 07/13] Fixed issues related to project list dropdown --- src/main/resources/static/project_configuration.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/resources/static/project_configuration.js b/src/main/resources/static/project_configuration.js index b0b838a..f65dcfd 100644 --- a/src/main/resources/static/project_configuration.js +++ b/src/main/resources/static/project_configuration.js @@ -137,6 +137,7 @@ window.registerExtension('checkmarx/project_configuration', function (options) createProjectOptionsForm(); createRemediationEffort(); createSaveButton(); + setFstDropdown(); }) } @@ -295,8 +296,9 @@ window.registerExtension('checkmarx/project_configuration', function (options) try { projectsIn = ""; var select = document.getElementById('projectSelect'); - select.innerHTML = createOptions(); - setFstDropdown(); + select.innerHTML = createOptions(); + setFstDropdown(); + select.fstdropdown.rebind(); } catch (ignored) { } try { @@ -329,6 +331,7 @@ window.registerExtension('checkmarx/project_configuration', function (options) var select = document.getElementById('projectSelect'); select.innerHTML = createOptions(); setFstDropdown(); + select.fstdropdown.rebind(); }) } @@ -351,14 +354,13 @@ window.registerExtension('checkmarx/project_configuration', function (options) var className = "fstdropdown-select"; if (!select.classList.contains(className)) { select.classList.add(className); - } - select.innerHTML = createOptions(); - setFstDropdown(); + } + select.innerHTML = createOptions(); form.appendChild(select); var errSpan = createErrSpan(form.id); paragraph.appendChild(form); paragraph.appendChild(errSpan); - configurationPage.appendChild(paragraph); + configurationPage.appendChild(paragraph); } From 953de90bbcaaa9df281cbee5c13e088b4c4f435c Mon Sep 17 00:00:00 2001 From: Khant1000 <131154593+Khant1000@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:57:49 +0530 Subject: [PATCH 08/13] version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 23ffaa0..87ee92e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ checkmarx.com com.checkmarx.sonar.cxplugin sonar-plugin - 2023.3.2 + 2023.3.1 Checkmarx plugin Checkmarx plugin From c4bd3ce2617973747459602472c8cea3781e55f3 Mon Sep 17 00:00:00 2001 From: swatipersistent <99341045+swatipersistent@users.noreply.github.com> Date: Tue, 29 Aug 2023 06:40:50 -0700 Subject: [PATCH 09/13] fixed vulnerable dependencies --- pom.xml | 13 +++++++++++-- src/main/resources/static/jquery-3.5.1.min.js | 2 -- src/main/resources/static/jquery-3.7.1.min.js | 2 ++ src/main/resources/static/project_configuration.js | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) delete mode 100644 src/main/resources/static/jquery-3.5.1.min.js create mode 100644 src/main/resources/static/jquery-3.7.1.min.js diff --git a/pom.xml b/pom.xml index 87ee92e..4d40281 100644 --- a/pom.xml +++ b/pom.xml @@ -173,7 +173,7 @@ org.json json - 20210307 + 20230618 @@ -241,7 +241,7 @@ com.fasterxml.jackson.core jackson-databind - 2.13.3 + 2.13.4.2 @@ -331,6 +331,10 @@ commons-logging commons-logging-api + + + org.codehaus.plexus + plexus-archiver @@ -344,6 +348,11 @@ org.slf4j slf4j-ext 1.8.0-beta2 + + + org.codehaus.plexus + plexus-archiver + 4.8.0 diff --git a/src/main/resources/static/jquery-3.5.1.min.js b/src/main/resources/static/jquery-3.5.1.min.js deleted file mode 100644 index b061403..0000000 --- a/src/main/resources/static/jquery-3.5.1.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0 Date: Tue, 29 Aug 2023 19:38:05 +0530 Subject: [PATCH 10/13] version fix --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4d40281..be6242d 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ checkmarx.com com.checkmarx.sonar.cxplugin sonar-plugin - 2023.3.1 + 2023.3.3 Checkmarx plugin Checkmarx plugin From d2b4e12190034b12dc3f492b7d01d3331021e5cc Mon Sep 17 00:00:00 2001 From: PravinGadankush Date: Wed, 30 Aug 2023 16:56:41 +0530 Subject: [PATCH 11/13] Fix for overview screen issue while navigating from reports screen --- .settings/org.eclipse.core.resources.prefs | 2 ++ .settings/org.eclipse.m2e.core.prefs | 4 ++++ src/main/resources/static/cx_report.js | 13 ++++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/src/main/resources/static/cx_report.js b/src/main/resources/static/cx_report.js index aec94bd..32278b2 100644 --- a/src/main/resources/static/cx_report.js +++ b/src/main/resources/static/cx_report.js @@ -5,9 +5,10 @@ window.registerExtension('checkmarx/cx_report', function (options) { //Setting analysis date to resolve continuous page refresh issue. //It is observeed that until a sonar analysis is done for a project, all the pages keeps on reloading. //By setting analysisDate for the project resolves the issue for checkmarx pages without having to run sonar scan on the project. - if(!options.component.analysisDate){ - options.component.analysisDate = new Date(); - } + if(!options.component.analysisDate) + { + options.component.analysisDate = 'tempAnalysisDate'; + } var staticUrl = window.baseUrl +'/static/checkmarx'; var spanSpinner; @@ -1537,6 +1538,12 @@ window.registerExtension('checkmarx/cx_report', function (options) { return function () { + //This is to reset value of analysisDate and reload the component and other pages will keep on refreshing as expected + if(options.component.analysisDate === 'tempAnalysisDate') + { + options.component.analysisDate = undefined; + location.reload(); + } // we unset the `isDisplayed` flag to ignore to Web API calls finished after the static is closed isDisplayed = false; From 95120f11a6a23f292668056edebb3298e52b5bd0 Mon Sep 17 00:00:00 2001 From: Khant1000 <131154593+Khant1000@users.noreply.github.com> Date: Thu, 31 Aug 2023 02:05:51 +0530 Subject: [PATCH 12/13] version change --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be6242d..7dab8e9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ checkmarx.com com.checkmarx.sonar.cxplugin sonar-plugin - 2023.3.3 + 2023.3.4 Checkmarx plugin Checkmarx plugin From 1c801587218a2b7aa4e6e0b11a933dc07289aea1 Mon Sep 17 00:00:00 2001 From: Khant1000 <131154593+Khant1000@users.noreply.github.com> Date: Thu, 31 Aug 2023 18:52:04 +0530 Subject: [PATCH 13/13] delet pref files --- .settings/org.eclipse.core.resources.prefs | 2 -- .settings/org.eclipse.m2e.core.prefs | 4 ---- 2 files changed, 6 deletions(-) delete mode 100644 .settings/org.eclipse.core.resources.prefs delete mode 100644 .settings/org.eclipse.m2e.core.prefs diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index 99f26c0..0000000 --- a/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -encoding/=UTF-8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1