portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r393149 - in /portals/jetspeed-2/trunk/src: javascript/dojo/ webapp/desktop-themes/blue/ webapp/desktop-themes/blue/css/ webapp/javascript/desktop/core/ webapp/javascript/desktop/widget/ webapp/javascript/desktop/windowthemes/blueocean/css/...
Date Tue, 11 Apr 2006 06:35:03 GMT
Author: taylor
Date: Mon Apr 10 23:34:59 2006
New Revision: 393149

URL: http://svn.apache.org/viewcvs?rev=393149&view=rev
Log:
2 and 3 column layout, positional drag and rop.
The taskbar context menu currently allows switching between three layout modes: free flowing / 2 column / 3 column. 
The switch to free flowing seems to mess with IE at the moment.

To switch the default layout, set the jetspeed.prefs.windowTiling value on line 64 of core.js
   windowTiling: false   // free flowing
   windowTiling: n       // n column layout (where n > 0)

Debug is currently enabled. To disable, swap the commented line in blue.jsp/blue.vm :

    var djConfig = {isDebug: true, debugAtAllCosts: true};
    //var djConfig = {isDebug: false, debugAtAllCosts: false};

Contribution from Steve Milek


Modified:
    portals/jetspeed-2/trunk/src/javascript/dojo/VERSION.txt
    portals/jetspeed-2/trunk/src/javascript/dojo/dojo.zip
    portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.jsp
    portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.vm
    portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/css/styles.css
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/core/core.js
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.css
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.html
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalTaskBar.js
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortletWindow.js
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/blueocean/css/styles.css
    portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/tigris/css/styles.css

Modified: portals/jetspeed-2/trunk/src/javascript/dojo/VERSION.txt
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/javascript/dojo/VERSION.txt?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/javascript/dojo/VERSION.txt (original)
+++ portals/jetspeed-2/trunk/src/javascript/dojo/VERSION.txt Mon Apr 10 23:34:59 2006
@@ -1,2 +1,36 @@
- dojo-nightly 2006-03-26 
+dojo.zip contains copy of dojo nightly build form 2006-03-26
+
+dojo-2006-04-06.tgz
+
+see http://archive.dojotoolkit.org
+
+
+diff modified-dojo/src/widget/FloatingPane.js dojo/src/widget/FloatingPane.js
+
+78,82c78,82
+< 			//var drag = new dojo.dnd.HtmlDragMoveSource(this.domNode);	
+< 			//if (this.constrainToContainer) {
+< 			//	drag.constrainTo();
+< 			//}
+< 			//drag.setDragHandle(this.titleBar);
+---
+> 			var drag = new dojo.dnd.HtmlDragMoveSource(this.domNode);	
+> 			if (this.constrainToContainer) {
+> 				drag.constrainTo();
+> 			}
+> 			drag.setDragHandle(this.titleBar);
+85,90c85,89
+<         if ( ! this.resizable && this.resizeBar ) { this.resizeBar.style.display = "none"; }
+< 		//if(this.resizable){
+< 		//	this.resizeBar.style.display="";
+< 		//	var rh = dojo.widget.createWidget("ResizeHandle", {targetElmId: this.widgetId, id:this.widgetId+"_resize"});
+< 		//	this.resizeBar.appendChild(rh.domNode);
+< 		//}
+---
+> 		if(this.resizable){
+> 			this.resizeBar.style.display="";
+> 			var rh = dojo.widget.createWidget("ResizeHandle", {targetElmId: this.widgetId, id:this.widgetId+"_resize"});
+> 			this.resizeBar.appendChild(rh.domNode);
+> 		}
+
  

Modified: portals/jetspeed-2/trunk/src/javascript/dojo/dojo.zip
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/javascript/dojo/dojo.zip?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
Binary files - no diff available.

Modified: portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.jsp
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.jsp?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.jsp (original)
+++ portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.jsp Mon Apr 10 23:34:59 2006
@@ -28,8 +28,8 @@
   DOJO Config Script ( djConfig )
   -->
 <script type="text/javascript">
-    var djConfig = {isDebug: false};
-    // djConfig.debugAtAllCosts = true;     
+    var djConfig = {isDebug: true, debugAtAllCosts: true};
+    //var djConfig = {isDebug: false, debugAtAllCosts: false};
     // needed for js debuggers (both venkman and visual studio)
     djConfig.baseScriptUri = '<%= desktop.getPortalResourceUrl("/javascript/dojo/") %>' ;
     {
@@ -90,30 +90,25 @@
 </script>
 <style>
 
-html, body
+html, body, .jetspeedDesktop
 {	
     width: 100%;	/* make the body expand to fill the visible window */
     height: 100%;
-    /*overflow: hidden;*/  /* erase window level scrollbars */
     margin: 0 0 0 0;
 }
-/* body { padding: 10px 10px 100px 10px; } */
 
 </style>
 
 </head>
 
 <!-- Start Jetspeed Desktop -->
-<body id="jetspeedDesktop" class="layout-blue">
-<div class="layout-blue">
-
-
+<body class="layout-blue" id="jetspeedPage">
+<div class="layout-blue" id="jetspeedDesktop">
 <!-- Start Taskbar -->
-<div dojoType="PortalTaskBar" id="jetspeedTaskbar" style="background-color: #666; width: 100%; bottom: 5px; height: 100px">
+<div dojoType="PortalTaskBar" id="jetspeedTaskbar" style="background-color: #666; width: 98%; bottom: 5px; height: 110px" resizable="false">
 </div>
 <!-- End Taskbar -->
 </div>
 </body>
 <!-- End Jetspeed Desktop -->
-
 </html>

Modified: portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.vm?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.vm (original)
+++ portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/blue.vm Mon Apr 10 23:34:59 2006
@@ -23,8 +23,8 @@
   DOJO Config Script ( djConfig )
   -->
 <script type="text/javascript">
-    var djConfig = {isDebug: false};
-    // djConfig.debugAtAllCosts = true;   
+    var djConfig = {isDebug: true, debugAtAllCosts: true};
+    //var djConfig = {isDebug: false, debugAtAllCosts: false};
     // needed for js debuggers (both venkman and visual studio)
     djConfig.baseScriptUri = '$jetspeedDesktop.getPortalResourceUrl("/javascript/dojo/")';
     {
@@ -85,29 +85,25 @@
 </script>
 <style>
 
-html, body
+html, body, .jetspeedDesktop
 {	
     width: 100%;	/* make the body expand to fill the visible window */
     height: 100%;
-    /*overflow: hidden;*/  /* erase window level scrollbars */
     margin: 0 0 0 0;
 }
-/* body { padding: 10px 10px 100px 10px; } */
 
 </style>
 
 </head>
 
 <!-- Start Jetspeed Desktop -->
-<body id="jetspeedDesktop" class="layout-blue">
-<div class="layout-blue">
-
+<body class="layout-blue" id="jetspeedPage">
+<div class="layout-blue" id="jetspeedDesktop">
 <!-- Start Taskbar -->
-<div dojoType="PortalTaskBar" id="jetspeedTaskbar" style="background-color: #666; width: 100%; bottom: 5px; height: 100px">
+<div dojoType="PortalTaskBar" id="jetspeedTaskbar" style="background-color: #666; width: 98%; bottom: 5px; height: 110px" resizable="false">
 </div>
 <!-- End Taskbar -->
 </div>
 </body>
 <!-- End Jetspeed Desktop -->
-
 </html>

Modified: portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/css/styles.css
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/css/styles.css?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/css/styles.css (original)
+++ portals/jetspeed-2/trunk/src/webapp/desktop-themes/blue/css/styles.css Mon Apr 10 23:34:59 2006
@@ -18,7 +18,8 @@
 
 DIV.portlet
 {
-    margin: 0px;    /* necessary to override margin settings from decorations/layout/css/standard-columns.css */
+    margin: 2px;    /* necessary to override margin settings from decorations/layout/css/standard-columns.css */
+                    /* needs to match margin setting for .dojoFloatingPaneClient */
 }
 
 

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/core/core.js
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/core/core.js?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/core/core.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/core/core.js Mon Apr 10 23:34:59 2006
@@ -53,13 +53,16 @@
 {
     DESKTOP: "jetspeedDesktop",
     TASKBAR: "jetspeedTaskbar",
-    PORTLET_STYLE_CLASS: "portlet"
+    COLUMNS: "jetspeedColumns",
+    PORTLET_STYLE_CLASS: "portlet",
+    PORTLET_WINDOW_STYLE_CLASS: "dojoFloatingPane"
 };
 
 // ... jetspeed desktop preferences
 jetspeed.prefs = 
 {
-    windowTiling: false
+    windowTiling: 3
+    //windowTiling: false
     
 };
 
@@ -75,22 +78,32 @@
     confirmOnSubmit: false,
     createWindow: false,
     initializeWindowState: false,
-    submitChangedWindowState: 0
+    submitChangedWindowState: 0,
+
+    debugContainerId: ( djConfig.debugContainerId ? djConfig.debugContainerId : dojo.hostenv.defaultDebugContainerId )
 };
+jetspeed.debugInPortletWindow = true;
 jetspeed.debugPsmlDumpContent = false;
-//jetspeed.debugPortletEntityIdFilter = [ "dp-7", "um-3", "um-4" ]; // NOTE: uncomment causes only the listed portlets to be loaded; all others are ignored; for testing
-//jetspeed.debugPortletEntityIdFilter = [ "dp-12" ];
+jetspeed.debugPortletEntityIdFilter = [ "dp-3", "dp-16", "dp-17", "dp-22", "dp-18", "dp-23", "dp-7", "dp-12" ];   // all default-page except IFrame
+//jetspeed.debugPortletEntityIdFilter = [ "dp-7", "dp-3", "dp-12", "dp-18" ]; // NOTE: uncomment causes only the listed portlets to be loaded; all others are ignored; for testing
+//portlets: [dp-3 LocaleSelector, dp-16 RoleSecurityTest, dp-17 UserInfoTest, dp-22 ForgottenPasswordPortlet, dp-18 BookmarkPortlet, dp-23 UserRegistrationPortlet, dp-7 PickANumberPortlet, dp-9 IFramePortlet, dp-12 LoginPortlet]
+//jetspeed.debugPortletEntityIdFilter = [ "dp-7" ];
 jetspeed.debugPortletWindowIcons = [ "text-x-generic.png", "text-html.png", "application-x-executable.png" ];
-jetspeed.debugPortletWindowThemes = [ "tigris", "blueocean" ];
+jetspeed.debugPortletWindowThemes = [ "tigris", "blueocean" ];  /* , "blueocean" ]; */
 //jetspeed.debugPortletDumpRawContent = [ "dp-7" ]; // , "dp-7", "jsfGuessNumber1", "jsfCalendar" ];    // "um-4", "dp-7", "jsfGuessNumber1", "jsfCalendar"
 //jetspeed.debugPortletDumpRawContent = [ "*" ];
 
 
 // ... load page /portlets
 jetspeed.page = null ;   // BOZO: is this it? one page at a time?
+jetspeed.columns = [];
 jetspeed.initializeDesktop = function()
 {
     jetspeed.loadPage();
+    if ( jetspeed.prefs.windowTiling > 0 )
+    {
+        jetspeed.ui.createColumns( document.getElementById( jetspeed.id.DESKTOP ), jetspeed.prefs.windowTiling );
+    }
     //jetspeed.currentTaskbar = new jetspeed.ui.PortalTaskBar() ;
 };
 jetspeed.loadPage = function()
@@ -105,20 +118,35 @@
     if ( portletArray )
     {
         var createdPortlets = [];
+
+        if ( djConfig.isDebug && jetspeed.debugInPortletWindow && dojo.byId( jetspeed.debug.debugContainerId ) == null )
+        {
+            var dojoDebugPortlet = new jetspeed.om.Portlet( "DojoDebug", "dojo-debug", "Dojo Debug", new jetspeed.om.DojoDebugPortletContentRetriever() );
+            dojoDebugPortlet.putProperty( "forceAbsolute", true );
+            dojoDebugPortlet.putProperty( "excludePContent", true );
+            dojoDebugPortlet.putProperty( "window-theme", "tigris" );
+            dojoDebugPortlet.putProperty( "width", "700" );
+            dojoDebugPortlet.putProperty( "height", "400" );
+            dojoDebugPortlet.putProperty( "x", "35" );
+            createdPortlets.push( dojoDebugPortlet );
+            dojoDebugPortlet.createPortletWindow( portletWindowFactory, null, true );
+        }
+
         for ( var i = 0; i < portletArray.length; i++ )
         {
             var portlet = portletArray[i];
             if ( jetspeed.debugPortletEntityIdFilter )
             {
-                if (! dojo.lang.inArray(jetspeed.debugPortletEntityIdFilter, portlet.entityId))
+                if ( ! dojo.lang.inArray( jetspeed.debugPortletEntityIdFilter, portlet.entityId ) )
                     portlet = null;
             }
             if (portlet)
             {
                 createdPortlets.push(portlet);
-                portlet.createPortletWindow(portletWindowFactory,null,true);
+                portlet.createPortletWindow( portletWindowFactory, null, true );
             }
         }
+
         jetspeed.doRenderAll( null, createdPortlets, true );
     }
 };
@@ -240,6 +268,7 @@
     return false;
 };
 
+
 // ... jetspeed.om.PageContentListenerCreateWidget
 jetspeed.om.PageContentListenerCreateWidget = function()
 {
@@ -487,7 +516,8 @@
     reload: function()
     {
         this._destroyPortlets();
-        jetspeed.loadPage();
+        jetspeed.ui.removeColumns();
+        jetspeed.initializeDesktop();
     }
 };
 
