OSDN Git Service

Merge remote-tracking branch 'origin/master'
[shogi-server/shogi-server.git] / showgame / view / error.xhtml
1 <link rel="stylesheet" href="/css/ramaze_error.css" />
2 <script type="text/javascript" src="/js/jquery.js"></script>
3
4 <p>The backtrace gives filenames and line numbers for all parts of the call stack.<br />
5 Click on any of them to view the surrounding source code.</p>
6
7 <h3>#@title</h3>
8
9 <table class="main">
10   <tr class="head">
11     <td>File</td><td>Line</td><td>Method</td>
12   </tr>
13   <?r @backtrace.each do |lines, hash, file, lineno, meth| ?>
14     <tr class="line" id="#{hash}">
15       <td>#{file}</td><td class="lineno">#{lineno}</td><td><pre>#{meth}</pre></td>
16     </tr>
17     <tr id="source_#{hash}" style="display:none;">
18       <td colspan="3">
19         <div class="source">
20           <table style="width:100%;">
21             <tr>
22               <td class="editor" colspan="2">
23                 #{@editor} #{file} +#{lineno}
24                 <div style="float: right">
25                   <a href="txmt://open?url=file://#{file}&line=#{lineno}">open in textmate</a>
26                 </div>
27               </td>
28             </tr>
29             <?r lines.each do |llineno, lcode, lcurrent| ?>
30               <tr class="source" #{'style="background:#faa;"' if lcurrent}>
31                 <td class="lineno">#{llineno}</td>
32                 <td class="code"><pre>#{lcode.to_s.rstrip}</pre></td>
33               </tr>
34             <?r end ?>
35           </table>
36         </div>
37       </td>
38     </tr>
39   <?r end ?>
40 </table>
41
42 <?r
43   { 'Session'   => Thread.current[:session],
44     'Request'   => Thread.current[:request],
45     'Response'  => Thread.current[:response],
46     'Global'    => Global,
47   }.each do |title, content|
48     hash = [title, content].object_id.abs
49   ?>
50   <div class="additional">
51     <h3 id="#{hash}">#{title}</h3>
52     <pre style="display:none" id="is_#{hash}">#{CGI.escapeHTML(content.pretty_inspect)}</pre>
53   </div>
54 <?r end ?>
55
56 <script type="text/javascript">
57   $("tr.line").click(function(){
58     $("tr#source_"+this.id).toggle()
59   });
60
61   $("div.additional > h3").click(function(){
62     $("pre#is_"+this.id).toggle()
63   });
64 </script>