-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathglocide.xsl
99 lines (90 loc) · 2.84 KB
/
glocide.xsl
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
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/xhtml1/strict">
<xsl:output method="html" />
<xsl:template name="glol_params">
<h2>glol</h2>
<form>
<ul>
<li><input type="text" /></li>
</ul>
</form>
</xsl:template>
<xsl:template name="glom_name">
<xsl:if test="@name">
<h3><xsl:value-of select="@name" /></h3>
</xsl:if>
</xsl:template>
<xsl:template name="glo_name">
<xsl:choose>
<xsl:when test="@name"><xsl:value-of select="@name" /></xsl:when>
<xsl:otherwise>[unknown]</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/">
<html>
<head>
<title>glocide : glo compiler ide</title>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<link rel="stylesheet" type="text/css" href="glocide.css" />
<link rel="stylesheet" type="text/css" href="CodeMirror2/lib/codemirror.css" />
<script src="CodeMirror2/lib/codemirror.js"></script>
<script src="CodeMirror2/mode/clike/clike.js"></script>
<script src="CodeMirror2/keymap/emacs.js"></script>
</head>
<body>
<xsl:choose>
<xsl:when test="glom">
<div id="sidebar">
<div id="glol">
<xsl:call-template name="glol_params" />
</div>
<div id="glom">
<h2>glom</h2>
<xsl:apply-templates mode="glom">
<xsl:with-param name="path" />
</xsl:apply-templates>
</div>
</div>
<div id="gloc">
<form>
<textarea id="source" name="source">
</textarea>
</form>
<div id="stderr">
stderr
</div>
<div id="stdout">
stdout
</div>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="format_error" />
</xsl:otherwise>
</xsl:choose>
<script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("source"), {
lineNumbers: true,
mode: "text/x-csrc",
keyMap: "emacs"
});
</script>
</body>
</html>
</xsl:template>
<xsl:template match="glom" mode="glom">
<xsl:param name="path" />
<xsl:call-template name="glom_name" />
<ul>
<xsl:for-each select="child::*">
<li><xsl:apply-templates select="." mode="glom" /></li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template match="glo" mode="glom">
<a href="#"><xsl:call-template name="glo_name" /></a>
</xsl:template>
</xsl:stylesheet>