diff --git a/.drone.yml b/.drone.yml
index 74bcabbf..ecb0a24d 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -5,7 +5,7 @@ clone:
pipeline:
signed-off-check:
- image: nextcloudci/php7.0:php7.0-2
+ image: nextcloudci/php7.1:php7.1-16
environment:
- APP_NAME=files_pdfviewer
- CORE_BRANCH=master
diff --git a/.travis.yml b/.travis.yml
index 897b64ba..57b22329 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,5 @@
language: php
php:
- - 7.0
- 7.1
- 7.2
- 7.3
@@ -52,13 +51,13 @@ script:
matrix:
include:
- - php: 7.0
+ - php: 7.1
env: DB=mysql
- - php: 7.0
+ - php: 7.1
env: DB=pgsql
- - php: 7.0
+ - php: 7.1
env: DB=mysql;CODECHECK=1
- - php: 7.0
+ - php: 7.1
env: DB=mysql;CODECHECK=2
fast_finish: true
diff --git a/js/previewplugin.js b/js/previewplugin.js
index 7d740f81..66a1882a 100644
--- a/js/previewplugin.js
+++ b/js/previewplugin.js
@@ -40,14 +40,15 @@
/**
* @param downloadUrl
+ * @param param
* @param isFileList
*/
- show: function(downloadUrl, isFileList) {
+ show: function(downloadUrl, param, isFileList) {
var self = this;
var shown = true;
var $iframe;
var viewer = OC.generateUrl('/apps/files_pdfviewer/?file={file}', {file: downloadUrl});
- $iframe = $('');
+ $iframe = $('');
if(isFileList === true) {
FileList.setViewerMode(true);
@@ -117,7 +118,7 @@
actionHandler: function(fileName, context) {
var downloadUrl = context.fileList.getDownloadUrl(fileName, context.dir);
if (downloadUrl && downloadUrl !== '#') {
- self.show(downloadUrl, true);
+ self.show(downloadUrl, param, true);
}
}
});
@@ -132,10 +133,15 @@ OC.Plugins.register('OCA.Files.FileList', OCA.FilesPdfViewer.PreviewPlugin);
// FIXME: Hack for single public file view since it is not attached to the fileslist
$(document).ready(function(){
if ($('#isPublic').val() && $('#mimetype').val() === 'application/pdf') {
+ $.urlParam = function(name){
+ var results = new RegExp('[\?&]' + name + '=([^]*)').exec(window.location.href);
+ return results[1] || 0;
+ };
var sharingToken = $('#sharingToken').val();
+ var page = '#page='+$.urlParam('page');
var downloadUrl = OC.generateUrl('/s/{token}/download', {token: sharingToken});
var viewer = OCA.FilesPdfViewer.PreviewPlugin;
- viewer.show(downloadUrl, false);
+ viewer.show(downloadUrl, page, false);
}
});