use directories for structure

This commit is contained in:
s2
2020-05-26 10:37:57 +02:00
parent 66580d4847
commit ae4aaf2668
1287 changed files with 92093 additions and 13113 deletions

30
app/shell/shell.js Normal file
View File

@@ -0,0 +1,30 @@
(function() {
// globals
MyApp.Shell = {};
// utility functions
// app functions
MyApp.Shell.renderShell = function() {
document.title = i18next.t('vanillaJS');
var d = $.Deferred();
//preload this template, so we can be sure the dom in rendered when we resolve
ejs.preloadTemplate('/app/shell/templates/main.ejs')
.then(function(templateUrl) {
$('.js-main-content').html(ejs.rr(templateUrl));
d.resolve();
});
return d;
};
MyApp.Shell.renderHomePage = function() {
$('.js-page-container').html(ejs.rr('/app/shell/templates/home.ejs'));
};
// events
// app startup
page('/', MyApp.Shell.renderHomePage);
})();

View File

@@ -0,0 +1,8 @@
<ul class="list-group">
<li class="list-group-item">
<a href="/text">Here is a page with some example text and something happens when you click</a>
</li>
<li class="list-group-item">
<a href="/about">This is just an about page</a>
</li>
</ul>

View File

@@ -0,0 +1,12 @@
<div class="container">
<p class="js-language">
<a href="?lang=de" target="_self">Deutsch</a> <a href="?lang=it" target="_self">Italiano</a> <a href="?lang=en" target="_self">English</a>
</p>
<div class="alert alert-primary">
<h1><%= i18next.t('awesome') %></h1>
</div>
<div class="js-page-container">
</div>
</div>