Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_texteditor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/public-share.js6
-rw-r--r--lib/Controller/PublicFileHandlingController.php7
2 files changed, 4 insertions, 9 deletions
diff --git a/js/public-share.js b/js/public-share.js
index eb00eb0..28edf39 100644
--- a/js/public-share.js
+++ b/js/public-share.js
@@ -86,11 +86,11 @@ $(document).ready(function(){
$.ajax({
url: OC.generateUrl('/apps/files_texteditor/public/{token}', { token: sharingToken }),
headers: {
- 'Range': 'bytes=0-1000'
+ 'Range': 'bytes=0-524288'
}
}).success(function(content) {
var textDiv = $('<div/>').addClass('text-preview default-overridden');
- textDiv.text(content.filecontents);
+ textDiv.text(content);
previewElement
.removeClass('icon-loading')
@@ -98,7 +98,7 @@ $(document).ready(function(){
.append(textDiv);
var divHeight = textDiv.height();
- if (content.filecontents.length > 999) {
+ if (content.length > 50000) {
var ellipsis = $('<div/>').addClass('ellipsis');
ellipsis.html('(&#133;)');
ellipsis.appendTo('#imgframe');
diff --git a/lib/Controller/PublicFileHandlingController.php b/lib/Controller/PublicFileHandlingController.php
index d5b1db5..42a38bd 100644
--- a/lib/Controller/PublicFileHandlingController.php
+++ b/lib/Controller/PublicFileHandlingController.php
@@ -127,12 +127,7 @@ class PublicFileHandlingController extends Controller{
}
return new DataResponse(
- [
- 'filecontents' => $fileContents,
- 'writeable' => false,
- 'mime' => $node->getMimeType(),
- 'mtime' => $node->getMTime(),
- ],
+ $fileContents,
Http::STATUS_OK
);
}