@@ -549,29 +579,116 @@
 {
     create: function( /* Portlet */ portlet )
     {
-        return jetspeed.ui.createPortletWindowWidget(portlet);
+        return jetspeed.ui.createPortletWindowWidget( portlet );
+    },
+    layout: function( /* Portlet */ portlet, /* PortletWindow */ portletWindowWidget )
+    {
+        var addToElmt = document.getElementById( jetspeed.id.DESKTOP );
+        addToElmt.appendChild( portletWindowWidget.domNode );
+    }
+};
+
+jetspeed.om.PortletTilingWindowFactory = function()
+{
+};
+jetspeed.om.PortletTilingWindowFactory.prototype =
+{
+    create: function( /* Portlet */ portlet )
+    {
+        var portletWinParams = {};
+        portletWinParams.inTileLayout = true;
+        return jetspeed.ui.createPortletWindowWidget( portlet, portletWinParams );
+    },
+    layout: function( /* Portlet */ portlet, /* PortletWindow */ portletWindowWidget )
+    {
+        var useColumnElmt = null;    // select a column based on least populated (least number of child nodes)
+        var useColumnIndex = -1;
+        for ( var i = 0 ; i < jetspeed.columns.length ; i++ )
+        {
+            var columnElmt = jetspeed.columns[i];
+            if ( ! columnElmt.hasChildNodes() )
+            {
+                useColumnElmt = columnElmt;
+                useColumnIndex = i;
+                break;
+            }
+            if ( useColumnElmt == null || useColumnElmt.childNodes.length > columnElmt.childNodes.length )
+            {
+                useColumnElmt = columnElmt;
+                useColumnIndex = i;
+            }
+        }
+        if ( useColumnElmt )
+        {
+            //portletWindowWidget.domNode.style.width = "";
+            if ( ! portlet.getProperty( "forceAbsolute" ) )
+            {
+                portletWindowWidget.domNode.style.left = "auto";
+                portletWindowWidget.domNode.style.top = "auto";
+                portletWindowWidget.domNode.style.position = "static";
+                useColumnElmt.appendChild( portletWindowWidget.domNode );
+            }
+            else
+            {
+                var addToElmt = document.getElementById( jetspeed.id.DESKTOP );
+                addToElmt.appendChild( portletWindowWidget.domNode );
+            }
+        }
+    }
+};
+
+//        if ( jetspeed.columns && jetspeed.columns.length > 0 )
+
+// ... jetspeed.om.PortletContentRetriever
+jetspeed.om.PortletContentRetriever = function()
+{
+};
+jetspeed.om.PortletContentRetriever.prototype =
+{
+    getContent: function( /* Portlet */ portlet, /* String */ requestUrl, /* PortletContentListener */ portletContentListener )
+    {
+    }
+};
+
+// ... jetspeed.om.DojoDebugPortletContentRetriever
+jetspeed.om.DojoDebugPortletContentRetriever = function()
+{
+    this.initialized = false;
+};
+jetspeed.om.DojoDebugPortletContentRetriever.prototype =
+{
+    getContent: function( /* Portlet */ portlet, /* String */ requestUrl, /* PortletContentListener */ portletContentListener )
+    {
+        if ( ! this.initialized )
+        {
+            var content = '<div id="' + jetspeed.debug.debugContainerId + '"></div>';
+            portletContentListener.notifySuccess( content, requestUrl, portlet ) ;
+            this.initialized = true;
+        }
     }
 };
 
 
 // ... jetspeed.om.Portlet
