-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed 3f0230b with MkDocs version: 1.6.0
- Loading branch information
Unknown
committed
Aug 19, 2024
1 parent
c7220eb
commit e4bc988
Showing
7 changed files
with
56 additions
and
41 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 4 additions & 4 deletions
8
...ts/javascripts/bundle.fe8b6f2b.min.js.map → ...ts/javascripts/bundle.471ce7a9.min.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
// Script to ensure timeago keeps working when | ||
// used with mkdocs-material's instant loading feature | ||
// 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 = nodes[0].getAttribute('locale'); | ||
timeago.render(nodes, locale); | ||
var locale = getLocale(nodes[0]); | ||
timeago.render(nodes, locale); | ||
} | ||
}) | ||
} else { | ||
var nodes = document.querySelectorAll('.timeago'); | ||
if (nodes.length > 0) { | ||
var locale = nodes[0].getAttribute('locale'); | ||
timeago.render(nodes, locale); | ||
var locale = getLocale(nodes[0]); | ||
timeago.render(nodes, locale); | ||
} | ||
} |
Binary file not shown.