mirror of https://github.com/jenkinsci/jenkins.git
turns out '^' is a bit-wise XOR
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@8349 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
parent
eb9f0b4f2b
commit
d6a660040e
|
|
@ -455,6 +455,12 @@ function applyTooltip(e,text) {
|
||||||
Behaviour.register(hudsonRules);
|
Behaviour.register(hudsonRules);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function xor(a,b) {
|
||||||
|
// convert both values to boolean by '!' and then do a!=b
|
||||||
|
return !a != !b;
|
||||||
|
}
|
||||||
|
|
||||||
// used by editableDescription.jelly to replace the description field with a form
|
// used by editableDescription.jelly to replace the description field with a form
|
||||||
function replaceDescription() {
|
function replaceDescription() {
|
||||||
var d = document.getElementById("description");
|
var d = document.getElementById("description");
|
||||||
|
|
@ -496,7 +502,7 @@ function updateOptionalBlock(c,scroll) {
|
||||||
var i = false;
|
var i = false;
|
||||||
var o = false;
|
var o = false;
|
||||||
|
|
||||||
var checked = c.checked^Element.hasClassName(c,"negative");
|
var checked = xor(c.checked,Element.hasClassName(c,"negative"));
|
||||||
var lastRow = null;
|
var lastRow = null;
|
||||||
|
|
||||||
for (var j = 0; tbl.rows[j]; j++) {
|
for (var j = 0; tbl.rows[j]; j++) {
|
||||||
|
|
@ -1043,7 +1049,7 @@ function buildFormTree(form) {
|
||||||
|
|
||||||
var name = e.getAttribute("name");
|
var name = e.getAttribute("name");
|
||||||
if(name!=null) {
|
if(name!=null) {
|
||||||
if(e.tagName=="INPUT" && !(e.checked^Element.hasClassName(e,"negative")))
|
if(e.tagName=="INPUT" && !xor(e.checked,Element.hasClassName(e,"negative")))
|
||||||
return {}; // field is not active
|
return {}; // field is not active
|
||||||
|
|
||||||
var m = e.formDom;
|
var m = e.formDom;
|
||||||
|
|
@ -1090,7 +1096,7 @@ function buildFormTree(form) {
|
||||||
break;
|
break;
|
||||||
case "checkbox":
|
case "checkbox":
|
||||||
p = findParent(e);
|
p = findParent(e);
|
||||||
var checked = e.checked ^ Element.hasClassName(e,"negative");
|
var checked = xor(e.checked,Element.hasClassName(e,"negative"));
|
||||||
if(!e.groupingNode)
|
if(!e.groupingNode)
|
||||||
addProperty(p, e.name, checked);
|
addProperty(p, e.name, checked);
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue