mirror of
https://github.com/django-components/django-components.git
synced 2025-08-18 05:00:15 +00:00
Deployed c76f819
to 0.123 with MkDocs 1.6.1 and mike 2.1.3
This commit is contained in:
parent
0b83c7f1f9
commit
2f4b15ad92
167 changed files with 12436 additions and 3 deletions
2
0.123/js/timeago.min.js
vendored
Normal file
2
0.123/js/timeago.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
33
0.123/js/timeago_mkdocs_material.js
Normal file
33
0.123/js/timeago_mkdocs_material.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
// Script to ensure timeago keeps working when
|
||||
// used with mkdocs-material's instant loading feature
|
||||
|
||||
function getLocale(element) {
|
||||
var raw_locale = element.getAttribute('locale');
|
||||
var locale = {
|
||||
bn: 'bn_IN',
|
||||
en: 'en_US',
|
||||
hi: 'hi_IN',
|
||||
id: 'id_ID',
|
||||
nb: 'nb_NO',
|
||||
nn: 'nn_NO',
|
||||
pt: 'pt_BR',
|
||||
zh: 'zh_CN'
|
||||
}[raw_locale];
|
||||
return locale ? locale : raw_locale;
|
||||
}
|
||||
|
||||
if (typeof document$ !== "undefined") {
|
||||
document$.subscribe(function() {
|
||||
var nodes = document.querySelectorAll('.timeago');
|
||||
if (nodes.length > 0) {
|
||||
var locale = getLocale(nodes[0]);
|
||||
timeago.render(nodes, locale);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
var nodes = document.querySelectorAll('.timeago');
|
||||
if (nodes.length > 0) {
|
||||
var locale = getLocale(nodes[0]);
|
||||
timeago.render(nodes, locale);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue