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

[uno-choice] Extract inline script block and event handlers in org/biouno/unochoice/common/radioContent.jelly

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor Minor
    • _unsorted

      Problems

      == Inline Script Block
      Line: 106
      ----
      <script type="text/javascript">
      <![CDATA[
        (function() {
            var f = function() {
                var height = 0;
                var maxCount = ${it.getVisibleItemCount()};
                if(maxCount > ${it.visibleItemCount}) {
                    maxCount = ${it.visibleItemCount};
                }
      
                var refElement = document.getElementById("ecp_${h.escape(it.randomName)}_0");
                if(maxCount > 0 && refElement && refElement.offsetHeight !=0) {
                    for(var i=0; i< maxCount; i++) {
                        height += refElement.offsetHeight + 3;
                    }
                }
                else {
                    height = maxCount * 25.5;
                }
      
                height = Math.floor(height);
                document.getElementById("ecp_${h.escape(it.randomName)}").style.height = height + "px";
            };
      
            f();
        })();
      ]]>
      </script>
      ----
      
      == Inline Event Handler
      Line: 80
      ----
      <input disabled="${disabled}" json="${escapedAndDisabledKey}" alt="${escapedAndDisabledValue}" otherid="${id}" checked="checked" name="${h.escape(it.name)}" value="${escapedAndDisabledKey}" class=" " type="radio" onchange="UnoChoice.fakeSelectRadioButton(&quot;${h.escape(it.name)}&quot;, &quot;${id}&quot;)" />
      ----
      
      == Inline Event Handler
      Line: 85
      ----
      <input json="${escapedKey}" alt="${escapedValue}" otherid="${id}" checked="checked" name="${h.escape(it.name)}" value="${escapedKey}" class=" " type="radio" onchange="UnoChoice.fakeSelectRadioButton(&quot;${h.escape(it.name)}&quot;, &quot;${id}&quot;)" />
      ----
      
      == Inline Event Handler
      Line: 90
      ----
      <input disabled="${disabled}" json="${escapedDisabledKey}" alt="${escapedDisabledValue}" otherid="${id}" name="${h.escape(it.name)}" value="${escapedDisabledKey}" class=" " type="radio" onchange="UnoChoice.fakeSelectRadioButton(&quot;${h.escape(it.name)}&quot;, &quot;${id}&quot;)" />
      ----
      
      == Inline Event Handler
      Line: 95
      ----
      <input json="${escapedKey}" alt="${escapedValue}" otherid="${id}" name="${h.escape(it.name)}" value="${escapedKey}" class=" " type="radio" onchange="UnoChoice.fakeSelectRadioButton(&quot;${h.escape(it.name)}&quot;, &quot;${id}&quot;)" />
      ----
      

      Solutions

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

            yafenkin Yaroslav Afenkin
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: