Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix istex legacy blank page #2017

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,14 @@
"istex": {
"host": "/",
"title": "Services",
"summary": "Les technologies et les outils ISTEX pour les projets de recherche."
"summary": "Les technologies et les outils ISTEX pour les projets de recherche.",
"matomoID": "39"
},
"istex-legacy": {
"host": "/",
"title": "Services",
"summary": "Les technologies et les outils ISTEX pour les projets de recherche.",
"matomoID": "39"
},
"inist": {
"title": "Etudes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@
</a>
<div id="pageText" class="pageHead-texte">
<div id="pageTitle">
<%= theme.title %>
<%= custom.title %>
</div>
<p id="pageSubTitle" class="text-center">
<%= theme.summary %>
<%= custom.summary %>
</p>
</div>
</div>
Expand All @@ -117,13 +117,16 @@
</div>
</footer>
<!-- Footer - bloc-8 END -->
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<script src="/js/responsiveMenu.js"></script>
<script src="/js/tooltip.js"></script>
<!-- Piwik -->
<script src="<%= theme.base.href %>/themes/istex/js/jquery-3.6.0.min.js"></script>
<script src="<%= theme.base.href %>/themes/istex/js/responsiveMenu.js"></script>
<script src="<%= theme.base.href %>/themes/istex/js/tooltip.js"></script>
<script>
window.__PRELOADED_STATE__ = <%- lodex.preload %>;
window.__TENANT__ = '<%= lodex.tenant %>';
window.ISTEX_API_URL = '<%= lodex.istexApi %>';
</script>
<script src="<%= lodex.base.href %>/index.js"></script>
<!-- Piwik -->
<script>
var _paq = _paq || [];
_paq.push([
Expand All @@ -146,7 +149,7 @@
(function () {
var u = "https://piwik2.inist.fr/";
_paq.push(["setTrackerUrl", u + "piwik.php"]);
_paq.push(["setSiteId", "39"]);
_paq.push(["setSiteId", "<%= custom.matomoID %>"]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
Expand Down
4 changes: 2 additions & 2 deletions src/app/custom/themes/istex-legacy/lodex-theme.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2",
"version": "3",
"restricted": true,
"name": {
"fr": "ISTEX",
Expand All @@ -12,7 +12,7 @@
"files": {
"theme": {
"main": "customTheme.js",
"index": "index.html"
"index": "index.ejs"
}
}
}
41 changes: 38 additions & 3 deletions src/app/custom/themes/istex/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,41 @@
window.__TENANT__ = '<%= lodex.tenant %>';
window.ISTEX_API_URL = '<%= lodex.istexApi %>';
</script>
<script src="<%= lodex.base.href %>/index.js"></script>
</body>
</html>
<script src="<%= lodex.base.href %>/index.js"></script>
<!-- Piwik -->
<script>
var _paq = _paq || [];
_paq.push([
function () {
var self = this;
function getOriginalVisitorCookieTimeout() {
var now = new Date(),
nowTs = Math.round(now.getTime() / 1000),
visitorInfo = self.getVisitorInfo();
var createTs = parseInt(visitorInfo[2]);
var cookieTimeout = 33696000;
var originalTimeout = createTs + cookieTimeout - nowTs;
return originalTimeout;
}
this.setVisitorCookieTimeout(getOriginalVisitorCookieTimeout());
}
]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function () {
var u = "https://piwik2.inist.fr/";
_paq.push(["setTrackerUrl", u + "piwik.php"]);
_paq.push(["setSiteId", "<%= custom.matomoID %>"]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
g.type = "text/javascript";
g.async = true;
g.defer = true;
g.src = u + "piwik.js";
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Piwik Code -->
</body>
</html>
Loading