Fixed multiple-digit indices in env browser

Fixed the "fullpath" regex in the env browser's javascript so that
variables with multiple-digit array indices are inserted into the input
box properly when their value is clicked.
This commit is contained in:
rxi 2014-04-18 12:35:41 +01:00
parent ae921e2033
commit 943c0c48df

View File

@ -255,7 +255,8 @@ end
updateDivContent("status", "disconnected ○");
});
}
setInterval(refreshOutput, <?lua echo(lovebird.updateinterval) ?> * 1000);
setInterval(refreshOutput,
<?lua echo(lovebird.updateinterval) ?> * 1000);
/* Environment variable view */
var envPath = "";
@ -291,7 +292,7 @@ end
k + "</a>";
}
var v = "<a href='#' onclick=\"insertVar('" +
fullpath.replace(/\.(-?[0-9])+/g, "[$1]") +
fullpath.replace(/\.(-?[0-9]+)/g, "[$1]") +
"');\">" + x.value + "</a>"
html += "<tr><td>" + k + "</td><td>" + v + "</td></tr>";
}