-jetspeed.om.Portlet = function( /* String */ portletName, /* String */ portletEntityId, /* String */ portletTitle )
+jetspeed.om.Portlet = function( /* String */ portletName, /* String */ portletEntityId, /* String */ portletTitle, /* special */ alternateContentRetriever )
 {
     this.name = portletName;
     this.entityId = portletEntityId;
-    if (portletTitle == null && portletName)
+    if ( portletTitle == null && portletName )
     {
         var re = (/^[^:]*:*/);
         portletTitle = portletName.replace( re, "" );
     }
     this.title = portletTitle;
     this.properties = {};
+    this.alternateContentRetriever = alternateContentRetriever;
 };
 jetspeed.om.Portlet.prototype =   /* defining prototypes like this is not cool if the object uses dojo.inherits (this would replace pt)  */
 {                                 /* dojo.lang.extend would allow this syntax instead of [<type>.prototype.<propname> = <propval>]*      */
     name: null,
     entityId: null,
     title: null,
+    alternateContentRetriever: null,
     
     windowFactory: null,
 
@@ -929,13 +1046,24 @@
     createPortletWindow: function(portletWindowFactory, portletContentListener, doNotRetrieveContent)
     {
         if ( portletWindowFactory == null )
-            portletWindowFactory = new jetspeed.om.PortletWindowFactory() ;
+        {
+            if ( ! jetspeed.prefs.windowTiling )
+                portletWindowFactory = new jetspeed.om.PortletWindowFactory() ;
+            else
+                portletWindowFactory = new jetspeed.om.PortletTilingWindowFactory() ;
+        }
 
         this.windowFactory = portletWindowFactory ;
-        this.windowWidgetId = portletWindowFactory.create( this ) ;
+        var windowWidget = portletWindowFactory.create( this ) ;
+        if ( windowWidget )
+        {
+            this.windowWidgetId = windowWidget.widgetId;
 
-        if (! doNotRetrieveContent)
-            this.retrievePortletContent(portletContentListener) ;
+            portletWindowFactory.layout( this, windowWidget );
+
+            if (! doNotRetrieveContent)
+                this.retrievePortletContent(portletContentListener) ;
+        }
     },
 
     getPortletUrl: function(renderUrl)
@@ -1010,6 +1138,12 @@
             portletContentListener = new jetspeed.om.PortletContentListener() ;
         var portlet = this ;
         var requestUrl = portlet.getPortletUrl( renderOrActionUrl ) ;
+
+        if ( this.alternateContentRetriever != null )
+        {
+            this.alternateContentRetriever.getContent( portlet, requestUrl, portletContentListener );
+            return ;
+        }
         dojo.io.bind({
             formNode: actionForm,
             url: requestUrl,
@@ -1081,6 +1215,7 @@
 
 
 // ... jetspeed.ui methods
+
 jetspeed.ui.createPortalTaskBar = function( taskbarParameters )
 {
     if ( ! taskbarParameters )
@@ -1089,12 +1224,110 @@
         taskbarParameters.widgetId = jetspeed.id.TASKBAR;
     
     var nWidget = dojo.widget.createWidget( 'PortalTaskBar', taskbarParameters );
-    nWidget.domNode.style.cssText = "background-color: #666; width: 100%; bottom: 5px; height: 100px";
+    nWidget.domNode.style.cssText = "background-color: #666; width: 100%; bottom: 5px; height: 110px";
 
     var addToElmt = document.getElementById( jetspeed.id.DESKTOP );
     addToElmt.appendChild( nWidget.domNode );
 };
-
+jetspeed.ui.createColumns = function( columnsParent, columnTotal )
+{
+    if ( columnTotal > 0 )
+    {
+        jetspeed.columns = new Array( columnTotal );
+        var columnContainer = document.createElement("div");
+        columnContainer.id = jetspeed.id.COLUMNS;
+        for ( var i = 0 ; i < columnTotal ; i++ )
+        {
+            jetspeed.ui.createColumn( columnContainer, i, columnTotal );
+        }
+        columnsParent.appendChild( columnContainer );
+    }
+};
+jetspeed.ui.removeColumns = function()
+{
+    if ( jetspeed.columns && jetspeed.columns.length > 0 )
+    {
+        for ( var i = 0 ; i < jetspeed.columns.length ; i++ )
+        {
+            if ( jetspeed.columns[i] )
+                dojo.dom.removeNode( jetspeed.columns[i] );
+            jetspeed.columns[i] = null;
+        }
+        var columnContainer = dojo.byId( jetspeed.id.COLUMNS );
+        if ( columnContainer )
+            dojo.dom.removeNode( columnContainer );
+    }
+    jetspeed.columns = [];
+};
+jetspeed.ui.createColumn = function( columnContainer, columnIndex, columnTotal )
+{
+    var divElmt = document.createElement("div");
+    divElmt.setAttribute("columnIndex", columnIndex);
+    var colWidthPctg = Math.round(100/columnTotal);
+    if ( columnIndex == (columnTotal-1) && ( (columnTotal * colWidthPctg) >= 100 ) )
+        colWidthPctg = colWidthPctg -1;
+    divElmt.style.width = colWidthPctg + "%";
+    divElmt.style.minHeight = "1px";
+    divElmt.className = "DesktopColumn";
+    jetspeed.columns[columnIndex]  = divElmt;
+    columnContainer.appendChild(divElmt);
+    //divElmt.appendChild( document.createTextNode( "LayoutColumn" + (columnIndex +1) ) );
+};
+jetspeed.ui.getPortletWindowChildren = function( /* DOM node */ parentNode, /* DOM node */ matchNodeIfFound )
+{
+    var nodesPW = null;
+    var nodeMatchIndex = -1;
+    if ( parentNode )
+    {
+        var nodesPW = [];
+        var children = parentNode.childNodes;
+        for ( var i = 0 ; i < children.length ; i++ )
+        {
+            var child = children[i];
+            if ( dojo.html.hasClass( child, jetspeed.id.PORTLET_WINDOW_STYLE_CLASS ) )
+            {
+                nodesPW.push( child );
+                if ( matchNodeIfFound && child == matchNodeIfFound )
+                    nodeMatchIndex = nodesPW.length -1;
+            }
+            else if ( matchNodeIfFound && child == matchNodeIfFound )
+            {
+                nodesPW.push( child );
+                nodeMatchIndex = nodesPW.length -1;
+            }
+        }
+    }
+    return { portletWindowNodes: nodesPW, matchIndex: nodeMatchIndex };
+};
+jetspeed.ui.getPortletWindowsFromNodes = function( /* DOM node [] */ portletWindowNodes )
+{
+    var portletWindows = null;
+    if ( portletWindowNodes )
+    {
+        portletWindows = new Array();
+        for ( var i = 0 ; i < portletWindowNodes.length ; i++ )
+        {
+            var widget = dojo.widget.byNode( portletWindowNodes[ i ] );
+            if ( widget )
+                portletWindows.push( widget ) ;
+        }
+    }
+    return portletWindows;
+};
+jetspeed.ui.dumpPortletWindowsPerColumn = function()
+{
+    for ( var i = 0 ; i < jetspeed.columns.length ; i++ )
+    {
+        var columnElmt = jetspeed.columns[i];
+        var windowNodesInColumn = jetspeed.ui.getPortletWindowChildren( columnElmt, null );
+        var portletWindowsInColumn = jetspeed.ui.getPortletWindowsFromNodes( windowNodesInColumn.portletWindowNodes );
+        var dumpClosure = { dumpMsg: "" };
+        dojo.lang.forEach( portletWindowsInColumn,
+                                function(portletWindow) { dumpClosure.dumpMsg = dumpClosure.dumpMsg + ( dumpClosure.dumpMsg.length > 0 ? ", " : "" ) + portletWindow.portlet.entityId; } );
+        dumpClosure.dumpMsg = "column " + i + ": " + dumpClosure.dumpMsg;
+        dojo.debug( dumpClosure.dumpMsg );
+    }
+};
 jetspeed.ui.createPortletWindowWidget = function(/* Portlet */ portletObj, portletParameters)
 {
     if ( ! portletParameters )
@@ -1103,10 +1336,7 @@
     // NOTE: other parameters, such as widgetId could be set here (to override what PortletWindow does)
     var nWidget = dojo.widget.createWidget( 'PortletWindow', portletParameters );
     
-    var addToElmt = document.getElementById( jetspeed.id.DESKTOP );
-    addToElmt.appendChild( nWidget.domNode );
-
-    return nWidget.widgetId;
+    return nWidget;
 };
 
 jetspeed.ui.getDefaultFloatingPaneTemplate = function()
@@ -1120,23 +1350,23 @@
 
 
 // ... fade-in convenience methods (work with set of nodes)
-jetspeed.ui.fadeIn = function(nodes, duration, displayStyleValue)
+jetspeed.ui.fadeIn = function(nodes, duration, visibilityStyleValue)
 {
-    jetspeed.ui.fade(nodes, duration, displayStyleValue, 0, 1);
+    jetspeed.ui.fade(nodes, duration, visibilityStyleValue, 0, 1);
 };
 jetspeed.ui.fadeOut = function(nodes, duration)
 {
-    jetspeed.ui.fade(nodes, duration, "none", 1, 0);
+    jetspeed.ui.fade(nodes, duration, "hidden", 1, 0);
 };
-jetspeed.ui.fade = function(nodes, duration, displayStyleValue, startOpac, endOpac)
+jetspeed.ui.fade = function(nodes, duration, visibilityStyleValue, startOpac, endOpac)
 {
     if ( nodes.length > 0 )
     {   // mimick dojo.fx.html.fade, but for all objects together
         for ( var i = 0 ; i < nodes.length ; i++ )
         {
             dojo.fx.html._makeFadeable(nodes[i]);
-            if (displayStyleValue != "none")
-                nodes[i].style.display = displayStyleValue ;
+            if (visibilityStyleValue != "none")
+                nodes[i].style.visibility = visibilityStyleValue ;
         }
         var anim = new dojo.animation.Animation(
 		                new dojo.math.curves.Line([startOpac],[endOpac]),
@@ -1147,11 +1377,11 @@
                 dojo.style.setOpacity(nodes[mi], e.x);
 	        }});
         
-        if (displayStyleValue == "none")
+        if (visibilityStyleValue == "hidden")
         {
             dojo.event.connect(anim, "onEnd", function(e) {
 			    for ( var mi = 0 ; mi < nodes.length ; mi++ )
-                    nodes[mi].style.display = displayStyleValue ;
+                    nodes[mi].style.visibility = visibilityStyleValue ;
 		    });
         }
         anim.play(true);

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.css
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.css?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.css (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.css Mon Apr 10 23:34:59 2006
@@ -1,52 +1,82 @@
+.desktopColumn {
+	float:left;
+    /* background-color: transparent; */
+}
+*html .desktopColumn {
+	overflow: hidden;
+    /* background-color: transparent; */
+    /* background-color: #666; */
+}
+
+#pwGhost {
+	border: 1px dashed #F00;
+	margin: 2px;
+}
+
+/********** Outer Window ***************/
 
 .dojoFloatingPane {
 	/* essential css */
 	position: absolute;
-	overflow: hidden;		/* dojo says 'visible' with this explanation "so drop shadow is displayed"" */
+    overflow: hidden;		/* dojo says 'visible' with this explanation "so drop shadow is displayed"" */
                             /* we says 'hidden' cause IE likes to kindly expand div to fit content otherwise */
-	z-index: 5;
-	-moz-box-sizing: border-box;
-	-khtml-box-sizing: border-box;
-	
+	z-index: 10;
+
 	/* styling css */
 	border: 1px solid;
 	border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;
 	background-color: ThreeDFace;
 }
 
-.dojoFloatingPaneTitleBar {
-	/* essential css */
-	z-index: 2;
-	position: absolute;
-	top: 0px;
-	left: 0px;
-	width: 100%;
 
-	/* styling css */
-	vertical-align: middle;
-	height: 22px;
-	color: CaptionText;
-	font: small-caption;
+/********** Title Bar ****************/
+
+.dojoFloatingPaneTitleBar {
+	vertical-align: top;
+	margin: 2px 2px 2px 2px;
+	z-index: 10;
 	background-color: #7596c6;
 	cursor: default;
+	overflow: hidden;
+	border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;
+	vertical-align: middle;
 }
+
 .dojoFloatingPaneTitleText {
+	float: left;
 	padding: 2px 4px 2px 2px;
-    float:left;
+	white-space: nowrap;
+	color: CaptionText;
+	font: small-caption;
 }
 
+.dojoFloatingPaneActions{
+	float: right;
+	position: absolute;
+	right: 2px;
+	top: 2px;
+	vertical-align: middle;
+}
+
+
+.dojoFloatingPaneActionItem {
+	vertical-align: middle;
+	margin-right: 1px;
+	height: 22px;
+	width: 22px;
+}
+
+
 .dojoFloatingPaneTitleBarIcon {
-    /* essential css */
-    float: left;
+	/* essential css */
+	float: left;
 
-    /* styling css */
+	/* styling css */
+    height: 16px;
+	width: 16px;
     margin-top: 3px;
     margin-left: 2px;
     margin-right: 3px;
-    height: 16px;
-	width: 16px;
-    /* height: 22px; */
-    /* vertical-align: middle; */
 }
 
 /* minimize/maximize icons are specified by CSS only */
@@ -74,32 +104,25 @@
 
 /* bar at bottom of window that holds resize handle */
 .dojoFloatingPaneResizebar {
-	/* essential css */
-	position: absolute;
-	left: 0;
-	bottom: 0;
-	width: 100%;
+	z-index: 10;
 	height: 13px;
-	z-index: 2;
-	
-	/* styling css */
 	background-color: ThreeDFace;
+    /*padding: 0px;
+    margin: 0px;*/
 }
 
-/* the part that holds the actual content of the floating pane (text or whatever) */
+/************* Client Area ***************/
+
 .dojoFloatingPaneClient {
-	/* essential css */
 	position: relative;
-	width: 100%;
-	height: 100%;
-	-moz-box-sizing: border-box;
-	-khtml-box-sizing: border-box;
-	z-index: 2;
-	overflow: auto;
-	
-	/* styling css */
+	z-index: 10;
+	border: 1px solid;
+	border-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow;
+	margin: 2px;
 	background-color: ThreeDFace;
-    padding: 8px;   /* doesn't work!  can't figure out why */
+	padding: 8px;
 	/*font-family: Verdana, Helvetica, Garamond, sans-serif;
 	font-size: 12px;*/
+	overflow: auto;
 }
+

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.html
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.html?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.html (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/HtmlFloatingPane.html Mon Apr 10 23:34:59 2006
@@ -1,27 +1,18 @@
-<div id="${this.widgetId}" class="dojoFloatingPane" datasrc="${this.blee}" dojoAttachEvent="onMouseDown">
-	<div dojoAttachPoint="titleBar" class="dojoFloatingPaneTitleBar" style="display:none" dojoAttachEvent="onMouseOver:titleMouseOver;onMouseOut:titleMouseOut">
-        <img dojoAttachPoint="titleBarIcon" class="dojoFloatingPaneTitleBarIcon">
-		<div class="dojoFloatingPaneCloseIcon" dojoAttachPoint="closeAction" dojoAttachEvent="onClick:closeWindow"></div>
-        <!-- dojoAttachEvent="onClick:closeWindow;onMouseOver:titleMouseOver;onMouseOut:titleMouseOut"></div> -->
-		<div class="dojoFloatingPaneRestoreIcon" dojoAttachPoint="restoreAction" dojoAttachEvent="onClick:restoreWindow"></div>
-        <!--  dojoAttachEvent="onClick:restoreWindow;onMouseOver:titleMouseOver;onMouseOut:titleMouseOut"></div> -->
-		<div class="dojoFloatingPaneMaximizeIcon" dojoAttachPoint="maximizeAction" dojoAttachEvent="onClick:maximizeWindow"></div>
-        <!--  dojoAttachEvent="onClick:maximizeWindow;onMouseOver:titleMouseOver;onMouseOut:titleMouseOut"></div> -->
-		<div class="dojoFloatingPaneMinimizeIcon" dojoAttachPoint="minimizeAction" dojoAttachEvent="onClick:minimizeWindow"></div>
-        <!-- dojoAttachEvent="onClick:minimizeWindow;onMouseOver:titleMouseOver;onMouseOut:titleMouseOut"></div> -->
-	  	<div class="dojoFloatingPaneTitleText" dojoAttachPoint="titleBarText">${this.title}</div>
+<div id="${this.widgetId}" class="dojoFloatingPane" >  <!-- dojoAttachEvent="onMouseDown" -->
+	<div dojoAttachPoint="titleBar" class="dojoFloatingPaneTitleBar"  dojoAttachEvent="onMouseDown;onMouseOver:titleMouseOver;onMouseOut:titleMouseOut" style="display:none">
+	  	<img dojoAttachPoint="titleBarIcon"  class="dojoFloatingPaneTitleBarIcon">
+		<div dojoAttachPoint="closeAction" dojoAttachEvent="onClick:closeWindow"
+   	  		class="dojoFloatingPaneCloseIcon"></div>
+		<div dojoAttachPoint="restoreAction" dojoAttachEvent="onClick:restoreWindow"
+   	  		class="dojoFloatingPaneRestoreIcon"></div>
+		<div dojoAttachPoint="maximizeAction" dojoAttachEvent="onClick:maximizeWindow"
+   	  		class="dojoFloatingPaneMaximizeIcon"></div>
+		<div dojoAttachPoint="minimizeAction" dojoAttachEvent="onClick:minimizeWindow"
+   	  		class="dojoFloatingPaneMinimizeIcon"></div>
+	  	<div dojoAttachPoint="titleBarText" class="dojoFloatingPaneTitleText">${this.title}</div>
 	</div>
 
-    <div dojoAttachPoint="containerNodeWrapper" style="position: relative; height: 100%; width: 100%; overflow: hidden;">
-        <div dojoAttachPoint="containerNode" class="dojoFloatingPaneClient"></div>
-	</div>
-
-    <!--
-	<div dojoAttachPoint="containerNode" class="dojoFloatingPaneClient">
-	</div>
-    -->
-
-	<div dojoAttachPoint="resizeBar" class="dojoFloatingPaneResizebar">
-	</div>
+	<div dojoAttachPoint="containerNode" class="dojoFloatingPaneClient"></div>
 
+	<div dojoAttachPoint="resizeBar" class="dojoFloatingPaneResizebar"></div>
 </div>

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalTaskBar.js
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalTaskBar.js?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalTaskBar.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalTaskBar.js Mon Apr 10 23:34:59 2006
@@ -51,7 +51,6 @@
         //this.domNode.style.cssText = "background-color: #666; width: 100%; bottom: 5px; height: 100px";
         if ( ! this.domNode.id )
             this.domNode.id = this.widgetId;
-        dojo.debug( "PortalTaskBar.postCreate  widgetId=" + this.widgetId + " domNode.id=" + this.domNode.id );
 
         this.contextMenuCreate();
     },
@@ -66,11 +65,20 @@
     },
     contextMenuCreate: function()
     {
-        var taskBarContextMenu = dojo.widget.createWidget( "PopupMenu2", { id: "m1", targetNodeIds: [ this.domNode.id ], contextMenuForWindow: false }, null );
-        var resetLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "menu-item1", caption: "Reset Window Layout"} );
+        var taskBarContextMenu = dojo.widget.createWidget( "PopupMenu2", { id: "jstb_menu", targetNodeIds: [ this.domNode.id ], contextMenuForWindow: false }, null );
+        var resetLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstb_menu_item1", caption: "Reset Window Layout"} );
+        var freeFormLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstb_menu_item2", caption: "Free Flowing Layout"} );
+        var twoColummLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstb_menu_item3", caption: "Two Column Layout"} );
+        var threeColummLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstb_menu_item4", caption: "Three Column Layout"} );
         
         dojo.event.connect( resetLayoutMenuItem, "onClick", function(e) { jetspeed.page.resetWindowLayout(); } );
+        dojo.event.connect( freeFormLayoutMenuItem, "onClick", function(e) { jetspeed.prefs.windowTiling = false; jetspeed.page.resetWindowLayout(); jetspeed.page.reload(); } );
+        dojo.event.connect( twoColummLayoutMenuItem, "onClick", function(e) { jetspeed.prefs.windowTiling = 2; jetspeed.page.reload(); } );
+        dojo.event.connect( threeColummLayoutMenuItem, "onClick", function(e) { jetspeed.prefs.windowTiling = 3; jetspeed.page.reload(); } );
         taskBarContextMenu.addChild( resetLayoutMenuItem );
+        taskBarContextMenu.addChild( freeFormLayoutMenuItem );
+        taskBarContextMenu.addChild( twoColummLayoutMenuItem );
+        taskBarContextMenu.addChild( threeColummLayoutMenuItem );
         document.body.appendChild( taskBarContextMenu.domNode );
     }
 });

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortletWindow.js
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortletWindow.js?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortletWindow.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortletWindow.js Mon Apr 10 23:34:59 2006
@@ -9,6 +9,7 @@
 {
     dojo.widget.html.FloatingPane.call( this );
     this.widgetType = "PortletWindow";
+    this.windowTiling = jetspeed.prefs.windowTiling;
     this.portletInitialized = false;
 };
 
