diff --git a/core/src/main/resources/jenkins/install/SetupWizard/setInitialRootUrlFieldValue.js b/core/src/main/resources/jenkins/install/SetupWizard/setInitialRootUrlFieldValue.js new file mode 100644 index 0000000000000000000000000000000000000000..9faabe82815b837330b2ab9cf59e26ebd5389de4 --- /dev/null +++ b/core/src/main/resources/jenkins/install/SetupWizard/setInitialRootUrlFieldValue.js @@ -0,0 +1,22 @@ +var rootUrlField = $("root-url"); + +rootUrlField.focus(); +rootUrlField.onkeydown = function (event) { + if (event.keyCode == 13) { + event.preventDefault(); + } +}; + +(function setInitialRootUrlFieldValue() { + var iframeUrl = window.location.href; + // will let the trailing slash in the rootUrl + var iframeRelativeUrl = "setupWizard/setupWizardConfigureInstance"; + var rootUrl = iframeUrl.substr( + 0, + iframeUrl.length - iframeRelativeUrl.length + ); + // to keep only the root url + rootUrlField.value = rootUrl; + // to adjust the width of the input, + rootUrlField.size = Math.min(50, rootUrl.length); +})(); diff --git a/core/src/main/resources/jenkins/install/SetupWizard/setupWizardConfigureInstance.jelly b/core/src/main/resources/jenkins/install/SetupWizard/setupWizardConfigureInstance.jelly index 60bfd452462d796a515941d478195fc7727ed6e7..3fd6c5df004b183c8be758cb9224e580364db80d 100644 --- a/core/src/main/resources/jenkins/install/SetupWizard/setupWizardConfigureInstance.jelly +++ b/core/src/main/resources/jenkins/install/SetupWizard/setupWizardConfigureInstance.jelly @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> - + @@ -45,27 +45,7 @@ THE SOFTWARE. - +