123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- /**
- * @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);
- console.log("Init _dbs.types", _dbs.types);
- console.log("Init _dbs.data_bytype", _dbs.data_bytype);
- m.route.prefix("");
- m.route(document.body, "/fr/connections", {
- "/: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()
|