Author: smilek
Date: Sun Feb 25 20:15:38 2007
New Revision: 511717

URL: http://svn.apache.org/viewvc?view=rev&rev=511717
Log:
added page path to render and action urls; added common jetspeed.url.addPath 
function

Modified:
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js
    portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js

Modified: portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js?view=diff&rev=511717&r1=511716&r2=511717
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js (original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/common.js Sun Feb 
25 20:15:38 2007
@@ -410,7 +410,42 @@
         jetspeed.url.pathInitialize();
     return jetspeed.url.basePortalUrl() + jetspeed.url.path.JETSPEED ;
 };
-
+jetspeed.url.addPath = function( url, path )
+{
+    if ( path == null || path.length == 0 )
+        return url;
+    var modUri = new jetspeed.url.JSUri( url );
+    var origPath = modUri.path;
+    if ( origPath != null && origPath.length > 0 )
+    {
+        if ( modUri.path.charCodeAt( origPath.length -1 ) == 47 )
+        {
+            if ( path.charCodeAt( 0 ) == 47 )
+            {
+                if ( path.length > 1 )
+                    modUri.path += path.substring( 1 );
+            }
+            else
+            {
+                modUri.path += path;
+            }
+        }
+        else
+        {
+            if ( path.charCodeAt( 0 ) == 47 )
+            {
+                modUri.path += path;
+            }
+            else
+            {
+                if ( path.length > 1 )
+                    modUri.path += "/" + path;
+            }
+        }
+    }
+    var urlObj = jetspeed.url.parse( modUri );
+    return urlObj.toString();
+};
 jetspeed.url.validateUrlStartsWithHttp = function( url )
 {
     if ( url )

Modified: 
portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js?view=diff&rev=511717&r1=511716&r2=511717
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js 
(original)
+++ portals/jetspeed-2/trunk/src/webapp/javascript/jetspeed/desktop/core.js Sun 
Feb 25 20:15:38 2007
@@ -180,7 +180,7 @@
 jetspeed.debug =
 {
     pageLoad: true,
-    retrievePsml: true,
+    retrievePsml: false,
     setPortletContent: false,
     doRenderDoAction: false,
     postParseAnnotateHtml: false,
@@ -3037,7 +3037,7 @@
                 modUrl = formAction + queryString;
         }
         if ( modUrl == null )
-            modUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.PORTLET 
+ queryString;
+            modUrl = jetspeed.url.basePortalUrl() + jetspeed.url.path.PORTLET 
+ jetspeed.page.getPath() + queryString;
         if ( bindArgs )
             bindArgs.url = modUrl;
         return modUrl;
@@ -3186,8 +3186,11 @@
         var action = this.getAction( actionName );
         if ( action == null ) return;
         if ( action.url == null ) return;
-        var renderActionUrl = jetspeed.url.basePortalUrl() + 
jetspeed.url.path.PORTLET + "/" + action.url;
-        this.retrieveContent( null, { url: renderActionUrl } );
+        var renderActionUrl = jetspeed.url.basePortalUrl() + 
jetspeed.url.path.PORTLET + jetspeed.page.getPath() + "/" + action.url;
+        if ( actionName != jetspeed.id.ACTION_NAME_PRINT )
+            this.retrieveContent( null, { url: renderActionUrl } );
+        //else
+        //    window.open( renderActionUrl, "jsportlet_print", 
"status,scrollbars,resizable" );
     },
     getAction: function( name )
     {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to