Web Inspector: Change Main Frame Status Buttons when debugging Augmented JSContext
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Jan 2015 02:01:17 +0000 (02:01 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Jan 2015 02:01:17 +0000 (02:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141006

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
New "Restart" string.

* UserInterface/Base/Main.js:
(WebInspector.canArchiveMainFrame):
* UserInterface/Views/FrameTreeElement.js:
(WebInspector.FrameTreeElement.prototype.updateStatusForMainFrame):
(WebInspector.FrameTreeElement.prototype._updateDownloadButton):
Update the tooltip when in a non-Web debuggable, and only show
the Download button when in a Web debuggable.

* UserInterface/Views/TreeElementStatusButton.js:
(WebInspector.TreeElementStatusButton.prototype.set hidden):
Oops! The implementation was backwards. Simplify with classList.toggle.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js
Source/WebInspectorUI/UserInterface/Views/TreeElementStatusButton.js

index b858d09..2fe58a7 100644 (file)
@@ -1,3 +1,25 @@
+2015-01-28  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Change Main Frame Status Buttons when debugging Augmented JSContext
+        https://bugs.webkit.org/show_bug.cgi?id=141006
+
+        Reviewed by Timothy Hatcher.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        New "Restart" string.
+
+        * UserInterface/Base/Main.js:
+        (WebInspector.canArchiveMainFrame):
+        * UserInterface/Views/FrameTreeElement.js:
+        (WebInspector.FrameTreeElement.prototype.updateStatusForMainFrame):
+        (WebInspector.FrameTreeElement.prototype._updateDownloadButton):
+        Update the tooltip when in a non-Web debuggable, and only show
+        the Download button when in a Web debuggable.
+
+        * UserInterface/Views/TreeElementStatusButton.js:
+        (WebInspector.TreeElementStatusButton.prototype.set hidden):
+        Oops! The implementation was backwards. Simplify with classList.toggle.
+
 2015-01-28  Brian J. Burg  <burg@cs.washington.edu>
 
         Web Inspector: remove CSS.setPropertyText, CSS.toggleProperty and related dead code
index 7ce53ae..292fb27 100644 (file)
Binary files a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js and b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js differ
index 5c73e0e..9bddd46 100644 (file)
@@ -1886,7 +1886,7 @@ WebInspector.archiveMainFrame = function()
 
 WebInspector.canArchiveMainFrame = function()
 {
-    if (!PageAgent.archive)
+    if (!PageAgent.archive || this.debuggableType !== WebInspector.DebuggableType.Web)
         return false;
 
     return WebInspector.Resource.typeFromMIMEType(WebInspector.frameResourceManager.mainFrame.mainResource.mimeType) === WebInspector.Resource.Type.Document;
index a99564e..d3797fc 100644 (file)
@@ -202,7 +202,12 @@ WebInspector.FrameTreeElement.prototype = {
         if (!this._loadingMainFrameButtons) {
             this._loadingMainFrameButtons = true;
 
-            var tooltip = WebInspector.UIString("Reload page (%s)\nReload ignoring cache (%s)").format(WebInspector._reloadPageKeyboardShortcut.displayName, WebInspector._reloadPageIgnoringCacheKeyboardShortcut.displayName);
+            var tooltip;
+            if (WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript)
+                tooltip = WebInspector.UIString("Restart (%s)").format(WebInspector._reloadPageKeyboardShortcut.displayName);
+            else
+                tooltip = WebInspector.UIString("Reload page (%s)\nReload ignoring cache (%s)").format(WebInspector._reloadPageKeyboardShortcut.displayName, WebInspector._reloadPageIgnoringCacheKeyboardShortcut.displayName);
+
             wrappedSVGDocument(platformImagePath("Reload.svg"), null, tooltip, function(element) {
                 this._reloadButton = new WebInspector.TreeElementStatusButton(element);
                 this._reloadButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._reloadPageClicked, this);
@@ -342,7 +347,7 @@ WebInspector.FrameTreeElement.prototype = {
         if (!this._downloadButton)
             return;
 
-        if (!PageAgent.archive) {
+        if (!PageAgent.archive || WebInspector.debuggableType !== WebInspector.DebuggableType.Web) {
             this._downloadButton.hidden = true;
             return;
         }
index 8ee6d82..44be569 100644 (file)
@@ -57,10 +57,7 @@ WebInspector.TreeElementStatusButton.prototype = {
 
     set hidden(flag)
     {
-        if (flag)
-            this._element.classList.remove("hidden");
-        else
-            this._element.classList.add("hidden");
+        this._element.classList.toggle("hidden", flag);
     },
 
     get enabled()