Changeset 53328 in webkit


Ignore:
Timestamp:
Jan 15, 2010 3:20:21 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2010-01-14 Mikhail Naganov <mnaganov@chromium.org>

Reviewed by Timothy Hatcher.

Add welcome screen to Profiles pane to provide some instructions for novices.

https://bugs.webkit.org/show_bug.cgi?id=19268

  • English.lproj/localizedStrings.js:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • inspector/front-end/ProfileView.js: (WebInspector.CPUProfileType.prototype.get welcomeMessage):
  • inspector/front-end/ProfilesPanel.js: (WebInspector.ProfileType.prototype.get welcomeMessage): (WebInspector.ProfilesPanel): (WebInspector.ProfilesPanel.prototype.show): (WebInspector.ProfilesPanel.prototype.registerProfileType): (WebInspector.ProfilesPanel.prototype._addWelcomeMessage.messageButtonClicked): (WebInspector.ProfilesPanel.prototype._addWelcomeMessage): (WebInspector.ProfilesPanel.prototype.showProfile): (WebInspector.ProfilesPanel.prototype.closeVisibleView): (WebInspector.ProfilesPanel.prototype._updateInterface):
  • inspector/front-end/WebKit.qrc:
  • inspector/front-end/WelcomeView.js: Added. (WebInspector.WelcomeView): (WebInspector.WelcomeView.prototype._windowResized): (WebInspector.WelcomeView.prototype.addMessage):
  • inspector/front-end/inspector.css:
  • inspector/front-end/inspector.html:
