OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 /** | 140 /** |
141 * @unrestricted | 141 * @unrestricted |
142 */ | 142 */ |
143 Sources.FilesNavigatorView = class extends Sources.NavigatorView { | 143 Sources.FilesNavigatorView = class extends Sources.NavigatorView { |
144 constructor() { | 144 constructor() { |
145 super(); | 145 super(); |
146 var toolbar = new UI.Toolbar('navigator-toolbar'); | 146 var toolbar = new UI.Toolbar('navigator-toolbar'); |
147 var title = Common.UIString('Add folder to workspace'); | 147 var title = Common.UIString('Add folder to workspace'); |
148 var addButton = new UI.ToolbarButton(title, 'largeicon-add', title); | 148 var addButton = new UI.ToolbarButton(title, 'largeicon-add', title); |
149 addButton.addEventListener( | 149 addButton.addEventListener('click', () => Workspace.isolatedFileSystemManage
r.addFileSystem()); |
150 UI.ToolbarButton.Events.Click, () => Workspace.isolatedFileSystemManager
.addFileSystem()); | |
151 toolbar.appendToolbarItem(addButton); | 150 toolbar.appendToolbarItem(addButton); |
152 this.element.insertBefore(toolbar.element, this.element.firstChild); | 151 this.element.insertBefore(toolbar.element, this.element.firstChild); |
153 } | 152 } |
154 | 153 |
155 /** | 154 /** |
156 * @override | 155 * @override |
157 * @param {!Workspace.UISourceCode} uiSourceCode | 156 * @param {!Workspace.UISourceCode} uiSourceCode |
158 * @return {boolean} | 157 * @return {boolean} |
159 */ | 158 */ |
160 accept(uiSourceCode) { | 159 accept(uiSourceCode) { |
(...skipping 30 matching lines...) Expand all Loading... |
191 }; | 190 }; |
192 | 191 |
193 /** | 192 /** |
194 * @unrestricted | 193 * @unrestricted |
195 */ | 194 */ |
196 Sources.SnippetsNavigatorView = class extends Sources.NavigatorView { | 195 Sources.SnippetsNavigatorView = class extends Sources.NavigatorView { |
197 constructor() { | 196 constructor() { |
198 super(); | 197 super(); |
199 var toolbar = new UI.Toolbar('navigator-toolbar'); | 198 var toolbar = new UI.Toolbar('navigator-toolbar'); |
200 var newButton = new UI.ToolbarButton('', 'largeicon-add', Common.UIString('N
ew Snippet')); | 199 var newButton = new UI.ToolbarButton('', 'largeicon-add', Common.UIString('N
ew Snippet')); |
201 newButton.addEventListener(UI.ToolbarButton.Events.Click, this._handleCreate
Snippet.bind(this)); | 200 newButton.addEventListener('click', this._handleCreateSnippet.bind(this)); |
202 toolbar.appendToolbarItem(newButton); | 201 toolbar.appendToolbarItem(newButton); |
203 this.element.insertBefore(toolbar.element, this.element.firstChild); | 202 this.element.insertBefore(toolbar.element, this.element.firstChild); |
204 } | 203 } |
205 | 204 |
206 /** | 205 /** |
207 * @override | 206 * @override |
208 * @param {!Workspace.UISourceCode} uiSourceCode | 207 * @param {!Workspace.UISourceCode} uiSourceCode |
209 * @return {boolean} | 208 * @return {boolean} |
210 */ | 209 */ |
211 accept(uiSourceCode) { | 210 accept(uiSourceCode) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 this.create(Snippets.scriptSnippetModel.project(), ''); | 270 this.create(Snippets.scriptSnippetModel.project(), ''); |
272 } | 271 } |
273 | 272 |
274 /** | 273 /** |
275 * @override | 274 * @override |
276 */ | 275 */ |
277 sourceDeleted(uiSourceCode) { | 276 sourceDeleted(uiSourceCode) { |
278 this._handleRemoveSnippet(uiSourceCode); | 277 this._handleRemoveSnippet(uiSourceCode); |
279 } | 278 } |
280 }; | 279 }; |
OLD | NEW |