Created
April 6, 2009 14:28
-
-
Save cyu/90771 to your computer and use it in GitHub Desktop.
Fixes a clipping issue when running Campfire in Fluid
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
// ==UserScript== | |
// @name Fix Chat ViewPort width | |
// @namespace http://blog.codeeg.com | |
// @description Fix clipping of campfire chats | |
// @include * | |
// @author Calvin Yu | |
// ==/UserScript== | |
(function () { | |
if (window.fluid) { | |
Campfire.LayoutManager.prototype.adjustChatMessageColumnWidth = function() { | |
if (this.chat.IE && !this.chat.IE7) return false; | |
var viewportWidth = this.getChatViewportWidth(); | |
var authorColumnWidth = this.getChatAuthorColumnWidth(); | |
var messageColumnWidth = viewportWidth - authorColumnWidth - 15; | |
var stylesheet = $A(document.styleSheets).last(); | |
var rules = stylesheet.cssRules || stylesheet.rules; | |
var style = rules[rules.length - 1].style; | |
if (style) style.width = messageColumnWidth + 'px'; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment