function setEditorSize(){
// Sets the size of the text editor window.
fillWindow($('#editor'));
}
function getFileExtension(file){
var parts=file.split('.');
return parts[parts.length-1];
}
function setSyntaxMode(ext){
// Loads the syntax mode files and tells the editor
var filetype = new Array();
// Todo finish these
filetype["php"] = "php";
filetype["html"] = "html";
filetype["rb"] = "ruby";
filetype["css"] = "css";
filetype["pl"] = "perl";
filetype["py"] = "python";
filetype["xml"] = "xml";
filetype["js"] = "javascript";
if(filetype[ext]!=null){
// Then it must be in the array, so load the custom syntax mode
// Set the syntax mode
OC.addScript('files_texteditor','aceeditor/mode-'+filetype[ext], function(){
var SyntaxMode = require("ace/mode/"+filetype[ext]).Mode;
window.aceEditor.getSession().setMode(new SyntaxMode());
});
}
}
function showControls(filename){
// Loads the control bar at the top.
$('.actions,#file_action_panel').fadeOut('slow').promise().done(function() {
// Load the new toolbar.
var savebtnhtml = '';
var html = '';
$('#controls').append(html);
$('#editorbar').fadeIn('slow');
var breadcrumbhtml = '