OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
6 <include src="history_focus_manager.js"> | 6 <include src="history_focus_manager.js"> |
7 | 7 |
8 /////////////////////////////////////////////////////////////////////////////// | 8 /////////////////////////////////////////////////////////////////////////////// |
9 // Globals: | 9 // Globals: |
10 /** @const */ var RESULTS_PER_PAGE = 150; | 10 /** @const */ var RESULTS_PER_PAGE = 150; |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1791 */ | 1791 */ |
1792 PageState.instance = null; | 1792 PageState.instance = null; |
1793 | 1793 |
1794 /** | 1794 /** |
1795 * @return {Object} An object containing parameters from our window hash. | 1795 * @return {Object} An object containing parameters from our window hash. |
1796 */ | 1796 */ |
1797 PageState.prototype.getHashData = function() { | 1797 PageState.prototype.getHashData = function() { |
1798 var result = { | 1798 var result = { |
1799 q: '', | 1799 q: '', |
1800 page: 0, | 1800 page: 0, |
1801 grouped: false, | 1801 grouped: false, |
Evan Stade
2014/08/04 21:16:23
can we get rid of this as well then?
Dan Beam
2014/08/04 21:34:29
Done.
| |
1802 range: 0, | 1802 range: 0, |
1803 offset: 0 | 1803 offset: 0 |
1804 }; | 1804 }; |
1805 | 1805 |
1806 if (!window.location.hash) | 1806 if (!window.location.hash) |
1807 return result; | 1807 return result; |
1808 | 1808 |
1809 var hashSplit = window.location.hash.substr(1).split('&'); | 1809 var hashSplit = window.location.hash.substr(1).split('&'); |
1810 for (var i = 0; i < hashSplit.length; i++) { | 1810 for (var i = 0; i < hashSplit.length; i++) { |
1811 var pair = hashSplit[i].split('='); | 1811 var pair = hashSplit[i].split('='); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1872 uber.onContentFrameLoaded(); | 1872 uber.onContentFrameLoaded(); |
1873 | 1873 |
1874 var searchField = $('search-field'); | 1874 var searchField = $('search-field'); |
1875 | 1875 |
1876 historyModel = new HistoryModel(); | 1876 historyModel = new HistoryModel(); |
1877 historyView = new HistoryView(historyModel); | 1877 historyView = new HistoryView(historyModel); |
1878 pageState = new PageState(historyModel, historyView); | 1878 pageState = new PageState(historyModel, historyView); |
1879 | 1879 |
1880 // Create default view. | 1880 // Create default view. |
1881 var hashData = pageState.getHashData(); | 1881 var hashData = pageState.getHashData(); |
1882 var grouped = (hashData.grouped == 'true') || historyModel.getGroupByDomain(); | |
1883 var page = parseInt(hashData.page, 10) || historyView.getPage(); | 1882 var page = parseInt(hashData.page, 10) || historyView.getPage(); |
1884 var range = parseInt(hashData.range, 10) || historyView.getRangeInDays(); | 1883 var range = parseInt(hashData.range, 10) || historyView.getRangeInDays(); |
1885 var offset = parseInt(hashData.offset, 10) || historyView.getOffset(); | 1884 var offset = parseInt(hashData.offset, 10) || historyView.getOffset(); |
1886 historyView.setPageState(hashData.q, page, range, offset); | 1885 historyView.setPageState(hashData.q, page, range, offset); |
1887 | 1886 |
1888 if ($('overlay')) { | 1887 if ($('overlay')) { |
1889 cr.ui.overlay.setupOverlay($('overlay')); | 1888 cr.ui.overlay.setupOverlay($('overlay')); |
1890 cr.ui.overlay.globalInitialization(); | 1889 cr.ui.overlay.globalInitialization(); |
1891 } | 1890 } |
1892 HistoryFocusManager.getInstance().initialize(); | 1891 HistoryFocusManager.getInstance().initialize(); |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2330 historyView.reload(); | 2329 historyView.reload(); |
2331 } | 2330 } |
2332 | 2331 |
2333 // Add handlers to HTML elements. | 2332 // Add handlers to HTML elements. |
2334 document.addEventListener('DOMContentLoaded', load); | 2333 document.addEventListener('DOMContentLoaded', load); |
2335 | 2334 |
2336 // This event lets us enable and disable menu items before the menu is shown. | 2335 // This event lets us enable and disable menu items before the menu is shown. |
2337 document.addEventListener('canExecute', function(e) { | 2336 document.addEventListener('canExecute', function(e) { |
2338 e.canExecute = true; | 2337 e.canExecute = true; |
2339 }); | 2338 }); |
OLD | NEW |