Author: kien_nguyen
Date: 2010-06-04 03:49:45 -0400 (Fri, 04 Jun 2010)
New Revision: 3231
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DOMUtil.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/HTMLUtil.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/I18n.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/MouseEventManager.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Skin.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/i18n/I18NMessage.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIWorkspace.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDropDownControl.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIForm.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIItemSelector.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UINotification.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupMenu.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupSelectCategory.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPortlet.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIRightClickPopupMenu.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIToolbar.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUserSelector.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVerticalSlideTabs.js
Log:
Update javascript API document
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DOMUtil.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DOMUtil.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DOMUtil.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -293,7 +293,11 @@
}
return null ;
} ;
-
+/**
+ * Move an element
+ * @param {String} srcElemt element to move
+ * @param {String} destElemt destination element that will contains srcElemt
+ */
DOMUtil.prototype.moveElemt = function(srcElemt, destElemt) {
if(typeof(srcElemt) == "string") srcElemt = document.getElementById(srcElemt)
;
if(typeof(destElemt) == "string") destElemt =
document.getElementById(destElemt) ;
@@ -452,7 +456,10 @@
return el; // some other object, just pass it back
}
-
+/**
+ * Disable onclick event
+ * @param {Event} el
+ */
DOMUtil.prototype.disableOnClick = function(el) {
el.onclick = new Function("return false;");
}
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/HTMLUtil.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/HTMLUtil.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/HTMLUtil.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -28,11 +28,10 @@
}
/**
+ * Encode string
+ * @param {String} str string to encode
+ * @return {String} encoded string
*
- * @param {String} str
- *
- * @return {String}
- *
*/
HTMLUtil.prototype.entitiesEncode = function(str) {
if (!str || str == '') {
@@ -51,11 +50,10 @@
}
/**
+ * Decode string
+ * @param {String} str to decode
+ * @return {String} decoded string
*
- * @param {String} str
- *
- * @return {String}
- *
*/
HTMLUtil.prototype.entitiesDecode = function(str) {
if (!str || str == '') {
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/I18n.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/I18n.js 2010-06-03
09:01:43 UTC (rev 3230)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/I18n.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -20,7 +20,9 @@
function I18n() {
this.init();
}
-
+/**
+ * initialize some information as language, orientation, etc of I18n object
+ */
I18n.prototype.init = function() {
var html = document.getElementsByTagName('html')[0];
var lang = html.getAttribute('xml:lang') || html.getAttribute('lang')
|| "en";
@@ -30,23 +32,34 @@
this.orientation = "rtl" == dir ? "rt" : "lt";
this.lt = this.orientation == "lt";
}
-
+/**
+ * return language
+ */
I18n.prototype.getLanguage = function() {
return this.lang;
}
-
+/**
+ * return orientation (right to left, left to right),
+ * some languages (such as Arabic) used "right to left" view
+ */
I18n.prototype.getOrientation = function() {
return this.orientation;
}
-
+/**
+ * return directory
+ */
I18n.prototype.getDir = function() {
return !this.lt;
}
-
+/**
+ * return "left to"(lt) state
+ */
I18n.prototype.isLT = function() {
return this.lt;
}
-
+/**
+ * return "right to" state
+ */
I18n.prototype.isRT = function() {
return !this.lt;
}
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/MouseEventManager.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/MouseEventManager.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/MouseEventManager.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -18,12 +18,18 @@
*/
function MouseEventManager () {} ;
-
+/**
+ * Add mouse down event handler
+ * @param method handler method
+ */
MouseEventManager.prototype.addMouseDownHandler = function(method) {
document.onmousedown = this.docMouseDownEvt ;
this.onMouseDownHandlers = method ;
} ;
-
+/**
+ * Document mouse down event, it will cancel default behavior of browser and process
behavior in handler chain
+ * @param {Event} evt
+ */
MouseEventManager.prototype.docMouseDownEvt = function(evt) {
if(!evt) evt = window.event ;
evt.cancelBubble = true ;
@@ -33,17 +39,26 @@
else eXo.core.MouseEventManager.onMouseDownHandlers(evt) ;
document.onmousedown = null ;
} ;
-
+/**
+ * Add Mouse up event handler
+ * @param method handler method
+ */
MouseEventManager.prototype.addMouseUpHandler = function(method) {
document.onmouseup = this.docMouseUpEvt ;
this.onMouseUpHandlers = method ;
} ;
-
+/**
+ * Document mouse up event, it will cancel default behavior of browser and process
behavior in handler chain
+ * @param {Event} evt
+ */
MouseEventManager.prototype.docMouseUpEvt = function() {
var mouseUpHandlers = eXo.core.MouseEventManager.onMouseUpHandlers ;
} ;
-
+/**
+ * Document mouse click event, it will cancel default behavior of browser and process
behavior in handler chain
+ * @param {Event} evt
+ */
MouseEventManager.prototype.docMouseClickEvt = function(evt) {
if(!evt) evt = window.event ;
evt.cancelBubble = true ;
@@ -52,7 +67,10 @@
else eXo.core.MouseEventManager.onMouseClickHandlers(evt) ;
document.onclick = null ;
} ;
-
+/**
+ * Add mouse click handler
+ * @param method handler method
+ */
MouseEventManager.prototype.addMouseClickHandler = function(method) {
document.onclick = this.docMouseClickEvt ;
this.onMouseClickHandlers = method ;
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Skin.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Skin.js 2010-06-03
09:01:43 UTC (rev 3230)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Skin.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -35,7 +35,11 @@
var head = document.getElementsByTagName("head")[0] ;
head.appendChild(link) ;
} ;
-
+/**
+ * Add skin css file to the page and assign them to core skin document objects
+ * @param {String} componentId
+ * @param {String} url Url to css skin file in respository
+ */
Skin.prototype.addCoreSkin = function(componentId, url) {
if(document.getElementById(componentId) == null) {
var coreSkin = document.getElementById("CoreSkin") ;
@@ -48,7 +52,11 @@
head.insertBefore(link, coreSkin) ;
}
} ;
-
+/**
+ * Add skin css file to the page and assign them to portal skin document objects
+ * @param {String} componentId
+ * @param {String} url Url to css skin file in respository
+ */
Skin.prototype.addApplicationSkin = function(componentId, url) {
if(document.getElementById(componentId) == null) {
var coreSkin = document.getElementById("PortalSkin") ;
@@ -61,7 +69,9 @@
head.insertBefore(link, coreSkin) ;
}
} ;
-
+/**
+ * Init Skin instance (if null)
+ */
if(!eXo.core.Skin){
eXo.core.Skin = new Skin() ;
} ;
\ No newline at end of file
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -18,6 +18,17 @@
*/
eXo.gadget.UIGadget = {
+ /**
+ * Create a new Gadget
+ * @param {String} url local or remote path that contain gadget .xml file
+ * @param {String} id id of object contains this gadget (parent id)
+ * @param {String} metadata contain information of gadget
+ * @param {Object} userPref
+ * @param {String} view type of view (home, canvas, ...)
+ * @param {boolean} isdev normal or development mode (0, 1)
+ * @param {boolean} debug normal or debug mode (0, 1)
+ * @param {String} nocache value indicate cache or nocache at shindig level (0, 1)
+ */
createGadget : function(url, id, metadata, userPref, view, hostName, isdev, debug,
nocache) {
//eXo = eXo || {};
window.gadgets = window.gadgets || {};
@@ -74,7 +85,12 @@
}
},
-
+ /**
+ * Initialize data of gadget such as title, style, etc
+ * @param {Object} uiGadget object need to init data
+ * @param {boolean} inDesktop use to realize UIDesktopPage or no
+ * @param {String} metadata metadata of gadget
+ */
init : function(uiGadget, inDesktop, metadata) {
var portletFragment = eXo.core.DOMUtil.findAncestorByClass(uiGadget,
"PORTLET-FRAGMENT");
if (portletFragment == null) {
@@ -156,7 +172,10 @@
}
},
-
+ /**
+ * Show gadget control
+ * @param {Event} e
+ */
showGadgetControl : function(e) {
if (!e) e = window.event;
e.cancelBubble = true;
@@ -171,7 +190,10 @@
}
},
-
+ /**
+ * Hide gadget control
+ *@param {Event} e
+ */
hideGadgetControl : function(e) {
if (!e) e = window.event;
e.cancelBubble = true;
@@ -180,7 +202,10 @@
gadgetControl.style.visibility = "hidden";
uiGadget.style.border = "none";
},
-
+ /**
+ * Use to edit some information of gadget such as nocache, debug, etc
+ * @param {String} id identifier of gadget
+ */
editGadget : function(id) {
var DOMUtil = eXo.core.DOMUtil ;
var uiapp = document.getElementById(id) ;
@@ -188,7 +213,10 @@
var tempId = id.id.split('_')[2] ;
gadgets.container.getGadget(tempId).handleOpenUserPrefsDialog();
},
-
+ /**
+ * Minimize a gadget
+ * @param {Object} selectedElement object to minimize
+ */
minimizeGadget: function(selectedElement) {
var DOMUtil = eXo.core.DOMUtil ;
var uiGadget = DOMUtil.findAncestorByClass(selectedElement, "UIGadget")
;
@@ -219,7 +247,10 @@
ajaxAsyncGetRequest(href);
if (uiGadget.minimizeCallback)
uiGadget.minimizeCallback(portletFrag.parentNode.id);
},
-
+ /**
+ * Maximize a gadget
+ * @param {Object} selectedElement object to maximize
+ */
maximizeGadget: function(selectedElement) {
var DOMUtil = eXo.core.DOMUtil ;
var uiGadget = DOMUtil.findAncestorByClass(selectedElement, "UIGadget")
;
@@ -236,7 +267,10 @@
href += "&objectId=" + uiGadget.id +
"&ajaxRequest=true";
ajaxGet(href,true);
},
-
+ /**
+ * Delete a gadget from UI and database
+ * @param {Object} selectedElement object to delete
+ */
deleteGadget : function(selectedElement) {
var DOMUtil = eXo.core.DOMUtil ;
var uiPage = DOMUtil.findAncestorByClass(selectedElement, "UIPage") ;
@@ -285,7 +319,10 @@
}
}
},
-
+ /**
+ * Save Window information of gadget instance (x, y, z axis, etc)
+ * @param {Object} object Gadget object
+ */
saveWindowProperties : function(object) {
var DOMUtil = eXo.core.DOMUtil ;
var uiPage = DOMUtil.findAncestorByClass(object, "UIPage") ;
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/i18n/I18NMessage.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/i18n/I18NMessage.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/i18n/I18NMessage.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -18,7 +18,12 @@
*/
function I18NMessage() {}
-
+/**
+ * Get message from resource bundle files, this function often is called from .js files
+ * @param {String} str know as key in Message Resource bundle file
+ * @param {Array} params parameter that can used to set value in message
+ * @return {String} message string
+ */
I18NMessage.prototype.getMessage = function(str, params) {
var msg;
try {
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -613,7 +613,10 @@
eXo.session.itvInit() ;
}
} ;
-
+/**
+ * Abort an ajax request
+ * @return
+ */
function ajaxAbort() {
eXo.core.UIMaskLayer.removeMasks(eXo.portal.AjaxRequest.maskLayer) ;
eXo.portal.AjaxRequest.maskLayer = null ;
@@ -622,7 +625,12 @@
eXo.portal.CurrentRequest.aborted = true ;
eXo.portal.CurrentRequest = null ;
} ;
-
+/**
+ * Create a ajax request
+ * @param {String} url - Url
+ * @param {boolean} async - asynchronous or none
+ * @return {String} response text if request is not async
+ */
function ajaxAsyncGetRequest(url, async) {
if(async == undefined) async = true ;
var request = eXo.core.Browser.createHttpRequest() ;
@@ -635,7 +643,11 @@
}
if(!async) return request.responseText ;
}
-
+/**
+ * Redirect browser to url
+ * @param url
+ * @return
+ */
function ajaxRedirect(url) {
url = url.replace(/&/g, "&") ;
window.location.href = url ;
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -112,7 +112,10 @@
controlPortlet.style.display = eXo.portal.portalMode == 4 ? "none" :
"block";
}
};
-
+/**
+ * Get all UIPortlets of current UIWorkingWorkspace
+ * @return {Array} Array of UIComponents
+ */
UIPortal.prototype.getUIPortlets = function() {
var uiWorkingWorkspace = document.getElementById("UIWorkingWorkspace") ;
var founds = eXo.core.DOMUtil.findDescendantsByClass(uiWorkingWorkspace,
"div", "UIPortlet") ;
@@ -122,7 +125,10 @@
}
return components ;
} ;
-
+/**
+ * Get all UIPortlets is children of UIWorkingWorkspace
+ * @return {Array} Array of UIComponents
+ */
UIPortal.prototype.getUIPortletsInUIPortal = function() {
var uiWorkingWorkspace = document.getElementById("UIWorkingWorkspace") ;
var founds = eXo.core.DOMUtil.findDescendantsByClass(uiWorkingWorkspace,
"div", "UIPortlet") ;
@@ -134,7 +140,10 @@
}
return components ;
} ;
-
+/**
+ * Get all UIPortlets in UIPage
+ * @return {Array} components array of UIComponent objects
+ */
UIPortal.prototype.getUIPortletsInUIPage = function() {
var uiPage = document.getElementById("UIPage") ;
var founds = eXo.core.DOMUtil.findDescendantsByClass(uiPage, "div",
"UIPortlet");
@@ -144,7 +153,10 @@
}
return components ;
} ;
-
+/**
+ * Get All UIContainers in current UIWorkingWorkspace
+ * @return {Array} components array of UIComponent objects
+ */
UIPortal.prototype.getUIContainers = function() {
var uiWorkingWorkspace = document.getElementById("UIWorkingWorkspace") ;
var founds = eXo.core.DOMUtil.findDescendantsByClass(uiWorkingWorkspace,
"div", "UIContainer");
@@ -154,18 +166,28 @@
}
return components ;
};
-
+/**
+ * Get current UIPageBody
+ * @return {Object} UIPageBody object of this document
+ */
UIPortal.prototype.getUIPageBody = function() {
// var uiPortal = document.getElementById("UIPortal") ;
// return new UIComponent(eXo.core.DOMUtil.findFirstDescendantByClass(uiPortal,
"div", "UIPage")) ;
return new UIComponent(document.getElementById("UIPageBody")) ;
};
-
+/**
+ * Get current UIPortal
+ * @return {Object} UIComponent object that contains UIPortal object of this component
+ */
UIPortal.prototype.getUIPortal = function() {
var uiWorkingWorkspace = document.getElementById("UIWorkingWorkspace") ;
return new UIComponent(eXo.core.DOMUtil.findFirstDescendantByClass(uiWorkingWorkspace,
"div", "UIPortal"));
};
-
+/**
+ * Change page mode from view mode to layout mode
+ * @param {Object} uicomponent component contains this view (layout)
+ * @param {boolean} swapContent indicate changing content or not
+ */
UIPortal.prototype.switchViewModeToLayoutMode = function(uicomponent, swapContent) {
var layoutBlock = uicomponent.getLayoutBlock() ;
if(!layoutBlock || layoutBlock.style.display == 'block') return ;
@@ -182,7 +204,11 @@
viewBlock.style.display = "none" ;
} catch (err) {}
};
-
+/**
+ * Change page mode from layout mode to view mode
+ * @param {Object} uicomponent component contains this layout (view)
+ * @param {boolean} swapContent indicate changing content or not
+ */
UIPortal.prototype.switchLayoutModeToViewMode = function(uicomponent, swapContent) {
var viewBlock = uicomponent.getViewBlock() ;
if(!viewBlock || viewBlock.style.display == 'block') return ;
@@ -226,7 +252,10 @@
// this.showLayoutModeForPortal() ;
// }
//};
-
+/**
+ * Switch mode of page
+ * @param {Object} elemtClicked clicked element
+ */
UIPortal.prototype.switchModeForPage = function(elemtClicked) {
var layoutMode = this.showViewLayoutModeForPage();
if(layoutMode == 1) {
@@ -237,7 +266,11 @@
this.showMaskLayer() ;
}
} ;
-
+/**
+ * Show area for dnd into this UIComponent
+ * @param {Object} uiComponent component contains control block
+ * @param {boolean} flag display (blocking) or hide control block
+ */
UIPortal.prototype.showUIComponentControl = function(uicomponent, flag) {
var controlBlock = uicomponent.getControlBlock() ;
if(!controlBlock) return ;
@@ -250,7 +283,10 @@
// controlBlock.style.display = 'none' ;
// }
};
-
+/**
+ * Change page to layout view
+ * @return layoutMode type of view mode (0, 1)
+ */
UIPortal.prototype.showViewLayoutModeForPage = function() {
/*
* minh.js.exo;
@@ -437,7 +473,9 @@
}
return null ;
};
-
+/**
+ * Display Mask layer infront of page's surface
+ */
UIPortal.prototype.showMaskLayer = function() {
var uiPortalApplication = document.getElementById("UIPortalApplication") ;
var object = document.createElement("div") ;
@@ -463,7 +501,9 @@
this.maskLayer.style.zIndex = parseInt(object.style.zIndex) + 1 ;
eXo.core.Browser.addOnScrollCallback("3743892",
eXo.core.UIMaskLayer.setPosition) ;
} ;
-
+/**
+ * Hide (remove) mask layer from page's surface
+ */
UIPortal.prototype.hideMaskLayer = function() {
if(this.maskLayer) {
var uiPortalApplication = document.getElementById("UIPortalApplication") ;
@@ -473,7 +513,10 @@
uiPortalApplication.removeChild(maskObject) ;
}
} ;
-
+/**
+ * Change skin of Portal
+ * @param url
+ */
UIPortal.prototype.changeSkin = function(url) {
var skin = '';
if(eXo.webui.UIItemSelector.SelectedItem != undefined) {
@@ -483,7 +526,10 @@
//ajaxAsyncGetRequest(url + '&skin='+skin, false);
window.location = url + '&skin='+skin;
} ;
-
+/**
+ * Change language of Portal
+ * @param url
+ */
UIPortal.prototype.changeLanguage = function(url) {
var language = '';
if(eXo.webui.UIItemSelector.SelectedItem != undefined) {
@@ -493,7 +539,9 @@
//ajaxAsyncGetRequest(url + '&language='+language, false);
window.location = url + '&language='+language;
} ;
-
+/**
+ * Change current portal
+ */
UIPortal.prototype.changePortal = function(accessPath, portal) {
window.location = eXo.env.server.context + "/" + accessPath + "/" +
portal+"/";
} ;
@@ -503,7 +551,10 @@
if(action == undefined) action = '';
window.location = url + '&action='+ action ;
} ;
-
+/**
+ * Remove a component of portal
+ * @param {String} componentId identifier of component
+ */
UIPortal.prototype.removeComponent = function(componentId) {
var comp = document.getElementById(componentId);
var viewPage = eXo.core.DOMUtil.findAncestorByClass(comp, "VIEW-PAGE");
@@ -521,7 +572,9 @@
}
};
-
+/**
+ * Change Save button to editing state
+ */
UIPortal.prototype.changeComposerSaveButton = function() {
if(eXo.portal.hasEditted == false) {
var uiWorkingWS = document.getElementById("UIWorkingWorkspace");
@@ -551,7 +604,10 @@
var requestStr = eXo.env.server.createPortalURL(portalComposer.id, "Toggle",
true);
ajaxAsyncGetRequest(requestStr);
};
-
+/**
+ * Clollapse or expand an element (all its children) of tree
+ * @param {Object} element object to collapse or expand
+ */
UIPortal.prototype.collapseExpand = function(element) {
var subGroup = eXo.core.DOMUtil.findFirstChildByClass(element.parentNode,
"div", "ChildrenContainer") ;
var className = element.className;
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -21,7 +21,11 @@
this.scrollManagers = new Array();
this.t = 0;
};
-
+/**
+ * Change state of window
+ * @param {String} id object identifier
+ * @param {String} state state will be displayed (maximized, minimized, normal)
+ */
UIPortalControl.prototype.changeWindowState = function(id, state) {
var params = [
{name: "portletId", value: id},
@@ -29,8 +33,10 @@
] ;
ajaxGet(eXo.env.server.createPortalURL("UIPortal",
"ChangeWindowState", true, params));
};
-
-/*For Navigation Tree*/
+/**
+ * Collapse tree, use for Navigation Tree
+ * @param {Object} selectedElement first object of tree
+ */
UIPortalControl.prototype.collapseTree = function(selectedElement ) {
var DOMUtil = eXo.core.DOMUtil ;
@@ -346,7 +352,9 @@
if (this.scrollMgr) this.scrollMgr.scrollRight();
};
-
+/**
+ * Get all visible elements
+ */
ScrollManager.prototype.getVisibleElements = function() {
var availableSpace = this.getElementSpace(this.mainContainer) -
this.getElementSpace(this.arrowsContainer);
var refereceIndex = 0;
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIWorkspace.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIWorkspace.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIWorkspace.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -28,7 +28,9 @@
if(eXo.portal.UIWorkingWorkspace == undefined) {
eXo.portal.UIWorkingWorkspace = new UIWorkspace("UIWorkingWorkspace") ;
};
-
+/**
+ * Resize UIControlWorkspace document object to fit on the screen
+ */
eXo.portal.UIWorkingWorkspace.onResize = function() {
var uiWorkspace = document.getElementById(eXo.portal.UIWorkingWorkspace.id) ;
if(eXo.core.Browser.isIE6()) {
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -395,7 +395,11 @@
var deltaY = Math.ceil((uiDashboard.offsetHeight - popup.offsetHeight) / 2);
popup.style.top = eXo.core.Browser.findPosY(uiDashboard) + deltaY + "px";
};
-
+ /**
+ * Build a UITarget element (div element) with properties in parameters
+ * @param {Number} width
+ * @param {Number} height
+ */
UIDashboard.prototype.createTarget = function(width, height) {
var uiTarget = document.createElement("div");
uiTarget.id = "UITarget";
@@ -404,7 +408,10 @@
uiTarget.style.height = height + "px";
return uiTarget;
};
-
+ /**
+ * Build a UITarget element (div element) with properties equal to object's
properties in parameter
+ * @param {Object} obj object
+ */
UIDashboard.prototype.createTargetOfAnObject = function(obj) {
var uiTarget = document.createElement("div");
uiTarget.id = "UITarget";
@@ -412,7 +419,10 @@
uiTarget.style.height = obj.offsetHeight + "px";
return uiTarget;
};
-
+ /**
+ * Show and hide gadget list for selecting gadget in dashboard
+ * @param {Object} comp indicate action show and hide, if it is close button, action is
hide
+ */
UIDashboard.prototype.showHideSelectContainer = function(event) {
if(!event) event = window.event;
var DOMUtil = eXo.core.DOMUtil;
@@ -438,7 +448,12 @@
ajaxGet(url);
}
};
-
+ /**
+ * Using when click event happens on a dashboard tab
+ * @param {Object} clickElement
+ * @param {String} normalStyle a css style
+ * @param {String} selectedType a css style
+ */
UIDashboard.prototype.onTabClick = function(clickElement, normalStyle, selectedType) {
var DOMUtil = eXo.core.DOMUtil;
var category = DOMUtil.findAncestorByClass(clickElement, "GadgetCategory");
@@ -459,7 +474,10 @@
categoryContent.style.display = "none";
}
};
-
+ /**
+ * Change disabled object to enable state
+ * @param {Object} elemt object to enable
+ */
UIDashboard.prototype.enableContainer = function(elemt) {
var DOMUtil = eXo.core.DOMUtil;
if(DOMUtil.hasClass(elemt, "DisableContainer")) {
@@ -468,7 +486,10 @@
var arrow = DOMUtil.findFirstChildByClass(elemt, "div", "Arrow");
if(DOMUtil.hasClass(arrow, "DisableArrowIcon"))
DOMUtil.replaceClass(arrow," DisableArrowIcon", "");
};
-
+ /**
+ * Change object to disable state
+ * @param {Object} elemt object to enable
+ */
UIDashboard.prototype.disableContainer = function(elemt) {
var DOMUtil = eXo.core.DOMUtil;
if(!DOMUtil.hasClass(elemt, "DisableContainer")) {
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDropDownControl.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDropDownControl.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDropDownControl.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -31,7 +31,11 @@
/*.
* minh.js.exo
*/
-
+/**
+ * show or hide drop down control
+ * @param {Object} obj document object to use as Anchor for drop down
+ * @param {Object} evet event object
+ */
UIDropDownControl.prototype.show = function(obj, evt) {
if(!evt) evt = window.event ;
evt.cancelBubble = true ;
@@ -77,12 +81,20 @@
}
} ;
-
+/**
+ * Hide an object
+ * @param {Object, String} obj object to hide
+ */
UIDropDownControl.prototype.hide = function(obj) {
if (typeof(obj) == "string") obj = document.getElementById(obj) ;
obj.style.display = "none" ;
} ;
-
+/**
+ * Use as event when user selects a item in drop down list
+ * Display content of selected item and hide drop down control
+ * @param {Object} obj selected object
+ * @param {Object} evt event
+ */
UIDropDownControl.prototype.onclickEvt = function(obj, evt) {
var DOMUtil = eXo.core.DOMUtil ;
var uiDropDownAnchor = DOMUtil.findAncestorByClass(obj, 'UIDropDownAnchor') ;
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIForm.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIForm.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIForm.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -22,7 +22,11 @@
*/
function UIForm() {
};
-
+/**
+ * Get form element with pattern condition
+ * @param {String} pattern
+ * The pattern can be Id#Id, example: Account#UIAccountForm
+ */
UIForm.prototype.getFormElemt = function(pattern) {
if(pattern.indexOf("#") == -1) return document.getElementById(pattern) ;
var strArr = pattern.split("#") ;
@@ -30,10 +34,10 @@
return eXo.core.DOMUtil.findDescendantById(portlet, strArr[1]) ;
}
-/*ie bug you cannot have more than one button tag*/
/**
* A function that submits the form identified by formId, with the specified action
* If useAjax is true, calls the ajaxPost function from PortalHttpRequest, with the given
callback function
+ * Note: ie bug you cannot have more than one button tag
*/
UIForm.prototype.submitForm = function(formId, action, useAjax, callback) {
if (!callback) callback = null;
@@ -60,10 +64,10 @@
else form.submit();
} ;
-/*ie bug you cannot have more than one button tag*/
/**
* Submits a form by Ajax, with the given action and the given parameters
* Calls ajaxPost of PortalHttpRequest
+ * Note: ie bug you cannot have more than one button tag
*/
UIForm.prototype.submitEvent = function(formId, action, params) {
var form = this.getFormElemt(formId) ;
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIItemSelector.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIItemSelector.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIItemSelector.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -21,7 +21,11 @@
this.backupClass;
this.backupItem;
};
-
+/**
+ * Mouse over event, Set highlight to OverItem
+ * @param {Object} selectedElement focused element
+ * @param {boolean} mouseOver
+ */
UIItemSelector.prototype.onOver = function(selectedElement, mouseOver) {
if(selectedElement.className == "Item"){
eXo.webui.UIItemSelector.beforeActionHappen(selectedElement);
@@ -36,7 +40,11 @@
// this.onChangeItemDetail(selectedElement, false);
}
};
-
+/**
+ * Mouse click event, highlight selected item and non-highlight other items
+ * There are 3 types of item: Item, OverItem, SeletedItem
+ * @param {Object} clickedElement
+ */
UIItemSelector.prototype.onClick = function(clickedElement) {
var itemListContainer = clickedElement.parentNode;
var allItems = eXo.core.DOMUtil.findDescendantsByClass(itemListContainer,
"div", "Item");
@@ -53,7 +61,11 @@
}
}
};
-
+/**
+ * Change UI of new selected item, selected item will be displayed and others will be
hidden
+ * @param {Object} itemSelected selected item
+ * @param {boolean} mouseOver
+ */
UIItemSelector.prototype.onChangeItemDetail = function(itemSelected, mouseOver) {
if(!this.allItems || this.allItems.length <= 0 ) return;
if(mouseOver) {
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UINotification.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UINotification.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UINotification.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -38,7 +38,10 @@
})
}
}
-
+/**
+ * Display notification on sliding down
+ * @param {String} objectName identifier of notification object
+ */
UINotification.prototype.slideDown = function(objectName){
if(this.moving[objectName]) return;
if(document.getElementById(objectName).style.display != "none") return;
@@ -46,20 +49,27 @@
this.dir[objectName] = "down";
this.startSlide(objectName);
}
-
+/**
+ * Set sliding down and up
+ */
UINotification.prototype.slideDownUp = function(objectName, endSlideUpCallback){
this.slideDown(objectName);
this.endSlideUpCallback[objectName] = endSlideUpCallback;
if(this.flagNoti[objectName])
setTimeout("eXo.webui.UINotification.slideUp('" + objectName +
"')", 3000);
}
-
+/**
+ * Event when user click "x" close button on the notification
+ * If notify content is important, immediately it will not be close and uses closing
timeout
+ */
UINotification.prototype.closeNotification = function() {
for(var i = 0; i < this.importantNoti.length; i ++) {
this.flagNoti[this.importantNoti[i]] = true;
setTimeout("eXo.webui.UINotification.slideUp('" + this.importantNoti[i] +
"')", 100);
}
}
-
+/**
+ * Display (hide) notification as sliding up
+ */
UINotification.prototype.slideUp = function(objectName){
if(this.moving[objectName]) return;
if(document.getElementById(objectName).style.display == "none") return;
@@ -67,7 +77,10 @@
this.dir[objectName] = "up";
this.startSlide(objectName);
}
-
+/**
+ * Start slide animation
+ * @param {String} objectName identifier of notification object
+ */
UINotification.prototype.startSlide = function(objectName){
this.object[objectName] = document.getElementById(objectName);
this.endHeight[objectName] = parseInt(this.object[objectName].style.height);
@@ -78,7 +91,10 @@
this.object[objectName].style.display = "block";
this.timerID[objectName] =
setInterval('eXo.webui.UINotification.slideTick(\'' + objectName +
'\');',this.timerlen);
}
-
+/**
+ * Calculate height property every tick time
+ * @param {String} objectName name of object
+ */
UINotification.prototype.slideTick = function(objectName){
var elapsed = (new Date()).getTime() - this.startTime[objectName];
if (elapsed > this.slideAniLen)
@@ -91,12 +107,16 @@
}
return;
}
-
+/**
+ * Remove notification from page body
+ */
UINotification.prototype.destroyUINotification = function(){
var UINotification = document.getElementById("UINotification");
document.getElementsByTagName("body")[0].removeChild(UINotification);
}
-
+/**
+ * End sliding, clean and destroy resource
+ */
UINotification.prototype.endSlide = function(objectName){
clearInterval(this.timerID[objectName]);
if(this.dir[objectName] == "up") {
@@ -120,12 +140,18 @@
delete(this.flagNoti[objectName]);
return;
}
-
+/**
+ * Remove object from document
+ * @param {String} objectName identifier of Object
+ */
UINotification.prototype.deleteBox = function(objectName) {
var el = document.getElementById(objectName);
el.parentNode.removeChild(el);
}
-
+/**
+ * Create frame that contains whole notification content
+ * @return {String} htmlString html string
+ */
UINotification.prototype.createFrameForMessages = function() {
var htmlString = "";
htmlString += "<div class=\"UIPopupNotification\">";
@@ -154,7 +180,11 @@
htmlString += "</div>";
return htmlString;
}
-
+/**
+ * Add message content to notification
+ * @param {String} messageContent content to notify
+ * @param {boolean} flag
+ */
UINotification.prototype.addMessage = function(messageContent, flag) {
var currMessageBoxId = "UIMessageBox_" + this.numberMessageRecepted++;
var UIMessageContent = document.createElement('div');
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupMenu.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupMenu.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupMenu.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -27,16 +27,33 @@
this.currentVisibleContainers = new Array();
this.currentElement = null;
} ;
-
+/**
+ * initialize UIPopupMenu
+ * @param {Object, String} popupMenu popup object
+ * @param {Object} container
+ * @param {Number} x
+ * @param {Number} y
+ */
UIPopupMenu.prototype.init = function(popupMenu, container, x, y) {
this.superClass = eXo.webui.UIPopup;
this.superClass.init(popupMenu, container.id) ;
} ;
-
+/**
+ * Set position to a popup
+ * @param {Object} popupMenu
+ * @param {Number} x x axis
+ * @param {Number} y y axis
+ * @param {boolean} isRTL right to left flag
+ */
UIPopupMenu.prototype.setPosition = function(popupMenu, x, y, isRTL) {
this.superClass.setPosition(popupMenu, x, y, isRTL) ;
};
-
+/**
+ * Set size to a popup
+ * @param {Object} popupMenu
+ * @param {Number} w width
+ * @param {Number} h height
+ */
UIPopupMenu.prototype.setSize = function(popup, w, h) {
this.superClass.setSize(popupMenu, w, h) ;
} ;
@@ -115,13 +132,19 @@
*/
this.superClass.setPosition(menuItemContainer, x, y) ;
} ;
-
+/**
+ * Change object to hidden state
+ * @param {Object} object to hide
+ */
UIPopupMenu.prototype.hide = function(object) {
if(typeof(object) == "string") object = document.getElementById(object);
object.style.display = "none" ;
object.style.visibility = "hidden";
} ;
-
+/**
+ * Change object to visibility state
+ * @param {Object} object to hide
+ */
UIPopupMenu.prototype.show = function(object) {
if(typeof(object) == "string") object = document.getElementById(object);
object.style.display = "block" ;
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupSelectCategory.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupSelectCategory.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPopupSelectCategory.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -19,6 +19,9 @@
function UIPopupSelectCategory() {
} ;
+/**
+ * Hide all hidden elements, it is used while showing UIPopupCategory
+ */
UIPopupSelectCategory.prototype.hide = function() {
var ln = eXo.core.DOMUtil.hideElementList.length ;
if (ln > 0) {
@@ -27,7 +30,11 @@
}
}
} ;
-
+/**
+ * Show UIPopupCategory object
+ * @param {Object} obj document object contains UIPopupCategory
+ * @param {Event} evt
+ */
UIPopupSelectCategory.prototype.show = function(obj, evt){
if(!evt) evt = window.event ;
evt.cancelBubble = true ;
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPortlet.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPortlet.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIPortlet.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -20,7 +20,12 @@
function UIPortlet() {
this.maxIndex = 0;
} ;
-
+/**
+ * Event when mouse focuses to element, this function is called when user minimizes or
+ * maximized portlet window
+ * @param {Object} element focusing element
+ * @param {boolean} isOver know as mouse over or out
+ */
UIPortlet.prototype.onControlOver = function(element, isOver) {
var originalElementName = element.className ;
if(isOver) {
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIRightClickPopupMenu.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIRightClickPopupMenu.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIRightClickPopupMenu.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -18,7 +18,10 @@
*/
function UIRightClickPopupMenu() {};
-
+/**
+ * Initialize a UIRightClickPopupMenu object
+ * @param contextMenuId identifier of a document object
+ */
UIRightClickPopupMenu.prototype.init = function(contextMenuId) {
var contextMenu = document.getElementById(contextMenuId) ;
// TODO: Fix temporary for the problem Minimize window in Page Mode
@@ -32,14 +35,20 @@
var parentNode = contextMenu.parentNode ;
this.disableContextMenu(parentNode) ;
}
-
+/**
+ * Hide and disable mouse down event of context menu object
+ * @param contextId identifier of context menu
+ */
UIRightClickPopupMenu.prototype.hideContextMenu = function(contextId) {
if (document.getElementById(contextId)) {
document.getElementById(contextId).style.display = 'none' ;
eXo.core.MouseEventManager.onMouseDownHandlers = null ;
}
}
-
+/**
+ * Disable default context menu of browser
+ * @param comp identifier or document object
+ */
UIRightClickPopupMenu.prototype.disableContextMenu = function(comp) {
if(typeof(comp) == "string") comp = document.getElementById(comp) ;
comp.onmouseover = function() {
@@ -49,7 +58,11 @@
document.oncontextmenu = function() {return true} ;
}
};
-
+/**
+ * Prepare something for context menu
+ * @param {Object} evt event
+ * @param {Object} elemt document object that contains context menu
+ */
UIRightClickPopupMenu.prototype.prepareObjectId = function(evt, elemt) {
var contextMenu = eXo.core.DOMUtil.findAncestorByClass(elemt,
"UIRightClickPopupMenu") ;
contextMenu.style.display = "none" ;
@@ -62,7 +75,15 @@
elemt.setAttribute('href', href.replace('_objectid_',
encodeURI(contextMenu.objId.replace(/'/g, "\\'")))) ;
return true;
}
-
+/**
+ * Mouse click on element, If click is right-click, the context menu will be shown
+ * @param {Object} event
+ * @param {Object} elemt clicked element
+ * @param {String} menuId identifier of context menu will be shown
+ * @param {String} objId object identifier in tree
+ * @param {Array} params
+ * @param {Number} opt option
+ */
UIRightClickPopupMenu.prototype.clickRightMouse = function(event, elemt, menuId, objId,
params, opt) {
if (!event) event = window.event;
eXo.core.MouseEventManager.docMouseDownEvt(event) ;
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIToolbar.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIToolbar.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIToolbar.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -18,7 +18,10 @@
*/
function UIToolbar() {};
-
+/**
+ * Display clicked element on block state
+ * @param {Object} clickedEle clicked object
+ */
UIToolbar.prototype.displayBlockContent = function(clickedEle) {
if(clickedEle == null) return;
var uiToolbar = eXo.core.DOMUtil.findAncestorByClass(clickedEle,
"UIToolbar");
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUpload.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -22,7 +22,11 @@
this.isAutoUpload = false;
//this.listLimitMB = new Array();
};
-
+/**
+ * Initialize upload and create a upload request to server
+ * @param {String} uploadId identifier upload
+ * @param {boolean} isAutoUpload auto upload or none
+ */
UIUpload.prototype.initUploadEntry = function(uploadId, isAutoUpload) {
var url = eXo.env.server.context + "/command?" ;
url +=
"type=org.exoplatform.web.command.handler.UploadHandler&action=progress&uploadId="+uploadId
;
@@ -74,7 +78,10 @@
idoc.close();
};
-
+/**
+ * Refresh progress bar to update state of upload progress
+ * @param {String} elementId identifier of upload bar frame
+ */
UIUpload.prototype.refeshProgress = function(elementId) {
var list = eXo.webui.UIUpload.listUpload;
if(list.length < 1) return;
@@ -124,7 +131,11 @@
"<span
onclick='parent.eXo.webui.UIUpload.abortUpload("+id+")'>Abort</span>";
}
};
-
+/**
+ * Show uploaded state when upload has just finished a file
+ * @param {String} id uploaded identifier
+ * @param {String} fileName uploaded file name
+ */
UIUpload.prototype.showUploaded = function(id, fileName) {
eXo.webui.UIUpload.listUpload.remove(id);
var container = parent.document.getElementById(id);
@@ -148,7 +159,10 @@
var input = parent.document.getElementById('input' + id);
input.value = "true" ;
};
-
+/**
+ * Abort upload process
+ * @param {String} id upload identifier
+ */
UIUpload.prototype.abortUpload = function(id) {
eXo.webui.UIUpload.listUpload.remove(id);
var url = eXo.env.server.context + "/command?" ;
@@ -178,7 +192,10 @@
var input = parent.document.getElementById('input' + id);
input.value = "false";
};
-
+/**
+ * Delete uploaded file
+ * @param {String} id upload identifier
+ */
UIUpload.prototype.deleteUpload = function(id) {
var url = eXo.env.server.context + "/command?";
url += "type=org.exoplatform.web.command.handler.UploadHandler&uploadId="
+id+"&action=delete" ;
@@ -206,7 +223,11 @@
input.value = "false";
} ;
-
+/**
+ * Start upload file
+ * @param {Object} clickEle
+ * @param {String} id
+ */
UIUpload.prototype.upload = function(clickEle, id) {
var DOMUtil = eXo.core.DOMUtil;
var container = parent.document.getElementById(id);
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUserSelector.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUserSelector.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIUserSelector.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -19,7 +19,10 @@
function UIUserSelector() {
} ;
-
+/**
+ * Init information and event for items table
+ * @param {Object, String} cont Object or identifier of Object that contains items table
+ */
UIUserSelector.prototype.init = function(cont) {
if(typeof(cont) == "string") cont = document.getElementById(cont) ;
var checkboxes = eXo.core.DOMUtil.findDescendantsByClass(cont, "input",
"checkbox") ;
@@ -30,21 +33,32 @@
checkboxes[i].onclick = this.check ;
}
} ;
-
+/**
+ * Check or uncheck all items in table
+ */
UIUserSelector.prototype.checkAll = function() {
eXo.webui.UIUserSelector.checkAllItem(this);
} ;
-
+/**
+ * Get all item in table list
+ * @param {Object} obj first object of table
+ */
UIUserSelector.prototype.getItems = function(obj) {
var table = eXo.core.DOMUtil.findAncestorByTagName(obj, "table");
var checkboxes = eXo.core.DOMUtil.findDescendantsByClass(table,
"input","checkbox");
return checkboxes ;
} ;
-
+/**
+ * Check and uncheck first item
+ */
UIUserSelector.prototype.check = function() {
eXo.webui.UIUserSelector.checkItem(this);
} ;
-
+/**
+ * check and uncheck all items in table
+ * @param {Object} obj first object of table, if obj.checked is true, check all item.
+ * obj.checked is false, uncheck all items
+ */
UIUserSelector.prototype.checkAllItem = function(obj){
var checked = obj.checked ;
var items = eXo.webui.UIUserSelector.getItems(obj) ;
@@ -53,7 +67,10 @@
items[i].checked = checked ;
}
} ;
-
+/**
+ * Check and uncheck first item, state has dependence on obj state
+ * @param {Object} obj selected object
+ */
UIUserSelector.prototype.checkItem = function(obj){
var checkboxes = eXo.webui.UIUserSelector.getItems(obj);
var len = checkboxes.length;
@@ -68,7 +85,10 @@
checkboxes[0].checked = state;
}
} ;
-
+/**
+ * Get key code of pressed key
+ * @param {Object} event event that user presses a key
+ */
UIUserSelector.prototype.getKeynum = function(event) {
var keynum = false ;
if(window.event) { /* IE */
@@ -82,13 +102,19 @@
}
return keynum ;
} ;
-
+/**
+ * Process event when user presses a key
+ * @param {Object} evt event
+ */
UIUserSelector.prototype.captureInput = function(input, action) {
if(typeof(input) == "string") input = document.getElementById(input) ;
input.form.onsubmit = eXo.webui.UIUserSelector.cancelSubmit ;
input.onkeypress= eXo.webui.UIUserSelector.onEnter ;
} ;
-
+/**
+ * Process event when user presses a Enter key
+ * @param {Object} evt event
+ */
UIUserSelector.prototype.onEnter = function(evt) {
var _e = evt || window.event ;
_e.cancelBubble = true ;
@@ -100,7 +126,9 @@
eval(action) ;
}
} ;
-
+/**
+ * Cancel submit action
+ */
UIUserSelector.prototype.cancelSubmit = function() {
return false ;
} ;
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVerticalSlideTabs.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVerticalSlideTabs.js 2010-06-03
09:01:43 UTC (rev 3230)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVerticalSlideTabs.js 2010-06-04
07:49:45 UTC (rev 3231)
@@ -64,7 +64,12 @@
}
}
};
-
+/**
+ * Action when user clicks on item of vertical tab
+ * @param cleckedElement clicked element
+ * @param normalStyle a css class indicate normal state
+ * @param selectedStyle a css class indicate selected state
+ */
UIVerticalSlideTabs.prototype.onTabClick = function(clickedElement, normalStyle,
selectedStyle) {
var uiClickedVTab = eXo.core.DOMUtil.findAncestorByClass(clickedElement,
"UIVTab");
var uiClickedVTabContent = eXo.core.DOMUtil.findFirstChildByClass(uiClickedVTab,
"div", "UIVTabContent");
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo.js 2010-06-03 09:01:43
UTC (rev 3230)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo.js 2010-06-04 07:49:45
UTC (rev 3231)
@@ -16,7 +16,9 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-
+/**
+ * This class contains common js object that used in whole portal
+ */
var eXo = {
animation : { },
@@ -57,7 +59,7 @@
i18n : { }
} ;
-/*
+/**
* This method will :
* 1) dynamically load a javascript module from the server (if no root location is set
* then use '/eXoResources/javascript/', aka files
@@ -95,7 +97,15 @@
alert(err + " : " + request.responseText) ;
}
} ;
-
+/**
+ * Make url portal request with parameters
+ *
+ * @param targetComponentId identifier of component
+ * @param actionName name of action
+ * @param useAjax indicate Ajax request or none
+ * @param params array contains others parameters
+ * @return full url request
+ */
eXo.env.server.createPortalURL = function(targetComponentId, actionName, useAjax, params)
{
var href = eXo.env.server.portalBaseURL + "?portal:componentId=" +
targetComponentId + "&portal:action=" + actionName ;
@@ -108,7 +118,9 @@
if(useAjax) href += "&ajaxRequest=true" ;
return href ;
} ;
-
+/**
+ * log out of user session
+ */
eXo.portal.logout = function() {
window.location = eXo.env.server.createPortalURL("UIPortal",
"Logout", false) ;
} ;