From 76ae5d9f597b9d8060259e12cc445a79b4dfdad7 Mon Sep 17 00:00:00 2001 From: fletcherhaz Date: Fri, 23 Oct 2020 17:39:07 -0600 Subject: [PATCH] Switch back to SingleFile from SingleFileZ (#1904) Our SingleFileZ integration would save images inside directories following the SingleFileZ format. However, Zotero does not support syncing sub-directories of attachments. This commit switch back to a single HTML file with base64 encoded resources. We think that the 33% increase in resources will be offset by the compression of HTML and removal of JavaScript and unused CSS. This commit does not fix past snapshots that were saved using SingleFileZ. --- .gitmodules | 3 + chrome/content/zotero/about.xul | 2 +- chrome/content/zotero/xpcom/attachments.js | 37 +-- .../xpcom/connector/server_connector.js | 144 +++++---- chrome/content/zotero/xpcom/http.js | 15 + chrome/content/zotero/xpcom/singlefile.js | 23 +- .../xpcom/translation/translate_item.js | 18 +- .../zotero/xpcom/utilities_internal.js | 126 +------- resource/SingleFile | 1 + scripts/babel-worker.js | 47 +-- scripts/config.js | 21 +- test/tests/attachmentsTest.js | 83 ++--- test/tests/server_connectorTest.js | 302 +++++++++++++----- 13 files changed, 404 insertions(+), 418 deletions(-) create mode 160000 resource/SingleFile diff --git a/.gitmodules b/.gitmodules index d7fef096be..e8708c5cf6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,3 +29,6 @@ [submodule "resource/SingleFileZ"] path = resource/SingleFileZ url = https://github.com/gildas-lormeau/SingleFileZ.git +[submodule "resource/SingleFile"] + path = resource/SingleFile + url = https://github.com/gildas-lormeau/SingleFile.git diff --git a/chrome/content/zotero/about.xul b/chrome/content/zotero/about.xul index 9cdcfd195b..d37faa6c84 100644 --- a/chrome/content/zotero/about.xul +++ b/chrome/content/zotero/about.xul @@ -80,7 +80,7 @@