OLD | NEW |
---|---|
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <h1>Instant</h1> | 3 <h1>Instant</h1> |
4 <div id=log></div> | 4 <div id=log></div> |
5 <script> | 5 <script> |
6 window.chrome.sv = true; | 6 window.chrome.sv = true; |
7 | 7 |
8 window.onsubmitcalls = 0; | 8 window.onsubmitcalls = 0; |
9 window.onchangecalls = 0; | 9 window.onchangecalls = 0; |
10 window.oncancelcalls = 0; | 10 window.oncancelcalls = 0; |
11 window.onresizecalls = 0; | 11 window.onresizecalls = 0; |
12 | 12 |
13 var searchBox = window.chrome.searchBox || {}; | 13 var searchBox = window.chrome.searchBox || {}; |
14 | 14 |
15 window.beforeLoadSearchBox = {}; | 15 window.beforeLoadSearchBox = {}; |
16 for (var prop in searchBox) window.beforeLoadSearchBox[prop] = searchBox[prop]; | 16 for (var prop in searchBox) window.beforeLoadSearchBox[prop] = searchBox[prop]; |
17 | 17 |
18 window.setSuggestionsArgument = ["abcdef"]; | |
sky
2011/01/13 22:37:46
Doesn't this need to be map with suggestions: cont
tonyg
2011/01/13 23:07:50
An array of strings is the old format (which conti
| |
19 | |
18 window.chrome.searchBox.onsubmit = function() { | 20 window.chrome.searchBox.onsubmit = function() { |
19 searchBox.setSuggestions(["abcdef"]); | 21 searchBox.setSuggestions(setSuggestionsArgument); |
20 window.onsubmitcalls++; | 22 window.onsubmitcalls++; |
21 }; | 23 }; |
22 | 24 |
23 window.chrome.searchBox.onchange = function() { | 25 window.chrome.searchBox.onchange = function() { |
24 searchBox.setSuggestions(["abcdef"]); | 26 searchBox.setSuggestions(setSuggestionsArgument); |
25 window.onchangecalls++; | 27 window.onchangecalls++; |
26 }; | 28 }; |
27 | 29 |
28 window.chrome.searchBox.oncancel = function() { | 30 window.chrome.searchBox.oncancel = function() { |
29 searchBox.setSuggestions(["abcdef"]); | 31 searchBox.setSuggestions(setSuggestionsArgument); |
30 window.oncancelcalls++; | 32 window.oncancelcalls++; |
31 }; | 33 }; |
32 | 34 |
33 window.chrome.searchBox.onresize = function() { | 35 window.chrome.searchBox.onresize = function() { |
34 window.onresizecalls++; | 36 window.onresizecalls++; |
35 }; | 37 }; |
36 </script> | 38 </script> |
37 </body> | 39 </body> |
38 </html> | 40 </html> |
OLD | NEW |