Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: chrome/browser/resources/bookmark_manager/main.html

Issue 5530006: Bookmarks manager: Use onsearch and incremental instead of a timer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html i18n-values="dir:textdirection"> 2 <html i18n-values="dir:textdirection">
3 <!-- 3 <!--
4 4
5 Copyright (c) 2010 The Chromium Authors. All rights reserved. 5 Copyright (c) 2010 The Chromium Authors. All rights reserved.
6 Use of this source code is governed by a BSD-style license that can be 6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file. 7 found in the LICENSE file.
8 8
9 --> 9 -->
10 <head> 10 <head>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 <script src="js/bmm.js"></script> 48 <script src="js/bmm.js"></script>
49 <script src="js/bmm/bookmark_list.js"></script> 49 <script src="js/bmm/bookmark_list.js"></script>
50 <script src="js/bmm/bookmark_tree.js"></script> 50 <script src="js/bmm/bookmark_tree.js"></script>
51 </head> 51 </head>
52 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> 52 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
53 53
54 <div class="header"> 54 <div class="header">
55 <button class="logo" tabindex=3></button> 55 <button class="logo" tabindex=3></button>
56 <form onsubmit="setSearch(this.term.value); return false;" 56 <form onsubmit="setSearch(this.term.value); return false;"
57 class="form"> 57 class="form">
58 <input type="search" id="term" tabindex=1 autofocus 58 <input type="search" id="term" tabindex=1 autofocus incremental
59 i18n-values="placeholder:search_button"> 59 i18n-values="placeholder:search_button">
60 </form> 60 </form>
61 </div> 61 </div>
62 62
63 <div class="summary"> 63 <div class="summary">
64 <h3 i18n-content="title"></h3> 64 <h3 i18n-content="title"></h3>
65 <button menu="#organize-menu" tabindex="-1" i18n-content="organize_menu"></but ton> 65 <button menu="#organize-menu" tabindex="-1" i18n-content="organize_menu"></but ton>
66 </div> 66 </div>
67 67
68 <div class=main> 68 <div class=main>
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 if (e.button == 0) 323 if (e.button == 0)
324 $('open-in-same-window-command').execute(); 324 $('open-in-same-window-command').execute();
325 }); 325 });
326 326
327 // The list dispatches an event when the user clicks on the URL or the Show in 327 // The list dispatches an event when the user clicks on the URL or the Show in
328 // folder part. 328 // folder part.
329 list.addEventListener('urlClicked', function(e) { 329 list.addEventListener('urlClicked', function(e) {
330 getLinkController().openUrlFromEvent(e.url, e.originalEvent); 330 getLinkController().openUrlFromEvent(e.url, e.originalEvent);
331 }); 331 });
332 332
333 /** 333 $('term').onsearch = function(e) {
334 * Timer id used for delaying find-as-you-type 334 setSearch(this.value);
335 */
336 var inputDelayTimer;
337
338 // Capture input changes to the search term input element and delay searching
339 // for 250ms to reduce flicker.
340 $('term').oninput = function(e) {
341 clearTimeout(inputDelayTimer);
342 inputDelayTimer = setTimeout(function() {
343 setSearch($('term').value);
344 }, 250);
345 }; 335 };
346 336
347 /** 337 /**
348 * Navigates to the search results for the search text. 338 * Navigates to the search results for the search text.
349 * @para {string} searchText The text to search for. 339 * @para {string} searchText The text to search for.
350 */ 340 */
351 function setSearch(searchText) { 341 function setSearch(searchText) {
352 if (searchText) { 342 if (searchText) {
353 // Only update search item if we have a search term. We never want the 343 // Only update search item if we have a search term. We never want the
354 // search item to be for an empty search. 344 // search item to be for an empty search.
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1720 // Paste is a bit special since we need to do an async call to see if we can 1710 // Paste is a bit special since we need to do an async call to see if we can
1721 // paste because the paste command might not be up to date. 1711 // paste because the paste command might not be up to date.
1722 updatePasteCommand(pasteHandler); 1712 updatePasteCommand(pasteHandler);
1723 }); 1713 });
1724 })(); 1714 })();
1725 1715
1726 </script> 1716 </script>
1727 1717
1728 </body> 1718 </body>
1729 </html> 1719 </html>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698