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

[dynamic_extended_choice_parameter] Extract inline script block in com/moded/extendedchoiceparameter/ExtendedChoiceParameterDefinition/radioContent.jelly

      Problem

      == Inline Script Block
      Line: 25
      ----
      <script>
      <![CDATA[  
        		(function() {
        			var f = function() {
      	  			var height = 0;
      	  			var maxCount = ${index};
      	  			if(maxCount > ${it.visibleItemCount}) {
      	  				maxCount = ${it.visibleItemCount};
      	  			}
      	  			
      	  			if(maxCount > 0 && document.getElementById("ecp_${it.name}_0").offsetHeight !=0) {
      		  			for(var i=0; i< maxCount; i++) {
      		  				height += document.getElementById("ecp_${it.name}_" + i).offsetHeight + 3;
      		  			}
      		  		}
      	  			else {
      	  				height = maxCount * 25.5;
      	  			}
      	  			height = Math.floor(height);
      	  			document.getElementById("ecp_${it.name}").style.height = height + "px";
      	  		};
      	  		
      	  		f();
        		})();
      ]]>  		
        </script>
      ----
      

      Solution

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

          [JENKINS-74106] [dynamic_extended_choice_parameter] Extract inline script block in com/moded/extendedchoiceparameter/ExtendedChoiceParameterDefinition/radioContent.jelly

          Basil Crow created issue -
          Basil Crow made changes -
          Description Original: h4. Problems

          {noformat}
          == Inline Script Block
          Line: 25
          ----
          <script>
          <![CDATA[
             (function() {
             var f = function() {
          var height = 0;
          var maxCount = ${index};
          if(maxCount > ${it.visibleItemCount}) {
          maxCount = ${it.visibleItemCount};
          }

          if(maxCount > 0 && document.getElementById("ecp_${it.name}_0").offsetHeight !=0) {
          for(var i=0; i< maxCount; i++) {
          height += document.getElementById("ecp_${it.name}_" + i).offsetHeight + 3;
          }
          }
          else {
          height = maxCount * 25.5;
          }
          height = Math.floor(height);
          document.getElementById("ecp_${it.name}").style.height = height + "px";
          };

          f();
             })();
          ]]>
            </script>
          ----

          == Inline Script Block
          Line: 25
          ----
          <script>
          <![CDATA[
             (function() {
             var f = function() {
          var height = 0;
          var maxCount = ${index};
          if(maxCount > ${it.visibleItemCount}) {
          maxCount = ${it.visibleItemCount};
          }

          if(maxCount > 0 && document.getElementById("ecp_${it.name}_0").offsetHeight !=0) {
          for(var i=0; i< maxCount; i++) {
          height += document.getElementById("ecp_${it.name}_" + i).offsetHeight + 3;
          }
          }
          else {
          height = maxCount * 25.5;
          }
          height = Math.floor(height);
          document.getElementById("ecp_${it.name}").style.height = height + "px";
          };

          f();
             })();
          ]]>
            </script>
          ----
          {noformat}

          h4. Solution

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          New: h4. Problem

          {noformat}
          == Inline Script Block
          Line: 25
          ----
          <script>
          <![CDATA[
             (function() {
             var f = function() {
          var height = 0;
          var maxCount = ${index};
          if(maxCount > ${it.visibleItemCount}) {
          maxCount = ${it.visibleItemCount};
          }

          if(maxCount > 0 && document.getElementById("ecp_${it.name}_0").offsetHeight !=0) {
          for(var i=0; i< maxCount; i++) {
          height += document.getElementById("ecp_${it.name}_" + i).offsetHeight + 3;
          }
          }
          else {
          height = maxCount * 25.5;
          }
          height = Math.floor(height);
          document.getElementById("ecp_${it.name}").style.height = height + "px";
          };

          f();
             })();
          ]]>
            </script>
          ----
          {noformat}

          h4. Solution

          [https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks]
          Summary Original: [dynamic_extended_choice_parameter] Extract inline script blocks in com/moded/extendedchoiceparameter/ExtendedChoiceParameterDefinition/radioContent.jelly New: [dynamic_extended_choice_parameter] Extract inline script block in com/moded/extendedchoiceparameter/ExtendedChoiceParameterDefinition/radioContent.jelly
          Yaroslav Afenkin made changes -
          Assignee New: Yaroslav Afenkin [ yafenkin ]
          Yaroslav Afenkin made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Yaroslav Afenkin made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]

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

              Created:
              Updated: