[gatein-commits] gatein SVN: r4700 - in portal/branches/branch-GTNPORTAL-1537: web/portal/src/main/webapp/groovy/portal/webui/application and 6 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Sun Oct 17 23:12:46 EDT 2010


Author: phuong_vu
Date: 2010-10-17 23:12:45 -0400 (Sun, 17 Oct 2010)
New Revision: 4700

Modified:
   portal/branches/branch-GTNPORTAL-1537/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
   portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
   portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
   portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl
   portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
   portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
   portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
   portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
   portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java
   portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
   portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
GTNPORTAL-1498 Show Status of Finish button is not correct in Edition page when don't do anything on this  page

Modified: portal/branches/branch-GTNPORTAL-1537/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js	2010-10-18 03:12:45 UTC (rev 4700)
@@ -196,6 +196,38 @@
 
   DragDrop.dropCallback = function(dndEvent) {
   	this.origDragObjectStyle.setProperties(dndEvent.dragObject.style, false) ;
+  	
+  	var hasChanged = true;
+  	//When press esc key, we want to cancel the dragdrop, but now it only works with FF
+  	if (dndEvent.backupMouseEvent && dndEvent.backupMouseEvent.keyCode == 27 && eXo.core.Browser.isFF()) {
+  		hasChanged = false;
+  	}
+  	//When dragObject is outside 
+		var targetElement = dndEvent.foundTargetObject;  
+		if(!targetElement || targetElement.foundIndex == null) {
+			hasChanged = false;
+		}
+		//When dragobject is next to preview object (position is not changed)
+  	if(!dndEvent.dragObject.isAddingNewly) {
+	  	var DOMUtil = eXo.core.DOMUtil;
+	  	var previewClass = "DragAndDropPreview";
+	  	var previewTagName = "div";
+	  	var previewSibling = dndEvent.dragObject;
+	  	if (dndEvent.dragObject.parentNode.tagName.toLowerCase() == "td") {
+	  		previewSibling = dndEvent.dragObject.parentNode; 		
+	  		previewClass = "PreviewTDBlock";
+	  		previewTagName = "td";
+	  	}
+	  	var tempObj = DOMUtil.findNextElementByTagName(previewSibling, previewTagName);
+	  	if (tempObj != null && tempObj.className == previewClass) {
+	    	hasChanged = false;
+	    } else {
+	    	tempObj = DOMUtil.findPreviousElementByTagName(previewSibling, previewTagName);
+		    if (tempObj != null && tempObj.className == previewClass) {
+		    	hasChanged = false;
+		    }
+	    }
+  	}
 
     if(dndEvent.foundTargetObject != null || (dndEvent.backupMouseEvent && dndEvent.backupMouseEvent.keyCode != 27)) {
     	eXo.portal.PortalDragDrop.doDropCallback(dndEvent) ;
@@ -219,7 +251,9 @@
     previewBlock = previewTD = null;
     
     eXo.portal.isInDragging = false;
-  	eXo.portal.UIPortal.changeComposerSaveButton();
+    if (hasChanged) {
+    	eXo.portal.UIPortal.changeComposerSaveButton();
+    }
 		// fix bug WEBOS-196	
 		dndEvent.dragObject.style.width = "auto" ; 
   };

Modified: portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl	2010-10-18 03:12:45 UTC (rev 4700)
@@ -286,7 +286,7 @@
 															%>
 															<div class="PortletIcon $portletIcon"><%=hasPermission ? title : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 															<%if(hasPermission) {%>
-																<a href="<%=uicomponent.event("EditPortlet","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditPortletPropertiesIcon" title="<%=_ctx.appRes("UIPortlet.tooltip.editPortlet");%>"></a>
+																<a href="<%=uicomponent.event("EditPortlet","$uicomponent.id")%>;" class="EditPortletPropertiesIcon" title="<%=_ctx.appRes("UIPortlet.tooltip.editPortlet");%>"></a>
 																<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeletePortletIcon" title="<%=_ctx.appRes("UIPortlet.tooltip.deletePortlet");%>"></a>
 															<%}%>
 														</div>

Modified: portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl	2010-10-18 03:12:45 UTC (rev 4700)
@@ -42,9 +42,9 @@
 				<div class="VIEW-CONTAINER VIEW-BLOCK">
 			<%} %> 
 					<%if(hasPermission) {%>
-						<div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">
-							<div>
-								<%uicomponent.renderChildren();%>
+					    <div>
+							<div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">							
+									<%uicomponent.renderChildren();%>							
 							</div>
 						</div>
 						<%} else out.print("<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
@@ -72,7 +72,7 @@
 														%>
 														<div class="ContainerIcon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 														<%if(hasPermission) {%>
-															<a href="<%=uicomponent.event("EditContainer")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("EditContainer")%>" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
 															<a href="<%=uicomponent.event("DeleteComponent")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
 														<%}%>
 													

