| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @param {!WebInspector.SourcesPanel} sourcesPanel | 8 * @param {!WebInspector.SourcesPanel} sourcesPanel |
| 9 * @param {!WebInspector.Workspace} workspace | 9 * @param {!WebInspector.Workspace} workspace |
| 10 */ | 10 */ |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 { | 106 { |
| 107 var title; | 107 var title; |
| 108 if (isNetwork) | 108 if (isNetwork) |
| 109 title = WebInspector.UIString("Map network resource '%s' to workspac
e?", uiSourceCode.originURL()); | 109 title = WebInspector.UIString("Map network resource '%s' to workspac
e?", uiSourceCode.originURL()); |
| 110 else | 110 else |
| 111 title = WebInspector.UIString("Map workspace resource '%s' to networ
k?", uiSourceCode.path()); | 111 title = WebInspector.UIString("Map workspace resource '%s' to networ
k?", uiSourceCode.path()); |
| 112 | 112 |
| 113 var infobar = new WebInspector.UISourceCodeFrame.Infobar(WebInspector.UI
SourceCodeFrame.Infobar.Level.Info, title); | 113 var infobar = new WebInspector.UISourceCodeFrame.Infobar(WebInspector.UI
SourceCodeFrame.Infobar.Level.Info, title); |
| 114 infobar.createDetailsRowMessage(WebInspector.UIString("You can map files
in your workspace to the ones loaded over the network. As a result, changes mad
e in DevTools will be persisted to disk.")); | 114 infobar.createDetailsRowMessage(WebInspector.UIString("You can map files
in your workspace to the ones loaded over the network. As a result, changes mad
e in DevTools will be persisted to disk.")); |
| 115 infobar.createDetailsRowMessage(WebInspector.UIString("Use context menu
to establish the mapping at any time.")); | 115 infobar.createDetailsRowMessage(WebInspector.UIString("Use context menu
to establish the mapping at any time.")); |
| 116 var actionLink = infobar.createDetailsRowMessage("").createChild("a"); | 116 var actionLink = WebInspector.createAnchor("", WebInspector.UIString("Es
tablish the mapping now..."), true); |
| 117 actionLink.href = ""; | |
| 118 actionLink.onclick = this._establishTheMapping.bind(this, uiSourceCode); | 117 actionLink.onclick = this._establishTheMapping.bind(this, uiSourceCode); |
| 119 actionLink.textContent = WebInspector.UIString("Establish the mapping no
w..."); | 118 infobar.createDetailsRowMessage("").appendChild(actionLink); |
| 120 this._appendInfobar(uiSourceCode, infobar); | 119 this._appendInfobar(uiSourceCode, infobar); |
| 121 }, | 120 }, |
| 122 | 121 |
| 123 /** | 122 /** |
| 124 * @param {!WebInspector.UISourceCode} uiSourceCode | 123 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 125 * @param {?Event} event | 124 * @param {?Event} event |
| 126 */ | 125 */ |
| 127 _establishTheMapping: function(uiSourceCode, event) | 126 _establishTheMapping: function(uiSourceCode, event) |
| 128 { | 127 { |
| 129 event.consume(true); | 128 event.consume(true); |
| 130 if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSyst
em) | 129 if (uiSourceCode.project().type() === WebInspector.projectTypes.FileSyst
em) |
| 131 this._sourcesPanel.mapFileSystemToNetwork(uiSourceCode); | 130 this._sourcesPanel.mapFileSystemToNetwork(uiSourceCode); |
| 132 else | 131 else |
| 133 this._sourcesPanel.mapNetworkToFileSystem(uiSourceCode); | 132 this._sourcesPanel.mapNetworkToFileSystem(uiSourceCode); |
| 134 }, | 133 }, |
| 135 | 134 |
| 136 /** | 135 /** |
| 137 * @param {!WebInspector.UISourceCode} uiSourceCode | 136 * @param {!WebInspector.UISourceCode} uiSourceCode |
| 138 * @param {!WebInspector.UISourceCodeFrame.Infobar} infobar | 137 * @param {!WebInspector.UISourceCodeFrame.Infobar} infobar |
| 139 */ | 138 */ |
| 140 _appendInfobar: function(uiSourceCode, infobar) | 139 _appendInfobar: function(uiSourceCode, infobar) |
| 141 { | 140 { |
| 142 var uiSourceCodeFrame = this._sourcesView.viewForFile(uiSourceCode); | 141 var uiSourceCodeFrame = this._sourcesView.viewForFile(uiSourceCode); |
| 143 | 142 |
| 144 infobar.createDetailsRowMessage("").createChild("br"); | 143 infobar.createDetailsRowMessage("").createChild("br"); |
| 145 var rowElement = infobar.createDetailsRowMessage(WebInspector.UIString("
For more information on workspaces, refer to the ")); | 144 var rowElement = infobar.createDetailsRowMessage(WebInspector.UIString("
For more information on workspaces, refer to the ")); |
| 146 var a = rowElement.createChild("a"); | 145 rowElement.appendChild(WebInspector.createDocumentationAnchor("workspace
s", WebInspector.UIString("workspaces documentation"))); |
| 147 a.textContent = "workspaces documentation"; | |
| 148 a.href = "https://developer.chrome.com/devtools/docs/workspaces"; | |
| 149 rowElement.createTextChild("."); | 146 rowElement.createTextChild("."); |
| 150 uiSourceCode[WebInspector.WorkspaceMappingTip._infobarSymbol] = infobar; | 147 uiSourceCode[WebInspector.WorkspaceMappingTip._infobarSymbol] = infobar; |
| 151 uiSourceCodeFrame.attachInfobars([infobar]); | 148 uiSourceCodeFrame.attachInfobars([infobar]); |
| 152 WebInspector.runCSSAnimationOnce(infobar.element, "source-frame-infobar-
animation"); | 149 WebInspector.runCSSAnimationOnce(infobar.element, "source-frame-infobar-
animation"); |
| 153 } | 150 } |
| 154 } | 151 } |
| OLD | NEW |