Skip to content

Commit

Permalink
Refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Nov 30, 2024
1 parent b5bf156 commit 787961c
Show file tree
Hide file tree
Showing 131 changed files with 1,672 additions and 1,536 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2,656 changes: 1,328 additions & 1,328 deletions packages/demos/docsLookup.json

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions packages/demos/includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

<title>xeokit - 3D Web Programming Toolkit for BIM and Engineering Visualization</title>

<link href="../../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="../../libs/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="../../css/business-frontpage.css" rel="stylesheet">

<link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script src="./../vendor/jquery/jquery.min.js"></script>
<script src="./../vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="./../libs/jquery/jquery.min.js"></script>
<script src="./../libs/bootstrap/js/bootstrap.bundle.min.js"></script>


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css">
Expand Down
2 changes: 1 addition & 1 deletion packages/demos/includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<a class="dropdown-item" href="https://xeokit.github.io/xeokit-sdk/examples/" target="_examples">Examples</a>
<a class="dropdown-item" href="https://xeokit.github.io/xeokit-sdk/docs/" target="_docs">API Reference</a>
<a class="dropdown-item" href="https://github.com/xeokit" target="_code">Source Code</a>
<a class="dropdown-item" href="">Articles</a>
<a class="dropdown-item" href="">Pages</a>
</div>
</li>
<li class="nav-item">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<title></title>
</head>
<body>
@@include('../includes/article-navbar.html')
<header class="bg-black home-header bg-black">
<div class="container h-75">
<!-- <div class="row h-100 align-items-center">-->
<!-- <div class="col-lg-12">-->
<!-- <h1 class="text-white mt-5 mb-2">IFC Conversion Tests</h1>-->
<!-- <p class="lead mb-5 text-white">Check the health of our IFC file conversion tools</p>-->
<!-- </div>-->
<!-- </div>-->
</div>
</header>
@@include('../includes/page-navbar.html')
<!--<header class="bg-black home-header bg-black">-->
<!-- <div class="container h-75">-->
<!-- &lt;!&ndash; <div class="row h-100 align-items-center">&ndash;&gt;-->
<!-- &lt;!&ndash; <div class="col-lg-12">&ndash;&gt;-->
<!-- &lt;!&ndash; <h1 class="text-white mt-5 mb-2">IFC Conversion Tests</h1>&ndash;&gt;-->
<!-- &lt;!&ndash; <p class="lead mb-5 text-white">Check the health of our IFC file conversion tools</p>&ndash;&gt;-->
<!-- &lt;!&ndash; </div>&ndash;&gt;-->
<!-- &lt;!&ndash; </div>&ndash;&gt;-->
<!-- </div>-->
<!--</header>-->
<section id="intro" class="main-section alabaster">
<div class="container">
<div class="row testimonial-row">
Expand All @@ -35,10 +35,10 @@ <h1>Articles</h1>
function getTagMap(index) {
const tagMap = {};
const tagList = [];
for (let articleId in index.articles) {
const article = index.articles[articleId];
if (article.tags) {
for (let tagId of article.tags) {
for (let pageId in index.pages) {
const page = index.pages[pageId];
if (page.tags) {
for (let tagId of page.tags) {
if (!tagMap[tagId]) {
tagMap[tagId] = tagId;
tagList.push(tagId);
Expand All @@ -63,21 +63,21 @@ <h1>Articles</h1>
}
html.push(`</p></div>`);

for (let articleId in index.articles) {
const article = index.articles[articleId];
html.push(`<div class="col-sm-4 mb-5"><a href="./viewer" class="card-link">
for (let pageId in index.pages) {
const page = index.pages[pageId];
html.push(`<div class="col-sm-4 mb-5"><a href="./${pageId}" class="card-link">
<div class="card">
<img class="card-img-top thumbnail"
src="https://github.com/xeokit/xeokit.io/blob/master/img/docs/PerformanceModel/PerformanceModel.png?raw=true"
alt="Thumbnail 2">
<div class="card-body">
<h4 class="card-title">${article.title}</h4>
<p class="card-text"> ${article.description || ""}</p>
<h4 class="card-title">${page.title}</h4>
<p class="card-text"> ${page.description || ""}</p>
</div>`);
if (article.tags) {
if (page.tags) {
html.push(`<div class="card-footer tag">`)
for (let i = 0, len = article.tags.length; i < len; i++) {
html.push(`<button type="button" class="btn btn-primary btn-sm btn-tag my-1">${article.tags[i]}</button>`);
for (let i = 0, len = page.tags.length; i < len; i++) {
html.push(`<button type="button" class="btn btn-primary btn-sm btn-tag my-1">${page.tags[i]}</button>`);
}
html.push(`</div>`);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top ">
<span style="color: #ffffff;"><a class="navbar-home" href="http://xeolabs.com">xeolabs</a>/<a class="navbar-parent" href="https://xeokit.io">xeokit&nbsp;SDK</a>/<a class="navbar-brand" href="./../index.html">Articles</a></span>
<span style="color: #ffffff;"><a class="navbar-home" href="http://xeolabs.com">xeolabs</a>/<a class="navbar-parent" href="https://xeokit.io">xeokit&nbsp;SDK</a>/<a class="navbar-brand" href="./index.html">Articles</a></span>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@
<title></title>
</head>
<body>
@@include('../../includes/article-navbar.html')
<header class="bg-black home-header bg-black">
<div class="container h-75">
<!-- <div class="row h-100 align-items-center">-->
<!-- <div class="col-lg-12">-->
<!-- <h1 class="text-white mt-5 mb-2">@@title</h1>-->
<!-- <p class="lead mb-5 text-white">@@subtitle</p>-->
<!-- </div>-->
<!-- </div>-->
</div>
</header>
@@include('../../includes/navbar.html')
<!--<header class="bg-black home-header bg-black">-->
<!-- <div class="container h-75">-->
<!-- &lt;!&ndash; <div class="row h-100 align-items-center">&ndash;&gt;-->
<!-- &lt;!&ndash; <div class="col-lg-12">&ndash;&gt;-->
<!-- &lt;!&ndash; <h1 class="text-white mt-5 mb-2">@@title</h1>&ndash;&gt;-->
<!-- &lt;!&ndash; <p class="lead mb-5 text-white">@@subtitle</p>&ndash;&gt;-->
<!-- &lt;!&ndash; </div>&ndash;&gt;-->
<!-- &lt;!&ndash; </div>&ndash;&gt;-->
<!-- </div>-->
<!--</header>-->
<section id="intro" class="main-section">
<div class="container">
<div class="row testimonial-row">
<!-- <div class="col-lg-12">-->
<!-- <h5><a href="../index.html">&lt;&lt;&nbsp;Articles</a></h5>-->
<!-- </div>-->
<div class="col-lg-12">
<h1>@@title</h1>
</div>
</div>

<div class="row testimonial-row">
<div class="col-lg-12">
@@include('content.html')
Expand All @@ -35,7 +37,7 @@ <h1>@@title</h1>
<div class="container">
<div class="row testimonial-row">
<div class="col-lg-12">
<h2>Related articles:</h2>
<h2>Related pages:</h2>
<br><br>
<ul>
<li>Creating a squirrel mansion</li>
Expand All @@ -46,28 +48,26 @@ <h2>Related articles:</h2>
</div>
</section>
<script>

fetch("./index.json").then(response => {
response.json().then(articleIndex => {
const relatedArticles = getRelatedArticles(index);
const html = [
];
response.json().then(pageIndex => {
const relatedPages = getRelatedPages(index);
const html = [];

for (let articleId in index.articles) {
const article = index.articles[articleId];
for (let pageId in index.pages) {
const page = index.pages[pageId];
html.push(`<div class="col-sm-4 mb-5"><a href="./viewer" class="card-link">
<div class="card">
<img class="card-img-top thumbnail"
src="https://github.com/xeokit/xeokit.io/blob/master/img/docs/PerformanceModel/PerformanceModel.png?raw=true"
alt="Thumbnail 2">
<div class="card-body">
<h4 class="card-title">${article.title}</h4>
<p class="card-text"> ${article.description || ""}</p>
<h4 class="card-title">${page.title}</h4>
<p class="card-text"> ${page.description || ""}</p>
</div>`);
if (article.tags) {
if (page.tags) {
html.push(`<div class="card-footer tag">`)
for (let i = 0, len = article.tags.length; i < len; i++) {
html.push(`<button type="button" class="btn btn-primary btn-sm btn-tag my-1">${article.tags[i]}</button>`);
for (let i = 0, len = page.tags.length; i < len; i++) {
html.push(`<button type="button" class="btn btn-primary btn-sm btn-tag my-1">${page.tags[i]}</button>`);
}
html.push(`</div>`);
}
Expand All @@ -77,7 +77,6 @@ <h4 class="card-title">${article.title}</h4>
});
});


</script>
@@include('../../includes/footer.html')
</body>
Expand Down
20 changes: 10 additions & 10 deletions packages/demos/js/DemoHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ export class DemoHelper {
descElement.innerHTML = this.index.title;
this.statusContainer.appendChild(descElement);
}
fetch("../../../../../../../packages/demos/data/tutorials/index.json").then(response => {
response.json().then(tutorialsIndex => {
this.tutorialsIndex = tutorialsIndex;
fetch("../../../../../../../packages/demos/docsLinks.json").then(response => {
fetch("/pages/index.json").then(response => {
response.json().then(pagesIndex => {
this.pagesIndex = pagesIndex;
fetch("/docsLinks.json").then(response => {
response.json().then(docsLinks => {
fetch("../../../../../../../packages/demos/docsLookup.json").then(response => {
fetch("/docsLookup.json").then(response => {
response.json().then(docsLookup => {
DOCS_LOOKUP = {...docsLookup, ...docsLinks};
if (cfg.index) {
Expand Down Expand Up @@ -185,12 +185,12 @@ export class DemoHelper {
this.logTitle("Resources");
this.logViewSource();

if (this.tutorialsIndex && this.tutorialsIndex.tutorials && Object.keys(this.tutorialsIndex.tutorials).length > 0) {
this.logTitle("Related Tutorials");
if (this.pagesIndex && this.pagesIndex.pages && Object.keys(this.pagesIndex.pages).length > 0) {
this.logTitle("Artices");
const items = [];
for (let tutorialId in this.tutorialsIndex.tutorials) {
const tutorial = this.tutorialsIndex.tutorials[tutorialId];
items.push(`<a target="_parent" style="font-style: italic" href="${this.gitHubDataDir}/tutorials/${tutorialId}/index.md">${tutorial.title}</a>`);
for (let tutorialPageId in this.pagesIndex.pages) {
const tutorialPage = this.pagesIndex.pages[tutorialPageId];
items.push(`<a target="_parent" style="font-style: italic" href="/pages/${tutorialPageId}/index.html">${tutorialPage.title}</a>`);
}
this.logUnorderedItems(items);
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/demos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "src/index.ts",
"scripts": {
"dist": "node scripts/build-xeokit-demo-bundle.js",
"demos": "node scripts/build-docs-lookup.js; node scripts/build-viewer-demos-index.js; node scripts/build-articles.js;",
"demos": "node scripts/build-docs-lookup.js; node scripts/build-viewer-demos-index.js; node scripts/build-pages.js;",
"models": "node scripts/build-convert-models.js; sh scripts/convert-models.sh",
"lint": "eslint . --fix"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"articles": {
"pages": {
"foo": {
"title": "View a Spinning 3D Box in a Web Page"
},
Expand Down Expand Up @@ -40,7 +40,7 @@
]
}
},
"tagToArticlesMap": {
"tagToPagesMap": {
"Beginner": [
"sceneModelBuildBox",
"sceneModelBuildGeometries",
Expand Down
Loading

0 comments on commit 787961c

Please sign in to comment.