
//Load modules and use them
if( typeof require.config === "function" ) {
    require.config({
        paths: {
            'jquery':'../lib/jquery/jquery',
            'underscore':'../lib/lodash/lodash',
            'filesaver' :'../lib/FileSaver/FileSaver.min',
            'requtils':'require-utils',
            'jquery-private':'jquery-private',
            'ckeditor-core':'../lib/ckeditor/ckeditor',
            'screenfull':'../lib/screenfull/screenfull-umd'
        },
        // JQuery config. cf: http://requirejs.org/docs/jquery.html#noconflictmap
        map: {
            '*': { 'jquery': 'jquery-private' },
            'jquery-private': { 'jquery': 'jquery' }
        },
        shim: {
            'ckeditor-core': {
                exports: 'CKEDITOR',
            }
        }
    });
}

require(['renderer/baserepresentation',
         'renderer/basebutton',
         'renderer/noderepr',
         'renderer/edge',
         'renderer/tempedge',
         'renderer/baseeditor',
         'renderer/nodeeditor',
         'renderer/edgeeditor',
         'renderer/nodebutton',
         'renderer/nodeeditbutton',
         'renderer/noderemovebutton',
         'renderer/nodehidebutton',
         'renderer/nodeshowbutton',
         'renderer/noderevertbutton',
         'renderer/nodelinkbutton',
         'renderer/nodeenlargebutton',
         'renderer/nodeshrinkbutton',
         'renderer/edgeeditbutton',
         'renderer/edgeremovebutton',
         'renderer/edgerevertbutton',
         'renderer/miniframe',
         'renderer/scene',
         'renderer/viewrepr'
         ], function(BaseRepresentation, BaseButton, NodeRepr, Edge, TempEdge, BaseEditor, NodeEditor, EdgeEditor, NodeButton, NodeEditButton, NodeRemoveButton, NodeHideButton, NodeShowButton, NodeRevertButton, NodeLinkButton, NodeEnlargeButton, NodeShrinkButton, EdgeEditButton, EdgeRemoveButton, EdgeRevertButton, MiniFrame, Scene, ViewRepr){

    'use strict';

    var Rkns = window.Rkns;

    if(typeof Rkns.Renderer === "undefined"){
        Rkns.Renderer = {};
    }
    var Renderer = Rkns.Renderer;

    Renderer._BaseRepresentation = BaseRepresentation;
    Renderer._BaseButton = BaseButton;
    Renderer.Node = NodeRepr;
    Renderer.Edge = Edge;
    Renderer.View = ViewRepr;
    Renderer.TempEdge = TempEdge;
    Renderer._BaseEditor = BaseEditor;
    Renderer.NodeEditor = NodeEditor;
    Renderer.EdgeEditor = EdgeEditor;
    Renderer._NodeButton = NodeButton;
    Renderer.NodeEditButton = NodeEditButton;
    Renderer.NodeRemoveButton = NodeRemoveButton;
    Renderer.NodeHideButton = NodeHideButton;
    Renderer.NodeShowButton = NodeShowButton;
    Renderer.NodeRevertButton = NodeRevertButton;
    Renderer.NodeLinkButton = NodeLinkButton;
    Renderer.NodeEnlargeButton = NodeEnlargeButton;
    Renderer.NodeShrinkButton = NodeShrinkButton;
    Renderer.EdgeEditButton = EdgeEditButton;
    Renderer.EdgeRemoveButton = EdgeRemoveButton;
    Renderer.EdgeRevertButton = EdgeRevertButton;
    Renderer.MiniFrame = MiniFrame;
    Renderer.Scene = Scene;

    startRenkan();
});
