| 38 | | // save to cookie |
| | 38 | Event.stop(event); |
| | 39 | save_all_cookies(); |
| | 40 | window.location.reload(); |
| | 41 | } |
| | 42 | |
| | 43 | function clear_terminal_info(event) { |
| | 44 | Event.stop(event); |
| | 45 | clear_all_cookies(); |
| | 46 | window.location.reload(); |
| | 47 | } |
| | 48 | |
| | 49 | function save_suggest_terminai_info(event) { |
| | 50 | var manager = new CookieManager(); |
| | 51 | var val = SSB.ktai_db[$("term_search").value]; |
| | 52 | if(val) { |
| | 53 | $('field_useragent').value = val['useragent']; |
| | 54 | save_all_cookies(); |
| | 55 | window.location.reload(); |
| | 56 | } else { |
| | 57 | $('term_search').value = ''; |
| | 58 | } |
| | 59 | Event.stop(event); |
| | 60 | } |
| | 61 | |
| | 62 | function save_all_cookies() { |
| 53 | | var val = SSB.ktai_db[$("term_search").value]; |
| 54 | | if(val) { |
| 55 | | manager.setCookie('useragent', encodeURIComponent(val['useragent'])); |
| 56 | | window.location.reload(); |
| 57 | | } else { |
| 58 | | $("term_search").value = ''; |
| 59 | | } |
| 60 | | Event.stop(event); |
| | 75 | keys = ['homepage', 'mailaddr', 'useragent', |
| | 76 | 'uid', 'hid', 'icc', 'exheader']; |
| | 77 | keys.each(function(key) { |
| | 78 | manager.clearCookie(key); |
| | 79 | }); |
| | 80 | manager.clearCookie('pane'); |
| 113 | | Event.observe($('suggest_start'), 'click', function(event) { |
| 114 | | $('suggest_start').toggle(); |
| 115 | | $('suggest_form').innerHTML = '機種名: <input type="text" id="term_search" autocomplete="off" /><input type="submit" value="OK" />'; |
| 116 | | $('term_search').focus(); |
| 117 | | Event.observe($('suggest_form'), 'submit', save_suggest_terminai_info, true); |
| 118 | | new Suggest.Local('term_search', |
| 119 | | 'term_select', |
| 120 | | SSB.ktai_list, |
| 121 | | { |
| 122 | | highlight: true, |
| 123 | | dispAllKey: true, |
| 124 | | dispMax: 3 |
| 125 | | }); |
| 126 | | Event.stop(event); |
| 127 | | }, true); |
| 128 | | |
| | 134 | Event.observe($('suggest_start'), 'click', function(event) { |
| | 135 | $('suggest_start').toggle(); |
| | 136 | $('suggest_form').innerHTML = '機種名: <input type="text" id="term_search" autocomplete="off" /><input type="submit" value="OK" />'; |
| | 137 | $('term_search').focus(); |
| | 138 | Event.observe($('suggest_form'), 'submit', save_suggest_terminai_info, true); |
| | 139 | new Suggest.Local('term_search', |
| | 140 | 'term_select', |
| | 141 | SSB.ktai_list, |
| | 142 | { |
| | 143 | highlight: true, |
| | 144 | dispAllKey: true, |
| | 145 | dispMax: 3 |
| | 146 | }); |
| | 147 | Event.stop(event); |
| | 148 | }, true); |
| | 149 | |