Browse files

Add UI for continue, ignore warnings, or abort. Fixes #116.

  • Loading branch information...
1 parent 6d6ea54 commit 3332aaa57911e50bba1f6642704a86c9dd0fd2f6 Brian J. Burg committed Jan 4, 2013
View
69 Source/WebCore/inspector/front-end/TimelapseOverview.js
@@ -760,18 +760,67 @@ WebInspector.TimelapseOverview.prototype = {
_onPlaybackError: function(event)
{
var errorMessage = event.data.errorMessage;
- //var isFatal = event.data.isFatal;
-
- var clickCallback = function(event) {
- this._previewProvider.popView();
- this._messagePanel.element.removeEventListener("click", clickCallback, false);
- this._messagePanel.detach();
- }.bind(this);
+ var isFatal = event.data.isFatal;
+
+ if (isFatal) {
+ var clickDismissalCallback = function(event) {
+ this._previewProvider.popView();
+ this._messagePanel.element.removeEventListener("click", clickDismissalCallback, false);
+ this._messagePanel.detach();
+ }.bind(this);
+
+ this._messagePanel.content = document.createTextNode("Playback was terminated by a fatal error. Please try again.");
+ this._messagePanel.element.addEventListener("click", clickDismissalCallback, false);
+ } else {
+ var model = this._model;
+ var message = this._messagePanel;
+ var optionLabels = [
+ "Keep going",
+ "Ignore warnings",
+ "Abort"
+ ];
+ var optionCallbacks = [
+ // case: moral equivalent of pressing play button
+ function(event) {
+ model.replayUpToMarkIndex(model.replayFinishMarkIndex,
+ model.fastReplaying,
+ !model.fastReplaying || model.scanningBreakpoints);
+ message.detach();
+ },
+
+ // case: disable pauses, then press play
+ function(event) {
+ TimelapseAgent.setPauseOnError(false);
+ model.replayUpToMarkIndex(model.replayFinishMarkIndex,
+ model.fastReplaying,
+ !model.fastReplaying || model.scanningBreakpoints);
+ message.detach();
+ },
+
+ // case: unlock
+ function() {
+ model.stopPlayback(true);
+ message.detach();s
+ }
+ ];
+
+ var ul = document.createElement("ul");
+
+ for (var i = 0; i < optionLabels.length; i++) {
+ var li = document.createElement("li");
+ var span = document.createElement("span");
+ span.textContent = optionLabels[i];
+ span.addEventListener("click", optionCallbacks[i], false);
+ li.appendChild(span);
+ ul.appendChild(li);
+ }
+ var p = document.createElement("p");
+ p.appendChild(document.createTextNode("Something went wrong during playback."));
+ p.appendChild(ul);
+ this._messagePanel.content = p;
+ }
this._previewProvider.pushView(new WebInspector.OverviewPreviewViews.ErrorView(errorMessage));
-
- this._messagePanel.element.addEventListener("click", clickCallback, false);
- this._messagePanel.content = document.createTextNode("Oops! Playback failed. Please try again.");
this._messagePanel.show(this.element);
},
View
21 Source/WebCore/inspector/front-end/inspector.css
@@ -3364,11 +3364,25 @@ div.timelapse-overview-preview div.preview-message {
font-size: 18pt;
color: #666;
background-color: rgba(255, 255, 255, 0.5);
- line-height: 214px;
+ padding: 40px 15px 0;
text-align: center;
cursor: pointer;
}
+.timelapse-overview-message li {
+ list-style-type: none;
+ display: inline;
+ text-decoration: underline;
+ font-size: 14px;
+ margin: 0px 10px 0px 10px;
+ color: #444;
+}
+
+.timelapse-overview-message li:hover {
+ text-decoration: underline;
+ color: #a04010;
+}
+
.timelapse-overview-message:not(.hidden) {
-webkit-animation-name: message-fade-in;
-webkit-animation-duration: 0.2s;
@@ -3398,11 +3412,6 @@ div.timelapse-overview-preview div.preview-message {
100% { opacity: 0; z-index: 0; display: none; }
}
-.timelapse-overview-message:not(.hidden):hover {
- text-decoration: underline;
- color: #a04010;
-}
-
.timelapse-overview .resources-dividers-label-bar {
position: absolute;
bottom: -23px;

0 comments on commit 3332aaa

Please sign in to comment.