add support for user-specified sidebar, and support the "height" attribute (for messenger)
remove the 5em height from the flashpanel because it doesn't seem to work for iframes
This commit is contained in:
Родитель
d093ca4e66
Коммит
e547078583
|
@ -32,17 +32,26 @@
|
|||
var RDF = Components.classes['component://netscape/rdf/rdf-service'].getService()
|
||||
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService)
|
||||
|
||||
var sidebar = new Object
|
||||
sidebar.db = 'chrome://sidebar/content/sidebar.rdf'
|
||||
sidebar.resource = 'NC:SidebarRoot'
|
||||
var defaultsidebar = new Object
|
||||
defaultsidebar.db = 'chrome://sidebar/content/sidebar.rdf'
|
||||
defaultsidebar.resource = 'NC:SidebarRoot'
|
||||
|
||||
function sidebarOverlayInit()
|
||||
// the current sidebar:
|
||||
var sidebar;
|
||||
|
||||
function sidebarOverlayInit(usersidebar)
|
||||
{
|
||||
var sidebar_element = document.getElementById('sidebarbox');
|
||||
if (sidebar_element.getAttribute('hidden')) {
|
||||
return
|
||||
}
|
||||
|
||||
// load up user-specified sidebar
|
||||
if (!usersidebar)
|
||||
sidebar = defaultsidebar;
|
||||
else
|
||||
sidebar = usersidebar;
|
||||
|
||||
var registry
|
||||
try {
|
||||
// First try to construct a new one and load it
|
||||
|
@ -97,6 +106,7 @@ function addSidebarPanel(parent, registry, service, is_last) {
|
|||
var iframe = document.createElement('html:iframe')
|
||||
|
||||
iframe.setAttribute('src', panel_content)
|
||||
if (panel_height) iframe.setAttribute('height', panel_height);
|
||||
dump("panel_content="+panel_content+"\n")
|
||||
if (is_last) {
|
||||
//iframe.setAttribute('flex', '100%')
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
<RDF:Description ID="flash">
|
||||
<NC:title>&sidebar.flash.label;</NC:title>
|
||||
<NC:content>chrome://sidebar/content/flash.xul</NC:content>
|
||||
<NC:height>5em</NC:height>
|
||||
</RDF:Description>
|
||||
</RDF:li>
|
||||
<RDF:li>
|
||||
|
|
|
@ -32,17 +32,26 @@
|
|||
var RDF = Components.classes['component://netscape/rdf/rdf-service'].getService()
|
||||
RDF = RDF.QueryInterface(Components.interfaces.nsIRDFService)
|
||||
|
||||
var sidebar = new Object
|
||||
sidebar.db = 'chrome://sidebar/content/sidebar.rdf'
|
||||
sidebar.resource = 'NC:SidebarRoot'
|
||||
var defaultsidebar = new Object
|
||||
defaultsidebar.db = 'chrome://sidebar/content/sidebar.rdf'
|
||||
defaultsidebar.resource = 'NC:SidebarRoot'
|
||||
|
||||
function sidebarOverlayInit()
|
||||
// the current sidebar:
|
||||
var sidebar;
|
||||
|
||||
function sidebarOverlayInit(usersidebar)
|
||||
{
|
||||
var sidebar_element = document.getElementById('sidebarbox');
|
||||
if (sidebar_element.getAttribute('hidden')) {
|
||||
return
|
||||
}
|
||||
|
||||
// load up user-specified sidebar
|
||||
if (!usersidebar)
|
||||
sidebar = defaultsidebar;
|
||||
else
|
||||
sidebar = usersidebar;
|
||||
|
||||
var registry
|
||||
try {
|
||||
// First try to construct a new one and load it
|
||||
|
@ -97,6 +106,7 @@ function addSidebarPanel(parent, registry, service, is_last) {
|
|||
var iframe = document.createElement('html:iframe')
|
||||
|
||||
iframe.setAttribute('src', panel_content)
|
||||
if (panel_height) iframe.setAttribute('height', panel_height);
|
||||
dump("panel_content="+panel_content+"\n")
|
||||
if (is_last) {
|
||||
//iframe.setAttribute('flex', '100%')
|
||||
|
|
Загрузка…
Ссылка в новой задаче