Adds an overlay window that covers the scripts panel and
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2008 22:31:45 +0000 (22:31 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 May 2008 22:31:45 +0000 (22:31 +0000)
informs the user that they need to attach the debugger.
Provides an "Attach Debugger" button below the info text.

Reviewed by Dan Bernstein.

* English.lproj/localizedStrings.js: New strings.
* page/inspector/ScriptsPanel.js:
(WebInspector.ScriptsPanel): Create the overlay elements and
append to the main panel element.
* page/inspector/inspector.css: New styles for the over lay elements.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@33416 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/English.lproj/localizedStrings.js
WebCore/page/inspector/ScriptsPanel.js
WebCore/page/inspector/inspector.css

index c1c8c6a..afb9a52 100644 (file)
@@ -1,5 +1,19 @@
 2008-05-13  Timothy Hatcher  <timothy@apple.com>
 
+        Adds an overlay window that covers the scripts panel and
+        informs the user that they need to attach the debugger.
+        Provides an "Attach Debugger" button below the info text.
+
+        Reviewed by Dan Bernstein.
+
+        * English.lproj/localizedStrings.js: New strings.
+        * page/inspector/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel): Create the overlay elements and
+        append to the main panel element.
+        * page/inspector/inspector.css: New styles for the over lay elements.
+
+2008-05-13  Timothy Hatcher  <timothy@apple.com>
+
         Fixes the assertion and crash that would happen when inspecting a element from a frame.
         This change makes JSInspectedObjectWrapper pass unwrapped objects around for global objects
         that share the same page group identifier. Also returns jsUndefined() instead of 0 to prevent
index 20ee659..22e0fbe 100644 (file)
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
index 3f00071..d8ff1fb 100644 (file)
@@ -133,6 +133,26 @@ WebInspector.ScriptsPanel = function()
 
     this.sidebarPanes.scopechain.expanded = true;
 
+    this.attachOverlayElement = document.createElement("div");
+    this.attachOverlayElement.id = "scripts-attach-overlay";
+
+    var headerElement = document.createElement("h1");
+    headerElement.textContent = WebInspector.UIString("Debugging scripts requires you to attach the debugger.");
+    this.attachOverlayElement.appendChild(headerElement);
+
+    var infoElement = document.createElement("span");
+    infoElement.textContent = WebInspector.UIString("Attaching will reload the inspected page.");
+    this.attachOverlayElement.appendChild(infoElement);
+
+    this.attachOverlayElement.appendChild(document.createElement("br"));
+    this.attachOverlayElement.appendChild(document.createElement("br"));
+
+    var attachButton = document.createElement("button");
+    attachButton.textContent = WebInspector.UIString("Attach Debugger");
+    attachButton.addEventListener("click", this._toggleDebugging.bind(this), false);
+    this.attachOverlayElement.appendChild(attachButton);
+
+    this.element.appendChild(this.attachOverlayElement);
     this.element.appendChild(this.scriptResourceViews);
     this.element.appendChild(this.sidebarElement);
     this.element.appendChild(this.sidebarResizeElement);
@@ -550,10 +570,13 @@ WebInspector.ScriptsPanel.prototype = {
         this._waitingToPause = false;
         this._stepping = false;
 
-        if (InspectorController.debuggerAttached())
+        if (InspectorController.debuggerAttached()) {
+            this.element.appendChild(this.attachOverlayElement);
             InspectorController.stopDebugging();
-        else
+        } else {
+            this.attachOverlayElement.parentNode.removeChild(this.attachOverlayElement);
             InspectorController.startDebuggingAndReloadInspectedPage();
+        }
 
         this.sidebarPanes.callstack.update(null);
         this.sidebarPanes.scopechain.update(null);
index b8995bc..f3302a4 100644 (file)
@@ -1466,6 +1466,29 @@ body.inactive .data-grid th.sort-ascending, body.inactive .data-grid th.sort-des
     background-image: url(Images/errorIcon.png);
 }
 
+#scripts-attach-overlay {
+    z-index: 1000;
+    position: absolute;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background-color: white;
+    color: rgb(96, 96, 96);
+    padding: 75px 50px;
+    text-align: center;
+    font-size: 16px;
+}
+
+#scripts-attach-overlay h1 {
+    font-size: 18px;
+}
+
+#scripts-attach-overlay button {
+    padding-left: 15px;
+    padding-right: 15px;
+}
+
 #scripts-debugging-status-bar-item {
     background-image: url(Images/debuggingButtons.png);
 }