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
if (Meteor.is_client) { | |
SimpleRouter = FilteredRouter.extend({ | |
initialize: function() { | |
FilteredRouter.prototype.initialize.call(this); | |
this.filter(this.require_login, {only: ['submit']}); | |
}, | |
require_login: function(page) { | |
console.log(Meteor.user()); | |
if (Meteor.user()) { | |
return page; |
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
Template.single_comment.post = function(){ | |
var selected_comment = Comments.findOne({_id:Session.get('selected_comment_id')}); | |
if(selected_comment){ | |
var post = selected_comment.post; | |
return post; | |
} | |
}; |
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
Template.post.events = { | |
'click input[type=submit]': function(e){ | |
e.preventDefault(); | |
var post = Posts.findOne(Session.get('selected_post_id')); | |
var $comment = $('#comment'); | |
Meteor.call('comment', post, null, $comment.val()); | |
$comment.val(''); | |
} | |
}; |
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
Template.post_page.rendered_class = function(){ | |
if(firstTimeRendered){ | |
firstTimeRendered=false; | |
return "opened"; | |
}else{ | |
return "queued"; | |
} | |
} |
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
<template name="post_page"> | |
<div class="single-post grid"> | |
{{#with post}} | |
{{> post_item}} | |
{{/with}} | |
{{#if show_comment_form}} | |
<div class="comment-new"> | |
<form> | |
<div class="comment-field"> | |
<textarea id="comment" rows="3" autofocus="autofocus"></textarea> |
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
// in comment_list.js | |
Session.set('comments_rendered', false); | |
Template.comment_list.rendered = function(){ | |
var numberOfComments=Comments.find({post: Session.get('selected_post_id')}).count(); | |
var commentsRendered=this.findAll(".comment").length; | |
if(numberOfComments==commentsRendered){ | |
console.log(numberOfComments+" comments rendered"); | |
Session.set('comments_rendered', true); |
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
2012-09-11T01:12:34+00:00 heroku[api]: Deploy c2dd4f8 by sacha357@gmail.com | |
2012-09-11T01:12:34+00:00 heroku[slugc]: Slug compilation finished | |
2012-09-11T01:12:36+00:00 heroku[web.1]: Starting process with command `MONGO_URL=mongodb://heroku:addb2250dda415c0da9f3bf2ec646e01@alex.mongohq.com:10052/app7339374 .meteor/heroku_build/bin/node .meteor/heroku_build/app/main.js` | |
2012-09-11T01:12:37+00:00 app[web.1]: node.js:201 | |
2012-09-11T01:12:37+00:00 app[web.1]: | |
2012-09-11T01:12:37+00:00 app[web.1]: throw e; // process.nextTick error, or 'error' event on first tick | |
2012-09-11T01:12:37+00:00 app[web.1]: ^ | |
2012-09-11T01:12:37+00:00 app[web.1]: TypeError: Object #<Object> has no method 'existsSync' | |
2012-09-11T01:12:37+00:00 app[web.1]: at /app/.meteor/heroku_build/app/server/server.js:77:10 | |
2012-09-11T01:12:37+00:00 app[web.1]: at Object.<anonymous> (/app/.meteor/heroku_build/app/server/server.js:150:1) |
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
Downloading Meteor development bundle | |
######################################################################## 100.0% | |
✓ router | |
tag: https://github.com/tmeasday/meteor-router.git#v0.1.0 | |
✓ deps-extensions | |
branch: https://github.com/tmeasday/meteor-deps-extensions.git#master | |
Done installing smart packages | |
Ok, everything's ready. Here comes Meteor! |
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
uilding meteor bundle | |
Stand back while Meteorite does it's thing | |
Installing Meteor | |
branch: https://github.com/meteor/meteor.git#auth | |
Installing smart packages | |
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
// GoSquared | |
if (goSquaredId = getSetting("goSquaredId")) { | |
var GoSquared = {}; | |
GoSquared.acct = goSquaredId; | |
window._gstc_lt = +new Date; | |
var d = document, g = d.createElement("script"); | |
g.type = "text/javascript"; | |
g.src = "//d1l6p2sc9645hc.cloudfront.net/tracker.js"; | |
var s = d.getElementsByTagName("script")[0]; | |
s.parentNode.insertBefore(g, s); |
OlderNewer