diff --git a/README.md b/README.md
index 1553785f39..40485cedae 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,10 @@ The server configuration file (located at `/config.js`) contains default options
base_url
(Default: 'http://localhost') A web-accessible URL to your app, without the port
+
+
upload_path
+
(Default: '/public/uploads') A relative path (relative to the application's web root) to the uploads folder. Please ensure that Node.js can write to this folder
+
use_port
(Default: true) Whether or not to include the port number when constructing the url for use in NodeBB. If you are serving NodeBB via a proxy (i.e. nginx), switch this off.
diff --git a/app.js b/app.js
index 0aa624af0e..5f5d16ac8d 100644
--- a/app.js
+++ b/app.js
@@ -1,41 +1,30 @@
-var modules = {
- user: require('./src/user.js'),
- topics: require('./src/topics.js'),
- posts: require('./src/posts.js'),
- categories: require('./src/categories.js'),
- templates: require('./src/templates.js'),
- webserver: require('./src/webserver.js'),
- websockets: require('./src/websockets.js'),
- fs: require('fs')
- }
-
- DEVELOPMENT = true;
+var categories = require('./src/categories.js'),
+ templates = require('./src/templates.js'),
+ webserver = require('./src/webserver.js'),
+ websockets = require('./src/websockets.js'),
+ fs = require('fs');
+DEVELOPMENT = true;
global.configuration = {};
-global.modules = modules;
-
(function(config) {
config['ROOT_DIRECTORY'] = __dirname;
- modules.templates.init();
- modules.websockets.init();
-
-
+ templates.init();
//setup scripts to be moved outside of the app in future.
function setup_categories() {
console.log('Checking categories...');
- modules.categories.get(function(data) {
+ categories.get(function(data) {
if (data.categories.length === 0) {
console.log('Setting up default categories...');
- modules.fs.readFile(config.ROOT_DIRECTORY + '/install/data/categories.json', function(err, categories) {
+ fs.readFile(config.ROOT_DIRECTORY + '/install/data/categories.json', function(err, categories) {
categories = JSON.parse(categories);
for (var category in categories) {
- modules.categories.create(categories[category]);
+ categories.create(categories[category]);
}
});
diff --git a/config.default.js b/config.default.js
index 69c0d7a9c0..e7a662b76b 100644
--- a/config.default.js
+++ b/config.default.js
@@ -5,11 +5,8 @@ var config = {
// "base_url" is expected to be a publically accessible URL to your NodeBB instance (Default base_url: 'http://localhost', port: '4567')
"base_url": "http://localhost",
- // public url for uploaded files
- "upload_url": "http://dev.domain.com/uploads/",
-
// relative path for uploads
- "upload_path": "/uploads/",
+ "upload_path": "/public/uploads/",
"use_port": true,
"port": 4567,
@@ -54,5 +51,6 @@ var config = {
}
config.url = config.base_url + (config.use_port ? ':' + config.port : '') + '/';
+config.upload_url = config.base_url + (config.use_port ? ':' + config.port : '') + '/uploads/';
module.exports = config;
\ No newline at end of file
diff --git a/public/css/style.less b/public/css/style.less
index 93719fcd45..8a39505d37 100644
--- a/public/css/style.less
+++ b/public/css/style.less
@@ -245,6 +245,11 @@ footer.footer {
line-height: 18px;
padding: 5px;
padding-left: 10px;
+
+ img.hidden-desktop {
+ max-width: 10px;
+ max-height: 10px;
+ }
}
.post-content {
min-height: 50px;
@@ -371,6 +376,7 @@ footer.footer {
.user-profile-picture {
width:128px;
height:128px;
+ margin-bottom:10px;
}
.user-8080-picture {
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index e83d16fbf4..b2941529fc 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -21,11 +21,12 @@ var ajaxify = {};
window.onpopstate = function(event) {
- // this breaks reloading and results in ajaxify.go calling twice, believe it messes around with sockets. ill come back for you later bitchez
- // ajaxify.go(document.location.href.replace(rootUrl +'/', ''));
+ console.log('popstate called:', event);
+ if (event !== null && event.state && event.state.url) ajaxify.go(event.state.url, null, null, true);
};
- ajaxify.go = function(url, callback, custom_tpl) {
+ ajaxify.go = function(url, callback, template, quiet) {
+ // "quiet": If set to true, will not call pushState
// leave room and join global
app.enter_room('global');
@@ -41,7 +42,11 @@ var ajaxify = {};
}
if (templates[tpl_url]) {
- window.history.pushState({}, url, "/" + url);
+ if (quiet !== true) {
+ window.history.pushState({
+ "url": url
+ }, url, "/" + url);
+ }
jQuery('#footer').fadeOut(100);
jQuery('#content').fadeOut(100);
@@ -55,7 +60,7 @@ var ajaxify = {};
}
jQuery('#content, #footer').fadeIn(200);
- }, custom_tpl);
+ }, url, template);
return true;
diff --git a/public/src/templates.js b/public/src/templates.js
index 95c7f76566..de538645e8 100644
--- a/public/src/templates.js
+++ b/public/src/templates.js
@@ -160,14 +160,12 @@ var templates = {};
}());
-function load_template(callback, custom_tpl) {
+function load_template(callback, url, template) {
var location = document.location || window.location,
rootUrl = location.protocol + '//' + (location.hostname || location.host) + (location.port ? ':' + location.port : '');
- var url = location.href.replace(rootUrl +'/', '');
url = (url === '' || url === '/') ? 'home' : url;
-
jQuery.get(API_URL + url, function(data) {
var tpl = templates.get_custom_map(url);
diff --git a/public/templates/account.tpl b/public/templates/account.tpl
index 5b870e6c59..58c4cad975 100644
--- a/public/templates/account.tpl
+++ b/public/templates/account.tpl
@@ -6,48 +6,47 @@
-
-
+