@@ -16,13 +17,16 @@
 
 dojo.lang.extend(jetspeed.ui.widget.PortletWindow, {
     title: "Unknown Portlet",
-    constrainToContainer: "1",
+    constrainToContainer: ( jetspeed.prefs.windowTiling ? 0 : 1 ),
     contentWrapper: "layout",
     displayCloseAction: true,
     displayMinimizeAction: true,
     displayMaximizeAction: true,
     taskBarId: jetspeed.id.TASKBAR,
+    hasShadow: false,
     nextIndex: 1,
+
+    windowTiling: false,
     titleMouseIn: 0,
     titleLit: false,
 
@@ -45,6 +49,9 @@
         }
         this._incrementNextIndex();
 
+        if ( portletObj.getProperty( "forceAbsolute" ) )
+            this.windowTiling = 0;
+
         var windowid = null;
         var windowtheme = null;
         var windowicon = null;
@@ -61,21 +68,21 @@
             windowicon = portletObj.getProperty("window-icon");
         }
         
-        if (! windowtheme)
+        if ( ! windowtheme )
         {
             if ( jetspeed.debugPortletWindowThemes )
             {
                 windowtheme = jetspeed.debugPortletWindowThemes[Math.floor(Math.random()*jetspeed.debugPortletWindowThemes.length)];
             }
         }
