view shared_view/includes/dojo/context.tt @ 12:d9551c7e7101

improved dox library
author sergey
date Fri, 16 May 2014 16:47:50 +0400
parents 573272ec604b
children
line wrap: on
line source

[%  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>