136
by mattgiuca
Added File Browser (browser) application. (Currently just stub). |
1 |
# IVLE
|
2 |
# Copyright (C) 2007-2008 The University of Melbourne
|
|
3 |
#
|
|
4 |
# This program is free software; you can redistribute it and/or modify
|
|
5 |
# it under the terms of the GNU General Public License as published by
|
|
6 |
# the Free Software Foundation; either version 2 of the License, or
|
|
7 |
# (at your option) any later version.
|
|
8 |
#
|
|
9 |
# This program is distributed in the hope that it will be useful,
|
|
10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
# GNU General Public License for more details.
|
|
13 |
#
|
|
14 |
# You should have received a copy of the GNU General Public License
|
|
15 |
# along with this program; if not, write to the Free Software
|
|
16 |
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17 |
||
18 |
# App: File Browser
|
|
19 |
# Author: Matt Giuca
|
|
20 |
# Date: 9/1/2008
|
|
21 |
||
22 |
# The file browser application. Presents an Ajax-based interface to the
|
|
23 |
# student's subversion workspace.
|
|
185
by mattgiuca
Integrated the (second) Prototype browser (HTML+CSS but no code) into the main |
24 |
# Note that there is virtually no server-side code for this application. It
|
25 |
# simply presents static HTML and JavaScript, and all server-side activities
|
|
26 |
# take place in the FileService app (for handling Ajax requests).
|
|
136
by mattgiuca
Added File Browser (browser) application. (Currently just stub). |
27 |
|
28 |
from common import util |
|
29 |
||
30 |
def handle(req): |
|
31 |
"""Handler for the File Browser application."""
|
|
32 |
||
33 |
# Set request attributes
|
|
34 |
req.content_type = "text/html" |
|
170
by mattgiuca
browser: Added CSS and JS files (not much in them). |
35 |
req.styles = ["media/browser/browser.css"] |
36 |
req.scripts = [ |
|
37 |
"media/common/json2.js", |
|
233
by mattgiuca
Added a shaky implementation of EditArea as the text editor. |
38 |
"media/common/edit_area/edit_area_full.js", |
171
by mattgiuca
Added "util.js" in common. Contains useful utility functions. |
39 |
"media/common/util.js", |
170
by mattgiuca
browser: Added CSS and JS files (not much in them). |
40 |
"media/browser/browser.js", |
209
by mattgiuca
browser.js: Split out dir-listing code into listing.js (it's going to get |
41 |
"media/browser/listing.js", |
220
by mattgiuca
browser: Removed 3 buttons which didn't do anything. |
42 |
"media/browser/editor.js", |
170
by mattgiuca
browser: Added CSS and JS files (not much in them). |
43 |
]
|
136
by mattgiuca
Added File Browser (browser) application. (Currently just stub). |
44 |
req.write_html_head_foot = True # Have dispatch print head and foot |
45 |
||
46 |
# Start writing data
|
|
185
by mattgiuca
Integrated the (second) Prototype browser (HTML+CSS but no code) into the main |
47 |
req.write(""" |
48 |
<!-- Top bar section -->
|
|
49 |
||
50 |
<div id="topbar">
|
|
186
by mattgiuca
Added a bit of "chrome" (some CSS styling and minor touching up of the HTML). |
51 |
<h2>IVLE File Browser</h2>
|
52 |
<p id="path"></p>
|
|
185
by mattgiuca
Integrated the (second) Prototype browser (HTML+CSS but no code) into the main |
53 |
</div>
|
54 |
<!-- End topbar -->
|
|
55 |
||
203
by mattgiuca
browser: Removed all directory-listing specific HTML from the Python-generated |
56 |
<!-- Body. The JavaScript places content here relevant to the path -->
|
57 |
<div id="filesbody">
|
|
58 |
</div>
|
|
59 |
<!-- End body -->
|
|
185
by mattgiuca
Integrated the (second) Prototype browser (HTML+CSS but no code) into the main |
60 |
|
61 |
</body>
|
|
62 |
</html>
|
|
203
by mattgiuca
browser: Removed all directory-listing specific HTML from the Python-generated |
63 |
""") |
185
by mattgiuca
Integrated the (second) Prototype browser (HTML+CSS but no code) into the main |
64 |