[Jifty-commit] r6650 - in jifty/trunk: lib/Jifty share/web/templates/__jifty

Jifty commits jifty-commit at lists.jifty.org
Tue Mar 17 18:40:04 EDT 2009


Author: sartak
Date: Tue Mar 17 18:40:04 2009
New Revision: 6650

Added:
   jifty/trunk/share/web/templates/__jifty/config.js
Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Web.pm

Log:
 r81345 at onn:  sartak | 2009-03-17 18:15:52 -0400
 Move js config into a template


Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm	(original)
+++ jifty/trunk/lib/Jifty/Web.pm	Tue Mar 17 18:40:04 2009
@@ -1164,12 +1164,7 @@
         }
     }
 
-    my $config = $self->current_user->javascript_config;
-    my $js_config = $self->escape(Jifty::JSON::objToJson($config, { singlequote => 1 }));
-
-    $self->out(
-        qq[<script type="text/javascript">Jifty.Config = $js_config;</script>\n]
-    );
+    $self->out(qq[<script type="text/javascript" src="/__jifty/config.js"></script>\n]);
 
     $self->call_trigger('after_include_javascript', @_);
 

Added: jifty/trunk/share/web/templates/__jifty/config.js
==============================================================================
--- (empty file)
+++ jifty/trunk/share/web/templates/__jifty/config.js	Tue Mar 17 18:40:04 2009
@@ -0,0 +1,5 @@
+Jifty.Config = <% $js_config %>;
+<%init>
+my $config = Jifty->web->current_user->javascript_config;
+my $js_config = Jifty::JSON::objToJson($config, { singlequote => 1 });
+</%init>


More information about the Jifty-commit mailing list