diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 1a9ae1d5b0..7ecc6e6006 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -35,6 +35,9 @@ import hudson.util.Area; import hudson.util.Iterators; import org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken; import org.apache.commons.jelly.JellyContext; +import org.apache.commons.jelly.JellyTagException; +import org.apache.commons.jelly.Script; +import org.apache.commons.jelly.XMLOutput; import org.apache.commons.jexl.parser.ASTSizeFunction; import org.apache.commons.jexl.util.Introspector; import org.kohsuke.stapler.Ancestor; @@ -871,6 +874,17 @@ public class Functions { return context; } + /** + * Evaluate a Jelly script and return output as a String. + * + * @since 1.267 + */ + public static String runScript(Script script) throws JellyTagException { + StringWriter out = new StringWriter(); + script.run(getCurrentJellyContext(), XMLOutput.createXMLOutput(out)); + return out.toString(); + } + /** * Returns a sub-list if the given list is bigger than the specified 'maxSize' */ diff --git a/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly b/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly index 746abd7eba..fed47fd21c 100644 --- a/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly +++ b/core/src/main/resources/hudson/widgets/HistoryWidget/index.jelly @@ -1,7 +1,10 @@ - + +
(${%trend})
+ +
+ @@ -58,4 +61,4 @@ -
\ No newline at end of file + diff --git a/core/src/main/resources/lib/hudson/buildHealth.jelly b/core/src/main/resources/lib/hudson/buildHealth.jelly new file mode 100644 index 0000000000..4ef3084c01 --- /dev/null +++ b/core/src/main/resources/lib/hudson/buildHealth.jelly @@ -0,0 +1,47 @@ + + + + + + ${buildHealth.score} + healthReport + this.className='healthReport hover';return true; + + this.className='healthReport';return true; + + ${buildHealth.score}% + + + +
+ + + + + + + + + + + + + + + + + +
W${%Description}%
+ + ${rpt.localizableDescription}${rpt.score}
+
+
+
+
diff --git a/core/src/main/resources/lib/hudson/projectView.jelly b/core/src/main/resources/lib/hudson/projectView.jelly index 5ec1dbb6ed..2c8e783d98 100644 --- a/core/src/main/resources/lib/hudson/projectView.jelly +++ b/core/src/main/resources/lib/hudson/projectView.jelly @@ -40,47 +40,9 @@ - - - - healthReport - this.className='healthReport hover';return true; - - this.className='healthReport';return true; - - ${buildHealth.score}% - - - -
- - - - - - - - - - - - - - - - - -
W${%Description}%
- - ${rpt.localizableDescription}${rpt.score}
-
-
-
- + ${job.displayName} @@ -139,4 +101,4 @@ - \ No newline at end of file + diff --git a/war/resources/css/style.css b/war/resources/css/style.css index 7af639fe43..c898003110 100644 --- a/war/resources/css/style.css +++ b/war/resources/css/style.css @@ -459,31 +459,38 @@ th.pane { /* ============================ health report hover ========================== */ -a.healthReport { +.healthReport a { text-decoration: none; } -div.healthReport div.healthReportDetails { +.healthReport div.healthReportDetails { display: none; } -div.healthReport:hover, div.healthReport.hover { /* fix IE6 bug with :hover */ +.healthReport:hover, .healthReport.hover { /* fix IE6 bug with :hover */ background: transparent; } -div.healthReport:hover div.healthReportDetails, div.healthReport.hover div.healthReportDetails { +.healthReport:hover div.healthReportDetails, .healthReport.hover div.healthReportDetails { display: block; position: absolute; background-color: #ffe; border: 1px solid #bbb; margin-left: 32px; /* move it across a bit */ + z-index: 26; } -div.healthReport div.healthReportDetails table { +.healthReport div.healthReportDetails table { border-collapse: collapse; width: 450px; /* fix IE bug with width */ } +/* ========================= build history ========================= */ +#buildHistory .healthReport { + display: inline; + margin-right: 1em; +} + /* ========================= editable combobox style ========================= */ .comboBoxList { border: 1px solid #000;