Merge branch 'develop' into upgrades-refactor

Also handled upgrade script introduced in #5482
v1.18.x
Julian Lam 8 years ago
commit 23a0881311

@ -2,7 +2,7 @@
"name": "nodebb",
"license": "GPL-3.0",
"description": "NodeBB Forum",
"version": "1.4.3",
"version": "1.4.4",
"homepage": "http://www.nodebb.org",
"repository": {
"type": "git",

@ -1,6 +1,6 @@
{
"events": "Veranstaltungen",
"no-events": "Es gibt keine Veranstaltungen",
"control-panel": "Veranstaltungen Steuerung",
"delete-events": "Veranstaltungen löschen"
"events": "Ereignisse",
"no-events": "Es gibt keine Ereignisse",
"control-panel": "Ereignis-Steuerung",
"delete-events": "Ereignisse löschen"
}

@ -7,14 +7,14 @@
"allow-login-with": "Allow login with",
"allow-login-with.username-email": "Kullanıcı adı veya Email",
"allow-login-with.username": "Sadece kullanıcı adı",
"allow-login-with.email": "Email Only",
"allow-login-with.email": "Sadece Email",
"account-settings": "Hesap Ayarları",
"disable-username-changes": "Disable username changes",
"disable-email-changes": "Disable email changes",
"disable-password-changes": "Disable password changes",
"allow-account-deletion": "Allow account deletion",
"user-info-private": "Make user info private",
"themes": "Themes",
"disable-username-changes": "Kullanıcı adı değişikliği kapalı",
"disable-email-changes": "Email değişikliği kapalı",
"disable-password-changes": "Parola değişikliği kapalı",
"allow-account-deletion": "Hesap silmeye izin ver",
"user-info-private": "Kullanıcı bilgilerini gizli yap",
"themes": "Temalar",
"disable-user-skins": "Prevent users from choosing a custom skin",
"account-protection": "Account Protection",
"login-attempts": "Login attempts per hour",
@ -23,13 +23,13 @@
"login-days": "Days to remember user login sessions",
"password-expiry-days": "Force password reset after a set number of days",
"registration": "User Registration",
"registration-type": "Registration Type",
"registration-type": "Kayıt Tipi",
"registration-type.normal": "Normal",
"registration-type.admin-approval": "Admin Approval",
"registration-type.admin-approval-ip": "Admin Approval for IPs",
"registration-type.invite-only": "Invite Only",
"registration-type.admin-invite-only": "Admin Invite Only",
"registration-type.disabled": "No registration",
"registration-type.admin-approval": "Yönetici Onayı",
"registration-type.admin-approval-ip": "IP'ler için Yönetici Onayı",
"registration-type.invite-only": "Sadece Davet",
"registration-type.admin-invite-only": "Sadece Yönetici Daveti",
"registration-type.disabled": "Kayıt yok",
"registration-type.help": "Normal - Users can register from the /register page.<br/>\nAdmin Approval - User registrations are placed in an <a href=\"%1/admin/manage/registration\">approval queue</a> for administrators.<br/>\nAdmin Approval for IPs - Normal for new users, Admin Approval for IP addresses that already have an account.<br/>\nInvite Only - Users can invite others from the <a href=\"%1/users\" target=\"_blank\">users</a> page.<br/>\nAdmin Invite Only - Only administrators can invite others from <a href=\"%1/users\" target=\"_blank\">users</a> and <a href=\"%1/admin/manage/users\">admin/manage/users</a> pages.<br/>\nNo registration - No user registration.<br/>",
"registration.max-invites": "Maximum Invitations per User",
"max-invites": "Maximum Invitations per User",

@ -2,7 +2,7 @@
"latest_users": "最新会员",
"top_posters": "发帖排行",
"most_reputation": "声望排行",
"most_flags": "被举报次数最多",
"most_flags": "最多举报",
"search": "搜索",
"enter_username": "输入用户名搜索",
"load_more": "加载更多",

@ -13,20 +13,6 @@ define('admin/general/sounds', ['sounds', 'settings', 'admin/settings'], functio
Sounds.playSound(soundName);
});
// Load Form Values
Settings.load('sounds', $('.sounds form'));
// Saving of Form Values
var saveEl = $('#save');
saveEl.on('click', function () {
Settings.save('sounds', $('.sounds form'), function () {
socket.emit('admin.fireEvent', {
name: 'event:sounds.reloadMapping',
});
app.alertSuccess('[[admin/general/sounds:saved]]');
});
});
AdminSettings.prepare();
};

