improved route strategy (url path), headers menu are working
This commit is contained in:
+21
-10
@@ -8,6 +8,7 @@ var markdown = require('markdown-it')()
|
||||
var _dbs = require('./dbs');
|
||||
var _Header = require('./header');
|
||||
var _Footer = require('./footer');
|
||||
var _Ui = require('./ui.js');
|
||||
|
||||
// __ _ __
|
||||
// / / (_)___ / /__
|
||||
@@ -134,7 +135,7 @@ var _Text = {
|
||||
},
|
||||
oninit: function(vn){
|
||||
this.id = vn.attrs.id;
|
||||
this.text = vn.attrs.text;
|
||||
this.text = vn.attrs.text || "";
|
||||
this.parsetext();
|
||||
},
|
||||
onbeforeupdate: function(vn,old){
|
||||
@@ -212,7 +213,7 @@ var _Enonce = {
|
||||
this.id = vn.attrs.id;
|
||||
this.title = vn.attrs.title;
|
||||
this.text = vn.attrs.text;
|
||||
this.childs = vn.attrs.childs;
|
||||
this.childs = vn.attrs.childs || [];
|
||||
this.nested = vn.attrs.nested || false;
|
||||
},
|
||||
onbeforeupdate:function(vn, old) {
|
||||
@@ -250,12 +251,12 @@ var _Enonce = {
|
||||
var _Part = {
|
||||
oninit: function(vn){
|
||||
this.id = vn.attrs.id;
|
||||
this.title = vn.attrs.title;
|
||||
this.title = vn.attrs.title || '';
|
||||
this.enonces = vn.attrs.enonces;
|
||||
},
|
||||
onbeforeupdate: function(vn, old){
|
||||
// console.log('_Part, onbeforeupdate old',old);
|
||||
this.title = vn.attrs.title;
|
||||
this.title = vn.attrs.title || '';
|
||||
this.enonces = vn.attrs.enonces;
|
||||
},
|
||||
view: function(vn){
|
||||
@@ -266,18 +267,20 @@ var _Part = {
|
||||
},
|
||||
[
|
||||
// create title node
|
||||
m("h1", {'class':'part'}, m.trust(markdown.renderInline(this.title))),
|
||||
m("h1", {'class':'part-title', 'part':this.id}, m.trust(markdown.renderInline(this.title))),
|
||||
// create text node
|
||||
this.enonces.map(function(e){
|
||||
console.log(e.type);
|
||||
|
||||
// console.log(e.type);
|
||||
// var title = e.title || '';
|
||||
switch (e.type) {
|
||||
case "title":
|
||||
// handle titles
|
||||
// console.log('title');
|
||||
return m("h2", {'class':'title'}, m.trust(markdown.renderInline(e.title)));
|
||||
break;
|
||||
case "filet":
|
||||
// handle filets
|
||||
// console.log('filet');
|
||||
return m("h4", {'class':'filet'}, m.trust(markdown.renderInline(e.title)));
|
||||
break;
|
||||
default:
|
||||
@@ -296,11 +299,18 @@ var _Part = {
|
||||
// _/ // / / / /___/ / / / / __/
|
||||
// /___/_/ /_/_____/_/_/ /_/\___/
|
||||
module.exports = {
|
||||
view: function(){
|
||||
console.log('_Inline view', _dbs.lang);
|
||||
// oninit : function(vn){
|
||||
// this.lang = vn.attrs.lang;
|
||||
// },
|
||||
oncreate: function(vn){
|
||||
document.body.classList.add('inline');
|
||||
_Ui.init();
|
||||
},
|
||||
view: function(vn){
|
||||
console.log('_Inline view', vn.attrs.lang);
|
||||
return [
|
||||
m(_Header),
|
||||
m('main', {id:"content", 'class':'inline'}, _dbs.data[_dbs.lang].map(function(p){
|
||||
m('main', {id:"content", 'class':'inline'}, _dbs.data[vn.attrs.lang].map(function(p){
|
||||
// console.log("MAP _dbs", p);
|
||||
return m(_Part,p);
|
||||
})
|
||||
@@ -308,4 +318,5 @@ module.exports = {
|
||||
m(_Footer)
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user