From 0250432b23be6a230a25e88b111aa0134f3d4270 Mon Sep 17 00:00:00 2001 From: Mingze Date: Thu, 2 Jan 2020 13:34:41 -0800 Subject: [PATCH] feat(archive): Add archive loader to prepare for conversion feature flip (#1137) --- src/lib/__tests__/Preview-test.js | 2 +- src/lib/constants.js | 3 +-- src/lib/loaders.js | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/__tests__/Preview-test.js b/src/lib/__tests__/Preview-test.js index d5b7df861..54e6060e6 100644 --- a/src/lib/__tests__/Preview-test.js +++ b/src/lib/__tests__/Preview-test.js @@ -2420,7 +2420,7 @@ describe('lib/Preview', () => { stubs.getHeaders = sandbox.stub(util, 'getHeaders'); stubs.headers = { 'X-Rep-Hints': - '[3d][pdf][text][mp3][jpg?dimensions=1024x1024&paged=false][jpg?dimensions=2048x2048,png?dimensions=2048x2048]', + '[3d][pdf][text][mp3][json][jpg?dimensions=1024x1024&paged=false][jpg?dimensions=2048x2048,png?dimensions=2048x2048]', }; preview.options.sharedLink = 'link'; diff --git a/src/lib/constants.js b/src/lib/constants.js index 2218c5caf..b9afc41cb 100644 --- a/src/lib/constants.js +++ b/src/lib/constants.js @@ -93,8 +93,7 @@ export const STATUS_SUCCESS = 'success'; export const STATUS_VIEWABLE = 'viewable'; // X-Rep-Hints for Representations API -export const X_REP_HINT_ARCHIVE = '[json]'; -export const X_REP_HINT_BASE = '[3d][pdf][text][mp3]'; +export const X_REP_HINT_BASE = '[3d][pdf][text][mp3][json]'; export const X_REP_HINT_DOC_THUMBNAIL = '[jpg?dimensions=1024x1024&paged=false]'; export const X_REP_HINT_IMAGE = '[jpg?dimensions=2048x2048,png?dimensions=2048x2048]'; export const X_REP_HINT_VIDEO_DASH = '[dash,mp4][filmstrip]'; diff --git a/src/lib/loaders.js b/src/lib/loaders.js index 6f127dedd..ec0bb9964 100644 --- a/src/lib/loaders.js +++ b/src/lib/loaders.js @@ -1,3 +1,4 @@ +import ArchiveLoader from './viewers/archive/ArchiveLoader'; import ImageLoader from './viewers/image/ImageLoader'; import Image360Loader from './viewers/box3d/image360/Image360Loader'; import SWFLoader from './viewers/swf/SWFLoader'; @@ -11,6 +12,7 @@ import OfficeLoader from './viewers/office/OfficeLoader'; // Order in this list matters export default [ + ArchiveLoader, TextLoader, // should come before document OfficeLoader, // should come before document DocLoader, // should come after text