| OLD | NEW |
| 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 26 matching lines...) Expand all Loading... |
| 37 <script src="chrome://resources/js/cr/ui/list_selection_controller.js"></script> | 37 <script src="chrome://resources/js/cr/ui/list_selection_controller.js"></script> |
| 38 <script src="chrome://resources/js/cr/ui/list_item.js"></script> | 38 <script src="chrome://resources/js/cr/ui/list_item.js"></script> |
| 39 <script src="chrome://resources/js/cr/ui/list.js"></script> | 39 <script src="chrome://resources/js/cr/ui/list.js"></script> |
| 40 <script src="chrome://resources/js/cr/ui/tree.js"></script> | 40 <script src="chrome://resources/js/cr/ui/tree.js"></script> |
| 41 <script src="chrome://resources/js/cr/ui/splitter.js"></script> | 41 <script src="chrome://resources/js/cr/ui/splitter.js"></script> |
| 42 | 42 |
| 43 <script src="chrome://resources/js/util.js"></script> | 43 <script src="chrome://resources/js/util.js"></script> |
| 44 <script src="chrome://resources/js/local_strings.js"></script> | 44 <script src="chrome://resources/js/local_strings.js"></script> |
| 45 <script src="chrome://resources/js/i18n_template.js"></script> | 45 <script src="chrome://resources/js/i18n_template.js"></script> |
| 46 | 46 |
| 47 <script src="js/bmm/tree_iterator.js"></script> | |
| 48 <script src="js/bmm.js"></script> | 47 <script src="js/bmm.js"></script> |
| 49 <script src="js/bmm/bookmark_list.js"></script> | 48 <script src="js/bmm/bookmark_list.js"></script> |
| 50 <script src="js/bmm/bookmark_tree.js"></script> | 49 <script src="js/bmm/bookmark_tree.js"></script> |
| 51 </head> | 50 </head> |
| 52 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> | 51 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> |
| 53 | 52 |
| 54 <div class="header"> | 53 <div class="header"> |
| 55 <button class="logo" tabindex=3></button> | 54 <button class="logo" tabindex=3></button> |
| 56 <form onsubmit="setSearch(this.term.value); return false;" | 55 <form onsubmit="setSearch(this.term.value); return false;" |
| 57 class="form"> | 56 class="form"> |
| (...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 } else { | 1063 } else { |
| 1065 selectionCount = e.target.selectedItems.length; | 1064 selectionCount = e.target.selectedItems.length; |
| 1066 } | 1065 } |
| 1067 | 1066 |
| 1068 var isFolder = selectionCount == 1 && | 1067 var isFolder = selectionCount == 1 && |
| 1069 selectedItem && | 1068 selectedItem && |
| 1070 bmm.isFolder(selectedItem); | 1069 bmm.isFolder(selectedItem); |
| 1071 var multiple = selectionCount != 1 || isFolder; | 1070 var multiple = selectionCount != 1 || isFolder; |
| 1072 | 1071 |
| 1073 function hasBookmarks(node) { | 1072 function hasBookmarks(node) { |
| 1074 var it = new bmm.TreeIterator(node); | 1073 for (var i = 0; i < node.children.length; i++) { |
| 1075 while (it.moveNext()) { | 1074 if (!bmm.isFolder(node.children[i])) |
| 1076 if (!bmm.isFolder(it.current)) | |
| 1077 return true; | 1075 return true; |
| 1078 } | 1076 } |
| 1079 return false; | 1077 return false; |
| 1080 } | 1078 } |
| 1081 | 1079 |
| 1082 switch (command.id) { | 1080 switch (command.id) { |
| 1083 case 'open-in-new-tab-command': | 1081 case 'open-in-new-tab-command': |
| 1084 command.label = localStrings.getString(multiple ? | 1082 command.label = localStrings.getString(multiple ? |
| 1085 'open_all' : 'open_in_new_tab'); | 1083 'open_all' : 'open_in_new_tab'); |
| 1086 break; | 1084 break; |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 * Opens the selected bookmarks. | 1439 * Opens the selected bookmarks. |
| 1442 * @param {LinkKind} kind The kind of link we want to open. | 1440 * @param {LinkKind} kind The kind of link we want to open. |
| 1443 */ | 1441 */ |
| 1444 function openBookmarks(kind) { | 1442 function openBookmarks(kind) { |
| 1445 // If we have selected any folders we need to find all items recursively. | 1443 // If we have selected any folders we need to find all items recursively. |
| 1446 // We use multiple async calls to getSubtree instead of getting the whole | 1444 // We use multiple async calls to getSubtree instead of getting the whole |
| 1447 // tree since we would like to minimize the amount of data sent. | 1445 // tree since we would like to minimize the amount of data sent. |
| 1448 | 1446 |
| 1449 var urls = []; | 1447 var urls = []; |
| 1450 | 1448 |
| 1451 // Adds the node and all the descendants | 1449 // Adds the node and all its children. |
| 1452 function addNodes(node) { | 1450 function addNodes(node) { |
| 1453 var it = new bmm.TreeIterator(node); | 1451 if (node.children) { |
| 1454 while (it.moveNext()) { | 1452 node.children.forEach(function(child) { |
| 1455 var n = it.current; | 1453 if (!bmm.isFolder(child)) |
| 1456 if (!bmm.isFolder(n)) | 1454 urls.push(child.url); |
| 1457 urls.push(n.url); | 1455 }); |
| 1456 } else { |
| 1457 urls.push(node.url); |
| 1458 } | 1458 } |
| 1459 } | 1459 } |
| 1460 | 1460 |
| 1461 var nodes = getSelectedBookmarkNodes(); | 1461 var nodes = getSelectedBookmarkNodes(); |
| 1462 | 1462 |
| 1463 // Get a future promise for every selected item. | 1463 // Get a future promise for every selected item. |
| 1464 var promises = nodes.map(function(node) { | 1464 var promises = nodes.map(function(node) { |
| 1465 if (bmm.isFolder(node)) | 1465 if (bmm.isFolder(node)) |
| 1466 return bmm.loadSubtree(node.id); | 1466 return bmm.loadSubtree(node.id); |
| 1467 // Not a folder so we already have all the data we need. | 1467 // Not a folder so we already have all the data we need. |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1725 // Paste is a bit special since we need to do an async call to see if we can | 1725 // Paste is a bit special since we need to do an async call to see if we can |
| 1726 // paste because the paste command might not be up to date. | 1726 // paste because the paste command might not be up to date. |
| 1727 updatePasteCommand(pasteHandler); | 1727 updatePasteCommand(pasteHandler); |
| 1728 }); | 1728 }); |
| 1729 })(); | 1729 })(); |
| 1730 | 1730 |
| 1731 </script> | 1731 </script> |
| 1732 | 1732 |
| 1733 </body> | 1733 </body> |
| 1734 </html> | 1734 </html> |
| OLD | NEW |