mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -05:00

* {{currentUser.isAdmin}} instead of custom helpers. * drop currentUserIsAdmin session variable. relies on fix to meteor's handlebars evaluator in 0.4.2.
36 lines
872 B
JavaScript
36 lines
872 B
JavaScript
t=function(message){
|
|
var d=new Date();
|
|
console.log("### "+message+" rendered at "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds());
|
|
}
|
|
|
|
nl2br= function(str) {
|
|
var breakTag = '<br />';
|
|
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ breakTag +'$2');
|
|
}
|
|
|
|
getSetting = function(setting){
|
|
var settings=Settings.find().fetch()[0];
|
|
if(settings){
|
|
return settings[setting];
|
|
}
|
|
return '';
|
|
}
|
|
|
|
getCurrentUserEmail = function(){
|
|
return Meteor.user() ? Meteor.user().emails[0].email : '';
|
|
}
|
|
|
|
trackEvent = function(event, properties){
|
|
var properties= (typeof properties === 'undefined') ? {} : properties;
|
|
if(typeof mixpanel.track != 'undefined'){
|
|
mixpanel.track(event, properties);
|
|
}
|
|
}
|
|
|
|
sessionSetObject=function(name, value){
|
|
Session.set(name, JSON.stringify(value));
|
|
}
|
|
|
|
sessionGetObject=function(name){
|
|
return JSON.parse(Session.get(name));
|
|
}
|