未验证 提交 5dcae0b4 编写于 作者: A Alexander Brandes 提交者: GitHub

[JENKINS-60866] Un-inline setup wizard root URL js (#7619)

* Un-inline setup wizard root URL

* Fix linting
上级 6b4dd606
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);
})();
...@@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ...@@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
--> -->
<?jelly escape-by-default='true'?> <?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout"> <j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout" xmlns:st="jelly:stapler">
<l:layout norefresh="true" type="full-screen" title="${it.displayName}"> <l:layout norefresh="true" type="full-screen" title="${it.displayName}">
<l:main-panel> <l:main-panel>
...@@ -45,27 +45,7 @@ THE SOFTWARE. ...@@ -45,27 +45,7 @@ THE SOFTWARE.
</tr> </tr>
</table> </table>
</div> </div>
<script> <st:adjunct includes="jenkins.install.SetupWizard.setInitialRootUrlFieldValue"/>
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);
})();
</script>
</form> </form>
</div> </div>
</l:main-panel> </l:main-panel>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册