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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 | 81 |
82 this._excludedFolderList = new WebInspector.EditableSettingsList([pathColumn ], this._excludedFolderValueProvider.bind(this), this._excludedFolderValidate.bi nd(this), this._excludedFolderEdit.bind(this)); | 82 this._excludedFolderList = new WebInspector.EditableSettingsList([pathColumn ], this._excludedFolderValueProvider.bind(this), this._excludedFolderValidate.bi nd(this), this._excludedFolderEdit.bind(this)); |
83 this._excludedFolderList.addEventListener(WebInspector.SettingsList.Events.R emoved, this._excludedFolderRemovedfromList.bind(this)); | 83 this._excludedFolderList.addEventListener(WebInspector.SettingsList.Events.R emoved, this._excludedFolderRemovedfromList.bind(this)); |
84 this._excludedFolderList.element.classList.add("excluded-folders-list"); | 84 this._excludedFolderList.element.classList.add("excluded-folders-list"); |
85 this._excludedFolderListContainer.appendChild(this._excludedFolderList.eleme nt); | 85 this._excludedFolderListContainer.appendChild(this._excludedFolderList.eleme nt); |
86 this._excludedFolderEntries = new StringMap(); | 86 this._excludedFolderEntries = new StringMap(); |
87 for (var i = 0; i < excludedFolderEntries.length; ++i) | 87 for (var i = 0; i < excludedFolderEntries.length; ++i) |
88 this._addExcludedFolderRow(excludedFolderEntries[i]); | 88 this._addExcludedFolderRow(excludedFolderEntries[i]); |
89 | 89 |
90 this.element.tabIndex = 0; | 90 this.element.tabIndex = 0; |
91 this._hasMappingChanges = false; | |
91 } | 92 } |
92 | 93 |
93 WebInspector.EditFileSystemDialog.show = function(element, fileSystemPath) | 94 WebInspector.EditFileSystemDialog.show = function(element, fileSystemPath) |
94 { | 95 { |
95 WebInspector.Dialog.show(element, new WebInspector.EditFileSystemDialog(file SystemPath)); | 96 WebInspector.Dialog.show(element, new WebInspector.EditFileSystemDialog(file SystemPath)); |
96 var glassPane = document.getElementById("glass-pane"); | 97 var glassPane = document.getElementById("glass-pane"); |
97 glassPane.classList.add("settings-glass-pane"); | 98 glassPane.classList.add("settings-glass-pane"); |
98 } | 99 } |
99 | 100 |
100 WebInspector.EditFileSystemDialog.prototype = { | 101 WebInspector.EditFileSystemDialog.prototype = { |
(...skipping 29 matching lines...) Expand all Loading... | |
130 * @param {!Element} relativeToElement | 131 * @param {!Element} relativeToElement |
131 */ | 132 */ |
132 position: function(element, relativeToElement) | 133 position: function(element, relativeToElement) |
133 { | 134 { |
134 this._relativeToElement = relativeToElement; | 135 this._relativeToElement = relativeToElement; |
135 this._resize(); | 136 this._resize(); |
136 }, | 137 }, |
137 | 138 |
138 willHide: function(event) | 139 willHide: function(event) |
139 { | 140 { |
141 if (!this._hasMappingChanges) | |
142 return; | |
143 if (window.confirm(WebInspector.UIString("It is recommended to restart i nspector after making these changes. Would you like to restart it?"))) | |
dgozman
2014/08/01 10:34:10
Should we use the term "DevTools" instead of "insp
| |
144 WebInspector.reload(); | |
140 }, | 145 }, |
141 | 146 |
142 _fileMappingAdded: function(event) | 147 _fileMappingAdded: function(event) |
143 { | 148 { |
144 var entry = /** @type {!WebInspector.FileSystemMapping.Entry} */ (event. data); | 149 var entry = /** @type {!WebInspector.FileSystemMapping.Entry} */ (event. data); |
145 this._addMappingRow(entry); | 150 this._addMappingRow(entry); |
146 }, | 151 }, |
147 | 152 |
148 _fileMappingRemoved: function(event) | 153 _fileMappingRemoved: function(event) |
149 { | 154 { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 * @param {!WebInspector.Event} event | 227 * @param {!WebInspector.Event} event |
223 */ | 228 */ |
224 _fileMappingRemovedfromList: function(event) | 229 _fileMappingRemovedfromList: function(event) |
225 { | 230 { |
226 var urlPrefix = /** @type{?string} */ (event.data); | 231 var urlPrefix = /** @type{?string} */ (event.data); |
227 if (!urlPrefix) | 232 if (!urlPrefix) |
228 return; | 233 return; |
229 | 234 |
230 var entry = this._entries[urlPrefix]; | 235 var entry = this._entries[urlPrefix]; |
231 WebInspector.isolatedFileSystemManager.mapping().removeFileMapping(entry .fileSystemPath, entry.urlPrefix, entry.pathPrefix); | 236 WebInspector.isolatedFileSystemManager.mapping().removeFileMapping(entry .fileSystemPath, entry.urlPrefix, entry.pathPrefix); |
237 this._hasMappingChanges = true; | |
232 }, | 238 }, |
233 | 239 |
234 /** | 240 /** |
235 * @param {string} urlPrefix | 241 * @param {string} urlPrefix |
236 * @param {string} pathPrefix | 242 * @param {string} pathPrefix |
237 * @return {boolean} | 243 * @return {boolean} |
238 */ | 244 */ |
239 _addFileMapping: function(urlPrefix, pathPrefix) | 245 _addFileMapping: function(urlPrefix, pathPrefix) |
240 { | 246 { |
241 var normalizedURLPrefix = this._normalizePrefix(urlPrefix); | 247 var normalizedURLPrefix = this._normalizePrefix(urlPrefix); |
242 var normalizedPathPrefix = this._normalizePrefix(pathPrefix); | 248 var normalizedPathPrefix = this._normalizePrefix(pathPrefix); |
243 WebInspector.isolatedFileSystemManager.mapping().addFileMapping(this._fi leSystemPath, normalizedURLPrefix, normalizedPathPrefix); | 249 WebInspector.isolatedFileSystemManager.mapping().addFileMapping(this._fi leSystemPath, normalizedURLPrefix, normalizedPathPrefix); |
250 this._hasMappingChanges = true; | |
244 this._fileMappingsList.selectItem(normalizedURLPrefix); | 251 this._fileMappingsList.selectItem(normalizedURLPrefix); |
245 return true; | 252 return true; |
246 }, | 253 }, |
247 | 254 |
248 /** | 255 /** |
249 * @param {string} prefix | 256 * @param {string} prefix |
250 * @return {string} | 257 * @return {string} |
251 */ | 258 */ |
252 _normalizePrefix: function(prefix) | 259 _normalizePrefix: function(prefix) |
253 { | 260 { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
396 { | 403 { |
397 WebInspector.Dialog.hide(); | 404 WebInspector.Dialog.hide(); |
398 }, | 405 }, |
399 | 406 |
400 onEnter: function() | 407 onEnter: function() |
401 { | 408 { |
402 }, | 409 }, |
403 | 410 |
404 __proto__: WebInspector.DialogDelegate.prototype | 411 __proto__: WebInspector.DialogDelegate.prototype |
405 } | 412 } |
OLD | NEW |