| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 ProjectAdded: "ProjectAdded", | 593 ProjectAdded: "ProjectAdded", |
| 594 ProjectRemoved: "ProjectRemoved" | 594 ProjectRemoved: "ProjectRemoved" |
| 595 } | 595 } |
| 596 | 596 |
| 597 WebInspector.Workspace.prototype = { | 597 WebInspector.Workspace.prototype = { |
| 598 /** | 598 /** |
| 599 * @return {!Array.<!WebInspector.UISourceCode>} | 599 * @return {!Array.<!WebInspector.UISourceCode>} |
| 600 */ | 600 */ |
| 601 unsavedSourceCodes: function() | 601 unsavedSourceCodes: function() |
| 602 { | 602 { |
| 603 /** |
| 604 * @param {!WebInspector.UISourceCode} sourceCode |
| 605 * @return {boolean} |
| 606 */ |
| 603 function filterUnsaved(sourceCode) | 607 function filterUnsaved(sourceCode) |
| 604 { | 608 { |
| 605 return sourceCode.isDirty(); | 609 return sourceCode.isDirty(); |
| 606 } | 610 } |
| 607 return this.uiSourceCodes().filter(filterUnsaved); | 611 |
| 612 var unsavedSourceCodes = []; |
| 613 var projects = this.projectsForType(WebInspector.projectTypes.FileSystem
); |
| 614 for (var i = 0; i < projects.length; ++i) |
| 615 unsavedSourceCodes = unsavedSourceCodes.concat(projects[i].uiSourceC
odes().filter(filterUnsaved)); |
| 616 |
| 617 return unsavedSourceCodes; |
| 608 }, | 618 }, |
| 609 | 619 |
| 610 /** | 620 /** |
| 611 * @param {string} projectId | 621 * @param {string} projectId |
| 612 * @param {string} path | 622 * @param {string} path |
| 613 * @return {?WebInspector.UISourceCode} | 623 * @return {?WebInspector.UISourceCode} |
| 614 */ | 624 */ |
| 615 uiSourceCode: function(projectId, path) | 625 uiSourceCode: function(projectId, path) |
| 616 { | 626 { |
| 617 var project = this._projects[projectId]; | 627 var project = this._projects[projectId]; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 this.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, l
istener, this); | 855 this.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded, l
istener, this); |
| 846 }, | 856 }, |
| 847 | 857 |
| 848 __proto__: WebInspector.Object.prototype | 858 __proto__: WebInspector.Object.prototype |
| 849 } | 859 } |
| 850 | 860 |
| 851 /** | 861 /** |
| 852 * @type {!WebInspector.Workspace} | 862 * @type {!WebInspector.Workspace} |
| 853 */ | 863 */ |
| 854 WebInspector.workspace; | 864 WebInspector.workspace; |
| OLD | NEW |