Attention ! Gitlab fournissant maintenant nativement des certificats Let’s Encrypt aux domaines personnalisés des Gitlab Pages, nous avons coupé notre service qui le faisait automatiquement pour vous.

Il est impératif, pour que votre domaine personnalisé continue à avoir un certificat Let’s Encrypt à jour, d’activer la fonctionnalité native dans les paramètres de votre projet. Cette activation remplacera votre certificat actuel par un nouveau certificat Let’s Encrypt géré par Gitlab.

Voir les détails sur https://docs.framasoft.org/fr/gitlab/gitlab-pages-le.html

Commit 92a18516 authored by Thierry BUGEAT's avatar Thierry BUGEAT

#26 Localize times. Performances issues

parent 65459571
......@@ -1174,7 +1174,7 @@
if ((params.entries.theme == 'list') && (!_isSmallEntry)) {
_content = _content + '<div class="my-'+_theme+'-entry-l ' + _ratioClass + '" i="' + i + '">';
_content = _content + '<span class="my-'+_theme+'-feed-title">' + _entrie._myFeedInformations.title + '</span>';
_content = _content + '<span class="my-'+_theme+'-date">' + _time + '</span>';
_content = _content + '<span class="my-'+_theme+'-date" publishedDate="' + _entrie.publishedDate + '">' + _time + '</span>';
_content = _content + '<div class="my-'+_theme+'-image-wrapper">' + _imageUrl + '</div>';
_content = _content + '<span class="my-'+_theme+'-title">' + _accountIcone + _entrie.title + '</span>';
_content = _content + '<span class="my-'+_theme+'-snippet">' + _entrie.contentSnippet + '</span>';
......@@ -1186,7 +1186,7 @@
} else if (params.entries.theme == 'list') {
_content = _content + '<div class="_online_ _small_ my-'+_theme+'-entry-s ' + _ratioClass + '" i="' + i + '" entry_link="' + _entrie.link + '">';
_content = _content + '<span class="my-'+_theme+'-feed-title">' + _entrie._myFeedInformations.title + '</span>';
_content = _content + '<span class="my-'+_theme+'-date">' + _time + '</span>';
_content = _content + '<span class="my-'+_theme+'-date" publishedDate="' + _entrie.publishedDate + '">' + _time + '</span>';
_content = _content + '<div class="my-'+_theme+'-image-wrapper">' + _imageUrl + '</div>';
_content = _content + '<span class="my-'+_theme+'-title">' + _accountIcone + _entrie.title + '</span>';
_content = _content + '<span class="my-'+_theme+'-snippet">' + _entrie.contentSnippet + '</span>';
......@@ -1200,7 +1200,7 @@
_content = _content + '<span class="my-'+_theme+'-title">' + _accountIcone + _entrie.title + '</span>';
_content = _content + '<span class="my-'+_theme+'-feed-title">' + _entrie._myFeedInformations.title + '</span>';
_content = _content + _imageUrl;
_content = _content + '<span class="my-'+_theme+'-date">' + _time + '</span>';
_content = _content + '<span class="my-'+_theme+'-date" publishedDate="' + _entrie.publishedDate + '">' + _time + '</span>';
_content = _content + '<span class="my-'+_theme+'-snippet">' + _entrie.contentSnippet + '</span>';
_content = _content + '</div>';
......@@ -1211,7 +1211,7 @@
_content = _content + '<span class="my-'+_theme+'-title">' + _accountIcone + _entrie.title + '</span>';
_content = _content + '<span class="my-'+_theme+'-feed-title">' + _entrie._myFeedInformations.title + '</span>';
_content = _content + _imageUrl;
_content = _content + '<span class="my-'+_theme+'-date">' + _time + '</span>';
_content = _content + '<span class="my-'+_theme+'-date" publishedDate="' + _entrie.publishedDate + '">' + _time + '</span>';
_content = _content + '</div>';
_nbEntriesDisplayed['small']++;
......@@ -1414,7 +1414,7 @@
_srcDoc = _srcDoc + _srcDocCss; // Inline CSS from file "style/inline.css.js"
_srcDoc = _srcDoc + '<div class="entrie-title">' + _entry.title.replace(_regex, "&#39;") + '</div>';
_srcDoc = _srcDoc + '<div class="entrie-date">' + _entry._myLocalizedDate + ' ' + _entry._myLocalizedTime + '</div>';
_srcDoc = _srcDoc + '<div class="entrie-date">' + new Date(_entry.publishedDate).toLocaleString() + '</div>';
_srcDoc = _srcDoc + _author;
_srcDoc = _srcDoc + '<div class="entrie-feed-title"><a href="' + _entry._myFeedInformations.link + '">' + _entry._myFeedInformations.title.replace(_regex, "&#39;") + '</a></div>';
_srcDoc = _srcDoc + '<div class="entrie-contentSnippet">' + _entry.content.replace(_regex, "&#39;") + '</div>';
......@@ -1637,6 +1637,20 @@
}
}
/**
* Localize times who are visibles in viewport
* */
function localizeTimes() {
var className = 'my-'+params.entries.theme+'-date';
var elements = document.getElementsByClassName(className);
for (var i = 0; i < elements.length; i++) {
if (isInViewport(elements[i]) && (elements[i].textContent == "")) {
var _publishedDate = elements[i].getAttribute('publishedDate');
elements[i].textContent = new Date(_publishedDate).toLocaleTimeString(userLocale);
}
}
}
/**
* Load images who are visibles in viewport
* */
......@@ -1755,6 +1769,14 @@
setInterval(function() {
loadImages();
}, 200);
// ======================
// --- Localize times ---
// ======================
setInterval(function() {
localizeTimes();
}, 500);
// ==============
// --- Events ---
......
......@@ -192,12 +192,15 @@ GoogleFeed.prototype.addEntries = function(entries) {
// Dans le timestamp en "ms" j'ajoute une valeur aléatoire pour ne pas avoir 2 dates de publication identiques.
// J'ajoute une valeur comprise entre 0 et 500 (0 à 0.5 seconde).
//
_entry['_myTimestamp'] = Math.round(new Date(_entry.publishedDate).getTime()/1000);
_entry['_myTimestampInMs'] = Math.round(new Date(_entry.publishedDate).getTime()) + (Math.floor(Math.random()*500));
var _date = new Date(_entry.publishedDate);
_entry['_myTimestamp'] = Math.round(_date.getTime()/1000);
_entry['_myTimestampInMs'] = Math.round(_date.getTime()) + (Math.floor(Math.random()*500));
_entry['_myLocalizedDate'] = ""; // Due to severe performances issues dates are generated later
_entry['_myLocalizedTime'] = ""; // Due to severe performances issues times are generated later
//_entry['_myLocalizedTime'] = _date.toLocaleTimeString(userLocale);
_entry['_myPublishedDateUTC'] = new Date(_entry.publishedDate).toUTCString();
_entry['_myLocalizedDate'] = new Date(_entry.publishedDate).toLocaleDateString(userLocale);
_entry['_myLocalizedTime'] = new Date(_entry.publishedDate).toLocaleTimeString(userLocale);
_entry['_mySha256_title'] = (_entry['_myFeedInformations']['_myFeedId'] + _entry['title']).toString();
_entry['_mySha256_link'] = (_entry['_myFeedInformations']['_myFeedId'] + _entry['link']).toString();
......@@ -300,9 +303,11 @@ GoogleFeed.prototype.addFeed = function(feed) {
_myNewfeed['_myNbEntries'] = _myNewEntries.length;
// /!\ The 3 following data are false. Entries are not sort by dates
// /!\ The 3 following values are false. Entries are not sorted by dates.
var _date = new Date(_myNewEntries[0].publishedDate);
_myNewfeed['_myLastPublishedDate'] = new Date(_myNewEntries[0].publishedDate).toLocaleDateString(userLocale) + ' ' + new Date(_myNewEntries[0].publishedDate).toLocaleTimeString(userLocale);
_myNewfeed['_myLastPublishedDate'] = _date.toLocaleString(userLocale);
_myNewfeed['_myLastTimestamp'] = _myNewEntries[0]._myTimestamp;
_myNewfeed['_myLastTimestampInMs'] = _myNewEntries[0]._myTimestampInMs;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment