diff --git a/assets/src/bundles/webapp/iframes.js b/assets/src/bundles/browse/iframe.js similarity index 75% rename from assets/src/bundles/webapp/iframes.js rename to assets/src/bundles/browse/iframe.js index 4a7b5301..225cd629 100644 --- a/assets/src/bundles/webapp/iframes.js +++ b/assets/src/bundles/browse/iframe.js @@ -1,23 +1,23 @@ /** - * Copyright (C) 2021 The Software Heritage developers + * Copyright (C) 2021-2022 The Software Heritage developers * See the AUTHORS file at the top-level directory of this distribution * License: GNU Affero General Public License version 3, or any later version * See top-level LICENSE file for more information */ export function showIframeInfoModal(objectType, objectSWHID) { const html = `

You can embed that ${objectType} view in an external website through the use of an iframe. Use the following HTML code to do so.

<iframe style="width: 100%; height: 500px; border: 1px solid rgba(0, 0, 0, 0.125);"
-        src="${window.location.origin}${Urls.swhid_iframe(objectSWHID.replaceAll('\n', ''))}">
+        src="${window.location.origin}${Urls.browse_swhid_iframe(objectSWHID.replaceAll('\n', ''))}">
 </iframe>
`; swh.webapp.showModalHtml(`Software Heritage ${objectType} iframe`, html, '1000px'); swh.webapp.highlightCode(false, '.swh-iframe-html'); } diff --git a/assets/src/bundles/browse/index.js b/assets/src/bundles/browse/index.js index bda1363c..bccaa22a 100644 --- a/assets/src/bundles/browse/index.js +++ b/assets/src/bundles/browse/index.js @@ -1,18 +1,19 @@ /** - * Copyright (C) 2018 The Software Heritage developers + * Copyright (C) 2018-2022 The Software Heritage developers * See the AUTHORS file at the top-level directory of this distribution * License: GNU Affero General Public License version 3, or any later version * See top-level LICENSE file for more information */ // main bundle for the swh-web/browse application -import './browse.css'; import './breadcrumbs.css'; +import './browse.css'; import './content.css'; import './snapshot-navigation.css'; -export * from './snapshot-navigation'; -export * from './origin-search'; export * from './browse-utils'; +export * from './iframe'; +export * from './origin-search'; +export * from './snapshot-navigation'; export * from './swhid-utils'; diff --git a/assets/src/bundles/webapp/index.js b/assets/src/bundles/webapp/index.js index d4f04bfd..8862ad2a 100644 --- a/assets/src/bundles/webapp/index.js +++ b/assets/src/bundles/webapp/index.js @@ -1,29 +1,27 @@ /** - * Copyright (C) 2018-2021 The Software Heritage developers + * Copyright (C) 2018-2022 The Software Heritage developers * See the AUTHORS file at the top-level directory of this distribution * License: GNU Affero General Public License version 3, or any later version * See top-level LICENSE file for more information */ // webapp entrypoint bundle centralizing global custom stylesheets // and utility js modules used in all swh-web applications // global swh-web custom stylesheets -import './webapp.css'; import './breadcrumbs.css'; import './coverage.css'; - -export * from './webapp-utils'; +import './webapp.css'; // utility js modules +export * from './badges'; export * from './code-highlighting'; -export * from './readme-rendering'; -export * from './pdf-rendering'; -export * from './notebook-rendering'; -export * from './xss-filtering'; export * from './history-counters'; -export * from './badges'; -export * from './sentry'; export * from './math-typesetting'; +export * from './notebook-rendering'; +export * from './pdf-rendering'; +export * from './readme-rendering'; +export * from './sentry'; export * from './status-widget'; -export * from './iframes'; +export * from './webapp-utils'; +export * from './xss-filtering'; diff --git a/swh/web/templates/misc/iframe.html b/swh/web/browse/templates/browse-iframe.html similarity index 97% rename from swh/web/templates/misc/iframe.html rename to swh/web/browse/templates/browse-iframe.html index c89516bb..eb479797 100644 --- a/swh/web/templates/misc/iframe.html +++ b/swh/web/browse/templates/browse-iframe.html @@ -1,182 +1,182 @@ {% comment %} -Copyright (C) 2021 The Software Heritage developers +Copyright (C) 2021-2022 The Software Heritage developers See the AUTHORS file at the top-level directory of this distribution License: GNU Affero General Public License version 3, or any later version See top-level LICENSE file for more information {% endcomment %} {% load static %} {% load render_bundle from webpack_loader %} {% load swh_templatetags %} Software Heritage archived object {% render_bundle 'vendors' %} {% render_bundle 'webapp' %} {% render_bundle 'browse' %}
{% include "includes/show-swhids.html" %}
Software Heritage
Navigating in
{% if swhid != focus_swhid %} -
Reset view
{% endif %} View in the archive
{% if error_code != 200 %} {% include "includes/http-error.html" %} {% elif object_type == "cnt" %} {% include "includes/content-display.html" %} {% elif object_type == "dir" %} {% include "includes/directory-display.html" %} {% endif %}
JavaScript license information {% if object_type == "cnt" %} {% endif %} diff --git a/swh/web/browse/templates/includes/show-swhids.html b/swh/web/browse/templates/includes/show-swhids.html index 42e4df57..a6ad7c61 100644 --- a/swh/web/browse/templates/includes/show-swhids.html +++ b/swh/web/browse/templates/includes/show-swhids.html @@ -1,123 +1,123 @@ {% comment %} -Copyright (C) 2017-2021 The Software Heritage developers +Copyright (C) 2017-2022 The Software Heritage developers See the AUTHORS file at the top-level directory of this distribution License: GNU Affero General Public License version 3, or any later version See top-level LICENSE file for more information {% endcomment %} {% load swh_templatetags %} {% if swhids_info %}