From 6c7d84c807fbc385902759c61517c738c390b690 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Wed, 25 Jan 2012 15:47:28 -0500 Subject: [PATCH] add needed jquery and jquery-ui files --- README.md | 8 + external/README | 8 + external/jquery.min.js | 23 ++ external/jquery.ui.core.js | 314 +++++++++++++++ external/jquery.ui.draggable.js | 825 +++++++++++++++++++++++++++++++++++++++ external/jquery.ui.mouse.js | 162 ++++++++ external/jquery.ui.widget.js | 272 +++++++++++++ index.html | 10 +- server.coffee | 10 +- 9 files changed, 1622 insertions(+), 10 deletions(-) create mode 100644 external/README create mode 100644 external/jquery.min.js create mode 100644 external/jquery.ui.core.js create mode 100644 external/jquery.ui.draggable.js create mode 100644 external/jquery.ui.mouse.js create mode 100644 external/jquery.ui.widget.js diff --git a/README.md b/README.md index 7c13a36..660bee6 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,11 @@ jquery-ui that it is looking for. Future versions of Peach CGT should be better at finding these javascript files, and may even come with some of them. For now, try fiddling with the ` - - - - + + + + + diff --git a/server.coffee b/server.coffee index b1cdac9..0411657 100644 --- a/server.coffee +++ b/server.coffee @@ -115,9 +115,9 @@ clean_pathname = (str) -> str = str.replace clean_pathname_regex2, '/_' return str.replace clean_pathname_regex3, '_' -# serve javascript files from within /usr/share/javascript -javascript_handler = (args, out, request, url_parts) -> - filename = clean_pathname "/usr/share/#{url_parts.pathname}" +# serve javascript files from within external/ +external_javascript_handler = (args, out, request, url_parts) -> + filename = clean_pathname "external/#{url_parts.pathname.substr 10}" fs.readFile filename, 'utf8', (err, data) -> if err out.writeHead 404 @@ -274,8 +274,8 @@ http_server = http.createServer (req, res) -> rel_path = url_parts.pathname.substr 1 - if rel_path.substr(0, 11) is 'javascript/' - return javascript_handler url_parts.query, res, req, url_parts + if rel_path.substr(0, 9) is 'external/' + return external_javascript_handler url_parts.query, res, req, url_parts else if rel_path.substr(rel_path.length - 4) is '.css' res.writeHead 200, 'Content-Type': 'text/css' return css_handler url_parts.query, res, req, url_parts -- 1.7.10.4