Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-74573

[bmc-rpd] Extract inline script block in com/bmc/rpd/jenkins/plugin/bmcrpd/buildstep/RPDDeployInstance/config.jelly

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • bmc-rpd-plugin

      Problem

      == Inline Script Block
      Line: 35
      ----
      <script type='text/javascript'>
                      YAHOO.util.Event.on("${h}_${uniq_id}_select", "change",function(e){
                          document.getElementById("${h}_${uniq_id}").value=null;
                      });
      
                      YAHOO.util.Event.onAvailable("page-body",function(a){
                      YAHOO.util.Dom.getElementsByClassName('rpd-package-class', "input").forEach(function(el){
      
                      var input = el;
                      var select = document.getElementById(el.id+"_select");
                      var dsXHR = new YAHOO.util.XHRDataSource("${descriptor.getDescriptorFullUrl()}/completePack");
                      dsXHR.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;
                      dsXHR.responseSchema = {
                          resultsList: "suggestions",
                          fields: ["name"]
                      };
                      var myAutoComp = new YAHOO.widget.AutoComplete(input.id, input.id+"_myContainer", dsXHR);
                      myAutoComp.generateRequest = function(query) {
                      return "?value=" + query + "&amp;profile="+ select.value ;
                      };
                      //myAutoComp.enableCache = false;
                      //myAutoComp.scrollIntoView = true;
                      myAutoComp.prehighlightClassName = "yui-ac-prehighlight";
                      myAutoComp.animSpeed = 0;
                      myAutoComp.useShadow = true;
                      myAutoComp.autoSnapContainer = true;
                      myAutoComp.maxResultsDisplayed = 30;
                      myAutoComp.doBeforeExpandContainer = function(textbox,container) {// adjust the width every time we show it
                          container.style.width=textbox.clientWidth+"px";
                          var Dom = YAHOO.util.Dom;
                          Dom.setXY(container, [Dom.getX(textbox), Dom.getY(textbox) + textbox.offsetHeight] );
                          return true;
                      }
                      })
      
                      });
      
                  </script>
      ----
      

      Solution

      https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks

            Unassigned Unassigned
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: