Browse code

add default sample to taisteur

devnewton authored on 19/06/2016 19:15:12
Showing 1 changed files
... ...
@@ -1,11 +1,18 @@
1 1
 var convertButton = document.getElementById('convert');
2
+var inputArea = document.getElementById('input');
3
+var outputArea = document.getElementById('output');
4
+function convert() {
5
+	try {
6
+		outputArea.value= p2c2.parse(inputArea.value);
7
+	} catch(err) {
8
+		outputArea.value = err;
9
+	}
10
+}
11
+convertButton.addEventListener('click', convert);
2 12
 
3
-convertButton.addEventListener('click', function() {
4
-	var inputArea = document.getElementById('input');
5
-	var outputArea = document.getElementById('output');
6
-try {
7
-	outputArea.value= p2c2.parse(inputArea.value);
8
-} catch(err) {
9
-outputArea.value = err;
13
+function init() {
14
+	inputArea.value = '10:11:03 [:bondour] les <b>moules<</b>';
15
+	convert();
10 16
 }
11
-});
17
+document.readyState === "interactive" || document.readyState === "complete" ? init() : document.addEventListener("DOMContentLoaded", init);
18
+