Skip to content

Commit

Permalink
Integrate with Nextcloud Viewer.
Browse files Browse the repository at this point in the history
Signed-off-by: Ari Selseng <[email protected]>
  • Loading branch information
ariselseng committed Mar 21, 2019
1 parent 2038499 commit 6b1c033
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*.js]
charset = utf-8
indent_style = tab
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/vendor/
/build/
/build/
5 changes: 4 additions & 1 deletion appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
use OCP\AppFramework\App;
$app = new App('camerarawpreviews');
$container = $app->getContainer();
$eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', function() {
script('camerarawpreviews', 'register-viewer'); // adds js/script.js
});
$mimeTypeDetector = \OC::$server->getMimeTypeDetector();

$mimes = $mimeTypeDetector->getAllMappings();
$mimes_to_detect = [
'indd' => ['image/x-indesign'],
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<name>Camera RAW Previews</name>
<summary>Preview and show camera RAW files in Nextcloud/ownCloud</summary>
<description><![CDATA[This app will make previews of &quot;RAW&quot; files from cameras in Nextcloud/ownCloud.]]></description>
<version>0.6.5</version>
<version>0.7.0</version>
<licence>agpl</licence>
<author mail="[email protected]" >Ari Selseng</author>
<namespace>CameraRawPreviews</namespace>
Expand Down
10 changes: 10 additions & 0 deletions js/register-viewer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
document.addEventListener("DOMContentLoaded", function() {
if (OCA.Viewer) {
OCA.Viewer.registerHandler({
id: 'camerarawpreviews',
mimesAliases: {
'image/x-dcraw': 'image/jpeg'
}
})
}
});

0 comments on commit 6b1c033

Please sign in to comment.