Merge branch 'master' into 0.5.1

v1.18.x
Julian Lam 11 years ago
commit 101288c75c

@ -3,6 +3,10 @@
"field": "title",
"value": "NodeBB"
},
{
"field": "showSiteTitle",
"value": "1"
},
{
"field": "postDelay",
"value": 10

@ -2,7 +2,7 @@
"name": "nodebb",
"license": "GPLv3 or later",
"description": "NodeBB Forum",
"version": "0.5.0-4",
"version": "0.5.0",
"homepage": "http://www.nodebb.org",
"repository": {
"type": "git",

@ -1,7 +1,7 @@
"use strict";
/*global define, ajaxify, app, socket, RELATIVE_PATH*/
define('forum/admin/index', function() {
define('forum/admin/index', ['semver'], function(semver) {
var Admin = {};
Admin.init = function() {
@ -21,6 +21,13 @@ define('forum/admin/index', function() {
});
$.get('https://api.github.com/repos/NodeBB/NodeBB/tags', function(releases) {
// Re-sort the releases, as they do not follow Semver (wrt pre-releases)
releases = releases.sort(function(a, b) {
a = a.name.replace(/^v/, '');
b = b.name.replace(/^v/, '');
return semver.lt(a, b) ? 1 : -1;
});
var version = $('#version').html(),
latestVersion = releases[0].name.slice(1),
checkEl = $('.version-check');

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 KiB

File diff suppressed because it is too large Load Diff

@ -1,6 +1,7 @@
'use strict';
var user = require('../user'),
var winston = require('winston'),
user = require('../user'),
translator = require('../../public/src/translator');
module.exports = function(Meta) {
@ -14,7 +15,14 @@ module.exports = function(Meta) {
};
Meta.title.build = function (urlFragment, language, callback) {
Meta.title.parseFragment(decodeURIComponent(urlFragment), language, function(err, title) {
var uri = '';
try {
uri = decodeURIComponent(urlFragment);
} catch(e) {
winston.error('Invalid url fragment : ' + urlFragment, e.stack);
return callback(null, Meta.config.browserTitle || 'NodeBB');
}
Meta.title.parseFragment(uri, language, function(err, title) {
if (err) {
title = Meta.config.browserTitle || 'NodeBB';
} else {

@ -295,7 +295,7 @@ var async = require('async'),
}
posts = posts.filter(function(post) {
return parseInt(results.topics[post.tid].deleted, 10) !== 1;
return results.topics[post.tid] && parseInt(results.topics[post.tid].deleted, 10) !== 1;
});
async.map(posts, function(post, next) {

@ -173,9 +173,9 @@ var async = require('async'),
Topics.getTopicsData(tids, function(err, topics) {
function mapFilter(array, field) {
return array.map(function(topic) {
return topic[field];
return topic && topic[field];
}).filter(function(value, index, array) {
return array.indexOf(value) === index;
return value && array.indexOf(value) === index;
});
}
@ -218,6 +218,7 @@ var async = require('async'),
});
for (var i=0; i<topics.length; ++i) {
if (topics[i]) {
topics[i].category = categories[topics[i].cid];
topics[i].category.disabled = parseInt(topics[i].category.disabled, 10) === 1;
topics[i].user = users[topics[i].uid];
@ -230,9 +231,10 @@ var async = require('async'),
topics[i].unread = !(results.hasRead[i] && parseInt(uid, 10) !== 0);
topics[i].unreplied = parseInt(topics[i].postcount, 10) <= 1;
}
}
topics = topics.filter(function(topic) {
return !topic.category.disabled &&
return topic && !topic.category.disabled &&
(!topic.deleted || (topic.deleted && isAdminOrMod[topic.cid]) ||
parseInt(topic.uid, 10) === parseInt(uid, 10));
});

Loading…
Cancel
Save