Resolve merge conflicts, minify only .js files

This commit is contained in:
Peter Jaszkowiak
2017-02-23 18:31:49 -07:00
99 changed files with 4500 additions and 1751 deletions

View File

@@ -30,6 +30,14 @@ dashboardController.get = function (req, res, next) {
link: '/admin/extend/plugins',
},
];
if (global.env !== 'production') {
notices.push({
done: false,
notDoneText: '[[admin/general/dashboard:running-in-development]]',
});
}
plugins.fireHook('filter:admin.notices', notices, next);
},
}, function (err, results) {

View File

@@ -1,24 +1,46 @@
'use strict';
var meta = require('../../meta');
var plugins = require('../../plugins');
var db = require('../../database');
var soundsController = {};
soundsController.get = function (req, res, next) {
meta.sounds.getFiles(function (err, sounds) {
db.getObject('settings:sounds', function (err, settings) {
if (err) {
return next(err);
}
sounds = Object.keys(sounds).map(function (name) {
return {
name: name,
};
settings = settings || {};
var types = [
'notification',
'chat-incoming',
'chat-outgoing',
];
var output = {};
types.forEach(function (type) {
var soundpacks = plugins.soundpacks.map(function (pack) {
var sounds = Object.keys(pack.sounds).map(function (soundName) {
var value = pack.name + ' | ' + soundName;
return {
name: soundName,
value: value,
selected: value === settings[type],
};
});
return {
name: pack.name,
sounds: sounds,
};
});
output[type + '-sound'] = soundpacks;
});
res.render('admin/general/sounds', {
sounds: sounds,
});
res.render('admin/general/sounds', output);
});
};

View File

@@ -5,6 +5,8 @@ var path = require('path');
var async = require('async');
var nconf = require('nconf');
var winston = require('winston');
var meta = require('../../meta');
var file = require('../../file');
var image = require('../../image');
var plugins = require('../../plugins');
@@ -105,12 +107,7 @@ uploadsController.uploadSound = function (req, res, next) {
return next(err);
}
var soundsPath = path.join(__dirname, '../../../build/public/sounds');
var filePath = path.join(nconf.get('upload_path'), 'sounds', uploadedFile.name);
file.link(filePath, path.join(soundsPath, path.basename(filePath)));
fs.unlink(uploadedFile.path, function (err) {
meta.sounds.build(function (err) {
if (err) {
return next(err);
}