aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakozak2011-11-23 10:06:08 (EST)
committerWinston Prakash2011-12-01 20:47:13 (EST)
commit411168d5dc7e39a3e9a3692a019a83e2bc9ed531 (patch)
tree50fbbbda60ac1c2e9b29fefba24dd73e0781ec38
parent01ad111e4cf1d27362c9f3e793f388dbe0be2a99 (diff)
downloadorg.eclipse.hudson.core-411168d5dc7e39a3e9a3692a019a83e2bc9ed531.zip
org.eclipse.hudson.core-411168d5dc7e39a3e9a3692a019a83e2bc9ed531.tar.gz
org.eclipse.hudson.core-411168d5dc7e39a3e9a3692a019a83e2bc9ed531.tar.bz2
Avoid caching of css and js custom resources. Add hudson version to css and js refs, a few fixes
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
-rw-r--r--hudson-core/src/main/java/hudson/matrix/MatrixProject.java7
-rw-r--r--hudson-core/src/main/resources/lib/layout/layout.jelly6
-rw-r--r--hudson-war/src/main/webapp/scripts/hudson-behavior.js35
3 files changed, 31 insertions, 17 deletions
diff --git a/hudson-core/src/main/java/hudson/matrix/MatrixProject.java b/hudson-core/src/main/java/hudson/matrix/MatrixProject.java
index 47b66cb..32271f5 100644
--- a/hudson-core/src/main/java/hudson/matrix/MatrixProject.java
+++ b/hudson-core/src/main/java/hudson/matrix/MatrixProject.java
@@ -196,7 +196,12 @@ public class MatrixProject extends BaseBuildableProject<MatrixProject, MatrixBui
* @inheritDoc
*/
public void setRunSequentially(boolean runSequentially) throws IOException {
- setProjectPropertyValue(RUN_SEQUENTIALLY_PROPERTY_NAME, BooleanProjectProperty.class, runSequentially, true);
+ setRunSequentially(runSequentially, true);
+ }
+
+ protected void setRunSequentially(boolean runSequentially, boolean forceModify) throws IOException {
+ setProjectPropertyValue(RUN_SEQUENTIALLY_PROPERTY_NAME, BooleanProjectProperty.class, runSequentially,
+ forceModify);
save();
}
diff --git a/hudson-core/src/main/resources/lib/layout/layout.jelly b/hudson-core/src/main/resources/lib/layout/layout.jelly
index 6c98df7..0f17720 100644
--- a/hudson-core/src/main/resources/lib/layout/layout.jelly
+++ b/hudson-core/src/main/resources/lib/layout/layout.jelly
@@ -65,7 +65,7 @@
${h.checkPermission(it,permission)}
<title>${h.appendIfNotNull(title, ' [Hudson]', 'Hudson')}</title>
- <link rel="stylesheet" href="${resURL}/css/style.css" type="text/css" />
+ <link rel="stylesheet" href="${resURL}/css/style.css?${h.version}" type="text/css" />
<link rel="stylesheet" href="${resURL}/css/color.css" type="text/css" />
<j:if test="${attrs.css!=null}">
<link rel="stylesheet" href="${rootURL}${attrs.css}" type="text/css" />
@@ -103,8 +103,8 @@
<l:yui module="button" />
<!--l:yui module="editor" suffix="-beta" /-->
- <script src="${resURL}/scripts/hudson-behavior.js" type="text/javascript"></script>
- <script src="${resURL}/scripts/cascading.js" type="text/javascript"></script>
+ <script src="${resURL}/scripts/hudson-behavior.js?${h.version}" type="text/javascript"></script>
+ <script src="${resURL}/scripts/cascading.js?${h.version}" type="text/javascript"></script>
<script>
crumb.init("${h.getCrumbRequestField()}", "${h.getCrumb(request)}");
</script>
diff --git a/hudson-war/src/main/webapp/scripts/hudson-behavior.js b/hudson-war/src/main/webapp/scripts/hudson-behavior.js
index 1bbc9ec..e052b46 100644
--- a/hudson-war/src/main/webapp/scripts/hudson-behavior.js
+++ b/hudson-war/src/main/webapp/scripts/hudson-behavior.js
@@ -242,7 +242,7 @@ function findFollowingTR(input, className) {
// then next TR that matches the CSS
do {
tr = tr.nextSibling;
- } while (tr != null && (tr.tagName != "TR" || tr.className != className));
+ } while (tr != null && (tr.tagName != "TR" || !Element.hasClassName(tr,className)));
return tr;
}
@@ -524,8 +524,12 @@ var hudsonRules = {
var nameRef = tr.getAttribute("nameref");
while (container.lastChild != null) {
var row = container.lastChild;
- if(nameRef!=null && row.getAttribute("nameref")==null)
+ if(nameRef!=null && row.getAttribute("nameref")==null){
row.setAttribute("nameref",nameRef); // to handle inner rowSets, don't override existing values
+ }
+ if(Element.hasClassName(link,"modified")){
+ Element.addClassName(row,"modified");
+ }
tr.parentNode.insertBefore(row, tr.nextSibling);
}
});
@@ -592,7 +596,7 @@ var hudsonRules = {
registerRegexpValidator(e,/^(\d*[1-9]\d*|)$/,"Not a positive number");
},
- "INPUT.auto-complete": function(e) {// form field with auto-completion support
+ "INPUT.auto-complete": function(e) {// form field with auto-completion support
// insert the auto-completion container
var div = document.createElement("DIV");
e.parentNode.insertBefore(div,e.nextSibling);
@@ -600,7 +604,7 @@ var hudsonRules = {
var ds = new YAHOO.widget.DS_XHR(e.getAttribute("autoCompleteUrl"),["suggestions","name"]);
ds.scriptQueryParam = "value";
-
+
// Instantiate the AutoComplete
var ac = new YAHOO.widget.AutoComplete(e, div, ds);
ac.prehighlightClassName = "yui-ac-prehighlight";
@@ -698,7 +702,7 @@ var hudsonRules = {
}
var handle = textarea.nextSibling;
- if(handle==null || handle.className!="textarea-handle") return;
+ if(handle==null || !Element.hasClassName(handle, "textarea-handle")) return;
var Event = YAHOO.util.Event;
@@ -877,6 +881,11 @@ var hudsonRules = {
g.updateSingleButton(r,s,e);
};
applyNameRef(s,e,r.id);
+ if (Element.hasClassName(r.parentNode,'modified')){
+ jQuery('[nameref='+ r.id +']').children().addClass('modified');
+ //required for the advanced sections (hudson generates content inside div).
+ jQuery('[nameref='+ r.id +'] div.advancedLink').addClass('modified');
+ }
g.buttons.push(u);
// apply the initial visibility
@@ -908,7 +917,7 @@ var hudsonRules = {
e.subForms = [];
var start = findFollowingTR(e, 'dropdownList-container').firstChild.nextSibling, end;
do { start = start.firstChild; } while (start && start.tagName != 'TR');
- if (start && start.className != 'dropdownList-start')
+ if (start && !Element.hasClassName(start,'dropdownList-start'))
start = findFollowingTR(start, 'dropdownList-start');
while (start != null) {
end = findFollowingTR(start, 'dropdownList-end');
@@ -955,7 +964,7 @@ var hudsonRules = {
candidates.push(items[i]);
if (candidates.length>20) break;
}
- }
+ }
return candidates;
}, {});
@@ -1118,7 +1127,7 @@ function updateOptionalBlock(c,scroll) {
}
if (c.name == 'hudson-tools-InstallSourceProperty') {
- // Work around to hide tool home when "Install automatically" is checked.
+ // Hack to hide tool home when "Install automatically" is checked.
var homeField = findPreviousFormItem(c, 'home');
if (homeField != null && homeField.value == '') {
var tr = findAncestor(homeField, 'TR');
@@ -1393,12 +1402,12 @@ var repeatableSupport = {
// noop
} else
if(children.length==1) {
- children[0].className = "repeated-chunk first last only";
+ children[0].addClassName("repeated-chunk first last only");
} else {
- children[0].className = "repeated-chunk first";
+ children[0].addClassName("repeated-chunk first");
for(var i=1; i<children.length-1; i++)
- children[i].className = "repeated-chunk middle";
- children[children.length-1].className = "repeated-chunk last";
+ children[i].addClassName("repeated-chunk middle");
+ children[children.length-1].addClassName("repeated-chunk last");
}
},
@@ -1419,7 +1428,7 @@ var repeatableSupport = {
while(n.tag==null)
n = n.parentNode;
n.tag.expand();
- // Work around to hide tool home when a new tool has some installers.
+ // Hack to hide tool home when a new tool has some installers.
var inputs = n.getElementsByTagName('INPUT');
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];