show better os names on Windows and nicer browser names
This commit is contained in:
parent
261516d002
commit
290b18b722
|
|
@ -85,14 +85,18 @@ module.exports.registerHelpers = function registerHelpers() {
|
|||
});
|
||||
|
||||
hb.registerHelper('prettyOSName', function(name) {
|
||||
// TODO make first character upper case and return one windows name
|
||||
// Selenium is used when fetching OS names (for BrowserTime)
|
||||
// and windows has the following names, change them to
|
||||
// just Windows
|
||||
var windows = ['xp', 'windows', 'win8', 'win7'];
|
||||
return name;
|
||||
if (windows.indexOf(name)>-1)
|
||||
return 'Windows';
|
||||
else
|
||||
return name.substr(0, 1).toUpperCase() + name.substr(1);
|
||||
});
|
||||
|
||||
hb.registerHelper('prettyBrowserName', function(name) {
|
||||
// TODO upper case the browser name
|
||||
return name;
|
||||
hb.registerHelper('capitalize', function(word) {
|
||||
return word.substr(0, 1).toUpperCase() + word.substr(1);
|
||||
});
|
||||
|
||||
hb.registerHelper('getPlural', function(value) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h4 id="browserTime"> Page tested with {{prettyBrowserName pageData.browserName}} version {{pageData.browserVersion}} on
|
||||
<h4 id="browserTime"> Page tested with {{capitalize pageData.browserName}} version {{pageData.browserVersion}} on
|
||||
{{prettyOSName pageData.platform}} with {{timingRuns.length}} run{{getPlural timingRuns.length}}.
|
||||
</h4>
|
||||
<div class="table-responsive">
|
||||
|
|
|
|||
Loading…
Reference in New Issue