diff shared_view/includes/dojo/context.tt @ 11:573272ec604b

almost comlete doxygen library
author sergey
date Thu, 15 May 2014 18:24:02 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/shared_view/includes/dojo/context.tt	Thu May 15 18:24:02 2014 +0400
@@ -0,0 +1,25 @@
+[%  META activation = 'singleton' class='Benzin::Web::View::DojoContext';
+    
+    JSON = import('JSON');
+    MACRO ToJSON(arg) GET JSON.new.utf8(1).encode(arg);
+    
+    theme = this.theme || 'tundra';
+    config = this.config || {};
+    dijitCss = cdn.dojo.dijit.themes.$theme.$theme.SetView('css');
+    dojoCss = cdn.dojo.dojo.resources.dojo.SetView('css');
+    dojoJs = cdn.dojo.Clone.SetView('js');
+%]
+<link type="text/css" rel="stylesheet" href="$dojoCss"/>
+<link type="text/css" rel="stylesheet" href="$dijitCss"/>
+<script type="text/javascript">
+    var dojoConfig = [% ToJSON(config) %]
+</script>
+<script type="text/javascript" src="$dojoJs.dojo.dojo"></script>
+<script type="text/javascript">
+    [%
+        IF config.parseOnLoad;
+            this.AddJsModule('dojo/parser');
+        END;
+        'require(' _ ToJSON(this.modules) _ ');';
+    +%]
+</script>
\ No newline at end of file