Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Sample Propane caveatPatchor.js file
Sample Propane caveatPatchor.js file based on tmm1's avatar hack.
You'll need at least version 1.1.1 to experiment with this:
Once I'm sure exposing this hack-injection point doesn't cause problems
I'll do an official auto-updating version.
As of version 1.1.1, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
Please don't tinker with enhancer.js - it's the glue that binds Campfire's
javascript to Propane's UI and features.
Also: this is totally and utterly unsupported. By all means you can
ask me questions via Propane's help forums but I can't debug your scripts
for you. My javascript isn't that good, trust me.
Finally, if Propane is acting broken in general and you've got hacks in
caveatPatchor.js, *please* tell me about your hacks up-front when opening
an issue on the support site.
var displayAvatars = true;
if (displayAvatars) {
Object.extend(Campfire.Message.prototype, {
addAvatar: function() {
if (this.actsLikeTextMessage()) {
var author = this.authorElement();
if (author.visible()) {
if ('strong').length == 0) {
this.bodyCell.insert({top: '<strong>''</strong><br>'})
author.insert({after: '<img alt="''" width="32" height="32" align="top" style="margin-left: 5px; border-radius:3px" src="'+author.getAttribute('data-avatar')+'">'});
/* if you can wrap rather than rewrite, use swizzle like this: */
swizzle(Campfire.Message, {
setAuthorVisibilityInRelationTo: function($super, message) {
/* defining a new responder is probably the best way to insulate your hacks from Campfire and Propane */
Campfire.AvatarMangler = Class.create({
initialize: function(chat) { = chat;
if (elem.match('tr')) {
var msg = new Campfire.Message(chat, elem)
onMessagesInserted: function(messages) {
var scrolledToBottom =;
for (var i = 0; i < messages.length; i++) {
var message = messages[i];
if (scrolledToBottom);
/* Here is how to install your responder into the running chat */
Campfire.Responders.push("AvatarMangler");"AvatarMangler", "avatarmangler");

thanks. nice scripts:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.