mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-17 18:10:42 +01:00
Merge remote-tracking branch 'origin/master' into composer-revamp
This commit is contained in:
@@ -41,6 +41,17 @@ define(['forum/accountheader', 'uploader'], function(header, uploader) {
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
function getSignatureCharsLeft() {
|
||||
return '(' + $('#inputSignature').val().length + '/' + config.maximumSignatureLength + ')';
|
||||
}
|
||||
|
||||
$('#signatureCharCountLeft').html(getSignatureCharsLeft());
|
||||
|
||||
$('#inputSignature').on('keyup change', function(ev) {
|
||||
$('#signatureCharCountLeft').html(getSignatureCharsLeft());
|
||||
});
|
||||
|
||||
$('#changePictureBtn').on('click', function() {
|
||||
selectedImageType = '';
|
||||
AccountEdit.updateImages();
|
||||
|
||||
@@ -84,9 +84,9 @@
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="inputSignature">[[user:signature]]</label>
|
||||
<label class="control-label" for="inputSignature">[[user:signature]]</label> <small><label id="signatureCharCountLeft"></label></small>
|
||||
<div class="controls">
|
||||
<textarea class="form-control" id="inputSignature" placeholder="max 150 chars" rows="5">{signature}</textarea>
|
||||
<textarea class="form-control" id="inputSignature" rows="5">{signature}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@
|
||||
<input type="text" class="form-control" value="16" data-field="maximumUsernameLength"><br />
|
||||
<strong>Minimum Password Length</strong><br />
|
||||
<input type="text" class="form-control" value="6" data-field="minimumPasswordLength"><br />
|
||||
<strong>Maximum Signature Length</strong><br />
|
||||
<input type="text" class="form-control" value="255" data-field="maximumSignatureLength"><br />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -220,6 +220,9 @@ var async = require('async'),
|
||||
}, {
|
||||
field: 'imgurClientID',
|
||||
value: ''
|
||||
}, {
|
||||
field: 'maximumSignatureLength',
|
||||
value: 255
|
||||
}, {
|
||||
field: 'maximumProfileImageSize',
|
||||
value: 256
|
||||
|
||||
@@ -274,10 +274,17 @@ var fs = require('fs'),
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(active) {
|
||||
Plugins.fireHook('action:plugin.deactivate', id);
|
||||
}
|
||||
|
||||
// Reload meta data
|
||||
Plugins.reload(function() {
|
||||
// (De)activation Hooks
|
||||
Plugins.fireHook('action:plugin.' + (active ? 'de' : '') + 'activate', id);
|
||||
|
||||
if(!active) {
|
||||
Plugins.fireHook('action:plugin.activate', id);
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback({
|
||||
|
||||
@@ -34,6 +34,7 @@ var path = require('path'),
|
||||
config.minimumUsernameLength = meta.config.minimumUsernameLength;
|
||||
config.maximumUsernameLength = meta.config.maximumUsernameLength;
|
||||
config.minimumPasswordLength = meta.config.minimumPasswordLength;
|
||||
config.maximumSignatureLength = meta.config.maximumSignatureLength;
|
||||
config.useOutgoingLinksPage = meta.config.useOutgoingLinksPage;
|
||||
config.emailSetup = !!meta.config['email:from'];
|
||||
|
||||
@@ -149,11 +150,11 @@ var path = require('path'),
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}, req.params.id, uid);
|
||||
}, req.params.id, uid);
|
||||
} else {
|
||||
res.send(403);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
} else {
|
||||
res.send(403);
|
||||
|
||||
@@ -190,9 +190,9 @@ var bcrypt = require('bcrypt'),
|
||||
};
|
||||
|
||||
function isSignatureValid(next) {
|
||||
if (data.signature !== undefined && data.signature.length > 150) {
|
||||
if (data.signature !== undefined && data.signature.length > meta.config.maximumSignatureLength) {
|
||||
next({
|
||||
error: 'Signature can\'t be longer than 150 characters!'
|
||||
error: 'Signature can\'t be longer than ' + meta.config.maximumSignatureLength + ' characters!'
|
||||
}, false);
|
||||
} else {
|
||||
next(null, true);
|
||||
|
||||
@@ -593,7 +593,9 @@ websockets.init = function(io) {
|
||||
|
||||
socket.on('api:categories.get', function(callback) {
|
||||
categories.getAllCategories(0, function(err, categories) {
|
||||
callback(categories);
|
||||
if(callback) {
|
||||
callback(categories);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1095,7 +1097,7 @@ websockets.init = function(io) {
|
||||
groups.leaveByGroupName('cid:' + cid + ':privileges:' + privilege, gid, cb);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
socket.on('api:admin.categories.groupsearch', function(cid, callback) {
|
||||
groups.list({expand:false}, function(err, data){
|
||||
async.map(data, function(groupObj, next) {
|
||||
@@ -1111,7 +1113,7 @@ websockets.init = function(io) {
|
||||
}, function(err, data) {
|
||||
if (!callback) socket.emit('api:admin.categories.groupsearch', data);
|
||||
else callback(null, data);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user