Location:
trunk/WebCore
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53327 r53328  
     12010-01-14  Mikhail Naganov  <mnaganov@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Add welcome screen to Profiles pane to provide some instructions for novices.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=19268
     8
     9        * English.lproj/localizedStrings.js:
     10        * WebCore.gypi:
     11        * WebCore.vcproj/WebCore.vcproj:
     12        * inspector/front-end/ProfileView.js:
     13        (WebInspector.CPUProfileType.prototype.get welcomeMessage):
     14        * inspector/front-end/ProfilesPanel.js:
     15        (WebInspector.ProfileType.prototype.get welcomeMessage):
     16        (WebInspector.ProfilesPanel):
     17        (WebInspector.ProfilesPanel.prototype.show):
     18        (WebInspector.ProfilesPanel.prototype.registerProfileType):
     19        (WebInspector.ProfilesPanel.prototype._addWelcomeMessage.messageButtonClicked):
     20        (WebInspector.ProfilesPanel.prototype._addWelcomeMessage):
     21        (WebInspector.ProfilesPanel.prototype.showProfile):
     22        (WebInspector.ProfilesPanel.prototype.closeVisibleView):
     23        (WebInspector.ProfilesPanel.prototype._updateInterface):
     24        * inspector/front-end/WebKit.qrc:
     25        * inspector/front-end/WelcomeView.js: Added.
     26        (WebInspector.WelcomeView):
     27        (WebInspector.WelcomeView.prototype._windowResized):
     28        (WebInspector.WelcomeView.prototype.addMessage):
     29        * inspector/front-end/inspector.css:
     30        * inspector/front-end/inspector.html:
     31
    1322010-01-13  Girish Ramakrishnan  <girish@forwardbias.in>
    233
  • trunk/WebCore/WebCore.gypi

    r53308 r53328  
    37383738            'inspector/front-end/View.js',
    37393739            'inspector/front-end/WatchExpressionsSidebarPane.js',
     3740            'inspector/front-end/WelcomeView.js',
    37403741            'inspector/front-end/audits.css',
    37413742            'inspector/front-end/inspector.css',
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r53205 r53328  
    4293242932                                        >
    4293342933                                </File>
     42934                                <File
     42935                                        RelativePath="..\inspector\front-end\WelcomeView.js"
     42936                                        >
     42937                                </File>
    4293442938                        </Filter>
    4293542939                </Filter>
  • trunk/WebCore/inspector/front-end/ProfileView.js

    r51528 r53328  
    600600    },
    601601
     602    get welcomeMessage()
     603    {
     604        return WebInspector.UIString("Start CPU profiling by pressing<br>the %s button on the status bar.");
     605    },
     606
    602607    setRecordingProfile: function(isProfiling)
    603608    {
  • trunk/WebCore/inspector/front-end/ProfilesPanel.js

    r51528 r53328  
    7171    },
    7272
     73    get welcomeMessage()
     74    {
     75        return "";
     76    },
     77
    7378    // Must be implemented by subclasses.
    7479    createView: function(profile)
     
    111116    this.profileViewStatusBarItemsContainer = document.createElement("div");
    112117    this.profileViewStatusBarItemsContainer.id = "profile-view-status-bar-items";
     118
     119    this.welcomeView = new WebInspector.WelcomeView("profiles", WebInspector.UIString("Welcome to the Profiles panel"));
     120    this.element.appendChild(this.welcomeView.element);
    113121
    114122    this._profiles = [];
     
    150158    {
    151159        WebInspector.Panel.prototype.show.call(this);
     160        this.welcomeView.show();
    152161        if (this._shouldPopulateProfiles)
    153162            this._populateProfiles();
     
    204213        this.sidebarTree.appendChild(profileType.treeElement);
    205214        profileType.treeElement.expand();
     215        this._addWelcomeMessage(profileType);
     216    },
     217
     218    _addWelcomeMessage: function(profileType)
     219    {
     220        var message = profileType.welcomeMessage;
     221        // Message text is supposed to have a '%s' substring as a placeholder
     222        // for a status bar button. If it is there, we split the message in two
     223        // parts, and insert the button between them.
     224        var buttonPos = message.indexOf("%s");
     225        if (buttonPos > -1) {
     226            var container = document.createDocumentFragment();
     227            var part1 = document.createElement("span");
     228            part1.innerHTML = message.substr(0, buttonPos);
     229            container.appendChild(part1);
     230     
     231            var button = new WebInspector.StatusBarButton(profileType.buttonTooltip, profileType.buttonStyle, profileType.buttonCaption);
     232            button.element.addEventListener("click", profileType.buttonClicked.bind(profileType), false);
     233            container.appendChild(button.element);
     234       
     235            var part2 = document.createElement("span");
     236            part2.innerHTML = message.substr(buttonPos + 2);
     237            container.appendChild(part2);
     238            this.welcomeView.addMessage(container);
     239        } else
     240            this.welcomeView.addMessage(message);
    206241    },
    207242
     
    277312            return;
    278313
     314        this.welcomeView.hide();
    279315        if (this.visibleView)
    280316            this.visibleView.hide();
     
    330366            this.visibleView.hide();
    331367        delete this.visibleView;
     368        this.welcomeView.show();
    332369    },
    333370
     
    408445            this.profileViewStatusBarItemsContainer.removeStyleClass("hidden");
    409446            this.panelEnablerView.visible = false;
     447            this.welcomeView.visible = true;
    410448        } else {
    411449            this.enableToggleButton.title = WebInspector.UIString("Profiling disabled. Click to enable.");
     
    414452                this._profileTypeButtonsByIdMap[typeId].addStyleClass("hidden");
    415453            this.profileViewStatusBarItemsContainer.addStyleClass("hidden");
     454            this.welcomeView.visible = false;
    416455            this.panelEnablerView.visible = true;
    417456        }
  • trunk/WebCore/inspector/front-end/WebKit.qrc

    r53205 r53328  
    8686    <file>View.js</file>
    8787    <file>WatchExpressionsSidebarPane.js</file>
     88    <file>WelcomeView.js</file>
    8889    <file>audits.css</file>
    8990    <file>inspector.css</file>
  • trunk/WebCore/inspector/front-end/inspector.css

    r53263 r53328  
    22572257}
    22582258
    2259 .panel-enabler-view button, .pane button {
     2259.panel-enabler-view button:not(.status-bar-item), .pane button {
    22602260    color: rgb(6, 6, 6);
    22612261    background-color: transparent;
     
    22672267}
    22682268
    2269 .panel-enabler-view button {
     2269.panel-enabler-view button:not(.status-bar-item) {
    22702270    font-size: 13px;
    22712271    margin: 6px 0 0 0;
    22722272    padding: 3px 20px;
    22732273    height: 24px;
     2274}
     2275
     2276.panel-enabler-view.welcome {
     2277    z-index: auto;
     2278    left: 200px;
     2279}
     2280
     2281.panel-enabler-view.welcome img {
     2282    height: 90%;
     2283    min-height: 180px;
     2284    max-width: 90%;
     2285}
     2286
     2287.panel-enabler-view.welcome .instructions {
     2288    display: inline-block;
     2289    vertical-align: middle;
     2290    width: 330px;
     2291    margin: 0;
     2292    padding: 15px;
     2293    white-space: normal;
     2294    line-height: 175%;
     2295}
     2296
     2297.panel-enabler-view.welcome .message {
     2298    margin-bottom: 2ex;
     2299}
     2300
     2301.panel-enabler-view.welcome button.status-bar-item {
     2302    vertical-align: middle;
    22742303}
    22752304
  • trunk/WebCore/inspector/front-end/inspector.html

    r53205 r53328  
    7979    <script type="text/javascript" src="StylesSidebarPane.js"></script>
    8080    <script type="text/javascript" src="PanelEnablerView.js"></script>
     81    <script type="text/javascript" src="WelcomeView.js"></script>
    8182    <script type="text/javascript" src="StatusBarButton.js"></script>
    8283    <script type="text/javascript" src="SummaryBar.js"></script>
Note: See TracChangeset for help on using the changeset viewer.