From 5638a960a3d47505a11bdc01aa0cd8112d1363a9 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Sat, 1 Oct 2011 10:14:17 +0100 Subject: [PATCH] Re-organise files. Move the client directory out of the node folder, remove the symlinks and put the real js, img and css directories in it. Rename the 'node' folder to 'server'. Tweaks to app.js and config.json to facilitate this reorganisation. --- {css => client/css}/border-radius.htc | 0 {css => client/css}/default.css | 0 {css => client/css}/touchscreen_tweaks.css | 0 {css => client/css}/ui.css | 0 {img => client/img}/app_menu.png | Bin {img => client/img}/ico.png | Bin {img => client/img}/logo.png | Bin {img => client/img}/more.png | Bin {img => client/img}/redcross.png | Bin {img => client/img}/trans_back.png | Bin {node/client => client}/index.html.jade | 0 {js => client/js}/front.events.js | 0 {js => client/js}/front.js | 0 {js => client/js}/front.ui.js | 0 {js => client/js}/gateway.js | 0 {js => client/js}/iscroll.js | 0 {js => client/js}/jquery-ui.1.8.16.min.js | 0 {js => client/js}/jquery.1.6.4.min.js | 0 {js => client/js}/jquery.json-2.2.min.js | 0 {js => client/js}/touchscreen_tweaks.js | 0 {js => client/js}/underscore.min.js | 0 {js => client/js}/util.js | 0 node/client/css | 1 - node/client/img | 1 - node/client/js | 1 - {node => server}/app.js | 6 ++++-- {node => server}/cert.pem | 0 {node => server}/config.json | 2 +- {node => server}/kiwi.js | 0 {node => server}/kiwi_modules/spamfilter.js | 0 {node => server}/kiwi_modules/statistics.js | 0 {node => server}/lib/kiwi_mod.js | 0 {node => server}/lib/starttls.js | 0 {node => server}/lib/underscore.min.js | 0 {node => server}/server.key | 0 35 files changed, 5 insertions(+), 6 deletions(-) rename {css => client/css}/border-radius.htc (100%) rename {css => client/css}/default.css (100%) rename {css => client/css}/touchscreen_tweaks.css (100%) rename {css => client/css}/ui.css (100%) rename {img => client/img}/app_menu.png (100%) rename {img => client/img}/ico.png (100%) rename {img => client/img}/logo.png (100%) rename {img => client/img}/more.png (100%) rename {img => client/img}/redcross.png (100%) rename {img => client/img}/trans_back.png (100%) rename {node/client => client}/index.html.jade (100%) rename {js => client/js}/front.events.js (100%) rename {js => client/js}/front.js (100%) rename {js => client/js}/front.ui.js (100%) rename {js => client/js}/gateway.js (100%) rename {js => client/js}/iscroll.js (100%) rename {js => client/js}/jquery-ui.1.8.16.min.js (100%) rename {js => client/js}/jquery.1.6.4.min.js (100%) rename {js => client/js}/jquery.json-2.2.min.js (100%) rename {js => client/js}/touchscreen_tweaks.js (100%) rename {js => client/js}/underscore.min.js (100%) rename {js => client/js}/util.js (100%) delete mode 120000 node/client/css delete mode 120000 node/client/img delete mode 120000 node/client/js rename {node => server}/app.js (99%) rename {node => server}/cert.pem (100%) rename {node => server}/config.json (96%) rename {node => server}/kiwi.js (100%) rename {node => server}/kiwi_modules/spamfilter.js (100%) rename {node => server}/kiwi_modules/statistics.js (100%) rename {node => server}/lib/kiwi_mod.js (100%) rename {node => server}/lib/starttls.js (100%) rename {node => server}/lib/underscore.min.js (100%) rename {node => server}/server.key (100%) diff --git a/css/border-radius.htc b/client/css/border-radius.htc similarity index 100% rename from css/border-radius.htc rename to client/css/border-radius.htc diff --git a/css/default.css b/client/css/default.css similarity index 100% rename from css/default.css rename to client/css/default.css diff --git a/css/touchscreen_tweaks.css b/client/css/touchscreen_tweaks.css similarity index 100% rename from css/touchscreen_tweaks.css rename to client/css/touchscreen_tweaks.css diff --git a/css/ui.css b/client/css/ui.css similarity index 100% rename from css/ui.css rename to client/css/ui.css diff --git a/img/app_menu.png b/client/img/app_menu.png similarity index 100% rename from img/app_menu.png rename to client/img/app_menu.png diff --git a/img/ico.png b/client/img/ico.png similarity index 100% rename from img/ico.png rename to client/img/ico.png diff --git a/img/logo.png b/client/img/logo.png similarity index 100% rename from img/logo.png rename to client/img/logo.png diff --git a/img/more.png b/client/img/more.png similarity index 100% rename from img/more.png rename to client/img/more.png diff --git a/img/redcross.png b/client/img/redcross.png similarity index 100% rename from img/redcross.png rename to client/img/redcross.png diff --git a/img/trans_back.png b/client/img/trans_back.png similarity index 100% rename from img/trans_back.png rename to client/img/trans_back.png diff --git a/node/client/index.html.jade b/client/index.html.jade similarity index 100% rename from node/client/index.html.jade rename to client/index.html.jade diff --git a/js/front.events.js b/client/js/front.events.js similarity index 100% rename from js/front.events.js rename to client/js/front.events.js diff --git a/js/front.js b/client/js/front.js similarity index 100% rename from js/front.js rename to client/js/front.js diff --git a/js/front.ui.js b/client/js/front.ui.js similarity index 100% rename from js/front.ui.js rename to client/js/front.ui.js diff --git a/js/gateway.js b/client/js/gateway.js similarity index 100% rename from js/gateway.js rename to client/js/gateway.js diff --git a/js/iscroll.js b/client/js/iscroll.js similarity index 100% rename from js/iscroll.js rename to client/js/iscroll.js diff --git a/js/jquery-ui.1.8.16.min.js b/client/js/jquery-ui.1.8.16.min.js similarity index 100% rename from js/jquery-ui.1.8.16.min.js rename to client/js/jquery-ui.1.8.16.min.js diff --git a/js/jquery.1.6.4.min.js b/client/js/jquery.1.6.4.min.js similarity index 100% rename from js/jquery.1.6.4.min.js rename to client/js/jquery.1.6.4.min.js diff --git a/js/jquery.json-2.2.min.js b/client/js/jquery.json-2.2.min.js similarity index 100% rename from js/jquery.json-2.2.min.js rename to client/js/jquery.json-2.2.min.js diff --git a/js/touchscreen_tweaks.js b/client/js/touchscreen_tweaks.js similarity index 100% rename from js/touchscreen_tweaks.js rename to client/js/touchscreen_tweaks.js diff --git a/js/underscore.min.js b/client/js/underscore.min.js similarity index 100% rename from js/underscore.min.js rename to client/js/underscore.min.js diff --git a/js/util.js b/client/js/util.js similarity index 100% rename from js/util.js rename to client/js/util.js diff --git a/node/client/css b/node/client/css deleted file mode 120000 index 8e8b6d0..0000000 --- a/node/client/css +++ /dev/null @@ -1 +0,0 @@ -../../css \ No newline at end of file diff --git a/node/client/img b/node/client/img deleted file mode 120000 index 26c9fa8..0000000 --- a/node/client/img +++ /dev/null @@ -1 +0,0 @@ -../../img \ No newline at end of file diff --git a/node/client/js b/node/client/js deleted file mode 120000 index 104dde2..0000000 --- a/node/client/js +++ /dev/null @@ -1 +0,0 @@ -../../js/ \ No newline at end of file diff --git a/node/app.js b/server/app.js similarity index 99% rename from node/app.js rename to server/app.js index 8b06685..e2af101 100644 --- a/node/app.js +++ b/server/app.js @@ -538,9 +538,9 @@ this.httpHandler = function (request, response) { uri_parts = uri.pathname.split('/'); subs = uri.pathname.substr(0, 4); + public_http_path = kiwi.kiwi_root + '/' + kiwi.config.public_http; if (uri.pathname === '/js/all.js') { if (kiwi.cache.alljs === '') { - public_http_path = kiwi.kiwi_root + '/' + kiwi.config.public_http; min.underscore = fs.readFileSync(public_http_path + 'js/underscore.min.js'); min.util = fs.readFileSync(public_http_path + 'js/util.js'); @@ -640,7 +640,7 @@ this.httpHandler = function (request, response) { } response.end(); } else { - fs.readFile(__dirname + '/client/index.html.jade', 'utf8', function (err, str) { + fs.readFile(public_http_path + 'index.html.jade', 'utf8', function (err, str) { var html, hash2; if (!err) { try { @@ -656,8 +656,10 @@ this.httpHandler = function (request, response) { } } catch (e) { response.statusCode = 500; + console.log(e); } } else { + console.log(err); response.statusCode = 500; } response.end(); diff --git a/node/cert.pem b/server/cert.pem similarity index 100% rename from node/cert.pem rename to server/cert.pem diff --git a/node/config.json b/server/config.json similarity index 96% rename from node/config.json rename to server/config.json index 21503a1..6e023d8 100644 --- a/node/config.json +++ b/server/config.json @@ -22,7 +22,7 @@ "cap_options": [], "handle_http": true, - "public_http": "./../", + "public_http": "./../client/", "max_client_conns": 2, diff --git a/node/kiwi.js b/server/kiwi.js similarity index 100% rename from node/kiwi.js rename to server/kiwi.js diff --git a/node/kiwi_modules/spamfilter.js b/server/kiwi_modules/spamfilter.js similarity index 100% rename from node/kiwi_modules/spamfilter.js rename to server/kiwi_modules/spamfilter.js diff --git a/node/kiwi_modules/statistics.js b/server/kiwi_modules/statistics.js similarity index 100% rename from node/kiwi_modules/statistics.js rename to server/kiwi_modules/statistics.js diff --git a/node/lib/kiwi_mod.js b/server/lib/kiwi_mod.js similarity index 100% rename from node/lib/kiwi_mod.js rename to server/lib/kiwi_mod.js diff --git a/node/lib/starttls.js b/server/lib/starttls.js similarity index 100% rename from node/lib/starttls.js rename to server/lib/starttls.js diff --git a/node/lib/underscore.min.js b/server/lib/underscore.min.js similarity index 100% rename from node/lib/underscore.min.js rename to server/lib/underscore.min.js diff --git a/node/server.key b/server/server.key similarity index 100% rename from node/server.key rename to server/server.key -- 2.25.1