-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
79 lines (75 loc) · 2.91 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="/examples/css/index.css">
</head>
<body>
<div class="nav-bar">
<div class="item">
<a href="/" data-goto="/">Home</a>
</div>
<div class="item">
<a href="/next" data-goto="/next">JS module</a>
</div>
<div class="item">
<a href="/angularjs" data-goto="/angularjs">Angularjs</a>
</div>
<div class="item">
<a href="/iframe" data-goto="/iframe">iframe</a>
</div>
<div class="item">
<a href="/vue" data-goto="/vue">Vue</a>
</div>
</div>
<div class="container">
<fem-router>
<fem-route path="/" exec="homeBootstrap" exact default></fem-route>
<fem-route path="/angularjs" type="angularjs" scripts="/modules/fem-angularjs/umd/app.example.js"
main-angular-module="example-app" ui-view></fem-route>
<fem-route path="/next" type="JS" scripts="/examples/javascript/next.js, /examples/css/next.css"
exec="jsMain"></fem-route>
<fem-route path="/iframe" type="iframe" scripts="/examples/css/iframe.css"
src="/examples/page.html"></fem-route>
<fem-route path="/vue" type="vue"
scripts="/modules/fem-vue/example/dist/static/js/app.js, /modules/fem-vue/example/dist/static/css/app.css"
component-getter="getVueComponent" component-name="HelloWorld"></fem-route>
</fem-router>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll(".nav-bar .item a")
.forEach(function (elm) {
elm.addEventListener("click", function (evt) {
var goto = elm.getAttribute('data-goto');
window.femRouter.Link(goto)(evt);
});
});
});
function homeBootstrap(elm) {
let h1 = document.createElement('h1');
h1.innerHTML = 'Home - page ';
const div1 = document.createElement('div');
div1.appendChild(h1);
elm.appendChild(div1);
let p = document.createElement('p');
p.appendChild(document.createTextNode('This element was created by the js script present in the index.html page.'));
elm.appendChild(p);
let a = document.createElement('button');
a.classList = 'btn-king-size';
a.appendChild(document.createTextNode('Test Javascript'))
a.addEventListener('click', (evt) => {
alert('js defined in the index.html')
});
const div2 = document.createElement('div')
div2.appendChild(a);
elm.appendChild(div2);
}
</script>
<script src="/umd/front-end-multiples.js"></script>
<script src="/modules/fem-angularjs/umd/fem-angularjs.js"></script>
<script src="/modules/fem-iframe/umd/fem-iframe.js"></script>
<script src="/modules/fem-vue/umd/fem-vue.js"></script>
</body>
</html>