-        if (windowtheme)
+        if ( windowtheme )
         {
             this.portletWindowTheme = windowtheme ;
             this.templateCssPath = new dojo.uri.Uri(jetspeed.url.basePortalDesktopUrl(), "jetspeed/javascript/desktop/windowthemes/" + windowtheme + "/css/styles.css");
         }
         this.templatePath = jetspeed.ui.getDefaultFloatingPaneTemplate();
         
-        if (! windowicon)
+        if ( ! windowicon )
         {
             if ( jetspeed.debugPortletWindowIcons )
             {
@@ -89,11 +96,37 @@
     
         if ( dojo.render.html.mozilla )  // dojo.render.html.ie
         {
-            this.hasShadow = "true";
+            //this.hasShadow = "true";
             //        dojo.debug( "nWidget.domNode.cssText: " + 
             //nWidget.domNode.style = "overflow: visible;";   // so that drop shadow is displayed
         }
 
+        var portletWindowState = portletObj.getLastSavedWindowState();
+        var portletWidth = portletWindowState.width;
+        var portletHeight = portletWindowState.height;
+        var portletLeft = portletWindowState.left;
+        var portletTop = portletWindowState.top;
+        // NOTE: portletWindowState.zIndex;  - should be dealt with in the creation order
+
+        if ( portletWidth != null && portletWidth > 0 ) portletWidth = Math.floor(portletWidth) + "px";
+        else portletWidth = "280px";
+    
+        if ( portletHeight != null && portletHeight > 0 ) portletHeight = Math.floor(portletHeight) + "px";
+        else portletHeight = "200px";
+            
+        if ( portletLeft != null && portletLeft >= 0 ) portletLeft = Math.floor(portletLeft) + "px";
+        else portletLeft = (((this._getNextIndex() -2) * 30 ) + 200) + "px";
+    
+        if ( portletTop != null && portletTop >= 0 ) portletTop = Math.floor(portletTop) + "px";
+        else portletTop = (((this._getNextIndex() -2) * 30 ) + 170) + "px";
+
+        var source = this.getFragNodeRef( fragment );
+        var dimensionsCss = "width: " + portletWidth + "; height: " + portletHeight;
+        if ( ! this.windowTiling )
+            dimensionsCss += "; left: " + portletLeft + "; top: " + portletTop + ";";
+        
+        source.style.cssText = dimensionsCss;
+        
         //dojo.debug("PortletWindow  widgetId=" + this.widgetId + "  windowtheme=" + windowtheme + "  templateCssPath=" + this.templateCssPath);
     },
 
@@ -110,6 +143,22 @@
         return jetspeed.ui.widget.PortletWindow.prototype.nextIndex;
     },
 
+    // dojo.widget.Widget create->buildRendering protocol
+    fillInTemplate: function( args, frag )
+    {
+        var isResizable = this.resizable;
+        if ( isResizable )
+        {
+			this.resizeBar.style.display = "";
+			var rh = dojo.widget.createWidget( "ResizeHandle", { targetElmId: this.widgetId, id: this.widgetId+"_resize" } );
+            if ( this.windowTiling && dojo.render.html.mozilla )  // dojo.render.html.ie
+                rh.domNode.style.position = "static";
+			this.resizeBar.appendChild( rh.domNode );
+		}
+
+        jetspeed.ui.widget.PortletWindow.superclass.fillInTemplate.call( this, args, frag );
+    },
+
     // dojo.widget.Widget create protocol
     postCreate: function( args, fragment, parentComp )
     {
@@ -124,12 +173,10 @@
         
         this.domNode.id = this.widgetId;  // BOZO: must set the id here - it gets defensively cleared by dojo
         
-
         var domNodeClassName = this.domNode.className;
         if ( this.portletWindowTheme )
         {
             domNodeClassName = this.portletWindowTheme + ( domNodeClassName ? ( " " + domNodeClassName ) : "" );
-            this.domNode.className = domNodeClassName;
         }
         this.domNode.className = jetspeed.id.PORTLET_STYLE_CLASS + ( domNodeClassName ? ( " " + domNodeClassName ) : "" );
 
@@ -139,38 +186,14 @@
             var containerNodeClassName = this.containerNode.className;
             if ( this.portletWindowTheme )
             {
-                var existingClassName = this.containerNode.className;
                 containerNodeClassName = this.portletWindowTheme + ( containerNodeClassName ? ( " " + containerNodeClassName ) : "" );
             }
             this.containerNode.className = jetspeed.id.PORTLET_STYLE_CLASS + ( containerNodeClassName ? ( " " + containerNodeClassName ) : "" );
-            dojo.debug( "setting containerNode [" + this.portlet.entityId + "] className=" + this.containerNode.className );
         }
