Created
December 29, 2011 18:46
-
-
Save protocool/1535541 to your computer and use it in GitHub Desktop.
Propane caveatPatchor.js snippet for a /clear command
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
/* | |
Add a /clear command to clear out the chat transcript in Propane. | |
Place this snippet into: | |
~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
*/ | |
Campfire.Speaker.Filters.push( | |
function(message) { | |
var match; | |
if (match = message.match(/^\/clear\s*$/)) { | |
chat.transcript.trimHistoryBy(100) | |
return false; | |
} else { | |
return message; | |
} | |
} | |
); | |
chat.speaker.filters = Campfire.Speaker.Filters.toArray(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment