Skip to content

Commit 8e85ac8

Browse files
committed
fix packaging and re-add packaged demo
1 parent 32d7246 commit 8e85ac8

File tree

4 files changed

+227
-6
lines changed

4 files changed

+227
-6
lines changed

Readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ ACE (Ajax.org Code Editor)
33

44
ACE is a standalone code editor written in JavaScript. It can be easily embedded in any web page and JavaScript application. It is currently used as the editor component of the [Cloud9 IDE](http://cloud9ide.com).
55

6-
Checkout the [demo](http://ajaxorg.github.com/ace/editor.html)!
6+
Checkout the [demo](http://ajaxorg.github.com/ace/editor-build.html)!

build.js

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{
2-
baseUrl: "./lib",
2+
baseUrl: "lib",
33
dir: "build",
44

5+
paths: {
6+
"ace": "ace",
7+
"demo": "../demo",
8+
"cockpit": "../support/cockpit/lib/cockpit",
9+
"pilot": "../support/cockpit/support/pilot/lib/pilot"
10+
},
11+
512
//- "closure": uses Google's Closure Compiler in simple optimization
613
//mode to minify the code.
714
//- "closure.keepLines": Same as closure option, but keeps line returns
@@ -23,6 +30,13 @@
2330
skipModuleInsertion: false,
2431

2532
modules: [
33+
{
34+
name: "demo/startup",
35+
includeRequire: false,
36+
include: [
37+
"pilot/fixoldbrowsers"
38+
]
39+
},
2640
{
2741
name: "ace/editor",
2842
include: [
@@ -35,7 +49,6 @@
3549
],
3650
includeRequire: false
3751
},
38-
3952
{
4053
name: "ace/theme/eclipse",
4154
exclude: [
@@ -77,8 +90,8 @@
7790
{
7891
name: "ace/mode/python",
7992
exclude: [
80-
"ace/lib/oop",
81-
"ace/lib/lang",
93+
"pilot/oop",
94+
"pilot/lang",
8295
"ace/tokenizer",
8396
"ace/range",
8497
"ace/mode/text"

editor-build.html

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2+
"http://www.w3.org/TR/html4/strict.dtd">
3+
4+
<html lang="en">
5+
<head>
6+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7+
<title>Editor</title>
8+
<meta name="author" content="Fabian Jakobs">
9+
10+
<style type="text/css" media="screen">
11+
12+
html {
13+
height: 100%;
14+
overflow: hidden;
15+
}
16+
17+
body {
18+
overflow: hidden;
19+
margin: 0;
20+
padding: 0;
21+
height: 100%;
22+
width: 100%;
23+
font-family: Arial, Helvetica, sans-serif, Tahoma, Verdana, sans-serif;
24+
font-size: 12px;
25+
background: rgb(14, 98, 165);
26+
color: white;
27+
}
28+
29+
#editor {
30+
top: 55px;
31+
left: 0px;
32+
background: white;
33+
}
34+
35+
#controls {
36+
width: 100%;
37+
height: 55px;
38+
}
39+
40+
#jump {
41+
position: absolute;
42+
width: 10px;
43+
height: 10px;
44+
border: 1px solid red;
45+
z-index: 10000;
46+
display: none;
47+
}
48+
49+
#cockpitInput {
50+
position: absolute;
51+
width: 100%;
52+
bottom: 0;
53+
54+
border: none; outline: none;
55+
font-family: consolas, courier, monospace;
56+
font-size: 120%;
57+
}
58+
59+
#cockpitOutput {
60+
padding: 10px;
61+
margin: 0 15px;
62+
border: 1px solid #AAA;
63+
-moz-border-radius-topleft: 10px;
64+
-moz-border-radius-topright: 10px;
65+
border-top-left-radius: 4px; border-top-right-radius: 4px;
66+
background: #DDD; color: #000;
67+
}
68+
</style>
69+
</head>
70+
<body>
71+
<div id="jump"></div>
72+
73+
<table id="controls">
74+
<tr>
75+
<td>
76+
<label for="doc">Document:</label>
77+
<select id="doc" size="1">
78+
<option value="js">JS Document</option>
79+
<option value="html">HTML Document</option>
80+
<option value="css">CSS Document</option>
81+
<option value="python">Python Document</option>
82+
<option value="php">PHP Document</option>
83+
</select>
84+
</td>
85+
<td>
86+
<label for="mode">Mode:</label>
87+
<select id="mode" size="1">
88+
<option value="text">Plain Text</option>
89+
<option value="javascript">JavaScript</option>
90+
<option value="xml">XML</option>
91+
<option value="html">HTML</option>
92+
<option value="css">CSS</option>
93+
<option value="python">Python</option>
94+
<option value="php">PHP</option>
95+
</select>
96+
</td>
97+
<td>
98+
<label for="theme">Theme:</label>
99+
<select id="theme" size="1">
100+
<option value="ace/theme/textmate">TextMate</option>
101+
<option value="ace/theme/eclipse">Eclipse</option>
102+
<option value="ace/theme/dawn">Dawn</option>
103+
<option value="ace/theme/idle_fingers">idleFingers</option>
104+
<option value="ace/theme/pastel_on_dark">Pastel on dark</option>
105+
<option value="ace/theme/twilight">Twilight</option>
106+
</select>
107+
</td>
108+
<td>
109+
<label for="select_style">Full line selections</label>
110+
<input type="checkbox" name="select_style" id="select_style" checked>
111+
</td>
112+
<td>
113+
<label for="highlight_active">Highlight active line</label>
114+
<input type="checkbox" name="highlight_active" id="highlight_active" checked>
115+
</td>
116+
<td>
117+
<label for="show_hidden">Show invisibles</label>
118+
<input type="checkbox" name="show_hidden" id="show_hidden">
119+
</td>
120+
<td align="right">
121+
<img src="demo/logo.png">
122+
</td>
123+
</tr>
124+
</table>
125+
126+
<div id="editor">
127+
</div>
128+
129+
<script type="text/editor" id="jstext">function foo(items) {
130+
for (var i=0; i<items.length; i++) {
131+
alert(items[i] + "juhu");
132+
}
133+
}</script>
134+
135+
<script type="text/editor" id="csstext">.text-layer {
136+
font-family: Monaco, "Courier New", monospace;
137+
font-size: 12px;
138+
cursor: text;
139+
}</script>
140+
141+
<script type="text/editor" id="htmltext"><html>
142+
<head>
143+
144+
<style type="text/css">
145+
.text-layer {
146+
font-family: Monaco, "Courier New", monospace;
147+
font-size: 12px;
148+
cursor: text;
149+
}
150+
</style>
151+
152+
</head>
153+
<body>
154+
<h1 style="color:red">Juhu Kinners</h1>
155+
</body>
156+
</html></script>
157+
158+
<script type="text/editor" id="pythontext">#!/usr/local/bin/python
159+
160+
import string, sys
161+
162+
# If no arguments were given, print a helpful message
163+
if len(sys.argv)==1:
164+
print 'Usage: celsius temp1 temp2 ...'
165+
sys.exit(0)
166+
167+
# Loop over the arguments
168+
for i in sys.argv[1:]:
169+
try:
170+
fahrenheit=float(string.atoi(i))
171+
except string.atoi_error:
172+
print repr(i), "not a numeric value"
173+
else:
174+
celsius=(fahrenheit-32)*5.0/9.0
175+
print '%i\260F = %i\260C' % (int(fahrenheit), int(celsius+.5))
176+
</script>
177+
178+
<script type="text/editor" id="phptext"><?php
179+
180+
function nfact($n) {
181+
if ($n == 0) {
182+
return 1;
183+
}
184+
else {
185+
return $n * nfact($n - 1);
186+
}
187+
}
188+
189+
echo "\n\nPlease enter a whole number ... ";
190+
$num = trim(fgets(STDIN));
191+
192+
// ===== PROCESS - Determing the factorial of the input number =====
193+
$output = "\n\nFactorial " . $num . " = " . nfact($num) . "\n\n";
194+
echo $output;
195+
196+
?></script>
197+
198+
<input id="cockpitInput" type="text"/>
199+
200+
<script src="demo/require.js" type="text/javascript" charset="utf-8"></script>
201+
<script src="build/demo/startup.js" type="text/javascript" charset="utf-8"></script>
202+
<script src="build/demo/boot.js" type="text/javascript" charset="utf-8"></script>
203+
<script type="text/javascript">
204+
require("demo/boot", function() {})
205+
</script>
206+
207+
</body>
208+
</html>

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ <h2>Authors</h2>
6262
<br/>
6363
<br/> </p>
6464
<h2>Demo</h2>
65-
Check out the <a href="editor.html">demo</a>.
65+
Check out the <a href="editor-build.html">demo</a>.
6666
<h2>Contact</h2>
6767
<p>Fabian Jakobs ([email protected])
6868
<br/> </p>

0 commit comments

Comments
 (0)