-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
71 lines (61 loc) · 1.89 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
<!DOCTYPE html>
<html>
<head>
<title>komandojs demo page</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="./komando-dev.js"></script>
<!-- page specific styles -->
<link rel="stylesheet" type="text/css" href="./demo.css">
<link href='https://fonts.googleapis.com/css?family=Roboto+Mono:400,300,300italic,400italic,500italic,500,700,700italic' rel='stylesheet' type='text/css'>
<!-- komandojs specific styles -->
<link rel="stylesheet" type="text/css" href="./komando-theme.css">
</head>
<body>
<div class="wrapper">
<header>
<img src="komando.png" class="icon">
<h1>komandojs</h1>
<p>command line-like interface for custom commands in JS.<br/>
<a style="text-decoration: none; color: #5f93ae;" href="https://github.com/muratkemaldar/komandojs">view on GitHub</a>
</p>
</header>
<!-- komando block -->
<div id="komando-display" class="komando-display">
<span>Enter a command, soldier.</span>
</div>
<input class="komando-input" type="text" name="komando-input" id="komando-input" placeholder="type 'help' to see what you can do." />
<h2>
</h2>
</div>
<script type="text/javascript">
komando.init({
input: document.getElementById('komando-input'),
display: document.getElementById('komando-display'),
commands: [
{
command: "hello",
action: function(command, display, parameters){
display.print("hello to you too!");
}
},
{
command: 'goodbye',
parameterHint: '(name)',
action: function(command, display, parameters){
if (parameters) {
display.print("see you soon " + parameters.string);
} else {
display.print("güle güle");
}
}
}
],
callback: function(){
console.log("komando initialized");
}
});
</script>
</body>
</html>