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
var resetFields = function () { | |
var p = Meteor.user().profile; | |
$('#profile-name').val(p.name); | |
$('#profile-country-list').select2('val', p.country); | |
$('#profile-email').val(Meteor.user().emails[0].address); | |
$('#profile-paypal-email').val(p.paypal_email); | |
$('#profile-password').val(''); | |
$('#profile-confirm-password').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.admin.events = | |
"click #createPost": () -> | |
Meteor.render(() -> | |
"{{> create_news_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
if (MyCollection.find().count() === 0) { | |
// Insert all of the MyCollection data here | |
} |
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
Session.setDefault('game-list-position', 0); // The current position for the skip | |
Session.setDefault('viewport', 10); // The number of games to display in the list | |
Template.gameList.scrollableList = function () { | |
return Games.find({}, { | |
limit: Session.get('viewport'), // Limit the games to the current viewport number | |
skip: Session.get('game-list-position') * Session.get('viewport') // Skip the right number of games | |
}); | |
} |
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
Session.setDefault('done-shit', false); // In the beginning, we haven't done shit | |
Meteor.subscribe('foobar', function () { | |
// We have recieved the data (either for the first time, or in an update) | |
if (Session.equals('done-shit', false)) { | |
// This is the first time we've got it | |
// Do data manipulation, or something | |
Session.set('done-shit', 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
Deps.autorun(function () { | |
// The current game they're playing | |
var game = Games.findOne(Session.get('current-game')); // or whatever your equivalent of that is | |
if (! Session.equals('current-game-version', game.version)) { | |
// The game's version has updated | |
Session.set('current-game-version', game.version); | |
// Alert the user here | |
} | |
}); |
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
client.addListener('PING', function() { | |
Fiber(function() { | |
client.send('PONG'); | |
}).run(); | |
}); |
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
<head> | |
<title>Title</title> | |
<meta charset="utf-8"> | |
<meta name="robots" content="all"> | |
</head> | |
<body> | |
{{> nav_header}} | |
{{> index}} | |
</body> |
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.movie.events({ | |
'click .seen': function (e, t) { | |
// User has set status to "seen", but not exited poster | |
Session.set('seen-movie', true); | |
}, | |
'click .not-seen': function (e, t) { | |
// User has set status to "not seen", but not exited poster | |
Session.set('seen-movie', false); | |
} | |
'mouseout .poster': function (e, t) { |
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.isClient) { | |
function updateHTML(elmId, value) { | |
document.getElementById(elmId).innerHTML = value; | |
} | |
// This function is called when an error is thrown by the player | |
function onPlayerError(errorCode) { | |
alert("An error occured of type:" + errorCode); | |
} |