Mercurial > hg > batmud > chester
comparison index.php @ 10:e2f975b0c518
Fix reset functionality. Add startup message.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 10 Jan 2011 07:35:15 +0200 |
parents | da404b8ff282 |
children | fb503ee5489f |
comparison
equal
deleted
inserted
replaced
9:da404b8ff282 | 10:e2f975b0c518 |
---|---|
409 function initAll() | 409 function initAll() |
410 { | 410 { |
411 list_containers = [".$str."]; | 411 list_containers = [".$str."]; |
412 list_items = ".(isset($data["items"]) ? getContainerObject("items", 10000, $data["items"]) : "null")."; | 412 list_items = ".(isset($data["items"]) ? getContainerObject("items", 10000, $data["items"]) : "null")."; |
413 ".$jsData." | 413 ".$jsData." |
414 curr_container = null; | |
414 updatePage(); | 415 updatePage(); |
416 statusMsg('Welcome to the editor. <b>(c) Copyright 2011 Matti Hämäläinen aka Ggr Pupunen.</b>'); | |
415 } | 417 } |
416 "; | 418 "; |
417 ?> | 419 ?> |
418 <!-- kludge --><!-- | 420 <!-- kludge --><!-- |
419 | 421 |
423 var answer = confirm("Really delete all defined containers and reset item pool to original state?"); | 425 var answer = confirm("Really delete all defined containers and reset item pool to original state?"); |
424 if (!answer) { | 426 if (!answer) { |
425 statusMsg("Reset operation cancelled."); | 427 statusMsg("Reset operation cancelled."); |
426 return; | 428 return; |
427 } | 429 } |
430 initAll(); | |
428 } | 431 } |
429 | 432 |
430 function setHTML(id, str) | 433 function setHTML(id, str) |
431 { | 434 { |
432 var o = document.getElementById(id); | 435 var o = document.getElementById(id); |
549 | 552 |
550 | 553 |
551 // Change current container | 554 // Change current container |
552 function containerChange(f) | 555 function containerChange(f) |
553 { | 556 { |
557 if (curr_container == null) { | |
558 statusMsg("No current container, create or select one."); | |
559 return; | |
560 } | |
561 | |
554 var c = validateContainerData(f); | 562 var c = validateContainerData(f); |
555 if (c == null) | 563 if (c == null) |
556 return; | 564 return; |
557 | 565 |
558 if (c.slots < curr_container.items.length) { | 566 if (c.slots < curr_container.items.length) { |