-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
112 lines (106 loc) · 3.3 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!doctype html><meta charset='utf-8'>
<html>
<head>
<title> Aulx hands-on </title>
<link href='http://fonts.googleapis.com/css?family=Averia+Sans+Libre'
rel='stylesheet' type='text/css'>
<link rel='stylesheet' href='demo/codemirror.css'>
<link rel='stylesheet' href='demo/styles.css'>
</head>
<body>
<textarea id='editorJS'>
// This demo showcases Aulx's JS autocompletion.
// F10 to switch to dark theme, F11 to toggle fullscreen
// `Stream` is an implementation of lazy/infinite lists.
function Stream(item, next) {
this.head = item;
this.shell = null;
this.computed = false;
this.generator = next;
}
Stream.prototype = {
// `tail` is the next stream in the list.
get tail() {
if (!this.computed) {
this.computed = true;
return this.shell = this.generator();
} else return this.shell;
},
at: function(index) {
var stream = this;
for (var i = index; i > 0; i--) {
stream = stream.tail;
}
return stream.head;
},
add: function(otherStream) {
return new Stream(this.head + otherStream.head, function() {
return this.tail.add(otherStream.tail);
}.bind(this));
}
};
var fibonacci = new Stream(0, function() {
return new Stream(1, function() {
return fibonacci.add(fibonacci.tail);
});
});
console.log('fib(10) = ' + fibonacci.at(10));
</textarea>
<textarea id='editorCSS'>
/* This one showcases Aulx's CSS autocompletion. */
html {
color: #222;
font-size: 1em;
line-height: 1.4;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
::selection {
background: #b3d4fc;
text-shadow: none;
}
</textarea>
<section class='right'>
<header>
<hgroup>
<h1> Aulx </h1>
<h2> The autocompletion for the Web </h2>
</hgroup>
<a href='https://raw.github.com/espadrine/aulx/master/aulx.js'>< Download Me ></a>
</header>
<p>
Let's have the best JS, CSS, HTML autocompletion ever!
<br>
You can try it out on the side, on sample source code. Use
<code> Tab </code>
to complete what you are writing.
</p>
</section>
<script src='demo/codemirror.js'></script>
<script src='node_modules/esprima/esprima.js'></script>
<script src='aulx-ui.js'></script>
<script>
var cmjseditor = CodeMirror.fromTextArea(editorJS,
{lineNumbers: true, theme: 'default js', mode: 'text/javascript'});
new AulxUI.CM(cmjseditor, { parserWorker: 'demo/parser-worker.js' });
var cmcsseditor = CodeMirror.fromTextArea(editorCSS,
{lineNumbers: true, theme: 'default css', mode: 'text/css'});
new AulxUI.CM(cmcsseditor);
</script>
<script>
// Background noise.
(function background() {
var seed = (Math.random() * 1000)|0;
var domHtml = document.documentElement;
var svg = '<svg xmlns="http://www.w3.org/2000/svg" width="' + domHtml.clientWidth + '" height="' + domHtml.clientHeight + '"><filter id="a"><feTurbulence baseFrequency=".2" numOctaves="1" seed="' + seed + '"/><feColorMatrix values="1 1 1 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0.04"/></filter><rect width="100%" height="100%" filter="url(#a)"/></svg>';
domHtml.style.backgroundImage = 'url(data:image/svg+xml;base64,' + btoa(svg) + ')';
}());
</script>
</body>
</html>