tina4ruby 3.11.18 → 3.11.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -714,10 +714,55 @@ module Tina4
714
714
  <span style="color:#ffeb3b;">req:#{request_id}</span>
715
715
  <span style="color:#90caf9;">#{route_count} routes</span>
716
716
  <span style="color:#888;">Ruby #{RUBY_VERSION}</span>
717
- <a href="#" onclick="(function(e){e.preventDefault();var p=document.getElementById('tina4-dev-panel');if(p){p.style.display=p.style.display==='none'?'block':'none';return;}var c=document.createElement('div');c.id='tina4-dev-panel';c.style.cssText='position:fixed;top:3rem;left:0;right:0;bottom:2rem;z-index:99998;transition:all 0.2s';var f=document.createElement('iframe');f.src='/__dev';f.style.cssText='width:100%;height:100%;border:1px solid #CC342D;border-radius:0.5rem;box-shadow:0 8px 32px rgba(0,0,0,0.5);background:#0f172a';c.appendChild(f);document.body.appendChild(c);})(event)" style="color:#ef9a9a;margin-left:auto;text-decoration:none;cursor:pointer;">Dashboard &#8599;</a>
717
+ <a href="#" onclick="window.__tina4ToggleOverlay(event)" style="color:#ef9a9a;margin-left:auto;text-decoration:none;cursor:pointer;">Dashboard &#8599;</a>
718
718
  <span onclick="this.parentElement.style.display='none'" style="cursor:pointer;color:#888;margin-left:8px;">&#10005;</span>
719
719
  </div>
720
720
  <script>
721
+ // Overlay open/toggle helper + auto-restore. Persist the dev-admin
722
+ // iframe's open/closed state across parent reloads so saving a
723
+ // file doesn't lose the user's dev-admin context. Cross-framework
724
+ // parity with PHP / Python / Node — same localStorage key.
725
+ (function(){
726
+ var STATE_KEY = 'tina4_dev_overlay_open';
727
+ function buildOverlay() {
728
+ var c = document.createElement('div');
729
+ c.id = 'tina4-dev-panel';
730
+ c.style.cssText = 'position:fixed;top:3rem;left:0;right:0;bottom:2rem;z-index:99998;transition:all 0.2s';
731
+ var f = document.createElement('iframe');
732
+ f.src = '/__dev';
733
+ f.style.cssText = 'width:100%;height:100%;border:1px solid #CC342D;border-radius:0.5rem;box-shadow:0 8px 32px rgba(0,0,0,0.5);background:#0f172a';
734
+ c.appendChild(f);
735
+ document.body.appendChild(c);
736
+ return c;
737
+ }
738
+ window.__tina4ToggleOverlay = function(e) {
739
+ if (e) e.preventDefault();
740
+ var p = document.getElementById('tina4-dev-panel');
741
+ if (p) {
742
+ var hide = p.style.display !== 'none';
743
+ p.style.display = hide ? 'none' : 'block';
744
+ try { localStorage.setItem(STATE_KEY, hide ? '0' : '1'); } catch (_) {}
745
+ return;
746
+ }
747
+ buildOverlay();
748
+ try { localStorage.setItem(STATE_KEY, '1'); } catch (_) {}
749
+ };
750
+ function restoreIfOpen() {
751
+ try {
752
+ if (location.pathname.indexOf('/__dev') === 0) return;
753
+ if (localStorage.getItem(STATE_KEY) === '1' && !document.getElementById('tina4-dev-panel')) {
754
+ buildOverlay();
755
+ }
756
+ } catch (_) {}
757
+ }
758
+ if (document.readyState === 'loading') {
759
+ document.addEventListener('DOMContentLoaded', restoreIfOpen);
760
+ } else {
761
+ restoreIfOpen();
762
+ }
763
+ })();
764
+ </script>
765
+ <script>
721
766
  function tina4VersionModal(){
722
767
  var m=document.getElementById('tina4-ver-modal');
723
768
  if(m.style.display==='block'){m.style.display='none';return;}
@@ -151,6 +151,9 @@ module Tina4
151
151
  self
152
152
  end
153
153
 
154
+ # Render a Frond/Twig template file with data and return self. Tries
155
+ # the user template directory first, falling back to the framework's
156
+ # built-in templates. Sets the response body to the rendered HTML.
154
157
  def render(template_path, data = {}, status: 200, template_dir: nil)
155
158
  @status_code = status
156
159
  @headers["content-type"] = HTML_CONTENT_TYPE
data/lib/tina4/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tina4
4
- VERSION = "3.11.18"
4
+ VERSION = "3.11.19"
5
5
  end
data/lib/tina4.rb CHANGED
@@ -53,6 +53,7 @@ require_relative "tina4/response_cache"
53
53
  require_relative "tina4/html_element"
54
54
  require_relative "tina4/error_overlay"
55
55
  require_relative "tina4/test_client"
56
+ require_relative "tina4/docs"
56
57
  require_relative "tina4/mcp"
57
58
 
58
59
  module Tina4
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tina4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.18
4
+ version: 3.11.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tina4 Team
@@ -295,6 +295,7 @@ files:
295
295
  - lib/tina4/dev.rb
296
296
  - lib/tina4/dev_admin.rb
297
297
  - lib/tina4/dev_mailbox.rb
298
+ - lib/tina4/docs.rb
298
299
  - lib/tina4/drivers/firebird_driver.rb
299
300
  - lib/tina4/drivers/mongodb_driver.rb
300
301
  - lib/tina4/drivers/mssql_driver.rb