portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r898665 - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/ applications/jetspeed/src/main/webapp/jetui/engine/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/
Date Wed, 13 Jan 2010 07:14:01 GMT
Author: taylor
Date: Wed Jan 13 07:14:00 2010
New Revision: 898665

URL: http://svn.apache.org/viewvc?rev=898665&view=rev
Log:
JS2-1084
starting on improving minimizations

Modified:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js?rev=898665&r1=898664&r2=898665&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js
(original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/javascript/jetspeed/jetui/jetui-portal.js
Wed Jan 13 07:14:00 2010
@@ -181,17 +181,15 @@
             var currentStyle = toggler.getAttribute('class');
             var nodelist = toolbar.get('children');
             var state = 'normal';
-            var reverse = false;
             if (currentStyle == compareStyle) {
             	toolbar.setStyle('display', 'block');
             	nodelist.setStyle('display', 'block');
-            	reverse = true;
             } else {
                 nodelist.setStyle('display', 'none');
                 toolbar.setStyle('display', 'none');
                 state = 'closed';
             }
-            var windowId = (toolbar == portal.jstbLeft) ? 'template-top2.jstbLeft' : 'template-top2.jstbRight';
+            var windowId = (toolbar == portal.jstbLeft) ? 'template-top2.jstbLeft' : 'template-top2.jstbRight';
// FIXME: don't hard code template
             var uri = portal.portalContextPath + "/services/pagelayout/fragment/" + windowId
+ "/mod/?_type=json";
             uri += "&state=" + state;
             var config = {
@@ -204,6 +202,36 @@
         },
         
         /**
+         * Toggles a tool or window state
+         *  (fragment id is option
+         * @method toggleState shoot
+         */
+        toggleState : function(windowId) {
+            var portal = JETUI_YUI.getPortalInstance();
+        	var window = Y.one("[id='" + windowId + "']");
+            if (!Y.Lang.isNull(window)) {
+            	var state = window.data.get('state');
+            	if (state == null || state == "normal") {
+	                window.setStyle('display', 'none');
+	                state = 'minimized';
+	            } else {
+	        		window.setStyle('display', 'block');
+	            	state = 'normal';	            	
+	            }
+            	window.data.set('state', state);	        	
+	            var uri = portal.portalContextPath + "/services/pagelayout/fragment/" + windowId
+ "/mod/?_type=json";
+	            uri += "&state=" + state;
+	            var config = {
+	                    on: { complete: portal.onStateComplete },
+	                    method: "PUT",
+	                    headers: { "X-Portal-Path" : portal.portalPagePath },
+	                    arguments: { complete: [ windowId ] }
+	                };
+	            var request = Y.io(uri, config);            
+            }
+        },        
+        
+        /**
          * @method moveToLayout moves a portlet window to layout column grid position in
the browser
          * this is a client side only operation. Operates in grid (non-detached) mode.
          */
@@ -643,14 +671,14 @@
                 var request = Y.io(uri, config);
             }
         },
-        
+                
         /**
          * @method addPortlet
          */
         addPortlet : function(fragment) {
             var portal = JETUI_YUI.getPortalInstance();
             var templatePanel = Y.Node.one("#jsPortletTemplate");
-            var v = templatePanel.cloneNode(true);
+            var v = templatePanel.cloneNode(true);            
             v.setStyle('display', '');
             v.set("id", fragment.id);
             v.setAttribute("name", fragment.name);
@@ -726,6 +754,7 @@
             "id" : { value: "0" },
             "tool" : { value : false },
             "detached" : { value : false },
+            "state" : { value : "normal" },
             "locked" : { value : false },
             "column" : { value : 0 },
             "row" : { value : 0 },
@@ -782,6 +811,9 @@
         portlet.set("tool", tool);
         var detached = portal.booleanValue(node.getAttribute("detached"));
         portlet.set("detached", detached);
+        var display = node.getStyle('display');
+        if (display != null && display == 'none')
+        	portlet.set("state", "minimized");
         var locked = portal.booleanValue(node.getAttribute("locked"));
         portlet.set("locked", locked);
         portlet.set("column", node.getAttribute("column"));

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js?rev=898665&r1=898664&r2=898665&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
(original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/jetui/engine/portal.js
Wed Jan 13 07:14:00 2010
@@ -96,7 +96,7 @@
 		            groups: dropGroups            
 		        });
 	        }
-	    	//portlet.info();
+	    	// portlet.info();
     	}
     });
     

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java?rev=898665&r1=898664&r2=898665&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
Wed Jan 13 07:14:00 2010
@@ -262,7 +262,7 @@
         else
             return toolbar;
         ContentPage page = context.getPage();
-        ContentFragment cf = page.getFragmentByFragmentId(id);
+        ContentFragment cf = page.getFragmentByFragmentId(id); 
         if (cf != null) 
         {
             toolbar = new Toolbar(orientation, id, cf);
@@ -274,4 +274,20 @@
         return toolbar;
     }
     
+    public ContentFragment getToolbox(RequestContext context)
+    {
+        List<ContentFragment> result = context.getPage().getFragmentsByName("j2-admin::JetspeedToolbox");
+        if (result != null && result.size() > 0)
+            return result.get(0);
+        return null;
+    }
+
+    public ContentFragment getPageNavigator(RequestContext context)
+    {
+        List<ContentFragment> result = context.getPage().getFragmentsByName("j2-admin::PageNavigator");
+        if (result != null && result.size() > 0)
+            return result.get(0);
+        return null;
+    }
+    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message