OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html i18n-values="dir:textdirection;"> | 2 <html i18n-values="dir:textdirection;"> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <title i18n-content="title"></title> | 5 <title i18n-content="title"></title> |
6 <link rel="icon" href="../../app/theme/history_favicon.png"> | 6 <link rel="icon" href="../../app/theme/history_favicon.png"> |
7 <script src="shared/js/local_strings.js"></script> | 7 <script src="shared/js/local_strings.js"></script> |
8 <script> | 8 <script> |
9 /////////////////////////////////////////////////////////////////////////////// | 9 /////////////////////////////////////////////////////////////////////////////// |
10 // Globals: | 10 // Globals: |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 /** | 524 /** |
525 * Toggles the edit mode and triggers UI update. | 525 * Toggles the edit mode and triggers UI update. |
526 */ | 526 */ |
527 HistoryView.prototype.toggleEditMode = function() { | 527 HistoryView.prototype.toggleEditMode = function() { |
528 var editMode = !this.model_.getEditMode(); | 528 var editMode = !this.model_.getEditMode(); |
529 this.setEditMode(editMode); | 529 this.setEditMode(editMode); |
530 this.updateEditControls_(); | 530 this.updateEditControls_(); |
531 }; | 531 }; |
532 | 532 |
533 /** | 533 /** |
| 534 * @return {boolean} Whether we are in edit mode where history items can be |
| 535 * deleted |
| 536 */ |
| 537 HistoryView.prototype.getEditMode = function() { |
| 538 return this.model_.getEditMode(); |
| 539 }; |
| 540 |
| 541 /** |
534 * Reload the current view. | 542 * Reload the current view. |
535 */ | 543 */ |
536 HistoryView.prototype.reload = function() { | 544 HistoryView.prototype.reload = function() { |
537 this.model_.reload(); | 545 this.model_.reload(); |
538 }; | 546 }; |
539 | 547 |
540 /** | 548 /** |
541 * Switch to a specified page. | 549 * Switch to a specified page. |
542 * @param {number} page The page we wish to view. | 550 * @param {number} page The page we wish to view. |
543 */ | 551 */ |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 * Our history system calls this function when a deletion has finished. | 1060 * Our history system calls this function when a deletion has finished. |
1053 */ | 1061 */ |
1054 function deleteComplete() { | 1062 function deleteComplete() { |
1055 window.console.log('Delete complete'); | 1063 window.console.log('Delete complete'); |
1056 deleteInFlight = false; | 1064 deleteInFlight = false; |
1057 if (deleteQueue.length > 2) { | 1065 if (deleteQueue.length > 2) { |
1058 deleteQueue = deleteQueue.slice(2); | 1066 deleteQueue = deleteQueue.slice(2); |
1059 deleteNextInQueue(); | 1067 deleteNextInQueue(); |
1060 } else { | 1068 } else { |
1061 deleteQueue = []; | 1069 deleteQueue = []; |
1062 historyView.reload(); | |
1063 } | 1070 } |
1064 } | 1071 } |
1065 | 1072 |
1066 /** | 1073 /** |
1067 * Our history system calls this function if a delete is not ready (e.g. | 1074 * Our history system calls this function if a delete is not ready (e.g. |
1068 * another delete is in-progress). | 1075 * another delete is in-progress). |
1069 */ | 1076 */ |
1070 function deleteFailed() { | 1077 function deleteFailed() { |
1071 window.console.log('Delete failed'); | 1078 window.console.log('Delete failed'); |
1072 // The deletion failed - try again later. | 1079 // The deletion failed - try again later. |
1073 deleteInFlight = false; | 1080 deleteInFlight = false; |
1074 setTimeout(deleteNextInQueue, 500); | 1081 setTimeout(deleteNextInQueue, 500); |
1075 } | 1082 } |
| 1083 |
| 1084 /** |
| 1085 * We're called when something is deleted (either by us or by someone |
| 1086 * else). |
| 1087 */ |
| 1088 function historyDeleted() { |
| 1089 window.console.log('History deleted'); |
| 1090 var anyChecked = document.querySelector('.entry input:checked') != null; |
| 1091 if (!(historyView.getEditMode() && anyChecked)) |
| 1092 historyView.reload(); |
| 1093 } |
1076 </script> | 1094 </script> |
1077 <link rel="stylesheet" href="webui2.css"> | 1095 <link rel="stylesheet" href="webui2.css"> |
1078 <style> | 1096 <style> |
1079 #results-separator { | 1097 #results-separator { |
1080 margin-top:12px; | 1098 margin-top:12px; |
1081 border-top:1px solid #9cc2ef; | 1099 border-top:1px solid #9cc2ef; |
1082 background-color:#ebeff9; | 1100 background-color:#ebeff9; |
1083 font-weight:bold; | 1101 font-weight:bold; |
1084 padding:3px; | 1102 padding:3px; |
1085 margin-bottom:-8px; | 1103 margin-bottom:-8px; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 </table> | 1239 </table> |
1222 </div> | 1240 </div> |
1223 <div id="editing-controls"></div> | 1241 <div id="editing-controls"></div> |
1224 <div id="results-display"></div> | 1242 <div id="results-display"></div> |
1225 <div id="results-pagination"></div> | 1243 <div id="results-pagination"></div> |
1226 </div> | 1244 </div> |
1227 <div class="footer"> | 1245 <div class="footer"> |
1228 </div> | 1246 </div> |
1229 </body> | 1247 </body> |
1230 </html> | 1248 </html> |
OLD | NEW |