diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index b41fb8cd2164..5c690f7637f1 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2289,4 +2289,10 @@ public static boolean isContextMenuVisible(Action a) { return true; } } + + @SuppressFBWarnings(value = "PREDICTABLE_RANDOM", justification = "True randomness isn't necessary for form item IDs") + @Restricted(NoExternalUse.class) + public static String generateItemId() { + return String.valueOf(Math.floor(Math.random() * 3000)); + } } diff --git a/core/src/main/resources/hudson/logging/LogRecorderManager/new.jelly b/core/src/main/resources/hudson/logging/LogRecorderManager/new.jelly index d4029937a704..330067dc14c4 100644 --- a/core/src/main/resources/hudson/logging/LogRecorderManager/new.jelly +++ b/core/src/main/resources/hudson/logging/LogRecorderManager/new.jelly @@ -33,7 +33,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/model/AbstractProject/configure-common.jelly b/core/src/main/resources/hudson/model/AbstractProject/configure-common.jelly index 806067f21095..b013b1a672ca 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/configure-common.jelly +++ b/core/src/main/resources/hudson/model/AbstractProject/configure-common.jelly @@ -36,7 +36,7 @@ THE SOFTWARE. - @@ -55,7 +55,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/hudson/model/Computer/configure.jelly b/core/src/main/resources/hudson/model/Computer/configure.jelly index bf209f136f45..6a470d7255b4 100644 --- a/core/src/main/resources/hudson/model/Computer/configure.jelly +++ b/core/src/main/resources/hudson/model/Computer/configure.jelly @@ -36,9 +36,11 @@ THE SOFTWARE. - - - +
+ + + +
diff --git a/core/src/main/resources/hudson/model/Job/configure.jelly b/core/src/main/resources/hudson/model/Job/configure.jelly index be91af8a99a2..36f509fc06ab 100644 --- a/core/src/main/resources/hudson/model/Job/configure.jelly +++ b/core/src/main/resources/hudson/model/Job/configure.jelly @@ -45,9 +45,11 @@ THE SOFTWARE. - - - +
+ + + +
diff --git a/core/src/main/resources/hudson/model/ProxyView/configure-entries.jelly b/core/src/main/resources/hudson/model/ProxyView/configure-entries.jelly index 42942970a6cd..5b672c4364e0 100644 --- a/core/src/main/resources/hudson/model/ProxyView/configure-entries.jelly +++ b/core/src/main/resources/hudson/model/ProxyView/configure-entries.jelly @@ -26,7 +26,7 @@ THE SOFTWARE. - ${inst.viewName} diff --git a/core/src/main/resources/hudson/model/UsageStatistics/global.properties b/core/src/main/resources/hudson/model/UsageStatistics/global.properties index 8b38ffef7695..01971f396652 100644 --- a/core/src/main/resources/hudson/model/UsageStatistics/global.properties +++ b/core/src/main/resources/hudson/model/UsageStatistics/global.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. statsBlurb=\ - Help make Jenkins better by sending anonymous usage statistics and crash reports to the Jenkins project. + Help make Jenkins better by sending anonymous usage statistics and crash reports to the Jenkins project diff --git a/core/src/main/resources/hudson/model/View/newJob.jelly b/core/src/main/resources/hudson/model/View/newJob.jelly index 5467f5d9506e..f9c6bcd6f8d5 100644 --- a/core/src/main/resources/hudson/model/View/newJob.jelly +++ b/core/src/main/resources/hudson/model/View/newJob.jelly @@ -39,7 +39,7 @@ THE SOFTWARE.
- +
» ${%ItemName.help}
» ${%ItemName.validation.required}
diff --git a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/index.groovy b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/index.groovy index 3bfb4b284eb1..3dce26cdd2df 100644 --- a/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/index.groovy +++ b/core/src/main/resources/hudson/security/GlobalSecurityConfiguration/index.groovy @@ -12,11 +12,9 @@ def l=namespace(lib.LayoutTagLib) def st=namespace("jelly:stapler") l.layout(permission:app.SYSTEM_READ, title:my.displayName, cssclass:request.getParameter('decorate')) { + l.app_bar(title: my.displayName) + l.main_panel { - h1 { - l.icon(class: 'icon-secure icon-xlg') - text(my.displayName) - } set("readOnlyMode", !app.hasPermission(app.ADMINISTER)) p() @@ -32,12 +30,8 @@ l.layout(permission:app.SYSTEM_READ, title:my.displayName, cssclass:request.getP f.checkbox(title:_("Disable remember me"), field: "disableRememberMe") } - div(style:"width:100%") { - f.descriptorRadioList(title:_("Security Realm"), varName:"realm", instance:app.securityRealm, descriptors: h.filterDescriptors(app, SecurityRealm.all())) - } - } + f.descriptorRadioList(title:_("Security Realm"), varName:"realm", instance:app.securityRealm, descriptors: h.filterDescriptors(app, SecurityRealm.all())) - div(style:"width:100%") { f.descriptorRadioList(title:_("Authorization"), varName:"authorization", instance:app.authorizationStrategy, descriptors:h.filterDescriptors(app, AuthorizationStrategy.all())) } diff --git a/core/src/main/resources/hudson/security/LegacySecurityRealm/config.groovy b/core/src/main/resources/hudson/security/LegacySecurityRealm/config.groovy index 9c017edda7d4..1d0d2eb4d9cb 100644 --- a/core/src/main/resources/hudson/security/LegacySecurityRealm/config.groovy +++ b/core/src/main/resources/hudson/security/LegacySecurityRealm/config.groovy @@ -7,7 +7,9 @@ import jenkins.model.Jenkins def f = namespace(lib.FormTagLib) f.entry(title: _('Unprotected URLs')) { - p(_('blurb')) + p(class: "jenkins-form-description") { + _('blurb') + } ul { for (def action : Jenkins.get().getActions().sort { x, y -> x.getUrlName() <=> y.getUrlName() }) { if (action instanceof UnprotectedRootAction) { diff --git a/core/src/main/resources/hudson/tasks/BuildTrigger/config.jelly b/core/src/main/resources/hudson/tasks/BuildTrigger/config.jelly index 0e2b56aab2d8..c1b5ed907ee9 100644 --- a/core/src/main/resources/hudson/tasks/BuildTrigger/config.jelly +++ b/core/src/main/resources/hudson/tasks/BuildTrigger/config.jelly @@ -31,17 +31,11 @@ THE SOFTWARE. field="childProjects"/> - - - + title="${%Trigger only if build is stable}" id="threshold-SUCCESS" value="SUCCESS"/> - - + title="${%Trigger even if the build is unstable}" id="threshold-UNSTABLE" value="UNSTABLE"/> - + title="${%Trigger even if the build fails}" id="threshold-FAILURE" value="FAILURE"/> diff --git a/core/src/main/resources/hudson/tasks/Maven/config.jelly b/core/src/main/resources/hudson/tasks/Maven/config.jelly index 7653f18a03ae..1e54cdbf628b 100644 --- a/core/src/main/resources/hudson/tasks/Maven/config.jelly +++ b/core/src/main/resources/hudson/tasks/Maven/config.jelly @@ -26,7 +26,7 @@ THE SOFTWARE. - ${inst.name} diff --git a/core/src/main/resources/hudson/tools/ToolLocationNodeProperty/config.jelly b/core/src/main/resources/hudson/tools/ToolLocationNodeProperty/config.jelly index 4f8a57463196..5a38fbd626e1 100644 --- a/core/src/main/resources/hudson/tools/ToolLocationNodeProperty/config.jelly +++ b/core/src/main/resources/hudson/tools/ToolLocationNodeProperty/config.jelly @@ -28,7 +28,7 @@ - (${toolDescriptor.displayName}) ${toolInstallation.name} diff --git a/core/src/main/resources/hudson/views/GlobalDefaultViewConfiguration/config.groovy b/core/src/main/resources/hudson/views/GlobalDefaultViewConfiguration/config.groovy index c729c35b1006..4deb2a91c7ea 100644 --- a/core/src/main/resources/hudson/views/GlobalDefaultViewConfiguration/config.groovy +++ b/core/src/main/resources/hudson/views/GlobalDefaultViewConfiguration/config.groovy @@ -4,10 +4,12 @@ def f=namespace(lib.FormTagLib) if (app.views.size()>1) { f.entry(title:_("Default view"), field:"defaultView") { - select("class":"setting-input", name:"primaryView") { - app.views.each { v -> - f.option(value:v.viewName, selected:app.primaryView==v) { - text(v.viewName) + div(class:"jenkins-select") { + select(name:"primaryView", class:"jenkins-select__input") { + app.views.each { v -> + f.option(value:v.viewName, selected:app.primaryView==v) { + text(v.viewName) + } } } } diff --git a/core/src/main/resources/hudson/views/StatusFilter/config.jelly b/core/src/main/resources/hudson/views/StatusFilter/config.jelly index bd4507ab0454..416c63b18b10 100644 --- a/core/src/main/resources/hudson/views/StatusFilter/config.jelly +++ b/core/src/main/resources/hudson/views/StatusFilter/config.jelly @@ -26,7 +26,7 @@ THE SOFTWARE. - ${%Enabled jobs only} ${%Disabled jobs only} diff --git a/core/src/main/resources/jenkins/fingerprints/GlobalFingerprintConfiguration/config.jelly b/core/src/main/resources/jenkins/fingerprints/GlobalFingerprintConfiguration/config.jelly index 916ca936ff71..40a441604b6a 100644 --- a/core/src/main/resources/jenkins/fingerprints/GlobalFingerprintConfiguration/config.jelly +++ b/core/src/main/resources/jenkins/fingerprints/GlobalFingerprintConfiguration/config.jelly @@ -20,8 +20,8 @@ THE SOFTWARE. - - + + diff --git a/core/src/main/resources/jenkins/formelementpath/form-element-path.js b/core/src/main/resources/jenkins/formelementpath/form-element-path.js index 0bba9171438e..6c512faeea86 100644 --- a/core/src/main/resources/jenkins/formelementpath/form-element-path.js +++ b/core/src/main/resources/jenkins/formelementpath/form-element-path.js @@ -62,7 +62,8 @@ document.addEventListener("DOMContentLoaded", function(){ case "button": var element // modern buttons aren't wrapped in spans - if (e.classList.contains('jenkins-button')) { + if (e.classList.contains('jenkins-button') || e.classList.contains('repeatable-delete')) { + p = findParent(e); element = e } else { p = findParent(e); diff --git a/core/src/main/resources/jenkins/management/AdministrativeMonitorsConfiguration/config.groovy b/core/src/main/resources/jenkins/management/AdministrativeMonitorsConfiguration/config.groovy index 6327d38955d6..fb00245ad877 100644 --- a/core/src/main/resources/jenkins/management/AdministrativeMonitorsConfiguration/config.groovy +++ b/core/src/main/resources/jenkins/management/AdministrativeMonitorsConfiguration/config.groovy @@ -32,23 +32,21 @@ st = namespace("jelly:stapler") f.section(title: _("Administrative monitors configuration")) { f.advanced(title: _("Administrative monitors")) { f.entry(title: _("Enabled administrative monitors")) { - p(_("blurb")) - div(width: "100%") { - for (AdministrativeMonitor am : new ArrayList<>(AdministrativeMonitor.all()) - .sort({ o1, o2 -> o1.getDisplayName() <=> o2.getDisplayName() })) { - f.block() { - f.checkbox(name: "administrativeMonitor", - title: am.displayName, - checked: am.enabled, - json: am.id) - if (am.isSecurity()) { - span(style: 'margin-left: 0.5rem', class: 'am-badge', _("Security")) - } + p(class: "jenkins-form-description", _("blurb")) + for (AdministrativeMonitor am : new ArrayList<>(AdministrativeMonitor.all()) + .sort({ o1, o2 -> o1.getDisplayName() <=> o2.getDisplayName() })) { + div(class: "jenkins-checkbox-help-wrapper") { + f.checkbox(name: "administrativeMonitor", + title: am.displayName, + checked: am.enabled, + json: am.id) + if (am.isSecurity()) { + span(style: 'margin-left: 0.5rem', class: 'am-badge', _("Security")) } - div(class: "tr") { - div(class: "setting-description") { - st.include(from: am, page: "description", optional: true) - } + } + div(class: "tr") { + div(class: "jenkins-checkbox__description") { + st.include(from: am, page: "description", optional: true) } } } diff --git a/core/src/main/resources/jenkins/model/GlobalCloudConfiguration/index.groovy b/core/src/main/resources/jenkins/model/GlobalCloudConfiguration/index.groovy index 5fe75363d225..3d3bb7f6be76 100644 --- a/core/src/main/resources/jenkins/model/GlobalCloudConfiguration/index.groovy +++ b/core/src/main/resources/jenkins/model/GlobalCloudConfiguration/index.groovy @@ -16,12 +16,8 @@ l.layout(norefresh:true, permission:app.SYSTEM_READ, title:my.displayName) { l.task(icon:"icon-gear icon-md", href:"${rootURL}/computer/", title:_("Manage Nodes")) } } + l.app_bar(title: my.displayName) l.main_panel { - h1 { - l.icon(class: 'icon-health-40to59 icon-xlg') - // TODO more appropriate icon - text(my.displayName) - } def clouds = Cloud.all() if (!clouds.isEmpty()) { p() diff --git a/core/src/main/resources/jenkins/model/GlobalProjectNamingStrategyConfiguration/config.groovy b/core/src/main/resources/jenkins/model/GlobalProjectNamingStrategyConfiguration/config.groovy index 4edce2f25ea1..70a178dccb60 100644 --- a/core/src/main/resources/jenkins/model/GlobalProjectNamingStrategyConfiguration/config.groovy +++ b/core/src/main/resources/jenkins/model/GlobalProjectNamingStrategyConfiguration/config.groovy @@ -4,12 +4,14 @@ import jenkins.model.ProjectNamingStrategy def f=namespace(lib.FormTagLib) -f.optionalBlock( field:"useProjectNamingStrategy", title:_("useNamingStrategy"), checked:app.useProjectNamingStrategy) { +div(class: "jenkins-form-item") { + f.optionalBlock( field:"useProjectNamingStrategy", title:_("useNamingStrategy"), checked:app.useProjectNamingStrategy) { - f.entry(title:_("namingStrategyTitle")) { - div(style:"width:100%") { - f.descriptorRadioList(title:_("strategy"), varName:"namingStrategy", instance:app.projectNamingStrategy, descriptors:ProjectNamingStrategy.all()) + f.entry(title:_("namingStrategyTitle")) { + div(style:"width:100%") { + f.descriptorRadioList(title:_("strategy"), varName:"namingStrategy", instance:app.projectNamingStrategy, descriptors:ProjectNamingStrategy.all()) + } } - } + } } diff --git a/core/src/main/resources/jenkins/model/Jenkins/configure.jelly b/core/src/main/resources/jenkins/model/Jenkins/configure.jelly index a0ccbd5cc223..16dee8feaf4d 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/configure.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/configure.jelly @@ -29,17 +29,20 @@ THE SOFTWARE. - + + + +
- + - - ${it.rootDir} + +
${it.rootDir}
- + @@ -50,7 +53,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck.jelly b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck.jelly index cdd23d927c66..77379a58ea54 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/fingerprintCheck.jelly @@ -41,7 +41,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly index 9311dbb992b7..8bf0c69ed277 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly @@ -49,7 +49,7 @@ THE SOFTWARE. -
+

${category.key.label}

${taskTags!=null and attrs.contextMenu!='false' ? taskTags.addHeader(category.key.label) : null}
diff --git a/core/src/main/resources/jenkins/model/OptionalJobProperty/config.jelly b/core/src/main/resources/jenkins/model/OptionalJobProperty/config.jelly index 6f46063fb5bf..4281fc183c6b 100644 --- a/core/src/main/resources/jenkins/model/OptionalJobProperty/config.jelly +++ b/core/src/main/resources/jenkins/model/OptionalJobProperty/config.jelly @@ -25,9 +25,7 @@ THE SOFTWARE. - - - - - + + + diff --git a/core/src/main/resources/jenkins/mvn/FilePathGlobalSettingsProvider/config.jelly b/core/src/main/resources/jenkins/mvn/FilePathGlobalSettingsProvider/config.jelly index fcd17978b2e1..3f3ff2065305 100644 --- a/core/src/main/resources/jenkins/mvn/FilePathGlobalSettingsProvider/config.jelly +++ b/core/src/main/resources/jenkins/mvn/FilePathGlobalSettingsProvider/config.jelly @@ -24,7 +24,7 @@ THE SOFTWARE. - + \ No newline at end of file diff --git a/core/src/main/resources/jenkins/mvn/GlobalMavenConfig/config.groovy b/core/src/main/resources/jenkins/mvn/GlobalMavenConfig/config.groovy index ca998385e069..7d1ff84aa72f 100644 --- a/core/src/main/resources/jenkins/mvn/GlobalMavenConfig/config.groovy +++ b/core/src/main/resources/jenkins/mvn/GlobalMavenConfig/config.groovy @@ -3,6 +3,6 @@ package jenkins.mvn.GlobalMavenConfig def f = namespace(lib.FormTagLib) f.section(title:_("Maven Configuration")) { - f.dropdownDescriptorSelector(title:_("Default settings provider"), field:"settingsProvider") - f.dropdownDescriptorSelector(title:_("Default global settings provider"), field:"globalSettingsProvider") + f.dropdownDescriptorSelector(title:_("Default settings provider"), field:"settingsProvider") + f.dropdownDescriptorSelector(title:_("Default global settings provider"), field:"globalSettingsProvider") } diff --git a/core/src/main/resources/jenkins/security/ApiTokenProperty/resources.css b/core/src/main/resources/jenkins/security/ApiTokenProperty/resources.css index 73c211376c67..631043e98ce8 100644 --- a/core/src/main/resources/jenkins/security/ApiTokenProperty/resources.css +++ b/core/src/main/resources/jenkins/security/ApiTokenProperty/resources.css @@ -144,7 +144,8 @@ } .token-list .repeated-chunk { border-width: 0; - padding-left: 0; + padding: 0; + margin: 0; } .token-list .repeatable-add{ margin: 6px 6px 3px 6px; diff --git a/core/src/main/resources/jenkins/tools/GlobalToolConfiguration/index.groovy b/core/src/main/resources/jenkins/tools/GlobalToolConfiguration/index.groovy index 0ad0f39ffa4b..dcac38139ac9 100644 --- a/core/src/main/resources/jenkins/tools/GlobalToolConfiguration/index.groovy +++ b/core/src/main/resources/jenkins/tools/GlobalToolConfiguration/index.groovy @@ -14,15 +14,9 @@ l.layout(permission:app.SYSTEM_READ, title:my.displayName) { l.task(icon:"icon-gear icon-md", href:"${rootURL}/manage", title:_("Manage Jenkins")) } } + l.app_bar(title: my.displayName) set("readOnlyMode", !app.hasPermission(app.ADMINISTER)) l.main_panel { - h1 { - l.icon(class: 'icon-setting icon-xlg') - // TODO more appropriate icon - text(my.displayName) - } - - p() div(class:"behavior-loading") { l.spinner(text: _("LOADING")) } @@ -31,7 +25,7 @@ l.layout(permission:app.SYSTEM_READ, title:my.displayName) { Functions.getSortedDescriptorsForGlobalConfigByDescriptor(my.FILTER).each { Descriptor descriptor -> set("descriptor",descriptor) set("instance",descriptor) - f.rowSet(name:descriptor.jsonSafeClassName) { + f.rowSet(name:descriptor.jsonSafeClassName, class: "jenkins-!-margin-bottom-0") { st.include(from:descriptor, page:descriptor.globalConfigPage) } } diff --git a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly index 19434e0f843c..e22a5861fdc9 100644 --- a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly +++ b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly @@ -26,8 +26,11 @@ THE SOFTWARE. Adds one more in-page breadcrumb that jumps to sections in the page. Put this tag right before <l:main-panel> + + Optional title for this breadcrumb + - - \ No newline at end of file + + diff --git a/core/src/main/resources/lib/form/checkbox.jelly b/core/src/main/resources/lib/form/checkbox.jelly index dc63a1ca9123..99109623b996 100644 --- a/core/src/main/resources/lib/form/checkbox.jelly +++ b/core/src/main/resources/lib/form/checkbox.jelly @@ -46,7 +46,7 @@ THE SOFTWARE. If set to true, this will take precedence over the onclick attribute and prevent the state of the checkbox from being changed. - + Note: if you want an actual read only checkbox then add: <j:set var="readOnlyMode" value="true"/> inside your entry tag See https://www.jenkins.io/doc/developer/views/read-only/#enabling-read-only-view-support @@ -67,16 +67,18 @@ THE SOFTWARE. - - + + + + ${customizedFields.add(name)} diff --git a/core/src/main/resources/lib/form/combobox.jelly b/core/src/main/resources/lib/form/combobox.jelly index 9f5da2fc5982..c9c93658d436 100644 --- a/core/src/main/resources/lib/form/combobox.jelly +++ b/core/src/main/resources/lib/form/combobox.jelly @@ -81,7 +81,7 @@ THE SOFTWARE. diff --git a/core/src/main/resources/lib/form/description.jelly b/core/src/main/resources/lib/form/description.jelly index 12bc8ab80575..a11363de8a09 100644 --- a/core/src/main/resources/lib/form/description.jelly +++ b/core/src/main/resources/lib/form/description.jelly @@ -27,11 +27,7 @@ THE SOFTWARE. Renders a row that shows description text below an input field. -
-
-
- -
-
+
+
diff --git a/core/src/main/resources/lib/form/dropdownList.jelly b/core/src/main/resources/lib/form/dropdownList.jelly index aefcbb35a28a..159e4fc37ad9 100644 --- a/core/src/main/resources/lib/form/dropdownList.jelly +++ b/core/src/main/resources/lib/form/dropdownList.jelly @@ -39,16 +39,16 @@ THE SOFTWARE.
-
+
${attrs.title}
-
+
- + diff --git a/core/src/main/resources/lib/form/hetero-list.jelly b/core/src/main/resources/lib/form/hetero-list.jelly index 0bee8a859d4f..098293450f37 100644 --- a/core/src/main/resources/lib/form/hetero-list.jelly +++ b/core/src/main/resources/lib/form/hetero-list.jelly @@ -80,33 +80,28 @@ THE SOFTWARE. -
+
- -
-
-
- ${descriptor.displayName} -
- -
-
- - - + +
+
+ + ${descriptor.displayName} + + + + + - +
- + + + - - -
- -
-
-
+ +
diff --git a/core/src/main/resources/lib/form/optionalBlock.jelly b/core/src/main/resources/lib/form/optionalBlock.jelly index da8f3603e99e..d3cd5bec93bd 100644 --- a/core/src/main/resources/lib/form/optionalBlock.jelly +++ b/core/src/main/resources/lib/form/optionalBlock.jelly @@ -66,9 +66,9 @@ THE SOFTWARE. -
+
-
+
diff --git a/core/src/main/resources/lib/form/password.jelly b/core/src/main/resources/lib/form/password.jelly index 26fa75c615ca..538eb9753278 100644 --- a/core/src/main/resources/lib/form/password.jelly +++ b/core/src/main/resources/lib/form/password.jelly @@ -77,7 +77,7 @@ THE SOFTWARE.
- - - - + +
+ + +
+ +
+
diff --git a/core/src/main/resources/lib/form/radioBlock.jelly b/core/src/main/resources/lib/form/radioBlock.jelly index 9a9db5b37760..93b2853f2bea 100644 --- a/core/src/main/resources/lib/form/radioBlock.jelly +++ b/core/src/main/resources/lib/form/radioBlock.jelly @@ -56,17 +56,20 @@ THE SOFTWARE.
-
-
diff --git a/core/src/main/resources/lib/form/radioBlock/radioBlock.js b/core/src/main/resources/lib/form/radioBlock/radioBlock.js index 75d87b66f164..3d11d82c76ff 100644 --- a/core/src/main/resources/lib/form/radioBlock/radioBlock.js +++ b/core/src/main/resources/lib/form/radioBlock/radioBlock.js @@ -18,7 +18,11 @@ var radioBlockSupport = { n = blockStart; } while((n = n.next()) != blockEnd) { - n.style.display = show ? "" : "none"; + if (show) { + n.classList.remove("form-container--hidden") + } else { + n.classList.add("form-container--hidden") + } } layoutUpdateCallback.call(); } @@ -27,6 +31,7 @@ var radioBlockSupport = { // this needs to happen before TR.row-set-end rule kicks in. Behaviour.specify("INPUT.radio-block-control", 'radioBlock', -100, function(r) { r.id = "radio-block-"+(iota++); + r.nextSibling.setAttribute("for", r.id); // when one radio button is clicked, we need to update foldable block for // other radio buttons with the same name. To do this, group all the diff --git a/core/src/main/resources/lib/form/readOnlyTextbox.jelly b/core/src/main/resources/lib/form/readOnlyTextbox.jelly index 62bfb3fb5cc2..1bf9e3e2b207 100644 --- a/core/src/main/resources/lib/form/readOnlyTextbox.jelly +++ b/core/src/main/resources/lib/form/readOnlyTextbox.jelly @@ -62,7 +62,7 @@ THE SOFTWARE. -
-
${header}
+
+
+ ${header} +
diff --git a/core/src/main/resources/lib/form/repeatable/repeatable.js b/core/src/main/resources/lib/form/repeatable/repeatable.js index 3260051d1795..e30e636c3820 100644 --- a/core/src/main/resources/lib/form/repeatable/repeatable.js +++ b/core/src/main/resources/lib/form/repeatable/repeatable.js @@ -173,19 +173,31 @@ Behaviour.specify("INPUT.repeatable-add", 'repeatable', 0, function(e) { e = null; // avoid memory leak }); -Behaviour.specify("INPUT.repeatable-delete", 'repeatable', 0, function(e) { - var b = makeButton(e,function(e) { - repeatableSupport.onDelete(e.target); - }); - var be = $(b.get("element")); - be.on("mouseover",function() { - $(this).up(".repeated-chunk").addClassName("hover"); - }); - be.on("mouseout",function() { - $(this).up(".repeated-chunk").removeClassName("hover"); - }); +/** + * Converts markup for plugins that aren't using the repeatableDeleteButton tag + */ +Behaviour.specify('input.repeatable-delete', 'repeatable-button-fallbacks', 0, function (input) { + var button = document.createElement("button"); + for (var index = input.attributes.length - 1; index >= 0; --index) { + button.attributes.setNamedItem(input.attributes[index].cloneNode()); + } + if (input.value) { + button.setAttribute("tooltip", input.value); + button.removeAttribute("value"); + } + + button.classList.add('danger'); + + button.innerHTML = '' + input.parentNode.replaceChild(button, input); + console.warn('Adapted element to new markup, it should be changed to use f:repeatableDeleteButton instead in the plugin', button) +}); + - e = be = null; // avoid memory leak +Behaviour.specify("BUTTON.repeatable-delete, INPUT.repeatable-delete", 'repeatable', 1, function(e) { + e.addEventListener("click", function() { + repeatableSupport.onDelete(e); + }) }); // radio buttons in repeatable content @@ -206,4 +218,4 @@ Behaviour.specify("DIV.repeated-chunk", 'repeatable', -200, function(d) { if (inputs[i].defaultChecked) inputs[i].checked = true; } } -}); \ No newline at end of file +}); diff --git a/core/src/main/resources/lib/form/repeatableDeleteButton.jelly b/core/src/main/resources/lib/form/repeatableDeleteButton.jelly index 9e676217b25f..8c5c0ba73bd5 100644 --- a/core/src/main/resources/lib/form/repeatableDeleteButton.jelly +++ b/core/src/main/resources/lib/form/repeatableDeleteButton.jelly @@ -32,5 +32,7 @@ THE SOFTWARE. - + diff --git a/core/src/main/resources/lib/form/richtextarea.jelly b/core/src/main/resources/lib/form/richtextarea.jelly index 7649ed5e88a0..00ee41bce4ac 100644 --- a/core/src/main/resources/lib/form/richtextarea.jelly +++ b/core/src/main/resources/lib/form/richtextarea.jelly @@ -34,7 +34,7 @@ THE SOFTWARE. diff --git a/core/src/main/resources/lib/form/rowSet.jelly b/core/src/main/resources/lib/form/rowSet.jelly index 0f6f863a9f77..2ede2c842d40 100644 --- a/core/src/main/resources/lib/form/rowSet.jelly +++ b/core/src/main/resources/lib/form/rowSet.jelly @@ -35,21 +35,25 @@ THE SOFTWARE. id of the thing that serves as the group head, if that's available separately + + Removes the "jenkins-form-item" class if false + + + Classes to apply to the container (this will be the form item if 'isFormItem' is true) + -
- - - - - - + + + + + + +
-
- -
+
- - -
+
+ + diff --git a/core/src/main/resources/lib/form/section.jelly b/core/src/main/resources/lib/form/section.jelly index 29afe27144af..3322dd3e701d 100644 --- a/core/src/main/resources/lib/form/section.jelly +++ b/core/src/main/resources/lib/form/section.jelly @@ -37,14 +37,15 @@ THE SOFTWARE. + - - -
+
+ +
${title}
- -
- + + +
\ No newline at end of file diff --git a/core/src/main/resources/lib/form/section_.js b/core/src/main/resources/lib/form/section_.js index 8cf90783d5b9..a0c177c24726 100644 --- a/core/src/main/resources/lib/form/section_.js +++ b/core/src/main/resources/lib/form/section_.js @@ -52,8 +52,9 @@ var section = (function (){ for (var e=dom.firstChild; e!=null; e=e.nextSibling) { if (e.nodeType==1) { - if (e.className=="jenkins-section__header" && isVisible(e)) { + if (e.className == "jenkins-section__title" && isVisible(e)) { var child = new SectionNode(e); + parent.children.push(child); // The next line seems to be unnecessary, as there are no children inside the section header itself. // So this code will always returns a flat list of section headers. diff --git a/core/src/main/resources/lib/form/select.jelly b/core/src/main/resources/lib/form/select.jelly index 8286e2e06a13..2f4ee0d836f5 100644 --- a/core/src/main/resources/lib/form/select.jelly +++ b/core/src/main/resources/lib/form/select.jelly @@ -63,14 +63,16 @@ THE SOFTWARE. ${descriptor.calcFillSettings(field,attrs)} - - - - - +
+ + + + + +
diff --git a/core/src/main/resources/lib/form/serverTcpPort.groovy b/core/src/main/resources/lib/form/serverTcpPort.groovy index 81c70ff3ee26..7840cde7f8f3 100644 --- a/core/src/main/resources/lib/form/serverTcpPort.groovy +++ b/core/src/main/resources/lib/form/serverTcpPort.groovy @@ -9,38 +9,19 @@ package lib.form * port number. The getter method should just expose the port number integer. */ +int port = instance ? instance[field] : 0 -int port = instance?instance[field]:0 - -def f=namespace(lib.FormTagLib) +def f = namespace(lib.FormTagLib) def type = "${field}.type" -def id = "${field}Id" // TODO: get rid of this -div(name:field) { - label { - f.radio(name: type, value:"fixed", - checked:port>0, onclick:"\$('${id}').disabled=false") - text(_("Fixed")) - text(" : ") +div(name: field) { + f.radio(name: type, value: "fixed", title: _("Fixed"), id: "radio-${field}-fixed", checked: port > 0) { + input(type: "number", class: "jenkins-input", name: "value", id: "${field}Id", placeholder: _("Port"), + value: port > 0 ? port : null, min: 0, max: 65535, step: 1) } - input(type:"number", "class":"number", name:"value", id:id, - value: port>0 ? port : null, disabled: port>0 ? null : "true", - min:0, max:65535, step:1) - - raw(" ") //////////////////////////// - label { - f.radio(name:type, value:"random", - checked:port==0, onclick:"\$('${id}').disabled=true") - text(_("Random")) - } + f.radio(name: type, value: "random", title: _("Random"), id: "radio-${field}-random", checked: port == 0) - raw(" ") //////////////////////////// - - label { - f.radio(name:type, value:"disable", - checked:port==-1, onclick:"\$('${id}').disabled=true") - text(_("Disable")) - } + f.radio(name: type, value: "disable", title: _("Disable"), id: "radio-${field}-disable", checked: port == -1) } diff --git a/core/src/main/resources/lib/form/slave-mode.jelly b/core/src/main/resources/lib/form/slave-mode.jelly index fef9425f082c..b338b4ef0c88 100644 --- a/core/src/main/resources/lib/form/slave-mode.jelly +++ b/core/src/main/resources/lib/form/slave-mode.jelly @@ -42,11 +42,13 @@ THE SOFTWARE. - +
+ +
diff --git a/core/src/main/resources/lib/form/textarea.jelly b/core/src/main/resources/lib/form/textarea.jelly index 0121f26baf84..64bae2e84e87 100644 --- a/core/src/main/resources/lib/form/textarea.jelly +++ b/core/src/main/resources/lib/form/textarea.jelly @@ -90,7 +90,7 @@ THE SOFTWARE.