Module: DevPanel::Panel
- Defined in:
- lib/devpanel/extension.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/devpanel/extension.rb', line 4 def self.included(base) base.after_filter :dev_panel_output, :if => lambda { request.format.to_s == "text/html" && !(!!request.xhr?) } end |
Instance Method Details
#dev_panel_output ⇒ Object
8 9 10 |
# File 'lib/devpanel/extension.rb', line 8 def dev_panel_output self.response.body += panel end |
#hide_container ⇒ Object
35 36 37 |
# File 'lib/devpanel/extension.rb', line 35 def hide_container (Stats.show?) ? '' : '$jq("#devPanelContainer").toggle()' end |
#panel ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/devpanel/extension.rb', line 12 def panel " <script>\n window.onload = function() {\n body = document.getElementsByTagName('body')[0]\n iframe = document.createElement('iframe')\n iframe.setAttribute('src', '__DevPanel/main')\n iframe.setAttribute('id', 'devPanel')\n iframe.setAttribute('style', 'width: 100%; border: none;')\n iframe.setAttribute('height', 50)\n body.insertBefore(iframe ,body.children[0])\n }\n\n window.resizeDevPanel = function(height) {\n element = document.getElementById('devPanel')\n console.log(height)\n element.setAttribute('height', height)\n }\n\n </script>\n html_code\nend\n" |