diff options
-rw-r--r-- | appinfo/database.xml | 55 | ||||
-rw-r--r-- | appinfo/info.xml | 2 | ||||
-rw-r--r-- | js/documents.js | 20 | ||||
-rw-r--r-- | js/viewer/viewer.js | 42 | ||||
-rw-r--r-- | lib/Preview/Office.php | 6 |
5 files changed, 12 insertions, 113 deletions
diff --git a/appinfo/database.xml b/appinfo/database.xml index 1a33e72f..61dd5f64 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -4,61 +4,6 @@ <create>true</create> <overwrite>false</overwrite> <charset>utf8</charset> - <table> - <name>*dbprefix*richdocuments_member</name> - <declaration> - - <field> - <name>member_id</name> - <type>integer</type> - <notnull>true</notnull> - <autoincrement>1</autoincrement> - <unsigned>true</unsigned> - <length>4</length> - <comments>Unique per user and session</comments> - </field> - <field> - <name>uid</name> - <type>text</type> - <length>64</length> - </field> - <field> - <name>color</name> - <type>text</type> - <length>32</length> - </field> - <field> - <name>last_activity</name> - <type>integer</type> - <unsigned>true</unsigned> - <length>4</length> - </field> - <field> - <name>is_guest</name> - <type>integer</type> - <default>0</default> - <notnull>true</notnull> - <unsigned>true</unsigned> - <length>1</length> - </field> - <field> - <name>token</name> - <type>text</type> - <default></default> - <notnull>false</notnull> - <length>32</length> - </field> - <field> - <name>status</name> - <type>integer</type> - <default>1</default> - <notnull>true</notnull> - <unsigned>true</unsigned> - <length>1</length> - </field> - - </declaration> - </table> <table> <name>*dbprefix*richdocuments_wopi</name> diff --git a/appinfo/info.xml b/appinfo/info.xml index 37406a09..6ee8d8a8 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -25,7 +25,7 @@ <screenshot>https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-presentation.png</screenshot> <screenshot>https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-spreadsheet.png</screenshot> <dependencies> - <nextcloud min-version="13" max-version="16" /> + <nextcloud min-version="15" max-version="16" /> </dependencies> <background-jobs> <job>OCA\Richdocuments\Backgroundjobs\ObtainCapabilities</job> diff --git a/js/documents.js b/js/documents.js index 3311baa7..310d044d 100644 --- a/js/documents.js +++ b/js/documents.js @@ -514,12 +514,7 @@ var documentsMain = { documentsMain.$deferredVersionRestoreAck = $.Deferred(); jQuery.when(documentsMain.$deferredVersionRestoreAck).done(function(args) { - var nextcloudVersion = parseInt(parent.oc_config.version.split('.')[0]); - if (nextcloudVersion < 15) { - self._restoreAjax(version); - } else { - self._restoreDAV(version) - } + self._restoreDAV(version) }); // resolve the deferred object immediately if client doesn't support version states @@ -559,19 +554,6 @@ var documentsMain = { }); }, - _restoreAjax: function(version) { - var restoreUrl = OC.generateUrl('apps/files_versions/ajax/rollbackVersion.php?file={file}&revision={revision}', - { - file: documentsMain.fullPath, revision: version - }); - $.ajax({ - type: 'GET', - url: restoreUrl, - success: this._restoreSuccess, - error: this._restoreError - }); - }, - showEditor : function(title, fileId, action){ if (documentsMain.loadError) { documentsMain.onEditorShutdown(documentsMain.loadErrorMessage + '\n' + documentsMain.loadErrorHint); diff --git a/js/viewer/viewer.js b/js/viewer/viewer.js index 7c8e8125..48ce7a15 100644 --- a/js/viewer/viewer.js +++ b/js/viewer/viewer.js @@ -119,12 +119,7 @@ var odfViewer = { $('#controls').addClass('hidden'); $('#content').addClass('loading'); } else { - if (odfViewer.nextcloudVersion < 14) { - $iframe.css('height', '100%'); - $('#app-content').css('overflow', 'hidden'); - } else { - $('body').css('overflow', 'hidden'); - } + $('body').css('overflow', 'hidden'); $('#app-content').append($iframe); if ($('header').length) { var $button = $('<div class="richdocuments-sharing"><a class="icon-shared icon-white"></a></div>'); @@ -158,11 +153,7 @@ var odfViewer = { $('#richdocuments-avatars').remove(); $('#richdocuments-actions').remove(); $('.searchbox').show(); - if (odfViewer.nextcloudVersion < 14) { - $('#app-content').css('overflow', 'auto'); - } else { - $('body').css('overflow', 'auto'); - } + $('body').css('overflow', 'auto'); if ($('#isPublic').val()) { $('#content').removeClass('full-height'); @@ -372,6 +363,7 @@ var odfViewer = { }; $(document).ready(function() { + // register file actions and menu if ( typeof OCA !== 'undefined' && typeof OCA.Files !== 'undefined' && typeof OCA.Files.fileActions !== 'undefined' @@ -386,36 +378,20 @@ $(document).ready(function() { // register() needs to be re-run to re-register the fileActions. odfViewer.register(); - var getSettings = $.get(OC.filePath('richdocuments', 'ajax', 'settings.php')); - var getCapabilities = $.Deferred().resolve(); - - if (typeof oc_capabilities === 'undefined') { - getCapabilities = $.get(OC.linkToOCS('cloud', 2) + 'capabilities?format=json', function (data) { - oc_capabilities = data.ocs.data.capabilities; - }) - } - $.when(getSettings, getCapabilities).done(function(settings, capabilities) { - odfViewer.registerFilesMenu(settings[0]); + $.get(OC.filePath('richdocuments', 'ajax', 'settings.php')).done(function(settings) { + odfViewer.registerFilesMenu(settings); }) } -}); -// FIXME: Hack for single public file view since it is not attached to the fileslist -$(document).ready(function(){ - // FIXME: Filter compatible mime types + // Open documents if a public page is opened for a supported mimetype if ($('#isPublic').val() && odfViewer.supportedMimes.indexOf($('#mimetype').val()) !== -1) { odfViewer.onEdit($('#filename').val()); } -}); - -$(document).ready(function() { - var eventMethod = window.addEventListener ? 'addEventListener' : 'attachEvent'; - var eventer = window[eventMethod]; - var messageEvent = eventMethod == 'attachEvent' ? 'onmessage' : 'message'; - eventer(messageEvent,function(e) { - if(e.data === 'close') { + // listen to message from the viewer for closing/loading actions + window.addEventListener('message', function(e) { + if (e.data === 'close') { odfViewer.onClose(); } else if(e.data === 'loading') { $('#content').removeClass('loading'); diff --git a/lib/Preview/Office.php b/lib/Preview/Office.php index a94f8a6c..d80c83cc 100644 --- a/lib/Preview/Office.php +++ b/lib/Preview/Office.php @@ -67,11 +67,7 @@ abstract class Office extends Provider { $options['verify'] = false; } - if (version_compare($this->config->getSystemValue('version'), '14.0.0.0', '<')) { - $options['body'] = new \GuzzleHttp\Post\PostFile($path, $stream); // Since we upgraded guzzle in NC14 we have to do some dark magic here - } else { - $options['multipart'] = [['name' => $path, 'contents' => $stream]]; - } + $options['multipart'] = [['name' => $path, 'contents' => $stream]]; try { $response = $client->post($this->getWopiURL(). '/lool/convert-to/png', $options); |