Skip to content

Instantly share code, notes, and snippets.

Template.layout.events({
'click .terms-modal': function() {
Session.set('showTermsModal', true);
}
});
Template.layout.helpers({
termsModalOpen: function() {
return !!Session.get('showTermsModal');
}
UI.registerHelper('sourceCode', function() {
return Template.sourceCode;
});
<template name="sourceCode">
<pre><code data-language="html">
{{> UI.contentBlock}}
</code></pre>
</template>
Template.facetFilterItem.helpers({
isChecked: function(name, _id) {
return _.indexOf(Facet.get(name), _id) !== -1;
}
});
Facet = (function() {
var set = function(name, value) {
var current = Router.current();
var params = {};
Router.query = (function(router) {
var current = function() {
return router.current();
};
var currentParams = function() {
return current().params;
};
var currentQueryParams = function() {
Tinytest.add('Working', function(test) {
Books = new Meteor.Collection('books' + test.id);
Authors = new Meteor.Collection('authors' + test.id);
var author1 = Authors.insert({
firstName: 'Charles',
lastName: 'Darwin'
});
var book1 = Books.insert({
sendVideoMessagingSMS: function(to, message) {
check([this.userId, to, message], [String]);
twilio.sendSms({
to: to,
from: "...",
body: message
}, function(error, response) {
if (error)
throw new Meteor.Error(503, "Failed to send SMS.");
// Link service accounts when signed in
orig_updateOrCreateUserFromExternalService = Accounts.updateOrCreateUserFromExternalService;
Accounts.updateOrCreateUserFromExternalService = function(serviceName, serviceData, options) {
var loggedInUser = Meteor.user();
if (loggedInUser) {
var setAttr = {};
setAttr['linkedServices.' + serviceName] = serviceData;
Meteor.users.update(loggedInUser._id, { $set: setAttr });
GroupOneController = RouteController.extend({
activeTab: 'groupOne',
// ...
});
PageController = GroupOneController.extend({
// inherits 'activeTab'
// ...
});
Router.handlebars = function(options) {
options = options || {};
options.data = options.data || {};
if (! options.template)
throw new Meteor.Error("Router.handlebars: options.template is required");
if (! options.path)
throw new Meteor.Error("Router.handlebars: options.path is required");
return {
if (Meteor.isServer) {
Router.handlebars = (function(fn) {
return function (options) {
options.template = Handlebars.templates[options.template];
return fn(options);
};
}(Router.handlebars));
}
Router.configure({