Added mithril.js on new branch mithril
This commit is contained in:
parent
f9a3297ca2
commit
35d70443be
@ -175,4 +175,9 @@ class Home
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Branch mithril test
|
||||||
|
public function mithril() {
|
||||||
|
View::render('Data/mithril.html');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
38
App/Views/Data/mithril.html
Normal file
38
App/Views/Data/mithril.html
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}Mithril{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<main class="documentation">
|
||||||
|
<section id="mit">
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
<script>
|
||||||
|
var count = 0
|
||||||
|
|
||||||
|
var Hello = {
|
||||||
|
view: function() {
|
||||||
|
return m("main", [
|
||||||
|
m("h1", "Mithril"),
|
||||||
|
m("code", "You do " + count + " clicks"),
|
||||||
|
m("button", {onclick: function() {
|
||||||
|
count++
|
||||||
|
}}, "Click"),
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var Splash = {
|
||||||
|
view: function() {
|
||||||
|
return m("a", {href: "#!/hello"}, "Enter!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var root = document.getElementById('mit')
|
||||||
|
|
||||||
|
m.route(root, "/splash", {
|
||||||
|
"/splash": Splash,
|
||||||
|
"/hello": Hello,
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
@ -210,6 +210,7 @@
|
|||||||
<script src="/js/rome.js"></script>
|
<script src="/js/rome.js"></script>
|
||||||
<script src="/js/slidr.min.js"></script>
|
<script src="/js/slidr.min.js"></script>
|
||||||
<script src="/js/simplemde.min.js"></script>
|
<script src="/js/simplemde.min.js"></script>
|
||||||
|
<script src="/js/mithril.js"></script>
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
1242
public/js/mithril.js
Normal file
1242
public/js/mithril.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user