moved format number functions to utils

This commit is contained in:
barisusakli
2014-03-31 14:43:44 -04:00
parent f01cb88c57
commit b1a6d394e3
11 changed files with 35 additions and 35 deletions

View File

@@ -166,11 +166,6 @@ var socket,
});
};
// takes a string like 1000 and returns 1,000
app.addCommas = function (text) {
return text.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
};
// use unique alert_id to have multiple alerts visible at a time, use the same alert_id to fade out the current instance
// type : error, success, info, warning/notify
// title = bolded title text
@@ -362,12 +357,6 @@ var socket,
});
};
app.makeNumbersHumanReadable = function(elements) {
elements.each(function() {
$(this).html(utils.makeNumberHumanReadable($(this).attr('title')));
});
};
app.processPage = function () {
app.populateOnlineUsers();
@@ -376,7 +365,7 @@ var socket,
$('span.timeago').timeago();
$('.post-content img').addClass('img-responsive');
app.makeNumbersHumanReadable($('.human-readable-number'));
utils.makeNumbersHumanReadable($('.human-readable-number'));
app.createUserTooltips();
@@ -407,12 +396,6 @@ var socket,
}
};
app.addCommasToNumbers = function () {
$('.formatted-number').each(function (index, element) {
$(element).html(app.addCommas($(element).html()));
});
};
app.openChat = function (username, touid) {
if (username === app.username) {
app.alert({