Skip to content

Commit

Permalink
CONCD-923 Implement an import map for JavaScript modules (#2500)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasarkar authored Aug 26, 2024
1 parent facc107 commit 05ce45b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion concordia/static/js/src/contribute.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global $ displayMessage buildErrorMessage */

import {reserveAssetForEditing} from './asset-reservation.js';
import {reserveAssetForEditing} from 'asset-reservation';

function lockControls($container) {
if (!$container) {
Expand Down
2 changes: 1 addition & 1 deletion concordia/static/js/src/viewer-split.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {seadragonViewer} from './viewer.js';
import {seadragonViewer} from 'viewer';
import Split from '/static/split.js/dist/split.es.js';

let pageSplit;
Expand Down
12 changes: 8 additions & 4 deletions concordia/templates/transcriptions/asset_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
data-tile-source-url="{% asset_media_url asset %}?canvas"
></script>

<script type="importmap">
{
"imports": {
"asset-reservation": "{% static 'js/asset-reservation.js' %}",
"viewer": "{% static 'js/viewer.js' %}"
}
}
</script>
<script module src="{% static 'openseadragon/build/openseadragon/openseadragon.min.js' %}"></script>
<script module src="{% static 'openseadragon-filtering/openseadragon-filtering.js' %}"></script>

Expand All @@ -39,10 +47,6 @@
<script type="module" src="{% static 'js/guide.js' %}"></script>
<script type="module" src="{% static 'js/quick-tips-setup.js' %}"></script>
<script type="module" src="{% static 'js/ocr.js' %}"></script>
<script type="module" src="{% static 'js/asset-reservation.js' %}"></script>
<script type="module" src="{% static 'js/viewer.js' %}"

></script>
{% endblock head_content %}

{% block breadcrumbs %}
Expand Down

0 comments on commit 05ce45b

Please sign in to comment.