Smart package for SuperChat. Superchat is a chat that includes Social Login and Github Flavored Markdown.
Works with Meteor release 0.6.4.1 and below only.
If you don't need persistence see SuperChat-Streams instead.
This package is much more behind than SuperChat-Streams. It presents some bugs that may be not corrected by me. I'm dedicated to the other package.
This package is used and mantained by CodersTV
To install in a new project:
> mrt add superchat
To update an existing project:
> mrt update superchat
You need to configure at least one kind of account. Supported social plataforms now are:
Twitter(Twitter API v1.1 requires OAuth authenticated requests to get profile picture)
For example, with Google:
meteor add accounts-google
<template name="index">
{{> chatroom}}
</template>
If you don't want to have a global chat for entire website, you can set a Path so you can have a different chat box for each Path you set.
What's needed to do on javascript part is set a Path. Path is a reactive source of current page path (like window.location.pathname).
So, whenever it changes, it must be updated calling Path.set(path)
Meteor.pages({
'/': {to: 'index', before: setPath}
});
function setPath () {
Path.set(Meteor.router.path());
}
Meteor.Router.add({
'/': { to: 'index', and: setPath}
});
function setPath () {
Path.set(Meteor.Router.page());
}
Template.parentTemplate.rendered = function() {
$(window).resize(function () {
var height = $(this).height(); // you can set a value you want here
$('#chat-wrapper').height(height);
});
$(window).resize(); // trigger the resize
}