Changeset 52149 in webkit


Ignore:
Timestamp:
Dec 15, 2009 3:29:08 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-15 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Pavel Feldman.

Extract WebInspector.Section from WebInspector.PropertiesSection.
https://bugs.webkit.org/show_bug.cgi?id=32523

Location:
trunk/WebCore
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r52146 r52149  
     12009-12-15  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Extract WebInspector.Section from WebInspector.PropertiesSection.
     6        https://bugs.webkit.org/show_bug.cgi?id=32523
     7
     8        * WebCore.gypi:
     9        * WebCore.vcproj/WebCore.vcproj:
     10        * inspector/front-end/PropertiesSection.js:
     11        (WebInspector.PropertiesSection):
     12        * inspector/front-end/Section.js: Added.
     13        (WebInspector.Section):
     14        (WebInspector.Section.prototype.get title):
     15        (WebInspector.Section.prototype.set title):
     16        (WebInspector.Section.prototype.get subtitle):
     17        (WebInspector.Section.prototype.set subtitle):
     18        (WebInspector.Section.prototype.get expanded):
     19        (WebInspector.Section.prototype.set expanded):
     20        (WebInspector.Section.prototype.get populated):
     21        (WebInspector.Section.prototype.set populated):
     22        (WebInspector.Section.prototype.expand):
     23        (WebInspector.Section.prototype.collapse):
     24        (WebInspector.Section.prototype.toggleExpanded):
     25        * inspector/front-end/WebKit.qrc:
     26        * inspector/front-end/inspector.html:
     27
    1282009-12-15  Eric Seidel  <eric@webkit.org>
    229
  • trunk/WebCore/WebCore.gypi

    r52103 r52149  
    37013701            'inspector/front-end/ScriptsPanel.js',
    37023702            'inspector/front-end/ScriptView.js',
     3703            'inspector/front-end/Section.js',
    37033704            'inspector/front-end/SidebarPane.js',
    37043705            'inspector/front-end/SidebarTreeElement.js',
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r52103 r52149  
    4262142621                                </File>
    4262242622                                <File
     42623                                        RelativePath="..\inspector\front-end\Section.js"
     42624                                        >
     42625                                </File>
     42626                                <File
    4262342627                                        RelativePath="..\inspector\front-end\SidebarPane.js"
    4262442628                                        >
  • trunk/WebCore/inspector/front-end/PropertiesSection.js

    r52099 r52149  
    11/*
    22 * Copyright (C) 2007 Apple Inc.  All rights reserved.
     3 * Copyright (C) 2009 Google Inc.  All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2930WebInspector.PropertiesSection = function(title, subtitle)
    3031{
    31     this.element = document.createElement("div");
    32     this.element.className = "section";
    33 
    34     this.headerElement = document.createElement("div");
    35     this.headerElement.className = "header";
    36 
    37     this.titleElement = document.createElement("div");
    38     this.titleElement.className = "title";
    39 
    40     this.subtitleElement = document.createElement("div");
    41     this.subtitleElement.className = "subtitle";
    42 
    43     this.headerElement.appendChild(this.subtitleElement);
    44     this.headerElement.appendChild(this.titleElement);
    45 
    46     this.headerElement.addEventListener("click", this.toggleExpanded.bind(this), false);
     32    WebInspector.Section.call(this, title, subtitle);
    4733
    4834    this.propertiesElement = document.createElement("ol");
     
    5238    this.propertiesTreeOutline.section = this;
    5339
    54     this.element.appendChild(this.headerElement);
    5540    this.element.appendChild(this.propertiesElement);
    56 
    57     this.title = title;
    58     this.subtitle = subtitle;
    59     this._expanded = false;
    6041}
    6142
    62 WebInspector.PropertiesSection.prototype = {
    63     get title()
    64     {
    65         return this._title;
    66     },
    67 
    68     set title(x)
    69     {
    70         if (this._title === x)
    71             return;
    72         this._title = x;
    73 
    74         if (x instanceof Node) {
    75             this.titleElement.removeChildren();
    76             this.titleElement.appendChild(x);
    77         } else
    78           this.titleElement.textContent = x;
    79     },
    80 
    81     get subtitle()
    82     {
    83         return this._subtitle;
    84     },
    85 
    86     set subtitle(x)
    87     {
    88         if (this._subtitle === x)
    89             return;
    90         this._subtitle = x;
    91         this.subtitleElement.innerHTML = x;
    92     },
    93 
    94     get expanded()
    95     {
    96         return this._expanded;
    97     },
    98 
    99     set expanded(x)
    100     {
    101         if (x)
    102             this.expand();
    103         else
    104             this.collapse();
    105     },
    106 
    107     get populated()
    108     {
    109         return this._populated;
    110     },
    111 
    112     set populated(x)
    113     {
    114         this._populated = x;
    115         if (!x && this.onpopulate && this._expanded) {
    116             this.onpopulate(this);
    117             this._populated = true;
    118         }
    119     },
    120 
    121     expand: function()
    122     {
    123         if (this._expanded)
    124             return;
    125         this._expanded = true;
    126         this.element.addStyleClass("expanded");
    127 
    128         if (!this._populated && this.onpopulate) {
    129             this.onpopulate(this);
    130             this._populated = true;
    131         }
    132     },
    133 
    134     collapse: function()
    135     {
    136         if (!this._expanded)
    137             return;
    138         this._expanded = false;
    139         this.element.removeStyleClass("expanded");
    140     },
    141 
    142     toggleExpanded: function()
    143     {
    144         this.expanded = !this.expanded;
    145     }
    146 }
     43WebInspector.PropertiesSection.prototype.__proto__ = WebInspector.Section.prototype;
  • trunk/WebCore/inspector/front-end/Section.js

    r52148 r52149  
    11/*
    22 * Copyright (C) 2007 Apple Inc.  All rights reserved.
     3 * Copyright (C) 2009 Google Inc.  All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    2728 */
    2829
    29 WebInspector.PropertiesSection = function(title, subtitle)
     30WebInspector.Section = function(title, subtitle)
    3031{
    3132    this.element = document.createElement("div");
     
    4546
    4647    this.headerElement.addEventListener("click", this.toggleExpanded.bind(this), false);
    47 
    48     this.propertiesElement = document.createElement("ol");
    49     this.propertiesElement.className = "properties";
    50     this.propertiesElement.tabIndex = 0;
    51     this.propertiesTreeOutline = new TreeOutline(this.propertiesElement);
    52     this.propertiesTreeOutline.section = this;
    53 
    5448    this.element.appendChild(this.headerElement);
    55     this.element.appendChild(this.propertiesElement);
    5649
    5750    this.title = title;
     
    6053}
    6154
    62 WebInspector.PropertiesSection.prototype = {
     55WebInspector.Section.prototype = {
    6356    get title()
    6457    {
  • trunk/WebCore/inspector/front-end/WebKit.qrc

    r51839 r52149  
    5454    <file>ScriptsPanel.js</file>
    5555    <file>ScriptView.js</file>
     56    <file>Section.js</file>
    5657    <file>SidebarPane.js</file>
    5758    <file>SidebarTreeElement.js</file>
  • trunk/WebCore/inspector/front-end/inspector.html

    r52099 r52149  
    6363    <script type="text/javascript" src="ElementsTreeOutline.js"></script>
    6464    <script type="text/javascript" src="SidebarTreeElement.js"></script>
     65    <script type="text/javascript" src="Section.js"></script>
    6566    <script type="text/javascript" src="PropertiesSection.js"></script>
    6667    <script type="text/javascript" src="ObjectProxy.js"></script>
Note: See TracChangeset for help on using the changeset viewer.