MyPortal Development guide: Difference between revisions
From Catglobe Wiki
More actions
| Line 34: | Line 34: | ||
*''set_title(titleText)'': change the title of element Ā | *''set_title(titleText)'': change the title of element Ā | ||
*''get_contentDiv()'': get the | *''get_contentDiv()'': get the content of "div" element, used for manipulating the HTML content Ā | ||
*''getManager().updateElementOrdination()'': automatically re-arrange MyPortal page (used when the HTML content is updated dynamically) | *''getManager().updateElementOrdination()'': automatically re-arrange MyPortal page (used when the HTML content is updated dynamically) | ||
Revision as of 10:49, 28 December 2011
<accesscontrol>Administrators,,Cem,,Maysunshine</accesscontrol>
Introduction
The My Portal page is your own personalized view of what goes on in the Catglobe system that is interesting to you.
More information about My Portal is available here.
How to makeĀ user defined elements
A user defined element as its name is the one you can put anything you want.
An elementĀ contains 2 features:
- HTML content: input inside Detailed decsription tab's HTML editor. It isĀ required to show the element in MyPortal pageĀ (empty content will end up in not displaying anything)
- Javascript: input inside Detailed description tab's script mode. ItĀ is usedĀ to manipulate the way the element will act, it can connect to registered web services orĀ change the HTML content dynamically. jQuery is also supported, which makes it even more powerful.
Script - Supported features
Events
- onload: called after loading the element
- onadd: called once after adding the element to MyPortal page (Insert)
- onminimize: called when minimizing the element
- onmaximize: called when maximizing the element
- onremove: calledĀ when theĀ element is removed from MyPortal page
- onmouseover: called when mouse is over the element (Currently, this event does not work - CHECK ME)
- onmouseout: called when mouse is out of the element (Currently, this event does not work - CHECK ME)
Functions
- set_title(titleText): change the title of element
- get_contentDiv(): get the content of "div" element, used for manipulating the HTML content
- getManager().updateElementOrdination(): automatically re-arrange MyPortal page (used when the HTML content is updated dynamically)
Sample code
this.onload = function()
{
// use "this" keyword to access the element itself.
alert("onload");
}
this.onadd = function() {
alert("onadd");
}
this.onminimize = function() {
alert("onminimize");
}
this.onmaximize = function() {
alert("onmaximize");
}
this.onremove = function() {
alert("onremove");
}
Potential problems
It can sometimes be quite problematic when displaying portal elements.Be careful when adding the HTML content, no validation is supported inside the editors.
Tips
- Flash objects might be placed on top of others. To fix that problem, these parameters should be addedĀ into the flash:
IE: "<param name='wmode' value='transparent' />"
FF: 'wmode="transparent" '
