Montag, 22. August 2011

Woot

//
// everypage_early.js
//
// This content script gets injected into every page, enabling us to inject the conduit community toolbar
// into the DOM of the page.
//

var contentScript = {
'wasInit': false
};

var early = {
baseIframeId: 'CWTBiframe',
toolbarHeight: 34,
toolbarPositionTop: null,
bodyTop: null,
numVisibleToolbars: null,
containerIframeId: null,
scriptId: "CTID_ContentScript",
wasInit: false,
createToolbar: function (timeoutWait) {
var me = this;

if (typeof (this.didInsertStyle) == "undefined") {
this.didInsertStyle = true;

// And add a style element to reserve 30px above the body.
var style = document.createElement('style');
var text = "html { padding-top: " + this.bodyTop + "px !important; } body { position:relative !important; }";
var styleText = document.createTextNode(text);
style.appendChild(styleText);
style.setAttribute("type", "text/css");
if (!(window.menubar.visible === false && window.statusbar.visible === false)) {
document.documentElement.appendChild(style);
}
}

if (document.body) {
if (document.body.tagName.toLowerCase() != "frameset") {
// Directly position the body to make room for our toolbar. This may seem redundant
// with the code above that appends a