summaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
Diffstat (limited to 'files')
-rw-r--r--files/appinfo/app.php1
-rw-r--r--files/index.php3
-rw-r--r--files/js/fileactions.js16
-rw-r--r--files/templates/index.php2
-rw-r--r--files/templates/part.breadcrumb.php2
5 files changed, 19 insertions, 5 deletions
diff --git a/files/appinfo/app.php b/files/appinfo/app.php
index e8b2f0c3169..e434296b250 100644
--- a/files/appinfo/app.php
+++ b/files/appinfo/app.php
@@ -1,5 +1,6 @@
<?php
+
$l=new OC_L10N('files');
OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
diff --git a/files/index.php b/files/index.php
index aa081d48804..67324d4df2c 100644
--- a/files/index.php
+++ b/files/index.php
@@ -30,9 +30,12 @@ OC_Util::checkLoggedIn();
// Load the files we need
OC_Util::addStyle( "files", "files" );
+OC_Util::addStyle( 'files_texteditor', 'style' );
OC_Util::addScript( "files", "files" );
OC_Util::addScript( 'files', 'filelist' );
OC_Util::addScript( 'files', 'fileactions' );
+OC_Util::addScript( 'files_texteditor', 'editor');
+OC_Util::addScript( 'files_texteditor', 'aceeditor/ace');
if(!isset($_SESSION['timezone'])){
OC_Util::addScript( 'files', 'timezone' );
}
diff --git a/files/js/fileactions.js b/files/js/fileactions.js
index 0089c235ebf..81aedbd98b9 100644
--- a/files/js/fileactions.js
+++ b/files/js/fileactions.js
@@ -136,10 +136,20 @@ FileActions.register('all','Rename',function(){return OC.imagePath('core','actio
FileList.rename(filename);
});
-//FileActions.setDefault('all','Download');
-
FileActions.register('dir','Open','',function(filename){
window.location='index.php?dir='+$('#dir').val()+'/'+filename;
});
-FileActions.setDefault('dir','Open');
+FileActions.setDefault('dir','Open');
+
+FileActions.register('text','Edit','',function(filename){
+ showFileEditor($('#dir').val(),filename);
+});
+
+FileActions.setDefault('text','Edit');
+
+FileActions.register('application/xml','Edit','',function(filename){
+ showFileEditor($('#dir').val(),filename);
+});
+
+FileActions.setDefault('application/xml','Edit');
diff --git a/files/templates/index.php b/files/templates/index.php
index e2e9dc03001..a63f6e62b63 100644
--- a/files/templates/index.php
+++ b/files/templates/index.php
@@ -50,7 +50,7 @@ if (isset($_['files'])) {
<?php echo($_['fileList']); ?>
</tbody>
</table>
-
+<div id="editor"></div>
<div id="uploadsize-message" title="<?php echo $l->t('Upload too large')?>">
<p>
<?php echo $l->t('The files you are trying to upload exceed the maximum size for file uploads on this server.');?>
diff --git a/files/templates/part.breadcrumb.php b/files/templates/part.breadcrumb.php
index 9a265a9c1ea..63242dd326c 100644
--- a/files/templates/part.breadcrumb.php
+++ b/files/templates/part.breadcrumb.php
@@ -2,4 +2,4 @@
<div class="crumb svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo image_path('core','breadcrumb.png');?>")'>
<a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlspecialchars($crumb["name"]); ?></a>
</div>
- <?php endforeach; ?>
+ <?php endforeach; ?> \ No newline at end of file