Feng Forum

Other Topics => Development => Applications => Topic started by: oxydum on November 15, 2008, 11:15:56 am

Title: Hacking the ContentPanel
Post by: oxydum on November 15, 2008, 11:15:56 am
Hi Conrado,

  Today, I'd like to hack the layout.js
Quote
         new og.ContentPanel({
            title: "google",
            id: 'google-panel',
            iconCls: 'ico-google',
            refreshOnWorkspaceChange: false,
            defaultContent: {
                      closable: true,
               type: "url",
               src: "http://www.google.com"
            }
         }),
BUT, that's not working... Any idea^^ ?
Title: Re: Hacking the ContentPanel
Post by: ignacio on November 15, 2008, 05:08:17 pm
Hi oxydum,

What you are trying to do is this:
Code: [Select]
new og.ContentPanel({
title: "google",
id: 'google-panel',
iconCls: 'ico-google',
refreshOnWorkspaceChange: false,
closable: true,
defaultContent: {
type: "url",
data: "http://www.google.com"
}
})

But it won't work due to browser restrictions. Fetching URL's from another domain through AJAX (XmlHtppRequest) isn't allowed. Yo

However, you can achieve the same thing using an iframe, like this:

Code: [Select]
new og.ContentPanel({
title: "Google",
id: 'google-panel',
iconCls: 'ico-google',
refreshOnWorkspaceChange: false,
closable: true,
defaultContent: {
type: "html",
data: '<iframe style="width:100%;height:100%;border:0px;" src="http://www.google.com"></iframe>'
}
})

Also note that in order for the tab icon to be shown there has to be a CSS rule for 'ico-google' defined in some CSS file (for example: 'public/assets/themes/default/stylesheets/og/og.css').

Cheers
Title: Re: Hacking the ContentPanel
Post by: oxydum on November 16, 2008, 05:23:44 am
Hi Ignacio,

  Thank you for this answer, that's exactly what I want to do, and "merci beaucoup" too for the CSS tip  :)

  Now, I wonder to present an extension idea based on web links and tabs, after all, that's a web desk... So, when I'm clicking on a web link, it would open on an new closable tab as easily as your iframe src='weblink'
  Could you think it's possible ?

All the best,
Title: Re: Hacking the ContentPanel
Post by: ignacio on November 16, 2008, 10:35:52 am
Yes, it is possible and very simple to do, and a great idea, though opening links outside OpenGoo has its advantages too, like a bigger client area.

If we go with the idea of opening links insde OpenGoo we can add a toolbar button to the new panel that opens the link outside OpenGoo, and also an option in the WebLinks toolbar to open the link outside.

Opinions anyone?
Title: Re: Hacking the ContentPanel
Post by: soomon on November 17, 2008, 02:22:48 am
mhm as you have opengoo running in a browser you can also open a new tab and then open the web page...
maybe opening it inside opengoo is a nice addon, but i think there are more important features to be deatl with that this one ^^
Title: Re: Hacking the ContentPanel
Post by: earthtech on December 14, 2011, 08:44:09 am
I am using the fengoffice community edition and i tried adding a new tab using an iframe.
The tab is showing but clicking the tab it is not displaying the link set for the tab.