-    
-        var portletWindowState = this.portlet.getLastSavedWindowState();
-        var portletWidth = portletWindowState.width;
-        var portletHeight = portletWindowState.height;
-        var portletLeft = portletWindowState.left;
-        var portletTop = portletWindowState.top;
-        // NOTE: portletWindowState.zIndex;  - should be dealt with in the creation order
-
-        if ( portletWidth != null && portletWidth > 0 ) portletWidth = Math.floor(portletWidth) + "px";
-        else portletWidth = "280px";
-        this.domNode.style.width = portletWidth;
-    
-        if ( portletHeight != null && portletHeight > 0 ) portletHeight = Math.floor(portletHeight) + "px";
-        else portletHeight = "200px";
-        this.domNode.style.height = portletHeight;
-            
-        if ( portletLeft != null && portletLeft >= 0 ) portletLeft = Math.floor(portletLeft) + "px";
-        else portletLeft = (((this._getNextIndex() -2) * 30 ) + 200) + "px";
-        this.domNode.style.left = portletLeft;
-    
-        if ( portletTop != null && portletTop >= 0 ) portletTop = Math.floor(portletTop) + "px";
-        else portletTop = (((this._getNextIndex() -2) * 30 ) + 170) + "px";
-        this.domNode.style.top =  portletTop;
-    
+        //dojo.debug( "PortletWindow.postCreate [" + this.portlet.entityId + "] setting domNode.className=" + this.domNode.className + " containerNode.className=" + this.containerNode.className );
+        
         if ( jetspeed.debug.createWindow )
-            dojo.debug( "createWindow [" + this.portlet.entityId + "]" + " width=" + portletWidth + " height=" + portletHeight + " left=" + portletLeft + " top=" + portletTop ) ;
+            dojo.debug( "createdWindow [" + this.portlet.entityId + "]" + " width=" + this.domNode.style.width + " height=" + this.domNode.style.height + " left=" + this.domNode.style.left + " top=" + this.domNode.style.top ) ;
     
         this.titleDim( true );
 
@@ -265,7 +288,7 @@
         for ( var i = 0 ; i < mightBeEnlightened.length ; i++ )
         {
             var btn = mightBeEnlightened[i];
-            if (btn.style.display == "none")
+            if (btn.style.visibility == "hidden")
                 toBeEnlightened.push(btn);
         }
         jetspeed.ui.fadeIn(toBeEnlightened, 325, "");
@@ -279,8 +302,8 @@
         {
             var btn = mightBeExtinguished[i];
             if (immediateForce)
-                btn.style.display = "none" ;
-            else if (btn.style.display != "none")
+                btn.style.visibility = "hidden" ;
+            else if (btn.style.display != "hidden")
                 toBeExtinguished.push(btn);
         }
         jetspeed.ui.fadeOut(toBeExtinguished, 280);
@@ -330,7 +353,8 @@
     {
         var initialHtmlStr = html.toString();
         
-        initialHtmlStr = '<div class="PContent" >' + initialHtmlStr + '</div>';    // style="overflow: auto"
+        if ( ! this.portlet.getProperty( "excludePContent" ) )
+            initialHtmlStr = '<div class="PContent" >' + initialHtmlStr + '</div>';   // BOZO: get this into the template ?
 
         var preParsePortletResult = this.portlet.preParseAnnotateHtml( initialHtmlStr );
         //this.executeScripts = true;
@@ -373,6 +397,9 @@
 
 dojo.widget.tags.addParseTreeHandler("dojo:portletwindow");
 
+// ... PortletWindow drag ghost
+jetspeed.ui.widget.pwGhost = document.createElement("div");
+jetspeed.ui.widget.pwGhost.id = "pwGhost";
 
 jetspeed.ui.widget.PortletWindowDragMoveSource = function( /* jetspeed.ui.widget.PortletWindow */ portletWindow, type)
 {
@@ -380,14 +407,21 @@
 	dojo.dnd.HtmlDragMoveSource.call(this, portletWindow.domNode, type);
 };
 
-dojo.inherits(jetspeed.ui.widget.PortletWindowDragMoveSource, dojo.dnd.HtmlDragMoveSource);
+dojo.inherits( jetspeed.ui.widget.PortletWindowDragMoveSource, dojo.dnd.HtmlDragMoveSource );
 
-dojo.lang.extend(jetspeed.ui.widget.PortletWindowDragMoveSource, {
+dojo.lang.extend( jetspeed.ui.widget.PortletWindowDragMoveSource, {
 	onDragStart: function()
     {
-        //dojo.debug( "jetspeed.ui.widget.PortletWindowDragMoveSource.onDragStart" );
+        // BOZO: code copied from dojo.dnd.HtmlDragMoveSource.onDragStart to change dragObject
         this.portletWindow.isDragging = true;
-        return jetspeed.ui.widget.PortletWindowDragMoveSource.superclass.onDragStart.call( this );
+        var dragObj = new jetspeed.ui.widget.PortletWindowDragMoveObject( this.portletWindow, this.dragObject, this.type );
+
+		if ( this.constrainToContainer )
+        {
+			dragObj.constrainTo( this.constrainingContainer );
+		}
+
+		return dragObj;
 	},
     onDragEnd: function()
     {
@@ -396,4 +430,161 @@
         this.portletWindow.portlet.submitChangedWindowState();
         //dojo.debug( "jetspeed.ui.widget.PortletWindowDragMoveSource.onDragEnd" );
     }
+});
+
+jetspeed.ui.widget.PortletWindowDragMoveObject = function( portletWindow, node, type )
+{
+    this.portletWindow = portletWindow;
+    this.windowTiling = this.portletWindow.windowTiling;
+	dojo.dnd.HtmlDragMoveObject.call( this, node, type );
+}
+
+dojo.inherits( jetspeed.ui.widget.PortletWindowDragMoveObject, dojo.dnd.HtmlDragMoveObject );
+
+dojo.lang.extend( jetspeed.ui.widget.PortletWindowDragMoveObject, {
+    onDragStart: function(e) {
+        var portletWindowNode = this.domNode;
+
+        jetspeed.ui.widget.PortletWindowDragMoveObject.superclass.onDragStart.call( this, e );
+
+        // ghost placement - must happen after superclass.onDragStart
+        var pwGhost = jetspeed.ui.widget.pwGhost;
+
+        if ( this.windowTiling )
+        {
+            // ghost placement - must happen after superclass.onDragStart
+            pwGhost.style.height = portletWindowNode.offsetHeight+"px";
+            portletWindowNode.parentNode.insertBefore( pwGhost, portletWindowNode );
+
+            // domNode removal from column - add to desktop for visual freeform drag
+            document.getElementById( jetspeed.id.DESKTOP ).appendChild( portletWindowNode );
+
+            var inColIndex = null;
+            this.columnsX = new Array( jetspeed.columns.length );
+            for ( var i = 0 ; i < jetspeed.columns.length ; i++ )
+            {
+                var columnElmt = jetspeed.columns[i];
+                this.columnsX[ i ] = dojo.style.getAbsoluteX( columnElmt, true );
+                if ( dojo.dom.isDescendantOf( portletWindowNode, columnElmt, true ) )
+                    inColIndex = i;
+            }
+            
+            var inCol = ( inColIndex >= 0 ? jetspeed.columns[ inColIndex ] : null );
+            pwGhost.col = inCol;
+        }
+
+        dojo.debug( "PortletWindowDragMoveObject [" + this.portletWindow.portlet.entityId + "] onDragStart:  portletWindowNode.hasParent=" + dojo.dom.hasParent( portletWindowNode ) + " dragOffset.left=" + this.dragOffset.left + " dragOffset.top=" + this.dragOffset.top + " dragStartPosition.left=" + this.dragStartPosition.left + " dragStartPosition.top=" + this.dragStartPosition.top );
+    },
+    onDragMove: function(e)
+    {
+        //jetspeed.ui.widget.PortletWindowDragMoveObject.superclass.onDragMove.call( this, e );
+        // BOZO: code copied from dojo.dnd.HtmlDragMoveObject.onDragMove
+
+        var mouse = dojo.html.getCursorPosition(e);
+		this.updateDragOffset();
+		var x = this.dragOffset.left + mouse.x;
+		var y = this.dragOffset.top + mouse.y;
+        //var x = mouse.x ;
+        //var y = mouse.y ;
+
+		if (this.constrainToContainer) {
+			if (x < this.constraints.minX) { x = this.constraints.minX; }
+			if (y < this.constraints.minY) { y = this.constraints.minY; }
+			if (x > this.constraints.maxX) { x = this.constraints.maxX; }
+			if (y > this.constraints.maxY) { y = this.constraints.maxY; }
+		}
+
+		if(!this.disableY) { this.dragClone.style.top = y + "px"; }
+		if(!this.disableX) { this.dragClone.style.left = x + "px"; }
+
+        var pwGhost = jetspeed.ui.widget.pwGhost;
+
+        if ( this.windowTiling )
+        {
+            var colIndex = -1;
+            for ( var i = jetspeed.columns.length-1 ; i >= 0  ; i-- )
+            {
+                //dojo.debug( "PortletWindowDragMoveObject onDragMove: col[" + i + "] columnsX=" + this.columnsX[i] + " this.domNode.offsetWidth/2=" + (this.domNode.offsetWidth/2) + " x=" + x );
+                if ( ( x + ( this.domNode.offsetWidth / 2 ) ) >= this.columnsX[ i ] )
+                {
+                    colIndex = i;
+                    break;
+                }
+            }
+            var col = ( colIndex >= 0 ? jetspeed.columns[ colIndex ] : null );
+            //if ( col != null )
+            //    dojo.debug( "PortletWindowDragMoveObject onDragMove: col[" + colIndex + "] columnsX=" + this.columnsX[colIndex] + " this.domNode.offsetWidth=" + this.domNode.offsetWidth + " x=" + x );
+            //else
+            //    dojo.debug( "PortletWindowDragMoveObject onDragMove: no col  this.domNode.offsetWidth=" + this.domNode.offsetWidth + " x=" + x );
+            
+            if ( pwGhost.col != col )
+            {
+                dojo.dom.removeNode( pwGhost );
+				pwGhost.col = col;
+				col.appendChild(pwGhost);
+			}
+            
+            var portletWindowsResult = jetspeed.ui.getPortletWindowChildren( col, pwGhost );
+            var portletWindowsInCol = portletWindowsResult.portletWindowNodes;
+            
+            if ( portletWindowsInCol )
+            {
+                var ghostIndex = portletWindowsResult.matchIndex;
+                if ( ghostIndex > 0 )
+                {
+                    var yAboveWindow = dojo.style.getAbsoluteY( portletWindowsInCol[ ghostIndex -1 ], true );
+                    if ( y <= yAboveWindow )
+                    {
+                        dojo.debug( "onDragMove y <= yAbove [" + this.portletWindow.portlet.entityId + "] y=" + y + " yAboveWindow=" + yAboveWindow + " ghostIndex=" + ghostIndex );
+                        dojo.dom.removeNode( pwGhost );
+                        dojo.dom.insertBefore( pwGhost, portletWindowsInCol[ ghostIndex -1 ], true );
+                    }
+                    else
+                    {
+                        dojo.debug( "onDragMove noadjust y > yAbove [" + this.portletWindow.portlet.entityId + "] y=" + y + " yAboveWindow=" + yAboveWindow + " ghostIndex=" + ghostIndex );
+                    }
+                }
+                if ( ghostIndex != (portletWindowsInCol.length -1) )
+                {
+                    var yBelowWindow = dojo.style.getAbsoluteY( portletWindowsInCol[ ghostIndex +1 ], true );
+                    if ( y >= yBelowWindow )
+                    {
+                        dojo.debug( "onDragMove y >= yBelow [" + this.portletWindow.portlet.entityId + "] y=" + y + " yBelowWindow=" + yBelowWindow + " ghostIndex=" + ghostIndex );
+                        if ( ghostIndex + 2 < portletWindowsInCol.length )
+                            dojo.dom.insertBefore( pwGhost, portletWindowsInCol[ ghostIndex +2 ], true );
+                        else
+                            col.appendChild( pwGhost );
+                    }
+                    else
+                    {
+                        dojo.debug( "onDragMove noadjust y < yBelow [" + this.portletWindow.portlet.entityId + "] y=" + y + " yBelowWindow=" + yBelowWindow + " ghostIndex=" + ghostIndex );
+                    }
+                }
+            }
+        }
+    },
+	onDragEnd: function(e)
+    {
+        jetspeed.ui.widget.PortletWindowDragMoveObject.superclass.onDragEnd.call( this, e );
+        
+        //dojo.debug( "PortletWindowDragMoveObject [" + this.portletWindow.portlet.entityId + "] onDragEnd:  portletWindowNode.hasParent=" + dojo.dom.hasParent( this.domNode ) );
+
+        var pwGhost = jetspeed.ui.widget.pwGhost;
+        
+        if ( this.windowTiling )
+        {
+            if ( pwGhost && pwGhost.col )
+            {
+                dojo.dom.insertBefore( this.domNode, pwGhost, true );
+                dojo.dom.removeNode( pwGhost );
+            }
+            this.domNode.style.position = "static";
+        }
+        else
+        {
+            dojo.dom.removeNode( pwGhost );
+        }
+
+        jetspeed.ui.dumpPortletWindowsPerColumn();
+	}
 });

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/blueocean/css/styles.css
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/blueocean/css/styles.css?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/blueocean/css/styles.css (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/blueocean/css/styles.css Mon Apr 10 23:34:59 2006
@@ -22,7 +22,9 @@
 
 .blueocean .dojoFloatingPaneTitleBar {
     background: #B0C4DE;  /* lightsteelblue */
-    line-height: 1.4em;
+}
+
+.blueocean .dojoFloatingPaneTitleText {
 	color: #00368F;
 }
 

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/tigris/css/styles.css
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/tigris/css/styles.css?rev=393149&r1=393148&r2=393149&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/tigris/css/styles.css (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/windowthemes/tigris/css/styles.css Mon Apr 10 23:34:59 2006
@@ -22,7 +22,9 @@
 
 .tigris .dojoFloatingPaneTitleBar {
     background: #98FB98;    /* palegreen */ 
-    line-height: 1.4em;
+}
+
+.tigris .dojoFloatingPaneTitleText {
 	color: #4682B4;  /* steelblue */
 }
 



---------------------------------------------------------------------
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