Modified: trunk/Source/WebCore/ChangeLog (131180 => 131181)
--- trunk/Source/WebCore/ChangeLog 2012-10-12 12:46:34 UTC (rev 131180)
+++ trunk/Source/WebCore/ChangeLog 2012-10-12 13:01:20 UTC (rev 131181)
@@ -1,3 +1,19 @@
+2012-10-12 Vsevolod Vlasov <[email protected]>
+
+ Web Inspector: Resume button in element inspector -> scripts has tooltip 'pause script execution'
+ https://bugs.webkit.org/show_bug.cgi?id=99165
+
+ Reviewed by Pavel Feldman.
+
+ Pause/resume button title is now updated when debugger is paused/resumed.
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
+ (WebInspector.ScriptsPanel.prototype._createDebugToolbar):
+ (WebInspector.ScriptsPanel.prototype._updateButtonTitle):
+ (WebInspector.ScriptsPanel.prototype._createButtonAndRegisterShortcuts):
+
2012-10-12 Kentaro Hara <[email protected]>
Unreviewed. Fix run-binding-tests failures introduced in r131167.
Modified: trunk/Source/WebCore/English.lproj/localizedStrings.js (131180 => 131181)
--- trunk/Source/WebCore/English.lproj/localizedStrings.js 2012-10-12 12:46:34 UTC (rev 131180)
+++ trunk/Source/WebCore/English.lproj/localizedStrings.js 2012-10-12 13:01:20 UTC (rev 131181)
@@ -304,6 +304,7 @@
localizedStrings["Pause on all exceptions.\nClick to Pause on uncaught exceptions."] = "Pause on all exceptions.\nClick to Pause on uncaught exceptions.";
localizedStrings["Pause on uncaught exceptions.\nClick to Not pause on exceptions."] = "Pause on uncaught exceptions.\nClick to Not pause on exceptions.";
localizedStrings["Pause script execution (%s)."] = "Pause script execution (%s).";
+localizedStrings["Resume script execution (%s)."] = "Resume script execution (%s).";
localizedStrings["Pause/Continue"] = "Pause/Continue";
localizedStrings["Paused"] = "Paused";
localizedStrings["Paused on exception: '%s'."] = "Paused on exception: '%s'.";
Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (131180 => 131181)
--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js 2012-10-12 12:46:34 UTC (rev 131180)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js 2012-10-12 13:01:20 UTC (rev 131181)
@@ -593,6 +593,7 @@
}
if (this._paused) {
+ this._updateButtonTitle(this.pauseButton, WebInspector.UIString("Resume script execution (%s)."))
this.pauseButton.addStyleClass("paused");
this.pauseButton.disabled = false;
@@ -602,6 +603,7 @@
this.debuggerStatusElement.textContent = WebInspector.UIString("Paused");
} else {
+ this._updateButtonTitle(this.pauseButton, WebInspector.UIString("Pause script execution (%s)."))
this.pauseButton.removeStyleClass("paused");
this.pauseButton.disabled = this._waitingToPause;
@@ -752,12 +754,11 @@
var platformSpecificModifier = WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta;
// Continue.
- title = WebInspector.UIString("Pause script execution (%s).");
handler = this._togglePause.bind(this);
shortcuts = [];
shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F8));
shortcuts.push(WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Slash, platformSpecificModifier));
- this.pauseButton = this._createButtonAndRegisterShortcuts(section, "scripts-pause", title, handler, shortcuts, WebInspector.UIString("Pause/Continue"));
+ this.pauseButton = this._createButtonAndRegisterShortcuts(section, "scripts-pause", "", handler, shortcuts, WebInspector.UIString("Pause/Continue"));
debugToolbar.appendChild(this.pauseButton);
// Step over.
@@ -799,12 +800,23 @@
return debugToolbar;
},
+ _updateButtonTitle: function(button, buttonTitle)
+ {
+ button.buttonTitle = buttonTitle;
+ var hasShortcuts = button.shortcuts && button.shortcuts.length;
+ if (hasShortcuts)
+ button.title = String.vsprintf(buttonTitle, [button.shortcuts[0].name]);
+ else
+ button.title = buttonTitle;
+ },
+
_createButtonAndRegisterShortcuts: function(section, buttonId, buttonTitle, handler, shortcuts, shortcutDescription)
{
var button = document.createElement("button");
button.className = "status-bar-item";
button.id = buttonId;
- button.title = String.vsprintf(buttonTitle, [shortcuts[0].name]);
+ button.shortcuts = shortcuts;
+ this._updateButtonTitle(button, buttonTitle);
button.disabled = true;
button.appendChild(document.createElement("img"));
button.addEventListener("click", handler, false);