Modified: portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl	2010-10-18 03:12:45 UTC (rev 4700)
@@ -73,7 +73,7 @@
 														%>
 														<div class="ContainerIcon DefaultContainer16x16Icon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 														<%if(hasPermission) {%>
-															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
 															<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
 														<%}%>
 													</div>

Modified: portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl	2010-10-18 03:12:45 UTC (rev 4700)
@@ -73,7 +73,7 @@
 														%>
 														<div class="ContainerIcon DefaultContainer16x16Icon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 														<%if(hasPermission) {%>
-															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
 															<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
 														<%}%>
 													</div>

Modified: portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl	2010-10-18 03:12:45 UTC (rev 4700)
@@ -70,7 +70,7 @@
 														%>
 														<div class="ContainerIcon DefaultContainer16x16Icon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 														<%if(hasPermission) {%>
-															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>;" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
 															<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
 														<%}%>
 													</div>

Modified: portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl	2010-10-18 03:12:45 UTC (rev 4700)
@@ -52,7 +52,7 @@
 						<tr>
 							<td>
 								
-								<div onclick="<%= uicomponent.event("ViewProperties") %>;eXo.portal.UIPortal.changeComposerSaveButton()" class="ActionButton SimpleStyle1">
+								<div onclick="<%= uicomponent.event("ViewProperties") %>;" class="ActionButton SimpleStyle1">
 									<div class="ButtonLeft">
 										<div class="ButtonRight">
 											<div class="ButtonMiddle">

Modified: portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java	2010-10-18 03:12:45 UTC (rev 4700)
@@ -402,6 +402,7 @@
          }
 
          PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
+         pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
          pcontext.addUIComponentToUpdateByAjax(uiMaskWorkspace);
          UIPortalApplication uiPortalApp = uiPortlet.getAncestorOfType(UIPortalApplication.class);
          UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);

Modified: portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java	2010-10-18 03:12:45 UTC (rev 4700)
@@ -143,6 +143,7 @@
 
          UIPortalApplication uiPortalApp = uiForm.getAncestorOfType(UIPortalApplication.class);
          UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+         pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
          pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
          pcontext.setFullRender(true);
          Util.showComponentLayoutMode(UIContainer.class);

Modified: portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java	2010-10-18 03:12:45 UTC (rev 4700)
@@ -280,7 +280,7 @@
          PortalRequestContext pcontext = Util.getPortalRequestContext();
          UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
          uiMaskWS.setUIComponent(null);
-         uiMaskWS.setShow(false);
+         uiMaskWS.setShow(false);         
          pcontext.addUIComponentToUpdateByAjax(uiMaskWS);
 
          UIPage uiPage = uiPageForm.getUIPage();
@@ -318,7 +318,7 @@
             pcontext.setFullRender(true);
             UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
             pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
-
+            pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
             return;
          }
 
@@ -337,6 +337,7 @@
             pcontext.setFullRender(true);
             UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
             pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
+            pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
             DataStorage dataService = uiPageForm.getApplicationComponent(DataStorage.class);
             dataService.save(page);
             return;
@@ -360,6 +361,7 @@
 
          try{
             PortalDataMapper.toUIPage(uiPage, page);
+            pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
          } catch(NoSuchDataException de){
             uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.notExistOrDeleted", null, ApplicationMessage.ERROR));
             UIPortalComposer uiPortalComposer = (UIPortalComposer)uiPortalApp.findComponentById("UIPageEditor");

Modified: portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java	2010-10-18 01:48:48 UTC (rev 4699)
+++ portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java	2010-10-18 03:12:45 UTC (rev 4700)
@@ -337,7 +337,12 @@
 
          UIMaskWorkspace uiMaskWorkspace = uiForm.getParent();
          uiMaskWorkspace.setUIComponent(null);
-         event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWorkspace);
+         WebuiRequestContext rContext = event.getRequestContext();
+         if (!uiForm.getId().equals("CreatePortal")) 
+         {
+            rContext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
+         }         
+         rContext.addUIComponentToUpdateByAjax(uiMaskWorkspace);
       }
    }
 



More information about the gatein-commits mailing list