reduce duplication and code improvements (#1707)

* reduce code duplication

* reduce duplication, fix license headers

* simplify code

* typings fixes

* update tests

* minor fixes

* markdown fixes

* revert changes
This commit is contained in:
Denys Vuika
2020-12-11 15:47:17 +00:00
committed by GitHub
parent b71e1530d1
commit 7a5350a06d
64 changed files with 482 additions and 744 deletions

View File

@@ -3,10 +3,7 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"
/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
<title>Alfresco Content App</title>
<link rel="stylesheet" href="https://unpkg.com/docute@3/dist/docute.css" />
<link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96" />
@@ -16,20 +13,19 @@
<script src="https://unpkg.com/docute@3/dist/docute.js"></script>
<script src="https://unpkg.com/prismjs/components/prism-typescript.js"></script>
<script>
var langs = [
const langs = [
{ title: 'English', path: '/' },
{ title: '日本語', path: '/ja/', matchPath: /^\/ja[\/$]/ }
];
docute.init({
url: '.',
toc: $route => {
toc: ($route) => {
const isJapaneseLang = $route.path.split('/')[1] === 'ja';
const wasJapaneseLang = $route.from.path.split('/')[1] === 'ja';
if (wasJapaneseLang !== isJapaneseLang) {
const isFirstPageLoad =
$route.from.path === '/' && $route.from.meta.name !== 'home';
const isFirstPageLoad = $route.from.path === '/' && $route.from.meta.name !== 'home';
if (!isFirstPageLoad) {
document.location.reload();
}