Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/settings/EditFileSystemView.js

Issue 2614883002: DevTools: lighten the workspaces settings ui a bit. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 Workspace.fileSystemMapping.addEventListener( 44 Workspace.fileSystemMapping.addEventListener(
45 Workspace.FileSystemMapping.Events.FileMappingAdded, this._update, thi s), 45 Workspace.FileSystemMapping.Events.FileMappingAdded, this._update, thi s),
46 Workspace.fileSystemMapping.addEventListener( 46 Workspace.fileSystemMapping.addEventListener(
47 Workspace.FileSystemMapping.Events.FileMappingRemoved, this._update, t his), 47 Workspace.FileSystemMapping.Events.FileMappingRemoved, this._update, t his),
48 Workspace.isolatedFileSystemManager.addEventListener( 48 Workspace.isolatedFileSystemManager.addEventListener(
49 Workspace.IsolatedFileSystemManager.Events.ExcludedFolderAdded, this._ update, this), 49 Workspace.IsolatedFileSystemManager.Events.ExcludedFolderAdded, this._ update, this),
50 Workspace.isolatedFileSystemManager.addEventListener( 50 Workspace.isolatedFileSystemManager.addEventListener(
51 Workspace.IsolatedFileSystemManager.Events.ExcludedFolderRemoved, this ._update, this) 51 Workspace.IsolatedFileSystemManager.Events.ExcludedFolderRemoved, this ._update, this)
52 ]; 52 ];
53 53
54 this._mappingsList = new UI.ListWidget(this); 54
55 this._mappingsList.element.classList.add('file-system-list'); 55 if (!Runtime.experiments.isEnabled('persistence2')) {
56 this._mappingsList.registerRequiredCSS('settings/editFileSystemView.css'); 56 this._mappingsList = new UI.ListWidget(this);
57 var mappingsPlaceholder = createElementWithClass('div', 'file-system-list-em pty'); 57 this._mappingsList.element.classList.add('file-system-list');
58 var mappingsHeader = this.contentElement.createChild('div', 'file-system-hea der'); 58 this._mappingsList.registerRequiredCSS('settings/editFileSystemView.css');
59 mappingsHeader.createChild('div', 'file-system-header-text').textContent = C ommon.UIString('Mappings'); 59 var mappingsPlaceholder = createElementWithClass('div', 'file-system-list- empty');
60 if (Runtime.experiments.isEnabled('persistence2')) { 60 var mappingsHeader = this.contentElement.createChild('div', 'file-system-h eader');
61 var div = mappingsPlaceholder.createChild('div'); 61 mappingsHeader.createChild('div', 'file-system-header-text').textContent = Common.UIString('Mappings');
62 div.createTextChild( 62 mappingsPlaceholder.textContent = Common.UIString('None');
63 Common.UIString('Mappings are inferred automatically via the \'Persist ence 2.0\' experiment. Please '));
64 div.appendChild(UI.createExternalLink(
65 'https://bugs.chromium.org/p/chromium/issues/entry?template=Defect%20r eport%20from%20user&components=Platform%3EDevTools%3EAuthoring&comment=DevTools% 20failed%20to%20link%20network%20resource%20to%20filesystem.%0A%0APlatform%3A%20 %3CLinux%2FWin%2FMac%3E%0AChrome%20version%3A%20%3Cyour%20chrome%20version%3E%0A %0AWhat%20are%20the%20details%20of%20your%20project%3F%0A-%20Source%20code%20(if %20any)%3A%20http%3A%2F%2Fgithub.com%2Fexample%2Fexample%0A-%20Build%20System%3A %20gulp%2Fgrunt%2Fwebpack%2Frollup%2F...%0A-%20HTTP%20server%3A%20node%20HTTP%2F nginx%2Fapache...%0A%0AAssets%20failed%20to%20link%20(or%20incorrectly%20linked) %3A%0A1.%0A2.%0A3.%0A%0AIf%20possible%2C%20please%20attach%20a%20screenshot%20of %20network%20sources%20navigator%20which%20should%0Ashow%20which%20resources%20f ailed%20to%20map',
66 Common.UIString('report')));
67 div.createTextChild(Common.UIString(' any bugs.'));
68 } else {
69 mappingsPlaceholder.textContent = Common.UIString('No mappings');
70 mappingsHeader.appendChild( 63 mappingsHeader.appendChild(
71 UI.createTextButton(Common.UIString('Add'), this._addMappingButtonClic ked.bind(this), 'add-button')); 64 UI.createTextButton(Common.UIString('Add'), this._addMappingButtonClic ked.bind(this), 'add-button'));
65 this._mappingsList.setEmptyPlaceholder(mappingsPlaceholder);
66 this._mappingsList.show(this.contentElement);
72 } 67 }
73 this._mappingsList.setEmptyPlaceholder(mappingsPlaceholder);
74 this._mappingsList.show(this.contentElement);
75 68
76 var excludedFoldersHeader = this.contentElement.createChild('div', 'file-sys tem-header'); 69 var excludedFoldersHeader = this.contentElement.createChild('div', 'file-sys tem-header');
77 excludedFoldersHeader.createChild('div', 'file-system-header-text').textCont ent = 70 excludedFoldersHeader.createChild('div', 'file-system-header-text').textCont ent =
78 Common.UIString('Excluded folders'); 71 Common.UIString('Excluded folders');
79 excludedFoldersHeader.appendChild( 72 excludedFoldersHeader.appendChild(
80 UI.createTextButton(Common.UIString('Add'), this._addExcludedFolderButto nClicked.bind(this), 'add-button')); 73 UI.createTextButton(Common.UIString('Add'), this._addExcludedFolderButto nClicked.bind(this), 'add-button'));
81 this._excludedFoldersList = new UI.ListWidget(this); 74 this._excludedFoldersList = new UI.ListWidget(this);
82 this._excludedFoldersList.element.classList.add('file-system-list'); 75 this._excludedFoldersList.element.classList.add('file-system-list');
83 this._excludedFoldersList.registerRequiredCSS('settings/editFileSystemView.c ss'); 76 this._excludedFoldersList.registerRequiredCSS('settings/editFileSystemView.c ss');
84 var excludedFoldersPlaceholder = createElementWithClass('div', 'file-system- list-empty'); 77 var excludedFoldersPlaceholder = createElementWithClass('div', 'file-system- list-empty');
85 excludedFoldersPlaceholder.textContent = Common.UIString('No excluded folder s'); 78 excludedFoldersPlaceholder.textContent = Common.UIString('None');
86 this._excludedFoldersList.setEmptyPlaceholder(excludedFoldersPlaceholder); 79 this._excludedFoldersList.setEmptyPlaceholder(excludedFoldersPlaceholder);
87 this._excludedFoldersList.show(this.contentElement); 80 this._excludedFoldersList.show(this.contentElement);
88 81
89 this.contentElement.tabIndex = 0; 82 this.contentElement.tabIndex = 0;
90 this._update(); 83 this._update();
91 } 84 }
92 85
93 dispose() { 86 dispose() {
94 Common.EventTarget.removeEventListeners(this._eventListeners); 87 Common.EventTarget.removeEventListeners(this._eventListeners);
95 } 88 }
96 89
97 _update() { 90 _update() {
98 if (this._muteUpdate) 91 if (this._muteUpdate)
99 return; 92 return;
100 93
101 this._mappingsList.clear();
102 this._mappings = []; 94 this._mappings = [];
103 if (Runtime.experiments.isEnabled('persistence2')) 95 if (Runtime.experiments.isEnabled('persistence2'))
104 return; 96 return;
97
98 this._mappingsList.clear();
105 var mappings = Workspace.fileSystemMapping.mappingEntries(this._fileSystemPa th); 99 var mappings = Workspace.fileSystemMapping.mappingEntries(this._fileSystemPa th);
106 for (var entry of mappings) { 100 for (var entry of mappings) {
107 if (entry.configurable) { 101 if (entry.configurable) {
108 this._mappingsList.appendItem(entry, true); 102 this._mappingsList.appendItem(entry, true);
109 this._mappings.push(entry); 103 this._mappings.push(entry);
110 } 104 }
111 } 105 }
112 for (var entry of mappings) { 106 for (var entry of mappings) {
113 if (!entry.configurable) { 107 if (!entry.configurable) {
114 this._mappingsList.appendItem(entry, false); 108 this._mappingsList.appendItem(entry, false);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 /** 327 /**
334 * @param {string} prefix 328 * @param {string} prefix
335 * @return {string} 329 * @return {string}
336 */ 330 */
337 _normalizePrefix(prefix) { 331 _normalizePrefix(prefix) {
338 if (!prefix) 332 if (!prefix)
339 return ''; 333 return '';
340 return prefix + (prefix[prefix.length - 1] === '/' ? '' : '/'); 334 return prefix + (prefix[prefix.length - 1] === '/' ? '' : '/');
341 } 335 }
342 }; 336 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698