plugins/themeBuilder/client/themeBuilder.js
function renderThemeTree(themeId, fileList, themeName) {
        var getTreeNodes = function (arr) {
            var ret = [];
            _.each(arr, function (fileName) {
                ret.push({title:fileName});
            });
            return ret;
        };
        var css = {title:validTitleName[0], isFolder:true, children:getTreeNodes(fileList["css"])},
            js = {title:validTitleName[1], isFolder:true, children:getTreeNodes(fileList["js"])},
            images = {title:validTitleName[2], isFolder:true, children:getTreeNodes(fileList["images"])},
            tmpl = {title:validTitleName[3], isFolder:true, children:getTreeNodes(fileList["tmpl"])},
            children = [css, images, js, tmpl];
        tree = treeObj.dynatree({
                onActivate:function (node) {
                    var data = node.data;
                    if (!data.isFolder) {
                        openFile(themeId, node.parent.data.title, data.title);
                    }
                    else {
                        hideEditor();
                        hideImageHolder();
                    }
                },
                children:{title:themeName, children:children, isFolder:true, expand:true}
            }
        );
        $(tree).dynatree("getTree").reload();
    }
function renderThemeTree(themeId, fileList, themeName) {
        var getTreeNodes = function (arr) {
            var ret = [];
            _.each(arr, function (fileName) {
                ret.push({title:fileName});
            });
            return ret;
        };
        var css = {title:validTitleName[0], isFolder:true, children:getTreeNodes(fileList["css"])},
            js = {title:validTitleName[1], isFolder:true, children:getTreeNodes(fileList["js"])},
            images = {title:validTitleName[2], isFolder:true, children:getTreeNodes(fileList["images"])},
            tmpl = {title:validTitleName[3], isFolder:true, children:getTreeNodes(fileList["tmpl"])},
            children = [css, images, js, tmpl];
        tree = treeObj.dynatree({
                onActivate:function (node) {
                    var data = node.data;
                    if (!data.isFolder) {
                        openFile(themeId, node.parent.data.title, data.title);
                    }
                    else {
                        hideEditor();
                        hideImageHolder();
                    }
                },
                children:{title:themeName, children:children, isFolder:true, expand:true}
            }
        );
        $(tree).dynatree("getTree").reload();
    }
function renderThemeTree ( themeId , fileList , themeName ) { var getTreeNodes = function ( arr ) { var ret = [ ] ; _ . each ( arr , function ( fileName ) { ret . push ( { title : fileName } ) ; } ) ; return ret ; } ; var css = { title : validTitleName [ 0 ] , isFolder : true , children : getTreeNodes ( fileList [ "css" ] ) } , js = { title : validTitleName [ 1 ] , isFolder : true , children : getTreeNodes ( fileList [ "js" ] ) } , images = { title : validTitleName [ 2 ] , isFolder : true , children : getTreeNodes ( fileList [ "images" ] ) } , tmpl = { title : validTitleName [ 3 ] , isFolder : true , children : getTreeNodes ( fileList [ "tmpl" ] ) } , children = [ css , images , js , tmpl ] ; tree = treeObj . dynatree ( { onActivate : function ( node ) { var data = node . data ; if ( ! data . isFolder ) { openFile ( themeId , node . parent . data . title , data . title ) ; } else { hideEditor ( ) ; hideImageHolder ( ) ; } } , children : { title : themeName , children : children , isFolder : true , expand : true } } ) ; $ ( tree ) . dynatree ( "getTree" ) . reload ( ) ; }
Renders theme's folders as tree in left side and attach handlers on each file
@param {String} themeId
@param {Object} fileList
Renders theme s folders as tree in left side and attach handlers on each file