tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject [2/2] git commit: Restore the checkbox for hiding/showing filtered stack frames
Date Sat, 03 Nov 2012 18:14:06 GMT
Restore the checkbox for hiding/showing filtered stack frames


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/213421cd
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/213421cd
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/213421cd

Branch: refs/heads/5.4-js-rewrite
Commit: 213421cd09f8b1be0a4f097b2090a6e18c3e26ee
Parents: c8260a4
Author: Howard M. Lewis Ship <hlship@apache.org>
Authored: Sat Nov 3 11:11:39 2012 -0700
Committer: Howard M. Lewis Ship <hlship@apache.org>
Committed: Sat Nov 3 11:11:39 2012 -0700

----------------------------------------------------------------------
 .../META-INF/modules/core/exception-display.coffee |   30 +++++++++++++++
 .../corelib/components/ExceptionDisplay.java       |   21 +---------
 .../META-INF/assets/core/ExceptionDisplay.css      |    5 ++-
 .../corelib/components/ExceptionDisplay.tml        |    4 +-
 .../tapestry5/corelib/pages/ExceptionReport.tml    |    4 +-
 5 files changed, 41 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/213421cd/tapestry-core/src/main/coffeescript/META-INF/modules/core/exception-display.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/exception-display.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/core/exception-display.coffee
new file mode 100644
index 0000000..36dc0f2
--- /dev/null
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/exception-display.coffee
@@ -0,0 +1,30 @@
+# Copyright 2012 The Apache Software Foundation
+#
+# Licensed 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.
+
+# ## core/exception-report
+#
+# Provides dynamic behavior for the core/ExceptionDisplay component; specifically,
+# filtering the stack trace.
+define ["core/spi"],
+  (spi) ->
+
+    spi.onDocument "click", "[data-behavior=stack-trace-filter-toggle]", ->
+      checked = this.element.checked
+
+      for traceList in spi.body().find "ul.t-stack-trace"
+        traceList[if checked then "addClass" else "removeClass"] "t-filtered"
+
+      return
+
+    return null

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/213421cd/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java
index af41b38..209dd15 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ExceptionDisplay.java
@@ -14,7 +14,6 @@
 
 package org.apache.tapestry5.corelib.components;
 
-import org.apache.tapestry5.annotations.Environmental;
 import org.apache.tapestry5.annotations.Import;
 import org.apache.tapestry5.annotations.Parameter;
 import org.apache.tapestry5.annotations.Property;
@@ -25,18 +24,17 @@ import org.apache.tapestry5.ioc.services.ExceptionAnalyzer;
 import org.apache.tapestry5.ioc.services.ExceptionInfo;
 import org.apache.tapestry5.services.StackTraceElementAnalyzer;
 import org.apache.tapestry5.services.StackTraceElementClassConstants;
-import org.apache.tapestry5.services.javascript.JavaScriptSupport;
 
 import java.util.List;
 
 /**
  * Integral part of the default {@link org.apache.tapestry5.corelib.pages.ExceptionReport}
page used to break apart and
  * display the properties of the exception.
- * 
- * @see org.apache.tapestry5.ioc.services.ExceptionAnalyzer
+ *
  * @tapestrydoc
+ * @see org.apache.tapestry5.ioc.services.ExceptionAnalyzer
  */
-@Import(stylesheet = "ExceptionDisplay.css")
+@Import(stylesheet = "ExceptionDisplay.css", module = "core/exception-display")
 public class ExceptionDisplay
 {
     /**
@@ -60,12 +58,6 @@ public class ExceptionDisplay
     @Property
     private List<ExceptionInfo> stack;
 
-    @Environmental
-    private JavaScriptSupport jsSupport;
-
-    @Property
-    private String toggleId;
-
     private boolean sawDoFilter;
 
     @Inject
@@ -77,8 +69,6 @@ public class ExceptionDisplay
         ExceptionAnalysis analysis = analyzer.analyze(exception);
 
         stack = analysis.getExceptionInfos();
-
-        toggleId = jsSupport.allocateClientId("toggleStack");
     }
 
     public Object getPropertyValue()
@@ -99,9 +89,4 @@ public class ExceptionDisplay
 
         return result;
     }
-
-    void afterRender()
-    {
-        // jsSupport.addScript("Tapestry.stackFrameToggle('%s');", toggleId);
-    }
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/213421cd/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionDisplay.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionDisplay.css b/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionDisplay.css
index 8addb02..d4822e9 100644
--- a/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionDisplay.css
+++ b/tapestry-core/src/main/resources/META-INF/assets/core/ExceptionDisplay.css
@@ -8,11 +8,14 @@ LI.t-usercode-frame {
 }
 
 LI.t-omitted-frame {
-    display: none;
     color: gray;
     list-style: square;
 }
 
+UL.t-filtered LI.t-omitted-frame {
+    display: none;
+}
+
 DT:after {
     content: ":";
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/213421cd/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml
index c0547c1..445a62b 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/ExceptionDisplay.tml
@@ -25,12 +25,12 @@
             <div>
                 <form action="#" class="form-inline pull-right">
                     <label class="checkbox">
-                        <input type="checkbox" data-behavior="master" checked="true"/>
Filter Frames?
+                        <input type="checkbox" data-behavior="stack-trace-filter-toggle"
checked="true"/> Filter Frames?
                     </label>
                 </form>
                 <h4>Stack trace:</h4>
             </div>
-            <ul class="t-stack-trace">
+            <ul class="t-stack-trace t-filtered">
                 <li t:type="loop" source="info.stackTrace" value="frame" class="${frameClass}">
                     ${frame}
                 </li>

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/213421cd/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml
index 7a13a32..c12075e 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ExceptionReport.tml
@@ -5,7 +5,7 @@
 <body>
 <div class="navbar navbar-inverse navbar-fixed-top">
     <div class="navbar-inner">
-        <div class="container">
+        <div class="container-fluid">
 
             <ul class="nav">
                 <li class="navbar-text">
@@ -23,7 +23,7 @@
         </div>
     </div>
 </div>
-<div class="container">
+<div class="container-fluid">
 
     <div class="alert alert-error">
         <h2>An exception has occurred processing this request.</h2>


Mime
View raw message