This file contains hidden or 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
postData = {}; // Setup the postData global | |
// Have this run on startup. | |
Meteor.startup(function(){ | |
postsData = [ | |
{ | |
title: 'Introducing Telescope', | |
author: 'Sacha Greif', | |
url: 'http://sachagreif.com/introducing-telescope/' |
This file contains hidden or 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
currentCategory: function () { | |
return this.slug; // Make the capitolization correct | |
} |
This file contains hidden or 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
Template.myPosts.helpers({ | |
posts: function(){ | |
var posts = Posts.find({}).fetch(); | |
return posts | |
} | |
}) |
This file contains hidden or 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
//Collection: | |
Site = new Meteor.Collection('site'); | |
// Publication: | |
Meteor.publish('site', function () { | |
var host = headers.get(this, 'host'); | |
return Site.find({'domain': host}); | |
}); | |
This file contains hidden or 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
// helper for all templates. | |
Handlebars.registerHelper("site", function(){ | |
return Site.findOne({}); // Missing the query for the collection here. Need to narrow it down. | |
}); | |
Handlebars.registerHelper("siteTheme", function(){ | |
site = Site.findOne({}); // See comment on line 3. | |
if(typeof site == 'object'){ | |
Session.set('theme', site.theme); | |
} |
This file contains hidden or 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
[digilord@Io meteor-weak-dependency-test[master]]$ meteor | |
[[[[[ ~/projects/meteor-weak-dependency-test ]]]]] | |
=> Errors prevented startup: | |
While building package `weak-test`: | |
error: no such package: 'iron-router' | |
=> Your application has errors. Waiting for file change. |
This file contains hidden or 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
@Lexicon = new Meteor.Collection "lexicon" | |
if Meteor.isServer | |
Meteor.methods | |
Langs: -> Lexicon.distinct('lang') | |
if Meteor.isClient | |
Meteor.call 'Langs', (err, res) -> | |
console.log res |
This file contains hidden or 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
@Lexicon = new Meteor.Collection "lexicon" | |
@Langs = new Meteor.Collection(null) | |
if Meteor.isServer | |
for lang in Lexicon.distinct('lang') | |
Langs.insert lang | |
Meteor.publish 'lexicon', () -> | |
return Lexicon.find() |
This file contains hidden or 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
@Lexicon = new Meteor.Collection "lexicon" | |
if Meteor.isClient | |
Template.language_dropdown.rendered = -> | |
Lexicon.distinct "lang", (err, res) => | |
$("#langs").autocomplete {source: res} |
This file contains hidden or 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
class @AuthorizedController extends RouteController | |
before: -> | |
console.log 'AuthorizedController :before action' | |
if not Meteor.user()? | |
@redirect 'salesLanding' |