The following code is in a bookmark button that becomes disabled.
this.quot = function(evt) {
if(evt.shiftKey) {
this.showPopup(this);
return;
}
var link="https://www.google.com/accounts/ServiceLogin?service=cl&passive=true&nui=1&continue=http://www.google.com/calendar/render?hl=en&tab=wc&followup=http://www.google.com/calendar/render?hl=en&tab=wc";
var label="Google Calendar";
var head =(document.getElementById('sidebar-title').getAttribute('value') == label);
switch(evt.button) {
case 0:
gBrowser.selectedTab = gBrowser.addTab(link);
break;
case 1:
gBrowser.addTab(link);
break;
case 2:
if (!head) {
openWebPanel();
var sbLoc = document.getElementById('sidebar').contentDocument.location;
sbLoc.href = link;
document.getElementById('sidebar-box').hidden = false;
document.getElementById('sidebar-title').value = label;
document.getElementById('sidebar-box').collapsed = false;
document.getElementById('sidebar-splitter').hidden = false;
return;
}
if (head) {
toggleSidebar();
}
break;
}
}
this.showPopup = function(node) {
var popup = document.getElementById('custombuttons-contextpopup');
var x = node.boxObject.x;
var y = node.boxObject.y + node.boxObject.height;
document.popupNode = node;
popup.showPopup(node, x, y, 'popup', null, null);
}
this.setAttribute('onclick', 'this.quot(event);');
this.setAttribute('context', '');
this.tooltipText = 'Google Calendar';
}
