invenio-previewer 3.5.0__py2.py3-none-any.whl → 3.6.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -352,6 +352,6 @@ Now define the priority for all previewers by adding the newly created
352
352
  from .ext import InvenioPreviewer
353
353
  from .proxies import current_previewer
354
354
 
355
- __version__ = "3.5.0"
355
+ __version__ = "3.6.0"
356
356
 
357
357
  __all__ = ("__version__", "current_previewer", "InvenioPreviewer")
@@ -1,5 +1,6 @@
1
1
  /* Copyright 2014 Mozilla Foundation
2
2
  * Copyright 2024 TU Wien
3
+ * Copyright 2026 CERN
3
4
  *
4
5
  * Licensed under the Apache License, Version 2.0 (the "License");
5
6
  * you may not use this file except in compliance with the License.
@@ -76,6 +77,7 @@
76
77
  --toolbarButton-pageUp-icon: url("/static/images/pdfjs/previous.svg");
77
78
  --toolbarButton-pageDown-icon: url("/static/images/pdfjs/next.svg");
78
79
  --toolbarButton-fullScreenMode-icon: url("/static/images/pdfjs/fullscreen.svg");
80
+ --toolbarButton-download-icon: url("/static/images/pdfjs/download.svg");
79
81
  }
80
82
  :root:dir(rtl) {
81
83
  --dir-factor: -1;
@@ -298,6 +300,9 @@ body {
298
300
  #fullScreenMode::before {
299
301
  mask-image: var(--toolbarButton-fullScreenMode-icon);
300
302
  }
303
+ #downloadButton::before {
304
+ mask-image: var(--toolbarButton-download-icon);
305
+ }
301
306
  .toolbarField {
302
307
  padding: 4px 7px;
303
308
  margin: 3px 0;
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M9.79407 7.31811H7.86307C7.41807 7.31811 7.19407 7.85711 7.50907 8.17211L10.1911 10.8541C10.3861 11.0491 10.7031 11.0491 10.8981 10.8541L13.5801 8.17211C13.8951 7.85711 13.6721 7.31811 13.2261 7.31811H11.2941V4.38211H11.2961V3.13211H11.2941V2.30811H9.79407V3.13211H9.79107V4.38211H9.79507V7.31811H9.79407Z" fill="black"/>
4
+ <path d="M14 3.13208H12.796V4.38208H14C14.345 4.38208 14.625 4.66208 14.625 5.00708V13.0071C14.625 13.3521 14.345 13.6321 14 13.6321H2C1.655 13.6321 1.375 13.3521 1.375 13.0071V3.00708C1.375 2.66208 1.655 2.38208 2 2.38208H5.643C5.82 2.38208 5.989 2.45808 6.108 2.58908L7.536 4.17508C7.654 4.30708 7.823 4.38208 8 4.38208H8.291V3.13208H8.278L7.036 1.75208C6.681 1.35808 6.173 1.13208 5.642 1.13208H2C0.966 1.13208 0.125 1.97308 0.125 3.00708V13.0071C0.125 14.0411 0.966 14.8821 2 14.8821H14C15.034 14.8821 15.875 14.0411 15.875 13.0071V5.00708C15.875 3.97308 15.034 3.13208 14 3.13208Z" fill="black"/>
5
+ </svg>
@@ -1,5 +1,6 @@
1
1
  /* Copyright 2014 Mozilla Foundation
2
2
  * Copyright 2024 TU Wien
3
+ * Copyright 2026 CERN
3
4
  *
4
5
  * Licensed under the Apache License, Version 2.0 (the "License");
5
6
  * you may not use this file except in compliance with the License.
@@ -50,6 +51,7 @@ document.addEventListener("DOMContentLoaded", () => {
50
51
  const zoomInButton = document.getElementById("zoomInButton");
51
52
  const zoomOutButton = document.getElementById("zoomOutButton");
52
53
  const scaleSelect = document.getElementById("scaleSelect");
54
+ const downloadButton = document.getElementById("downloadButton");
53
55
 
54
56
  const eventBus = new pdfjsViewer.EventBus();
55
57
 
@@ -118,6 +120,22 @@ document.addEventListener("DOMContentLoaded", () => {
118
120
  pdfViewer.currentScaleValue = e.target.value;
119
121
  });
120
122
 
123
+ downloadButton.addEventListener("click", async function() {
124
+ const pdfUrl = new URL(window.location.origin + PDF_URL);
125
+ pdfUrl.searchParams.append("download", "1");
126
+
127
+ const pathComponents = pdfUrl.pathname.split("/");
128
+ const filename = pathComponents[pathComponents.length - 1];
129
+
130
+ // Create and click an invisible link to trigger the download dialog
131
+ const a = document.createElement("a");
132
+ a.href = pdfUrl;
133
+ a.download = filename;
134
+ document.body.appendChild(a);
135
+ a.click();
136
+ document.body.removeChild(a);
137
+ });
138
+
121
139
  // Register event handlers on the event bus
122
140
  eventBus.on("pagechanging", function(e) {
123
141
  pageNumberField.value = e.pageNumber;
@@ -8,7 +8,7 @@
8
8
  under the terms of the MIT License; see LICENSE file for more details.
9
9
  #}
10
10
 
11
- {%- extends config.PREVIEWER_BASE_TEMPLATE %}
11
+ {%- extends config.PREVIEWER_ABSTRACT_TEMPLATE %}
12
12
 
13
13
  {%- block html_tags %}
14
14
  {{ html_tags|safe }}
@@ -26,10 +26,11 @@
26
26
  <script src="{{ url_for('static', filename='js/fullscreen.js') }}" defer></script>
27
27
  {%- endblock %}
28
28
 
29
- {%- block page_body %}
29
+ {%- block panel %}
30
+
30
31
  <input id="pdf-file-uri" type="hidden" value="{{ file.uri }}" />
31
32
  <input id="pdf-enable-scripting" type="hidden" value="{{ config.PREVIEWER_PDF_JS_ENABLE_SCRIPTING|default(false)|lower }}" />
32
- <input id="pdf-document-init-params" type="hidden" value="{{ config.PREVIEWER_PDF_JS_DOCUMENT_INIT_PARAMS|default({})|tojson }}" />
33
+ <input id="pdf-document-init-params" type="hidden" value='{{ config.PREVIEWER_PDF_JS_DOCUMENT_INIT_PARAMS|default({})|tojson }}' />
33
34
 
34
35
  <div id="outerContainer">
35
36
  <div id="mainContainer">
@@ -91,6 +92,11 @@
91
92
  </div>
92
93
 
93
94
  <div id="toolbarViewerRight" class="toolbarHorizontalGroup">
95
+ <div id="downloadContainer" class="toolbarHorizontalGroup">
96
+ <button id="downloadButton" class="toolbarButton presentationMode" title="{{ _("Download PDF file") }}">
97
+ <span>{{ _("Download PDF file") }}</span>
98
+ </button>
99
+ </div>
94
100
  <div id="fullScreenModeContainer" class="toolbarHorizontalGroup">
95
101
  <button id="fullScreenMode" class="toolbarButton presentationMode visibleLargeView" title="Toggle Fullscreen Mode" tabindex="0">
96
102
  <span>{{ _("Toggle Fullscreen Mode") }}</span>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: invenio-previewer
3
- Version: 3.5.0
3
+ Version: 3.6.0
4
4
  Summary: Invenio module for previewing files.
5
5
  Home-page: https://github.com/inveniosoftware/invenio-previewer
6
6
  Author: CERN
@@ -96,6 +96,15 @@ available at: https://github.com/webrecorder/replayweb.page
96
96
  Changes
97
97
  =======
98
98
 
99
+ Version v3.6.0 (released 2026-01-15)
100
+
101
+ - feat(pdfjs): add download button
102
+ - fix(pdfjs): change inherited template for pdfjs
103
+
104
+ Version v3.5.1 (released 2025-11-20)
105
+
106
+ - fix(pdfjs): use single quotes for passing init config
107
+
99
108
  Version v3.5.0 (released 2025-11-12)
100
109
 
101
110
  - feat(pdfjs): allow passing parameters to document init
@@ -1,4 +1,4 @@
1
- invenio_previewer/__init__.py,sha256=LfePbqHmkb3MDjzDjK59K9ddMMK9ExKJKgnm2UCX31c,12292
1
+ invenio_previewer/__init__.py,sha256=5SIYF9xfgEy41pg_x4vxtdwvG7tbKHZks-XM_FyavYc,12292
2
2
  invenio_previewer/api.py,sha256=ntblD3P-nAlVmL6gTx4tJHJmoJp4tOFwoVz8gMh6T5U,1708
3
3
  invenio_previewer/config.py,sha256=7QCbs8zJhVGyaBFo0UPW-w9HX_nPxsEqdltv-eTQt1Q,2627
4
4
  invenio_previewer/ext.py,sha256=lWGOZXP78qv2PaA0lnrWkEGZ6C0kz9Mx1ioxcpnKfho,4559
@@ -44,14 +44,15 @@ invenio_previewer/extensions/video_videojs.py,sha256=O1JjhT-t8XLiTw1ii1WLzF5o9Qy
44
44
  invenio_previewer/extensions/web_archive.py,sha256=dfrBOFY973ifHWL_Ynp6iQ24mYtdxkv4m8OE-xyWDPY,980
45
45
  invenio_previewer/extensions/xml_prismjs.py,sha256=WO1_wyjO9NxthMDOscTQbEeiF1i0hcNOReNJGOZw9Ao,1908
46
46
  invenio_previewer/extensions/zip.py,sha256=DJQusuk8o7V0fDw3xB0D82-pTFne4IBpnSgTw0MFtUk,3306
47
- invenio_previewer/static/css/pdfjs.css,sha256=cWPYJL6YlsKbIxRrs9OmNRPE1ad1sSW9EKQSIwueieI,19151
47
+ invenio_previewer/static/css/pdfjs.css,sha256=iIkHusfVZYE-H0cZfjjxuUmJdJ_m8sk2Qgyuop7WNK0,19327
48
+ invenio_previewer/static/images/pdfjs/download.svg,sha256=X2_9DnNFAwKL6KEUkRaYWV81aPmS8pyfirSLjnZKRnQ,1091
48
49
  invenio_previewer/static/images/pdfjs/fullscreen.svg,sha256=31XHxh4f5WFFX19sPv78qdzlraLuy86XdEnGjiZ_LN4,2304
49
50
  invenio_previewer/static/images/pdfjs/minus.svg,sha256=W6wdyHKtb3SBRK-ljhbyK4afyS3HWJ180FYTu3gSYCg,1466
50
51
  invenio_previewer/static/images/pdfjs/next.svg,sha256=s8cVHIiKmueVrJclJ-guEFe_76t_Tq70VMWSW1xqrVA,577
51
52
  invenio_previewer/static/images/pdfjs/plus.svg,sha256=jHVi4RtaGnJAeMHeTZ6fsysRx568VzbFFvraL9PmCyY,1490
52
53
  invenio_previewer/static/images/pdfjs/previous.svg,sha256=zC_FFUD9qeGmieo3UwaekoU3L8aTgxp2WTHLOT3HvDE,577
53
54
  invenio_previewer/static/js/fullscreen.js,sha256=1FIvn_zJSgCkrzy8NZTQ3jNUrnaCUfzZOyaFCFzY_vc,1845
54
- invenio_previewer/static/js/open_pdf.js,sha256=etxTvTbPiNnG3gxL3TPc37jTNKdOVeYIHppkUwvhxcA,5858
55
+ invenio_previewer/static/js/open_pdf.js,sha256=vWsL_piMYX2mhToKamHiVO7lv-s-L1NfhrNDLwD1Ej4,6497
55
56
  invenio_previewer/templates/invenio_previewer/abstract_previewer.html,sha256=oeiYsCclUn_uu_NXa42IifG63ilhOYxPXWXOa1J-C-A,563
56
57
  invenio_previewer/templates/invenio_previewer/base.html,sha256=SnDtG7ru1USS6ihU9By_VN-Lv1SW5Wu_Z1rAdUFGTL8,803
57
58
  invenio_previewer/templates/invenio_previewer/bottom.html,sha256=TcHhwCwyhMJKISw1FG7kzhJxw5qlyQdTfkvJncGhu7k,2190
@@ -61,7 +62,7 @@ invenio_previewer/templates/invenio_previewer/ipynb.html,sha256=UACHV9vaGYnnZ5gu
61
62
  invenio_previewer/templates/invenio_previewer/json_prismjs.html,sha256=RT54rrIgDUltgm6Ud0zz3QhgBU1ruZg4cKkABmVOe1Q,387
62
63
  invenio_previewer/templates/invenio_previewer/macros.html,sha256=_ES1RvdaXYhOnIUBVn-YFhbuW4KhRduZrSOpez6PR_0,2519
63
64
  invenio_previewer/templates/invenio_previewer/mistune.html,sha256=DPWzm079QlLhmw1l6mtvGsggznwYoton43oJBQItTs0,483
64
- invenio_previewer/templates/invenio_previewer/pdfjs.html,sha256=Hsg0hVDkddTUw8pK2M9uUPa5r8ICjyR6i8yn0t0MGVM,7108
65
+ invenio_previewer/templates/invenio_previewer/pdfjs.html,sha256=IiHn-YAarZE3jMc11r-JxF3iFXKm6pwcKKWgcSO20dE,7421
65
66
  invenio_previewer/templates/invenio_previewer/simple_image.html,sha256=yCbmWrGgrZ--I8ZbKWSJvlNLzzEqV2ay4_Klzon-cBw,391
66
67
  invenio_previewer/templates/invenio_previewer/top.html,sha256=8Ry8B0BXv2hxLjPCp1XwJssL7M0r7ENwZTzMb29vC5Q,682
67
68
  invenio_previewer/templates/invenio_previewer/txt.html,sha256=yiStQx2nGoVvNpFWXW3SihjwyleL8ffu1HFTWIIBePE,511
@@ -146,10 +147,10 @@ invenio_previewer/translations/zh_CN/LC_MESSAGES/messages.mo,sha256=F75XtB6vrlNO
146
147
  invenio_previewer/translations/zh_CN/LC_MESSAGES/messages.po,sha256=YKEqdgACVuwj7DroAVz4b60ZeiDx3nLfB5RzXHpTF74,16227
147
148
  invenio_previewer/translations/zh_TW/LC_MESSAGES/messages.mo,sha256=uMZNBr5-xusB4mmh8075J9LAp0lYDvILQcMwxGlhATc,807
148
149
  invenio_previewer/translations/zh_TW/LC_MESSAGES/messages.po,sha256=S8o0foNsG4pLH8VwXu8Fq51ngLQIBkhpJ1Nfa3CEZbU,15485
149
- invenio_previewer-3.5.0.dist-info/licenses/AUTHORS.rst,sha256=wcFhv9iJlZPq0MkvNHDVBEn5iXZGsVfC32yjS2jW9CQ,486
150
- invenio_previewer-3.5.0.dist-info/licenses/LICENSE,sha256=p3bBZtg1gwhzibgFe4OuiiUStzewJS5TD6MC5Vu1uSM,1067
151
- invenio_previewer-3.5.0.dist-info/METADATA,sha256=ghLnS-FBPU63Jt5Ac9fPm6eEco7zZUWoozPfKzb0spM,9503
152
- invenio_previewer-3.5.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
153
- invenio_previewer-3.5.0.dist-info/entry_points.txt,sha256=gYe4eWC5Pul52jSjV_sdeIffYCm6KzwHhNkUsxrm7vc,916
154
- invenio_previewer-3.5.0.dist-info/top_level.txt,sha256=BwA4Jo3Wv0rLjDkEuCEIR2W-lz1EXRc7h9jzDwaMK3o,18
155
- invenio_previewer-3.5.0.dist-info/RECORD,,
150
+ invenio_previewer-3.6.0.dist-info/licenses/AUTHORS.rst,sha256=wcFhv9iJlZPq0MkvNHDVBEn5iXZGsVfC32yjS2jW9CQ,486
151
+ invenio_previewer-3.6.0.dist-info/licenses/LICENSE,sha256=p3bBZtg1gwhzibgFe4OuiiUStzewJS5TD6MC5Vu1uSM,1067
152
+ invenio_previewer-3.6.0.dist-info/METADATA,sha256=NbECY-gZyi9Gd0klLtn1YCrsJYR4tE1CMdFpdFajxWQ,9722
153
+ invenio_previewer-3.6.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
154
+ invenio_previewer-3.6.0.dist-info/entry_points.txt,sha256=gYe4eWC5Pul52jSjV_sdeIffYCm6KzwHhNkUsxrm7vc,916
155
+ invenio_previewer-3.6.0.dist-info/top_level.txt,sha256=BwA4Jo3Wv0rLjDkEuCEIR2W-lz1EXRc7h9jzDwaMK3o,18
156
+ invenio_previewer-3.6.0.dist-info/RECORD,,