Aber niemand weiß, was du verwendest. </faq/#Q-07c>
okay...
Hier der Quellcode:
function armies_add_new_target ()
{
var last_id = armies_next_target_id - 1;
var next_id = armies_next_target_id++;
var new_target_row = document.getElementById("target_" + last_id + "_").cloneNode(true);
var new_action_row = document.getElementById("action_" + last_id + "_").cloneNode(true);
var new_target_row = armies_change_ids(next_id, new_target_row);
var new_action_row = armies_change_overlay(new_action_row);
var new_action_row = armies_change_ids(next_id, new_action_row);
document.getElementById("target_table").appendChild(new_target_row);
document.getElementById("target_table").appendChild(new_action_row);
document.getElementById("row_id_" + next_id + "_").firstChild.nodeValue = next_id;
overlay_init();
overlay_toggleALL(false);
}
Hier noch die anderen Funktionen:
function armies_change_ids (next_id, current_node)
{
for (var i = 0; i < current_node.childNodes.length; i++) {
current_node.replaceChild(armies_change_ids(next_id, current_node.childNodes[i]), current_node.childNodes[i]);
}
if (typeof(current_node.data) == "string")
{
return current_node;
}
if (current_node.getAttribute("id")) {
current_id = current_node.getAttribute("id");
if (current_id.search(/overlay_.+/) == -1) {
current_node.id = current_id.replace(/_\d*_/, "_" + next_id + "_");
}
}
if (current_node.getAttribute("name")) {
current_name = current_node.getAttribute("name");
if (current_name.search(/overlay_.+/) == -1) {
current_node.name = current_name.replace(/\[\d*\]/, "[" + next_id + "]");
}
}
return current_node;
}
armies_change_overlay_id = -1;
function armies_change_overlay (current_node)
{
if (armies_change_overlay_id == -1) {
for (var i = 0; test = document.getElementById("overlay_" + i + "_area"); i++) {}
armies_change_overlay_id = i;
}
if (typeof(current_node.data) == "string")
{
return current_node;
}
var flag = false;
if (current_node.getAttribute("id")) {
if (current_node.id.search("overlay_js_stop") != -1) {
var flag = true;
}
}
if (!flag) {
for (var i = 0; i < current_node.childNodes.length; i++) {
current_node.replaceChild(armies_change_overlay(current_node.childNodes[i]),current_node.childNodes[i]);
}
}
if (current_node.getAttribute("id")) {
current_node.id = current_node.getAttribute("id").replace(/_\d*_/, "_" + armies_change_overlay_id + "_");
if (current_id.search(/overlay_\d*_area/) != -1) {
armies_change_overlay_id++;
}
}
if (current_node.getAttribute("name")) {
current_node.name = current_node.getAttribute("name").replace(/_\d*_/, "_" + armies_change_overlay_id + "_");
}
if (current_node.getAttribute("href")) {
if (current_node.getAttribute("href").search("localhost") == -1)
{
current_node.href = current_node.getAttribute("href").replace(/\(\d*\)/, "(" + armies_change_overlay_id + ")");
}
}
return current_node;
}
So ich hoffe ihr könnt mir nun helfen :-/