Bug 960730 - Rewrite inline script / style in devtools/framework/connect/connect.xhtml. r=bgrins
authorKay Plößer <mail@kay.is>
Wed, 22 Jan 2014 10:33:58 -0500
changeset 164626 80613bb663db
parent 164625 c6aad335ea99
child 164627 52e95a04fe55
push id4495
push userryanvm@gmail.com
push date2014-01-22 15:34 +0000
treeherderfx-team@52e95a04fe55 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs960730
milestone29.0a1
Bug 960730 - Rewrite inline script / style in devtools/framework/connect/connect.xhtml. r=bgrins
browser/devtools/framework/connect/connect.js
browser/devtools/framework/connect/connect.xhtml
--- a/browser/devtools/framework/connect/connect.js
+++ b/browser/devtools/framework/connect/connect.js
@@ -32,16 +32,20 @@ window.addEventListener("DOMContentLoade
   if (host) {
     document.getElementById("host").value = host;
   }
 
   if (port) {
     document.getElementById("port").value = port;
   }
 
+  let form = document.querySelector("#connection-form form");
+  form.addEventListener("submit", function() {
+    window.submit();
+  });
 }, true);
 
 /**
  * Called when the "connect" button is clicked.
  */
 function submit() {
   // Show the "connecting" screen
   document.body.classList.add("connecting");
--- a/browser/devtools/framework/connect/connect.xhtml
+++ b/browser/devtools/framework/connect/connect.xhtml
@@ -14,17 +14,17 @@
     <title>&title;</title>
     <link rel="stylesheet" href="chrome://browser/skin/devtools/dark-theme.css" type="text/css"/>
     <link rel="stylesheet" href="chrome://browser/content/devtools/connect.css" type="text/css"/>
     <script type="application/javascript;version=1.8" src="connect.js"></script>
   </head>
   <body>
     <h1>&header;</h1>
     <section id="connection-form">
-      <form validate="validate" onsubmit="window.submit()" action="#">
+      <form validate="validate" action="#">
         <label>
           <span>&host;</span>
           <input required="required" class="devtools-textinput" id="host" type="text"></input>
         </label>
         <label>
           <span>&port;</span>
           <input required="required" class="devtools-textinput" id="port" type="number" pattern="\d+"></input>
         </label>