~ivle-dev/ivle/codemirror

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/browser/media/codemirror/contrib/sql/index.html

  • Committer: David Coles
  • Date: 2010-05-31 10:38:53 UTC
  • Revision ID: coles.david@gmail.com-20100531103853-8xypjpracvwy0qt4
Editor: Added CodeMirror-0.67 Javascript code editor source from 
http://marijn.haverbeke.nl/codemirror/ (zlib-style licence)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html xmlns="http://www.w3.org/1999/xhtml">
 
2
  <head>
 
3
    <script src="../../js/codemirror.js" type="text/javascript"></script>
 
4
    <title>CodeMirror: SQL demonstration</title>
 
5
    <link rel="stylesheet" type="text/css" href="../../css/docs.css"/>
 
6
  </head>
 
7
  <body style="padding: 20px;">
 
8
 
 
9
<p>Demonstration of <a href="index.html">CodeMirror</a>'s SQL
 
10
highlighter.</p>
 
11
 
 
12
<p>Written by John Benediktsson (<a href="LICENSE">license</a>).</p>
 
13
 
 
14
<div class="border">
 
15
<textarea id="code" cols="120" rows="50">
 
16
create table if not exists table1(
 
17
  a  bigint(13) not null primary key,
 
18
  b  char(4)    not null,
 
19
  c  char(50)   not null,
 
20
  d  int(9)     not null,
 
21
);
 
22
 
 
23
insert into table1 values (1234567890123, "b", "c", 0);
 
24
 
 
25
select from_unixtime(a/1000), b, c, min(d) as `using`
 
26
  from table1 t1
 
27
  left join table2 t2 using (a)
 
28
  -- inner join table3 t3 on t3._a = t1.a
 
29
  join (
 
30
    select a, b, c
 
31
    from data
 
32
  ) as foo on foo.a = t1.a
 
33
 
 
34
  where a &gt; 10
 
35
  and b like '%foo'
 
36
  or c = 3.14159
 
37
  and d &lt; -15.7
 
38
  order by 1 desc
 
39
;
 
40
 
 
41
select @total := sum(d) from data;
 
42
</textarea>
 
43
</div>
 
44
 
 
45
<script type="text/javascript">
 
46
  var editor = CodeMirror.fromTextArea('code', {
 
47
    height: "450px",
 
48
    parserfile: "../contrib/sql/js/parsesql.js",
 
49
    stylesheet: "css/sqlcolors.css",
 
50
    path: "../../js/",
 
51
    textWrapping: false
 
52
  });
 
53
</script>
 
54
 
 
55
  </body>
 
56
</html>