12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- /**
- * @Author: Bachir Soussi Chiadmi <bach>
- * @Date: 16-04-2017
- * @Email: bachir@figureslibres.io
- * @Last modified by: bach
- * @Last modified time: 18-04-2017
- * @License: GPL-V3
- */
- require('normalize.css/normalize.css');
- require('./fonts/amiri/amiri.css');
- require('./fonts/dejavu/dejavu.css');
- require('./fonts/opensans/opensans.css');
- const m = require('mithril');
- // var marked = require('marked');
- // var _helpers = require('modules/helpers');
- const _dbs = require('./modules/dbs');
- const _i18n = require('./modules/i18n');
- const _Header = require('./modules/header');
- const _Footer = require('./modules/footer');
- const _ModeText = require('./modules/ModeText');
- const _ModeConnections = require('./modules/ModeConnections');
- var Layout = {
- view(vn){
- // console.log('Layout view : lang', vn.attrs.lang);
- _i18n.setLang(vn.attrs.lang);
- return [
- m(_Header, vn.attrs),
- vn.children,
- m(_Footer, vn.attrs)
- ]
- }
- }
- function init(){
- _dbs.load(function(){
- console.log('init dbs callback');
- console.log("Init _dbs.data", _dbs.data);
- console.log("Init _dbs.data_byid", _dbs.data_byid);
- console.log("Init _dbs.data_strct", _dbs.data_strct);
- m.route.prefix("");
- m.route(document.body, "/fr/text", {
- "/:lang/text": {
- render(vn){
- // console.log('Routing render : vn', vn);
- return m(Layout, vn.attrs, m(_ModeText, vn.attrs));
- }
- },
- "/:lang/connections": {
- render(vn){
- return m(Layout, vn.attrs, m(_ModeConnections, vn.attrs));
- }
- }
- });
- });
- };
- // ___
- // / | ____ ____
- // / /| | / __ \/ __ \
- // / ___ |/ /_/ / /_/ /
- // /_/ |_/ .___/ .___/
- // /_/ /_/
- // var _App = {
- // view(){
- // console.log('_App view', _lang);
- // return [
- // m('header', [
- // m('h1', 'Ethica'),
- // m('aside', {'id':"menus"}, m(_LangMenu) )
- // ]),
- // m(_Tree),
- // m('footer', [
- // m('p', m.trust('© 2017 <a href="./">Ethica Spinoza</a>'))
- // ])
- // ]
- // }
- // }
- // _ _ __
- // (_)___ (_) /_
- // / / __ \/ / __/
- // / / / / / / /_
- // /_/_/ /_/_/\__/
- init()
|