Merge pull request #3246 from owncloud/newfile-mimetype

Files: set the proper mimetype when creating a new text file
This commit is contained in:
Morris Jobke 2013-05-07 01:53:43 -07:00
commit deb0885e46
2 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ if($source) {
}elseif(\OC\Files\Filesystem::touch($dir . '/' . $filename)) {
$meta = \OC\Files\Filesystem::getFileInfo($dir.'/'.$filename);
$id = $meta['fileid'];
OCP\JSON::success(array("data" => array('content'=>$content, 'id' => $id)));
OCP\JSON::success(array("data" => array('content'=>$content, 'id' => $id, 'mime' => $meta['mimetype'])));
exit();
}
}

View File

@ -511,9 +511,9 @@ $(document).ready(function() {
var date=new Date();
FileList.addFile(name,0,date,false,hidden);
var tr=$('tr').filterAttr('data-file',name);
tr.attr('data-mime','text/plain');
tr.attr('data-mime',result.data.mime);
tr.attr('data-id', result.data.id);
getMimeIcon('text/plain',function(path){
getMimeIcon(result.data.mime,function(path){
tr.find('td.filename').attr('style','background-image:url('+path+')');
});
} else {