GUI -- Clean up of index.html and onos.js generation.
Change-Id: Icc1cdeb0e36b29bb76cee9d90fb342e131b78644
diff --git a/web/gui/src/main/webapp/app/fw/util/fn.js b/web/gui/src/main/webapp/app/fw/util/fn.js
index defb845..14060b9 100644
--- a/web/gui/src/main/webapp/app/fw/util/fn.js
+++ b/web/gui/src/main/webapp/app/fw/util/fn.js
@@ -223,9 +223,7 @@
// return the given string with the first character capitalized.
function cap(s) {
- return s.toLowerCase().replace(/^[a-z]/, function (m) {
- return m.toUpperCase();
- });
+ return s ? s[0].toUpperCase() + s.slice(1) : s;
}
// return the parameter without a px suffix
diff --git a/web/gui/src/main/webapp/app/view/app/app.js b/web/gui/src/main/webapp/app/view/app/app.js
index 2cca7c0..16c1e72 100644
--- a/web/gui/src/main/webapp/app/view/app/app.js
+++ b/web/gui/src/main/webapp/app/view/app/app.js
@@ -326,13 +326,9 @@
['scroll down', 'See more apps']
]);
- function capitalize(s) {
- return s ? s[0].toUpperCase() + s.slice(1) : s;
- }
-
function createConfirmationText(action, itemId) {
var content = ds.createDiv();
- content.append('p').text(capitalize(action) + ' ' + itemId);
+ content.append('p').text(fs.cap(action) + ' ' + itemId);
if (strongWarning[itemId]) {
content.append('p').text(discouragement).classed('strong', true);
}