plugins/themeBuilder/client/themeBuilder.js
function openFile(themeId, folderName, fileName) {
        if (themeId && folderName && fileName) {
            //if image then display it
            if (folderName === "images") {
                showImage(themeId, folderName, fileName);
                return;
            }

            var options = {
                url:getURL("show") + "/" + themeId + "/" + folderName + "/" + fileName,
                success:function (response) {
                    if (response.status === "error") {
                        util.showErrorFlash(response.message);
                    }
                    else {
                        // if js, css or jade file then show in editor
                        var mode = "scss";
                        if (fileName.indexOf(".js") > -1) {
                            mode = "javascript";
                        }
                        else if (fileName.indexOf(".css") > -1) {
                            mode = "css";
                        }

                        initAceEditor(themeId, folderName, fileName, response, mode);
                    }
                }
            };
            Rocket.ajax(options);
        }
    }
function openFile(themeId, folderName, fileName) {
        if (themeId && folderName && fileName) {
            //if image then display it
            if (folderName === "images") {
                showImage(themeId, folderName, fileName);
                return;
            }

            var options = {
                url:getURL("show") + "/" + themeId + "/" + folderName + "/" + fileName,
                success:function (response) {
                    if (response.status === "error") {
                        util.showErrorFlash(response.message);
                    }
                    else {
                        // if js, css or jade file then show in editor
                        var mode = "scss";
                        if (fileName.indexOf(".js") > -1) {
                            mode = "javascript";
                        }
                        else if (fileName.indexOf(".css") > -1) {
                            mode = "css";
                        }

                        initAceEditor(themeId, folderName, fileName, response, mode);
                    }
                }
            };
            Rocket.ajax(options);
        }
    }
function openFile ( themeId , folderName , fileName ) { if ( themeId && folderName && fileName ) { //if image then display it if ( folderName === "images" ) { showImage ( themeId , folderName , fileName ) ; return ; } var options = { url : getURL ( "show" ) + "/" + themeId + "/" + folderName + "/" + fileName , success : function ( response ) { if ( response . status === "error" ) { util . showErrorFlash ( response . message ) ; } else { // if js, css or jade file then show in editor var mode = "scss" ; if ( fileName . indexOf ( ".js" ) > - 1 ) { mode = "javascript" ; } else if ( fileName . indexOf ( ".css" ) > - 1 ) { mode = "css" ; } initAceEditor ( themeId , folderName , fileName , response , mode ) ; } } } ; Rocket . ajax ( options ) ; } }
Handler when theme file is activated in tree, calls io to show file content
@param {Number} themeId
@param {String} folderName
@param {String} fileName
Handler when theme file is activated in tree calls io to show file content