Mercurial > hg > batmud > chester
changeset 19:4add67f75075
Moar info.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 10 Jan 2011 12:36:22 +0200 |
parents | 716329d47372 |
children | 5208a2a2668d |
files | index.php |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/index.php Mon Jan 10 11:30:49 2011 +0200 +++ b/index.php Mon Jan 10 12:36:22 2011 +0200 @@ -301,6 +301,7 @@ <tr> <td><input type="button" value=" Switch to " onclick="containerEdit(this.form);" /></td> <td><input type="button" value=" Delete " onclick="containerDelete(this.form);" /></td> + <td><b><span id="containers_info"></span> items total</b></td> </tr> </table> </td> @@ -515,9 +516,14 @@ o = document.getElementById("container_list"); o.options.length = 0; + var total_items = 0; + var total_slots = 0; for (var i = 0; i < list_containers.length; i++) { o.options[i] = new Option(list_containers[i].name +" (" + list_containers[i].items.length +" of "+ list_containers[i].slots +" items)", i, false); + total_items += list_containers[i].items.length; + total_slots += list_containers[i].slots; } + setHTML("containers_info", total_items+" / "+total_slots); } else { container_list_editor.style.display = "none"; } @@ -528,7 +534,6 @@ if (curr_container != null) { container_editor.style.display = "block"; setHTML("curr_name", curr_container.name); - setHTML("curr_info", curr_container.items.length+" / "+curr_container.slots); if (curr_container.changed) {