changeset 12:774db3b4bedc

Add some informational output.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 10 Jan 2011 08:12:23 +0200
parents fb503ee5489f
children 1edbabcbcdbd
files index.php
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/index.php	Mon Jan 10 07:44:13 2011 +0200
+++ b/index.php	Mon Jan 10 08:12:23 2011 +0200
@@ -9,7 +9,11 @@
   "(purple|green) gloves" => 'a ${1} glove',
   "heavy black metal rings" => "a heavy black metal ring",
   "bracelet mades of green crystal" => "bracelet made of green crystal",
+  "alchemist moulded rings" => "alchemist moulded ring",
+  
   "white cloth packs for holding salves" => "white cloth pack for holding salves",
+  "(small|HUGE) shiny boxes for storing minerals" => 'a ${1} shiny box for storing minerals',
+  "(small|HUGE) sturdy packs for storing potions" => 'a ${1} sturdy pack for storing potions',
 );
 
 
@@ -253,17 +257,19 @@
      <tr>
       <td><input type="button" value=" Delete " onclick="deleteItems(this.form);" /></td>
       <td><input type="button" value=" Add new " onclick="addItems(this.form);" disabled="disabled" /></td>
+      <td><b><span id="curr_nitems"></span> items</b></td>
       <td style="width: 60%; text-align: right;"><input id="move_button" type="button" value=" Move to container " onclick="moveItems(this.form);" /></td>
      </tr>
     </table>
    </td>
 
    <td id="container_editor">
-    <h2>Editing container "<span id="curr_name"></span>" - <span id="curr_info"></span></h2>
+    <h2>Editing container "<span id="curr_name"></span>"</h2>
     <? printOptionSelect("curr_container", 10, TRUE); ?>
     <table class="buttons">
      <tr>
       <td><input type="button" value=" Remove selected " onclick="containerRemoveItems(this.form);" /></td>
+      <td><b><span id="curr_info"></span> items</b></td>
      </tr>
     </table>
    </td>
@@ -431,6 +437,7 @@
   initAll();
 }
 
+
 function setHTML(id, str)
 {
   var o = document.getElementById(id);
@@ -438,6 +445,7 @@
     o.innerHTML = str;
 }
 
+
 function setListData(id, list)
 {
   var o = document.getElementById(id);
@@ -447,6 +455,7 @@
   }
 }
 
+
 // Update the form data
 function updatePage()
 {
@@ -454,6 +463,7 @@
   if (list_items != null && list_items.changed) {
     list_items.changed = false;
     setListData("curr_items", list_items.items);
+    setHTML("curr_nitems", list_items.items.length);
   }
 
   // List of containers
@@ -477,7 +487,7 @@
     container_editor.style.display = "block";
     setHTML("curr_name", curr_container.name);
 
-    setHTML("curr_info", "(" + curr_container.items.length+" / "+curr_container.slots+" items)");
+    setHTML("curr_info", curr_container.items.length+" / "+curr_container.slots);
 
     if (curr_container.changed) {
       curr_container.changed = false;