You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ge...@apache.org on 2010/05/17 08:41:01 UTC

svn commit: r944984 - in /geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes: navigation.jsp portlets-only.jsp portlets-with-tree.jsp

Author: genspring
Date: Mon May 17 06:41:00 2010
New Revision: 944984

URL: http://svn.apache.org/viewvc?rev=944984&view=rev
Log:
fix ajax history problem for web console

Modified:
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-only.jsp
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp

Modified: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp?rev=944984&r1=944983&r2=944984&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp (original)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp Mon May 17 06:41:00 2010
@@ -64,6 +64,7 @@ limitations under the License.
 </div>
 
 
+
 <script type="text/javascript">
 
 <%-- scripts to create the navigation tree--%>
@@ -172,10 +173,9 @@ function load() {
         if(document.location.href.indexOf(iframeHref)==0){      
             iframeHref=document.location.href.substring(0,document.location.href.indexOf("?"));
         }
-    
-        document.getElementById("portletsFrame").src = iframeHref+"?formId="+formID;
-        setTimeout('returnToTop()', 30);
-
+        
+        dojo.io.iframe.setSrc(document.getElementById("portletsFrame"), iframeHref+"?formId="+formID, true);
+        setTimeout('returnToTop()', 30);      
      }
      
     function returnToTop(){

Modified: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-only.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-only.jsp?rev=944984&r1=944983&r2=944984&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-only.jsp (original)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-only.jsp Mon May 17 06:41:00 2010
@@ -31,7 +31,11 @@ limitations under the License.
 
 <script type="text/javascript">
     if(parent){
+       
+        if(!(parent.location.hash=="#noxssPage=<c:out value="${hashOfCurrentPortalPage}"/>"))
         parent.location.hash="#noxssPage=<c:out value="${hashOfCurrentPortalPage}"/>";
+        <!--window.parent.dojo.hash("#noxssPage=<c:out value='${hashOfCurrentPortalPage}'/>",true);-->
+        
     }
 </script>
 </body>

Modified: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp?rev=944984&r1=944983&r2=944984&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp (original)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/portlets-with-tree.jsp Mon May 17 06:41:00 2010
@@ -37,22 +37,34 @@ recogonize a hash change when users clic
 
 dojo.require("dojo.hash");
 dojo.require("dojox.collections.Dictionary");
+dojo.require("dojo.io.iframe");
 
 var hash_iframeSrc_map= new dojox.collections.Dictionary;
 
+dojo.subscribe("/dojo/hashchange", this, this.onHashChange);
 
 function onHashChange(current_hash) {
 
-    if(current_hash&&!hash_iframeSrc_map.containsKey(current_hash)){
-
-        hash_iframeSrc_map.add(current_hash,document.getElementById("portletsFrame").src);
+    if(!current_hash||current_hash.length==0) return;
+    
+    var currentIframeHref=document.getElementById("portletsFrame").contentWindow.location.href;
+    
+    if(hash_iframeSrc_map.containsKey(current_hash)){
+    
+        var HrefForCurrentHash=hash_iframeSrc_map.entry(current_hash).value;
+    
+        if(HrefForCurrentHash==currentIframeHref) return;
 
+        dojo.io.iframe.setSrc(document.getElementById("portletsFrame"), hash_iframeSrc_map.entry(current_hash).value, true);
+    
     } else {
-        document.getElementById("portletsFrame").src=""+hash_iframeSrc_map.entry(current_hash).value;
+    
+        hash_iframeSrc_map.add(current_hash,currentIframeHref);
+       
     }
 }
 
-dojo.subscribe("/dojo/hashchange", this, this.onHashChange);
+
 
 
 </script>