| Function summary | |
| save_history(maxsize) | 現在のフォームの内容を履歴に残す。 履歴総数が maxsize を超えてしまう場合は、古い履歴を1つ削除する |
| make_history() | 現在のフォームの内容から履歴を作る |
| load_history() | historyフォームで指定された番号の履歴を読み込む |
make_history = function(){
return new Array(
document.prompt.target.selectedIndex,
document.prompt.state.selectedIndex,
document.prompt.hisukoha.checked,
document.prompt.floatflag.checked,
document.prompt.recipe.value,
document.prompt.result.value
);
} load_history = function(){
var i = document.history.histlist.selectedIndex;
var hist = History[i];
document.prompt.target.selectedIndex = hist[0];
document.prompt.state.selectedIndex = hist[1];
document.prompt.hisukoha.checked = hist[2];
document.prompt.floatflag.checked = hist[3];
document.prompt.recipe.value = hist[4];
document.prompt.result.value = hist[5];
document.history.histlist.selectedIndex = -1;
} save_history = function(maxsize){
var opts = document.history.histlist.options;
var hist = make_history();
var i = History.length;
if(i >= maxsize){
opts[0] = null;
for(i = 0; i < maxsize - 1; i++){
History[i] = History[i + 1];
}
}
History[i] = hist;
opts[i] = new Option(hist[5], hist[5]);
}