1
0
Fork 0
mirror of https://github.com/Yetangitu/owncloud-apps.git synced 2025-10-02 14:49:17 +02:00

files_reader: v1.2.3

- (#76) typo plus some missing code kept Reader from being used to preview shared files
 - (#79) typo kept Reader from being used by default for CBx
 - (#82) missing setDefault kept actual style settings from being saved
This commit is contained in:
frankdelange 2018-02-25 00:09:49 +01:00
parent adf1b7561e
commit 50a41376c9
5 changed files with 16 additions and 5 deletions

View file

@ -1,3 +1,9 @@
## 1.2.3 - 2018-02-24
### Fixed
- (#76) typo plus some missing code kept Reader from being used to preview shared files
- (#79) typo kept Reader from being used by default for CBx
- (#82) missing setDefault kept actual style settings from being saved
## 1.2.2 - 2018-02-02 ## 1.2.2 - 2018-02-02
### Fixed ### Fixed
- (#75) NC and OC are diverging, NC encodes everything on $settings as JSON, OC does not yet. - (#75) NC and OC are diverging, NC encodes everything on $settings as JSON, OC does not yet.

View file

@ -30,7 +30,7 @@ See [README] for more exhaustive information on features and potential misfeatur
[README]: https://github.com/Yetangitu/owncloud-apps/blob/master/files_reader/README.md [README]: https://github.com/Yetangitu/owncloud-apps/blob/master/files_reader/README.md
]]> ]]>
</description> </description>
<version>1.2.2</version> <version>1.2.3</version>
<licence>AGPL</licence> <licence>AGPL</licence>
<author>Frank de Lange</author> <author>Frank de Lange</author>
<documentation> <documentation>

View file

@ -135,7 +135,7 @@
if (oc_appconfig.filesReader.enableEpub === 'true') if (oc_appconfig.filesReader.enableEpub === 'true')
fileActions.setDefault('application/epub+zip', 'view-epub'); fileActions.setDefault('application/epub+zip', 'view-epub');
if (oc_appconfig.filesReader.enableCbr === 'true') if (oc_appconfig.filesReader.enableCbx === 'true')
fileActions.setDefault('application/x-cbr', 'view-cbr'); fileActions.setDefault('application/x-cbr', 'view-cbr');
if (oc_appconfig.filesReader.enablePdf === 'true') if (oc_appconfig.filesReader.enablePdf === 'true')
fileActions.setDefault('application/pdf', 'view-pdf'); fileActions.setDefault('application/pdf', 'view-pdf');
@ -148,7 +148,11 @@ OC.Plugins.register('OCA.Files.FileList', OCA.Files_Reader.Plugin);
// FIXME: Hack for single public file view since it is not attached to the fileslist // FIXME: Hack for single public file view since it is not attached to the fileslist
$(document).ready(function(){ $(document).ready(function(){
if ($('#isPublic').val() && ($('#mimetype').val() === 'application/epub+zip'|| $('#mimetype').val() === 'application/x-cbr)')) { if ($('#isPublic').val()
&& ($('#mimetype').val() === 'application/epub+zip'
|| $('#mimetype').val() === 'application/pdf'
|| $('#mimetype').val() === 'application/x-cbr')
) {
var sharingToken = $('#sharingToken').val(); var sharingToken = $('#sharingToken').val();
var downloadUrl = OC.generateUrl('/s/{token}/download', {token: sharingToken}); var downloadUrl = OC.generateUrl('/s/{token}/download', {token: sharingToken});
var viewer = OCA.Files_Reader.Plugin; var viewer = OCA.Files_Reader.Plugin;

View file

@ -115,6 +115,7 @@ class PageController extends Controller {
$policy->addAllowedChildSrcDomain('\'self\''); $policy->addAllowedChildSrcDomain('\'self\'');
$policy->addAllowedFontDomain('\'self\''); $policy->addAllowedFontDomain('\'self\'');
$policy->addAllowedFontDomain('data:'); $policy->addAllowedFontDomain('data:');
$policy->addAllowedFontDomain('blob:');
$policy->addAllowedImageDomain('blob:'); $policy->addAllowedImageDomain('blob:');
$response = new TemplateResponse($this->appName, $template, $params, 'blank'); $response = new TemplateResponse($this->appName, $template, $params, 'blank');
@ -135,7 +136,7 @@ class PageController extends Controller {
*/ */
private function getFileInfo($path) { private function getFileInfo($path) {
$count = 0; $count = 0;
$shareToken = preg_replace("/(?:\/index\.php)?\/s\/([A-Za-z0-9]{15})\/download.*/", "$1", $path, 1,$count); $shareToken = preg_replace("/(?:\/index\.php)?\/s\/([A-Za-z0-9]{15,32})\/download.*/", "$1", $path, 1,$count);
if ($count === 1) { if ($count === 1) {

File diff suppressed because one or more lines are too long