| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 */ | 140 */ |
| 141 Sources.FilesNavigatorView = class extends Sources.NavigatorView { | 141 Sources.FilesNavigatorView = class extends Sources.NavigatorView { |
| 142 constructor() { | 142 constructor() { |
| 143 super(); | 143 super(); |
| 144 var toolbar = new UI.Toolbar('navigator-toolbar'); | 144 var toolbar = new UI.Toolbar('navigator-toolbar'); |
| 145 var title = Common.UIString('Add folder to workspace'); | 145 var title = Common.UIString('Add folder to workspace'); |
| 146 var addButton = new UI.ToolbarButton(title, 'largeicon-add', title); | 146 var addButton = new UI.ToolbarButton(title, 'largeicon-add', title); |
| 147 addButton.addEventListener( | 147 addButton.addEventListener( |
| 148 UI.ToolbarButton.Events.Click, () => Persistence.isolatedFileSystemManag
er.addFileSystem()); | 148 UI.ToolbarButton.Events.Click, () => Persistence.isolatedFileSystemManag
er.addFileSystem()); |
| 149 toolbar.appendToolbarItem(addButton); | 149 toolbar.appendToolbarItem(addButton); |
| 150 this.element.insertBefore(toolbar.element, this.element.firstChild); | 150 this.contentElement.insertBefore(toolbar.element, this.contentElement.firstC
hild); |
| 151 } | 151 } |
| 152 | 152 |
| 153 /** | 153 /** |
| 154 * @override | 154 * @override |
| 155 * @param {!Workspace.UISourceCode} uiSourceCode | 155 * @param {!Workspace.UISourceCode} uiSourceCode |
| 156 * @return {boolean} | 156 * @return {boolean} |
| 157 */ | 157 */ |
| 158 accept(uiSourceCode) { | 158 accept(uiSourceCode) { |
| 159 return uiSourceCode.project().type() === Workspace.projectTypes.FileSystem; | 159 return uiSourceCode.project().type() === Workspace.projectTypes.FileSystem; |
| 160 } | 160 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 191 /** | 191 /** |
| 192 * @unrestricted | 192 * @unrestricted |
| 193 */ | 193 */ |
| 194 Sources.SnippetsNavigatorView = class extends Sources.NavigatorView { | 194 Sources.SnippetsNavigatorView = class extends Sources.NavigatorView { |
| 195 constructor() { | 195 constructor() { |
| 196 super(); | 196 super(); |
| 197 var toolbar = new UI.Toolbar('navigator-toolbar'); | 197 var toolbar = new UI.Toolbar('navigator-toolbar'); |
| 198 var newButton = new UI.ToolbarButton('', 'largeicon-add', Common.UIString('N
ew snippet')); | 198 var newButton = new UI.ToolbarButton('', 'largeicon-add', Common.UIString('N
ew snippet')); |
| 199 newButton.addEventListener(UI.ToolbarButton.Events.Click, this._handleCreate
Snippet.bind(this)); | 199 newButton.addEventListener(UI.ToolbarButton.Events.Click, this._handleCreate
Snippet.bind(this)); |
| 200 toolbar.appendToolbarItem(newButton); | 200 toolbar.appendToolbarItem(newButton); |
| 201 this.element.insertBefore(toolbar.element, this.element.firstChild); | 201 this.contentElement.insertBefore(toolbar.element, this.contentElement.firstC
hild); |
| 202 } | 202 } |
| 203 | 203 |
| 204 /** | 204 /** |
| 205 * @override | 205 * @override |
| 206 * @param {!Workspace.UISourceCode} uiSourceCode | 206 * @param {!Workspace.UISourceCode} uiSourceCode |
| 207 * @return {boolean} | 207 * @return {boolean} |
| 208 */ | 208 */ |
| 209 accept(uiSourceCode) { | 209 accept(uiSourceCode) { |
| 210 return uiSourceCode.project().type() === Workspace.projectTypes.Snippets; | 210 return uiSourceCode.project().type() === Workspace.projectTypes.Snippets; |
| 211 } | 211 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 var uiSourceCode = Snippets.scriptSnippetModel.createScriptSnippet(''); | 294 var uiSourceCode = Snippets.scriptSnippetModel.createScriptSnippet(''); |
| 295 Common.Revealer.reveal(uiSourceCode); | 295 Common.Revealer.reveal(uiSourceCode); |
| 296 return true; | 296 return true; |
| 297 case 'sources.add-folder-to-workspace': | 297 case 'sources.add-folder-to-workspace': |
| 298 Persistence.isolatedFileSystemManager.addFileSystem(); | 298 Persistence.isolatedFileSystemManager.addFileSystem(); |
| 299 return true; | 299 return true; |
| 300 } | 300 } |
| 301 return false; | 301 return false; |
| 302 } | 302 } |
| 303 }; | 303 }; |
| OLD | NEW |