| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 29 matching lines...) Expand all Loading... |
| 40 this.registerRequiredCSS("settings/editFileSystemView.css"); | 40 this.registerRequiredCSS("settings/editFileSystemView.css"); |
| 41 this._fileSystemPath = fileSystemPath; | 41 this._fileSystemPath = fileSystemPath; |
| 42 | 42 |
| 43 this._eventListeners = [ | 43 this._eventListeners = [ |
| 44 WebInspector.fileSystemMapping.addEventListener(WebInspector.FileSystemM
apping.Events.FileMappingAdded, this._update, this), | 44 WebInspector.fileSystemMapping.addEventListener(WebInspector.FileSystemM
apping.Events.FileMappingAdded, this._update, this), |
| 45 WebInspector.fileSystemMapping.addEventListener(WebInspector.FileSystemM
apping.Events.FileMappingRemoved, this._update, this), | 45 WebInspector.fileSystemMapping.addEventListener(WebInspector.FileSystemM
apping.Events.FileMappingRemoved, this._update, this), |
| 46 WebInspector.isolatedFileSystemManager.addEventListener(WebInspector.Iso
latedFileSystemManager.Events.ExcludedFolderAdded, this._update, this), | 46 WebInspector.isolatedFileSystemManager.addEventListener(WebInspector.Iso
latedFileSystemManager.Events.ExcludedFolderAdded, this._update, this), |
| 47 WebInspector.isolatedFileSystemManager.addEventListener(WebInspector.Iso
latedFileSystemManager.Events.ExcludedFolderRemoved, this._update, this) | 47 WebInspector.isolatedFileSystemManager.addEventListener(WebInspector.Iso
latedFileSystemManager.Events.ExcludedFolderRemoved, this._update, this) |
| 48 ]; | 48 ]; |
| 49 | 49 |
| 50 var mappingsHeader = this.contentElement.createChild("div", "file-system-hea
der"); | |
| 51 mappingsHeader.createChild("div", "file-system-header-text").textContent = W
ebInspector.UIString("Mappings"); | |
| 52 mappingsHeader.appendChild(createTextButton(WebInspector.UIString("Add"), th
is._addMappingButtonClicked.bind(this), "add-button")); | |
| 53 this._mappingsList = new WebInspector.ListWidget(this); | 50 this._mappingsList = new WebInspector.ListWidget(this); |
| 54 this._mappingsList.element.classList.add("file-system-list"); | 51 this._mappingsList.element.classList.add("file-system-list"); |
| 55 this._mappingsList.registerRequiredCSS("settings/editFileSystemView.css"); | 52 this._mappingsList.registerRequiredCSS("settings/editFileSystemView.css"); |
| 56 var mappingsPlaceholder = createElementWithClass("div", "file-system-list-em
pty"); | 53 var mappingsPlaceholder = createElementWithClass("div", "file-system-list-em
pty"); |
| 57 mappingsPlaceholder.textContent = WebInspector.UIString("No mappings"); | 54 var mappingsHeader = this.contentElement.createChild("div", "file-system-hea
der"); |
| 55 mappingsHeader.createChild("div", "file-system-header-text").textContent = W
ebInspector.UIString("Mappings"); |
| 56 if (Runtime.experiments.isEnabled("persistence2")) { |
| 57 mappingsPlaceholder.textContent = WebInspector.UIString("Mappings are in
ferred automatically via the 'Persistence 2.0' experiment."); |
| 58 } else { |
| 59 mappingsPlaceholder.textContent = WebInspector.UIString("No mappings"); |
| 60 mappingsHeader.appendChild(createTextButton(WebInspector.UIString("Add")
, this._addMappingButtonClicked.bind(this), "add-button")); |
| 61 } |
| 58 this._mappingsList.setEmptyPlaceholder(mappingsPlaceholder); | 62 this._mappingsList.setEmptyPlaceholder(mappingsPlaceholder); |
| 59 this._mappingsList.show(this.contentElement); | 63 this._mappingsList.show(this.contentElement); |
| 60 | 64 |
| 61 var excludedFoldersHeader = this.contentElement.createChild("div", "file-sys
tem-header"); | 65 var excludedFoldersHeader = this.contentElement.createChild("div", "file-sys
tem-header"); |
| 62 excludedFoldersHeader.createChild("div", "file-system-header-text").textCont
ent = WebInspector.UIString("Excluded folders"); | 66 excludedFoldersHeader.createChild("div", "file-system-header-text").textCont
ent = WebInspector.UIString("Excluded folders"); |
| 63 excludedFoldersHeader.appendChild(createTextButton(WebInspector.UIString("Ad
d"), this._addExcludedFolderButtonClicked.bind(this), "add-button")); | 67 excludedFoldersHeader.appendChild(createTextButton(WebInspector.UIString("Ad
d"), this._addExcludedFolderButtonClicked.bind(this), "add-button")); |
| 64 this._excludedFoldersList = new WebInspector.ListWidget(this); | 68 this._excludedFoldersList = new WebInspector.ListWidget(this); |
| 65 this._excludedFoldersList.element.classList.add("file-system-list"); | 69 this._excludedFoldersList.element.classList.add("file-system-list"); |
| 66 this._excludedFoldersList.registerRequiredCSS("settings/editFileSystemView.c
ss"); | 70 this._excludedFoldersList.registerRequiredCSS("settings/editFileSystemView.c
ss"); |
| 67 var excludedFoldersPlaceholder = createElementWithClass("div", "file-system-
list-empty"); | 71 var excludedFoldersPlaceholder = createElementWithClass("div", "file-system-
list-empty"); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 79 WebInspector.EventTarget.removeEventListeners(this._eventListeners); | 83 WebInspector.EventTarget.removeEventListeners(this._eventListeners); |
| 80 }, | 84 }, |
| 81 | 85 |
| 82 _update: function() | 86 _update: function() |
| 83 { | 87 { |
| 84 if (this._muteUpdate) | 88 if (this._muteUpdate) |
| 85 return; | 89 return; |
| 86 | 90 |
| 87 this._mappingsList.clear(); | 91 this._mappingsList.clear(); |
| 88 this._mappings = []; | 92 this._mappings = []; |
| 93 if (Runtime.experiments.isEnabled("persistence2")) |
| 94 return; |
| 89 var mappings = WebInspector.fileSystemMapping.mappingEntries(this._fileS
ystemPath); | 95 var mappings = WebInspector.fileSystemMapping.mappingEntries(this._fileS
ystemPath); |
| 90 for (var entry of mappings) { | 96 for (var entry of mappings) { |
| 91 if (entry.configurable) { | 97 if (entry.configurable) { |
| 92 this._mappingsList.appendItem(entry, true); | 98 this._mappingsList.appendItem(entry, true); |
| 93 this._mappings.push(entry); | 99 this._mappings.push(entry); |
| 94 } | 100 } |
| 95 } | 101 } |
| 96 for (var entry of mappings) { | 102 for (var entry of mappings) { |
| 97 if (!entry.configurable) { | 103 if (!entry.configurable) { |
| 98 this._mappingsList.appendItem(entry, false); | 104 this._mappingsList.appendItem(entry, false); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 */ | 322 */ |
| 317 _normalizePrefix: function(prefix) | 323 _normalizePrefix: function(prefix) |
| 318 { | 324 { |
| 319 if (!prefix) | 325 if (!prefix) |
| 320 return ""; | 326 return ""; |
| 321 return prefix + (prefix[prefix.length - 1] === "/" ? "" : "/"); | 327 return prefix + (prefix[prefix.length - 1] === "/" ? "" : "/"); |
| 322 }, | 328 }, |
| 323 | 329 |
| 324 __proto__: WebInspector.VBox.prototype | 330 __proto__: WebInspector.VBox.prototype |
| 325 }; | 331 }; |
| OLD | NEW |