/* * Copyright (c) 2013-2014 Lukas Reschke * * This file is licensed under the Affero General Public License version 3 * or later. * * See the COPYING-README file. * */ var isSecureViewerAvailable = function () { return $('#hideDownload').val() === 'true' && typeof OCA.RichDocuments !== 'undefined'; }; (function(OCA) { OCA.FilesPdfViewer = OCA.FilesPdfViewer || {}; /** * @namespace OCA.FilesPdfViewer.PreviewPlugin */ OCA.FilesPdfViewer.PreviewPlugin = { /** * @param fileList */ attach: function(fileList) { this._extendFileActions(fileList.fileActions); }, hide: function() { $('#pdframe').remove(); if ($('#isPublic').val() && $('#filesApp').val()){ $('#controls').removeClass('hidden'); $('#content').removeClass('full-height'); $('footer').removeClass('hidden'); } if (typeof FileList !== 'undefined') { FileList.setViewerMode(false); } // replace the controls with our own $('#app-content #controls').removeClass('hidden'); }, /** * @param downloadUrl * @param param * @param 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 = $('