You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by jk...@apache.org on 2006/10/18 00:53:03 UTC

svn commit: r465091 - in /tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry: html/ pages/

Author: jkuhnert
Date: Tue Oct 17 15:53:03 2006
New Revision: 465091

URL: http://svn.apache.org/viewvc?view=rev&rev=465091
Log:
Cleaned up exception pages so that UI doesn't look quite as ugly by default. (which was my fault after the hide/show 
work done on exception blocks originally). 

Also made shown/hidden block css styling more intuitive looking.

Changed logic of ExceptionDisplay so that the last exception in the array is the "selected/shown" block 
by default. (as the innermost nested exceptions are usually the root cause of most issues )

Modified:
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.html
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.jwc
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RequestDisplay.html
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.css
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleLink.html
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleSession.html

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.html?view=diff&rev=465091&r1=465090&r2=465091
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.html (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.html Tue Oct 17 15:53:03 2006
@@ -4,15 +4,12 @@
 <body>
 
 <span jwcid="$content$">
-<p>
-
 <span jwcid="eException">
-	<a jwcid="@Any" href="" class="toggle" 
-	   onClick="ognl:'return toggleDisplay(\'excdisplay'+index+'\')'">[&nbsp;+/-&nbsp;] Exception:</a>
+	<a jwcid="@Any" href="" class="ognl:(index == (exceptions.length - 1)) ? 'toggle toggleSelected' : 'toggle'" 
+	   onClick="ognl:'return toggleDisplay(\'excdisplay'+index+'\', this)'">[&nbsp;+/-&nbsp;] Exception:</a>
 	   <span jwcid="@Insert" value="ognl:exception.message">A message describing the exception.</span>
 	
-	<div jwcid="@Any" id="ognl:'excdisplay' + index" class="toggleContent">
-	<table class="exception-display">
+	<table jwcid="@Any" id="ognl:'excdisplay' + index" class="exception-display toggleContent">
 		<tr class="exception-name">
 			<td colspan="2"><span jwcid="insertClass">some.exception.Class</span></td>
 		</tr>
@@ -41,11 +38,9 @@
 			<td>Property Value 4</td>
 		</tr>		
 		
-<span jwcid="ifNotLast">
-		<tr> <td colspan="2"> &nbsp; </td> </tr>
-</span>
+		<tr jwcid="ifNotLast"> <td colspan="2"> &nbsp; </td> </tr>
 
-<span jwcid="ifLast">
+<span jwcid="ifLast" renderTag="false">
 		<tr class="stack-trace-label">
 			<td colspan="2">Stack Trace:</td>
 		</tr>
@@ -64,10 +59,9 @@
 		</tr>
 </span> <!-- ifLast -->
 	</table>
-	</div>
+	
 </span> <!-- e-exception -->
 
-</p>
 </span> <!-- $content$ -->
 
 </body>

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.jwc?view=diff&rev=465091&r1=465090&r2=465091
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.jwc (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/ExceptionDisplay.jwc Tue Oct 17 15:53:03 2006
@@ -45,7 +45,7 @@
   
   <inject property="adapterFactory" object="service:tapestry.describe.RenderableAdapterFactory"/>
   
-  <component id="eException" type="Foreach">
+  <component id="eException" type="For">
     <binding name="source" value="exceptions"/>
     <binding name="value" value="exception"/>
     <binding name="index" value="index"/>
@@ -59,7 +59,7 @@
     <binding name="value" value="exception.message"/>
   </component>
   
-  <component id="eProperty" type="Foreach">
+  <component id="eProperty" type="For">
   	<binding name="element" value="literal:tr"/>
   	<binding name="class" value="beans.evenOdd.next"/>
     <binding name="source" value="exception.properties"/>
@@ -82,7 +82,7 @@
     <binding name="condition" value="! last"/>
   </component>
   
-  <component id="eStack" type="Foreach">
+  <component id="eStack" type="For">
     <binding name="element" value="literal:li"/>
     <binding name="source" value="exception.stackTrace"/>
     <binding name="value" value="trace"/>

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RequestDisplay.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RequestDisplay.html?view=diff&rev=465091&r1=465090&r2=465091
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RequestDisplay.html (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/RequestDisplay.html Tue Oct 17 15:53:03 2006
@@ -13,21 +13,19 @@
 </div>
 </span>
 
-<br/>
 <a href="" class="toggle" 
 	onClick="return toggleDisplay('contextDisplay')">[&nbsp;+/-&nbsp;] Context</a>
 <div id="contextDisplay" class="toggleContent">
 <span jwcid="@Describe" object="ognl:activator"/>
 <span jwcid="@Describe" object="ognl:context"/>
 </div>
-<br/>
+
 <a href="" class="toggle" 
 	onClick="return toggleDisplay('statusDisplay')">[&nbsp;+/-&nbsp;] Status</a>
 <div id="statusDisplay" class="toggleContent">
 <span jwcid="@Delegator" delegate="ognl:reportStatusRenderer"/>
 </div>
 
-<br/>
 <a href="" class="toggle" 
 	onClick="return toggleDisplay('sysPropDisplay')">[&nbsp;+/-&nbsp;] System Properties</a>
 <div id="sysPropDisplay" class="toggleContent">

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.css?view=diff&rev=465091&r1=465090&r2=465091
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.css (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.css Tue Oct 17 15:53:03 2006
@@ -14,7 +14,19 @@
 
 A:Hover  {}
 
-BODY  {}
+BODY  {
+    margin:0;
+    padding:0;
+}
+
+body, td, th {
+    font-family: Lucida Grande, Tahoma, Verdana, Arial, sans-serif;
+    font-size: 11pt;
+    color: #292929;
+}
+
+h2 { font: 1.4em Tahoma, Myriad, sans-serif; font-weight:bold; color: #296cb5; padding-bottom:0; }
+h3 { font: 0.8em Tahoma, Myriad, sans-serif; font-weight:bold; color: #296cb5; padding-bottom:0; }
 
 TABLE.exception-display TR.even  {
 	top : auto;
@@ -47,6 +59,13 @@
 	color : Red;
 }
 
+SPAN.exception-top {
+    display:block;
+    background: #efefef;
+    border-bottom: 2px solid #215E8A;
+    padding:0.4em;
+}
+
 SPAN.exception-message {
 	font-weight: bold;
 }
@@ -67,6 +86,8 @@
 
 TABLE.exception-display  {
 	width : 100%;
+	maring:0;
+	padding:0;
 }
 
 TABLE.exception-display TR.exception-message TD  {
@@ -156,10 +177,18 @@
 
 a.toggle {
     text-decoration:none;
-    color: #4066A0;
+    color: #292929;
     font-weight:bold;
+    display:block;
+    clear:left;
+    border-bottom: 2px solid #ffffff;
+    margin-top: 0.3em;
 }
 
 a.toggle:hover {
-    border-bottom: 2px solid #EDCC5F;
-}
\ No newline at end of file
+    background:#EDCC5F;
+}
+
+a.toggleSelected {
+    background:#EDCC5F;
+}

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html?view=diff&rev=465091&r1=465090&r2=465091
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/Exception.html Tue Oct 17 15:53:03 2006
@@ -14,31 +14,56 @@
    limitations under the License.
 -->
 <span jwcid="$content$">
-<html jwcid="@Shell" title="Exception" stylesheet="ognl:assets.stylesheet" disableCaching="true" doctype="ognl:''">
+<html jwcid="@Shell" title="Exception" stylesheet="ognl:assets.stylesheet" 
+	  disableCaching="true" doctype="ognl:''">
 <body>
 
+<span class="exception-top">
 <span class="exception-header">
 An exception has occurred.
 </span>
 
 <p>You may continue by <b><a jwcid="restart">restarting</a></b> the session.</p>
+</span>
 
 <span jwcid="@ExceptionDisplay" exceptions="ognl:exceptions"/>
-<br/>
+
 <span jwcid="@RequestDisplay"/>
 
 <script type="text/javascript">
 dojo.require("dojo.html.style");
 
-function toggleDisplay(id){
+var blockCount=0;
+
+function toggleLink(link){
+	if(!link){return;}
+	if(dojo.html.hasClass(link, "toggleSelected")){
+		dojo.html.removeClass(link, "toggleSelected");
+		return;
+	} else {
+		dojo.html.addClass(link, "toggleSelected");
+		return;
+	}
+}
+
+function toggleDisplay(id, link){
 	dojo.html.toggleShowing(dojo.byId(id));
+	toggleLink(link);
 	return false;
-}    
-    
-dojo.lang.forEach(
-	dojo.html.getElementsByClass('toggleContent'),
-	function(item) {toggleDisplay(item);}
-	);
+}
+
+(function(){
+	var elms=dojo.html.getElementsByClass('toggleContent');
+	if(elms && elms.length > 0){
+		for(var i=0;i<elms.length;i++){
+			toggleDisplay(elms[i]);
+		}
+	}
+	elms=dojo.html.getElementsByClass('exception-display');
+	if(elms && elms.length > 0){
+		toggleDisplay(elms[elms.length-1]);
+	}
+})();
 </script>
 
 </body>

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleLink.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleLink.html?view=diff&rev=465091&r1=465090&r2=465091
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleLink.html (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleLink.html Tue Oct 17 15:53:03 2006
@@ -1,16 +1,17 @@
 
-<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" disableCaching="true" doctype="ognl:''" title="Stale Link">
+<span jwcid="@Shell" stylesheet="ognl:assets.stylesheet" disableCaching="true" 
+	doctype="ognl:''" title="Stale Link">
 
 <body>
-
+<span class="exception-top">
 You have clicked on a <i>stale link</i>.  
+</span>
 
 <p>
 <span jwcid="@Insert" value="ognl:message" class="exception-message">
 Exception message goes here.
 </span>
 </p>
-
 <p>This is most likely the result of using your
 browser's <b>back</b> button, but can also be an application error.</p>
 

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleSession.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleSession.html?view=diff&rev=465091&r1=465090&r2=465091
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleSession.html (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pages/StaleSession.html Tue Oct 17 15:53:03 2006
@@ -2,7 +2,9 @@
 <span jwcid="@Shell" title="Stale Session" disableCaching="true" doctype="ognl:''" stylesheet="ognl:assets.stylesheet">
 
 <body>
+<span class="exception-top">
 Your session has timed out.
+</span>
 
 <p>Web applications store information about what you are doing on the server.  This information
 is called the <em>session</em>.</p>