utils.js 430 B

12345678910111213141516171819
  1. capitalize = function(str) {
  2. return str.charAt(0).toUpperCase() + str.slice(1);
  3. };
  4. signedInAs = function() {
  5. var user = Meteor.user();
  6. if (user) {
  7. if (user.username) {
  8. return user.username;
  9. } else if (user.profile && user.profile.name) {
  10. return user.profile.name;
  11. } else if (user.emails && user.emails[0]) {
  12. return user.emails[0].address;
  13. } else {
  14. return "Signed In";
  15. }
  16. }
  17. };