OLD | NEW |
---|---|
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
9 */ | 9 */ |
10 WebInspector.ServiceWorkersView = function() | 10 WebInspector.ServiceWorkersView = function() |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
314 startButton.title = WebInspector.UIString("Start"); | 314 startButton.title = WebInspector.UIString("Start"); |
315 } | 315 } |
316 runningStatusDiv.createChild("div", "service-workers-version-running -status-text").createTextChild(version.runningStatus); | 316 runningStatusDiv.createChild("div", "service-workers-version-running -status-text").createTextChild(version.runningStatus); |
317 var scriptURLDiv = stateRowElement.createChild("div", "service-worke rs-version-script-url"); | 317 var scriptURLDiv = stateRowElement.createChild("div", "service-worke rs-version-script-url"); |
318 scriptURLDiv.createChild("div", "service-workers-version-script-url- text").createTextChild(version.scriptURL.asParsedURL().path); | 318 scriptURLDiv.createChild("div", "service-workers-version-script-url- text").createTextChild(version.scriptURL.asParsedURL().path); |
319 if (version.isRunning() || version.isStarting()) { | 319 if (version.isRunning() || version.isStarting()) { |
320 var inspectButton = scriptURLDiv.createChild("span", "service-wo rkers-version-inspect"); | 320 var inspectButton = scriptURLDiv.createChild("span", "service-wo rkers-version-inspect"); |
321 inspectButton.createTextChild(WebInspector.UIString("inspect")); | 321 inspectButton.createTextChild(WebInspector.UIString("inspect")); |
322 inspectButton.addEventListener("click", this._inspectButtonClick ed.bind(this, version.id), false); | 322 inspectButton.addEventListener("click", this._inspectButtonClick ed.bind(this, version.id), false); |
323 } | 323 } |
324 | |
325 if (version.scriptLastModified) { | |
326 var scriptLastModifiedDiv = scriptURLDiv.createChild("div", "ser vice-workers-info"); | |
dgozman
2015/03/30 15:22:16
You can just create "dt-icon-label" in scriptURLDi
horo
2015/03/30 15:39:52
Done.
| |
327 var scriptLastModifiedText = WebInspector.UIString("Last-Modifie d: %s", (new Date(version.scriptLastModified * 1000)).toConsoleTime()); | |
328 scriptLastModifiedDiv.createChild("label", "", "dt-icon-label"). type = "info-icon"; | |
329 scriptLastModifiedDiv.createChild("div", "service-workers-info-m essage service-worker-script-last-modified").createTextChild(scriptLastModifiedT ext); | |
dgozman
2015/03/30 15:22:15
I don't see where you use these classes.
horo
2015/03/30 15:39:52
Removed service-workers-info-message.
service-work
| |
330 } | |
331 if (version.scriptResponseTime) { | |
332 var scriptResponseTimeDiv = scriptURLDiv.createChild("div", "ser vice-workers-info"); | |
333 var scriptResponseTimeText = WebInspector.UIString("Server respo nse time: %s", (new Date(version.scriptLastModified * 1000)).toConsoleTime()); | |
334 scriptResponseTimeDiv.createChild("label", "", "dt-icon-label"). type = "info-icon"; | |
335 scriptResponseTimeDiv.createChild("div", "service-workers-info-m essage service-worker-script-response-time").createTextChild(scriptResponseTimeT ext); | |
dgozman
2015/03/30 15:22:16
ditto
horo
2015/03/30 15:39:52
Removed service-workers-info-message.
service-work
| |
336 } | |
337 | |
324 var errorMessages = version.errorMessages; | 338 var errorMessages = version.errorMessages; |
325 for (var index = 0; index < errorMessages.length; ++index) { | 339 for (var index = 0; index < errorMessages.length; ++index) { |
326 var errorDiv = scriptURLDiv.createChild("div", "service-workers- error"); | 340 var errorDiv = scriptURLDiv.createChild("div", "service-workers- error"); |
327 errorDiv.createChild("div", "service-workers-error-icon"); | 341 errorDiv.createChild("label", "", "dt-icon-label").type = "error -icon"; |
328 errorDiv.createChild("div", "service-workers-error-message").cre ateTextChild(errorMessages[index].errorMessage); | 342 errorDiv.createChild("div", "service-workers-error-message").cre ateTextChild(errorMessages[index].errorMessage); |
329 var script_path = errorMessages[index].sourceURL; | 343 var script_path = errorMessages[index].sourceURL; |
330 var script_url; | 344 var script_url; |
331 if (script_url = script_path.asParsedURL()) | 345 if (script_url = script_path.asParsedURL()) |
332 script_path = script_url.path; | 346 script_path = script_url.path; |
333 if (errorMessages[index].lineNumber != -1) | 347 if (errorMessages[index].lineNumber != -1) |
334 script_path = String.sprintf("%s:%d", script_path, errorMess ages[index].lineNumber); | 348 script_path = String.sprintf("%s:%d", script_path, errorMess ages[index].lineNumber); |
335 errorDiv.createChild("div", "service-workers-error-line").create TextChild(script_path); | 349 errorDiv.createChild("div", "service-workers-error-line").create TextChild(script_path); |
336 } | 350 } |
351 | |
337 } | 352 } |
338 if (!versions.length) { | 353 if (!versions.length) { |
339 var stateRowElement = versionsElement.createChild("div", "service-wo rkers-version-row"); | 354 var stateRowElement = versionsElement.createChild("div", "service-wo rkers-version-row"); |
340 stateRowElement.createChild("div", "service-workers-version-status") ; | 355 stateRowElement.createChild("div", "service-workers-version-status") ; |
341 stateRowElement.createChild("div", "service-workers-version-running- status"); | 356 stateRowElement.createChild("div", "service-workers-version-running- status"); |
342 stateRowElement.createChild("div", "service-workers-version-script-u rl"); | 357 stateRowElement.createChild("div", "service-workers-version-script-u rl"); |
343 } | 358 } |
344 return modeRowElement; | 359 return modeRowElement; |
345 }, | 360 }, |
346 | 361 |
(...skipping 24 matching lines...) Expand all Loading... | |
371 | 386 |
372 /** | 387 /** |
373 * @param {string} versionId | 388 * @param {string} versionId |
374 * @param {!Event} event | 389 * @param {!Event} event |
375 */ | 390 */ |
376 _inspectButtonClicked: function(versionId, event) | 391 _inspectButtonClicked: function(versionId, event) |
377 { | 392 { |
378 this._manager.inspectWorker(versionId); | 393 this._manager.inspectWorker(versionId); |
379 } | 394 } |
380 } | 395 } |
OLD | NEW |