issue #0001264 : Add color

This commit is contained in:
Michael RICOIS 2012-08-28 20:02:29 +00:00
parent 86a661a500
commit 3c9fc9f7ea

View File

@ -1,6 +1,8 @@
<style>
.editable { background-color:#00B2EE; }
.editable-error { background-color:#00B2EE; }
span.unit select { width:50px; }
span.poste { color:black; background-color:#00B2EE; display:block; width:100%; }
span.poste { color:black; display:block; width:100%; }
span.poste input { width:50px; }
</style>
<?php $ancres = array_keys($this->partial()->view->ancres); ?>
@ -3024,21 +3026,41 @@ $('span.unit').editable(function(value, settings) {
});
$('span.dateCloture').editable(function(value, settings) {
return value;
if ( isInteger(value) && value.length==8 ) {
$(this).css('background-color','#00FF00');
return value;
} else {
$(this).onblur();
}
}, {
tooltip : 'Click to edit',
});
$('span.duree').editable(function(value, settings) {
return value;
if ( isInteger(value) && value.length<3 ) {
$(this).css('background-color','#00FF00');
return value;
} else {
$(this).onblur();
}
}, {
tooltip : 'Click to edit',
});
$('span.poste').editable(function(value, settings) {
return value;
if ( isInteger(value) ) {
$(this).css('background-color','#00FF00');
return value;
} else {
$(this).onblur();
}
}, {
tooltip : 'Click to edit',
});
function isInteger(number)
{
var exp = new RegExp("^[0-9]+$","g");
return exp.test(number);
}
</script>