Sha256: 4c04e836edc5b1a06d42211a8da08b8c8efad5622dcfd81a1276289a1099e920

Contents?: true

Size: 1.85 KB

Versions: 196

Compression:

Stored size: 1.85 KB

Contents

<% names = @traces.keys %>

<p><code>Rails.root: <%= defined?(Rails) && Rails.respond_to?(:root) ? Rails.root : "unset" %></code></p>

<div id="traces">
  <% names.each do |name| %>
    <%
      show = "show('#{name.gsub(/\s/, '-')}');"
      hide = (names - [name]).collect {|hide_name| "hide('#{hide_name.gsub(/\s/, '-')}');"}
    %>
    <a href="#" onclick="<%= hide.join %><%= show %>; return false;"><%= name %></a> <%= '|' unless names.last == name %>
  <% end %>

  <% @traces.each do |name, trace| %>
    <div id="<%= name.gsub(/\s/, '-') %>" style="display: <%= (name == @trace_to_show) ? 'block' : 'none' %>;">
      <pre><code><% trace.each do |frame| %><a class="trace-frames" data-frame-id="<%= frame[:id] %>" href="#"><%= frame[:trace] %></a><br><% end %></code></pre>
    </div>
  <% end %>

  <script type="text/javascript">
    var traceFrames = document.getElementsByClassName('trace-frames');
    var selectedFrame, currentSource = document.getElementById('frame-source-0');

    // Add click listeners for all stack frames
    for (var i = 0; i < traceFrames.length; i++) {
      traceFrames[i].addEventListener('click', function(e) {
        e.preventDefault();
        var target = e.target;
        var frame_id = target.dataset.frameId;

        if (selectedFrame) {
          selectedFrame.className = selectedFrame.className.replace("selected", "");
        }

        target.className += " selected";
        selectedFrame = target;

        // Change the extracted source code
        changeSourceExtract(frame_id);
      });

      function changeSourceExtract(frame_id) {
        var el = document.getElementById('frame-source-' + frame_id);
        if (currentSource && el) {
          currentSource.className += " hidden";
          el.className = el.className.replace(" hidden", "");
          currentSource = el;
        }
      }
    }
  </script>
</div>

Version data entries

196 entries across 194 versions & 14 rubygems

Version Path
actionpack-5.2.8.1 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.8 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.7.1 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.7 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.6.3 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.6.2 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.6.1 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.6 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.4.6 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.5 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.4.5 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.4.4 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.4.3 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-4.2.11.3 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-4.2.11.2 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.4.2 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.4.1 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/actionpack-5.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.4 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
actionpack-5.2.4.rc1 lib/action_dispatch/middleware/templates/rescues/_trace.html.erb