2007-04-04 22:20:45 +04:00
|
|
|
function checkAll (id, checked) {
|
|
|
|
var el = document.getElementById(id);
|
|
|
|
for (var i = 0; i < el.elements.length; i++) {
|
|
|
|
if (el.elements[i].disabled==false) {
|
|
|
|
el.elements[i].checked = checked;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function addFileField() {
|
|
|
|
var f = document.createElement("input");
|
|
|
|
f.type = "file";
|
|
|
|
f.name = "attachments[]";
|
|
|
|
f.size = 30;
|
|
|
|
|
|
|
|
p = document.getElementById("attachments_p");
|
|
|
|
p.appendChild(document.createElement("br"));
|
|
|
|
p.appendChild(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
function showTab(name) {
|
|
|
|
var f = $$('div#content .tab-content');
|
|
|
|
for(var i=0; i<f.length; i++){
|
|
|
|
Element.hide(f[i]);
|
|
|
|
}
|
|
|
|
var f = $$('div.tabs a');
|
|
|
|
for(var i=0; i<f.length; i++){
|
|
|
|
Element.removeClassName(f[i], "selected");
|
|
|
|
}
|
|
|
|
Element.show('tab-content-' + name);
|
|
|
|
Element.addClassName('tab-' + name, "selected");
|
|
|
|
return false;
|
2007-04-27 23:32:57 +04:00
|
|
|
}
|
|
|
|
|
2007-05-05 17:22:27 +04:00
|
|
|
function setPredecessorFieldsVisibility() {
|
|
|
|
relationType = $('relation_relation_type');
|
|
|
|
if (relationType && relationType.value == "precedes") {
|
|
|
|
Element.show('predecessor_fields');
|
|
|
|
} else {
|
|
|
|
Element.hide('predecessor_fields');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-08-16 20:45:06 +04:00
|
|
|
function promptToRemote(text, param, url) {
|
|
|
|
value = prompt(text + ':');
|
|
|
|
if (value) {
|
|
|
|
new Ajax.Request(url + '?' + param + '=' + value, {asynchronous:true, evalScripts:true});
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-04-27 23:32:57 +04:00
|
|
|
/* shows and hides ajax indicator */
|
|
|
|
Ajax.Responders.register({
|
|
|
|
onCreate: function(){
|
|
|
|
if ($('ajax-indicator') && Ajax.activeRequestCount > 0) {
|
|
|
|
Element.show('ajax-indicator');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onComplete: function(){
|
|
|
|
if ($('ajax-indicator') && Ajax.activeRequestCount == 0) {
|
|
|
|
Element.hide('ajax-indicator');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|