Created
November 26, 2012 15:55
-
-
Save zulfajuniadi/4148925 to your computer and use it in GitHub Desktop.
meteor common helpers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function eventActions(arg){ | |
var action = [ | |
'created a new task.', | |
'started a task.', | |
'finished a task.', | |
'checked a task.', | |
'commented on a task.' | |
]; | |
if(_.isNumber(arg)){ | |
return action[arg]; | |
} | |
else return action; | |
} | |
function unixTime(){ | |
return Math.round((new Date()).getTime() / 1000); | |
} | |
$.fn.genHandle = function(target){ | |
var that = $(this); | |
$(that).keyup(function(){ | |
s = $(that).val(); | |
$(target).val('@' + s.replace(/[aeiou\s]/gi,'').toLowerCase()); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment