gatein SVN: r1142 - in portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo: portal and 1 other directories.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2009-12-24 06:30:23 -0500 (Thu, 24 Dec 2009)
New Revision: 1142
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop2.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboardUtil.js
Log:
GTNPORTAL-376: Change somethings in DragDrop and structre of UIDashboard for consistency JS implementing way
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop.js 2009-12-24 10:09:43 UTC (rev 1141)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop.js 2009-12-24 11:30:23 UTC (rev 1142)
@@ -156,7 +156,7 @@
if(foundTarget == null) {
foundTarget = ele ;
} else {
- if(this.isAncestor(foundTarget, ele)) {
+ if(eXo.core.DOMUtil.hasAncestor(ele, foundTarget)) {
foundTarget = ele ;
}
}
@@ -166,16 +166,6 @@
return foundTarget ;
} ;
-DragDrop.prototype.isAncestor = function(ancestor , child) {
- var parent = child.parentNode ;
- while(parent != null) {
- if(parent == ancestor) return true ;
- var tmp = parent.parentNode ;
- parent = tmp ;
- }
- return false ;
-} ;
-
DragDrop.prototype.isIn = function(x, y, component) {
var componentLeft = eXo.core.Browser.findPosX(component);
var componentRight = componentLeft + component.offsetWidth ;
@@ -183,15 +173,6 @@
var componentBottom = componentTop + component.offsetHeight ;
var isOver = false ;
- var uiWorkspaceContainer = document.getElementById("UIWorkspaceContainer") ;
- if ((uiWorkspaceContainer && uiWorkspaceContainer.style.display != "none") && eXo.core.Browser.isIE7()) {
- if(eXo.core.I18n.isLT()) componentRight = componentRight - uiWorkspaceContainer.clientWidth ;
- }
-
- if(eXo.core.Browser.getBrowserType() == "ie") {
- componentLeft = componentLeft / 2 ;
- }
-
if((componentLeft < x) && (x < componentRight)) {
if((componentTop < y) && (y < componentBottom)) {
isOver = true ;
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop2.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop2.js 2009-12-24 10:09:43 UTC (rev 1141)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/DragDrop2.js 2009-12-24 11:30:23 UTC (rev 1142)
@@ -18,10 +18,10 @@
*/
var count = 1 ;
-eXo.core.DragDrop2 = {
- obj : null,
+function DragDrop2() {
+ var obj = null;
- init : function(o, oRoot) {
+ DragDrop2.prototype.init = function(o, oRoot) {
o.onmousedown = eXo.core.DragDrop2.start;
o.root = oRoot && oRoot != null ? oRoot : o ;
@@ -32,14 +32,14 @@
o.root.onDragStart = new Function();
o.root.onDragEnd = new Function();
o.root.onDrag = new Function();
- },
+ };
- start : function(e) {
+ DragDrop2.prototype.start = function(e) {
if (!e) e = window.event;
if(((e.which) && (e.which == 2 || e.which == 3)) || ((e.button) && (e.button == 2))) {
return;
}
- var o = eXo.core.DragDrop2.obj = this;
+ var o = obj = this;
e = eXo.core.DragDrop2.fixE(e);
var y = parseInt(eXo.core.DOMUtil.getStyle(o.root,"top"));
var x = parseInt(eXo.core.DOMUtil.getStyle(o.root,"left"));
@@ -51,11 +51,11 @@
document.onmouseup = eXo.core.DragDrop2.end;
document.onmouseout = eXo.core.DragDrop2.cancel;
return false;
- },
+ };
- drag : function(e) {
+ DragDrop2.prototype.drag = function(e) {
e = eXo.core.DragDrop2.fixE(e);
- var o = eXo.core.DragDrop2.obj;
+ var o = obj;
var ey = eXo.core.Browser.findMouseYInPage(e);
var ex = eXo.core.Browser.findMouseXInPage(e);
var y = parseInt(eXo.core.DOMUtil.getStyle(o.root, "top"));
@@ -64,34 +64,35 @@
var nx, ny;
nx = x + (ex - o.lastMouseX);
ny = y + (ey - o.lastMouseY);
- eXo.core.DragDrop2.obj.root.style["left"] = nx + "px";
- eXo.core.DragDrop2.obj.root.style["top"] = ny + "px";
- eXo.core.DragDrop2.obj.lastMouseX = ex;
- eXo.core.DragDrop2.obj.lastMouseY = ey;
+ obj.root.style["left"] = nx + "px";
+ obj.root.style["top"] = ny + "px";
+ obj.lastMouseX = ex;
+ obj.lastMouseY = ey;
- eXo.core.DragDrop2.obj.root.onDrag(nx, ny, ex, ey, e);
+ obj.root.onDrag(nx, ny, ex, ey, e);
return false;
- },
+ };
- end : function(e) {
+ DragDrop2.prototype.end = function(e) {
e = eXo.core.DragDrop2.fixE(e);
document.onmousemove = null;
document.onmouseup = null;
document.onmouseout = null;
- eXo.core.DragDrop2.obj.root.onDragEnd( parseInt(eXo.core.DragDrop2.obj.root.style["left"]),
- parseInt(eXo.core.DragDrop2.obj.root.style["top"]), e.clientX, e.clientY);
- eXo.core.DragDrop2.obj = null;
- },
+ obj.root.onDragEnd( parseInt(obj.root.style["left"]),
+ parseInt(obj.root.style["top"]), e.clientX, e.clientY);
+ obj = null;
+ };
- cancel : function(e) {
- if(eXo.core.DragDrop2.obj.root.onCancel) eXo.core.DragDrop2.obj.root.onCancel(e);
- },
+ DragDrop2.prototype.cancel = function(e) {
+ if(obj.root.onCancel) obj.root.onCancel(e);
+ };
- fixE : function(e) {
+ DragDrop2.prototype.fixE = function(e) {
if (typeof e == 'undefined') e = window.event;
if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
return e;
- }
-
-};
\ No newline at end of file
+ };
+};
+
+eXo.core.DragDrop2 = new DragDrop2();
\ No newline at end of file
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2009-12-24 10:09:43 UTC (rev 1141)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2009-12-24 11:30:23 UTC (rev 1142)
@@ -39,6 +39,9 @@
var Browser = eXo.core.Browser ;
var DragDrop = eXo.core.DragDrop ;
var Mouse = eXo.core.Mouse;
+
+ var previewBlock = null;
+ var previewTD = null;
/**
* This function is called after the DragDrop object is initialized
*/
@@ -50,7 +53,6 @@
this.origDragObjectStyle.copyProperties(properties, dragObject.style) ;
var isComponent = !!DOMUtil.findFirstDescendantByClass(dragObject, "div", "UIComponentBlock");
- dragObject.isComponent = isComponent;
var uiWorkingWS = document.getElementById("UIWorkingWorkspace");
PortalDragDrop.positionRootObj = isComponent ? uiWorkingWS :
@@ -58,8 +60,6 @@
var originalDragObjectTop = Browser.findPosYInContainer(dragObject, PortalDragDrop.positionRootObj);
var originalDragObjectLeft = Browser.findPosXInContainer(dragObject, PortalDragDrop.positionRootObj);
- var originalMousePositionY = Mouse.mouseyInPage;
- var originalMousePositionX = Mouse.mousexInPage;
PortalDragDrop.deltaYDragObjectAndMouse = Browser.findMouseRelativeY(dragObject, e);
PortalDragDrop.deltaXDragObjectAndMouse = Browser.findMouseRelativeX(dragObject, e);
if(!isComponent) {
@@ -75,25 +75,28 @@
if(!isComponent) {
var cloneObject = dragObject.cloneNode(true) ;
dragObject.parentNode.insertBefore(cloneObject, dragObject) ;
-
- dndEvent.dragObject = cloneObject ;
-
- cloneObject.style.position = "absolute" ;
- if(eXo.core.I18n.isLT()) cloneObject.style.left = originalDragObjectLeft + "px" ;
- else cloneObject.style.right = (PortalDragDrop.positionRootObj.offsetWidth - originalDragObjectLeft - dragObject.offsetWidth) + "px" ;
-
- cloneObject.style.top = originalDragObjectTop + "px" ;
cloneObject.style.opacity = 0.5 ;
cloneObject.style.filter = "alpha(opacity=50)" ;
cloneObject.style.width = PortalDragDrop.backupDragObjectWidth + "px" ;
- cloneObject.isComponent = false;
+ dndEvent.dragObject = cloneObject ;
+ } else {
+ previewBlock = PortalDragDrop.createPreview();
+ dragObject.parentNode.insertBefore(previewBlock, dragObject);
+ dragObject.style.width = "300px";
+ var componentBlock = eXo.core.DOMUtil.findFirstDescendantByClass(dragObject, "div", "UIComponentBlock") ;
+ var editBlock = eXo.core.DOMUtil.findFirstChildByClass(componentBlock, "div", "EDITION-BLOCK");
+ if(editBlock) {
+ var newLayer = eXo.core.DOMUtil.findFirstDescendantByClass(editBlock, "div", "NewLayer");
+ if(newLayer) newLayer.style.width = "300px";
+ }
}
+ dragObject.isComponent = isComponent;
- //fix bug ie in RTL
-// if(eXo.core.I18n.isRT() && Browser.isIE6() && DOMUtil.findFirstDescendantByClass(dragObject, "div", "CONTROL-BLOCK")) {
-// dragObject.style.right = parseInt(dragObject.style.right)
-// + document.getElementById("UIControlWorkspace").offsetWidth + "px" ;
-// }
+ dragObject = dndEvent.dragObject;
+ dragObject.style.position = "absolute" ;
+ if(eXo.core.I18n.isLT()) dragObject.style.left = originalDragObjectLeft + "px" ;
+ else dragObject.style.right = (PortalDragDrop.positionRootObj.offsetWidth - originalDragObjectLeft - dragObject.offsetWidth) + "px" ;
+ dragObject.style.top = originalDragObjectTop + "px" ;
eXo.portal.isInDragging = true;
}
@@ -101,146 +104,118 @@
DragDrop.dragCallback = function(dndEvent) {
var dragObject = dndEvent.dragObject ;
/* Control Scroll */
- eXo.portal.PortalDragDrop.scrollOnDrag(dragObject, dndEvent) ;
- if(dndEvent.foundTargetObject && dndEvent.lastFoundTargetObject) {
- /*Check and asign UIPage to uiComponentLayout when DND on UIPage*/
- var uiComponentLayout ;
- if(dndEvent.foundTargetObject.className == "UIPage") {
- uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.foundTargetObject, "div", "VIEW-PAGE");
- } else if(dndEvent.foundTargetObject.className == "UIPortal") {
- if(eXo.portal.portalMode%2) uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.foundTargetObject, "div", "LAYOUT-PORTAL") ;
- else uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.foundTargetObject, "div", "VIEW-PORTAL");
- } else {
- var foundUIComponent = new eXo.portal.UIPortalComponent(dndEvent.foundTargetObject) ;
- if(eXo.portal.portalMode%2) uiComponentLayout = foundUIComponent.getLayoutBlock() ;
- else uiComponentLayout = foundUIComponent.getViewBlock();
- uiComponentLayout.style.height = "auto";
- }
+ eXo.portal.PortalDragDrop.scrollOnDrag(dndEvent) ;
+ if(!dndEvent.foundTargetObject) return;
+ var uiComponentLayout ;
+ if(dndEvent.foundTargetObject.className == "UIPage") {
+ uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.foundTargetObject, "div", "VIEW-PAGE");
+ } else if(dndEvent.foundTargetObject.className == "UIPortal") {
+ if(eXo.portal.portalMode%2) uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.foundTargetObject, "div", "LAYOUT-PORTAL") ;
+ else uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.foundTargetObject, "div", "VIEW-PORTAL");
+ } else {
+ var foundUIComponent = new eXo.portal.UIPortalComponent(dndEvent.foundTargetObject) ;
+ if(eXo.portal.portalMode%2) uiComponentLayout = foundUIComponent.getLayoutBlock() ;
+ else uiComponentLayout = foundUIComponent.getViewBlock();
+ uiComponentLayout.style.height = "auto";
+ }
+
+ dndEvent.foundTargetObject.uiComponentLayoutType = uiComponentLayout ;
+ var componentIdElement = DOMUtil.getChildrenByTagName(uiComponentLayout, "div")[0] ;
+ var layoutTypeElement = DOMUtil.getChildrenByTagName(componentIdElement, "div")[0] ;
+ eXo.portal.PortalDragDrop.layoutTypeElementNode = layoutTypeElement ;
+
+ if(previewBlock == null) previewBlock = eXo.portal.PortalDragDrop.createPreview();
+ if(previewTD || document.getElementById("PreviewTDBlock")) {
+ if(!previewTD) previewTD = document.getElementById("PreviewTDBlock");
+ if(previewTD.parentNode) previewTD.parentNode.removeChild(previewTD);
+ previewTD = null;
+ }
+
+ if(layoutTypeElement != null && !DOMUtil.hasClass(layoutTypeElement, "UITableColumnContainer")) {
+ /* ===============================CASE ROW LAYOUT================================ */
+ var rowContainer = DOMUtil.findFirstDescendantByClass(uiComponentLayout, "div", "UIRowContainer") ;
+ var childRowContainer = DOMUtil.getChildrenByTagName(rowContainer, "div") ;
- try {
- if(eXo.portal.PortalDragDrop.backupLastFoundTarget) {
- var lastFoundUIComponent = new eXo.portal.UIPortalComponent(eXo.portal.PortalDragDrop.backupLastFoundTarget);
-
- var lastFoundComponentLayout = lastFoundUIComponent.getLayoutBlock();
- if((DOMUtil.hasClass(lastFoundComponentLayout, "LAYOUT-CONTAINER") || DOMUtil.hasClass(lastFoundComponentLayout, "VIEW-CONTAINER"))
- && (lastFoundComponentLayout.offsetHeight < 30)) {
- if (DOMUtil.findFirstDescendantByClass(lastFoundComponentLayout, "div", "UIContainer") == null) {
- lastFoundComponentLayout.style.height = "60px" ;
- }
- }
- }
- } catch(err) {
- //window.status = err.toString() ;
+ var listComponent = new Array() ;
+ for(var i = 0; i < childRowContainer.length; i++) {
+ if((childRowContainer[i].className != "DragAndDropPreview") && (childRowContainer[i] != dragObject)) {
+ listComponent.push(childRowContainer[i]) ;
+ }
}
-
- /*################################################################################*/
- dndEvent.foundTargetObject.uiComponentLayoutType = uiComponentLayout ;
+ dndEvent.foundTargetObject.listComponentInTarget = listComponent ;
+ var insertPosition = eXo.portal.PortalDragDrop.findInsertPosition(listComponent, dragObject, "row") ;
+ dndEvent.foundTargetObject.foundIndex = insertPosition ;
- var componentIdElement = DOMUtil.getChildrenByTagName(uiComponentLayout, "div")[0] ;
- var layoutTypeElement = DOMUtil.getChildrenByTagName(componentIdElement, "div")[0] ;
- eXo.portal.PortalDragDrop.layoutTypeElementNode = layoutTypeElement ;
+ /* Insert preview block */
+ if(insertPosition >= 0) {
+ rowContainer.insertBefore(previewBlock, listComponent[insertPosition]) ;
+ } else {
+ rowContainer.appendChild(previewBlock) ;
+ }
+ } else {
+ /* ===============================CASE COLUMN LAYOUT================================ */
+ var columnContainer = DOMUtil.findFirstDescendantByClass(uiComponentLayout, "table", "UITableColumnContainer") ;
+ var trContainer = DOMUtil.findFirstDescendantByClass(uiComponentLayout, "tr", "TRContainer") ;
+ var tdElementList = DOMUtil.getChildrenByTagName(trContainer, "td") ;
- if(layoutTypeElement != null && !DOMUtil.hasClass(layoutTypeElement, "UITableColumnContainer")) {
- /* ===============================CASE ROW LAYOUT================================ */
- var rowContainer = DOMUtil.findFirstDescendantByClass(uiComponentLayout, "div", "UIRowContainer") ;
- var childRowContainer = DOMUtil.getChildrenByTagName(rowContainer, "div") ;
-
- var listComponent = new Array() ;
- for(var i = 0; i < childRowContainer.length; i++) {
- if((childRowContainer[i].className != "DragAndDropPreview") && (childRowContainer[i] != dragObject)) {
- listComponent.push(childRowContainer[i]) ;
+ var listComponent = new Array() ;
+ for(var i = 0; i < tdElementList.length; i++) {
+ if(DOMUtil.hasAncestor(previewBlock, uiComponentLayout)) {
+ var td = tdElementList[i];
+ if((td != previewBlock.parentNode) && (td != dragObject.parentNode)) {
+ listComponent.push(td) ;
+ } else if(td == dragObject.parentNode) {
+ td.style.width = "0px";
}
- }
-
- dndEvent.foundTargetObject.listComponentInTarget = listComponent ;
- /*Set properties for drag object */
-
- var insertPosition = eXo.portal.PortalDragDrop.findInsertPosition(listComponent, dragObject, "row") ;
-
-// if(dndEvent.foundTargetObject == dndEvent.lastFoundTargetObject &&
-// dndEvent.lastFoundTargetObject.foundIndex == insertPosition) {
-// return ;
-// }
- dndEvent.foundTargetObject.foundIndex = insertPosition ;
-
- /*Undo preview */
- if(dndEvent.lastFoundTargetObject != null) {
- eXo.portal.PortalDragDrop.backupLastFoundTarget = dndEvent.lastFoundTargetObject ;
- eXo.portal.PortalDragDrop.undoPreview(dndEvent) ;
- }
-
- /* Insert preview block */
- if(insertPosition >= 0) {
- rowContainer.insertBefore(eXo.portal.PortalDragDrop.createPreview("row"), listComponent[insertPosition]) ;
} else {
- rowContainer.appendChild(eXo.portal.PortalDragDrop.createPreview("row")) ;
- }
-
- eXo.portal.PortalDragDrop.setDragObjectProperties(dragObject, childRowContainer, "row", dndEvent.backupMouseEvent) ;
+ listComponent.push(tdElementList[i]) ;
+ }
+ }
+
+ dndEvent.foundTargetObject.listComponentInTarget = listComponent ;
+ var insertPosition = eXo.portal.PortalDragDrop.findInsertPosition(listComponent, dragObject, "column") ;
+ dndEvent.foundTargetObject.foundIndex = insertPosition ;
+
+ /* Insert preview block */
+ var tdBlock = document.createElement("td");
+ tdBlock.id = tdBlock.className = "PreviewTDBlock";
+ tdBlock.appendChild(previewBlock);
+ previewTD = tdBlock;
+ if(insertPosition >= 0) {
+ trContainer.insertBefore(previewTD, listComponent[insertPosition]) ;
} else {
- /* ===============================CASE COLUMN LAYOUT================================ */
- var columnContainer = DOMUtil.findFirstDescendantByClass(uiComponentLayout, "table", "UITableColumnContainer") ;
- var trContainer = DOMUtil.findFirstDescendantByClass(uiComponentLayout, "tr", "TRContainer") ;
- var tdElementList = DOMUtil.getChildrenByTagName(trContainer, "td") ;
-
- var listComponent = new Array() ;
- for(var i = 0; i < tdElementList.length; i++) {
- if(DOMUtil.hasDescendantClass(uiComponentLayout, "DragAndDropPreview")) {
- var previewBlock = DOMUtil.findFirstDescendantByClass(trContainer, "div", "DragAndDropPreview") ;
- if((tdElementList[i] != previewBlock.parentNode) && (tdElementList[i] != dragObject.parentNode)) {
- listComponent.push(tdElementList[i]) ;
- }
- } else {
- listComponent.push(tdElementList[i]) ;
- }
- }
-
- dndEvent.foundTargetObject.listComponentInTarget = listComponent ;
- /*Find Insert Position */
- var insertPosition = eXo.portal.PortalDragDrop.findInsertPosition(listComponent, dragObject, "column") ;
-
- if(dndEvent.foundTargetObject == dndEvent.lastFoundTargetObject &&
- dndEvent.lastFoundTargetObject.foundIndex == insertPosition) {
- return ;
- }
-
- dndEvent.foundTargetObject.foundIndex = insertPosition ;
- /*Undo preview */
- if(dndEvent.lastFoundTargetObject != null) {
- eXo.portal.PortalDragDrop.undoPreview(dndEvent) ;
- }
-
- /* Insert preview block */
- eXo.portal.PortalDragDrop.tdInserted = document.createElement('td') ;
- eXo.portal.PortalDragDrop.tdInserted .appendChild(eXo.portal.PortalDragDrop.createPreview("column")) ;
- if(insertPosition >= 0) {
- trContainer.insertBefore(eXo.portal.PortalDragDrop.tdInserted, listComponent[insertPosition]) ;
- } else {
- trContainer.appendChild(eXo.portal.PortalDragDrop.tdInserted) ;
- }
- /*Set properties for drag object */
- eXo.portal.PortalDragDrop.setDragObjectProperties(dragObject, tdElementList, "column", dndEvent.backupMouseEvent) ;
+ trContainer.appendChild(previewTD) ;
}
- }
+ }
} ;
DragDrop.dropCallback = function(dndEvent) {
this.origDragObjectStyle.setProperties(dndEvent.dragObject.style, false) ;
- if(dndEvent.foundTargetObject != null) {
+ if(dndEvent.foundTargetObject != null || (dndEvent.backupMouseEvent && dndEvent.backupMouseEvent.keyCode != 27)) {
eXo.portal.PortalDragDrop.doDropCallback(dndEvent) ;
} else {
if(!dndEvent.dragObject.isComponent) {
dndEvent.dragObject.parentNode.removeChild(dndEvent.dragObject) ;
}
+ if(dndEvent.dragObject.parentNode.tagName.toLowerCase() == "td") {
+ dndEvent.dragObject.parentNode.style.width = "auto";
+ }
// fix bug WEBOS-196
- var srcElement = dndEvent.dragObject ;
- srcElement.style.width = "auto" ;
-
- eXo.portal.PortalDragDrop.removeNullPreview();
+ dndEvent.dragObject.style.width = "auto" ;
}
+ if(dndEvent.dragObject.isComponent) {
+ var componentBlock = eXo.core.DOMUtil.findFirstDescendantByClass(dndEvent.dragObject, "div", "UIComponentBlock") ;
+ var editBlock = eXo.core.DOMUtil.findFirstChildByClass(componentBlock, "div", "EDITION-BLOCK");
+ if(editBlock) editBlock.style.display = "none";
+ }
+
+ if(previewBlock) previewBlock.parentNode.removeChild(previewBlock);
+ if(previewTD) previewTD.parentNode.removeChild(previewTD);
+ previewBlock = previewTD = null;
+
eXo.portal.isInDragging = false;
eXo.portal.UIPortal.changeComposerSaveButton();
};
@@ -268,23 +243,15 @@
};
PortalDragDrop.prototype.doDropCallback = function(dndEvent) {
- if(!dndEvent.lastFoundTargetObject) {
- dndEvent.lastFoundTargetObject = eXo.portal.PortalDragDrop.backupLastFoundTarget ;
- }
-
- eXo.portal.PortalDragDrop.undoPreview(dndEvent) ;
-
var srcElement = dndEvent.dragObject ;
-
- var targetElement = dndEvent.foundTargetObject ;
+ var targetElement = dndEvent.foundTargetObject;
var newComponent = false;
- if(eXo.core.DOMUtil.hasDescendantClass(srcElement, "DragControlArea") && (targetElement.foundIndex != null)) {
-// alert("My Test: " + eXo.portal.PortalDragDrop.layoutTypeElementNode);
+ if(srcElement.isComponent && (targetElement.foundIndex != null)) {
if(eXo.portal.PortalDragDrop.layoutTypeElementNode != null) {
eXo.portal.PortalDragDrop.divRowContainerAddChild(srcElement, targetElement, targetElement.foundIndex) ;
} else {
-// alert("Table is OK");
+ eXo.portal.PortalDragDrop.parentDragObject.style.width = "auto";
eXo.portal.PortalDragDrop.tableColumnContainerAddChild(srcElement, targetElement, targetElement.foundIndex) ;
}
}
@@ -330,7 +297,7 @@
return dropableTargets ;
};
-PortalDragDrop.prototype.scrollOnDrag = function(dragObject, dndEvent) {
+PortalDragDrop.prototype.scrollOnDrag = function(dndEvent) {
var workspaceHeight = document.getElementById("UIWorkingWorkspace").offsetHeight;
var browserHeight = eXo.core.Browser.getBrowserHeight() ;
if(workspaceHeight <= browserHeight) return;
@@ -347,8 +314,6 @@
};
PortalDragDrop.prototype.findInsertPosition = function(components, dragObject, layout) {
- var dragObjectX = eXo.core.Browser.findPosX(dragObject) ;
-
if(layout == "row") {
for(var i = 0; i < components.length; i++) {
var componentTop = eXo.core.Browser.findPosY(components[i]) ;
@@ -361,6 +326,7 @@
return -1 ;
} else {
+ var dragObjectX = eXo.core.Browser.findPosX(dragObject) ;
for(var i = 0; i < components.length; i++) {
var componentInTD = eXo.core.DOMUtil.getChildrenByTagName(components[i] ,"div")[0] ;
var componentX = eXo.core.Browser.findPosX(components[i]) ;
@@ -372,117 +338,13 @@
}
};
-PortalDragDrop.prototype.setDragObjectProperties = function(dragObject, listComponent, layout, e) {
- var uiPage = eXo.core.DOMUtil.findAncestorByClass(dragObject, "UIPage");
-
- /* IE's Bug: It always double when set position, margin-left for
- * UIWorkingWorkspace is problem.
- * If WorkingWorkspace is setted a width, that bug disappear
- * but the layout on IE has breakdown!!!
- * */
- dragObject.style.top = (eXo.core.Browser.findMouseRelativeY(eXo.portal.PortalDragDrop.positionRootObj, e) -
- eXo.portal.PortalDragDrop.deltaYDragObjectAndMouse) + "px";
- var componentBlock = eXo.core.DOMUtil.findFirstDescendantByClass(dragObject, "div", "UIComponentBlock") ;
- if(!componentBlock) {
- if(eXo.core.I18n.isLT()) dragObject.style.left = (eXo.core.Browser.findMouseRelativeX(dragObject.offsetParent, e) -
- eXo.portal.PortalDragDrop.deltaXDragObjectAndMouse) + "px" ;
- } else {
- var uiWorkingWS = document.getElementById("UIWorkingWorkspace");
- if(eXo.core.I18n.isLT()) dragObject.style.left = (eXo.core.Browser.findMouseRelativeX(uiWorkingWS, e) -
- eXo.portal.PortalDragDrop.deltaXDragObjectAndMouse) + "px" ;
- var editBlock = eXo.core.DOMUtil.findFirstChildByClass(componentBlock, "div", "EDITION-BLOCK");
- if(editBlock) {
- var newLayer = eXo.core.DOMUtil.findFirstDescendantByClass(editBlock, "div", "NewLayer");
- if(newLayer) newLayer.style.width = "300px";
- }
- }
- dragObject.style.width = "300px" ;
- dragObject.style.position = "absolute" ;
-};
-
PortalDragDrop.prototype.createPreview = function(layoutType) {
-
- var previewBlock = document.createElement("div") ;
- var components = eXo.core.DragDrop.dndEvent.foundTargetObject.listComponentInTarget ;
-
- previewBlock.className = "DragAndDropPreview" ;
- previewBlock.id = "DragAndDropPreview" ;
-
- if((layoutType == "column") && (components.length > 0)) {
- var offsetWidthTR = components[0].parentNode.offsetWidth ;
- var widthComponent = 0 ;
-
- if(eXo.core.DOMUtil.findAncestorByClass(eXo.portal.PortalDragDrop.parentDragObject, "TRContainer") != null) {
- widthComponent = Math.round(offsetWidthTR / (components.length)) - 1 ;
- } else {
- widthComponent = Math.round(offsetWidthTR / (components.length + 1)) - 1 ;
- }
-
- eXo.portal.PortalDragDrop.tdInserted.style.width = widthComponent + "px" ;
-
- for(var i = 0 ; i < components.length; i++) {
- if(components[i] == eXo.portal.PortalDragDrop.parentDragObject) {
- components[i].style.width = "0px" ;
- } else {
- components[i].style.width = widthComponent + "px" ;
- }
- }
-
- eXo.portal.PortalDragDrop.widthComponentInTarget = widthComponent ;
- }
- return previewBlock ;
+ var previewBlock = document.createElement("div") ;
+ previewBlock.className = "DragAndDropPreview" ;
+ previewBlock.id = "DragAndDropPreview" ;
+ return previewBlock;
};
-PortalDragDrop.prototype.removeNullPreview = function() {
- var dropObject = document.getElementById("DragAndDropPreview") ;
- if (dropObject && dropObject.innerHTML == "") {
- dropObject.parentNode.removeChild(dropObject);
- }
-}
-
-PortalDragDrop.prototype.undoPreview = function(dndEvent) {
- var DOMUtil = eXo.core.DOMUtil ;
- var uiComponentLayout ;
- try{
- if(dndEvent.lastFoundTargetObject.className == "UIPage") {
- uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.foundTargetObject, "div", "VIEW-PAGE");
- } else if(dndEvent.lastFoundTargetObject.className == "UIPortal") {
- if(eXo.portal.portalMode%2) uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.lastFoundTargetObject, "div", "LAYOUT-PORTAL");
- else uiComponentLayout = DOMUtil.findFirstDescendantByClass(dndEvent.lastFoundTargetObject, "div", "VIEW-PORTAL");
- } else {
- var foundUIComponent = new eXo.portal.UIPortalComponent(dndEvent.lastFoundTargetObject) ;
- if(eXo.portal.portalMode%2) uiComponentLayout = foundUIComponent.getLayoutBlock() ;
- else uiComponentLayout = foundUIComponent.getViewBlock();
- }
- }catch(e) {}
- var componentIdElement = DOMUtil.getChildrenByTagName(uiComponentLayout ,"div")[0] ;
- var layoutTypeElement = DOMUtil.getChildrenByTagName(componentIdElement ,"div")[0] ;
-
- var dropHere = document.getElementById("DragAndDropPreview") ;
-
- var dragObject = dndEvent.dragObject ;
-
- if(dropHere != null) {
- if(layoutTypeElement != null) {
- dropHere.parentNode.removeChild(dropHere) ;
- } else {
- var tableLayoutElement = DOMUtil.getChildrenByTagName(componentIdElement ,"table")[0] ;
- var trContainer = DOMUtil.findFirstDescendantByClass(tableLayoutElement, "tr", "TRContainer") ;
-
- trContainer.removeChild(dropHere.parentNode) ;
- childTRContainer = DOMUtil.getChildrenByTagName(trContainer, "td") ;
-
- for(var i = 0; i < childTRContainer.length; i++) {
- if(childTRContainer[i] == eXo.portal.PortalDragDrop.parentDragObject) {
- childTRContainer[i].style.width = "0px" ;
- }
- }
-
- }
- }
- dragObject.style.border = "none" ;
-};
-
PortalDragDrop.prototype.divRowContainerAddChild = function(insertBlock, targetElement, insertPosition) {
var listComponent = eXo.core.DragDrop.dndEvent.foundTargetObject.listComponentInTarget ;
var uiRowContainer = eXo.core.DOMUtil.findFirstDescendantByClass(targetElement, "div", "UIRowContainer") ;
@@ -493,23 +355,16 @@
} else {
uiRowContainer.appendChild(insertBlock) ;
}
-
- if(eXo.portal.PortalDragDrop.parentDragObject.parentNode.className == "TRContainer") {
- eXo.portal.PortalDragDrop.parentDragObject.parentNode.removeChild(eXo.portal.PortalDragDrop.parentDragObject) ;
- }
};
PortalDragDrop.prototype.tableColumnContainerAddChild = function(insertBlock, targetElement, insertPosition) {
var listComponent = eXo.core.DragDrop.dndEvent.foundTargetObject.listComponentInTarget ;
var DOMUtil = eXo.core.DOMUtil ;
var trContainer = DOMUtil.findFirstDescendantByClass(targetElement, "tr", "TRContainer") ;
- var tdInserted = document.createElement('td') ;
- var checkTRContainerInsertBlock = DOMUtil.findAncestorByClass(insertBlock, "TRContainer") ;
-
- tdInserted.style.width = eXo.portal.PortalDragDrop.widthComponentInTarget + "px" ;
-
+ var tdInserted = document.createElement('td') ;
tdInserted.appendChild(insertBlock) ;
+
if(insertPosition >= 0) {
trContainer.insertBefore(tdInserted, listComponent[insertPosition]) ;
} else {
@@ -518,9 +373,9 @@
insertBlock.style.width = "auto" ;
- if(checkTRContainerInsertBlock) {
- trContainer.removeChild(eXo.portal.PortalDragDrop.parentDragObject) ;
+ if(eXo.portal.PortalDragDrop.parentDragObject.tagName.toLowerCase() == "td") {
+ DOMUtil.removeElement(eXo.portal.PortalDragDrop.parentDragObject) ;
}
};
-eXo.portal.PortalDragDrop = new PortalDragDrop() ;
+eXo.portal.PortalDragDrop = new PortalDragDrop() ;
\ No newline at end of file
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 2009-12-24 10:09:43 UTC (rev 1141)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js 2009-12-24 11:30:23 UTC (rev 1142)
@@ -17,17 +17,17 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-eXo.webui.UIDashboard = {
+function UIDashboard() {
- currCol : null,
- targetObj : null,
+ var currCol = null;
+ var targetObj = null;
- init : function (dragItem, dragObj) {
+ UIDashboard.prototype.init = function (dragItem, dragObj) {
- eXo.core.DragDrop2.init(dragItem, dragObj) ;
+ var DOMUtil = eXo.core.DOMUtil;
+ eXo.core.DragDrop2.init(dragItem, dragObj);
dragObj.onDragStart = function(x, y, lastMouseX, lastMouseY, e) {
- var DOMUtil = eXo.core.DOMUtil;
var uiDashboard = eXo.webui.UIDashboard ;
var portletFragment = DOMUtil.findAncestorByClass(dragObj, "PORTLET-FRAGMENT");
if(!portletFragment) return;
@@ -56,20 +56,16 @@
temp = temp.parentNode;
}
-// var slideBar = document.getElementById("ControlWorkspaceSlidebar");
-// if(slideBar!=null && slideBar.style.display!="none" && eXo.core.Browser.getBrowserType()=="ie")
-// x -= slideBar.offsetWidth;
-
var uiTarget = null;
if(!DOMUtil.hasClass(dragObj, "SelectItem")) {
uiTarget = uiDashboard.createTarget(ggwidth, 0);
dragObj.parentNode.insertBefore(uiTarget, dragObj.nextSibling);
- uiDashboard.currCol = eXo.webui.UIDashboardUtil.findColIndexInDashboard(dragObj);
+ currCol = eXo.webui.UIDashboardUtil.findColIndexInDashboard(dragObj);
}else{
var dragCopyObj = dragObj.cloneNode(true);
DOMUtil.addClass(dragCopyObj, "CopyObj");
dragObj.parentNode.insertBefore(dragCopyObj, dragObj);
- uiDashboard.targetObj = null;
+ targetObj = null;
}
dragObj.style.width = ggwidth +"px";
@@ -96,15 +92,14 @@
eXo.webui.UIDashboardUtil.setPositionInContainer(uiWorkingWS, dragObj, x, y);
if(uiTarget!=null) {
uiTarget.style.height = ggheight +"px";
- uiDashboard.targetObj = uiTarget;
+ targetObj = uiTarget;
}
}
dragObj.onDrag = function(nx, ny, ex, ey, e) {
- var DOMUtil = eXo.core.DOMUtil;
- var uiTarget = eXo.webui.UIDashboard.targetObj;
+ var uiTarget = targetObj;
var portletFragment = DOMUtil.findAncestorByClass(dragObj, "PORTLET-FRAGMENT");
if(!portletFragment) return;
@@ -116,18 +111,17 @@
if(eXo.webui.UIDashboardUtil.isIn(ex, ey, dashboardCont)) {
if(!uiTarget) {
uiTarget = eXo.webui.UIDashboard.createTargetOfAnObject(dragObj);
- eXo.webui.UIDashboard.targetObj = uiTarget;
+ targetObj = uiTarget;
}
- var uiCol = eXo.webui.UIDashboard.currCol ;
+ var uiCol = currCol ;
if(!uiCol) {
if(!cols) cols = DOMUtil.findDescendantsByClass(dashboardCont, "div", "UIColumn");
for(var i=0; i<cols.length; i++) {
var uiColLeft = eXo.webui.UIDashboardUtil.findPosX(cols[i]) - dashboardCont.scrollLeft;
if(uiColLeft<ex && ex<uiColLeft+cols[i].offsetWidth) {
- uiCol = cols[i];
- eXo.webui.UIDashboard.currCol = uiCol;
+ currCol = uiCol = cols[i];
break;
}
}
@@ -170,7 +164,7 @@
for(var i=0; i<cols.length; i++) {
var uiColLeft = eXo.webui.UIDashboardUtil.findPosX(cols[i]) - dashboardCont.scrollLeft;
if(uiColLeft<ex && ex<uiColLeft+cols[i].offsetWidth) {
- eXo.webui.UIDashboard.currCol = cols[i];
+ currCol = cols[i];
break;
}
}
@@ -179,7 +173,7 @@
//prevent dragging gadget object out of DashboardContainer
if(uiTarget!=null && DOMUtil.hasClass(dragObj, "SelectItem")) {
uiTarget.parentNode.removeChild(uiTarget);
- eXo.webui.UIDashboard.targetObj = uiTarget = null;
+ targetObj = uiTarget = null;
}
}
}
@@ -187,26 +181,25 @@
dragObj.onDragEnd = function(x, y, clientX, clientY) {
- var uiDashboard = eXo.webui.UIDashboard;
var uiDashboardUtil = eXo.webui.UIDashboardUtil;
- var portletFragment = eXo.core.DOMUtil.findAncestorByClass(dragObj, "PORTLET-FRAGMENT");
+ var portletFragment = DOMUtil.findAncestorByClass(dragObj, "PORTLET-FRAGMENT");
if(!portletFragment) return;
- var masks = eXo.core.DOMUtil.findDescendantsByClass(portletFragment, "div", "UIMask");
+ var masks = DOMUtil.findDescendantsByClass(portletFragment, "div", "UIMask");
for(var i=0; i<masks.length; i++) {
eXo.core.Browser.setOpacity(masks[i], 100);
masks[i].style.display = "none";
}
- var uiTarget = uiDashboard.targetObj;
+ var uiTarget = targetObj;
if(uiTarget && !uiTarget.parentNode) {
uiTarget = null;
}
dragObj.style.position = "static";
- eXo.core.DOMUtil.removeClass(dragObj,"Dragging");
+ DOMUtil.removeClass(dragObj,"Dragging");
- var dragCopyObj = eXo.core.DOMUtil.findFirstDescendantByClass(portletFragment, "div", "CopyObj");
+ var dragCopyObj = DOMUtil.findFirstDescendantByClass(portletFragment, "div", "CopyObj");
if(dragCopyObj) {
dragCopyObj.parentNode.replaceChild(dragObj, dragCopyObj);
dragObj.style.width = "auto";
@@ -218,7 +211,7 @@
var row = uiDashboardUtil.findRowIndexInDashboard(uiTarget);
var compId = portletFragment.parentNode.id;
- if(eXo.core.DOMUtil.hasClass(dragObj, "SelectItem")) {
+ if(DOMUtil.hasClass(dragObj, "SelectItem")) {
var params = [
{name: "colIndex", value: col},
{name: "rowIndex", value: row},
@@ -245,12 +238,12 @@
}
}
- uiTarget = eXo.core.DOMUtil.findFirstDescendantByClass(portletFragment, "div", "UITarget");
+ uiTarget = DOMUtil.findFirstDescendantByClass(portletFragment, "div", "UITarget");
while (uiTarget) {
- eXo.core.DOMUtil.removeElement(uiTarget);
+ DOMUtil.removeElement(uiTarget);
uiTarget = eXo.core.DOMUtil.findFirstDescendantByClass(portletFragment, "div", "UITarget");
}
- uiDashboard.targetObj = uiDashboard.currCol = uiDashboard.compId = null;
+ targetObj = currCol = null;
}
@@ -259,9 +252,9 @@
eXo.core.DragDrop2.end(e);
}
}
- },
+ };
- onLoad : function(windowId, canEdit) {
+ UIDashboard.prototype.onLoad = function(windowId, canEdit) {
var portletWindow = document.getElementById(windowId);
if(!portletWindow) return;
@@ -299,9 +292,9 @@
eXo.webui.UIDashboard.initHeight(windowId) ;
setTimeout("eXo.webui.UIDashboard.initDragDrop('" + windowId + "'," + canEdit + ");", 300) ;
- },
+ };
- initDragDrop : function(windowId, canEdit) {
+ UIDashboard.prototype.initDragDrop = function(windowId, canEdit) {
var DOMUtil = eXo.core.DOMUtil ;
var portletWindow = document.getElementById(windowId) ;
var gadgetControls = DOMUtil.findDescendantsByClass(portletWindow, "div", "GadgetControl");
@@ -328,9 +321,9 @@
}
}
}
- },
+ };
- initHeight : function(windowId) {
+ UIDashboard.prototype.initHeight = function(windowId) {
var DOMUtil = eXo.core.DOMUtil;
var portletWindow, uiWindow ;
if(typeof(windowId) != "string") {
@@ -390,26 +383,26 @@
}
}
}
- },
+ };
- createTarget : function(width, height) {
+ UIDashboard.prototype.createTarget = function(width, height) {
var uiTarget = document.createElement("div");
uiTarget.id = "UITarget";
uiTarget.className = "UITarget";
uiTarget.style.width = width + "px";
uiTarget.style.height = height + "px";
return uiTarget;
- },
+ };
- createTargetOfAnObject : function(obj) {
+ UIDashboard.prototype.createTargetOfAnObject = function(obj) {
var uiTarget = document.createElement("div");
uiTarget.id = "UITarget";
uiTarget.className = "UITarget";
uiTarget.style.height = obj.offsetHeight + "px";
return uiTarget;
- },
+ };
- showHideSelectContainer : function(event) {
+ UIDashboard.prototype.showHideSelectContainer = function(event) {
if(!event) event = window.event;
var DOMUtil = eXo.core.DOMUtil;
var comp = eXo.core.Browser.getEventSource(event);
@@ -433,9 +426,9 @@
var url = eXo.webui.UIDashboardUtil.createRequest(portletFragment.parentNode.id, "SetShowSelectContainer", params);
ajaxGet(url);
}
- },
+ };
- onTabClick : function(clickElement, normalStyle, selectedType) {
+ UIDashboard.prototype.onTabClick = function(clickElement, normalStyle, selectedType) {
var DOMUtil = eXo.core.DOMUtil;
var category = DOMUtil.findAncestorByClass(clickElement, "GadgetCategory");
var categoryContent = DOMUtil.findFirstChildByClass(category, "div", "ItemsContainer");
@@ -454,27 +447,27 @@
DOMUtil.findFirstChildByClass(category, "div", "GadgetTab").className = "GadgetTab " + normalStyle;
categoryContent.style.display = "none";
}
- },
+ };
- enableContainer : function(elemt) {
+ UIDashboard.prototype.enableContainer = function(elemt) {
var DOMUtil = eXo.core.DOMUtil;
if(DOMUtil.hasClass(elemt, "DisableContainer")) {
DOMUtil.replaceClass(elemt, " DisableContainer", "");
}
var arrow = DOMUtil.findFirstChildByClass(elemt, "div", "Arrow");
if(DOMUtil.hasClass(arrow, "DisableArrowIcon")) DOMUtil.replaceClass(arrow," DisableArrowIcon", "");
- },
+ };
- disableContainer : function(elemt) {
+ UIDashboard.prototype.disableContainer = function(elemt) {
var DOMUtil = eXo.core.DOMUtil;
if(!DOMUtil.hasClass(elemt, "DisableContainer")) {
DOMUtil.addClass(elemt, "DisableContainer");
}
var arrow = DOMUtil.findFirstChildByClass(elemt, "div", "Arrow");
if(!DOMUtil.hasClass(arrow, "DisableArrowIcon")) DOMUtil.addClass(arrow," DisableArrowIcon");
- },
+ };
- scrollOnDrag : function(dragObj) {
+ UIDashboard.prototype.scrollOnDrag = function(dragObj) {
var DOMUtil = eXo.core.DOMUtil;
var dashboardUtil = eXo.webui.UIDashboardUtil;
var uiDashboard = DOMUtil.findAncestorByClass(dragObj, "UIDashboard");
@@ -511,6 +504,7 @@
} else {
if(objTop < 0 && deltaY > 0) gadgetContainer.scrollTop -= 5;
}
- }
-
-}
+ };
+};
+
+eXo.webui.UIDashboard = new UIDashboard();
\ No newline at end of file
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboardUtil.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboardUtil.js 2009-12-24 10:09:43 UTC (rev 1141)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboardUtil.js 2009-12-24 11:30:23 UTC (rev 1142)
@@ -17,9 +17,9 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-eXo.webui.UIDashboardUtil = {
+function UIDashboardUtil() {
- findPosX : function(obj) {
+ UIDashboardUtil.prototype.findPosX = function(obj) {
var curleft = 0;
var uiWorkspaceContainer = document.getElementById("UIWorkspaceContainer");
var uiWorkingWorkspace = document.getElementById("UIWorkingWorkspace");
@@ -38,18 +38,18 @@
obj = obj.offsetParent ;
}
return curleft ;
- } ,
+ };
- findPosY : function(obj) {
+ UIDashboardUtil.prototype.findPosY = function(obj) {
var curtop = 0 ;
while (obj) {
curtop += obj.offsetTop ;
obj = obj.offsetParent ;
}
return curtop ;
- } ,
+ };
- findMouseRelativeX : function (object, e){
+ UIDashboardUtil.prototype.findMouseRelativeX = function (object, e){
var posx = -1 ;
var posXObject = eXo.webui.UIDashboardUtil.findPosX(object) ;
if (!e) e = window.event ;
@@ -59,9 +59,9 @@
posx = e.clientX + document.body.scrollLeft - posXObject ;
}
return posx ;
- },
+ };
- findMouseRelativeY : function(object, e) {
+ UIDashboardUtil.prototype.findMouseRelativeY = function(object, e) {
var posy = -1 ;
var posYObject = eXo.webui.UIDashboardUtil.findPosY(object) ;
if (!e) e = window.event ;
@@ -76,21 +76,21 @@
}
}
return posy ;
- },
+ };
- findPosXInContainer : function(obj, container) {
+ UIDashboardUtil.prototype.findPosXInContainer = function(obj, container) {
var objX = eXo.webui.UIDashboardUtil.findPosX(obj) ;
var containerX = eXo.webui.UIDashboardUtil.findPosX(container) ;
return (objX - containerX) ;
- },
+ };
- findPosYInContainer : function(obj, container) {
+ UIDashboardUtil.prototype.findPosYInContainer = function(obj, container) {
var objY = eXo.webui.UIDashboardUtil.findPosY(obj) ;
var containerY = eXo.webui.UIDashboardUtil.findPosY(container) ;
return (objY - containerY) ;
- },
+ };
- setPositionInContainer : function(container, component, posX, posY) {
+ UIDashboardUtil.prototype.setPositionInContainer = function(container, component, posX, posY) {
var offsetX = component.offsetLeft ;
var offsetY = component.offsetTop ;
@@ -102,9 +102,9 @@
component.style.left = deltaX + "px" ;
component.style.top = deltaY + "px" ;
- },
+ };
- isIn : function(x, y, component) {
+ UIDashboardUtil.prototype.isIn = function(x, y, component) {
var componentLeft = eXo.webui.UIDashboardUtil.findPosX(component);
var componentRight = componentLeft + component.offsetWidth ;
var componentTop = eXo.webui.UIDashboardUtil.findPosY(component) ;
@@ -118,9 +118,9 @@
}
return isOver ;
- },
+ };
- findColIndexInDashboard : function(dragObj){
+ UIDashboardUtil.prototype.findColIndexInDashboard = function(dragObj){
var col = dragObj.parentNode;
if(col==null) return null;
var dashboardContainer = eXo.core.DOMUtil.findAncestorByClass(col, "DashboardContainer");
@@ -130,16 +130,16 @@
return i;
}
}
- },
+ };
- findRowIndexInDashboard : function(dragObj){
+ UIDashboardUtil.prototype.findRowIndexInDashboard = function(dragObj){
var modules = eXo.core.DOMUtil.getChildrenByTagName(dragObj.parentNode, "div");
for(var i=0; i<modules.length; i++){
if(modules[i].id == dragObj.id) return i;
}
- },
+ };
- createRequest : function(componentId, action, params){
+ UIDashboardUtil.prototype.createRequest = function(componentId, action, params){
var url = eXo.env.server.portalBaseURL;
url += '?portal:componentId=' + componentId +
'&portal:type=action&uicomponent=UIDashboard&op=' + action ;
@@ -151,5 +151,7 @@
}
}
return url;
- }
-}
\ No newline at end of file
+ };
+};
+
+eXo.webui.UIDashboardUtil = new UIDashboardUtil();
\ No newline at end of file
15 years
gatein SVN: r1141 - in portal/trunk: component/dashboard/src/main/resources/groovy/dashboard/webui/component and 5 other directories.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-12-24 05:09:43 -0500 (Thu, 24 Dec 2009)
New Revision: 1141
Modified:
portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java
portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboard.gtmpl
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
Log:
GTNPORTAL-416 Fix for Page Management, Dashboard, Group Navigation
Modified: portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java
===================================================================
--- portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java 2009-12-24 03:31:15 UTC (rev 1140)
+++ portal/trunk/component/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java 2009-12-24 10:09:43 UTC (rev 1141)
@@ -30,8 +30,6 @@
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainer;
import org.exoplatform.portal.webui.util.PortalDataMapper;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.web.application.RequestContext;
import org.exoplatform.webui.application.WebuiRequestContext;
Modified: portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboard.gtmpl
===================================================================
--- portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboard.gtmpl 2009-12-24 03:31:15 UTC (rev 1140)
+++ portal/trunk/component/dashboard/src/main/resources/groovy/dashboard/webui/component/UIDashboard.gtmpl 2009-12-24 10:09:43 UTC (rev 1141)
@@ -13,7 +13,7 @@
<div id="$uicomponent.id" class="UIDashboard">
<div class="DashboardContainer <%=maxiGadget == null ? "" : "Maximized"%>">
<%
- if(maxiGadget == null) {
+ if(maxiGadget == null || !maxiGadget.isRendered()) {
uicomponent.renderChildren();
%>
<div class="ClearLeft"><span></span></div>
Modified: portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
--- portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2009-12-24 03:31:15 UTC (rev 1140)
+++ portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2009-12-24 10:09:43 UTC (rev 1141)
@@ -155,38 +155,53 @@
try
{
List<PageNode> nodes = pageNavigation.getNodes();
- PageNode parentNode = null;
- List<PageNode> selectedPath = uiPortal.getSelectedPaths();
- if (selectedPath != null && selectedPath.size() > 1)
- {
- parentNode = selectedPath.get(selectedPath.size() - 2);
- nodes = parentNode.getChildren();
- }
- if (parentNode == null && nodes.size() < 2)
- {
- return null; // At the moment, we prevent user from deleting all the dashboard
- }
PageNode tobeRemoved = nodes.get(nodeIndex);
PageNode selectedNode = uiPortal.getSelectedNode();
-
- nodes.remove(nodeIndex);
-
- String pageRef = tobeRemoved.getPageReference();
- if (pageRef != null && pageRef.length() > 0)
+
+ // Refresh Node List to prevent session conflict
+ nodes.clear();
+ PageNavigation updateNav = configService.getPageNavigation(pageNavigation.getOwnerType(), pageNavigation.getOwnerId());
+ int count = 0;
+ for (PageNode pageNode : updateNav.getNodes())
{
- configService.remove(configService.getPage(pageRef));
+ nodes.add(pageNode);
+ if (pageNode.getUri().equals(tobeRemoved.getUri())) {
+ nodeIndex = count;
+ tobeRemoved = pageNode;
+ }
+ if (pageNode.getUri().equals(selectedNode.getUri())) {
+ selectedNode = pageNode;
+ }
+ count ++;
}
-
+
if (tobeRemoved.getUri().equals(selectedNode.getUri()))
{
selectedNode = nodes.get(Math.max(0, nodeIndex - 1));
+
+ } else if (!nodes.contains(selectedNode)) {
+ selectedNode = nodes.get(0);
+ }
+
+ if (nodes.size() >= 2)
+ {
+ nodes.remove(tobeRemoved);
+ String pageRef = tobeRemoved.getPageReference();
+ if (pageRef != null && pageRef.length() > 0)
+ {
+ Page page = configService.getPage(pageRef);
+ if (page != null)
+ configService.remove(page);
+ }
+
uiPortal.setSelectedNode(selectedNode);
configService.update(pageNavigation);
- return selectedNode;
+ } else {
+ getAncestorOfType(UIApplication.class).addMessage(
+ new ApplicationMessage("UITabPaneDashboard.msg.cannotDeleteLastTab", null));
}
-
- configService.update(pageNavigation);
- return null; //Return null as there is no need to switch to new node
+
+ return selectedNode;
}
catch (Exception ex)
{
@@ -364,17 +379,7 @@
public void execute(Event<UITabPaneDashboard> event) throws Exception
{
UITabPaneDashboard source = event.getSource();
- WebuiRequestContext context = event.getRequestContext();
- List<PageNode> path = Util.getUIPortal().getSelectedPaths();
- boolean isRoot = true;
- if (path != null && path.size() > 1)
- isRoot = false;
- if (isRoot && source.getCurrentNumberOfTabs() == 1)
- {
- source.getAncestorOfType(UIApplication.class).addMessage(
- new ApplicationMessage("UITabPaneDashboard.msg.cannotDeleteLastTab", null));
- return;
- }
+ WebuiRequestContext context = event.getRequestContext();
int removedNodeIndex = Integer.parseInt(context.getRequestParameter(UIComponent.OBJECTID));
PageNode selectedNode = source.removePageNode(removedNodeIndex);
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2009-12-24 03:31:15 UTC (rev 1140)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIGroupNavigationManagement.java 2009-12-24 10:09:43 UTC (rev 1141)
@@ -44,12 +44,11 @@
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.UIRepeater;
-import org.exoplatform.webui.core.UIRightClickPopupMenu;
import org.exoplatform.webui.core.UIVirtualList;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.event.Event.Phase;
import java.util.ArrayList;
import java.util.List;
@@ -189,7 +188,7 @@
if (!userACL.hasEditPermission(navigation))
{
- uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.notUrl", null));
+ uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.Invalid-editPermission", null));
return;
}
@@ -197,7 +196,7 @@
DataStorage service = uicomp.getApplicationComponent(DataStorage.class);
if (service.getPageNavigation(navigation.getOwnerType(), navigation.getOwnerId()) == null)
{
- uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.notUrl", null));
+ uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.navigation-not-exist", null));
return;
}
@@ -273,7 +272,7 @@
if (!userACL.hasEditPermission(navigation))
{
- uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.notUrl", null));
+ uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.Invalid-editPermission", null));
return;
}
@@ -281,7 +280,7 @@
DataStorage service = uicomp.getApplicationComponent(DataStorage.class);
if (service.getPageNavigation(navigation.getOwnerType(), navigation.getOwnerId()) == null)
{
- uiApplication.addMessage(new ApplicationMessage("UIDashboard.msg.notUrl", null));
+ uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.navigation-not-exist", null));
return;
}
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-12-24 03:31:15 UTC (rev 1140)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-12-24 10:09:43 UTC (rev 1141)
@@ -1359,7 +1359,10 @@
############################################################################
UIGroupNavigationManagement.Action.Add=Add Navigation
-UIGroupNavigationManagement.Delete.Confirm=Are you sure to delete this navigation?
+UIGroupNavigationManagement.Delete.Confirm=Are you sure to delete this navigation?
+UIGroupNavigationManagement.msg.Invalid-deletePermission=User doesn't have permission to delete this navigation
+UIGroupNavigationManagement.msg.navigation-not-exist=The navigation is not existed or may be deleted
+UIGroupNavigationManagement.msg.Invalid-editPermission=User doesn't have permission to edit this navigation
############################################################################
# org.exoplatform.navigation.webui.component.UIGroupNavigationManagement #
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2009-12-24 03:31:15 UTC (rev 1140)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2009-12-24 10:09:43 UTC (rev 1141)
@@ -212,18 +212,26 @@
return null;
}
}
-
+
@Override
- public void processRender(WebuiRequestContext context) throws Exception
+ public boolean isRendered()
{
- if (getApplication() == null)
+ DataStorage service = getApplicationComponent(DataStorage.class);
+ try
{
- this.setRendered(false);
- return;
+ service.load(state, ApplicationType.GADGET);
+ if (getApplication() == null)
+ {
+ throw new Exception("ApplicationNotExisted");
+ }
}
- super.processRender(context);
+ catch (Exception e)
+ {
+ return false;
+ }
+ return super.isRendered();
}
-
+
/**
* Gets GadgetApplication by GadgedRegistryService
*
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-12-24 03:31:15 UTC (rev 1140)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-12-24 10:09:43 UTC (rev 1141)
@@ -23,7 +23,6 @@
import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
-import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.PortalProperties;
import org.exoplatform.portal.pom.data.ModelChange;
15 years
gatein SVN: r1140 - portal/trunk/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2009-12-23 22:31:15 -0500 (Wed, 23 Dec 2009)
New Revision: 1140
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIGadgetInfo.gtmpl
Log:
GTNPORTAL-387: Add default thumbnail to local gadget
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIGadgetInfo.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIGadgetInfo.gtmpl 2009-12-23 09:50:44 UTC (rev 1139)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIGadgetInfo.gtmpl 2009-12-24 03:31:15 UTC (rev 1140)
@@ -5,6 +5,10 @@
boolean selectorRender = uicomponent.getChild(UICategorySelector.class).isRendered();
String srcBGError = "/eXoResources/skin/sharedImages/Icon80x80/DefaultPortlet.png";
String categoryNames = uicomponent.getCategorieNames();
+ String gadgetThumbnail = gadget.getThumbnail();
+ if(gadgetThumbnail == null || gadgetThumbnail.length() == 0){
+ gadgetThumbnail = srcBGError ;
+ }
%>
<div class="UIGadgetInfo" id="$uicomponent.id">
<div class="UIBreadcumb">
@@ -19,7 +23,7 @@
</div>
<div class="Application">
<div class="PortletIcons">
- <img src="<%= gadget.getThumbnail() %>" onError="src='$srcBGError'" alt=""/>
+ <img src="$gadgetThumbnail" onError="src='$srcBGError'" alt=""/>
</div>
<div class="ApplicationContent">
<table class="TitleBarApplication">
15 years
gatein SVN: r1139 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-12-23 04:50:44 -0500 (Wed, 23 Dec 2009)
New Revision: 1139
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIResetPassword.java
Log:
GTNPORTAL-367: Can not change new recovered password
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIResetPassword.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIResetPassword.java 2009-12-23 09:41:20 UTC (rev 1138)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIResetPassword.java 2009-12-23 09:50:44 UTC (rev 1139)
@@ -102,7 +102,7 @@
OrganizationService orgService = uiForm.getApplicationComponent(OrganizationService.class);
uiForm.reset();
boolean isNew = true;
- if (!password.equals(user_.getPassword()))
+ if (!orgService.getUserHandler().authenticate(user_.getUserName(), password))
{
uiApp.addMessage(new ApplicationMessage("UIResetPassword.msg.Invalid-account", null));
isNew = false;
15 years
gatein SVN: r1138 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2009-12-23 04:41:20 -0500 (Wed, 23 Dec 2009)
New Revision: 1138
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
Log:
GTNPORTAL-387: Have problem when create new local gadget in Application registry portlet
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2009-12-23 08:21:05 UTC (rev 1137)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2009-12-23 09:41:20 UTC (rev 1138)
@@ -49,10 +49,8 @@
import java.util.Calendar;
/**
- * Created by The eXo Platform SAS
- * Author : Pham Thanh Tung
- * thanhtungty(a)gmail.com
- * Jul 29, 2008
+ * Created by The eXo Platform SAS Author : Pham Thanh Tung
+ * thanhtungty(a)gmail.com Jul 29, 2008
*/
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIForm.gtmpl", initParams = @ParamConfig(name = "SampleGadget", value = "app:/WEB-INF/conf/uiconf/applicationregistry/component/SampleGadget.groovy"), events = {
@EventConfig(listeners = UIGadgetEditor.SaveActionListener.class),
@@ -190,13 +188,14 @@
source.setTextContent(text);
source.setLastModified(Calendar.getInstance());
- // This will update the source and also update the gadget related cached meta data
- // from the source
sourceStorage.saveSource(gadget, source);
- // service.saveGadget(GadgetUtil.toGadget(name, sourceStorage.getSourceURI(dirPath + "/" + fileName), true));
+ uiManagement.removeChild(UIGadgetEditor.class);
+ // This will update the source and also update the gadget related
+ // cached meta data
+ // from the source
uiManagement.initData();
- uiManagement.setSelectedGadget(name);
+ uiManagement.setSelectedGadget(gadget.getName());
event.getRequestContext().addUIComponentToUpdateByAjax(uiManagement);
}
15 years
gatein SVN: r1137 - in portal/trunk: portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin and 1 other directories.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-12-23 03:21:05 -0500 (Wed, 23 Dec 2009)
New Revision: 1137
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
Log:
GTNPORTAL-416 Unknown error when edit User/membership in special case
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2009-12-23 07:18:51 UTC (rev 1136)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2009-12-23 08:21:05 UTC (rev 1137)
@@ -106,6 +106,10 @@
UIApplication uiApp = context.getUIApplication();
String username = getUIStringInput(USERNAME).getValue();
User user = service.getUserHandler().findUserByName(username);
+ if (user==null) {
+ uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-is-deleted", null));
+ return false;
+ }
invokeSetBindingField(user);
if (isChangePassword())
{
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java 2009-12-23 07:18:51 UTC (rev 1136)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListMembershipType.java 2009-12-23 08:21:05 UTC (rev 1137)
@@ -97,6 +97,12 @@
UIMembershipManagement uiMembershipManager = uiMembership.getParent();
UIMembershipTypeForm uiForm = uiMembershipManager.getChild(UIMembershipTypeForm.class);
uiForm.setMembershipType(mt);
+ if (mt == null)
+ {
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ uiApp.addMessage(new ApplicationMessage("UIMembershipTypeForm.msg.MembershipNotExist", new String[]{name}));
+ uiMembership.loadData();
+ }
}
}
@@ -116,11 +122,12 @@
uiApp.addMessage(new ApplicationMessage("UIMembershipList.msg.InUse", null));
return;
}
-
+
// Check to see whether given membershiptype is mandatory or not
UserACL acl = uiMembership.getApplicationComponent(UserACL.class);
List<String> mandatories = acl.getMandatoryMSTypes();
- if(!mandatories.isEmpty() && mandatories.contains(name)){
+ if (!mandatories.isEmpty() && mandatories.contains(name))
+ {
UIApplication uiApp = event.getRequestContext().getUIApplication();
uiApp.addMessage(new ApplicationMessage("UIMembershipList.msg.DeleteMandatory", null));
return;
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java 2009-12-23 07:18:51 UTC (rev 1136)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java 2009-12-23 08:21:05 UTC (rev 1137)
@@ -85,8 +85,18 @@
if (mt != null)
{
- uiForm.invokeSetBindingBean(mt);
- service.getMembershipTypeHandler().saveMembershipType(mt, true);
+ MembershipType existMembershipType = service.getMembershipTypeHandler().findMembershipType(mt.getName());
+ if (existMembershipType == null)
+ {
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ uiApp.addMessage(new ApplicationMessage("UIMembershipTypeForm.msg.MembershipNotExist", new String[]{mt
+ .getName()}));
+ }
+ else
+ {
+ uiForm.invokeSetBindingBean(mt);
+ service.getMembershipTypeHandler().saveMembershipType(mt, true);
+ }
}
else
{
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2009-12-23 07:18:51 UTC (rev 1136)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties 2009-12-23 08:21:05 UTC (rev 1137)
@@ -31,6 +31,7 @@
UIMembershipTypeForm.action.Back=#{word.back}
UIMembershipTypeForm.action.Reset=Reset
UIMembershipTypeForm.msg.SameName=This membership already exists, please enter another one
+UIMembershipTypeForm.msg.MembershipNotExist= Membership [{0}] is not exist or has been deleted.
##org.exoplatform.organization.webui.component.UIGroupMembershipForm
UIGroupEditMembershipForm.label.username=User Name
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-12-23 07:18:51 UTC (rev 1136)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-12-23 08:21:05 UTC (rev 1137)
@@ -220,6 +220,7 @@
UIAccountForm.msg.password-is-not-match=Password and Confirm Password must be the same.
UIAccountInputSet.msg.user-exist=This user name already exists, please enter a different name.
UIAccountInputSet.msg.user-not-exist=This user name is still available.
+UIAccountInputSet.msg.user-is-deleted=This user may be deleted.
UIAccountInputSet.msg.email-exist=This email already exists, please enter a different address.
UIAccountInputSet.msg.empty-input=The user name cannot be empty.
UIAccountInputSet.msg.successful.create.user=You have registered a new account.
15 years
gatein SVN: r1136 - portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-12-23 02:18:51 -0500 (Wed, 23 Dec 2009)
New Revision: 1136
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js
Log:
GTNPORTAL-379 IE7: Can't hide sub-group
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 2009-12-23 04:48:24 UTC (rev 1135)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalControl.js 2009-12-23 07:18:51 UTC (rev 1136)
@@ -34,15 +34,22 @@
UIPortalControl.prototype.collapseTree = function(selectedElement ) {
var DOMUtil = eXo.core.DOMUtil ;
- var parentNode = DOMUtil.findAncestorByClass(selectedElement, "Node");
+ var parentNode = DOMUtil.findAncestorByClass(selectedElement, "Node");
var childrenContainer = DOMUtil.findFirstDescendantByClass(parentNode, "div", "ChildrenContainer");
- var expandIcon = document.createElement('a');
- expandIcon.href = childrenContainer.getAttribute("actionLink") ;
- expandIcon.className = "ExpandIcon" ;
- expandIcon.innerHTML = selectedElement.innerHTML ;
- parentNode.removeChild(childrenContainer);
- parentNode.insertBefore(expandIcon, selectedElement);
- parentNode.removeChild(selectedElement);
+
+ if (eXo.core.Browser.browserType != "ie") {
+ var expandIcon = document.createElement('a');
+ expandIcon.href = childrenContainer.getAttribute("actionLink") ;
+ expandIcon.className = "ExpandIcon" ;
+ expandIcon.innerHTML = selectedElement.innerHTML ;
+ parentNode.removeChild(childrenContainer);
+ parentNode.insertBefore(expandIcon, selectedElement);
+ parentNode.removeChild(selectedElement);
+ } else {
+ // Fix for GTNPORTAL-379 IE7: Can't hide sub-group
+ var newHTML = "<div onclick=\"" + childrenContainer.getAttribute("actionLink") + "\" class=\"ExpandIcon\">" + selectedElement.innerHTML + "</div>";
+ parentNode.innerHTML = newHTML;
+ }
};
UIPortalControl.prototype.onEnterPress = function(e) {
15 years
gatein SVN: r1135 - portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-12-22 23:48:24 -0500 (Tue, 22 Dec 2009)
New Revision: 1135
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
Log:
GTNPORTAL-375: Exception in console & error in displaying current gadget after added new tab with special characters
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js 2009-12-22 20:55:58 UTC (rev 1134)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js 2009-12-23 04:48:24 UTC (rev 1135)
@@ -106,7 +106,7 @@
href += "&portal:isSecure=false";
href += "&uicomponent=UITabPaneDashboard";
href += "&op=AddDashboard";
- href += "&objectId=" + newTabLabel;
+ href += "&objectId=" + encodeURIComponent(newTabLabel);
eXo.webui.UITabbedDashboard.isInRequest = true;
window.location = href;
}
15 years
gatein SVN: r1134 - components/pc/trunk/distrib.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-12-22 15:55:58 -0500 (Tue, 22 Dec 2009)
New Revision: 1134
Modified:
components/pc/trunk/distrib/distrib.xml
Log:
Fixing distrib
Modified: components/pc/trunk/distrib/distrib.xml
===================================================================
--- components/pc/trunk/distrib/distrib.xml 2009-12-22 20:25:42 UTC (rev 1133)
+++ components/pc/trunk/distrib/distrib.xml 2009-12-22 20:55:58 UTC (rev 1134)
@@ -89,7 +89,7 @@
<!-- Simple portal -->
<copy todir="${pc.build.bin.as42}/server/default/deploy/simple-portal">
<fileset
- dir="${source.dir}/portal/target/simple-portal-jboss42.dir/simple-portal"/>
+ dir="${source.dir}/portal/target/simple-portal-jboss42/simple-portal"/>
</copy>
<!-- Taglib integration -->
@@ -127,7 +127,7 @@
<!-- Simple portal -->
<copy todir="${pc.build.bin.as51}/server/default/deploy/simple-portal.sar">
<fileset
- dir="${source.dir}/portal/target/simple-portal-jboss51.dir/simple-portal"/>
+ dir="${source.dir}/portal/target/simple-portal-jboss51/simple-portal"/>
</copy>
<!-- Taglib integration -->
@@ -169,12 +169,12 @@
<!-- -->
<copy todir="${pc.build.bin.tomcat6}/lib">
<fileset
- dir="${source.dir}/portal/target/simple-portal-tomcat60.dir/simple-portal/lib"
+ dir="${source.dir}/portal/target/simple-portal-tomcat60/simple-portal/lib"
includes="**/*.jar"/>
</copy>
<jar file="${pc.build.bin.tomcat6}/webapps/simple-portal.war">
<fileset
- dir="${source.dir}/portal/target/simple-portal-tomcat60.dir/simple-portal/simple-portal.war"
+ dir="${source.dir}/portal/target/simple-portal-tomcat60/simple-portal/simple-portal.war"
includes="**"/>
</jar>
@@ -211,7 +211,7 @@
<fileset dir="${source.dir}/samples/target" includes="*.war"/>
</copy>
<copy
- file="${source.dir}/docs/user-guide/target/attach/user-guide-en-US-${maven.version}-html.war"
+ file="${source.dir}/docs/user-guide/target/classes/user-guide-en-US-${maven.version}.war"
tofile="${samples.dir}/gateinpc-docs.war"/>
</target>
@@ -228,9 +228,9 @@
<mkdir dir="${todir}"/>
<mkdir dir="${todir}/user-guide"/>
<copy todir="${todir}/user-guide">
- <fileset dir="${src.docs.dir}/user-guide/target/docbook" includes="html_single/**"/>
- <fileset dir="${src.docs.dir}/user-guide/target/docbook" includes="html/**"/>
- <fileset dir="${src.docs.dir}/user-guide/target/docbook/pdf" includes="*.pdf"/>
+ <fileset dir="${src.docs.dir}/user-guide/target/docbook/publish/en-US" includes="html_single/**"/>
+ <fileset dir="${src.docs.dir}/user-guide/target/docbook/publish/en-US" includes="html/**"/>
+ <fileset dir="${src.docs.dir}/user-guide/target/docbook/publish/en-US/pdf" includes="*.pdf"/>
</copy>
</sequential>
</target>
15 years