Added mithril.js on new branch mithril

This commit is contained in:
Gregorio Chiko Putra 2017-09-26 16:28:18 +07:00
parent f9a3297ca2
commit 35d70443be
4 changed files with 1286 additions and 0 deletions

View File

@ -175,4 +175,9 @@ class Home
} }
return true; return true;
} }
// Branch mithril test
public function mithril() {
View::render('Data/mithril.html');
}
} }

View 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 %}

View File

@ -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

File diff suppressed because it is too large Load Diff