From c3511215d2391ac9587bc7e74ea6c635fcd27aa6 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Sun, 27 Oct 2013 05:08:57 +0000 Subject: [PATCH] Move src files out of assets dir * client/assets/src moved to client/src * build.js moved to client/build.js * Auto-generated index.html now written to assets/index.html * Fixed bug where conf.public_http was set in config file ut conf.public_html was being read in httphandler.js --- .gitignore | 2 +- client/{assets/src => }/build.js | 110 +++++++++--------- client/{assets => }/src/app.js | 0 client/{assets => }/src/applets/chanlist.js | 0 .../{assets => }/src/applets/scripteditor.js | 0 client/{assets => }/src/applets/settings.js | 0 client/{assets => }/src/helpers/utils.js | 0 client/{assets => }/src/index.html.tmpl | 12 +- client/{assets => }/src/models/applet.js | 0 client/{assets => }/src/models/application.js | 0 client/{assets => }/src/models/channel.js | 0 client/{assets => }/src/models/datastore.js | 0 client/{assets => }/src/models/gateway.js | 0 client/{assets => }/src/models/member.js | 0 client/{assets => }/src/models/memberlist.js | 0 client/{assets => }/src/models/network.js | 0 .../src/models/networkpanellist.js | 0 .../{assets => }/src/models/newconnection.js | 0 client/{assets => }/src/models/panel.js | 0 client/{assets => }/src/models/panellist.js | 0 .../{assets => }/src/models/pluginmanager.js | 0 client/{assets => }/src/models/query.js | 0 client/{assets => }/src/models/server.js | 0 client/{assets => }/src/translations/de-de.po | 0 client/{assets => }/src/translations/en-gb.po | 0 .../{assets => }/src/translations/es-419.po | 0 client/{assets => }/src/translations/fr.po | 0 client/{assets => }/src/translations/he.po | 0 client/{assets => }/src/translations/it.po | 0 client/{assets => }/src/translations/nl.po | 0 client/{assets => }/src/translations/no.po | 0 client/{assets => }/src/translations/pt-br.po | 0 client/{assets => }/src/translations/ro.po | 0 client/{assets => }/src/translations/ru.po | 0 .../{assets => }/src/translations/template.po | 0 client/{assets => }/src/translations/tr.po | 0 .../src/translations/translations.json | 0 client/{assets => }/src/translations/vi.po | 0 client/{assets => }/src/translations/zh-tw.po | 0 client/{assets => }/src/views/applet.js | 0 client/{assets => }/src/views/application.js | 0 client/{assets => }/src/views/apptoolbar.js | 0 client/{assets => }/src/views/channel.js | 0 client/{assets => }/src/views/controlbox.js | 0 client/{assets => }/src/views/favicon.js | 0 client/{assets => }/src/views/mediamessage.js | 0 client/{assets => }/src/views/member.js | 0 client/{assets => }/src/views/memberlist.js | 0 client/{assets => }/src/views/menubox.js | 0 client/{assets => }/src/views/networktabs.js | 0 .../{assets => }/src/views/nickchangebox.js | 0 client/{assets => }/src/views/panel.js | 0 .../{assets => }/src/views/resizehandler.js | 0 client/{assets => }/src/views/serverselect.js | 0 .../{assets => }/src/views/statusmessage.js | 0 client/{assets => }/src/views/tabs.js | 0 client/{assets => }/src/views/topicbar.js | 0 client/{assets => }/src/views/userbox.js | 0 config.example.js | 2 +- server/httphandler.js | 19 +-- server/server.js | 2 +- 61 files changed, 75 insertions(+), 72 deletions(-) rename client/{assets/src => }/build.js (58%) rename client/{assets => }/src/app.js (100%) rename client/{assets => }/src/applets/chanlist.js (100%) rename client/{assets => }/src/applets/scripteditor.js (100%) rename client/{assets => }/src/applets/settings.js (100%) rename client/{assets => }/src/helpers/utils.js (100%) rename client/{assets => }/src/index.html.tmpl (96%) rename client/{assets => }/src/models/applet.js (100%) rename client/{assets => }/src/models/application.js (100%) rename client/{assets => }/src/models/channel.js (100%) rename client/{assets => }/src/models/datastore.js (100%) rename client/{assets => }/src/models/gateway.js (100%) rename client/{assets => }/src/models/member.js (100%) rename client/{assets => }/src/models/memberlist.js (100%) rename client/{assets => }/src/models/network.js (100%) rename client/{assets => }/src/models/networkpanellist.js (100%) rename client/{assets => }/src/models/newconnection.js (100%) rename client/{assets => }/src/models/panel.js (100%) rename client/{assets => }/src/models/panellist.js (100%) rename client/{assets => }/src/models/pluginmanager.js (100%) rename client/{assets => }/src/models/query.js (100%) rename client/{assets => }/src/models/server.js (100%) rename client/{assets => }/src/translations/de-de.po (100%) rename client/{assets => }/src/translations/en-gb.po (100%) rename client/{assets => }/src/translations/es-419.po (100%) rename client/{assets => }/src/translations/fr.po (100%) rename client/{assets => }/src/translations/he.po (100%) rename client/{assets => }/src/translations/it.po (100%) rename client/{assets => }/src/translations/nl.po (100%) rename client/{assets => }/src/translations/no.po (100%) rename client/{assets => }/src/translations/pt-br.po (100%) rename client/{assets => }/src/translations/ro.po (100%) rename client/{assets => }/src/translations/ru.po (100%) rename client/{assets => }/src/translations/template.po (100%) rename client/{assets => }/src/translations/tr.po (100%) rename client/{assets => }/src/translations/translations.json (100%) rename client/{assets => }/src/translations/vi.po (100%) rename client/{assets => }/src/translations/zh-tw.po (100%) rename client/{assets => }/src/views/applet.js (100%) rename client/{assets => }/src/views/application.js (100%) rename client/{assets => }/src/views/apptoolbar.js (100%) rename client/{assets => }/src/views/channel.js (100%) rename client/{assets => }/src/views/controlbox.js (100%) rename client/{assets => }/src/views/favicon.js (100%) rename client/{assets => }/src/views/mediamessage.js (100%) rename client/{assets => }/src/views/member.js (100%) rename client/{assets => }/src/views/memberlist.js (100%) rename client/{assets => }/src/views/menubox.js (100%) rename client/{assets => }/src/views/networktabs.js (100%) rename client/{assets => }/src/views/nickchangebox.js (100%) rename client/{assets => }/src/views/panel.js (100%) rename client/{assets => }/src/views/resizehandler.js (100%) rename client/{assets => }/src/views/serverselect.js (100%) rename client/{assets => }/src/views/statusmessage.js (100%) rename client/{assets => }/src/views/tabs.js (100%) rename client/{assets => }/src/views/topicbar.js (100%) rename client/{assets => }/src/views/userbox.js (100%) diff --git a/.gitignore b/.gitignore index 16f2aee..0ca71dd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ client/assets/libs/engine.io.bundle.* client/assets/kiwi.js client/assets/kiwi.min.js client/assets/locales/*.json -client/index.html +client/assets/index.html kiwi.log kiwiirc.pid config.js \ No newline at end of file diff --git a/client/assets/src/build.js b/client/build.js similarity index 58% rename from client/assets/src/build.js rename to client/build.js index 0fb8b8c..f80d0a4 100644 --- a/client/assets/src/build.js +++ b/client/build.js @@ -2,7 +2,7 @@ var fs = require('fs'), uglifyJS = require('uglify-js'), _ = require('lodash'), po2json = require('po2json'), - config = require('./../../../server/configuration.js'); + config = require('../server/configuration.js'); var FILE_ENCODING = 'utf-8', EOL = '\n'; @@ -39,48 +39,48 @@ config.loadConfig(); var source_files = [ - __dirname + '/app.js', - __dirname + '/models/application.js', - __dirname + '/models/gateway.js', - __dirname + '/models/network.js', - __dirname + '/models/member.js', - __dirname + '/models/memberlist.js', - __dirname + '/models/newconnection.js', - __dirname + '/models/panel.js', - __dirname + '/models/panellist.js', - __dirname + '/models/networkpanellist.js', - __dirname + '/models/channel.js', - __dirname + '/models/query.js', - __dirname + '/models/server.js', - __dirname + '/models/applet.js', - __dirname + '/models/pluginmanager.js', - __dirname + '/models/datastore.js', - - __dirname + '/applets/settings.js', - __dirname + '/applets/chanlist.js', - __dirname + '/applets/scripteditor.js', - - __dirname + '/helpers/utils.js', - - __dirname + '/views/panel.js', - __dirname + '/views/channel.js', - __dirname + '/views/applet.js', - __dirname + '/views/application.js', - __dirname + '/views/apptoolbar.js', - __dirname + '/views/controlbox.js', - __dirname + '/views/favicon.js', - __dirname + '/views/mediamessage.js', - __dirname + '/views/member.js', - __dirname + '/views/memberlist.js', - __dirname + '/views/menubox.js', - __dirname + '/views/networktabs.js', - __dirname + '/views/nickchangebox.js', - __dirname + '/views/resizehandler.js', - __dirname + '/views/serverselect.js', - __dirname + '/views/statusmessage.js', - __dirname + '/views/tabs.js', - __dirname + '/views/topicbar.js', - __dirname + '/views/userbox.js' + __dirname + '/src/app.js', + __dirname + '/src/models/application.js', + __dirname + '/src/models/gateway.js', + __dirname + '/src/models/network.js', + __dirname + '/src/models/member.js', + __dirname + '/src/models/memberlist.js', + __dirname + '/src/models/newconnection.js', + __dirname + '/src/models/panel.js', + __dirname + '/src/models/panellist.js', + __dirname + '/src/models/networkpanellist.js', + __dirname + '/src/models/channel.js', + __dirname + '/src/models/query.js', + __dirname + '/src/models/server.js', + __dirname + '/src/models/applet.js', + __dirname + '/src/models/pluginmanager.js', + __dirname + '/src/models/datastore.js', + + __dirname + '/src/applets/settings.js', + __dirname + '/src/applets/chanlist.js', + __dirname + '/src/applets/scripteditor.js', + + __dirname + '/src/helpers/utils.js', + + __dirname + '/src/views/panel.js', + __dirname + '/src/views/channel.js', + __dirname + '/src/views/applet.js', + __dirname + '/src/views/application.js', + __dirname + '/src/views/apptoolbar.js', + __dirname + '/src/views/controlbox.js', + __dirname + '/src/views/favicon.js', + __dirname + '/src/views/mediamessage.js', + __dirname + '/src/views/member.js', + __dirname + '/src/views/memberlist.js', + __dirname + '/src/views/menubox.js', + __dirname + '/src/views/networktabs.js', + __dirname + '/src/views/nickchangebox.js', + __dirname + '/src/views/resizehandler.js', + __dirname + '/src/views/serverselect.js', + __dirname + '/src/views/statusmessage.js', + __dirname + '/src/views/tabs.js', + __dirname + '/src/views/topicbar.js', + __dirname + '/src/views/userbox.js' ]; @@ -91,7 +91,7 @@ concat(source_files, function (err, src) { if (!err) { src = '(function (global, undefined) {\n\n' + src + '\n\n})(window);'; - fs.writeFile(__dirname + '/../kiwi.js', src, { encoding: FILE_ENCODING }, function (err) { + fs.writeFile(__dirname + '/assets/kiwi.js', src, { encoding: FILE_ENCODING }, function (err) { if (!err) { console.log('Built kiwi.js'); } else { @@ -111,7 +111,7 @@ concat(source_files, function (err, src) { ast.mangle_names(); src = ast.print_to_string(); - fs.writeFile(__dirname + '/../kiwi.min.js', src, { encoding: FILE_ENCODING }, function (err) { + fs.writeFile(__dirname + '/assets/kiwi.min.js', src, { encoding: FILE_ENCODING }, function (err) { if (!err) { console.log('Built kiwi.min.js'); } else { @@ -131,9 +131,9 @@ concat(source_files, function (err, src) { /** * Build the engineio client + tools libs */ -concat([__dirname + '/../libs/engine.io.js', __dirname + '/../libs/engine.io.tools.js'], function (err, src) { +concat([__dirname + '/assets/libs/engine.io.js', __dirname + '/assets/libs/engine.io.tools.js'], function (err, src) { if (!err) { - fs.writeFile(__dirname + '/../libs/engine.io.bundle.js', src, { encoding: FILE_ENCODING }, function (err) { + fs.writeFile(__dirname + '/assets/libs/engine.io.bundle.js', src, { encoding: FILE_ENCODING }, function (err) { if (!err) { console.log('Built engine.io.bundle.js'); } else { @@ -149,7 +149,7 @@ concat([__dirname + '/../libs/engine.io.js', __dirname + '/../libs/engine.io.too ast.mangle_names(); src = ast.print_to_string(); - fs.writeFile(__dirname + '/../libs/engine.io.bundle.min.js', src, { encoding: FILE_ENCODING }, function (err) { + fs.writeFile(__dirname + '/assets/libs/engine.io.bundle.min.js', src, { encoding: FILE_ENCODING }, function (err) { if (!err) { console.log('Built engine.io.bundle.min.js'); } else { @@ -169,18 +169,18 @@ concat([__dirname + '/../libs/engine.io.js', __dirname + '/../libs/engine.io.too /** * Convert translations from .po to .json */ -if (!fs.existsSync(__dirname + '/../locales')) { - fs.mkdirSync(__dirname + '/../locales'); +if (!fs.existsSync(__dirname + '/assets/locales')) { + fs.mkdirSync(__dirname + '/assets/locales'); } -fs.readdir(__dirname + '/translations', function (err, translation_files) { +fs.readdir(__dirname + '/src/translations', function (err, translation_files) { if (!err) { translation_files.forEach(function (file) { var locale = file.slice(0, -3); if ((file.slice(-3) === '.po') && (locale !== 'template')) { - po2json.parse(__dirname + '/translations/' + file, function (err, json) { + po2json.parse(__dirname + '/src/translations/' + file, function (err, json) { if (!err) { - fs.writeFile(__dirname + '/../locales/' + locale + '.json', JSON.stringify(json), function (err) { + fs.writeFile(__dirname + '/assets/locales/' + locale + '.json', JSON.stringify(json), function (err) { if (!err) { console.log('Built translation file %s.json', locale); } else { @@ -207,10 +207,10 @@ fs.readdir(__dirname + '/translations', function (err, translation_files) { * Build the index.html file */ -var index_src = fs.readFileSync(__dirname + '/index.html.tmpl', FILE_ENCODING) +var index_src = fs.readFileSync(__dirname + '/src/index.html.tmpl', FILE_ENCODING) .replace(new RegExp('<%base_path%>', 'g'), config.get().http_base_path || '/kiwi'); -fs.writeFile(__dirname + '/../../index.html', index_src, { encoding: FILE_ENCODING }, function (err) { +fs.writeFile(__dirname + '/assets/index.html', index_src, { encoding: FILE_ENCODING }, function (err) { if (!err) { console.log('Built index.html'); } else { diff --git a/client/assets/src/app.js b/client/src/app.js similarity index 100% rename from client/assets/src/app.js rename to client/src/app.js diff --git a/client/assets/src/applets/chanlist.js b/client/src/applets/chanlist.js similarity index 100% rename from client/assets/src/applets/chanlist.js rename to client/src/applets/chanlist.js diff --git a/client/assets/src/applets/scripteditor.js b/client/src/applets/scripteditor.js similarity index 100% rename from client/assets/src/applets/scripteditor.js rename to client/src/applets/scripteditor.js diff --git a/client/assets/src/applets/settings.js b/client/src/applets/settings.js similarity index 100% rename from client/assets/src/applets/settings.js rename to client/src/applets/settings.js diff --git a/client/assets/src/helpers/utils.js b/client/src/helpers/utils.js similarity index 100% rename from client/assets/src/helpers/utils.js rename to client/src/helpers/utils.js diff --git a/client/assets/src/index.html.tmpl b/client/src/index.html.tmpl similarity index 96% rename from client/assets/src/index.html.tmpl rename to client/src/index.html.tmpl index 47ab89e..d9e8fee 100644 --- a/client/assets/src/index.html.tmpl +++ b/client/src/index.html.tmpl @@ -439,7 +439,7 @@ var cur_script = 0; function loadNextScript () { var to_load, - base = base_path + '/assets/'; + base = base_path + '/'; // Start the kiwi app if all scripts have been loaded if (cur_script === scripts.length) { @@ -463,14 +463,14 @@ // If we're not interested in debug libs, start loading production files if (!getQueryVariable('debug')) { - scripts.push(['libs/lodash.min.js']); + scripts.push(['assets/libs/lodash.min.js']); scripts.push([ - 'libs/backbone.min.js', - 'libs/jed.js' + 'assets/libs/backbone.min.js', + 'assets/libs/jed.js' ]); scripts.push([ - 'kiwi.min.js', - 'libs/engine.io.bundle.min.js' + 'assets/kiwi.min.js', + 'assets/libs/engine.io.bundle.min.js' ]); loadNextScript(); diff --git a/client/assets/src/models/applet.js b/client/src/models/applet.js similarity index 100% rename from client/assets/src/models/applet.js rename to client/src/models/applet.js diff --git a/client/assets/src/models/application.js b/client/src/models/application.js similarity index 100% rename from client/assets/src/models/application.js rename to client/src/models/application.js diff --git a/client/assets/src/models/channel.js b/client/src/models/channel.js similarity index 100% rename from client/assets/src/models/channel.js rename to client/src/models/channel.js diff --git a/client/assets/src/models/datastore.js b/client/src/models/datastore.js similarity index 100% rename from client/assets/src/models/datastore.js rename to client/src/models/datastore.js diff --git a/client/assets/src/models/gateway.js b/client/src/models/gateway.js similarity index 100% rename from client/assets/src/models/gateway.js rename to client/src/models/gateway.js diff --git a/client/assets/src/models/member.js b/client/src/models/member.js similarity index 100% rename from client/assets/src/models/member.js rename to client/src/models/member.js diff --git a/client/assets/src/models/memberlist.js b/client/src/models/memberlist.js similarity index 100% rename from client/assets/src/models/memberlist.js rename to client/src/models/memberlist.js diff --git a/client/assets/src/models/network.js b/client/src/models/network.js similarity index 100% rename from client/assets/src/models/network.js rename to client/src/models/network.js diff --git a/client/assets/src/models/networkpanellist.js b/client/src/models/networkpanellist.js similarity index 100% rename from client/assets/src/models/networkpanellist.js rename to client/src/models/networkpanellist.js diff --git a/client/assets/src/models/newconnection.js b/client/src/models/newconnection.js similarity index 100% rename from client/assets/src/models/newconnection.js rename to client/src/models/newconnection.js diff --git a/client/assets/src/models/panel.js b/client/src/models/panel.js similarity index 100% rename from client/assets/src/models/panel.js rename to client/src/models/panel.js diff --git a/client/assets/src/models/panellist.js b/client/src/models/panellist.js similarity index 100% rename from client/assets/src/models/panellist.js rename to client/src/models/panellist.js diff --git a/client/assets/src/models/pluginmanager.js b/client/src/models/pluginmanager.js similarity index 100% rename from client/assets/src/models/pluginmanager.js rename to client/src/models/pluginmanager.js diff --git a/client/assets/src/models/query.js b/client/src/models/query.js similarity index 100% rename from client/assets/src/models/query.js rename to client/src/models/query.js diff --git a/client/assets/src/models/server.js b/client/src/models/server.js similarity index 100% rename from client/assets/src/models/server.js rename to client/src/models/server.js diff --git a/client/assets/src/translations/de-de.po b/client/src/translations/de-de.po similarity index 100% rename from client/assets/src/translations/de-de.po rename to client/src/translations/de-de.po diff --git a/client/assets/src/translations/en-gb.po b/client/src/translations/en-gb.po similarity index 100% rename from client/assets/src/translations/en-gb.po rename to client/src/translations/en-gb.po diff --git a/client/assets/src/translations/es-419.po b/client/src/translations/es-419.po similarity index 100% rename from client/assets/src/translations/es-419.po rename to client/src/translations/es-419.po diff --git a/client/assets/src/translations/fr.po b/client/src/translations/fr.po similarity index 100% rename from client/assets/src/translations/fr.po rename to client/src/translations/fr.po diff --git a/client/assets/src/translations/he.po b/client/src/translations/he.po similarity index 100% rename from client/assets/src/translations/he.po rename to client/src/translations/he.po diff --git a/client/assets/src/translations/it.po b/client/src/translations/it.po similarity index 100% rename from client/assets/src/translations/it.po rename to client/src/translations/it.po diff --git a/client/assets/src/translations/nl.po b/client/src/translations/nl.po similarity index 100% rename from client/assets/src/translations/nl.po rename to client/src/translations/nl.po diff --git a/client/assets/src/translations/no.po b/client/src/translations/no.po similarity index 100% rename from client/assets/src/translations/no.po rename to client/src/translations/no.po diff --git a/client/assets/src/translations/pt-br.po b/client/src/translations/pt-br.po similarity index 100% rename from client/assets/src/translations/pt-br.po rename to client/src/translations/pt-br.po diff --git a/client/assets/src/translations/ro.po b/client/src/translations/ro.po similarity index 100% rename from client/assets/src/translations/ro.po rename to client/src/translations/ro.po diff --git a/client/assets/src/translations/ru.po b/client/src/translations/ru.po similarity index 100% rename from client/assets/src/translations/ru.po rename to client/src/translations/ru.po diff --git a/client/assets/src/translations/template.po b/client/src/translations/template.po similarity index 100% rename from client/assets/src/translations/template.po rename to client/src/translations/template.po diff --git a/client/assets/src/translations/tr.po b/client/src/translations/tr.po similarity index 100% rename from client/assets/src/translations/tr.po rename to client/src/translations/tr.po diff --git a/client/assets/src/translations/translations.json b/client/src/translations/translations.json similarity index 100% rename from client/assets/src/translations/translations.json rename to client/src/translations/translations.json diff --git a/client/assets/src/translations/vi.po b/client/src/translations/vi.po similarity index 100% rename from client/assets/src/translations/vi.po rename to client/src/translations/vi.po diff --git a/client/assets/src/translations/zh-tw.po b/client/src/translations/zh-tw.po similarity index 100% rename from client/assets/src/translations/zh-tw.po rename to client/src/translations/zh-tw.po diff --git a/client/assets/src/views/applet.js b/client/src/views/applet.js similarity index 100% rename from client/assets/src/views/applet.js rename to client/src/views/applet.js diff --git a/client/assets/src/views/application.js b/client/src/views/application.js similarity index 100% rename from client/assets/src/views/application.js rename to client/src/views/application.js diff --git a/client/assets/src/views/apptoolbar.js b/client/src/views/apptoolbar.js similarity index 100% rename from client/assets/src/views/apptoolbar.js rename to client/src/views/apptoolbar.js diff --git a/client/assets/src/views/channel.js b/client/src/views/channel.js similarity index 100% rename from client/assets/src/views/channel.js rename to client/src/views/channel.js diff --git a/client/assets/src/views/controlbox.js b/client/src/views/controlbox.js similarity index 100% rename from client/assets/src/views/controlbox.js rename to client/src/views/controlbox.js diff --git a/client/assets/src/views/favicon.js b/client/src/views/favicon.js similarity index 100% rename from client/assets/src/views/favicon.js rename to client/src/views/favicon.js diff --git a/client/assets/src/views/mediamessage.js b/client/src/views/mediamessage.js similarity index 100% rename from client/assets/src/views/mediamessage.js rename to client/src/views/mediamessage.js diff --git a/client/assets/src/views/member.js b/client/src/views/member.js similarity index 100% rename from client/assets/src/views/member.js rename to client/src/views/member.js diff --git a/client/assets/src/views/memberlist.js b/client/src/views/memberlist.js similarity index 100% rename from client/assets/src/views/memberlist.js rename to client/src/views/memberlist.js diff --git a/client/assets/src/views/menubox.js b/client/src/views/menubox.js similarity index 100% rename from client/assets/src/views/menubox.js rename to client/src/views/menubox.js diff --git a/client/assets/src/views/networktabs.js b/client/src/views/networktabs.js similarity index 100% rename from client/assets/src/views/networktabs.js rename to client/src/views/networktabs.js diff --git a/client/assets/src/views/nickchangebox.js b/client/src/views/nickchangebox.js similarity index 100% rename from client/assets/src/views/nickchangebox.js rename to client/src/views/nickchangebox.js diff --git a/client/assets/src/views/panel.js b/client/src/views/panel.js similarity index 100% rename from client/assets/src/views/panel.js rename to client/src/views/panel.js diff --git a/client/assets/src/views/resizehandler.js b/client/src/views/resizehandler.js similarity index 100% rename from client/assets/src/views/resizehandler.js rename to client/src/views/resizehandler.js diff --git a/client/assets/src/views/serverselect.js b/client/src/views/serverselect.js similarity index 100% rename from client/assets/src/views/serverselect.js rename to client/src/views/serverselect.js diff --git a/client/assets/src/views/statusmessage.js b/client/src/views/statusmessage.js similarity index 100% rename from client/assets/src/views/statusmessage.js rename to client/src/views/statusmessage.js diff --git a/client/assets/src/views/tabs.js b/client/src/views/tabs.js similarity index 100% rename from client/assets/src/views/tabs.js rename to client/src/views/tabs.js diff --git a/client/assets/src/views/topicbar.js b/client/src/views/topicbar.js similarity index 100% rename from client/assets/src/views/topicbar.js rename to client/src/views/topicbar.js diff --git a/client/assets/src/views/userbox.js b/client/src/views/userbox.js similarity index 100% rename from client/assets/src/views/userbox.js rename to client/src/views/userbox.js diff --git a/config.example.js b/config.example.js index a86fdb1..2e7cc5f 100644 --- a/config.example.js +++ b/config.example.js @@ -53,7 +53,7 @@ conf.identd = { // Where the client files are -conf.public_http = "client/"; +conf.public_html = "client/"; // Max connections per connection. 0 to disable conf.max_client_conns = 5; diff --git a/server/httphandler.js b/server/httphandler.js index bed9b49..68c4fbc 100644 --- a/server/httphandler.js +++ b/server/httphandler.js @@ -52,9 +52,12 @@ HttpHandler.prototype.serve = function (request, response) { // Any asset request to head into the asset dir request.url = request.url.replace(base_path + '/assets/', '/assets/'); + // Any src request to head into the src dir + request.url = request.url.replace(base_path + '/src/', '/src/'); + // Any requests for /client to load the index file if (request.url.match(new RegExp('^' + base_path_regex + '([/$]|$)', 'i'))) { - request.url = '/'; + request.url = '/assets/index.html'; } // If the 'magic' translation is requested, figure out the best language to use from @@ -208,9 +211,9 @@ function generateSettings(request, debug, callback) { translations: [], scripts: [ [ - 'libs/lodash.min.js' + 'assets/libs/lodash.min.js' ], - ['libs/backbone.min.js', 'libs/jed.js'] + ['assets/libs/backbone.min.js', 'assets/libs/jed.js'] ] }; @@ -218,8 +221,8 @@ function generateSettings(request, debug, callback) { vars.scripts = vars.scripts.concat([ [ 'src/app.js', - 'libs/engine.io.js', - 'libs/engine.io.tools.js' + 'assets/libs/engine.io.js', + 'assets/libs/engine.io.tools.js' ], [ 'src/models/application.js', @@ -281,7 +284,7 @@ function generateSettings(request, debug, callback) { ] ]); } else { - vars.scripts.push(['kiwi.min.js', 'libs/engine.io.bundle.min.js']); + vars.scripts.push(['assets/kiwi.min.js', 'assets/libs/engine.io.bundle.min.js']); } // Any restricted server mode set? @@ -309,14 +312,14 @@ function generateSettings(request, debug, callback) { } // Get a list of available translations - fs.readFile(__dirname + '/../client/assets/src/translations/translations.json', function (err, translations) { + fs.readFile(__dirname + '/../client/src/translations/translations.json', function (err, translations) { if (err) { return callback(err); } var translation_files; translations = JSON.parse(translations); - fs.readdir(__dirname + '/../client/assets/src/translations/', function (err, pofiles) { + fs.readdir(__dirname + '/../client/src/translations/', function (err, pofiles) { var hash, settings; if (err) { return callback(err); diff --git a/server/server.js b/server/server.js index c7e39e5..a139f60 100644 --- a/server/server.js +++ b/server/server.js @@ -45,7 +45,7 @@ switch (process.argv[2]) { break; case 'build': - require('../client/assets/src/build.js'); + require('../client/build.js'); break; default: -- 2.25.1