Commit 977d4c95 authored by timothy@apple.com's avatar timothy@apple.com

Rename the Scope Chain pane to Scope Variables. Name the global

object Global. Name objects before the locals "With Block".
Name colsure scopes "Closure". Name any element or document
after Local, "Event Target" and "Event Document", respectfully.

Reviewed by Adam Roben.

* English.lproj/localizedStrings.js: Add new strings.
* page/inspector/ObjectPropertiesSection.js:
(WebInspector.ObjectPropertiesSection): Add a new argument that is used
for the empty placeholder text.
(WebInspector.ObjectPropertiesSection.prototype.onpopulate): Use the
empty placeholder text.
* page/inspector/ScopeChainSidebarPane.js:
(WebInspector.ScopeChainSidebarPane): Rename Scope Chain to Scope Variables.
(WebInspector.ScopeChainSidebarPane.prototype.update): Use the object name as
the subtitle. Use "Global" for the global object title. Use "With Block" for
the title of objects before the locals. Use "No Variables" for the empty
placeholder text for locals.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 53901ad3
2008-05-14 Timothy Hatcher <timothy@apple.com>
Rename the Scope Chain pane to Scope Variables. Name the global
object Global. Name objects before the locals "With Block".
Name colsure scopes "Closure". Name any element or document
after Local, "Event Target" and "Event Document", respectfully.
Reviewed by Adam Roben.
* English.lproj/localizedStrings.js: Add new strings.
* page/inspector/ObjectPropertiesSection.js:
(WebInspector.ObjectPropertiesSection): Add a new argument that is used
for the empty placeholder text.
(WebInspector.ObjectPropertiesSection.prototype.onpopulate): Use the
empty placeholder text.
* page/inspector/ScopeChainSidebarPane.js:
(WebInspector.ScopeChainSidebarPane): Rename Scope Chain to Scope Variables.
(WebInspector.ScopeChainSidebarPane.prototype.update): Use the object name as
the subtitle. Use "Global" for the global object title. Use "With Block" for
the title of objects before the locals. Use "No Variables" for the empty
placeholder text for locals.
2008-05-14 Michael A. Puls II <shadow2531@gmail.com>
Reviewed by Alexey.
Bvar localizedStrings = new Object;
......
......@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
WebInspector.ObjectPropertiesSection = function(object, title, subtitle)
WebInspector.ObjectPropertiesSection = function(object, title, subtitle, emptyPlaceholder)
{
if (!title) {
title = Object.describe(object);
......@@ -34,6 +34,7 @@ WebInspector.ObjectPropertiesSection = function(object, title, subtitle)
}
}
this.emptyPlaceholder = (emptyPlaceholder || WebInspector.UIString("No Properties"));
this.object = object;
WebInspector.PropertiesSection.call(this, title, subtitle);
......@@ -51,7 +52,7 @@ WebInspector.ObjectPropertiesSection.prototype = {
}
if (!this.propertiesTreeOutline.children.length) {
var title = "<div class=\"info\">" + WebInspector.UIString("No Properties") + "</div>";
var title = "<div class=\"info\">" + this.emptyPlaceholder + "</div>";
var infoElement = new TreeElement(title, null, false);
this.propertiesTreeOutline.appendChild(infoElement);
}
......
......@@ -25,7 +25,7 @@
WebInspector.ScopeChainSidebarPane = function()
{
WebInspector.SidebarPane.call(this, WebInspector.UIString("Scope Chain"));
WebInspector.SidebarPane.call(this, WebInspector.UIString("Scope Variables"));
}
WebInspector.ScopeChainSidebarPane.prototype = {
......@@ -48,15 +48,32 @@ WebInspector.ScopeChainSidebarPane.prototype = {
for (var i = 0; i < scopeChain.length; ++i) {
var scopeObject = scopeChain[i];
var title = null;
var subtitle = Object.describe(scopeObject, true);
var emptyPlaceholder = null;
var localScope = false;
if (Object.prototype.toString.call(scopeObject) === "[object Activation]") {
title = WebInspector.UIString("Local");
if (!foundLocalScope)
title = WebInspector.UIString("Local");
else
title = WebInspector.UIString("Closure");
emptyPlaceholder = WebInspector.UIString("No Variables");
subtitle = null;
foundLocalScope = true;
localScope = true;
}
} else if (i === (scopeChain.length - 1))
title = WebInspector.UIString("Global");
else if (foundLocalScope && scopeObject instanceof InspectorController.inspectedWindow().Element)
title = WebInspector.UIString("Event Target");
else if (foundLocalScope && scopeObject instanceof InspectorController.inspectedWindow().Document)
title = WebInspector.UIString("Event Document");
else if (!foundLocalScope && !localScope)
title = WebInspector.UIString("With Block");
var section = new WebInspector.ObjectPropertiesSection(scopeObject, title);
if (!title || title === subtitle)
subtitle = null;
var section = new WebInspector.ObjectPropertiesSection(scopeObject, title, subtitle, emptyPlaceholder);
if (!foundLocalScope || localScope)
section.expanded = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment