| OLD | NEW |
| 1 | 1 |
| 2 // Helpers | 2 // Helpers |
| 3 | 3 |
| 4 function $(id) { | 4 function $(id) { |
| 5 return document.getElementById(id); | 5 return document.getElementById(id); |
| 6 } | 6 } |
| 7 | 7 |
| 8 // TODO(arv): Remove these when classList is available in HTML5. | 8 // TODO(arv): Remove these when classList is available in HTML5. |
| 9 // https://bugs.webkit.org/show_bug.cgi?id=20709 | 9 // https://bugs.webkit.org/show_bug.cgi?id=20709 |
| 10 function hasClass(el, name) { | 10 function hasClass(el, name) { |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 } | 553 } |
| 554 | 554 |
| 555 /** | 555 /** |
| 556 * Returns the text used for a recently closed window. | 556 * Returns the text used for a recently closed window. |
| 557 * @param {number} numTabs Number of tabs in the window. | 557 * @param {number} numTabs Number of tabs in the window. |
| 558 * @return {string} The text to use. | 558 * @return {string} The text to use. |
| 559 */ | 559 */ |
| 560 function formatTabsText(numTabs) { | 560 function formatTabsText(numTabs) { |
| 561 if (numTabs == 1) | 561 if (numTabs == 1) |
| 562 return localStrings.getString('closedwindowsingle'); | 562 return localStrings.getString('closedwindowsingle'); |
| 563 // TODO(arv): Update grd file to use %s so we can use formatString | 563 return localStrings.formatString('closedwindowmultiple', numTabs); |
| 564 // http://crbug.com/14878 | |
| 565 // return localStrings.formatString('closedwindowmultiple', numTabs); | |
| 566 return localStrings.getString('closedwindowmultiple').replace(/%/, numTabs); | |
| 567 } | 564 } |
| 568 | 565 |
| 569 /** | 566 /** |
| 570 * We need both most visited and the shown sections to be considered loaded. | 567 * We need both most visited and the shown sections to be considered loaded. |
| 571 * @return {boolean} | 568 * @return {boolean} |
| 572 */ | 569 */ |
| 573 function onDataLoaded() { | 570 function onDataLoaded() { |
| 574 if (gotMostVisited && gotShownSections) { | 571 if (gotMostVisited && gotShownSections) { |
| 575 // Remove class name in a timeout so that changes done in this JS thread are | 572 // Remove class name in a timeout so that changes done in this JS thread are |
| 576 // not animated. | 573 // not animated. |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 el.addEventListener('dragover', bind(this.handleDragOver, this)); | 879 el.addEventListener('dragover', bind(this.handleDragOver, this)); |
| 883 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); | 880 el.addEventListener('dragleave', bind(this.handleDragLeave, this)); |
| 884 el.addEventListener('drop', bind(this.handleDrop, this)); | 881 el.addEventListener('drop', bind(this.handleDrop, this)); |
| 885 el.addEventListener('dragend', bind(this.handleDragEnd, this)); | 882 el.addEventListener('dragend', bind(this.handleDragEnd, this)); |
| 886 el.addEventListener('drag', bind(this.handleDrag, this)); | 883 el.addEventListener('drag', bind(this.handleDrag, this)); |
| 887 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); | 884 el.addEventListener('mousedown', bind(this.handleMouseDown, this)); |
| 888 } | 885 } |
| 889 }; | 886 }; |
| 890 | 887 |
| 891 dnd.init(); | 888 dnd.init(); |
| OLD | NEW |