1 var max_history_length
= 1000;
3 function jq_load_history(jq
) {
4 if (localStorage
['mal_history']) {
5 var lines
= JSON
.parse(localStorage
['mal_history']);
6 if (lines
.length
> max_history_length
) {
7 lines
= lines
.slice(lines
.length
-max_history_length
);
13 function jq_save_history(jq
) {
14 var lines
= jq
.GetHistory();
15 localStorage
['mal_history'] = JSON
.stringify(lines
);
20 'readline': function(prompt_str
) {
21 return prompt(prompt_str
);