@ -102,19 +102,18 @@
helpers.generateChildrenCategories = function (category) {
var html = '';
var relative_path = (typeof config !== 'undefined' ? config.relative_path : require('nconf').get('relative_path'));
if (!category || !category.children) {
if (!category || !category.children || !category.children.length) {
return html;
}
category.children.forEach(function (child) {
if (!child) {
return;
if (child) {
var link = child.link ? child.link : (relative_path + '/category/' + child.slug);
html += '<a href="' + link + '">' +
'<span class="fa-stack fa-lg">' +
'<i style="color:' + child.bgColor + ';" class="fa fa-circle fa-stack-2x"></i>' +
'<i style="color:' + child.color + ';" class="fa fa-stack-1x ' + child.icon + '"></i>' +
'</span><small>' + child.name + '</small></a> ';
}
var link = child.link ? child.link : (relative_path + '/category/' + child.slug);
html += '<a href="' + link + '">' +
'<span class="fa-stack fa-lg">' +
'<i style="color:' + child.bgColor + ';" class="fa fa-circle fa-stack-2x"></i>' +
'<i style="color:' + child.color + ';" class="fa fa-stack-1x ' + child.icon + '"></i>' +
'</span><small>' + child.name + '</small></a> ';
});
html = html ? ('<span class="category-children">' + html + '</span>') : html;
return html;
@ -142,10 +141,6 @@
return style.join(' ');
};
helpers.getBookmarkFromIndex = function (topic) {
return (topic.index || 0) + 1;
};
helpers.displayUserSearch = function (data, allowGuestUserSearching) {
return data.loggedIn || allowGuestUserSearching === 'true';
};

Binary file not shown.

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 382 KiB

After

Width:  |  Height:  |  Size: 434 KiB

@ -1,5 +1,5 @@
/*!
* Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/

@ -605,6 +605,7 @@
.@{fa-css-prefix}-opencart:before { content: @fa-var-opencart; }
.@{fa-css-prefix}-expeditedssl:before { content: @fa-var-expeditedssl; }
.@{fa-css-prefix}-battery-4:before,
.@{fa-css-prefix}-battery:before,
.@{fa-css-prefix}-battery-full:before { content: @fa-var-battery-full; }
.@{fa-css-prefix}-battery-3:before,
.@{fa-css-prefix}-battery-three-quarters:before { content: @fa-var-battery-three-quarters; }
@ -731,3 +732,58 @@
.@{fa-css-prefix}-google-plus-official:before { content: @fa-var-google-plus-official; }
.@{fa-css-prefix}-fa:before,
.@{fa-css-prefix}-font-awesome:before { content: @fa-var-font-awesome; }
.@{fa-css-prefix}-handshake-o:before { content: @fa-var-handshake-o; }
.@{fa-css-prefix}-envelope-open:before { content: @fa-var-envelope-open; }
.@{fa-css-prefix}-envelope-open-o:before { content: @fa-var-envelope-open-o; }
.@{fa-css-prefix}-linode:before { content: @fa-var-linode; }
.@{fa-css-prefix}-address-book:before { content: @fa-var-address-book; }
.@{fa-css-prefix}-address-book-o:before { content: @fa-var-address-book-o; }
.@{fa-css-prefix}-vcard:before,
.@{fa-css-prefix}-address-card:before { content: @fa-var-address-card; }
.@{fa-css-prefix}-vcard-o:before,
.@{fa-css-prefix}-address-card-o:before { content: @fa-var-address-card-o; }
.@{fa-css-prefix}-user-circle:before { content: @fa-var-user-circle; }
.@{fa-css-prefix}-user-circle-o:before { content: @fa-var-user-circle-o; }
.@{fa-css-prefix}-user-o:before { content: @fa-var-user-o; }
.@{fa-css-prefix}-id-badge:before { content: @fa-var-id-badge; }
.@{fa-css-prefix}-drivers-license:before,
.@{fa-css-prefix}-id-card:before { content: @fa-var-id-card; }
.@{fa-css-prefix}-drivers-license-o:before,
.@{fa-css-prefix}-id-card-o:before { content: @fa-var-id-card-o; }
.@{fa-css-prefix}-quora:before { content: @fa-var-quora; }
.@{fa-css-prefix}-free-code-camp:before { content: @fa-var-free-code-camp; }
.@{fa-css-prefix}-telegram:before { content: @fa-var-telegram; }
.@{fa-css-prefix}-thermometer-4:before,
.@{fa-css-prefix}-thermometer:before,
.@{fa-css-prefix}-thermometer-full:before { content: @fa-var-thermometer-full; }
.@{fa-css-prefix}-thermometer-3:before,
.@{fa-css-prefix}-thermometer-three-quarters:before { content: @fa-var-thermometer-three-quarters; }
.@{fa-css-prefix}-thermometer-2:before,
.@{fa-css-prefix}-thermometer-half:before { content: @fa-var-thermometer-half; }
.@{fa-css-prefix}-thermometer-1:before,
.@{fa-css-prefix}-thermometer-quarter:before { content: @fa-var-thermometer-quarter; }
.@{fa-css-prefix}-thermometer-0:before,
.@{fa-css-prefix}-thermometer-empty:before { content: @fa-var-thermometer-empty; }
.@{fa-css-prefix}-shower:before { content: @fa-var-shower; }
.@{fa-css-prefix}-bathtub:before,
.@{fa-css-prefix}-s15:before,
.@{fa-css-prefix}-bath:before { content: @fa-var-bath; }
.@{fa-css-prefix}-podcast:before { content: @fa-var-podcast; }
.@{fa-css-prefix}-window-maximize:before { content: @fa-var-window-maximize; }
.@{fa-css-prefix}-window-minimize:before { content: @fa-var-window-minimize; }
.@{fa-css-prefix}-window-restore:before { content: @fa-var-window-restore; }
.@{fa-css-prefix}-times-rectangle:before,
.@{fa-css-prefix}-window-close:before { content: @fa-var-window-close; }
.@{fa-css-prefix}-times-rectangle-o:before,
.@{fa-css-prefix}-window-close-o:before { content: @fa-var-window-close-o; }
.@{fa-css-prefix}-bandcamp:before { content: @fa-var-bandcamp; }
.@{fa-css-prefix}-grav:before { content: @fa-var-grav; }
.@{fa-css-prefix}-etsy:before { content: @fa-var-etsy; }
.@{fa-css-prefix}-imdb:before { content: @fa-var-imdb; }
.@{fa-css-prefix}-ravelry:before { content: @fa-var-ravelry; }
.@{fa-css-prefix}-eercast:before { content: @fa-var-eercast; }
.@{fa-css-prefix}-microchip:before { content: @fa-var-microchip; }
.@{fa-css-prefix}-snowflake-o:before { content: @fa-var-snowflake-o; }
.@{fa-css-prefix}-superpowers:before { content: @fa-var-superpowers; }
.@{fa-css-prefix}-wpexplorer:before { content: @fa-var-wpexplorer; }
.@{fa-css-prefix}-meetup:before { content: @fa-var-meetup; }

@ -4,14 +4,18 @@
@fa-font-path: "./vendor/fontawesome/fonts";
@fa-font-size-base: 14px;
@fa-line-height-base: 1;
//@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.6.3/fonts"; // for referencing Bootstrap CDN font files directly
//@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts"; // for referencing Bootstrap CDN font files directly
@fa-css-prefix: fa;
@fa-version: "4.6.3";
@fa-version: "4.7.0";
@fa-border-color: #eee;
@fa-inverse: #fff;
@fa-li-width: (30em / 14);
@fa-var-500px: "\f26e";
@fa-var-address-book: "\f2b9";
@fa-var-address-book-o: "\f2ba";
@fa-var-address-card: "\f2bb";
@fa-var-address-card-o: "\f2bc";
@fa-var-adjust: "\f042";
@fa-var-adn: "\f170";
@fa-var-align-center: "\f037";
@ -60,11 +64,15 @@
@fa-var-backward: "\f04a";
@fa-var-balance-scale: "\f24e";
@fa-var-ban: "\f05e";
@fa-var-bandcamp: "\f2d5";
@fa-var-bank: "\f19c";
@fa-var-bar-chart: "\f080";
@fa-var-bar-chart-o: "\f080";
@fa-var-barcode: "\f02a";
@fa-var-bars: "\f0c9";
@fa-var-bath: "\f2cd";
@fa-var-bathtub: "\f2cd";
@fa-var-battery: "\f240";
@fa-var-battery-0: "\f244";
@fa-var-battery-1: "\f243";
@fa-var-battery-2: "\f242";
@ -214,19 +222,25 @@
@fa-var-dot-circle-o: "\f192";
@fa-var-download: "\f019";
@fa-var-dribbble: "\f17d";
@fa-var-drivers-license: "\f2c2";
@fa-var-drivers-license-o: "\f2c3";
@fa-var-dropbox: "\f16b";
@fa-var-drupal: "\f1a9";
@fa-var-edge: "\f282";
@fa-var-edit: "\f044";
@fa-var-eercast: "\f2da";
@fa-var-eject: "\f052";
@fa-var-ellipsis-h: "\f141";
@fa-var-ellipsis-v: "\f142";
@fa-var-empire: "\f1d1";
@fa-var-envelope: "\f0e0";
@fa-var-envelope-o: "\f003";
@fa-var-envelope-open: "\f2b6";
@fa-var-envelope-open-o: "\f2b7";
@fa-var-envelope-square: "\f199";
@fa-var-envira: "\f299";
@fa-var-eraser: "\f12d";
@fa-var-etsy: "\f2d7";
@fa-var-eur: "\f153";
@fa-var-euro: "\f153";
@fa-var-exchange: "\f0ec";
@ -294,6 +308,7 @@
@fa-var-forumbee: "\f211";
@fa-var-forward: "\f04e";
@fa-var-foursquare: "\f180";
@fa-var-free-code-camp: "\f2c5";
@fa-var-frown-o: "\f119";
@fa-var-futbol-o: "\f1e3";
@fa-var-gamepad: "\f11b";
@ -326,6 +341,7 @@
@fa-var-google-wallet: "\f1ee";
@fa-var-graduation-cap: "\f19d";
@fa-var-gratipay: "\f184";
@fa-var-grav: "\f2d6";
@fa-var-group: "\f0c0";
@fa-var-h-square: "\f0fd";
@fa-var-hacker-news: "\f1d4";
@ -342,6 +358,7 @@
@fa-var-hand-scissors-o: "\f257";
@fa-var-hand-spock-o: "\f259";
@fa-var-hand-stop-o: "\f256";
@fa-var-handshake-o: "\f2b5";
@fa-var-hard-of-hearing: "\f2a4";
@fa-var-hashtag: "\f292";
@fa-var-hdd-o: "\f0a0";
@ -365,8 +382,12 @@
@fa-var-houzz: "\f27c";
@fa-var-html5: "\f13b";
@fa-var-i-cursor: "\f246";
@fa-var-id-badge: "\f2c1";
@fa-var-id-card: "\f2c2";
@fa-var-id-card-o: "\f2c3";
@fa-var-ils: "\f20b";
@fa-var-image: "\f03e";
@fa-var-imdb: "\f2d8";
@fa-var-inbox: "\f01c";
@fa-var-indent: "\f03c";
@fa-var-industry: "\f275";
@ -404,6 +425,7 @@
@fa-var-link: "\f0c1";
@fa-var-linkedin: "\f0e1";
@fa-var-linkedin-square: "\f08c";
@fa-var-linode: "\f2b8";
@fa-var-linux: "\f17c";
@fa-var-list: "\f03a";
@fa-var-list-alt: "\f022";
@ -436,8 +458,10 @@
@fa-var-meanpath: "\f20c";
@fa-var-medium: "\f23a";
@fa-var-medkit: "\f0fa";
@fa-var-meetup: "\f2e0";
@fa-var-meh-o: "\f11a";
@fa-var-mercury: "\f223";
@fa-var-microchip: "\f2db";
@fa-var-microphone: "\f130";
@fa-var-microphone-slash: "\f131";
@fa-var-minus: "\f068";
@ -502,6 +526,7 @@
@fa-var-plus-circle: "\f055";
@fa-var-plus-square: "\f0fe";
@fa-var-plus-square-o: "\f196";
@fa-var-podcast: "\f2ce";
@fa-var-power-off: "\f011";
@fa-var-print: "\f02f";
@fa-var-product-hunt: "\f288";
@ -511,10 +536,12 @@
@fa-var-question: "\f128";
@fa-var-question-circle: "\f059";
@fa-var-question-circle-o: "\f29c";
@fa-var-quora: "\f2c4";
@fa-var-quote-left: "\f10d";
@fa-var-quote-right: "\f10e";
@fa-var-ra: "\f1d0";
@fa-var-random: "\f074";
@fa-var-ravelry: "\f2d9";
@fa-var-rebel: "\f1d0";
@fa-var-recycle: "\f1b8";
@fa-var-reddit: "\f1a1";
@ -541,6 +568,7 @@
@fa-var-rub: "\f158";
@fa-var-ruble: "\f158";
@fa-var-rupee: "\f156";
@fa-var-s15: "\f2cd";
@fa-var-safari: "\f267";
@fa-var-save: "\f0c7";
@fa-var-scissors: "\f0c4";
@ -565,6 +593,7 @@
@fa-var-shopping-bag: "\f290";
@fa-var-shopping-basket: "\f291";
@fa-var-shopping-cart: "\f07a";
@fa-var-shower: "\f2cc";
@fa-var-sign-in: "\f090";
@fa-var-sign-language: "\f2a7";
@fa-var-sign-out: "\f08b";
@ -581,6 +610,7 @@
@fa-var-snapchat: "\f2ab";
@fa-var-snapchat-ghost: "\f2ac";
@fa-var-snapchat-square: "\f2ad";
@fa-var-snowflake-o: "\f2dc";
@fa-var-soccer-ball-o: "\f1e3";
@fa-var-sort: "\f0dc";
@fa-var-sort-alpha-asc: "\f15d";
@ -626,6 +656,7 @@
@fa-var-subway: "\f239";
@fa-var-suitcase: "\f0f2";
@fa-var-sun-o: "\f185";
@fa-var-superpowers: "\f2dd";
@fa-var-superscript: "\f12b";
@fa-var-support: "\f1cd";
@fa-var-table: "\f0ce";
@ -635,6 +666,7 @@
@fa-var-tags: "\f02c";
@fa-var-tasks: "\f0ae";
@fa-var-taxi: "\f1ba";
@fa-var-telegram: "\f2c6";
@fa-var-television: "\f26c";
@fa-var-tencent-weibo: "\f1d5";
@fa-var-terminal: "\f120";
@ -644,6 +676,17 @@
@fa-var-th-large: "\f009";
@fa-var-th-list: "\f00b";
@fa-var-themeisle: "\f2b2";
@fa-var-thermometer: "\f2c7";
@fa-var-thermometer-0: "\f2cb";
@fa-var-thermometer-1: "\f2ca";
@fa-var-thermometer-2: "\f2c9";
@fa-var-thermometer-3: "\f2c8";
@fa-var-thermometer-4: "\f2c7";
@fa-var-thermometer-empty: "\f2cb";
@fa-var-thermometer-full: "\f2c7";
@fa-var-thermometer-half: "\f2c9";
@fa-var-thermometer-quarter: "\f2ca";
@fa-var-thermometer-three-quarters: "\f2c8";
@fa-var-thumb-tack: "\f08d";
@fa-var-thumbs-down: "\f165";
@fa-var-thumbs-o-down: "\f088";
@ -653,6 +696,8 @@
@fa-var-times: "\f00d";
@fa-var-times-circle: "\f057";
@fa-var-times-circle-o: "\f05c";
@fa-var-times-rectangle: "\f2d3";
@fa-var-times-rectangle-o: "\f2d4";
@fa-var-tint: "\f043";
@fa-var-toggle-down: "\f150";
@fa-var-toggle-left: "\f191";
@ -693,11 +738,16 @@
@fa-var-usb: "\f287";
@fa-var-usd: "\f155";
@fa-var-user: "\f007";
@fa-var-user-circle: "\f2bd";
@fa-var-user-circle-o: "\f2be";
@fa-var-user-md: "\f0f0";
@fa-var-user-o: "\f2c0";
@fa-var-user-plus: "\f234";
@fa-var-user-secret: "\f21b";
@fa-var-user-times: "\f235";
@fa-var-users: "\f0c0";
@fa-var-vcard: "\f2bb";
@fa-var-vcard-o: "\f2bc";
@fa-var-venus: "\f221";
@fa-var-venus-double: "\f226";
@fa-var-venus-mars: "\f228";
@ -722,10 +772,16 @@
@fa-var-wheelchair-alt: "\f29b";
@fa-var-wifi: "\f1eb";
@fa-var-wikipedia-w: "\f266";
@fa-var-window-close: "\f2d3";
@fa-var-window-close-o: "\f2d4";
@fa-var-window-maximize: "\f2d0";
@fa-var-window-minimize: "\f2d1";
@fa-var-window-restore: "\f2d2";
@fa-var-windows: "\f17a";
@fa-var-won: "\f159";
@fa-var-wordpress: "\f19a";
@fa-var-wpbeginner: "\f297";
@fa-var-wpexplorer: "\f2de";
@fa-var-wpforms: "\f298";
@fa-var-wrench: "\f0ad";
@fa-var-xing: "\f168";

@ -2,7 +2,6 @@
var async = require('async');
var fs = require('fs');
var nconf = require('nconf');
var winston = require('winston');
var db = require('../../database');
@ -158,7 +157,7 @@ editController.uploadPicture = function (req, res, next) {
res.json([{
name: userPhoto.name,
url: image.url.startsWith('http') ? image.url : nconf.get('relative_path') + image.url,
url: image.url,
}]);
});
};

@ -1,23 +1,23 @@
'use strict';
var plugins = require('../../plugins');
var db = require('../../database');
var meta = require('../../meta');
var soundsController = {};
soundsController.get = function (req, res, next) {
db.getObject('settings:sounds', function (err, settings) {
var types = [
'notification',
'chat-incoming',
'chat-outgoing',
];
meta.configs.getFields(types, function (err, settings) {
if (err) {
return next(err);
}
settings = settings || {};
var types = [
'notification',
'chat-incoming',
'chat-outgoing',
];
var output = {};
types.forEach(function (type) {

@ -1,7 +1,6 @@
'use strict';
var async = require('async');
var nconf = require('nconf');
var validator = require('validator');
var meta = require('../meta');
@ -181,7 +180,7 @@ groupsController.uploadCover = function (req, res, next) {
if (err) {
return next(err);
}
res.json([{ url: image.url.startsWith('http') ? image.url : nconf.get('relative_path') + image.url }]);
res.json([{ url: image.url }]);
});
};

@ -96,6 +96,9 @@ module.exports = function (redisClient, module) {
module.deleteObjectField = function (key, field, callback) {
callback = callback || function () {};
if (field === null) {
return setImmediate(callback);
}
redisClient.hdel(key, field, function (err) {
callback(err);
});

@ -9,8 +9,6 @@ var async = require('async');
var file = require('../file');
var plugins = require('../plugins');
var user = require('../user');
var db = require('../database');
var soundsPath = path.join(__dirname, '../../build/public/sounds');
var uploadsPath = path.join(__dirname, '../../public/uploads/sounds');
@ -100,7 +98,7 @@ module.exports = function (Meta) {
Meta.sounds.getUserSoundMap = function getUserSoundMap(uid, callback) {
async.parallel({
defaultMapping: function (next) {
db.getObject('settings:sounds', next);
Meta.configs.getFields(keys, next);
},
userSettings: function (next) {
user.getSettings(uid, next);
@ -121,9 +119,9 @@ module.exports = function (Meta) {
keys.forEach(function (key) {
if (userSettings[key] || userSettings[key] === '') {
soundMapping[key] = userSettings[key] || null;
soundMapping[key] = userSettings[key] || '';
} else {
soundMapping[key] = defaultMapping[key] || null;
soundMapping[key] = defaultMapping[key] || '';
}
});

@ -45,7 +45,11 @@ var Upgrade = {
upgrades: ['global_and_user_language_keys', 'sorted_set_for_pinned_topics'],
},
{
version: 'develop', // rename this to whatever the next NodeBB version is
version: 'master', // rename this to whenever the next NodeBB version is (non-breaking)
upgrades: ['sound_settings'],
},
{
version: 'develop', // rename this to whatever the next NodeBB version is (breaking)
upgrades: ['flags_refactor'],
},
],

@ -0,0 +1,64 @@
/* jslint node: true */
'use strict';
var db = require('../database');
var async = require('async');
module.exports = {
name: 'Update global and user sound settings',
timestamp: Date.UTC(2017, 1, 25),
method: function (callback) {
var user = require('../user');
var meta = require('../meta');
var batch = require('../batch');
var map = {
'notification.mp3': 'Default | Deedle-dum',
'waterdrop-high.mp3': 'Default | Water drop (high)',
'waterdrop-low.mp3': 'Default | Water drop (low)',
};
async.parallel([
function (cb) {
var keys = ['chat-incoming', 'chat-outgoing', 'notification'];
db.getObject('settings:sounds', function (err, settings) {
if (err) {
return cb(err);
}
keys.forEach(function (key) {
if (settings[key] && settings[key].indexOf(' | ') === -1) {
settings[key] = map[settings[key]] || '';
}
});
meta.configs.setMultiple(settings, cb);
});
},
function (cb) {
var keys = ['notificationSound', 'incomingChatSound', 'outgoingChatSound'];
batch.processSortedSet('users:joindate', function (ids, next) {
async.each(ids, function (uid, next) {
user.getSettings(uid, function (err, settings) {
if (err) {
return next(err);
}
keys.forEach(function (key) {
if (settings[key] && settings[key].indexOf(' | ') === -1) {
settings[key] = map[settings[key]] || '';
}
});
user.saveSettings(uid, settings, next);
});
}, next);
}, cb);
},
], callback);
},
};

@ -7,7 +7,7 @@
<label for="notification">[[admin/general/sounds:notifications]]</label>
<div class="row">
<div class="form-group col-xs-9">
<select class="form-control" id="notification" name="notification">
<select class="form-control" id="notification" data-field="notification">
<option value="">[[user:no-sound]]</option>
<!-- BEGIN notification-sound -->
<optgroup label="{notification-sound.name}">
@ -33,7 +33,7 @@
<label for="chat-incoming">[[admin/general/sounds:incoming-message]]</label>
<div class="row">
<div class="form-group col-xs-9">
<select class="form-control" id="chat-incoming" name="chat-incoming">
<select class="form-control" id="chat-incoming" data-field="chat-incoming">
<option value="">[[user:no-sound]]</option>
<!-- BEGIN chat-incoming-sound -->
<optgroup label="{chat-incoming-sound.name}">
@ -54,7 +54,7 @@
<label for="chat-outgoing">[[admin/general/sounds:outgoing-message]]</label>
<div class="row">
<div class="form-group col-xs-9">
<select class="form-control" id="chat-outgoing" name="chat-outgoing">
<select class="form-control" id="chat-outgoing" data-field="chat-outgoing">
<option value="">[[user:no-sound]]</option>
<!-- BEGIN chat-outgoing-sound -->
<optgroup label="{chat-outgoing-sound.name}">

@ -5,6 +5,10 @@
</div>
<div class="row fa-icons">
<i class="fa fa-500px"></i>
<i class="fa fa-address-book"></i>
<i class="fa fa-address-book-o"></i>
<i class="fa fa-address-card"></i>
<i class="fa fa-address-card-o"></i>
<i class="fa fa-adjust"></i>
<i class="fa fa-adn"></i>
<i class="fa fa-align-center"></i>
@ -53,11 +57,15 @@
<i class="fa fa-backward"></i>
<i class="fa fa-balance-scale"></i>
<i class="fa fa-ban"></i>
<i class="fa fa-bandcamp"></i>
<i class="fa fa-bank"></i>
<i class="fa fa-bar-chart"></i>
<i class="fa fa-bar-chart-o"></i>
<i class="fa fa-barcode"></i>
<i class="fa fa-bars"></i>
<i class="fa fa-bath"></i>
<i class="fa fa-bathtub"></i>
<i class="fa fa-battery"></i>
<i class="fa fa-battery-0"></i>
<i class="fa fa-battery-1"></i>
<i class="fa fa-battery-2"></i>
@ -207,19 +215,25 @@
<i class="fa fa-dot-circle-o"></i>
<i class="fa fa-download"></i>
<i class="fa fa-dribbble"></i>
<i class="fa fa-drivers-license"></i>
<i class="fa fa-drivers-license-o"></i>
<i class="fa fa-dropbox"></i>
<i class="fa fa-drupal"></i>
<i class="fa fa-edge"></i>
<i class="fa fa-edit"></i>
<i class="fa fa-eercast"></i>
<i class="fa fa-eject"></i>
<i class="fa fa-ellipsis-h"></i>
<i class="fa fa-ellipsis-v"></i>
<i class="fa fa-empire"></i>
<i class="fa fa-envelope"></i>
<i class="fa fa-envelope-o"></i>
<i class="fa fa-envelope-open"></i>
<i class="fa fa-envelope-open-o"></i>
<i class="fa fa-envelope-square"></i>
<i class="fa fa-envira"></i>
<i class="fa fa-eraser"></i>
<i class="fa fa-etsy"></i>
<i class="fa fa-eur"></i>
<i class="fa fa-euro"></i>
<i class="fa fa-exchange"></i>
@ -287,6 +301,7 @@
<i class="fa fa-forumbee"></i>
<i class="fa fa-forward"></i>
<i class="fa fa-foursquare"></i>
<i class="fa fa-free-code-camp"></i>
<i class="fa fa-frown-o"></i>
<i class="fa fa-futbol-o"></i>
<i class="fa fa-gamepad"></i>
@ -319,6 +334,7 @@
<i class="fa fa-google-wallet"></i>
<i class="fa fa-graduation-cap"></i>
<i class="fa fa-gratipay"></i>
<i class="fa fa-grav"></i>
<i class="fa fa-group"></i>
<i class="fa fa-h-square"></i>
<i class="fa fa-hacker-news"></i>
@ -335,6 +351,7 @@
<i class="fa fa-hand-scissors-o"></i>
<i class="fa fa-hand-spock-o"></i>
<i class="fa fa-hand-stop-o"></i>
<i class="fa fa-handshake-o"></i>
<i class="fa fa-hard-of-hearing"></i>
<i class="fa fa-hashtag"></i>
<i class="fa fa-hdd-o"></i>
@ -358,8 +375,12 @@
<i class="fa fa-houzz"></i>
<i class="fa fa-html5"></i>
<i class="fa fa-i-cursor"></i>
<i class="fa fa-id-badge"></i>
<i class="fa fa-id-card"></i>
<i class="fa fa-id-card-o"></i>
<i class="fa fa-ils"></i>
<i class="fa fa-image"></i>
<i class="fa fa-imdb"></i>
<i class="fa fa-inbox"></i>
<i class="fa fa-indent"></i>
<i class="fa fa-industry"></i>
@ -397,6 +418,7 @@
<i class="fa fa-link"></i>
<i class="fa fa-linkedin"></i>
<i class="fa fa-linkedin-square"></i>
<i class="fa fa-linode"></i>
<i class="fa fa-linux"></i>
<i class="fa fa-list"></i>
<i class="fa fa-list-alt"></i>
@ -429,8 +451,10 @@
<i class="fa fa-meanpath"></i>
<i class="fa fa-medium"></i>
<i class="fa fa-medkit"></i>
<i class="fa fa-meetup"></i>
<i class="fa fa-meh-o"></i>
<i class="fa fa-mercury"></i>
<i class="fa fa-microchip"></i>
<i class="fa fa-microphone"></i>
<i class="fa fa-microphone-slash"></i>
<i class="fa fa-minus"></i>
@ -495,6 +519,7 @@
<i class="fa fa-plus-circle"></i>
<i class="fa fa-plus-square"></i>
<i class="fa fa-plus-square-o"></i>
<i class="fa fa-podcast"></i>
<i class="fa fa-power-off"></i>
<i class="fa fa-print"></i>
<i class="fa fa-product-hunt"></i>
@ -504,10 +529,12 @@
<i class="fa fa-question"></i>
<i class="fa fa-question-circle"></i>
<i class="fa fa-question-circle-o"></i>
<i class="fa fa-quora"></i>
<i class="fa fa-quote-left"></i>
<i class="fa fa-quote-right"></i>
<i class="fa fa-ra"></i>
<i class="fa fa-random"></i>
<i class="fa fa-ravelry"></i>
<i class="fa fa-rebel"></i>
<i class="fa fa-recycle"></i>
<i class="fa fa-reddit"></i>
@ -534,6 +561,7 @@
<i class="fa fa-rub"></i>
<i class="fa fa-ruble"></i>
<i class="fa fa-rupee"></i>
<i class="fa fa-s15"></i>
<i class="fa fa-safari"></i>
<i class="fa fa-save"></i>
<i class="fa fa-scissors"></i>
@ -558,6 +586,7 @@
<i class="fa fa-shopping-bag"></i>
<i class="fa fa-shopping-basket"></i>
<i class="fa fa-shopping-cart"></i>
<i class="fa fa-shower"></i>
<i class="fa fa-sign-in"></i>
<i class="fa fa-sign-language"></i>
<i class="fa fa-sign-out"></i>
@ -574,6 +603,7 @@
<i class="fa fa-snapchat"></i>
<i class="fa fa-snapchat-ghost"></i>
<i class="fa fa-snapchat-square"></i>
<i class="fa fa-snowflake-o"></i>
<i class="fa fa-soccer-ball-o"></i>
<i class="fa fa-sort"></i>
<i class="fa fa-sort-alpha-asc"></i>
@ -619,6 +649,7 @@
<i class="fa fa-subway"></i>
<i class="fa fa-suitcase"></i>
<i class="fa fa-sun-o"></i>
<i class="fa fa-superpowers"></i>
<i class="fa fa-superscript"></i>
<i class="fa fa-support"></i>
<i class="fa fa-table"></i>
@ -628,6 +659,7 @@
<i class="fa fa-tags"></i>
<i class="fa fa-tasks"></i>
<i class="fa fa-taxi"></i>
<i class="fa fa-telegram"></i>
<i class="fa fa-television"></i>
<i class="fa fa-tencent-weibo"></i>
<i class="fa fa-terminal"></i>
@ -637,6 +669,17 @@
<i class="fa fa-th-large"></i>
<i class="fa fa-th-list"></i>
<i class="fa fa-themeisle"></i>
<i class="fa fa-thermometer"></i>
<i class="fa fa-thermometer-0"></i>
<i class="fa fa-thermometer-1"></i>
<i class="fa fa-thermometer-2"></i>
<i class="fa fa-thermometer-3"></i>
<i class="fa fa-thermometer-4"></i>
<i class="fa fa-thermometer-empty"></i>
<i class="fa fa-thermometer-full"></i>
<i class="fa fa-thermometer-half"></i>
<i class="fa fa-thermometer-quarter"></i>
<i class="fa fa-thermometer-three-quarters"></i>
<i class="fa fa-thumb-tack"></i>
<i class="fa fa-thumbs-down"></i>
<i class="fa fa-thumbs-o-down"></i>
@ -646,6 +689,8 @@
<i class="fa fa-times"></i>
<i class="fa fa-times-circle"></i>
<i class="fa fa-times-circle-o"></i>
<i class="fa fa-times-rectangle"></i>
<i class="fa fa-times-rectangle-o"></i>
<i class="fa fa-tint"></i>
<i class="fa fa-toggle-down"></i>
<i class="fa fa-toggle-left"></i>
@ -686,11 +731,16 @@
<i class="fa fa-usb"></i>
<i class="fa fa-usd"></i>
<i class="fa fa-user"></i>
<i class="fa fa-user-circle"></i>
<i class="fa fa-user-circle-o"></i>
<i class="fa fa-user-md"></i>
<i class="fa fa-user-o"></i>
<i class="fa fa-user-plus"></i>
<i class="fa fa-user-secret"></i>
<i class="fa fa-user-times"></i>
<i class="fa fa-users"></i>
<i class="fa fa-vcard"></i>
<i class="fa fa-vcard-o"></i>
<i class="fa fa-venus"></i>
<i class="fa fa-venus-double"></i>
<i class="fa fa-venus-mars"></i>
@ -715,10 +765,16 @@
<i class="fa fa-wheelchair-alt"></i>
<i class="fa fa-wifi"></i>
<i class="fa fa-wikipedia-w"></i>
<i class="fa fa-window-close"></i>
<i class="fa fa-window-close-o"></i>
<i class="fa fa-window-maximize"></i>
<i class="fa fa-window-minimize"></i>
<i class="fa fa-window-restore"></i>
<i class="fa fa-windows"></i>
<i class="fa fa-won"></i>
<i class="fa fa-wordpress"></i>
<i class="fa fa-wpbeginner"></i>
<i class="fa fa-wpexplorer"></i>
<i class="fa fa-wpforms"></i>
<i class="fa fa-wrench"></i>
<i class="fa fa-xing"></i>

@ -79,7 +79,6 @@ module.exports.listen = function (callback) {
};
function initializeNodeBB(callback) {
winston.info('initializing NodeBB ...');
var middleware = require('./middleware');
async.waterfall([

@ -34,64 +34,56 @@ helpers.loginUser = function (username, password, callback) {
if (err || res.statusCode !== 200) {
return callback(err || new Error('[[error:invalid-response]]'));
}
myXhr.callbacks.test2 = function () {
this.setDisableHeaderCheck(true);
var stdOpen = this.open;
this.open = function () {
stdOpen.apply(this, arguments);
this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]);
this.setRequestHeader('Origin', nconf.get('url'));
};
};
var socketClient = require('socket.io-client');
var io = socketClient.connect(nconf.get('url'), { forceNew: true, multiplex: false });
io.on('connect', function () {
callback(null, jar, io, body.csrf_token);
});
io.on('error', function (err) {
callback(err);
helpers.connectSocketIO(res, function (err, io) {
callback(err, jar, io, body.csrf_token);
});
});
});
};
helpers.connectSocketIO = function (res, callback) {
myXhr.callbacks.headerCallback = function () {
this.setDisableHeaderCheck(true);
var stdOpen = this.open;
this.open = function () {
stdOpen.apply(this, arguments);
this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]);
this.setRequestHeader('Origin', nconf.get('url'));
};
};
var socketClient = require('socket.io-client');
var io = socketClient.connect(nconf.get('base_url'), {
path: nconf.get('relative_path') + '/socket.io',
forceNew: true,
multiplex: false,
});
io.on('connect', function () {
callback(null, io);
});
io.on('error', function (err) {
callback(err);
});
};
helpers.initSocketIO = function (callback) {
var jar;
request.get({
url: nconf.get('url') + '/api/config',
jar: jar,
json: true,
}, function (err, res, body) {
}, function (err, res) {
if (err) {
return callback(err);
}
myXhr.callbacks.test2 = function () {
this.setDisableHeaderCheck(true);
var stdOpen = this.open;
this.open = function () {
stdOpen.apply(this, arguments);
this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]);
this.setRequestHeader('Origin', nconf.get('url'));
};
};
var io = require('socket.io-client')(nconf.get('url'), { forceNew: true });
io.on('connect', function () {
callback(null, jar, io);
});
io.on('error', function (err) {
callback(err);
helpers.connectSocketIO(res, function (err, io) {
callback(err, jar, io);
});
});
};
helpers.uploadFile = function (uploadEndPoint, filePath, body, jar, csrf_token, callback) {
var formData = {
files: [
@ -134,12 +126,8 @@ helpers.registerUser = function (data, callback) {
headers: {
'x-csrf-token': body.csrf_token,
},
}, function (err, res, body) {
if (err) {
return callback(err);
}
callback(null, jar);
}, function (err) {
callback(err, jar);
});
});
};

