An idea to suggest that this is just a sample of the full text
This commit is contained in:
parent
530c290555
commit
a968877a8b
2 changed files with 15 additions and 1 deletions
|
@ -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 */
|
||||
|
|
|
@ -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' &&
|
||||
|
|
Loading…
Reference in a new issue