An idea to suggest that this is just a sample of the full text

This commit is contained in:
Olivier Paroz 2015-04-18 22:11:36 +02:00
parent 530c290555
commit a968877a8b
2 changed files with 15 additions and 1 deletions

View File

@ -29,6 +29,7 @@
#imgframe .text-preview {
display: inline-block;
position: relative;
text-align: left;
white-space: pre-wrap;
overflow-y: auto;
@ -41,6 +42,16 @@
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
z-index: 1;
}
#imgframe .watermark {
color: #E3E3E3;
font-size: 75pt;
position: absolute;
width: 80%;
top: 100px;
z-index: 0;
}
/* fix multiselect bar offset on shared page */

View File

@ -118,7 +118,7 @@ OCA.Sharing.PublicApp = {
url: url,
headers: {Range: "bytes=0-1000"}
}).then(function (data) {
var textDiv = $('<span/>').addClass('text-preview');
var textDiv = $('<div/>').addClass('text-preview');
textDiv.text(data);
textDiv.appendTo('#imgframe');
var divHeight = textDiv.height();
@ -129,6 +129,9 @@ OCA.Sharing.PublicApp = {
if (divHeight > previewHeight) {
textDiv.height(previewHeight);
}
var watermark = $('<div/>').addClass('watermark');
watermark.text('SAMPLE');
watermark.appendTo('#imgframe');
});
} else if (previewSupported === 'true' ||
mimetype.substr(0, mimetype.indexOf('/')) === 'image' &&