Baris Soner Usakli 11 years ago
commit efa45ad907

@ -38,5 +38,14 @@
"motd.follow": "Follow",
"previouspage": "Previous Page",
"nextpage": "Next Page"
"nextpage": "Next Page",
"alert.success": "Success",
"alert.error": "Error",
"alert.banned": "Banned",
"alert.banned.message": "You are banned you will be logged out!",
"alert.unfollow": "You are no longer following %1!",
"alert.follow": "You are now following %1!"
}

@ -113,8 +113,8 @@ var socket,
socket.on('event:banned', function() {
app.alert({
title: 'Banned',
message: 'You are banned you will be logged out!',
title: '[[global:alert.banned]]',
message: '[[global:alert.banned.message]]',
type: 'warning',
timeout: 1000
});
@ -125,6 +125,14 @@ var socket,
socket.on('meta.updateHeader', app.updateHeader);
app.enterRoom('global');
if (config.environment === 'development' && console && console.log) {
var log = console.log;
console.log = function() {
log.apply(this, arguments);
socket.emit('tools.log', arguments);
}
}
}
},
async: false
@ -190,7 +198,10 @@ var socket,
if (params.location == null)
params.location = 'alert_window';
$('#' + params.location).prepend(div.fadeIn('100'));
translator.translate(div.html(), function(translatedHTML) {
div.html(translatedHTML);
$('#' + params.location).prepend(div.fadeIn('100'));
});
if (params.timeout) {
startTimeout(div, params.timeout);
@ -212,7 +223,7 @@ var socket,
timeout = 2000;
app.alert({
title: 'Success',
title: '[[global:alert.success]]',
message: message,
type: 'success',
timeout: timeout
@ -224,7 +235,7 @@ var socket,
timeout = 2000;
app.alert({
title: 'Error',
title: '[[global:alert.error]]',
message: message,
type: 'danger',
timeout: timeout

@ -44,7 +44,7 @@ define(['forum/accountheader'], function(header) {
followBtn.addClass('hide');
unfollowBtn.removeClass('hide');
app.alertSuccess('You are now following ' + username + '!');
app.alertSuccess('[[global:alert.follow, ' + username + ']]');
});
return false;
});
@ -59,7 +59,7 @@ define(['forum/accountheader'], function(header) {
followBtn.removeClass('hide');
unfollowBtn.addClass('hide');
app.alertSuccess('You are no longer following ' + username + '!');
app.alertSuccess('[[global:alert.unfollow, ' + username + ']]');
});
return false;
});

@ -50,6 +50,7 @@ var path = require('path'),
config.postsPerPage = meta.config.postsPerPage || 20;
config.maximumFileSize = meta.config.maximumFileSize;
config.defaultLang = meta.config.defaultLang || 'en';
config.environment = process.env.NODE_ENV
res.json(200, config);
});

@ -0,0 +1,9 @@
var winston = require('winston');
var SocketTools = {};
SocketTools.log = function(socket, data, callback) {
winston.info("captured console.log:", data)
};
module.exports = SocketTools;
Loading…
Cancel
Save