@ -12,11 +12,10 @@ var request = require('request');
var cookies = request.jar();
var db = require('./mocks/databasemock');
var myXhr = require('./mocks/newXhr');
var user = require('../src/user');
var groups = require('../src/groups');
var categories = require('../src/categories');
var helpers = require('./helpers');
describe('socket.io', function () {
var io;
@ -64,26 +63,12 @@ describe('socket.io', function () {
'x-csrf-token': body.csrf_token,
},
json: true,
}, function (err, res, body) {
}, function (err, res) {
assert.ifError(err);
myXhr.callbacks.test2 = function () {
this.setDisableHeaderCheck(true);
var stdOpen = this.open;
this.open = function () {
stdOpen.apply(this, arguments);
this.setRequestHeader('Cookie', res.headers['set-cookie'][0].split(';')[0]);
this.setRequestHeader('Origin', nconf.get('url'));
};
};
io = require('socket.io-client')(nconf.get('url'), { forceNew: true });
io.on('connect', function () {
done();
});
io.on('error', function (err) {
helpers.connectSocketIO(res, function (err, _io) {
io = _io;
assert.ifError(err);
done(err);
});
});

@ -1,6 +1,6 @@
'use strict';
var async = require('async');
var nconf = require('nconf');
var assert = require('assert');
var db = require('./mocks/databasemock');
@ -13,7 +13,6 @@ describe('helpers', function () {
done();
});
it('should return false if route is /users and privateUserInfo is on and user is not logged in', function (done) {
var flag = helpers.displayMenuItem({
navigation: [{ route: '/users' }],
@ -49,4 +48,186 @@ describe('helpers', function () {
assert.equal(str, 'gdkfhgk &lt; some &gt; and &amp;');
done();
});
it('should return empty string if category is falsy', function (done) {
assert.equal(helpers.generateCategoryBackground(null), '');
done();
});
it('should generate category background', function (done) {
var category = {
bgColor: '#ff0000',
color: '#00ff00',
backgroundImage: '/assets/uploads/image.png',
imageClass: 'auto',
};
var bg = helpers.generateCategoryBackground(category);
assert.equal(bg, 'background-color: #ff0000; color: #00ff00; background-image: url(/assets/uploads/image.png); background-size: auto;');
done();
});
it('should return empty string if category has no children', function (done) {
var category = {
children: [],
};
var bg = helpers.generateChildrenCategories(category);
assert.equal(bg, '');
done();
});
it('should generate html for children', function (done) {
var category = {
children: [
{
link: '',
bgColor: '#ff0000',
color: '#00ff00',
name: 'children',
},
],
};
var html = helpers.generateChildrenCategories(category);
assert.equal(html, '<span class="category-children"><a href="' + nconf.get('relative_path') + '/category/undefined"><span class="fa-stack fa-lg"><i style="color:#ff0000;" class="fa fa-circle fa-stack-2x"></i><i style="color:#00ff00;" class="fa fa-stack-1x undefined"></i></span><small>children</small></a> </span>');
done();
});
it('should generate topic class', function (done) {
var className = helpers.generateTopicClass({ locked: true, pinned: true, deleted: true, unread: true });
assert.equal(className, 'locked pinned deleted unread');
done();
});
it('should show leave button if isMember and group is not administrators', function (done) {
var btn = helpers.membershipBtn({ displayName: 'some group', name: 'some group', isMember: true });
assert.equal(btn, '<button class="btn btn-danger" data-action="leave" data-group="some group"><i class="fa fa-times"></i> [[groups:membership.leave-group]]</button>');
done();
});
it('should show pending button if isPending and group is not administrators', function (done) {
var btn = helpers.membershipBtn({ displayName: 'some group', name: 'some group', isPending: true });
assert.equal(btn, '<button class="btn btn-warning disabled"><i class="fa fa-clock-o"></i> [[groups:membership.invitation-pending]]</button>');
done();
});
it('should show reject invite button if isInvited', function (done) {
var btn = helpers.membershipBtn({ displayName: 'some group', name: 'some group', isInvited: true });
assert.equal(btn, '<button class="btn btn-link" data-action="rejectInvite" data-group="some group">[[groups:membership.reject]]</button><button class="btn btn-success" data-action="acceptInvite" data-group="some group"><i class="fa fa-plus"></i> [[groups:membership.accept-invitation]]</button>');
done();
});
it('should show join button if join requests are not disabled and group is not administrators', function (done) {
var btn = helpers.membershipBtn({ displayName: 'some group', name: 'some group', disableJoinRequests: false });
assert.equal(btn, '<button class="btn btn-success" data-action="join" data-group="some group"><i class="fa fa-plus"></i> [[groups:membership.join-group]]</button>');
done();
});
it('should show nothing if group is administrators ', function (done) {
var btn = helpers.membershipBtn({ displayName: 'administrators', name: 'administrators' });
assert.equal(btn, '');
done();
});
it('should spawn privilege states', function (done) {
var privs = {
find: true,
read: true,
};
var html = helpers.spawnPrivilegeStates('guests', privs);
assert.equal(html, '<td class="text-center" data-privilege="find"><input type="checkbox" checked /></td><td class="text-center" data-privilege="read"><input type="checkbox" checked /></td>');
done();
});
it('should spawn privilege states', function (done) {
var privs = {
find: true,
read: true,
};
var html = helpers.spawnPrivilegeStates('guests', privs);
assert.equal(html, '<td class="text-center" data-privilege="find"><input type="checkbox" checked /></td><td class="text-center" data-privilege="read"><input type="checkbox" checked /></td>');
done();
});
it('should render thumb as topic image', function (done) {
var topicObj = { thumb: '/uploads/1.png', user: { username: 'baris' } };
var html = helpers.renderTopicImage(topicObj);
assert.equal(html, '<img src="' + topicObj.thumb + '" class="img-circle user-img" title="' + topicObj.user.username + '" />');
done();
});
it('should render user picture as topic image', function (done) {
var topicObj = { thumb: '', user: { uid: 1, username: 'baris', picture: '/uploads/2.png' } };
var html = helpers.renderTopicImage(topicObj);
assert.equal(html, '<img component="user/picture" data-uid="' + topicObj.user.uid + '" src="' + topicObj.user.picture + '" class="user-img" title="' + topicObj.user.username + '" />');
done();
});
it('should render digest avatar', function (done) {
var block = { teaser: { user: { username: 'baris', picture: '/uploads/1.png' } } };
var html = helpers.renderDigestAvatar(block);
assert.equal(html, '<img style="vertical-align: middle; width: 16px; height: 16px; padding-right: 1em;" src="' + block.teaser.user.picture + '" title="' + block.teaser.user.username + '" />');
done();
});
it('should render digest avatar', function (done) {
var block = { teaser: { user: { username: 'baris', 'icon:text': 'B', 'icon:bgColor': '#ff000' } } };
var html = helpers.renderDigestAvatar(block);
assert.equal(html, '<div style="width: 16px; height: 16px; line-height: 16px; font-size: 10px; margin-right: 1em; background-color: ' + block.teaser.user['icon:bgColor'] + '; color: white; text-align: center; display: inline-block;">' + block.teaser.user['icon:text'] + '</div>');
done();
});
it('should render digest avatar', function (done) {
var block = { user: { username: 'baris', picture: '/uploads/1.png' } };
var html = helpers.renderDigestAvatar(block);
assert.equal(html, '<img style="vertical-align: middle; width: 16px; height: 16px; padding-right: 1em;" src="' + block.user.picture + '" title="' + block.user.username + '" />');
done();
});
it('should render digest avatar', function (done) {
var block = { user: { username: 'baris', 'icon:text': 'B', 'icon:bgColor': '#ff000' } };
var html = helpers.renderDigestAvatar(block);
assert.equal(html, '<div style="width: 16px; height: 16px; line-height: 16px; font-size: 10px; margin-right: 1em; background-color: ' + block.user['icon:bgColor'] + '; color: white; text-align: center; display: inline-block;">' + block.user['icon:text'] + '</div>');
done();
});
it('shoud render user agent/browser icons', function (done) {
var html = helpers.userAgentIcons({ platform: 'Linux', browser: 'Chrome' });
assert.equal(html, '<i class="fa fa-fw fa-linux"></i><i class="fa fa-fw fa-chrome"></i>');
done();
});
it('shoud render user agent/browser icons', function (done) {
var html = helpers.userAgentIcons({ platform: 'Microsoft Windows', browser: 'Firefox' });
assert.equal(html, '<i class="fa fa-fw fa-windows"></i><i class="fa fa-fw fa-firefox"></i>');
done();
});
it('shoud render user agent/browser icons', function (done) {
var html = helpers.userAgentIcons({ platform: 'Apple Mac', browser: 'Safari' });
assert.equal(html, '<i class="fa fa-fw fa-apple"></i><i class="fa fa-fw fa-safari"></i>');
done();
});
it('shoud render user agent/browser icons', function (done) {
var html = helpers.userAgentIcons({ platform: 'Android', browser: 'IE' });
assert.equal(html, '<i class="fa fa-fw fa-android"></i><i class="fa fa-fw fa-internet-explorer"></i>');
done();
});
it('shoud render user agent/browser icons', function (done) {
var html = helpers.userAgentIcons({ platform: 'iPad', browser: 'Edge' });
assert.equal(html, '<i class="fa fa-fw fa-tablet"></i><i class="fa fa-fw fa-edge"></i>');
done();
});
it('shoud render user agent/browser icons', function (done) {
var html = helpers.userAgentIcons({ platform: 'iPhone', browser: 'unknow' });
assert.equal(html, '<i class="fa fa-fw fa-mobile"></i><i class="fa fa-fw fa-question-circle"></i>');
done();
});
it('shoud render user agent/browser icons', function (done) {
var html = helpers.userAgentIcons({ platform: 'unknow', browser: 'unknown' });
assert.equal(html, '<i class="fa fa-fw fa-question-circle"></i><i class="fa fa-fw fa-question-circle"></i>');
done();
});
});

@ -71,7 +71,7 @@ describe('Upload Controllers', function () {
assert.equal(res.statusCode, 200);
assert(Array.isArray(body));
assert.equal(body.length, 1);
assert.equal(body[0].url, '/assets/uploads/profile/' + regularUid + '-profileavatar.png');
assert.equal(body[0].url, nconf.get('relative_path') + '/assets/uploads/profile/' + regularUid + '-profileavatar.png');
done();
});
});
@ -165,7 +165,7 @@ describe('Upload Controllers', function () {
assert.ifError(err);
assert.equal(res.statusCode, 200);
assert(Array.isArray(body));
assert.equal(body[0].url, '/assets/uploads/system/site-logo.png');
assert.equal(body[0].url, nconf.get('relative_path') + '/assets/uploads/system/site-logo.png');
done();
});
});
@ -175,7 +175,7 @@ describe('Upload Controllers', function () {
assert.ifError(err);
assert.equal(res.statusCode, 200);
assert(Array.isArray(body));
assert.equal(body[0].url, '/assets/uploads/category/category-1.png');
assert.equal(body[0].url, nconf.get('relative_path') + '/assets/uploads/category/category-1.png');
done();
});
});

@ -522,7 +522,7 @@ describe('User', function () {
};
User.uploadPicture(uid, picture, function (err, uploadedPicture) {
assert.ifError(err);
assert.equal(uploadedPicture.url, '/assets/uploads/profile/' + uid + '-profileavatar.png');
assert.equal(uploadedPicture.url, nconf.get('relative_path') + '/assets/uploads/profile/' + uid + '-profileavatar.png');
assert.equal(uploadedPicture.path, path.join(nconf.get('base_dir'), 'public', 'uploads', 'profile', uid + '-profileavatar.png'));
done();
});

Loading…
Cancel
Save