Feng Forum

Other Topics => Development => Applications => : oxydum November 15, 2008, 11:15:56 AM

: Hacking the ContentPanel
: oxydum November 15, 2008, 11:15:56 AM
Hi Conrado,

  Today, I'd like to hack the layout.js
         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^^ ?
: Re: Hacking the ContentPanel
: ignacio November 15, 2008, 05:08:17 PM
Hi oxydum,

What you are trying to do is this:
:
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:

:
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
: Re: Hacking the ContentPanel
: oxydum 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,
: Re: Hacking the ContentPanel
: ignacio 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?
: Re: Hacking the ContentPanel
: soomon 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 ^^
: Re: Hacking the ContentPanel
: earthtech 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.