$plaintypes = array('txt','doc','rtf');
$filetype = 'plain';
if(!in_array($parts[1],$plaintypes)){
+ // TODO ADD THESE
$types = array('php' => 'php',
'js' => 'javascript',
'html' => 'html');
}
// Add theme
-OC_UTIL::addScript('editor','aceeditor/theme-cobalt');
+OC_UTIL::addScript('editor','aceeditor/theme-clouds');
OC_App::setActiveNavigationEntry( 'editor_index' );
$(document).ready(function(){
+
+
// Set the editor size.
doEditorResize();
}
// Set the theme
- aceEditor.setTheme("ace/theme/cobalt");
+ aceEditor.setTheme("ace/theme/clouds");
// Process the save button click event
$('#editor_save').click(function(){
// TODO give focus back to the editor
// window.aceEditor.focus();
});
-
- /*
- // Process the gotoline button click event
- $('#editor_goToLine').click(function(){
- var html = '<div id="dropdown" class="drop"><input type="text" id="editot_goToLine_line" size="20"><input type="button" id="editor_goToLine_gp" value="<?php echo $l->t(\'Go\'); ?>"></div>';
- $(html).appendTo($('#editor_goToLine'));
- $('#dropdown').show('blind');
-
- //window.aceEditor.gotoLine(100);
- //TODO GIVE FOCUS BACK
- });
- */
// Process the window resize event
$(window).resize(function() {
}
$(document).ready(function() {
+ /*
if(typeof FileActions!=='undefined'){
FileActions.register('text','View','',function(filename){
TextViewer.showText($('#dir').val(),filename);
});
FileActions.setDefault('application/xml','View');
}
+ */
OC.search.customResults.Text=function(row,item){
var text=item.link.substr(item.link.indexOf('file=')+5);
var a=row.find('a');
FileActions.register('all','Rename',function(){return OC.imagePath('core','actions/rename')},function(filename){
FileList.rename(filename);
});
-FileActions.register('text','Edit',function(){return OC.imagePath('core','actions/rename')},function(filename){
- window.location='/apps/editor/index.php?file='+filename+'&dir='+$('#dir').val();
-});
-
-//FileActions.setDefault('all','Download');
FileActions.register('dir','Open','',function(filename){
window.location='index.php?dir='+$('#dir').val()+'/'+filename;
});
FileActions.setDefault('dir','Open');
+
+FileActions.register('text','Edit','',function(filename){
+ window.location=OC.linkTo('editor', 'index.php')+'?file='+filename+'&dir='+$('#dir').val();
+});
+
+FileActions.setDefault('text','Edit');
+
+FileActions.register('application/xml','Edit','',function(filename){
+ window.location=OC.linkTo('editor', 'index.php')+'?file='+filename+'&dir='+$('#dir').val();
+});
+
+FileActions.setDefault('application/xml','Edit');