Changeset 196692 in webkit


Ignore:
Timestamp:
Feb 17, 2016 8:01:23 AM (8 years ago)
Author:
Matt Baker
Message:

Web Inspector: Add singular and plural cases for "Ignore n times before stopping" label in breakpoint editor
https://bugs.webkit.org/show_bug.cgi?id=154335
<rdar://problem/24655491>

Reviewed by Timothy Hatcher.

  • Localizations/en.lproj/localizedStrings.js:

Added string for singular ignore count.

  • UserInterface/Controllers/BreakpointPopoverController.js:

(WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
Remove unused variable "this._ignoreCount" and update ignore count text.

(WebInspector.BreakpointPopoverController.prototype._popoverIgnoreInputChanged):
Update ignore count text as value changes.

(WebInspector.BreakpointPopoverController.prototype._updateIgnoreCountText):
Set singular text when count === 1, otherwise set plural text.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r196689 r196692  
     12016-02-17  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: Add singular and plural cases for "Ignore n times before stopping" label in breakpoint editor
     4        https://bugs.webkit.org/show_bug.cgi?id=154335
     5        <rdar://problem/24655491>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * Localizations/en.lproj/localizedStrings.js:
     10        Added string for singular ignore count.
     11
     12        * UserInterface/Controllers/BreakpointPopoverController.js:
     13        (WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
     14        Remove unused variable "this._ignoreCount" and update ignore count text.
     15
     16        (WebInspector.BreakpointPopoverController.prototype._popoverIgnoreInputChanged):
     17        Update ignore count text as value changes.
     18
     19        (WebInspector.BreakpointPopoverController.prototype._updateIgnoreCountText):
     20        Set singular text when count === 1, otherwise set plural text.
     21
    1222016-02-16  Nikita Vasilyev  <nvasilyev@apple.com>
    223
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r196549 r196692  
    722722localizedStrings["line "] = "line ";
    723723localizedStrings["originally %s"] = "originally %s";
     724localizedStrings["time before stopping"] = "time before stopping";
    724725localizedStrings["times before stopping"] = "times before stopping";
    725726localizedStrings["value"] = "value";
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/BreakpointPopoverController.js

    r192789 r196692  
    181181                this._ignoreCountInput.type = "number";
    182182                this._ignoreCountInput.min = 0;
    183                 this._ignoreCountInput.value = this._ignoreCount || 0;
     183                this._ignoreCountInput.value = 0;
    184184                this._ignoreCountInput.addEventListener("change", this._popoverIgnoreInputChanged.bind(this));
    185185
    186                 let ignoreCountText = ignoreCountData.appendChild(document.createElement("span"));
    187186                ignoreCountLabel.setAttribute("for", this._ignoreCountInput.id);
    188187                ignoreCountLabel.textContent = WebInspector.UIString("Ignore");
    189                 ignoreCountText.textContent = WebInspector.UIString("times before stopping");
     188
     189                this._ignoreCountText = ignoreCountData.appendChild(document.createElement("span"));
     190                this._updateIgnoreCountText();
    190191            }
    191192
     
    260261        this._ignoreCountInput.value = ignoreCount;
    261262        this._breakpoint.ignoreCount = ignoreCount;
     263
     264        this._updateIgnoreCountText();
    262265    }
    263266
     
    297300            this._actionsContainer.insertBefore(breakpointActionView.element, nextElement);
    298301        }
     302    }
     303
     304    _updateIgnoreCountText()
     305    {
     306        if (this._breakpoint.ignoreCount === 1)
     307            this._ignoreCountText.textContent = WebInspector.UIString("time before stopping");
     308        else
     309            this._ignoreCountText.textContent = WebInspector.UIString("times before stopping");
    299310    }
    300311
Note: See TracChangeset for help on using the changeset viewer.