portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r405130 [2/2] - in /portals/jetspeed-2/trunk/src/webapp: desktop-themes/blue/ desktop-themes/blue/css/ desktop-themes/tigris/ desktop-themes/tigris/css/ desktop-themes/tigris/images/ desktop-themes/tigris/images/tabs/ javascript/desktop/cor...
Date Mon, 08 May 2006 18:44:51 GMT
Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalAccordionContainer.js
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalAccordionContainer.js?rev=405130&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalAccordionContainer.js
(added)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalAccordionContainer.js
Mon May  8 11:44:48 2006
@@ -0,0 +1,145 @@
+dojo.provide("jetspeed.ui.widget.PortalAccordionContainer");
+dojo.provide("jetspeed.ui.widget.PortalMenuOptionLink");
+
+dojo.require("jetspeed.desktop.core");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.TabContainer");
+
+jetspeed.ui.widget.PortalAccordionContainer = function()
+{    
+    this.widgetType = "PortalAccordionContainer";
+    this.isContainer = true;
+    //this.templateString = '<div id="navcolumn"><table cellpadding="0" cellspacing="4"
border="0" width="100%"><tr><td><div dojoAttachPoint="containerNode" class="toolgroup"></div></td></tr></table></div>';
+    this.templateString = '<div dojoAttachPoint="containerNode" class="toolgroup"></div>';
+    dojo.widget.HtmlWidget.call(this);
+};
+
+dojo.inherits(jetspeed.ui.widget.PortalAccordionContainer, dojo.widget.HtmlWidget);
+
+dojo.lang.extend( jetspeed.ui.widget.PortalAccordionContainer,
+{
+    // dojo.widget.Widget create protocol
+    postMixInProperties: function( args, fragment, parentComp )
+    {
+        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getDesktopThemeRootUrl()
+ "/css/PortalAccordionContainer.css" ) ;
+        jetspeed.ui.widget.PortalAccordionContainer.superclass.postMixInProperties.call(
this, args, fragment, parentComp );
+    },
+    createAndAddPane: function( /* jetspeed.om.MenuOption */ labelMenuOption, accordionPaneProps
)
+    {
+        if ( ! accordionPaneProps )
+            accordionPaneProps = {};
+        if ( labelMenuOption )
+        {
+            accordionPaneProps.label = labelMenuOption.getText();
+            if ( labelMenuOption.getHidden() )
+                accordionPaneProps.open = false;
+            else
+                accordionPaneProps.open = true;
+            
+            accordionPaneProps.labelNodeClass = "label";
+            accordionPaneProps.containerNodeClass = "FolderList";
+            accordionPaneProps.templatePath = new dojo.uri.Uri( jetspeed.url.basePortalDesktopUrl()
+ "/javascript/desktop/widget/TitlePane.html" ) ;
+        }
+
+        var accordionPaneWidget = dojo.widget.createWidget( "PortalAccordionPane", accordionPaneProps
);
+        this.addChild( accordionPaneWidget );
+        return accordionPaneWidget;
+    },
+    addLinksToPane: function( accordionPaneWidget, /* Array */ menuOptions )
+    {
+        if ( ! menuOptions || ! accordionPaneWidget ) return;
+
+        var linkWidget;
+        for ( var i = 0; i < menuOptions.length; i++ )
+        {
+            linkWidget = dojo.widget.createWidget( "PortalMenuOptionLink", { menuOption:
menuOptions[i] } );
+            accordionPaneWidget.addChild( linkWidget );
+        }
+    },
+    createJetspeedMenu: function( /* jetspeed.om.Menu */ menuObj )
+    {
+        if ( ! menuObj ) return;
+        var menuOpts = menuObj.getOptions();
+        var currentLinkGroup = [], currentLinkGroupOpt = null, menuOption = null, menuOptIndex
= 0;
+        while ( currentLinkGroup != null )
+        {
+            menuOption = null;
+            if ( menuOptIndex < menuOpts.length )
+            {   // another one
+                menuOption = menuOpts[menuOptIndex];
+                
+                menuOptIndex++;
+            }
+            if ( menuOption == null || menuOption.isSeparator() )
+            {
+                if ( currentLinkGroup != null && currentLinkGroup.length > 0 )
+                {   // add pane
+                    var accordionPaneWidget = this.createAndAddPane( currentLinkGroupOpt
);
+                    this.addLinksToPane( accordionPaneWidget, currentLinkGroup );
+                }
+                currentLinkGroupOpt = null;
+                currentLinkGroup = null;
+                if ( menuOption != null )
+                {
+                    currentLinkGroupOpt = menuOption;
+                    currentLinkGroup = [];
+                }
+            }
+            else if ( menuOption.isLeaf() && menuOption.getUrl() )
+            {
+                currentLinkGroup.push( menuOption );
+            }
+        }        
+    }
+});
+
+
+jetspeed.ui.widget.PortalAccordionPane = function()
+{  
+    dojo.widget.html.AccordionPane.call(this);
+    this.widgetType = "PortalAccordionPane";
+};
+
+dojo.inherits( jetspeed.ui.widget.PortalAccordionPane, dojo.widget.html.AccordionPane );
+
+dojo.lang.extend( jetspeed.ui.widget.PortalAccordionPane,
+{
+    setSizes: function()
+    {
+        this.siblingWidgets = [];    // to keep label click from collapsing all siblings
+    }
+
+});
+
+jetspeed.ui.widget.PortalMenuOptionLink = function()
+{    
+	dojo.widget.HtmlWidget.call(this);
+    
+    this.widgetType = "PortalMenuOptionLink";
+    this.templateString = '<div dojoAttachPoint="containerNode"><a href="" dojoAttachPoint="menuOptionLinkNode"
dojoAttachEvent="onClick" class="Link"></a></div>';
+};
+dojo.inherits(jetspeed.ui.widget.PortalMenuOptionLink, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(jetspeed.ui.widget.PortalMenuOptionLink, {
+    fillInTemplate: function()
+    {
+		if ( this.iconSrc )
+        {
+			var img = document.createElement("img");
+			img.src = this.iconSrc;
+            this.menuOptionLinkNode.appendChild( img );
+		}
+        this.menuOptionLinkNode.href = this.menuOption.navigateUrl();
+		this.menuOptionLinkNode.appendChild( document.createTextNode( this.menuOption.getShortTitle()
) );
+		dojo.html.disableSelection( this.domNode );
+	},
+    onClick: function( evt )
+    {
+        this.menuOption.navigateTo();
+        dojo.event.browser.stopEvent( evt );
+	}
+});
+
+dojo.widget.tags.addParseTreeHandler("dojo:portalmenuoptionlink");
+dojo.widget.tags.addParseTreeHandler("dojo:portalaccordioncontainer");
+dojo.widget.tags.addParseTreeHandler("dojo:portalaccordionpane");

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalTabContainer.js
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalTabContainer.js?rev=405130&r1=405129&r2=405130&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalTabContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/PortalTabContainer.js Mon
May  8 11:44:48 2006
@@ -18,7 +18,7 @@
     // dojo.widget.Widget create protocol
     postMixInProperties: function( args, fragment, parentComp )
     {
-        this.templateCssPath = new dojo.uri.Uri( jetspeed.url.basePortalDesktopUrl() + "/javascript/desktop/widget/HtmlTabContainer.css"
) ;
+        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getDesktopThemeRootUrl()
+ "/css/PortalTabContainer.css" ) ;
         jetspeed.ui.widget.PortalTabContainer.superclass.postMixInProperties.call( this,
args, fragment, parentComp );
     },
     addTab: function( /* jetspeed.om.MenuOption */ menuOpt )
@@ -32,7 +32,7 @@
         tab.label = menuOpt.getShortTitle();
         this.addChild( tab );
         //dojo.debug( "PortalTabContainer.addTab" );
-        if ( jetspeed.page.isPageUrl( menuOpt.getUrl() ) )
+        if ( jetspeed.page.equalsPageUrl( menuOpt.getUrl() ) )
         {
             this.selectTab( tab );   // this.selectedTab
             this.selectedTab = null;  // to keep it from matching the fake widgets with no
widgetdI
@@ -44,7 +44,7 @@
         jetspeed.ui.widget.PortalTabContainer.superclass.selectTab.call( this, tab );
         //dojo.debug( "PortalTabContainer.selectTab " + tab.label);
         if ( ! this.js_addingTab )
-            jetspeed.menuNavClick( tab.menuOption );
+            tab.menuOption.navigateTo();
 	},
     _showTab: function( tab )
     {
@@ -56,7 +56,18 @@
 		dojo.html.removeClass( tab.div, "current" );
 		tab.selected=false;
 	},
-    createTabsFromMenu: function( /* jetspeed.om.Menu */ menuObj )
+    _doSizing: function()
+    {
+        // position the labels and the container node
+		var labelAlign=this.labelPosition.replace(/-h/,"");
+		var children = [
+			{domNode: this.dojoTabLabels, layoutAlign: labelAlign},
+			{domNode: this.containerNode, layoutAlign: "client"}
+		];
+		dojo.layout(this.domNode, children);
+    },
+
+    createJetspeedMenu: function( /* jetspeed.om.Menu */ menuObj )
     {
         if ( ! menuObj ) return;
         var menuOpts = menuObj.getOptions();

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=405130&r1=405129&r2=405130&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 May
 8 11:44:48 2006
@@ -30,7 +30,7 @@
         //    this.widgetId = jetspeed.id.TASKBAR;
 
         var tbProps = {};
-        tbProps.templateCssPath = new dojo.uri.Uri( jetspeed.url.basePortalDesktopUrl() +
"/javascript/desktop/widget/HtmlTaskBar.css" ) ;
+        tbProps.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getDesktopThemeRootUrl()
+ "/css/PortalTaskBar.css" ) ;
         tbProps.templatePath = new dojo.uri.Uri( jetspeed.url.basePortalDesktopUrl() + "/javascript/desktop/widget/HtmlTaskBarItemTemplate.html"
) ;
         // BOZO: improve this junk ^^^ 
 

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=405130&r1=405129&r2=405130&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 May
 8 11:44:48 2006
@@ -115,8 +115,12 @@
         {
             if ( this.portletWindowTheme )
                 windowtheme = this.portletWindowTheme;
-            else if ( jetspeed.debugPortletWindowThemes )
+            else if ( dojo.lang.indexOf( jetspeed.id.WINDOW_THEMES, jetspeed.page.getPortletDecorator()
) != -1 )
+                windowtheme = jetspeed.page.getPortletDecorator();
+            else if ( djConfig.isDebug && jetspeed.debugPortletWindowThemes )
                 windowtheme = jetspeed.debugPortletWindowThemes[ Math.floor( Math.random()
* jetspeed.debugPortletWindowThemes.length ) ];
+            else if ( jetspeed.id.WINDOW_THEMES )
+                windowtheme = jetspeed.id.WINDOW_THEMES[0];
         }
         this.portletWindowTheme = windowtheme ;
         var prevCssPath = ( this.templateCssPath == null ? null : this.templateCssPath.toString()
);
@@ -179,7 +183,7 @@
             // NOTE: portletWindowState.zIndex;  - should be dealt with in the creation order
         }
         else
-        {   
+        {
             portletWidth = this.getInitProperty( jetspeed.id.PORTLET_PROP_WIDTH );
             portletHeight = this.getInitProperty( jetspeed.id.PORTLET_PROP_HEIGHT );
             portletLeft = this.getInitProperty( jetspeed.id.PORTLET_PROP_LEFT );
@@ -417,6 +421,10 @@
             dojo.debug( "createdWindow [" + ( this.portlet ? this.portlet.entityId : this.widgetId
) + "]" + " width=" + this.domNode.style.width + " height=" + this.domNode.style.height +
" left=" + this.domNode.style.left + " top=" + this.domNode.style.top ) ;
 
         this.portletInitialized = true;
+
+        var initWindowState = this.getInitProperty( jetspeed.id.PORTLET_PROP_WINDOW_STATE
);
+        if ( initWindowState == "minimized" )
+            this.minimizeWindow();
     },
 
     isPortletWindowInitialized: function()
@@ -515,7 +523,7 @@
             dojo.style.getInnerHeight( document.body ) - yPos
 		);
 
-		this.windowState="maximized";
+		this.windowState ="maximized";
 	},
     bringToTop: function( evt )
     {
@@ -777,11 +785,11 @@
         var ppR = null;
         if ( this.portlet )
         {
-            ppR = this.portlet.preParseAnnotateHtml( initialHtmlStr );
+            ppR = this.portlet.preParseAnnotateHtml( initialHtmlStr, url );
         }
         else
         {
-            ppR = jetspeed.ui.preParseAnnotateHtml( initialHtmlStr );
+            ppR = jetspeed.ui.preParseAnnotateHtml( initialHtmlStr, url );
         }
         //this.executeScripts = true;
 

Added: portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/TitlePane.html
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/TitlePane.html?rev=405130&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/TitlePane.html (added)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/desktop/widget/TitlePane.html Mon May 
8 11:44:48 2006
@@ -0,0 +1,4 @@
+<div dojoAttachPoint="domNode">
+<div dojoAttachPoint="labelNode" dojoAttachEvent="onclick: onLabelClick"></div>
+<div class="body"><div dojoAttachPoint="containerNode"></div></div>
+</div>



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