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

[p4] Extract inline script block and event handler in org/jenkinsci/plugins/p4/workspace/ManualWorkspaceImpl/config.jelly

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin

      Problems

      == Inline Script Block
      Line: 26
      ----
      <script>
      		function updateWorkspaceSpec() {
      			var inst = <st:bind value="${instance}"/>;
      			var name = document.getElementById("id.name").value;
      					
      			inst.getSpecJSON(name, function(t) {
      				var json = t.responseObject();
      				
      				document.getElementById("id.allwrite").checked = json.options.allwrite;
      				document.getElementById("id.clobber").checked = json.options.clobber;
      				document.getElementById("id.compress").checked = json.options.compress;
      				document.getElementById("id.locked").checked = json.options.locked;
      				document.getElementById("id.modtime").checked = json.options.modtime;
      				document.getElementById("id.rmdir").checked = json.options.rmdir;
      				document.getElementById("id.stream").value = json.stream;
      				document.getElementById("id.line").value = json.line;
      				document.getElementById("id.view").value = json.view;
      			});
      		}
      	</script>
      ----
      
      == Inline Event Handler
      Line: 10
      ----
      <!--f:textbox id="id.name" onfocus="updateWorkspaceSpec()" onkeyup="updateWorkspaceSpec()" /-->
      ----
      

      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:
            1 Start watching this issue

              Created:
              Updated: