portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smi...@apache.org
Subject svn commit: r547641 [4/5] - in /portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed: ./ desktop/ widget/
Date Fri, 15 Jun 2007 11:47:22 GMT
Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.js?view=diff&rev=547641&r1=547640&r2=547641
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PageEditor.js Fri Jun 15 04:47:21 2007
@@ -1,24 +1,4 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * author: Steve Milek
- */
-
 dojo.provide("jetspeed.widget.PageEditor");
-
 dojo.require("dojo.widget.*");
 dojo.require("dojo.io.*");
 dojo.require("dojo.event.*");
@@ -28,689 +8,473 @@
 dojo.require("dojo.widget.Select");
 dojo.require("dojo.widget.Button");
 dojo.require("dojo.widget.Spinner");
-
 dojo.require("dojo.html.common");
 dojo.require("dojo.html.display");
 dojo.require("jetspeed.widget.PageEditPane");
 dojo.require("jetspeed.widget.LayoutEditPane");
-
-jetspeed.widget.PageEditor = function()
-{
-}
-
-dojo.widget.defineWidget(
-	"jetspeed.widget.PageEditor",
-	dojo.widget.HtmlWidget,
-	{
-        // template parameters
-        deletePortletDialog: null,
-		deletePortletDialogBg: null,
-		deletePortletDialogFg: null,
-
-        deleteLayoutDialog: null,
-		deleteLayoutDialogBg: null,
-		deleteLayoutDialogFg: null,
-
-        columnSizeDialog: null,
-		columnSizeDialogBg: null,
-		columnSizeDialogFg: null,
-
-
-        detail: null,
-
-        
-        // fields
-        editorInitiatedFromDesktop: false,
-
-		isContainer: true,
-        widgetsInTemplate: true,
-
-
-        // protocol - dojo.widget.Widget create
-
-        postMixInProperties: function( args, fragment, parent )
-        {
-            jetspeed.widget.PageEditor.superclass.postMixInProperties.apply( this, arguments );
-
-            this.templateCssPath = new dojo.uri.Uri( jetspeed.url.basePortalDesktopUrl() + "/javascript/jetspeed/widget/PageEditor.css" ) ;
-            this.templatePath = new dojo.uri.Uri( jetspeed.url.basePortalDesktopUrl() + "/javascript/jetspeed/widget/PageEditor.html" ) ;
-        },
-
-        fillInTemplate: function( args, fragment )
-        {
-            var self = this;
-
-            this.deletePortletDialog = dojo.widget.createWidget( "dialog", { widgetsInTemplate: true, deletePortletConfirmed: function() { this.hide(); self.deletePortletConfirmed( this.portletEntityId ); } }, this.deletePortletDialog );
-			this.deletePortletDialog.setCloseControl( this.deletePortletDialog.deletePortletCancel.domNode );
-
-            this.deleteLayoutDialog = dojo.widget.createWidget( "dialog", { widgetsInTemplate: true, deleteLayoutConfirmed: function() { this.hide(); self.deleteLayoutConfirmed( this.portletEntityId ); } }, this.deleteLayoutDialog );
-			this.deleteLayoutDialog.setCloseControl( this.deleteLayoutDialog.deleteLayoutCancel.domNode );
-
-            var columnSizeParams = {};
-            columnSizeParams.widgetsInTemplate = true;
-            columnSizeParams.columnSizeConfirmed = function()
-            {
-                var columnSizesSum = 0;
-                var columnSizes = new Array();
-                for ( var i = 0 ; i < this.columnCount; i++ )
-                {
-                    var spinnerWidget = this[ "spinner" + i ];
-                    var colSize = new Number( spinnerWidget.getValue() );
-                    columnSizes.push( colSize );
-                    columnSizesSum += colSize;
-                }
-
-                if ( columnSizesSum > 100 )
-                {
-                    alert( "Sum of column sizes cannot exceed 100." );
-                }
-                else
-                {
-                    this.hide();
-                    self.columnSizeConfirmed( this.layoutId, columnSizes );
-                }
-            };
-
-            this.columnSizeDialog = dojo.widget.createWidget( "dialog", columnSizeParams, this.columnSizeDialog );
-            this.columnSizeDialog.setCloseControl( this.columnSizeDialog.columnSizeCancel.domNode );
-
-            jetspeed.widget.PageEditor.superclass.fillInTemplate.call( this );
-		},
-
-        postCreate: function( args, fragment, parent )
-        {
-            this.editPageInitiate();
-        },
-
-        // initialization
-        editPageInitiate: function()
-        {
-            var themesContentManager = null;
-            if ( this.editorInitiatedFromDesktop )
-                themesContentManager = new jetspeed.widget.EditPageGetThemesContentManager( this, false, false, true, true, true );
-            else
-                themesContentManager = new jetspeed.widget.EditPageGetThemesContentManager( this, true, true, true, false, false );
-            themesContentManager.getContent();
-        },
-        editPageBuild: function()
-        {
-            jetspeed.url.loadingIndicatorHide();
-
-            var layoutImagesUrl = jetspeed.prefs.getLayoutRootUrl() + "/images/desktop/"; 
-
-            var pageEditorWidgets = new Array();
-            var layoutEditPaneWidgets = new Array();
-            var pageEditPaneWidget = dojo.widget.createWidget( "jetspeed:PageEditPane", { layoutDecoratorDefinitions: jetspeed.page.themeDefinitions.pageDecorations, portletDecoratorDefinitions: jetspeed.page.themeDefinitions.portletDecorations, layoutImagesRoot: layoutImagesUrl } );
-            pageEditPaneWidget.pageEditorWidget = this;
-            dojo.dom.insertAfter( pageEditPaneWidget.domNode, this.domNode );
-            pageEditorWidgets.push( pageEditPaneWidget );
-
-            var rootLayoutEditPaneWidget = dojo.widget.createWidget( "jetspeed:LayoutEditPane", { widgetId: "layoutEdit_root", layoutId: jetspeed.page.rootFragmentId, isRootLayout: true, layoutDefinitions: jetspeed.page.themeDefinitions.layouts, layoutImagesRoot: layoutImagesUrl } );
-            rootLayoutEditPaneWidget.pageEditorWidget = this;
-            dojo.dom.insertAfter( rootLayoutEditPaneWidget.domNode, pageEditPaneWidget.domNode );
-            pageEditorWidgets.push( rootLayoutEditPaneWidget );
-            layoutEditPaneWidgets.push( rootLayoutEditPaneWidget );
-            
-            if ( jetspeed.prefs.windowTiling )
-            {
-                for ( var i = 0 ; i < jetspeed.page.columns.length; i++ )
-                {
-                    var col = jetspeed.page.columns[i];
-                    if ( col.layoutHeader )
-                    {
-                        var layoutEditPaneWidget = dojo.widget.createWidget( "jetspeed:LayoutEditPane", { widgetId: "layoutEdit_" + i, layoutId: col.layoutId, layoutDefinitions: jetspeed.page.themeDefinitions.layouts, layoutImagesRoot: layoutImagesUrl } );
-                        layoutEditPaneWidget.pageEditorWidget = this;
-                        if ( col.domNode.firstChild != null )
-                            col.domNode.insertBefore( layoutEditPaneWidget.domNode, col.domNode.firstChild );
-                        else
-                            col.domNode.appendChild( layoutEditPaneWidget.domNode );
-                        layoutEditPaneWidget.initializeDrag();
-                        pageEditorWidgets.push( layoutEditPaneWidget );
-                        layoutEditPaneWidgets.push( layoutEditPaneWidget );
-                    }
-                }
-            }
-            this.pageEditorWidgets = pageEditorWidgets;
-            this.layoutEditPaneWidgets = layoutEditPaneWidgets;
-            this.editPageSyncPortletActions();
-        },
-        editPageSyncPortletActions: function()
-        {
-            var portlets = jetspeed.page.getPortletArray()
-            if ( portlets != null )
-            {
-                for ( var i = 0 ; i < portlets.length ; i++ )
-                {
-                    portlets[i].syncActions();
-                }
-            }
-        },
-        editPageHide: function()
-        {
-            if ( this.pageEditorWidgets != null )
-            {
-                for ( var i = 0 ; i < this.pageEditorWidgets.length ; i++ )
-                {
-                    this.pageEditorWidgets[i].hide();
-                }
-            }
-            this.hide();
-            this.editPageSyncPortletActions();
-        },
-        editPageShow: function()
-        {
-            if ( this.pageEditorWidgets != null )
-            {
-                for ( var i = 0 ; i < this.pageEditorWidgets.length ; i++ )
-                {
-                    this.pageEditorWidgets[i].editModeRedisplay();
-                }
-            }
-            this.show();
-            this.editPageSyncPortletActions();
-        },
-
-
-        // methods
-
-        deletePortlet: function( portletEntityId, portletTitle )
-        {
-            this.deletePortletDialog.portletEntityId = portletEntityId;
-            this.deletePortletDialog.portletTitle = portletTitle;
-            this.deletePortletTitle.innerHTML = portletTitle;
-            this.deletePortletDialog.show();
-        },
-        deletePortletConfirmed: function( portletEntityId )
-        {
-            var removePortletContentManager = new jetspeed.widget.RemovePortletContentManager( portletEntityId, this );
-            removePortletContentManager.getContent();
-        },
-        deleteLayout: function( layoutId )
-        {
-            this.deleteLayoutDialog.layoutId = layoutId;
-            this.deleteLayoutDialog.layoutTitle = layoutId;
-            this.deleteLayoutTitle.innerHTML = layoutId;
-            this.deleteLayoutDialog.show();
-        },
-        deleteLayoutConfirmed: function()
-        {
-            var removePortletContentManager = new jetspeed.widget.RemoveLayoutContentManager( this.deleteLayoutDialog.layoutId, this );
-            removePortletContentManager.getContent();
-        },
-        openColumnSizesEditor: function( layoutId )
-        {
-            var currentLayout = null;
-            if ( layoutId != null )
-                currentLayout = jetspeed.page.layouts[ layoutId ];
-
-            if ( currentLayout != null && currentLayout.columnSizes != null && currentLayout.columnSizes.length > 0 )
-            {
-                var spinnerMax = 5;   // 5 is current max
-                var spinnerCount = 0;
-                for ( var i = 0 ; i < spinnerMax; i++ )
-                {
-                    var spinnerWidget = this.columnSizeDialog[ "spinner" + i ];
-                    var spinnerFieldDiv = this[ "spinner" + i + "Field" ];
-                    if ( i < currentLayout.columnSizes.length )
-                    {
-                        spinnerWidget.setValue( currentLayout.columnSizes[i] );
-                        spinnerFieldDiv.style.display = "block";
-                        spinnerWidget.show();
-                        spinnerCount++;
-                    }
-                    else
-                    {
-                        spinnerFieldDiv.style.display = "none";
-                        spinnerWidget.hide();
-                    }
-                }
-                this.columnSizeDialog.layoutId = layoutId;
-                this.columnSizeDialog.columnCount = spinnerCount;
-                this.columnSizeDialog.show();
-            }            
-        },
-        columnSizeConfirmed: function( layoutId, columnSizes )
-        {
-            if ( layoutId != null && columnSizes != null && columnSizes.length > 0 )
-            {   // layout name is currently required by updatepage/update-fragment
-                var currentLayout = jetspeed.page.layouts[ layoutId ];
-    
-                var currentLayoutName = null;
-                if ( currentLayout != null )
-                    currentLayoutName = currentLayout.name;
-
-                if ( currentLayoutName != null )
-                {
-                    var colSizesStr = "";
-                    for ( var i = 0 ; i < columnSizes.length ; i++ )
-                    {
-                        if ( i > 0 )
-                            colSizesStr += ",";
-                        colSizesStr += columnSizes[i] + "%";
-                    }
-                    var updateFragmentContentManager = new jetspeed.widget.UpdateFragmentContentManager( layoutId, currentLayoutName, colSizesStr, this );
-                    updateFragmentContentManager.getContent();
-                }
-            }
-        },
-
-        refreshPage: function()
-        {
-            dojo.lang.setTimeout( this, this._doRefreshPage, 10 );
-        },
-        _doRefreshPage: function()
-        {
-            var pageUrl = jetspeed.page.getPageUrl();
-            pageUrl = jetspeed.url.addQueryParameter( pageUrl, "editPage", "true", true );
-            window.location.href = pageUrl.toString();
-        },
-
-        editModeNormal: function()
-        {
-            // restore all portlets (that were not previously minimized)
-            var portletArray = jetspeed.page.getPortletArray();
-            for ( var i = 0; i < portletArray.length; i++ )
-            {
-                var portletWindow = portletArray[i].getPortletWindow();
-                if ( portletWindow != null )
-                {
-                    portletWindow.restoreFromMinimizeWindowTemporarily();
-                }
-            }
-            if ( this.layoutEditPaneWidgets != null )
-            {
-                for ( var i = 0 ; i < this.layoutEditPaneWidgets.length ; i++ )
-                {
-                    var lepWidget = this.layoutEditPaneWidgets[i];
-                    if ( lepWidget.layoutMoveContainer != null )
-                        lepWidget.layoutMoveContainer.domNode.style.display = "none";
-                }
-            }           
-        },
-        editModeLayoutMove: function()
-        {
-            // minimize all portlets
-            var portletArray = jetspeed.page.getPortletArray();
-            for ( var i = 0; i < portletArray.length; i++ )
-            {
-                var portletWindow = portletArray[i].getPortletWindow();
-                if ( portletWindow != null )
-                {
-                    portletWindow.minimizeWindowTemporarily();
-                }
-            }
-            // display layout-move-handle widget
-            if ( this.layoutEditPaneWidgets != null )
-            {
-                for ( var i = 0 ; i < this.layoutEditPaneWidgets.length ; i++ )
-                {
-                    var lepWidget = this.layoutEditPaneWidgets[i];
-                    if ( ! lepWidget.isRootLayout && lepWidget.layoutMoveContainer != null )
-                        lepWidget.layoutMoveContainer.domNode.style.display = "block"
-                }
-            }
-        }
-	}
-);
-
-
-// ... jetspeed.widget.EditPageGetThemesContentManager
-jetspeed.widget.EditPageGetThemesContentManager = function( pageEditorWidget, pageDecorations, portletDecorations, layouts, desktopPageDecorations, desktopPortletDecorations )
-{
-    this.pageEditorWidget = pageEditorWidget;
-    var getThemeTypes = new Array();
-    if ( pageDecorations )
-        getThemeTypes.push( [ "pageDecorations" ] );
-    if ( portletDecorations )
-        getThemeTypes.push( [ "portletDecorations" ] );
-    if ( layouts )
-        getThemeTypes.push( [ "layouts" ] );
-    if ( desktopPageDecorations )
-        getThemeTypes.push( [ "desktopPageDecorations", "pageDecorations" ] );
-    if ( desktopPortletDecorations )
-        getThemeTypes.push( [ "desktopPortletDecorations", "portletDecorations" ] );
-    this.getThemeTypes = getThemeTypes;
-    this.getThemeTypeNextIndex = 0;
-};
-jetspeed.widget.EditPageGetThemesContentManager.prototype =
-{
-    getContent: function()
-    {
-        if ( this.getThemeTypes != null && this.getThemeTypes.length > this.getThemeTypeNextIndex )
-        {
-            var queryString = "?action=getthemes&type=" + this.getThemeTypes[ this.getThemeTypeNextIndex ][0] + "&format=json";
-            var getThemesUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + queryString ;
-            var ajaxApiContext = new jetspeed.om.Id( "getthemes", { } );
-            var bindArgs = {};
-            bindArgs.url = getThemesUrl;
-            bindArgs.mimetype = "text/json";
-            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
-        }
-        else
-        {
-            this.pageEditorWidget.editPageBuild();
-        }
-    },
-    notifySuccess: function( /* JSON */ getThemesData, /* String */ requestUrl, domainModelObject )
-    {
-        if ( jetspeed.page.themeDefinitions == null )
-            jetspeed.page.themeDefinitions = {};
-        var themeDefKey = ( ( this.getThemeTypes[ this.getThemeTypeNextIndex ].length > 1 ) ? this.getThemeTypes[ this.getThemeTypeNextIndex ][1] : this.getThemeTypes[ this.getThemeTypeNextIndex ][0]);
-        jetspeed.page.themeDefinitions[ themeDefKey ] = getThemesData;
-        this.getThemeTypeNextIndex++;
-        this.getContent();
-    },
-    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, domainModelObject )
-    {
-        dojo.raise( "EditPageGetThemesContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
-    }
-};
-
-// ... jetspeed.widget.RemovePageContentManager
-jetspeed.widget.RemovePageContentManager = function( pageEditorWidget )
-{
-    this.pageEditorWidget = pageEditorWidget;    
-};
-jetspeed.widget.RemovePageContentManager.prototype =
-{
-    getContent: function()
-    {
-        var queryString = "?action=updatepage&method=remove";
-        var removePageUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
-        var ajaxApiContext = new jetspeed.om.Id( "updatepage-remove-page", { } );
-        var bindArgs = {};
-        bindArgs.url = removePageUrl;
-        bindArgs.mimetype = "text/xml";
-        jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
-    },
-    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "updatepage-remove-page" ) )
-        {
-            var pageUrl = jetspeed.page.makePageUrl( "/" );
-            pageUrl += "?" + jetspeed.id.PAGE_EDITOR_INITIATE_PARAMETER + "=true";
-            window.location.href = pageUrl;
-        }
-    },
-    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        dojo.raise( "RemovePageContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
-    }
-};
-
-// ... jetspeed.widget.AddPageContentManager
-jetspeed.widget.AddPageContentManager = function( pageRealPath, pagePath, pageName, layoutName, pageTitle, pageShortTitle, pageEditorWidget )
-{
-    this.pageRealPath = pageRealPath;
-    this.pagePath = pagePath;
-    this.pageName = pageName;
-    if ( layoutName == null )
-    {
-        if ( jetspeed.page.themeDefinitions != null && jetspeed.page.themeDefinitions.layouts != null && jetspeed.page.themeDefinitions.layouts.length > 0 && jetspeed.page.themeDefinitions.layouts[0] != null && jetspeed.page.themeDefinitions.layouts[0].length == 2 )
-            layoutName = jetspeed.page.themeDefinitions.layouts[0][1];
-    }
-    this.layoutName = layoutName;
-    this.pageTitle = pageTitle;
-    this.pageShortTitle = pageShortTitle;
-    this.pageEditorWidget = pageEditorWidget;    
-};
-jetspeed.widget.AddPageContentManager.prototype =
-{
-    getContent: function()
-    {
-        if ( this.pageRealPath != null && this.pageName != null )
-        {
-            var queryString = "?action=updatepage&method=add&path=" + escape( this.pageRealPath ) + "&name=" + escape( this.pageName );
-            if ( this.layoutName != null )
-                queryString += "&defaultLayout=" + escape( this.layoutName );
-            if ( this.pageTitle != null )
-                queryString += "&title=" + escape( this.pageTitle );
-            if ( this.pageShortTitle != null )
-                queryString += "&short-title=" + escape( this.pageShortTitle );
-            var addPageUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + queryString ;
-            var ajaxApiContext = new jetspeed.om.Id( "updatepage-add-page", { } );
-            var bindArgs = {};
-            bindArgs.url = addPageUrl;
-            bindArgs.mimetype = "text/xml";
-            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
-        }
-    },
-    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "updatepage-add-page" ) )
-        {
-            var pageUrl = jetspeed.page.makePageUrl( this.pagePath );
-            if ( ! dojo.string.endsWith( pageUrl, ".psml", true ) )
-                pageUrl += ".psml";
-            pageUrl += "?" + jetspeed.id.PAGE_EDITOR_INITIATE_PARAMETER + "=true";
-            window.location.href = pageUrl;
-        }
-    },
-    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        dojo.raise( "AddPageContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
-    }
-};
-
-
-// ... jetspeed.widget.MoveLayoutContentManager
-jetspeed.widget.MoveLayoutContentManager = function( layoutId, moveToLayoutId, column, row, pageEditorWidget )
-{
-    this.layoutId = layoutId;
-    this.moveToLayoutId = moveToLayoutId;
-    this.column = column;
-    this.row = row;
-    this.pageEditorWidget = pageEditorWidget;
-};
-jetspeed.widget.MoveLayoutContentManager.prototype =
-{
-    getContent: function()
-    {
-        if ( this.layoutId != null && this.moveToLayoutId != null )
-        {
-            var queryString = "?action=moveabs&id=" + this.layoutId + "&layoutid=" + this.moveToLayoutId;
-            if ( this.column != null )
-                queryString += "&col=" + this.column;
-            if ( this.row != null )
-                queryString += "&row=" + this.row;
-            var psmlMoveActionUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
-            var ajaxApiContext = new jetspeed.om.Id( "moveabs-layout", this.layoutId );
-            var bindArgs = {};
-            bindArgs.url = psmlMoveActionUrl;
-            bindArgs.mimetype = "text/xml";
-            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
-        }
-    },
-    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "moveabs-layout" ) )
-        {
-            
-        }
-    },
-    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        dojo.raise( "MoveLayoutContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
-    }
-};
-
-// ... jetspeed.widget.UpdateFragmentContentManager
-jetspeed.widget.UpdateFragmentContentManager = function( layoutId, layoutName, layoutSizes, pageEditorWidget )
-{
-    this.layoutId = layoutId;
-    this.layoutName = layoutName;
-    this.layoutSizes = layoutSizes;
-    this.pageEditorWidget = pageEditorWidget;
-};
-jetspeed.widget.UpdateFragmentContentManager.prototype =
-{
-    getContent: function()
-    {
-        if ( this.layoutId != null )
-        {
-            var queryString = "?action=updatepage&method=update-fragment&id=" + this.layoutId;
-            if ( this.layoutName != null )
-                queryString += "&layout=" + escape( this.layoutName );
-            if ( this.layoutSizes != null )
-                queryString += "&sizes=" + escape( this.layoutSizes );
-            var updatePageUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
-            var ajaxApiContext = new jetspeed.om.Id( "updatepage-update-fragment", { } );
-            var bindArgs = {};
-            bindArgs.url = updatePageUrl;
-            bindArgs.mimetype = "text/xml";
-            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
-        }
-    },
-    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "updatepage-update-fragment" ) )
-        {
-            this.pageEditorWidget.refreshPage();
-        }
-    },
-    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        dojo.raise( "UpdateFragmentContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
-    }
-};
-
-// ... jetspeed.widget.UpdateFragmentContentManager
-jetspeed.widget.UpdatePageInfoContentManager = function( layoutDecorator, portletDecorator, pageEditorWidget )
-{
-    this.refreshPage = ( ( pageEditorWidget.editorInitiatedFromDesktop ) ? true : false ) ;
-    this.layoutDecorator = layoutDecorator;
-    this.portletDecorator = portletDecorator;
-    this.pageEditorWidget = pageEditorWidget;
-};
-jetspeed.widget.UpdatePageInfoContentManager.prototype =
-{
-    getContent: function()
-    {
-        var queryString = "?action=updatepage&method=info";
-        if ( this.layoutDecorator != null )
-            queryString += "&layout-decorator=" + escape( this.layoutDecorator );
-        if ( this.portletDecorator != null )
-            queryString += "&portlet-decorator=" + escape( this.portletDecorator );
-        var updatePageUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
-        var ajaxApiContext = new jetspeed.om.Id( "updatepage-info", { } );
-        var bindArgs = {};
-        bindArgs.url = updatePageUrl;
-        bindArgs.mimetype = "text/xml";
-        jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
-    },
-    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "updatepage-info" ) )
-        {
-            if ( this.refreshPage )
-                this.pageEditorWidget.refreshPage();
-        }
-    },
-    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        dojo.raise( "UpdatePageInfoContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
-    }
-};
-
-// ... jetspeed.widget.RemovePortletContentManager
-jetspeed.widget.RemovePortletContentManager = function( portletEntityId, pageEditorWidget )
-{
-    this.portletEntityId = portletEntityId;
-    this.pageEditorWidget = pageEditorWidget;
-};
-jetspeed.widget.RemovePortletContentManager.prototype =
-{
-    getContent: function()
-    {
-        if ( this.portletEntityId != null )
-        {
-            var queryString = "?action=remove&id=" + this.portletEntityId;
-            var removePortletUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
-            var ajaxApiContext = new jetspeed.om.Id( "removeportlet", { } );
-            var bindArgs = {};
-            bindArgs.url = removePortletUrl;
-            bindArgs.mimetype = "text/xml";
-            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
-        }
-    },
-    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "removeportlet" ) )
-        {
-            this.pageEditorWidget.refreshPage();
-        }
-    },
-    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        dojo.raise( "RemovePortletContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
-    }
-};
-
-// ... jetspeed.widget.RemoveLayoutContentManager
-jetspeed.widget.RemoveLayoutContentManager = function( layoutId, pageEditorWidget )
-{
-    this.layoutId = layoutId;
-    this.pageEditorWidget = pageEditorWidget;
-};
-jetspeed.widget.RemoveLayoutContentManager.prototype =
-{
-    getContent: function()
-    {
-        if ( this.layoutId != null )
-        {
-            var queryString = "?action=updatepage&method=remove-fragment&id=" + this.layoutId;
-            var removeLayoutUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
-            var ajaxApiContext = new jetspeed.om.Id( "removelayout", { } );
-            var bindArgs = {};
-            bindArgs.url = removeLayoutUrl;
-            bindArgs.mimetype = "text/xml";
-            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
-        }
-    },
-    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "removeportlet" ) )
-        {
-            this.pageEditorWidget.refreshPage();
-        }
-    },
-    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        dojo.raise( "RemoveLayoutContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
-    }
-};
-
-// ... jetspeed.widget.AddLayoutContentManager
-jetspeed.widget.AddLayoutContentManager = function( parentLayoutId, layoutName, pageEditorWidget )
-{
-    this.parentLayoutId = parentLayoutId;
-    this.layoutName = layoutName;
-    this.pageEditorWidget = pageEditorWidget;
-};
-jetspeed.widget.AddLayoutContentManager.prototype =
-{
-    getContent: function()
-    {
-        if ( this.parentLayoutId != null )
-        {
-            var queryString = "?action=updatepage&method=add-fragment&layoutid=" + this.parentLayoutId + ( this.layoutName != null ? ( "&layout=" + this.layoutName ) : "" );
-            var addLayoutUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.AJAX_API + jetspeed.page.getPath() + queryString ;
-            var ajaxApiContext = new jetspeed.om.Id( "addlayout", { } );
-            var bindArgs = {};
-            bindArgs.url = addLayoutUrl;
-            bindArgs.mimetype = "text/xml";
-            jetspeed.url.retrieveContent( bindArgs, this, ajaxApiContext, jetspeed.debugContentDumpIds );
-        }
-    },
-    notifySuccess: function( /* XMLDocument */ data, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        if ( jetspeed.url.checkAjaxApiResponse( requestUrl, data, true, "addportlet" ) )
-        {
-            this.pageEditorWidget.refreshPage();
-        }
-    },
-    notifyFailure: function( /* String */ type, /* Object */ error, /* String */ requestUrl, /* Portlet */ portlet )
-    {
-        dojo.raise( "AddLayoutContentManager notifyFailure url: " + requestUrl + " type: " + type + jetspeed.url.formatBindError( error ) );
-    }
+jetspeed.widget.PageEditor=function(){
 };
+dojo.widget.defineWidget("jetspeed.widget.PageEditor",dojo.widget.HtmlWidget,{deletePortletDialog:null,deletePortletDialogBg:null,deletePortletDialogFg:null,deleteLayoutDialog:null,deleteLayoutDialogBg:null,deleteLayoutDialogFg:null,columnSizeDialog:null,columnSizeDialogBg:null,columnSizeDialogFg:null,detail:null,editorInitiatedFromDesktop:false,isContainer:true,widgetsInTemplate:true,postMixInProperties:function(_1,_2,_3){
+jetspeed.widget.PageEditor.superclass.postMixInProperties.apply(this,arguments);
+this.templateCssPath=new dojo.uri.Uri(jetspeed.url.basePortalDesktopUrl()+"/javascript/jetspeed/widget/PageEditor.css");
+this.templatePath=new dojo.uri.Uri(jetspeed.url.basePortalDesktopUrl()+"/javascript/jetspeed/widget/PageEditor.html");
+},fillInTemplate:function(_4,_5){
+var _6=this;
+this.deletePortletDialog=dojo.widget.createWidget("dialog",{widgetsInTemplate:true,deletePortletConfirmed:function(){
+this.hide();
+_6.deletePortletConfirmed(this.portletEntityId);
+}},this.deletePortletDialog);
+this.deletePortletDialog.setCloseControl(this.deletePortletDialog.deletePortletCancel.domNode);
+this.deleteLayoutDialog=dojo.widget.createWidget("dialog",{widgetsInTemplate:true,deleteLayoutConfirmed:function(){
+this.hide();
+_6.deleteLayoutConfirmed(this.portletEntityId);
+}},this.deleteLayoutDialog);
+this.deleteLayoutDialog.setCloseControl(this.deleteLayoutDialog.deleteLayoutCancel.domNode);
+var _7={};
+_7.widgetsInTemplate=true;
+_7.columnSizeConfirmed=function(){
+var _8=0;
+var _9=new Array();
+for(var i=0;i<this.columnCount;i++){
+var _b=this["spinner"+i];
+var _c=new Number(_b.getValue());
+_9.push(_c);
+_8+=_c;
+}
+if(_8>100){
+alert("Sum of column sizes cannot exceed 100.");
+}else{
+this.hide();
+_6.columnSizeConfirmed(this.layoutId,_9);
+}
+};
+this.columnSizeDialog=dojo.widget.createWidget("dialog",_7,this.columnSizeDialog);
+this.columnSizeDialog.setCloseControl(this.columnSizeDialog.columnSizeCancel.domNode);
+jetspeed.widget.PageEditor.superclass.fillInTemplate.call(this);
+},postCreate:function(_d,_e,_f){
+this.editPageInitiate();
+},editPageInitiate:function(){
+var _10=null;
+if(this.editorInitiatedFromDesktop){
+_10=new jetspeed.widget.EditPageGetThemesContentManager(this,false,false,true,true,true);
+}else{
+_10=new jetspeed.widget.EditPageGetThemesContentManager(this,true,true,true,false,false);
+}
+_10.getContent();
+},editPageBuild:function(){
+jetspeed.url.loadingIndicatorHide();
+var _11=jetspeed.prefs.getLayoutRootUrl()+"/images/desktop/";
+var _12=new Array();
+var _13=new Array();
+var _14=dojo.widget.createWidget("jetspeed:PageEditPane",{layoutDecoratorDefinitions:jetspeed.page.themeDefinitions.pageDecorations,portletDecoratorDefinitions:jetspeed.page.themeDefinitions.portletDecorations,layoutImagesRoot:_11});
+_14.pageEditorWidget=this;
+dojo.dom.insertAfter(_14.domNode,this.domNode);
+_12.push(_14);
+var _15=dojo.widget.createWidget("jetspeed:LayoutEditPane",{widgetId:"layoutEdit_root",layoutId:jetspeed.page.rootFragmentId,isRootLayout:true,layoutDefinitions:jetspeed.page.themeDefinitions.layouts,layoutImagesRoot:_11});
+_15.pageEditorWidget=this;
+dojo.dom.insertAfter(_15.domNode,_14.domNode);
+_12.push(_15);
+_13.push(_15);
+if(jetspeed.prefs.windowTiling){
+for(var i=0;i<jetspeed.page.columns.length;i++){
+var col=jetspeed.page.columns[i];
+if(col.layoutHeader){
+var _18=dojo.widget.createWidget("jetspeed:LayoutEditPane",{widgetId:"layoutEdit_"+i,layoutId:col.layoutId,layoutDefinitions:jetspeed.page.themeDefinitions.layouts,layoutImagesRoot:_11});
+_18.pageEditorWidget=this;
+if(col.domNode.firstChild!=null){
+col.domNode.insertBefore(_18.domNode,col.domNode.firstChild);
+}else{
+col.domNode.appendChild(_18.domNode);
+}
+_18.initializeDrag();
+_12.push(_18);
+_13.push(_18);
+}
+}
+}
+this.pageEditorWidgets=_12;
+this.layoutEditPaneWidgets=_13;
+this.editPageSyncPortletActions();
+},editPageSyncPortletActions:function(){
+var _19=jetspeed.page.getPortletArray();
+if(_19!=null){
+for(var i=0;i<_19.length;i++){
+_19[i].syncActions();
+}
+}
+},editPageHide:function(){
+if(this.pageEditorWidgets!=null){
+for(var i=0;i<this.pageEditorWidgets.length;i++){
+this.pageEditorWidgets[i].hide();
+}
+}
+this.hide();
+this.editPageSyncPortletActions();
+},editPageShow:function(){
+if(this.pageEditorWidgets!=null){
+for(var i=0;i<this.pageEditorWidgets.length;i++){
+this.pageEditorWidgets[i].editModeRedisplay();
+}
+}
+this.show();
+this.editPageSyncPortletActions();
+},deletePortlet:function(_1d,_1e){
+this.deletePortletDialog.portletEntityId=_1d;
+this.deletePortletDialog.portletTitle=_1e;
+this.deletePortletTitle.innerHTML=_1e;
+this.deletePortletDialog.show();
+},deletePortletConfirmed:function(_1f){
+var _20=new jetspeed.widget.RemovePortletContentManager(_1f,this);
+_20.getContent();
+},deleteLayout:function(_21){
+this.deleteLayoutDialog.layoutId=_21;
+this.deleteLayoutDialog.layoutTitle=_21;
+this.deleteLayoutTitle.innerHTML=_21;
+this.deleteLayoutDialog.show();
+},deleteLayoutConfirmed:function(){
+var _22=new jetspeed.widget.RemoveLayoutContentManager(this.deleteLayoutDialog.layoutId,this);
+_22.getContent();
+},openColumnSizesEditor:function(_23){
+var _24=null;
+if(_23!=null){
+_24=jetspeed.page.layouts[_23];
+}
+if(_24!=null&&_24.columnSizes!=null&&_24.columnSizes.length>0){
+var _25=5;
+var _26=0;
+for(var i=0;i<_25;i++){
+var _28=this.columnSizeDialog["spinner"+i];
+var _29=this["spinner"+i+"Field"];
+if(i<_24.columnSizes.length){
+_28.setValue(_24.columnSizes[i]);
+_29.style.display="block";
+_28.show();
+_26++;
+}else{
+_29.style.display="none";
+_28.hide();
+}
+}
+this.columnSizeDialog.layoutId=_23;
+this.columnSizeDialog.columnCount=_26;
+this.columnSizeDialog.show();
+}
+},columnSizeConfirmed:function(_2a,_2b){
+if(_2a!=null&&_2b!=null&&_2b.length>0){
+var _2c=jetspeed.page.layouts[_2a];
+var _2d=null;
+if(_2c!=null){
+_2d=_2c.name;
+}
+if(_2d!=null){
+var _2e="";
+for(var i=0;i<_2b.length;i++){
+if(i>0){
+_2e+=",";
+}
+_2e+=_2b[i]+"%";
+}
+var _30=new jetspeed.widget.UpdateFragmentContentManager(_2a,_2d,_2e,this);
+_30.getContent();
+}
+}
+},refreshPage:function(){
+dojo.lang.setTimeout(this,this._doRefreshPage,10);
+},_doRefreshPage:function(){
+var _31=jetspeed.page.getPageUrl();
+_31=jetspeed.url.addQueryParameter(_31,"editPage","true",true);
+window.location.href=_31.toString();
+},editModeNormal:function(){
+var _32=jetspeed.page.getPortletArray();
+for(var i=0;i<_32.length;i++){
+var _34=_32[i].getPortletWindow();
+if(_34!=null){
+_34.restoreFromMinimizeWindowTemporarily();
+}
+}
+if(this.layoutEditPaneWidgets!=null){
+for(var i=0;i<this.layoutEditPaneWidgets.length;i++){
+var _35=this.layoutEditPaneWidgets[i];
+if(_35.layoutMoveContainer!=null){
+_35.layoutMoveContainer.domNode.style.display="none";
+}
+}
+}
+},editModeLayoutMove:function(){
+var _36=jetspeed.page.getPortletArray();
+for(var i=0;i<_36.length;i++){
+var _38=_36[i].getPortletWindow();
+if(_38!=null){
+_38.minimizeWindowTemporarily();
+}
+}
+if(this.layoutEditPaneWidgets!=null){
+for(var i=0;i<this.layoutEditPaneWidgets.length;i++){
+var _39=this.layoutEditPaneWidgets[i];
+if(!_39.isRootLayout&&_39.layoutMoveContainer!=null){
+_39.layoutMoveContainer.domNode.style.display="block";
+}
+}
+}
+}});
+jetspeed.widget.EditPageGetThemesContentManager=function(_3a,_3b,_3c,_3d,_3e,_3f){
+this.pageEditorWidget=_3a;
+var _40=new Array();
+if(_3b){
+_40.push(["pageDecorations"]);
+}
+if(_3c){
+_40.push(["portletDecorations"]);
+}
+if(_3d){
+_40.push(["layouts"]);
+}
+if(_3e){
+_40.push(["desktopPageDecorations","pageDecorations"]);
+}
+if(_3f){
+_40.push(["desktopPortletDecorations","portletDecorations"]);
+}
+this.getThemeTypes=_40;
+this.getThemeTypeNextIndex=0;
+};
+jetspeed.widget.EditPageGetThemesContentManager.prototype={getContent:function(){
+if(this.getThemeTypes!=null&&this.getThemeTypes.length>this.getThemeTypeNextIndex){
+var _41="?action=getthemes&type="+this.getThemeTypes[this.getThemeTypeNextIndex][0]+"&format=json";
+var _42=jetspeed.url.basePortalUrl()+jetspeed.url.path.AJAX_API+_41;
+var _43=new jetspeed.om.Id("getthemes",{});
+var _44={};
+_44.url=_42;
+_44.mimetype="text/json";
+jetspeed.url.retrieveContent(_44,this,_43,jetspeed.debugContentDumpIds);
+}else{
+this.pageEditorWidget.editPageBuild();
+}
+},notifySuccess:function(_45,_46,_47){
+if(jetspeed.page.themeDefinitions==null){
+jetspeed.page.themeDefinitions={};
+}
+var _48=((this.getThemeTypes[this.getThemeTypeNextIndex].length>1)?this.getThemeTypes[this.getThemeTypeNextIndex][1]:this.getThemeTypes[this.getThemeTypeNextIndex][0]);
+jetspeed.page.themeDefinitions[_48]=_45;
+this.getThemeTypeNextIndex++;
+this.getContent();
+},notifyFailure:function(_49,_4a,_4b,_4c){
+dojo.raise("EditPageGetThemesContentManager notifyFailure url: "+_4b+" type: "+_49+jetspeed.url.formatBindError(_4a));
+}};
+jetspeed.widget.RemovePageContentManager=function(_4d){
+this.pageEditorWidget=_4d;
+};
+jetspeed.widget.RemovePageContentManager.prototype={getContent:function(){
+var _4e="?action=updatepage&method=remove";
+var _4f=jetspeed.url.basePortalUrl()+jetspeed.url.path.AJAX_API+jetspeed.page.getPath()+_4e;
+var _50=new jetspeed.om.Id("updatepage-remove-page",{});
+var _51={};
+_51.url=_4f;
+_51.mimetype="text/xml";
+jetspeed.url.retrieveContent(_51,this,_50,jetspeed.debugContentDumpIds);
+},notifySuccess:function(_52,_53,_54){
+if(jetspeed.url.checkAjaxApiResponse(_53,_52,true,"updatepage-remove-page")){
+var _55=jetspeed.page.makePageUrl("/");
+_55+="?"+jetspeed.id.PAGE_EDITOR_INITIATE_PARAMETER+"=true";
+window.location.href=_55;
+}
+},notifyFailure:function(_56,_57,_58,_59){
+dojo.raise("RemovePageContentManager notifyFailure url: "+_58+" type: "+_56+jetspeed.url.formatBindError(_57));
+}};
+jetspeed.widget.AddPageContentManager=function(_5a,_5b,_5c,_5d,_5e,_5f,_60){
+this.pageRealPath=_5a;
+this.pagePath=_5b;
+this.pageName=_5c;
+if(_5d==null){
+if(jetspeed.page.themeDefinitions!=null&&jetspeed.page.themeDefinitions.layouts!=null&&jetspeed.page.themeDefinitions.layouts.length>0&&jetspeed.page.themeDefinitions.layouts[0]!=null&&jetspeed.page.themeDefinitions.layouts[0].length==2){
+_5d=jetspeed.page.themeDefinitions.layouts[0][1];
+}
+}
+this.layoutName=_5d;
+this.pageTitle=_5e;
+this.pageShortTitle=_5f;
+this.pageEditorWidget=_60;
+};
+jetspeed.widget.AddPageContentManager.prototype={getContent:function(){
+if(this.pageRealPath!=null&&this.pageName!=null){
+var _61="?action=updatepage&method=add&path="+escape(this.pageRealPath)+"&name="+escape(this.pageName);
+if(this.layoutName!=null){
+_61+="&defaultLayout="+escape(this.layoutName);
+}
+if(this.pageTitle!=null){
+_61+="&title="+escape(this.pageTitle);
+}
+if(this.pageShortTitle!=null){
+_61+="&short-title="+escape(this.pageShortTitle);
+}
+var _62=jetspeed.url.basePortalUrl()+jetspeed.url.path.AJAX_API+_61;
+var _63=new jetspeed.om.Id("updatepage-add-page",{});
+var _64={};
+_64.url=_62;
+_64.mimetype="text/xml";
+jetspeed.url.retrieveContent(_64,this,_63,jetspeed.debugContentDumpIds);
+}
+},notifySuccess:function(_65,_66,_67){
+if(jetspeed.url.checkAjaxApiResponse(_66,_65,true,"updatepage-add-page")){
+var _68=jetspeed.page.makePageUrl(this.pagePath);
+if(!dojo.string.endsWith(_68,".psml",true)){
+_68+=".psml";
+}
+_68+="?"+jetspeed.id.PAGE_EDITOR_INITIATE_PARAMETER+"=true";
+window.location.href=_68;
+}
+},notifyFailure:function(_69,_6a,_6b,_6c){
+dojo.raise("AddPageContentManager notifyFailure url: "+_6b+" type: "+_69+jetspeed.url.formatBindError(_6a));
+}};
+jetspeed.widget.MoveLayoutContentManager=function(_6d,_6e,_6f,row,_71){
+this.layoutId=_6d;
+this.moveToLayoutId=_6e;
+this.column=_6f;
+this.row=row;
+this.pageEditorWidget=_71;
+};
+jetspeed.widget.MoveLayoutContentManager.prototype={getContent:function(){
+if(this.layoutId!=null&&this.moveToLayoutId!=null){
+var _72="?action=moveabs&id="+this.layoutId+"&layoutid="+this.moveToLayoutId;
+if(this.column!=null){
+_72+="&col="+this.column;
+}
+if(this.row!=null){
+_72+="&row="+this.row;
+}
+var _73=jetspeed.url.basePortalUrl()+jetspeed.url.path.AJAX_API+jetspeed.page.getPath()+_72;
+var _74=new jetspeed.om.Id("moveabs-layout",this.layoutId);
+var _75={};
+_75.url=_73;
+_75.mimetype="text/xml";
+jetspeed.url.retrieveContent(_75,this,_74,jetspeed.debugContentDumpIds);
+}
+},notifySuccess:function(_76,_77,_78){
+if(jetspeed.url.checkAjaxApiResponse(_77,_76,true,"moveabs-layout")){
+}
+},notifyFailure:function(_79,_7a,_7b,_7c){
+dojo.raise("MoveLayoutContentManager notifyFailure url: "+_7b+" type: "+_79+jetspeed.url.formatBindError(_7a));
+}};
+jetspeed.widget.UpdateFragmentContentManager=function(_7d,_7e,_7f,_80){
+this.layoutId=_7d;
+this.layoutName=_7e;
+this.layoutSizes=_7f;
+this.pageEditorWidget=_80;
+};
+jetspeed.widget.UpdateFragmentContentManager.prototype={getContent:function(){
+if(this.layoutId!=null){
+var _81="?action=updatepage&method=update-fragment&id="+this.layoutId;
+if(this.layoutName!=null){
+_81+="&layout="+escape(this.layoutName);
+}
+if(this.layoutSizes!=null){
+_81+="&sizes="+escape(this.layoutSizes);
+}
+var _82=jetspeed.url.basePortalUrl()+jetspeed.url.path.AJAX_API+jetspeed.page.getPath()+_81;
+var _83=new jetspeed.om.Id("updatepage-update-fragment",{});
+var _84={};
+_84.url=_82;
+_84.mimetype="text/xml";
+jetspeed.url.retrieveContent(_84,this,_83,jetspeed.debugContentDumpIds);
+}
+},notifySuccess:function(_85,_86,_87){
+if(jetspeed.url.checkAjaxApiResponse(_86,_85,true,"updatepage-update-fragment")){
+this.pageEditorWidget.refreshPage();
+}
+},notifyFailure:function(_88,_89,_8a,_8b){
+dojo.raise("UpdateFragmentContentManager notifyFailure url: "+_8a+" type: "+_88+jetspeed.url.formatBindError(_89));
+}};
+jetspeed.widget.UpdatePageInfoContentManager=function(_8c,_8d,_8e){
+this.refreshPage=((_8e.editorInitiatedFromDesktop)?true:false);
+this.layoutDecorator=_8c;
+this.portletDecorator=_8d;
+this.pageEditorWidget=_8e;
+};
+jetspeed.widget.UpdatePageInfoContentManager.prototype={getContent:function(){
+var _8f="?action=updatepage&method=info";
+if(this.layoutDecorator!=null){
+_8f+="&layout-decorator="+escape(this.layoutDecorator);
+}
+if(this.portletDecorator!=null){
+_8f+="&portlet-decorator="+escape(this.portletDecorator);
+}
+var _90=jetspeed.url.basePortalUrl()+jetspeed.url.path.AJAX_API+jetspeed.page.getPath()+_8f;
+var _91=new jetspeed.om.Id("updatepage-info",{});
+var _92={};
+_92.url=_90;
+_92.mimetype="text/xml";
+jetspeed.url.retrieveContent(_92,this,_91,jetspeed.debugContentDumpIds);
+},notifySuccess:function(_93,_94,_95){
+if(jetspeed.url.checkAjaxApiResponse(_94,_93,true,"updatepage-info")){
+if(this.refreshPage){
+this.pageEditorWidget.refreshPage();
+}
+}
+},notifyFailure:function(_96,_97,_98,_99){
+dojo.raise("UpdatePageInfoContentManager notifyFailure url: "+_98+" type: "+_96+jetspeed.url.formatBindError(_97));
+}};
+jetspeed.widget.RemovePortletContentManager=function(_9a,_9b){
+this.portletEntityId=_9a;
+this.pageEditorWidget=_9b;
+};
+jetspeed.widget.RemovePortletContentManager.prototype={getContent:function(){
+if(this.portletEntityId!=null){
+var _9c="?action=remove&id="+this.portletEntityId;
+var _9d=jetspeed.url.basePortalUrl()+jetspeed.url.path.AJAX_API+jetspeed.page.getPath()+_9c;
+var _9e=new jetspeed.om.Id("removeportlet",{});
+var _9f={};
+_9f.url=_9d;
+_9f.mimetype="text/xml";
+jetspeed.url.retrieveContent(_9f,this,_9e,jetspeed.debugContentDumpIds);
+}
+},notifySuccess:function(_a0,_a1,_a2){
+if(jetspeed.url.checkAjaxApiResponse(_a1,_a0,true,"removeportlet")){
+this.pageEditorWidget.refreshPage();
+}
+},notifyFailure:function(_a3,_a4,_a5,_a6){
+dojo.raise("RemovePortletContentManager notifyFailure url: "+_a5+" type: "+_a3+jetspeed.url.formatBindError(_a4));
+}};
+jetspeed.widget.RemoveLayoutContentManager=function(_a7,_a8){
+this.layoutId=_a7;
+this.pageEditorWidget=_a8;
+};
+jetspeed.widget.RemoveLayoutContentManager.prototype={getContent:function(){
+if(this.layoutId!=null){
+var _a9="?action=updatepage&method=remove-fragment&id="+this.layoutId;
+var _aa=jetspeed.url.basePortalUrl()+jetspeed.url.path.AJAX_API+jetspeed.page.getPath()+_a9;
+var _ab=new jetspeed.om.Id("removelayout",{});
+var _ac={};
+_ac.url=_aa;
+_ac.mimetype="text/xml";
+jetspeed.url.retrieveContent(_ac,this,_ab,jetspeed.debugContentDumpIds);
+}
+},notifySuccess:function(_ad,_ae,_af){
+if(jetspeed.url.checkAjaxApiResponse(_ae,_ad,true,"removeportlet")){
+this.pageEditorWidget.refreshPage();
+}
+},notifyFailure:function(_b0,_b1,_b2,_b3){
+dojo.raise("RemoveLayoutContentManager notifyFailure url: "+_b2+" type: "+_b0+jetspeed.url.formatBindError(_b1));
+}};
+jetspeed.widget.AddLayoutContentManager=function(_b4,_b5,_b6){
+this.parentLayoutId=_b4;
+this.layoutName=_b5;
+this.pageEditorWidget=_b6;
+};
+jetspeed.widget.AddLayoutContentManager.prototype={getContent:function(){
+if(this.parentLayoutId!=null){
+var _b7="?action=updatepage&method=add-fragment&layoutid="+this.parentLayoutId+(this.layoutName!=null?("&layout="+this.layoutName):"");
+var _b8=jetspeed.url.basePortalUrl()+jetspeed.url.path.AJAX_API+jetspeed.page.getPath()+_b7;
+var _b9=new jetspeed.om.Id("addlayout",{});
+var _ba={};
+_ba.url=_b8;
+_ba.mimetype="text/xml";
+jetspeed.url.retrieveContent(_ba,this,_b9,jetspeed.debugContentDumpIds);
+}
+},notifySuccess:function(_bb,_bc,_bd){
+if(jetspeed.url.checkAjaxApiResponse(_bc,_bb,true,"addportlet")){
+this.pageEditorWidget.refreshPage();
+}
+},notifyFailure:function(_be,_bf,_c0,_c1){
+dojo.raise("AddLayoutContentManager notifyFailure url: "+_c0+" type: "+_be+jetspeed.url.formatBindError(_bf));
+}};
+

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js?view=diff&rev=547641&r1=547640&r2=547641
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalAccordionContainer.js Fri Jun 15 04:47:21 2007
@@ -1,147 +1,100 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * author: Steve Milek
- */
+dojo.provide("jetspeed.widget.PortalAccordionContainer");
+dojo.provide("jetspeed.widget.PortalMenuOptionLink");
+dojo.require("jetspeed.desktop.core");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.AccordionContainer");
+jetspeed.widget.PortalAccordionContainer=function(){
+this.widgetType="PortalAccordionContainer";
+this.isContainer=true;
+this.templateString="<div dojoAttachPoint=\"containerNode\" class=\"toolgroup\"></div>";
+dojo.widget.HtmlWidget.call(this);
+};
+dojo.inherits(jetspeed.widget.PortalAccordionContainer,dojo.widget.HtmlWidget);
+dojo.lang.extend(jetspeed.widget.PortalAccordionContainer,{postMixInProperties:function(_1,_2,_3){
+this.templateCssPath=new dojo.uri.Uri(jetspeed.prefs.getLayoutRootUrl()+"/css/PortalAccordionContainer.css");
+jetspeed.widget.PortalAccordionContainer.superclass.postMixInProperties.call(this,_1,_2,_3);
+},createAndAddPane:function(_4,_5){
+if(!_5){
+_5={};
+}
+if(_4){
+_5.label=_4.getText();
+if(_4.getHidden()){
+_5.open=false;
+}else{
+_5.open=true;
+}
+_5.labelNodeClass="label";
+_5.containerNodeClass="FolderList";
+_5.templatePath=new dojo.uri.Uri(jetspeed.url.basePortalDesktopUrl()+"/javascript/jetspeed/widget/TitlePane.html");
+_5.allowCollapse=false;
+}
+var _6=dojo.widget.createWidget("AccordionPane",_5);
+this.addChild(_6);
+return _6;
+},addLinksToPane:function(_7,_8){
+if(!_8||!_7){
+return;
+}
+var _9;
+for(var i=0;i<_8.length;i++){
+_9=dojo.widget.createWidget("jetspeed:PortalMenuOptionLink",{menuOption:_8[i]});
+_7.addChild(_9);
+}
+},createJetspeedMenu:function(_b){
+if(!_b){
+return;
+}
+var _c=_b.getOptions();
+var _d=[],_e=null,_f=null,_10=0;
+while(_d!=null){
+_f=null;
+if(_10<_c.length){
+_f=_c[_10];
+_10++;
+}
+if(_f==null||_f.isSeparator()){
+if(_d!=null&&_d.length>0){
+var _11=this.createAndAddPane(_e);
+this.addLinksToPane(_11,_d);
+}
+_e=null;
+_d=null;
+if(_f!=null){
+_e=_f;
+_d=[];
+}
+}else{
+if(_f.isLeaf()&&_f.getUrl()){
+_d.push(_f);
+}
+}
+}
+}});
+jetspeed.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.widget.PortalMenuOptionLink,dojo.widget.HtmlWidget);
+dojo.lang.extend(jetspeed.widget.PortalMenuOptionLink,{fillInTemplate:function(){
+if(this.menuOption.type=="page"){
+this.menuOptionLinkNode.className="LinkPage";
+}else{
+if(this.menuOption.type=="folder"){
+this.menuOptionLinkNode.className="LinkFolder";
+}
+}
+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.provide("jetspeed.widget.PortalAccordionContainer");
-dojo.provide("jetspeed.widget.PortalMenuOptionLink");
-
-dojo.require("jetspeed.desktop.core");
-dojo.require("dojo.widget.*");
-dojo.require("dojo.widget.AccordionContainer");
-
-jetspeed.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.widget.PortalAccordionContainer, dojo.widget.HtmlWidget);
-
-dojo.lang.extend( jetspeed.widget.PortalAccordionContainer,
-{
-    // dojo.widget.Widget create protocol
-    postMixInProperties: function( args, fragment, parentComp )
-    {
-        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getLayoutRootUrl() + "/css/PortalAccordionContainer.css" ) ;
-        jetspeed.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/jetspeed/widget/TitlePane.html" ) ;
-            accordionPaneProps.allowCollapse = false;
-        }
-    
-        var accordionPaneWidget = dojo.widget.createWidget( "AccordionPane", 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( "jetspeed: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.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.widget.PortalMenuOptionLink, dojo.widget.HtmlWidget);
-
-dojo.lang.extend(jetspeed.widget.PortalMenuOptionLink, {
-    fillInTemplate: function()
-    {
-        if ( this.menuOption.type == "page" )
-            this.menuOptionLinkNode.className = "LinkPage";
-        else if ( this.menuOption.type == "folder" )
-            this.menuOptionLinkNode.className = "LinkFolder";
-		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 );
-	}
-});

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js?view=diff&rev=547641&r1=547640&r2=547641
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalBreadcrumbContainer.js Fri Jun 15 04:47:21 2007
@@ -1,140 +1,84 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * author: Steve Milek
- */
+dojo.provide("jetspeed.widget.PortalBreadcrumbContainer");
+dojo.provide("jetspeed.widget.PortalBreadcrumbLink");
+dojo.provide("jetspeed.widget.PortalBreadcrumbLinkSeparator");
+dojo.require("jetspeed.desktop.core");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.TabContainer");
+jetspeed.widget.PortalBreadcrumbContainer=function(){
+this.widgetType="PortalBreadcrumbContainer";
+this.isContainer=true;
+dojo.widget.HtmlWidget.call(this);
+};
+dojo.inherits(jetspeed.widget.PortalBreadcrumbContainer,dojo.widget.HtmlWidget);
+dojo.lang.extend(jetspeed.widget.PortalBreadcrumbContainer,{postMixInProperties:function(_1,_2,_3){
+this.templateCssPath=new dojo.uri.Uri(jetspeed.prefs.getLayoutRootUrl()+"/css/PortalBreadcrumbContainer.css");
+this.templatePath=new dojo.uri.dojoUri(jetspeed.prefs.getLayoutRootUrl()+"/templates/PortalBreadcrumbContainer.html");
+jetspeed.widget.PortalBreadcrumbContainer.superclass.postMixInProperties.call(this,_1,_2,_3);
+},fillInTemplate:function(_4,_5){
+var _6=this.getFragNodeRef(_5);
+dojo.html.copyStyle(this.domNode,_6);
+jetspeed.widget.PortalBreadcrumbContainer.superclass.fillInTemplate.apply(this,arguments);
+},createJetspeedMenu:function(_7){
+if(!_7){
+return;
+}
+var _8=_7.getOptions();
+var _9=[],_a=null;
+for(var i=0;i<_8.length;i++){
+_a=_8[i];
+if(_a!=null&&!_a.isSeparator()){
+_9.push(_a);
+}
+}
+if(_9!=null&&_9.length>0){
+var _c,_d;
+var _e=_9.length;
+for(var i=0;i<_e;i++){
+if(i>0){
+_d=dojo.widget.createWidget("jetspeed:PortalBreadcrumbLinkSeparator");
+this.containerNode.appendChild(_d.domNode);
+}
+if(i==(_e-1)){
+var _f=document.createElement("span");
+_f.appendChild(document.createTextNode(_9[i].getShortTitle()));
+this.containerNode.appendChild(_f);
+}else{
+_c=dojo.widget.createWidget("jetspeed:PortalBreadcrumbLink",{menuOption:_9[i]});
+this.containerNode.appendChild(_c.domNode);
+}
+}
+}
+}});
+jetspeed.widget.PortalBreadcrumbLink=function(){
+dojo.widget.HtmlWidget.call(this);
+this.widgetType="PortalBreadcrumbLink";
+this.templateString="<span dojoAttachPoint=\"containerNode\"><a href=\"\" dojoAttachPoint=\"menuOptionLinkNode\" dojoAttachEvent=\"onClick\" class=\"Link\"></a></span>";
+};
+dojo.inherits(jetspeed.widget.PortalBreadcrumbLink,dojo.widget.HtmlWidget);
+dojo.lang.extend(jetspeed.widget.PortalBreadcrumbLink,{fillInTemplate:function(){
+if(this.menuOption.type=="page"){
+this.menuOptionLinkNode.className="LinkPage";
+}else{
+if(this.menuOption.type=="folder"){
+this.menuOptionLinkNode.className="LinkFolder";
+}
+}
+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);
+}});
+jetspeed.widget.PortalBreadcrumbLinkSeparator=function(){
+dojo.widget.HtmlWidget.call(this);
+this.widgetType="PortalBreadcrumbLinkSeparator";
+this.templatePath=new dojo.uri.dojoUri(jetspeed.prefs.getLayoutRootUrl()+"/templates/PortalBreadcrumbLinkSeparator.html");
+};
+dojo.inherits(jetspeed.widget.PortalBreadcrumbLinkSeparator,dojo.widget.HtmlWidget);
 
-dojo.provide("jetspeed.widget.PortalBreadcrumbContainer");
-dojo.provide("jetspeed.widget.PortalBreadcrumbLink");
-dojo.provide("jetspeed.widget.PortalBreadcrumbLinkSeparator");
-
-dojo.require("jetspeed.desktop.core");
-dojo.require("dojo.widget.*");
-dojo.require("dojo.widget.TabContainer");
-
-jetspeed.widget.PortalBreadcrumbContainer = function()
-{    
-    this.widgetType = "PortalBreadcrumbContainer";
-    this.isContainer = true;
-
-    //this.templateString = '<div id="breadcrumbs"><div dojoAttachPoint="containerNode" class="FolderList"></div><div id="jetspeedPageControls"></div></div>';
-    //this.templateString = '<div dojoAttachPoint="containerNode" class="toolgroup"></div>';
-    dojo.widget.HtmlWidget.call(this);
-};
-
-dojo.inherits(jetspeed.widget.PortalBreadcrumbContainer, dojo.widget.HtmlWidget);
-
-dojo.lang.extend( jetspeed.widget.PortalBreadcrumbContainer,
-{
-    // dojo.widget.Widget create protocol
-    postMixInProperties: function( args, fragment, parentComp )
-    {
-        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getLayoutRootUrl() + "/css/PortalBreadcrumbContainer.css" ) ;
-        this.templatePath = new dojo.uri.dojoUri( jetspeed.prefs.getLayoutRootUrl() + "/templates/PortalBreadcrumbContainer.html");
-        jetspeed.widget.PortalBreadcrumbContainer.superclass.postMixInProperties.call( this, args, fragment, parentComp );
-    },
-
-    // dojo.widget.Widget create protocol
-    fillInTemplate: function( args, frag )
-    {
-		// Copy style info from input node to output node
-		var source = this.getFragNodeRef( frag );
-		dojo.html.copyStyle( this.domNode, source );
-		jetspeed.widget.PortalBreadcrumbContainer.superclass.fillInTemplate.apply( this, arguments );
-	},
-
-    createJetspeedMenu: function( /* jetspeed.om.Menu */ menuObj )
-    {
-        if ( ! menuObj ) return;
-        var menuOpts = menuObj.getOptions();
-        var breadcrumbLinks = [], menuOption = null;
-        for ( var i = 0 ; i < menuOpts.length ; i++ )
-        {
-            menuOption = menuOpts[ i ];
-            if ( menuOption != null && ! menuOption.isSeparator() )
-            {
-                breadcrumbLinks.push( menuOption );
-            }
-        }
-        if ( breadcrumbLinks != null && breadcrumbLinks.length > 0 )
-        {
-            var linkWidget, linkSepWidget;
-            var bcLen = breadcrumbLinks.length;
-            for ( var i = 0 ; i < bcLen ; i++ )
-            {
-                if ( i > 0 )
-                {
-                    linkSepWidget = dojo.widget.createWidget( "jetspeed:PortalBreadcrumbLinkSeparator" );
-                    this.containerNode.appendChild( linkSepWidget.domNode );
-                }
-                if ( i == (bcLen -1) )
-                {
-                    var currentLinkNode = document.createElement( "span" );
-                    currentLinkNode.appendChild( document.createTextNode( breadcrumbLinks[i].getShortTitle() ) );
-                    this.containerNode.appendChild( currentLinkNode );
-                }
-                else
-                {
-                    linkWidget = dojo.widget.createWidget( "jetspeed:PortalBreadcrumbLink", { menuOption: breadcrumbLinks[i] } );
-                    this.containerNode.appendChild( linkWidget.domNode );
-                }
-            }
-        }        
-    }
-});
-
-jetspeed.widget.PortalBreadcrumbLink = function()
-{    
-	dojo.widget.HtmlWidget.call(this);
-    
-    this.widgetType = "PortalBreadcrumbLink";
-    this.templateString = '<span dojoAttachPoint="containerNode"><a href="" dojoAttachPoint="menuOptionLinkNode" dojoAttachEvent="onClick" class="Link"></a></span>';
-};
-dojo.inherits(jetspeed.widget.PortalBreadcrumbLink, dojo.widget.HtmlWidget);
-
-dojo.lang.extend(jetspeed.widget.PortalBreadcrumbLink, {
-    fillInTemplate: function()
-    {
-        if ( this.menuOption.type == "page" )
-            this.menuOptionLinkNode.className = "LinkPage";
-        else if ( this.menuOption.type == "folder" )
-            this.menuOptionLinkNode.className = "LinkFolder";
-		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 );
-	}
-});
-
-
-jetspeed.widget.PortalBreadcrumbLinkSeparator = function()
-{    
-	dojo.widget.HtmlWidget.call(this);
-    
-    this.widgetType = "PortalBreadcrumbLinkSeparator";
-    this.templatePath = new dojo.uri.dojoUri( jetspeed.prefs.getLayoutRootUrl() + "/templates/PortalBreadcrumbLinkSeparator.html");
-};
-dojo.inherits(jetspeed.widget.PortalBreadcrumbLinkSeparator, dojo.widget.HtmlWidget);

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js?view=diff&rev=547641&r1=547640&r2=547641
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/widget/PortalTabContainer.js Fri Jun 15 04:47:21 2007
@@ -1,150 +1,68 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * author: Steve Milek
- */
-
-dojo.provide("jetspeed.widget.PortalTabContainer");
-
-dojo.require("jetspeed.desktop.core");
-dojo.require("dojo.widget.*");
-dojo.require("dojo.widget.TabContainer");
-
-jetspeed.widget.PortalTabContainer = function()
-{    
-    this.widgetType = "PortalTabContainer";
-    this.js_addingTab = false;
-    this.doLayout = false;    // to keep base class from conducting certain layout behavior (not sure if needed?)
-    this.selectedChildWidget = true;   // to keep base class code from setting first tab as selected
-    this.tabsadded = 0;
-    dojo.widget.TabContainer.call( this );
-};
-
-dojo.inherits(jetspeed.widget.PortalTabContainer, dojo.widget.TabContainer);
-
-dojo.lang.extend( jetspeed.widget.PortalTabContainer,
-{
-    // dojo.widget.Widget create protocol
-    postMixInProperties: function( args, fragment, parentComp )
-    {
-        this.templateCssPath = new dojo.uri.Uri( jetspeed.prefs.getLayoutRootUrl() + "/css/PortalTabContainer.css" ) ;
-        jetspeed.widget.PortalTabContainer.superclass.postMixInProperties.call( this, args, fragment, parentComp );
-    },
-    // dojo.widget.Widget create protocol
-    postCreate: function( args, fragment, parentComp )
-    {
-        jetspeed.widget.PortalTabContainer.superclass.postCreate.call( this, args, fragment, parentComp );
-        
-        this.contextMenuCreate();
-    },
-    addTab: function( /* jetspeed.om.MenuOption */ menuOpt )
-    {
-        if ( ! menuOpt ) return;
-        this.js_addingTab = true;
-        var tabDomNode = document.createElement( "div" );
-        var tab = new dojo.widget.HtmlWidget();   // create a fake widget so that widget.addedTo doesn't bomb when we call this.addChild() below
-        tab.domNode = tabDomNode;
-        tab.menuOption = menuOpt;
-        tab.label = menuOpt.getShortTitle();
-        tab.closable = false;
-        tab.widgetId = this.widgetId + "-tab-" + this.tabsadded;   // to make toString of these widgets a useful hash key (this.tablist.pane2button)
-        this.tabsadded++;
-        this.addChild( tab );
-        //dojo.debug( "PortalTabContainer.addTab" );
-        if ( jetspeed.page.equalsPageUrl( menuOpt.getUrl() ) )
-        {
-            this.selectChild( tab );
-        }
-        this.js_addingTab = false;
-    },
-    _setupChild: function(page){
-		// Summary: Add the given child to this page container
-
-		//page.hide();
-
-		// publish the addChild event for panes added via addChild(), and the original panes too
-		dojo.event.topic.publish(this.widgetId+"-addChild", page);
-	},
-    selectChild: function( tab, _noRefresh )
-    {
-        //jetspeed.widget.PortalTabContainer.superclass.selectTab.call( this, tab );
-        
-        if(this.tablist._currentChild){
-            var oldButton=this.tablist.pane2button[this.tablist._currentChild];
-            oldButton.clearSelected();
-        }
-        var newButton=this.tablist.pane2button[tab];
-        newButton.setSelected();
-        this.tablist._currentChild=tab;
-
-        if ( ! this.js_addingTab && ! _noRefresh )
-        {
-            tab.menuOption.navigateTo();
-        }
-	},
-
-    _showChild: function(page) {
-		// size the current page (in case this is the first time it's being shown, or I have been resized)
-		//if(this.doLayout){
-		//	var content = dojo.html.getContentBox(this.containerNode);
-		//	page.resizeTo(content.width, content.height);
-		//}
-
-		page.selected=true;
-		//page.show();
-	},
-
-	_hideChild: function(page) {
-		page.selected=false;
-		//page.hide();
-	},
-
-    createJetspeedMenu: function( /* jetspeed.om.Menu */ menuObj )
-    {
-        if ( ! menuObj ) return;
-        var menuOpts = menuObj.getOptions();
-        for ( var i = 0 ; i < menuOpts.length ; i++ )
-        {
-            var menuOption = menuOpts[i];
-            if ( menuOption.isLeaf() && menuOption.getUrl() && ! menuOption.isSeparator() )
-            {
-                this.addTab( menuOption );
-            }
-        }
-    },
-    contextMenuCreate: function()
-    {
-        //var taskBarContextMenu = dojo.widget.createWidget( "PopupMenu2", { id: "jstc_menu", targetNodeIds: [ this.domNode.id ], contextMenuForWindow: false }, null );
-        //var resetLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item1", caption: "Reset Window Layout"} );
-        //var freeFormLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item2", caption: "Free Flowing Layout"} );
-        //var twoColummLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item3", caption: "Two Column Layout"} );
-        //var threeColummLayoutMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item4", caption: "Three Column Layout"} );
-        //var openPortletSelectorMenuItem = dojo.widget.createWidget( "MenuItem2", { id: "jstc_menu_item5", caption: "Portlet Selector"} );
-        
-        //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(); } );
-        //dojo.event.connect( openPortletSelectorMenuItem, "onClick", function(e) { jetspeed.loadPortletSelector(); } );
-        //taskBarContextMenu.addChild( resetLayoutMenuItem );
-        //taskBarContextMenu.addChild( freeFormLayoutMenuItem );
-        //taskBarContextMenu.addChild( twoColummLayoutMenuItem );
-        //taskBarContextMenu.addChild( threeColummLayoutMenuItem );
-        //taskBarContextMenu.addChild( openPortletSelectorMenuItem );
-        //document.body.appendChild( taskBarContextMenu.domNode );
-    }
-});
+dojo.provide("jetspeed.widget.PortalTabContainer");
+dojo.require("jetspeed.desktop.core");
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.TabContainer");
+jetspeed.widget.PortalTabContainer=function(){
+this.widgetType="PortalTabContainer";
+this.js_addingTab=false;
+this.doLayout=false;
+this.selectedChildWidget=true;
+this.tabsadded=0;
+dojo.widget.TabContainer.call(this);
+};
+dojo.inherits(jetspeed.widget.PortalTabContainer,dojo.widget.TabContainer);
+dojo.lang.extend(jetspeed.widget.PortalTabContainer,{postMixInProperties:function(_1,_2,_3){
+this.templateCssPath=new dojo.uri.Uri(jetspeed.prefs.getLayoutRootUrl()+"/css/PortalTabContainer.css");
+jetspeed.widget.PortalTabContainer.superclass.postMixInProperties.call(this,_1,_2,_3);
+},postCreate:function(_4,_5,_6){
+jetspeed.widget.PortalTabContainer.superclass.postCreate.call(this,_4,_5,_6);
+this.contextMenuCreate();
+},addTab:function(_7){
+if(!_7){
+return;
+}
+this.js_addingTab=true;
+var _8=document.createElement("div");
+var _9=new dojo.widget.HtmlWidget();
+_9.domNode=_8;
+_9.menuOption=_7;
+_9.label=_7.getShortTitle();
+_9.closable=false;
+_9.widgetId=this.widgetId+"-tab-"+this.tabsadded;
+this.tabsadded++;
+this.addChild(_9);
+if(jetspeed.page.equalsPageUrl(_7.getUrl())){
+this.selectChild(_9);
+}
+this.js_addingTab=false;
+},_setupChild:function(_a){
+dojo.event.topic.publish(this.widgetId+"-addChild",_a);
+},selectChild:function(_b,_c){
+if(this.tablist._currentChild){
+var _d=this.tablist.pane2button[this.tablist._currentChild];
+_d.clearSelected();
+}
+var _e=this.tablist.pane2button[_b];
+_e.setSelected();
+this.tablist._currentChild=_b;
+if(!this.js_addingTab&&!_c){
+_b.menuOption.navigateTo();
+}
+},_showChild:function(_f){
+_f.selected=true;
+},_hideChild:function(_10){
+_10.selected=false;
+},createJetspeedMenu:function(_11){
+if(!_11){
+return;
+}
+var _12=_11.getOptions();
+for(var i=0;i<_12.length;i++){
+var _14=_12[i];
+if(_14.isLeaf()&&_14.getUrl()&&!_14.isSeparator()){
+this.addTab(_14);
+}
+}
+},contextMenuCreate:function(){
+}});
 



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